Thread: binary data

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Some background for 'ya...

    Like everything in the computer, an exe file is stored as binary "numbers" or "bit-patterns".

    These bit-patterns represent machine code instuctions (and data) that the microprocessor understands. Different microprocessors have different instruction sets. You can't run an exe from your PC, on your Mac.

    Since the computer can only handle binary numbers, text is stored in ASCII code. An upper case "A" is stored as the number 65 (Decimal), or 41 Hex. The program has to keep track of this "number" to know if it's a number, an A, or a machine-code instruction. Notepad doesn't know what the numbers represent, and tries to convert everything to text.

    When you compile a program, you convert the C++ source code into machine language. This process is essentially irreversable. You can't de-compile and get your original C++ code. Some data is simply lost when you compile. For example, comments don't exist in machine code, and machine code doesn't use variable names. You can get a decompiler, but it won't recreate the original code.

    Assembly language is a direct line-to-line human readable representation of machine code. You can disassemble (like decompiling) a machine code program into assembly language. and you can see exactly what the program is doing. (Of course you don't get comments, etc.) I assume Sebastiani is going to look at your assembly code. For most of us mortals, understanding an uncommented assembly program more than a couple-hundred lines long is impossible. Understanding a complex program (like a game or word processing program) is just about impossible for anyone!

    A hex editor allows you to look at binary data. It's easy (for humans) to convert between hex and binary, and hex is much easier to read than binary. Most hex editors will also display the corresponding ASCII character for each byte.

    Malware = malicious software (virus, etc.)
    Last edited by DougDbug; 03-18-2004 at 04:42 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. store binary data in program...
    By Abda92 in forum C Programming
    Replies: 9
    Last Post: 03-23-2008, 10:33 AM
  2. Bitmasking Problem
    By mike_g in forum C++ Programming
    Replies: 13
    Last Post: 11-08-2007, 12:24 AM
  3. How to write image data to binary PGM file format(P5)?
    By tommy_chai in forum C Programming
    Replies: 6
    Last Post: 11-03-2007, 10:52 PM
  4. Binary comparison
    By tao in forum Windows Programming
    Replies: 0
    Last Post: 06-28-2006, 12:10 PM
  5. Replies: 4
    Last Post: 06-14-2005, 05:45 AM