Coding Questions and other Quandaries
#18
That makes much more sense. I can't think of a reason why a game would constantly re-locate a module/object-file/elf while the game is running.

So the sources I included are not needed, but I'll probably end up trying them with being modified for an MKW code just because. Anyway, you will need the F6 Codetype. The address of where the Health is at is not a concern. Only the addresses where the stw instruction could reside at is what we need.

F60000nn 80E080FF
zzzzzzzz zzzzzzzz
D20000xx 00000002
386000C8 907D0014
60000000 00000000
E0000000 80008000

The unique hex string is a list of compiled executable instructions (mem80) that includes your compiled default instruction (907D0014) ,or is nearby the default instruction.

Obviously I don't have the game in front of me but lets pretend that a li r0, 0x500 instruction is right after your default instruction in memory. So that's a compiled hex string of 907D0014 38000500. As long as that specific string is unique in Memory, it can be used. Since that would only take 1 line/row in a compiled gecko code, the nn value for the F6 Code is 01. The string just mentioned is the z value. The xx is the offset relative to the saved pointer, it will be 00 in this case since the Default Instruction is the very first item of the unique string.

F6000001 80E080FF #Example unique string takes up 1 row/line. Search from 0x80E00000 thru 0x80FF0000
907D0014 38000500 #Example unique string to look for
D2000000 00000002 #Insert ASM at pointer (zero offset); D2 = Codetype for Pointer ASM
386000C8 907D0014 #ASM code (li r3, 0xC8; stw r3, 0x0014 (r29)
60000000 00000000 #End of ASM code
E0000000 80008000 #End if (final terminator)

The only issue is that this F6 code will execute immediately upon boot and fail because the relocatable elf hasn't been loaded into memory yet. So for initial testing just to get this working you will need to slap on a button activator. If you don't have those for your game, I can help you find them in Memory. Idk much about your game, is there a screen where you select New vs Saved Game? If so, you would want to press your activator after that screen.

The way the code is, the Health cheat will effect everyone, but let's just get this working first before fixing the minor quirks.
Reply


Messages In This Thread
RE: Coding Questions and other Quandaries - by Vega - 12-09-2021, 04:00 AM

Forum Jump:


Users browsing this thread: 38 Guest(s)