thpatch / thcrap

Touhou Community Reliant Automatic Patcher
https://www.thpatch.net
The Unlicense
558 stars 41 forks source link

Let codecaves refer to each other #126

Closed ExpHP closed 4 years ago

ExpHP commented 4 years ago

Fixes usage of [codecave:foo] inside another codecave.

(unfortunately, there seems to be another bug somewhere with addresses like [Rx424ab3] that prevents me from testing this as well as I would like to. But that bug exists even without this modification, so 🤷‍♂)

Also fixes the first loop to read the correct JSON layout so that it allocates the right size. (previously this was probably only working because VirtualAlloc always allocates at least one page)