gametechmods
Robot Arena => Modifications => Topic started by: apanx on September 29, 2016, 10:18:31 AM
-
So, when is it true?
-
I'm pretty sure it is always false. The devs probably have a boolean in the EXE that they manually set during development. You may be able to enable it using sergepatcher. I usually just create my own boolean for turning on the debug code.
-
well there goes trov's quarterly post.
-
So, when is it true?
Never. It will always return None.
.text:004BC585 push offset aIsdebugmode ; "isDebugMode"
.text:004BC58A push offset py_isDebugMode
.text:004BC58F mov ecx, esi
.text:004BC591 call sub_4BDF80
[...]
.text:004B9BF0 py_isDebugMode proc near ; CODE XREF: sub_57C000+9Cp
.text:004B9BF0 ; DATA XREF: sub_4BBA00+B8Ao ...
.text:004B9BF0 xor al, al
.text:004B9BF2 retn
.text:004B9BF2 py_isDebugMode endp
-
Thanks Serge
Patched it statically to
.text:004B9BF0 or al, al
Now it returns true
Big meh, just crashes the game when trying to play. I suppose it needs extra coding from debug-build to work properly.
https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=288
OffTopic: Also patched in 16-point chassis limit removal statically based on offsets in SergePatcher, can put it up on GTM for you.
-
Thanks Serge
Patched it statically to
.text:004B9BF0 or al, al
Now it returns true
Big meh, just crashes the game when trying to play. I suppose it needs extra coding from debug-build to work properly.
https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=288
OffTopic: Also patched in 16-point chassis limit removal statically based on offsets in SergePatcher, can put it up on GTM for you.
The reason it doesn't work is because this function returns a PyObject *, so it should return the global Py_True or another truthy object. Returning a C NULL for None only works because of the way the C API parses a NULL that way. Everything else (including an 0x00000001-FF) will get parsed as a PyObject*, so in the case of an invalid pointer (like 0x1) will crash on dereferencing.