The old code based the data pointer used for data relocations off the buffer passed by the application. This is incorrect - the old data segment offset needs to be based upon the start of the CRO file. As a result, data relocations were written to the wrong addresses, potentially causing a crash.
Fixes the NULL pointer crash in ORAS. It likely fixes other crashes in games that use CROs, but this PR needs more testing.
The old code based the data pointer used for data relocations off the buffer passed by the application. This is incorrect - the old data segment offset needs to be based upon the start of the CRO file. As a result, data relocations were written to the wrong addresses, potentially causing a crash.
Fixes the NULL pointer crash in ORAS. It likely fixes other crashes in games that use CROs, but this PR needs more testing.