# Hacking ![rw-book-cover](https://images-na.ssl-images-amazon.com/images/I/61BVSCejVSL._SL200_.jpg) ## Metadata - Author: [[Jon Erickson]] - Full Title: Hacking - Category: #books ## Highlights - Unlike C and other compiled languages, assembly language instructions have a direct one-to-one relationship with their corresponding machine language instructions. This means that since every processor architecture has different machine language instructions, each also has a different form of assembly language. ([Location 565](https://readwise.io/to_kindle?action=open&asin=B004OEJN3I&location=565)) - Tags: [[pink]] - The first four registers (EAX, ECX, EDX, and EBX) are known as general purpose registers. These are called the Accumulator, Counter, Data, and Base registers, respectively. They are used for a variety of purposes, but they mainly act as temporary variables for the CPU when it is executing machine instructions. The second four registers (ESP, EBP, ESI, and EDI) are also general purpose registers, but they are sometimes known as pointers and indexes. These stand for Stack Pointer, Base Pointer, Source Index, and Destination Index, respectively. The first two registers are called pointers because they store 32-bit addresses, which essentially point to that location in memory. ([Location 628](https://readwise.io/to_kindle?action=open&asin=B004OEJN3I&location=628)) - Tags: [[pink]] - The EIP register is the Instruction Pointer register, which points to the current instruction the processor is reading. Like a child pointing his finger at each word as he reads, the processor reads each instruction using the EIP register as its finger. ([Location 639](https://readwise.io/to_kindle?action=open&asin=B004OEJN3I&location=639)) - Tags: [[pink]] - An exploit can be generalized as a three-step process: First, some sort of memory corruption; then, a change in control flow; and finally, execution of the shellcode. ([Location 8607](https://readwise.io/to_kindle?action=open&asin=B004OEJN3I&location=8607)) - Tags: [[favorite]] [[pink]] ## New highlights added May 28, 2022 at 6:35 PM - The growth of the heap moves downward toward higher memory addresses. ([Location 1664](https://readwise.io/to_kindle?action=open&asin=B004OEJN3I&location=1664)) - Opposite to the dynamic growth of the heap, as the stack changes in size, it grows upward in a visual listing of memory, toward lower memory addresses. ([Location 1678](https://readwise.io/to_kindle?action=open&asin=B004OEJN3I&location=1678)) ## New highlights added June 25, 2022 at 2:26 PM - Like the LaMacchia Loophole, these types of vulnerabilities exist because there are specific unexpected cases that the program can't handle. Under normal conditions, these unexpected cases cause the program to crash— metaphorically driving the execution flow off a cliff. But if the environment is carefully controlled, the execution flow can be controlled—preventing the crash and reprogramming the process. ([Location 2673](https://readwise.io/to_kindle?action=open&asin=B004OEJN3I&location=2673))