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

Question about recompiling #14

Open
abdulahmad opened this issue Nov 1, 2023 · 2 comments
Open

Question about recompiling #14

abdulahmad opened this issue Nov 1, 2023 · 2 comments

Comments

@abdulahmad
Copy link

So is this code in a state to be recompiled once it has been decompiled? I'm not really an assembler programmer so I can't immediately tell.

Was surprised to see the output ad the line numbers/binary code as well-- is there a way to disable that? I assume you can't recompile the code with that in the code.

Also, I've noticed comments about "bad code" or "misplaced" code-- I assume this is something your script does? Would that affect trying to recompile the code?

@fonic
Copy link
Owner

fonic commented Nov 1, 2023

Also, I've noticed comments about "bad code" or "misplaced" code-- I assume this is something your script does? Would that affect trying to recompile the code?

Yes, that would greatly affect the ability to recompile the code. All of those need to be eliminated first. See step 8 of the README.

Was surprised to see the output ad the line numbers/binary code as well-- is there a way to disable that? I assume you can't recompile the code with that in the code.

Since the main purpose when creating this tool was readability, I decided to keep this information as it is quite handy when investigating code. There's currently no option to turn that off, but a simple regex can be used to remove that, e.g. sed -i -E 's|^[0-9a-f ]+: [0-9a-f ]+ | |g' <file>

So is this code in a state to be recompiled once it has been decompiled? I'm not really an assembler programmer so I can't immediately tell.

No, it isn't. Recompilation is actually way harder than it sounds, as lots of necessary information (e.g. alignment) is lost when compiling sources to an executable (and thus that information is not available when reverse engineering, which is what wcdatool does).

I've had moderate success in recompiling MK1.EXE, but its structure is way simpler than MKTRIL.EXE. Plus, prior to refining wcdatool's output (again, step 8 of the README) it's not even worth trying.

@fonic
Copy link
Owner

fonic commented Nov 1, 2023

You might also want to browse through #9 and #11, which contain answers to lots of questions regarding what the output means, what can be done with it and so on.

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