maybe I'd be better at getting back into my reverse engineering projects if getting back into them didn't involve first figuring out which of the 13 Ghidra versions I have installed is for that project
-
@foone is it using useless_boolean to check if the loop is run at all?
-
and that first bit of code is at 0x70, which is a multiple of 4, so 0x70+4 just equals 0x74.
but the second time, it's at 0x79!
so 0x79+4 is is 0x7D: but that turns into 0x7C when we apply the AND. -
so this is a bytecode that has variable padding in order to align to 4 bytes. ugh.
-
@nickzoic useless_boolean is never checked at any point
-
oh, I think I've got what EnterFrame is: It's a way to easily shove multiple typed variables onto the stack, so the function/script can use them.
and it's doing a fixup to know what the types are, since they're declared in the relocation header
-
yeah, it ends up looking like:
pvm_EnterFrame int, int, bool, GuiAnim
-
Ron Gilbert #KamalaHarrisreplied to Foone🏳️⚧️ last edited by
-
okay now I have a disassembler that can only disassemble the relocatable instructions (and can't fully do one of them, because it's complicated)
I now need to add the ones that don't relocate, which is a separate headache
-
Foone🏳️⚧️replied to Ron Gilbert #KamalaHarris last edited by
@grumpygamer @nickzoic it sure should, but since I'm looking at disassembly here... it didn't!
-
ugh. apparently EnterFrame also adds a frame pointer (somewhere) and then the pvm_PushLocal operates off it.
-
Food $200
Data $150
Rent $800
Stacks $3,600
Utility $150
someone who is good at interpreters please help me budget this. my scripting language is dying -
@foone reduce your stacks usage
-
@0xSim no
-
anyway I'm now at the point where I've written enough of a disassembler that I need to basically throw it away and make this thing better and more systematic, so I can eventually have it give me real source files (not log output) and even further on, so I can round-trip it and re-compile these scripts
-
@foone useless_boolean will detect if the for loop never ran at all, because of the stop requirement.
-
@RueNahcMohr useless_boolean is actually never read by any code. thus the "useless"
-
@foone .....huh, ok, maybe the author didn't turn out to actually need it in the end???
-
@RueNahcMohr yeah! and apparently their compiler didn't warn them about this. or they didn't care
-
@foone Various Amiga formats would do that as a plain 68000 won't do misaligned memory accesses. Your mention of 24-bit addresses also makes me think of the 68000. But then you say the game is 14 years old, and 2010 is a tad late for m68k hardware…
-
Riley S. Faelanreplied to Foone🏳️⚧️ last edited by [email protected]
@foone This is relatively common, because a bunch of old (mostly, pre-C) machines used to be word-addressable, not byte-addressable. Even nowadays, with byte addressability the universal norm, there's RISC systems that throw an exception if you try to access a non-aligned multibyte value. DVI does 4-byte padding in a couple of places, for an example; IIRC, its first implementation was on a machine whose memory comprised of 36-bit words, four bytes per word.