Reversing LZ91 from Commander Keen
albertzeyer 2021-08-17 21:00:00 +0000 UTC [ - ]
indentit 2021-08-17 18:51:08 +0000 UTC [ - ]
AnIdiotOnTheNet 2021-08-17 19:39:14 +0000 UTC [ - ]
Akronymus 2021-08-18 11:14:06 +0000 UTC [ - ]
mywittyname 2021-08-17 19:50:33 +0000 UTC [ - ]
mips_avatar 2021-08-17 20:16:49 +0000 UTC [ - ]
mschuster91 2021-08-17 19:16:15 +0000 UTC [ - ]
Modernizations are especially tricky. Modern compilers can do all sort of weird magic, sometimes combining two or more lines of code into one instruction. Old school compilers don't optimize much which is part of why performance-critical parts of game engines were written in Assembler for a long time.
Not to mention that some stuff you can do in Assembler has no equivalent in higher-level code (e.g. dealing with raw stack frames), and even Assembler to byte code is nowhere near 1:1 reversible.
bugfix 2021-08-17 19:47:09 +0000 UTC [ - ]
IDA Pro and Ghidra can identify functions and generate the equivalent C code. I know that this is not the original code, but it does help a bit when you are trying to get an idea of what a large function doing.
kaoD 2021-08-17 20:10:28 +0000 UTC [ - ]
I've used Ghidra to reverse-engineer a game's serialization format[0] and, even though the C-ish result was marginally better than manually tracking registers across the disassembly, it was far from understandable.
A great deal of the work was cleaning up the resulting C into something that a human would've written instead of the garbage ASM-with-C-syntax that Ghidra produced.
That is nowhere near what OP was suggesting (although useful nonetheless).
mschuster91 2021-08-17 20:29:40 +0000 UTC [ - ]
Only thing where Ghidra lacks any form of knowledge of is how to deal with the FS register that is used for SEH on win32... it just marks it as in_FS_offset with no way to tell it that it can replace FS:[0xXX] with appropriate TIB access macros.
stevekemp 2021-08-18 05:37:21 +0000 UTC [ - ]
pdw 2021-08-17 21:01:02 +0000 UTC [ - ]
TacticalCoder 2021-08-17 22:55:10 +0000 UTC [ - ]
From his homepage:
> "I wrote LZEXE in 1989 and 1990 when I was 17."
Incredible.
_kdave 2021-08-17 22:30:31 +0000 UTC [ - ]