Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Monday March 24 2014, @08: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 Threshold/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: 2) by Random2 on Monday March 24 2014, @09:14PM

    by Random2 (669) on Monday March 24 2014, @09:14PM (#20560)

    One exercise I greatly appreciated in college was the week we spent writing in machine language for a processor. We broke out the instruction codes and put them in sequence to have the processor do stuff.

    We even had a test on it. Know how many students answered stupidly simple questions incorrectly because they missed a single bit in their 100's of bit-long strings? Hint: most of the class.

    So yes, outside of unusual debugging cases, only a lunatic would consider doing something like editing the binary files. This is the reason we came up with higher-level languages so you don't have to hunt through kilobytes of binary to find the one damn bit flipped to the wrong state or the accidental bit-shift from pressing the key the wrong number of times.

    It's something useful to know for those absolutely bizarre cases where a compiler breaks a build, but 99.99999999% of the time the faster, and far more sane, option is to look at something other than the binaries.

    --
    If only I registered 3 users earlier....
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 1, Insightful) by crutchy on Monday March 24 2014, @09:29PM

    by crutchy (179) on Monday March 24 2014, @09:29PM (#20573) Homepage Journal

    i remember reading the art of assembly, which had a section on opcodes.

    looked really interesting but would be more fun on a simple uc set up with blinkenlights. i reckon programming uc's with asm is definitely more fun than higher level languages like C or basic but i haven't tried writing the opcodes in hex directly.

    • (Score: 4, Interesting) by VLM on Monday March 24 2014, @09:43PM

      by VLM (445) on Monday March 24 2014, @09:43PM (#20583)

      You'd probably get a kick out of this

      http://www.retrotechnology.com/memship/memship.htm l [retrotechnology.com]

      which is a 1802 programmed from a binary front panel

      Or this

      http://www.brielcomputers.com/wordpress/?cat=24 [brielcomputers.com]

      which is a 6502 programmed in hex.

      I have both. Its hard to say which is better for new guy. The 1802 is certainly a simpler system but the binary coding is maddening. On the other hand 6502 is more complicated but the UI is far better. Probably better off with the KIM-1 6502 board.

      I also owned one of these in the late 80s somewhat soon after it became obsolete but before it became a classic:

      http://en.wikipedia.org/wiki/Heathkit_H8 [wikipedia.org]

      which is a 8080 programmed in octal, although you could upgrade it to a Z80 unfortunately still programmed in octal. It was an interesting experience.

      Although if you feel the need for octal, this architecture is dramatically superior to the 8080:

      http://en.wikipedia.org/wiki/PDP-8 [wikipedia.org]

      And no I never owned one but fooled around extensively with emulation. They sell on ebay for about the price of a used car now in the 2010s.

      • (Score: 2) by Koen on Tuesday March 25 2014, @01:25AM

        by Koen (427) on Tuesday March 25 2014, @01:25AM (#20670)

        Sir, thanks!, *this* is why I read SoylentNews.
        Now where is my credit card, I'm gonna order a 1802 memship at once.
        May the Forth be with you.

        --
        /. refugees on Usenet: comp.misc [comp.misc]
      • (Score: 0) by crutchy on Tuesday March 25 2014, @06:34AM

        by crutchy (179) on Tuesday March 25 2014, @06:34AM (#20837) Homepage Journal

        thanks for links... lead me to this http://www.brielcomputers.com/wordpress/?cat=18 [brielcomputers.com]

        not a *real* altair, but would be just about worthy of programming while wearing a stormtrooper outfit