Are you sure there isn't a hole in the housing where you can jam about a 3" piece of firewood?
Then you need a large 1" drive socket, about 1 3/8", if I recall correctly. A 4' piece of sturdy pipe is an essential implement. Put it over the breaker bar and apply lots of pressure to remove the right-hand-drive nut.
The first few times I did this I crawled underneath to turn the nut off. It's much better to hang the mower on edge from a loader or chain block. It saves effort and attacks of claustrophobia. Just make sure the thing is solidly attached to the ground and the chain before you start to twist. Assume that you'll need to apply enough force to that cheater bar that the nut will be too hot to touch when it comes loose.
To free the blades from the shaft you'll likely need to put the bolt back on to where the top is flush with the shaft. Drive wooden wedges between the stump jumper, the blade, (or whatever looks solid) and the body of the mower. Hit the nut/shaft sharply with a sledge hammer until the blade assembly pops free.
The PTO shaft won't come off the gearbox because it's held in place by a large C-clip which must be removed. Don't lose it.
Which way do the bolts go? When the new gearbox goes on, think about what will happen if one of those four nuts comes loose. How will you know? You may decide to put the nuts on top even if the nuts were likely underneath the body on the one you took off. Tighten them regularly.