News for hackers. Stuff that matters.
Re:Reversing LZ91 from Commander Keen by bugfix on Tuesday August 17, 2021 @03:47PM (#28214028)
You might not get the exact same code, but it is certainly possible to generate C/pseudo-code from the binary.

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.

Re:Reversing LZ91 from Commander Keen by kaoD on Tuesday August 17, 2021 @04:10PM (#28214288)
You're both right.

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).

[0] https://github.com/alvaro-cuesta/townsclipper

Re:Reversing LZ91 from Commander Keen by mschuster91 on Tuesday August 17, 2021 @04:29PM (#28214490)
I'm actually reverse-engineering a game myself... interestingly, for me Ghidra produces very good results, way better than IDA did ten years ago. On the other hand I may be lucky simply because 1996 Borland C++ is a pretty dumb, unoptimizing compiler and there is absolutely no copy protection or whatever present in the game, not even a dead code elimination.

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.