Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource for Binary Programming

I have searched all over the internet for programming in Binary and the only responses people seem willing to give are: "Why would you want to program in Binary?" "It's stupid, use assembly." "There's nothing you could possibly get out of it, there's no point in learning."

If you are one of these people, I appreciate your opinion, but it does not answer my question.

While I don't intend on actually trying to program in Binary my reasons for knowing are:

  1. I have an interest in knowing the Binary instructions behind the assembly commands.

  2. I am designing an experiment where random binary instructions are generated. I want them to be valid binary commands and I want to be able to interpret what those commands would do if run.

With that said, does anyone know any resource where one could learn Binary programming?

like image 956
Thallios Avatar asked Dec 22 '22 06:12

Thallios


2 Answers

In general there is a one-to-one mapping between assembly instructions and machine code (what you're calling binary). You can find these mappings in the instruction set architecture documentation for whatever machine you care about. Popular examples:

  1. Intel Software Developer Manuals, especially volumes 2A and 2B.
  2. ARM Architecture Reference Manual
  3. THe MIPS Instruction Set
  4. 8051 Instruction Set Manual

You'll be able to find a similar document for whichever architecture you want to work with. You can use the information in manuals like these to either to decode the machine instructions for a given program and identify how they were generated from the assembly source, or perhaps to hand-assemble your own program if you'd like.

like image 94
Carl Norum Avatar answered Jan 05 '23 03:01

Carl Norum


Here's what I did to learn binary: 1. open command prompt and type "debug" as the command.

  1. type "a" after the '-'.
  2. start programming in assembly (make sure that the commands you use are pretty generic, ex. moving registers. only doing one command.)
  3. type nothing and press enter when done.
  4. type 'd' to see what the binaries are, and cross reference several programs.

please note that to program in actual binary you'll need a hex editor. Here's the one I use:

http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

another idea that I do to learn more complex languages (like c++) is do the same as assembly but open it up in the hex editor.

like image 27
JAW1025 Avatar answered Jan 05 '23 03:01

JAW1025