Can't figure out how to get this damn ghidra extension to work. I have so many versions of ghidra and still, nope.
Can't figure out how to get this damn ghidra extension to work. I have so many versions of ghidra and still, nope.
oh this is a weird thing I didn't know existed.
you embed an int3 in your code, then a short JMP, and the ASCII characters "WVIDEO".
If the ASCII code is found, it ends up outputting a debug string in the Watcom debugger.
correction: that's now 100%
it definitely does.
my wizards-apprentice script keeps trying to open my text editor
why
what is there for you in the hex editor, keyboard/mouse macro?
okay I confirmed this works manually. I can find the new DOS-RAM section, add 2304500 to it, and I get the x-pos of the cursor.
now to do it automatically.
I was kinda hoping there was an API that let me point at a process and go "hey what memory regions does this have mapped?"
NOPE
so you just call VirtualQuery repeatedly on a ton of memory addresses.
why not
got it. hacked a bit on this script and now I have a script that takes a PID and tells you the address of the DOS RAM in that process:
https://github.com/nccgroup/memaddressanalysis/blob/master/Windows/memanalysis.py
OH NO
I just realized my computer crashed earlier and I had ghidra open. I may have lost all my reverse engineering work ;_;
CCS I think is for scripts.
oh god I do not want to decode the scripting language this thing uses. it has a big interpreter here and it's huge
I found the font renderer.
I wasn't even looking for one! this isn't a death generator thing!
but you can't stop Foone from Fooning
it calls malloc for every character it draws?
huh.
uhh.
I don't see any free()
I mean it's only allocating like, 24 bytes per character?
and this game has VERY little text.
but still.
this code appears to be strlen but it seems to count backwards from -1 and then inverts it at the end?
the fuck?
this is weird. the "Load_Dialogues" function tries to load .ccb files.
but there are no CCB files on the retail disc. Did... did they forget to include the dialogue files? IS THIS WHY THE GAME HAS NO SUBTITLES?
@foone Unconventional choice of 16-bit lengths (wait, is this 16 bit?), but otherwise I'd guess this is the equivalent of
for (unsigned int count=0; count<0xffff; count++) {
if (param_1[count] == '\0') break;
}
return count;
Except with the compiler changing array index to moving pointer and inverting the loop because testing for 0 is faster than equality. Used to be a pretty normal thing Borland compilers do, IIRC?
And yeah, 2's complement at the end is just a faster imul -1.