Stories
Slash Boxes
Comments

Dev.SN ♥ developers

posted by janrinok on Monday March 24 2014, @04:51PM   Printer-friendly
from the not-for-the-faint-hearted dept.

Anonymous Coward writes:

"Dan Luu, in his blog, suggests that editing binaries is something that we should consider from time to time. From that blog:

Editing binaries is a trick that comes in handy a few times a year. You don't often need to, but when you do, there's no alternative. When I mention patching binaries, I get one of two reactions: complete shock or no reaction at all. As far as I can tell, this is because most people have one of these two models of the world:

  • There exists source code. Compilers do something to source code to make it runnable. If you change the source code, different things happen.
  • There exists a processor. The processor takes some bits and decodes them to make things happen. If you change the bits, different things happen.

If you have the first view, breaking out a hex editor to modify a program is the action of a deranged lunatic. If you have the second view, editing binaries is the most natural thing in the world. Why wouldn't you just edit the binary?"

 
This discussion has been archived. No new comments can be posted.
Display Options Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Informative) by Zoot on Monday March 24 2014, @05:49PM

    by Zoot (679) on Monday March 24 2014, @05:49PM (#20586)

    With just a global change of literal text. It's a little harder in the era of Unicode etc., but about half the things I ever wanted to do to executables could be achieved by opening up the program file in a text editor and changing one literal string to another equal sized string. Not only message text, but constants for comparison, external function references, and other things could often be changed this way.

    Most of the other things I needed to do to executables were simply a matter of figuring out which single instruction to NOP or which single branch to make unconditional.

    There's hardly ever a need to insert or change a large amount of code. So probably 90%+ of things you want to do to a program are very simple changes.

    Z.

    Starting Score:    1  point
    Moderation   +2  
       Interesting=1, Informative=1, Total=2
    Extra 'Informative' Modifier   0  

    Total Score:   3