Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MS-DOS Microsoft QuickC Compiler #1350

Open
palmerj opened this issue Sep 28, 2024 · 3 comments
Open

Support for MS-DOS Microsoft QuickC Compiler #1350

palmerj opened this issue Sep 28, 2024 · 3 comments

Comments

@palmerj
Copy link

palmerj commented Sep 28, 2024

Is your feature request related to a problem? Please describe.
I want to decompile and create C code that can be recompiled to the same binary for 16bit real mode MS-DOS EXE. The binary is pretty small at 64kb.

Describe the solution you'd like
My EXE is compiled with QuickC 2.50. I'm unsure how to add the decompiled ASM into decomp.me. I've loaded the binary in Ghidra, okay? So maybe I can copy and paste ASM for each function from there? I don't see any ASM obj dump type tool in QC 2.5. I'm also not sure how to get some initial decompiled C code from the ASM. Maybe that needs to also be taken from Ghidra, although I see that C code is a pretty poor representation and is pretty far away from what the C likely was.

Describe alternatives you've considered
I guess some sort of python tooling could be created to help prepare the inputs?

Additional context
The binaries for the QC 2.5 compiler can be found here https://winworldpc.com/product/quick-c/2x

@ieee802dot11ac
Copy link

FYI, any copy of objdump is able to have its output configured for clean asm output, like such:
image
(using objdump --disassemble=add_assembler_option -M i386,att /usr/local/sce/ee/gcc/bin/ee-gcc in this case)

@palmerj
Copy link
Author

palmerj commented Sep 28, 2024

objdump --disassemble=add_assembler_option -M i386,att GAME.EXE
objdump: HENRYD.EXE: file format not recognized

I think that's because it's a 16bit DOS MZ EXE

@palmerj
Copy link
Author

palmerj commented Sep 28, 2024

Actually this seems to work:

objdump -D -x -s -f --file-offsets -b binary -mi386 -Maddr16,data16 GAME.EXE > GAME.ASM

But I'm not sure if how to decode the jump and call addresses. These need to be matched to segment and addresses.

I assume becauase there are no symbols, you can't dump specific functions or split the ASM to to ASM per function. That would require some specific analysis and tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants