lastbattle / Harepacker-resurrected

All in one .wz file/map editor for MapleStory game files
Mozilla Public License 2.0
426 stars 159 forks source link

allow 64 bit addresses in SharpApngBasicWrapper Marshalling #121

Closed Piezoelectric closed 3 years ago

Piezoelectric commented 3 years ago

Fixes the issue mentioned here, encountered while exporting animations: https://github.com/lastbattle/Harepacker-resurrected/issues/78#issuecomment-853157170

Uses the fix mentioned here: https://stackoverflow.com/a/36480919

The error is caused by your code running in a 64 bit context and returning a pointer address that lies outside the range addressable with 32 bits, so .ToInt32() throws.

Call Environment.Is64BitProcess to detect whether your process is running in 32 or 64 bit, and convert the address accordingly.

Note that I didn't regression-test this, nor did I find a test suite; it's up to the maintainer to test this out.

lastbattle commented 3 years ago

Thanks for the fix!