ACS interpreter assumes little endian, not good for non-x86 (p_acs.cpp)
I'll keep this short, the entirety of the ACS code located within p_acs.cpp must be rewritten or have its problems corrected, whichever might be easier. This is on PowerPC systems, but this WILL affect all other big endian systems and other systems with alignment requirements where the compiler is too dumb to do slower unaligned reads.
Scripts = object + ((DWORD *)object);
NumScripts = ((DWORD *)Scripts);
The problems with the code:
* Assumes the de-referenced DWORDs are of the same byte order, which they are not (they are in little endian).
* Assumes that the addresses are aligned, which they might not always be.
* int is used in some cases, which might not always be 32-bit.
Stuff to be cautious about:
* DWORD better be uint32_t or int32_t
These problems are littered all over the entire file.
Thank you for your report. I have updated the summary to better reflect the nature of the issue.
Reduced to trivial