Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The assembly you would write by hand and the assembly generated by a compiler are often very different when viewed from a high level. Of course, the innards of the program will be very similar (there are only so many different ways to encode <code>a = b + c</code>, after all), but they're not the trouble when you're trying to reverse engineer something. The compiler will add a <em>ton</em> of boilerplate code to even simple executables: last time I compared, "Hello World" compiled by GCC was about 4kB, while if written by hand in assembly it's around 100 bytes. It's worse on Windows: last time I compared (admittedly, this was last <em>century</em>) the smallest "Hello World" I could get my Windows compiler of then-choice to generate was 52kB! Usually this boilerplate is only executed once, if at all, so it doesn't much affect program speed -- like I said above, the core of the program, the part where most execution time is spent, is usually pretty similar whether compiled or written by hand.</p> <p>At the end of the day, this means that an expert assembly <em>programmer</em> and an expert <em>disassembler</em> are two different specialties. Commonly they're found in the same person, but they're really separate, and learning how to be an excellent assembly coder won't help you that much to learn reverse engineering.</p> <p>What you want to do is grab the IA-32 and AMD64 (both are covered together) architecture manuals from <a href="http://www.intel.com/products/processor/manuals/" rel="noreferrer">Intel</a> and <a href="http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_739_7044,00.html" rel="noreferrer">AMD</a>, and look through the early sections on instructions and opcodes. Maybe read a tutorial or two on assembly language, just to get the basics of assembly language down. Then grab a <em>small</em> sample program that you're interested in and disassemble it: step through its control flow and try to understand what it's doing. See if you can patch it to do something else. Then try again with another program, and repeat until you're comfortable enough to try to achieve a more useful goal. You might be interested in things like "crackmes", produced by the reverse engineering community, which are challenges for people interested in reverse engineering to try their hand at, and hopefully learn something along the way. They range in difficulty from basic (start here!) to impossible.</p> <p>Above all, you just need to <em>practice</em>. As in many other disciplines, with reverse engineering, practice makes perfect... or at least <em>better</em>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload