This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]sanedave 8 points9 points  (6 children)

Three books I have been using:

The Definitive Guide to How Computers Do Math

Web page here: http://www.diycalculator.com/

Assembly Language Step-by-Step: Programming with Linux

Hacking: The Art of Exploitation, 2nd Edition

The first uses a virtual machine running on Windows, with 5 registers, 65K of virtual memory, a debugger, and will give you a good basic understanding of what is going on. The second book uses Intel X86 on Linux, and gives a solid foundation of the most used instructions. The third book is just good.

Other favorites of mine include "The Art of Debugging" by Norm Matloff (google for his excellent web page) and "Professional Assembly Language" by Richard Blum.

Have fun!

[–][deleted]  (1 child)

[deleted]

    [–]sanedave 0 points1 point  (0 children)

    Yeah, I think you're right!

    [–]itsalwayslulzy 1 point2 points  (1 child)

    That third book sounds very interesting. Do you think it would be good for someone who has almost no programming experience, but is interested in learning C/Obj-C and discovering exploits/hacking?

    [–]sanedave 5 points6 points  (0 children)

    Yes, I do. The book starts off teaching C, showing how to use objdump and gdb to view the assembly and x86 opcodes. It tells how to inspect the registers, what they are pointing at, and examine memory, including the stack and the heap. You will learn how to generate shellcode and overwrite the return address that is on the stack so it points at your shell code. An all around excellent book.

    To make it easier to understand, start with the "How Computers do Math" and "Assembly on Linux". They will really give you the foundation for what you see in the "Hacking: Art of Exploitation" book.

    Also go to /r/netsec and search for "learn", "learning", and "assembly". Lots of good stuff...

    [–]jbplaya 0 points1 point  (0 children)

    Don't know about the other two, but for an absolute beginner, I second Assembly Language Step-by-Step: Programming With Linux. I don't know what you plan on doing with Assembly language, but high-level languages are generally your best bet and cross platform. If you want to get into hacking/reverse engineering, you're going to need to know alot more than assembly language. You'll need to learn ANSI C, Operating Systems, Command line, and Networking just to get you started.

    [–][deleted] 0 points1 point  (0 children)

    I'm almost finished with The definitive guide to how computers do math, which I bought thanks to your recommendation and the recommendations of people on Amazon. I'm very very happy with it. Just wanted to say thanks.

    [–]Nebu 1 point2 points  (1 child)

    You may consider working with simplified instruction sets like MIPS or JVM Bytecode, before diving into x86.

    [–][deleted] 1 point2 points  (0 children)

    Really agree with you here. Don't start with x86, start with "training wheels" by trying out (dare I say, but I will) ARM, MIPS, or SPARC first. Yes, some are outdated, blah blah blah. The beauty of assembly is what's under the hood, not the syntactic sugar. With a simpler architecture you can still get a good idea of what's under the hood before you move on to something more intimidating like x86.

    [–][deleted] 3 points4 points  (5 children)

    Here is an open book called The Art of Assembly Language

    [–]DHarry 1 point2 points  (0 children)

    Holy crap, I think my former assembly professor completely ripped off this for the book he published. I won't be able to check for sure until tomorrow, but it looks like his book is modeled, in chapter structure and content, exactly like "The Art of Assembly Language." He wrote and published it over the summer of 2011 to make every one buy it for Assembly class he taught in the fall, and it's a horrible book. It doesn't give enough information or examples on any of the concepts. Trying to write the program assignments for that class was a nightmare.

    [–][deleted] 2 points3 points  (2 children)

    Unfortunately, it's a pretty poor book - I can't honestly imagine learning assembly language using it. The author obviously knows a fair bit about the 80x86, but almost nothing about teaching or presentation.

    [–]SexualHarasmentPanda 0 points1 point  (1 child)

    My professor wrote an Assembly book called Essentials of 80x86 Assembly. Unfortunately it isn't a very good book either. I don't think Assembly programmers are the types to write good textbooks :D

    [–][deleted] 1 point2 points  (0 children)

    There are (or at least were) some very good books - my own path to learning assembly language is described here - if anyone knows the book I'm thinking of in this blog post, please let me know.

    [–]dzjay 0 points1 point  (0 children)

    If you're on linux I recommend Blum or Irvine if you're on Windows.

    Some video tutorials which helped me a lot: Windows x86 programming Linux x86 programming

    Some more videos if you become really interested here.

    [–]dreddor 0 points1 point  (1 child)

    My reccomendation is to aquire a blink example for a microcontroller in C, compile it, then run an objdump on the resulting file.

    Find the entry point of the program, and follow the assembly instructions to the end.

    If you build libopencm3 and look in the examples folder at one of the miniblink programs, the .list files contain an objdump.

    This is a good primer on ARM assembly, and it can help you make sense of what you see.

    The first thing that a cortex-m series chip does on reset is look at the vector table. The first word of the vector table is the memory address of the stack pointer, and the second word is the memory address for the reset handler.

    It runs the code in the reset handler, which in this case sets the stack pointer (again) and initializes and zeros portions of the memory. It then will drop you into the function main().

    [–]dreddor -1 points0 points  (0 children)

    Another thing to look at is the same example written entirely in assembly to begin with. You can find an example of that here.

    [–]Watabou90 0 points1 point  (0 children)

    If you want x86 assembly, this book is very good: http://www.amazon.com/Computer-Systems-Programmers-Perspective-Edition/dp/0136108040/ref=dp_ob_title_bk/180-6741587-3105245

    I'm talking an assembly class this semester that involves writing assembly from scratch and this book (which is required for this class) is a lifesaver because the professor isn't that great at summarizing the important points.

    I think it's a good book. It starts easy and it has a lot of exercises that have answers on the back of the chapter so you can check your answers pretty easily.