Re-compiling code

Scot Sealander Sealand at clarityconnect.com
Thu Jan 25 23:19:57 GMT 2001


Shannen Durphey wrote:
 
> I have a binary and uncommented disassembly of an ecm's code.

The original binary?  Save it for comparison.  Commented or uncommented
will make no difference to the assembler. (Assuming properly commented!)


> I need to add four lines of code in one area, and I have another 
> area where I can remove up to 6 lines of code.

> How can I make these changes a little less painful?

Where to start.....  Use the assembler written by the guy who wrote
the disassembler.  Ensures the best compatibility.  Does the disassembly
re-assemble without error back to the original binary?  That is the
next rule after the first.  If this does not happen, find out what 
the error is first, before going any farther.  Your added code won't
do any good if you can't get a good original re-assembly.

Now, once you get it to re-assemble back to original, start looking
for absolute addresses in the listing.  These addresses are pointing
to something, and if your code moves things, these will end up pointing
at something other than what you wanted.  Now, replace those absolute 
addresses with labels.  Make sure it re-assembles to original (yes
again.)

Now you are probably in good enough shape to add code or delete code.
Careful if adding code, you may move some branches out of range, if you
add too much.  Above all, keep calm, you can always start over again.
:-)

Scot Sealander

----------------------------------------------------------------------------
To unsubscribe from gmecm, send "unsubscribe gmecm" (without the quotes)
in the body of a message (not the subject) to majordomo at lists.diy-efi.org




More information about the Gmecm mailing list