AssaultCubeHack icon indicating copy to clipboard operation
AssaultCubeHack copied to clipboard

32-bit build crash

Open 0xDE57 opened this issue 7 years ago • 3 comments

When building in release mode, ReadProcessMemory() or GCHandle.Alloc() cause an AccessViolationException

Debug build works fine. Only happens in release. Strange....

0xDE57 avatar Feb 10 '19 00:02 0xDE57

Perhaps those kernel calls need admin access? Try running the prod exe under admin privs.

striderwhite avatar Feb 12 '19 05:02 striderwhite

Ah, so it's not release mode or privileges, but platform. I had my debug build set to 'Any CPU' (which defaulted to x64), and Release build set to 'x86'. When I set it to x64 / Any CPU it runs fines.

So it only works in 64-bit build. 32-bit is broken.

My best guess at this moment is there is a size mismatch somewhere. Something is trying to read/write a 64-bit address into a 32-bits, or vice versa. Probably the IntPtr or Marshal, maybe buffer size. Will look into more later.

0xDE57 avatar Feb 16 '19 03:02 0xDE57

Perhaps some of the P/invoke calls are only for x64 definitions and need separate wrappings per cpu build.

striderwhite avatar Feb 16 '19 08:02 striderwhite