
Explore x86 assembly fundamentals, including 8086 architectures, conditional jumps, and arithmetic instructions. Learn to emulate and debug with GDB, manage memory and stack, and explore SSE and buffer overflow concepts.
Trace the evolution of x86 processors from 16-bit origins to 32-bit and 64-bit cores, highlighting pipelining, out-of-order and speculative execution, and extended page tables.
Convert a C program into an executable by running the preprocessor, compiler, and assembler to produce an object file, then link libraries to create the final binary.
Description of the 8086 Processor Architecture
Explore the 80386 processor architecture, covering the CPU execution and instruction units, prefetch and decode, and the memory management unit with segmentation, paging, and virtual-to-physical address translation.
Explore IA32 integer registers, their 32-bit general purpose roles, and how 16-bit subregisters provide backwards compatibility, with flexible naming beyond traditional register aliases.
Explore the IA32 processor state, detailing general purpose registers, stack pointers, instruction pointer, and condition code flags (carry, zero, sign, overflow) and what constitutes complete memory state.
explains x86 condition codes as single-bit flags like carry, zero, and overflow and how implicit or explicit flag setting governs conditional set instructions that yield 0 or 1.
The lecture demonstrates an x86 assembly jump example, loading X, comparing with zero, and updating X: increment when not zero, or set X to one when zero.
Learn how the mov instruction transfers data by specifying a source and a destination, using immediate data, registers, or memory addresses stored in a register.
Compute an address using the source-destination instruction. Show how the source, the address mode expression, determines the destination address, and sets the destination to the expression's address.
Learn how to use GDB to debug x86 assembly, set breakpoints, disassemble code, run programs, and inspect registers and memory.
Explore gdb use cases in x86 assembly by tracing register moves and arithmetic. Disassemble print calls and examine swaps via pointers and test harnesses.
Explore x86 assembly arithmetic and instructions, including add, increment, decrement, and negate, operating on a source and destination. Understand left and right shifts, and or, not operations between registers.
Explore x86 floating point instructions on the 87 family, including fabs, change sign, add, sub, multiply, square root, divide, and inc for rounding.
Explore the IA32 Linux memory layout, with a stack growing to eight megabytes, a heap for dynamic storage, and data and text sections containing statically allocated data and instructions.
Explore the three main x86 operating modes: real mode, protected mode with virtual memory paging and multitasking since the 386, and virtual mode, hardware virtualization.
Demonstrates how a procedure call pushes the return address onto the stack, with the return address being the instruction after the call, and then jumps to the target label.
Explain the procedure return in x86 assembly by popping the return address from the stack and jumping to that address.
explain linux stack frames and the stack and frame pointers, showing how each function call pushes a frame with local variables and how frames link to previous frames.
Save register contents to the stack to preserve values across calls; two conventions exist, the first called a save where the caller saves temporary values in its frame.
Explore sse, a single instruction, multiple data extension to the x86. It enables applying the same operation across data, like image pixels, edge detection, and convolution in a neural network.
Explore the SSE registers, eight 128-bit registers accessible only in 64-bit mode, which remain disabled by default until the operating system explicitly enables them.
Explore sse instructions for packed double-precision values, moving and adding multiple numbers in registers, using a mask to process two, four, or eight elements with divide, multiply, subtract.
Learn how vulnerable code enables stack overflow exploits in x86 assembly programming by reading unchecked user input into a fixed buffer and allowing exploit code execution.
Learn how a gets input buffer overflow overwrites the return address on the stack, causing the exploit code to execute by jumping to the injected payload.
During this class you will learn X86 Assembly Language, the 8086 and 80386 Intel Architectures, and everything you need to know about the Stack: What is the Stack ? What are procedure calls and how procedure Calls are using the Stack to operate? How to allocate C data structures in Memory ? And How Hackers use code vulnerabilities to operate Stack Overflow Exploits and how to protect your code against such attacks. What are SSE Instructions and how to use them ? This is the ideal class to start learning X86 Assembly, understand how compilation works and how your computer compiles and executes C code. During the class we will also review multiple code examples and debug them using Gnu Debugger GDB debugging tool. The compilation process will be reviewed and we will go in details into the disassembled code to see how it works. All major X86 Instructions types will be explained, as for example: jump instructions, arithmetic instructions, mov instructions and more. The end of the class will be dedicated to stack overflow attacks, and how to prevent vulnerable code to be exploited by attackers. Requirements for the class is a working linux system and basic linux knowledge. We will go through the steps of how to install gdb and start turning C code into assembly code for debugging. All major GDB commands will be listed so that a comprehensive view of GDB is given.