Describe the bug Method Decompress() at ARM9.java does this:
public static byte[] Decompress(byte[] Data, int _start_ModuleParamsOffset)
{
if (IOUtil.ReadU32LE(Data, _start_ModuleParamsOffset + 0x14) == 0)
return Data;//Not Compressed!
byte[] Result = CRT0.MIi_UncompressBackward(Data);
IOUtil.WriteU32LE(Result, _start_ModuleParamsOffset + 0x14, 0); //sets 4 bytes to 0x0
return Result;
}
Instead of using ReadU32LE, we can access the corresponding field of the object ModuleParams (CRT0.java). I believe the field is public int CompressedStaticEnd; though I haven't properly checked it or if it is at ModuleParamsOffset + 0x14 but it is the only field that makes sense.