retdec
retdec copied to clipboard
Add Dos MZ support to retdec
Being able to decompile old MS DOS/MZ programs would be nice.
Yes, I'm struggling with this right now too and upvote this, please add MS-DOS support
Hello, I also would like to use RetDec to decompile MS-DOS binaries. While it may not be useful for modern security purpose, it would help all the hobbyist around here trying to reverse engineer MS-DOS video games.
Best regards.
If anyone wants to help with this one, here are some pointers what needs to be done (and in what order):
- Add Dos MZ parser to
fileformat. - Add Dos MZ loader to
loader. - Modify scripts and other support code to let Dos MZ through.
- Modify
decoderpass inbin2llvmirto handle 16-bit x86 - use 16-bit x86 mode ofcapstone2llvmirlibrary. - As we wrote
capstone2llvmir, we tried to model 16-bit x86 alongside 32/64-bit. But we have never used it so far, so it is quite possible some problems will need to be fixed, and some more features added.
At this point, decompilation of 16-bit x86 Dos MZ file should produce C. But the output quality probably will not be very good. So:
- Pick some very simple binary, decompile it, inspect the results, find out what is wrong, find out why it is wrong, draft a solution, implement it. (E.g. the whole x86 segment registers thing is not dealt with at all, DOS interrupts, etc. Either existing
retdecLLVM passes will need to be modified, or new, DOS specific passes will have to be created.) - Write regression tests when results are ok.
- Repeat points 6. and 7. with some more complex binaries.
Hello @PeterMatula, Thank you very much for the details. I'll definitely give it a try when I'll have some free time. However, I'm pretty sure 90% of us want to decompile 32-bit x86 Dos MZ, and not 16-bit x86.
Are there any news after 5 years regarding MS DOS 16 bit binaries support?
Also interested in this. Anyone still considering implementation?