Introduction to Intel x86 Assembly, Architecture, Applications, & Alliteration
|
|
|
- Brittney Wells
- 9 years ago
- Views:
Transcription
1 Introduction to Intel x86 Assembly, Architecture, Applications, & Alliteration Xeno Kovah 2009/2010 xkovah at gmail Approved for Public Release: Distribution Unlimited
2 All materials is licensed under a Creative Commons Share Alike license. 2
3 Additional Content/Ideas/Info Provided By: Jon A. Erickson, Christian Arllen, Dave Keppler Who suggested what, is inline with the material 3
4 About Me Security nerd - generalist, not specialist Realmz ~1996, Mac OS 8, BEQ->BNE FTW! x86 ~2002 Know or have known ~5 assembly languages(x86, SPARC, ARM, PPC, 68HC12). x86 is by far the most complex. Routinely read assembly when debugging my own code, reading exploit code, and reverse engineering things 4
5 About You? Name & Department Why did you want to take the class? If you know you will be applying this knowledge, to which OS and/or development environment? 5
6 About the Class The intent of this class is to expose you to the most commonly generated assembly instructions, and the most frequently dealt with architecture hardware. 32 bit instructions/hardware Implementation of a Stack Common tools Many things will therefore be left out or deferred to later classes. Floating point instructions/hardware 16/64 bit instructions/hardware Complicated or rare 32 bit instructions Instruction pipeline, caching hierarchy, alternate modes of operation, hw virtualization, etc 6
7 About the Class 2 The hope is that the material covered will be provide the required background to delve deeper into areas which may have seemed daunting previously. Because I can't anticipate the needs of all job classes, if there are specific areas which you think would be useful to certain job types, let me know. The focus areas are currently primarily influenced by my security background, but I would like to make the class as widely applicable as possible. 7
8 Agenda Day 1 - Part 1 - Architecture Introduction, Windows tools Day 1 - Part 2 - Windows Tools & Analysis, Learning New Instructions Day 2 - Part 1 - Linux Tools & Analysis Day 2 - Part 2 - Inline Assembly, Read The Fun Manual, Choose Your Own Adventure 8
9 Miss Alaineous Questions: Ask 'em if you got 'em If you fall behind and get lost and try to tough it out until you understand, it's more likely that you will stay lost, so ask questions ASAP. Browsing the web and/or checking during class is a good way to get lost ;) Vote on class schedule. Benevolent dictator clause. It's called x86 because of the progression of Intel chips from 8086, 80186, 80286, etc. I just had to get that out of the way. :) 9
10 What you're going to learn #include <stdio.h> int main(){ printf( Hello World!\n ); return 0x1234; } 10
11 Is the same as.text: main!.text: push ebp!.text: mov ebp, esp!.text: push offset ahelloworld ; "Hello world\n"!.text: call ds: imp printf!.text: e add esp, 4!.text: mov eax, 1234h!.text: pop ebp!.text: retn! Windows Visual C , /GS (buffer overflow protection) option turned 11 off Disassembled with IDA Pro 4.9 Free Version
12 Is the same as <main>:! : 8d 4c 24 04!lea 0x4(%esp),%ecx! : 83 e4 f0!and $0xfffffff0,%esp! b: ff 71 fc!pushl -0x4(%ecx)! e: 55!push %ebp! f: 89 e5!mov %esp,%ebp! : 51!push %ecx! : 83 ec 04!sub $0x4,%esp! : c !movl $0x ,(%esp)! c: e8 43 ff ff ff!call 80482d : b8 2a !mov $0x1234,%eax! : 83 c4 04!add $0x4,%esp! : 59!pop %ecx! a: 5d!pop %ebp! b: 8d 61 fc!lea -0x4(%ecx),%esp! e: c3!ret! f: 90!nop! Ubuntu 8.04, GCC Disassembled with objdump -d 12
13 Is the same as _main:! 00001fca!pushl!%ebp! 00001fcb!movl!%esp,%ebp! 00001fcd!pushl!%ebx! 00001fce!subl!$0x14,%esp! 00001fd1!calll!0x00001fd6! 00001fd6!popl!%ebx! 00001fd7!leal!0x a(%ebx),%eax! 00001fdd!movl!%eax,(%esp)! 00001fe0!calll!0x !; symbol stub for: _puts! 00001fe5!movl!$0x ,%eax! 00001fea!addl!$0x14,%esp! 00001fed!popl!%ebx! 00001fee!leave! 00001fef!ret! Mac OS , GCC Disassembled from command line with otool -tv 13
14 But it all boils down to.text: main!.text: push offset ahelloworld ; "Hello world\n"!.text: call ds: imp printf!.text: b pop ecx!.text: c mov eax, 1234h!.text: retn! Windows Visual C , /GS (buffer overflow protection) option turned off Optimize for minimum size (/O1) turned on 14 Disassembled with IDA Pro 4.9 Free Version
15 Take Heart! By one measure, only 14 assembly instructions account for 90% of code! I think that knowing about (not counting variations) is good enough that you will have the check the manual very infrequently You've already seen 11 instructions, just in the hello world variations! 15
16 Refresher - Data Types double/long long?-> long double? int/long In C: char short 16
17 Refresher - Alt. Radices Decimal, Binary, Hexidecimal If you don't know this, you must memorize tonight Decimal (base 10) Binary (base 2) Hex (base 16) b 0x b 0x b 0x b 0x b 0x b 0x b 0x b 0x b 0x b 0x b 0x0A b 0x0B b 0x0C b 0x0D b 0x0E b 0x0F 17
18 Refresher - Negative Numbers one's complement = flip all bits. 0->1, 1->0 two's complement = one's complement + 1 Negative numbers are defined as the two's complement of the positive number Number One's Comp. Two's Comp. (negative) b : 0x b : 0xFE b : 0xFF : b : 0x b : 0xFB b : 0xFC : b : 0x1A b : 0xE b : 0xE6 : -26?? b : 0xB0 : -? 0x01 to 0x7F positive byte, 0x80 to 0xFF negative byte 0x to 0x7FFFFFFF positive dword 0x to 0xFFFFFFFF negative dword 18
19 Architecture - CISC vs. RISC Intel is CISC - Complex Instruction Set Computer Many very special purpose instructions that you will never see, and a given compiler may never use - just need to know how to use the manual Variable-length instructions, between 1 and 16(?) bytes long. 16 is max len in theory, I don't know if it can happen in practice Other major architectures are typically RISC - Reduced Instruction Set Computer Typically more registers, less and fixed-size instructions Examples: PowerPC, ARM, SPARC, MIPS 19
20 Architecture - Endian Endianness comes from Jonathan Swift's Gulliver's Travels. It doesn't matter which way you eat your eggs :) Little Endian - 0x stored in RAM little end first. The least significant byte of a word or larger is stored in the lowest address. E.g. 0x Intel is Little Endian Big Endian - 0x stored as is. Network traffic is Big Endian Most everyone else you've heard of (PowerPC, ARM, SPARC, MIPS) is either Big Endian by default or can be configured as either (Bi-Endian) Book p. 163 Book for this class is Professional Assembly Language by Blum 20
21 Endianess pictures FE Big Endian (Others) Register ED FA CE CE FA ED FE High Memory Addresses 0x5 0x4 0x3 0x2 0x1 0x0 Low Memory Addresses FE ED FA CE Little Endian (Intel) FE Register ED FA 21 CE
22 Architecture - Registers Registers are small memory storage areas built into the processor (still volatile memory) 8 general purpose registers + the instruction pointer which points at the next instruction to execute But two of the 8 are not that general On x86-32, registers are 32 bits long On x86-64, they're 64 bits Book p
23 Architecture - Register Conventions 1 These are Intel's suggestions to compiler developers (and assembly handcoders). Registers don't have to be used these ways, but if you see them being used like this, you'll know why. But I simplified some descriptions. I also color coded as GREEN for the ones which we will actually see in this class (as opposed to future ones), and RED for not. EAX - Stores function return values" EBX - Base pointer to the data section" ECX - Counter for string and loop operations" EDX - I/O pointer Intel Arch v1 Section General-Purpose Registers 23
24 Architecture - Registers Conventions 2 ESI - Source pointer for string operations" EDI - Destination pointer for string operations" ESP - Stack pointer EBP - Stack frame base pointer EIP - Pointer to next instruction to execute ( instruction pointer ) 24
25 Architecture - Registers Conventions 3 Caller-save registers - eax, edx, ecx If the caller has anything in the registers that it cares about, the caller is in charge of saving the value before a call to a subroutine, and restoring the value after the call returns Put another way - the callee can (and is highly likely to) modify values in caller-save registers Callee-save registers - ebp, ebx, esi, edi If the callee needs to use more registers than are saved by the caller, the callee is responsible for making sure the values are stored/restored Put another way - the callee must be a good citizen and not modify registers which the caller didn't save, unless the callee itself saves and restores the existing values 25
26 Architecture - Registers - 8/16/32 bit addressing
27 Architecture - Registers - 8/16/32 bit addressing
28 Architecture - EFLAGS EFLAGS register holds many single bit flags. Will only ask you to remember the following for now. Zero Flag (ZF) - Set if the result of some instruction is zero; cleared otherwise. Sign Flag (SF) - Set equal to the most-significant bit of the result, which is the sign bit of a signed integer. (0 indicates a positive value and 1 indicates a negative value.) Intel Vol 1 Sec page
29 1 Your first x86 instruction: NOP NOP - No Operation! No registers, no values, no nothin'! Just there to pad/align bytes, or to delay time Bad guys use it to make simple exploits more reliable. But that's another class ;) 29
30 Extra! Extra! Late-breaking NOP news! Amaze those who know x86 by citing this interesting bit of trivia: The one-byte NOP instruction is an alias mnemonic for the XCHG (E)AX, (E)AX instruction. I had never looked in the manual for NOP apparently :) Every other person I had told this to had never heard it either. Thanks to Jon Erickson for cluing me in to this. XCHG instruction is not officially in this class. But if I hadn't just told you what it does, I bet you would have guessed right anyway. XCHG in book p
31 The Stack The stack is a conceptual area of main memory (RAM) which is designated by the OS when a program is started. Different OS start it at different addresses by convention A stack is a Last-In-First-Out (LIFO/FILO) data structure where data is "pushed" on to the top of the stack and "popped" off the top. By convention the stack grows toward lower memory addresses. Adding something to the stack means the top of the stack is now at a lower memory address. 31
32 The Stack 2 As already mentioned, esp points to the top of the stack, the lowest address which is being used While data will exist at addresses beyond the top of the stack, it is considered ined The stack keeps track of which functions were called before the current one, it holds local variables and is frequently used to pass arguments to the next function to be called. A firm understanding of what is happening on the stack is *essential* to understanding a program's operation. 32
33 2 PUSH - Push Word, Doubleword or Quadword onto the Stack" For our purposes, it will always be a DWORD (4 bytes)." Can either be an immediate (a numeric constant), or the value in a register" The push instruction automatically decrements the stack pointer, esp, by 4." Book p
34 Registers Before eax 0x esp 0x0012FF8C push eax Registers After eax 0x esp 0x0012FF88 Stack Before Stack After 0x0012FF90 0x x esp 0x0012FF8C 0x x x0012FF88 esp 0x x0012FF84 0x0012FF80 34
35 3 POP- Pop a Value from the Stack" Take a DWORD off the stack, put it in a register, and increment esp by 4 Book p
36 Registers Before eax 0xFFFFFFFF esp 0x0012FF88 pop eax Stack Before Registers After eax 0x esp 0x0012FF8C Stack After 0x0012FF90 0x x x0012FF8C 0x esp 0x esp 0x0012FF88 0x (0x ) 0x0012FF84 0x0012FF80 36
37 Calling Conventions How code calls a subroutine is compiler-dependent and configurable. But there are a few conventions. We will only deal with the cdecl and stdcall conventions. More info at
38 Calling Conventions - cdecl C declaration - most common calling convention Function parameters pushed onto stack right to left Saves the old stack frame pointer and sets up a new stack frame eax or edx:eax returns the result for primitive data types Caller is responsible for cleaning up the stack 38
39 Calling Conventions - stdcall I typically only see this convention used by Microsoft C++ code - e.g. Win32 API Function parameters pushed onto stack right to left Saves the old stack frame pointer and sets up a new stack frame eax or edx:eax returns the result for primitive data types Callee responsible for cleaning up any stack parameters it takes Aside: typical MS, If I call my new way of doing stuff 'standard' it must be true! 39
40 4 CALL - Call Procedure" Book p. 132 CALL's job is to transfer control to a different function, in a way that control can later be resumed where it left off First it pushes the address of the next instruction onto the stack For use by RET for when the procedure is done Then it changes eip to the address given in the instruction Destination address can be specified in multiple ways Absolute address Relative address (relative to the end of the instruction) 40
41 5 RET - Return from Procedure" Two forms Pop the top of the stack into eip (remember pop increments stack pointer) In this form, the instruction is just written as ret Typically used by cdecl functions Pop the top of the stack into eip and add a constant number of bytes to esp In this form, the instruction is written as ret 0x8, or ret 0x20, etc Typically used by stdcall functions Kinda book p
42 6 MOV - Move Can move: register to register memory to register, register to memory immediate to register, immediate to memory Never memory to memory! Memory addresses are given in r/m32 form talked about later Book p
43 General Stack Frame Operation We are going to pretend that main() is the very first function being executed in a program. This is what its stack looks like to start with (assuming it has any local variables). Local Variables stack bottom main() frame stack top Book p
44 General Stack Frame Operation 2 When main() decides to call a subroutine, main() becomes the caller. We will assume main() has some registers it would like to remain the same, so it will save them. We will also assume that the callee function takes some input arguments. Local Variables Caller-Save Registers Arguments to Pass to Callee stack bottom main() frame stack top 44
45 General Stack Frame Operation 3 When main() actually issues the CALL instruction, the return address gets saved onto the stack, and because the next instruction after the call will be the beginning of the called function, we consider the frame to have changed to the callee. Local Variables Caller-Save Registers Arguments to Pass to Callee Caller's saved return address stack bottom main() frame stack top 45
46 General Stack Frame Operation 4 When foo() starts, the frame pointer (ebp) still points to main()'s frame. So the first thing it does is to save the old frame pointer on the stack and set the new value to point to its own frame. Local Variables Caller-Save Registers Arguments to Pass to Callee Caller's saved return address Saved Frame Pointer stack bottom main() frame foo()'s frame stack top 46
47 General Stack Frame Operation 5 Next, we'll assume the the callee foo() would like to use all the registers, and must therefore save the callee-save registers. Then it will allocate space for its local variables. Local Variables Caller-Save Registers Arguments to Pass to Callee Caller's saved return address Saved Frame Pointer Callee-Save Registers stack bottom main() frame foo()'s frame stack top Local Variables 47
48 General Stack Frame Operation 6 At this point, foo() decides it wants to call bar(). It is still the callee-ofmain(), but it will now be the caller-of-bar. So it saves any caller-save registers that it needs to. It then puts the function arguments on the stack as well. Saved Frame Pointer Callee-Save Registers Local Variables Caller-Save Registers Arguments to Pass to Callee stack bottom main() frame foo()'s frame stack top 48
49 General Stack Frame Layout Every part of the stack frame is technically optional (that is, you can hand code asm without following the conventions.) But compilers generate code which uses portions if they are needed. Which pieces are used can sometimes be manipulated with compiler options. (E.g. omit frame pointers, changing calling convention to pass arguments in registers, etc.) Saved Frame Pointer Callee-Save Registers Local Variables Caller-Save Registers Arguments to Pass to Callee stack bottom main() frame foo()'s frame stack top 49
50 Stack Frames are a Linked List! The ebp in the current frame points at the saved ebp of the previous frame. stack bottom main() frame foo()'s frame bar()'s frame stack top 50
51 Example1.c The stack frames in this example will be very simple. Only saved frame pointer (ebp) and saved return addresses (eip). //Example1 - using the stack //to call subroutines //New instructions: //push, pop, call, ret, mov int sub(){ return 0xbeef; } int main(){ sub(); return 0xf00d; } sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop E ret ebp 51
52 eax ebp esp Example1.c 1: EIP = , but no instruction yet executed 0x003435C0 z 0x0012FFB8 z 0x0012FF6C z Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop E ret ebp Belongs to the frame *before* main() is called 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 52
53 Example1.c 2 eax ebp esp 0x003435C0 z 0x0012FFB8 z 0x0012FF68 c Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp x mov ebp,esp call sub (401000h) mov eax,0f00dh D pop E ret ebp 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 c 53
54 Example1.c 3 eax ebp esp 0x003435C0 z 0x0012FF68 c 0x0012FF68 Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp x call sub (401000h) mov eax,0f00dh D pop E ret ebp 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 54
55 Example1.c 4 eax ebp esp 0x003435C0 z 0x0012FF68 0x0012FF64 c Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) x mov eax,0f00dh D pop E ret ebp 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 0x c 55
56 Example1.c 5 eax ebp esp 0x003435C0 z 0x0012FF68 0x0012FF60 c Key: x executed instruction, c modified value z start value sub: push ebp x mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop E ret ebp 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 0x x0012FF68 c 56
57 Example1.c 6 eax ebp esp 0x003435C0 z 0x0012FF60 c 0x0012FF60 Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp x mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop E ret ebp 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 0x x0012FF68 57
58 Example1.c 6 STACK FRAME TIME OUT sub push mov mov pop retn main push mov call mov ebp ebp, esp eax, 0BEEFh ebp ebp ebp, esp _sub eax, 0F00Dh Function-beforemain 's frame main's frame (saved frame pointer and saved return address) sub's frame (only saved frame pointer, because it doesn't call anything else, and doesn't have local variables) 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 0x x0012FF68 pop retn ebp 58
59 Example1.c 7 eax ebp esp 0x0000BEEF 0x0012FF60 0x0012FF60 Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh x pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop ebp E ret 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 0x x0012FF68 59
60 Example1.c 8 eax ebp esp 0x0000BEEF 0x0012FF68 c 0x0012FF64 c Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp x ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop ebp E ret 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 0x c 60
61 Example1.c 9 eax ebp esp 0x0000BEEF 0x0012FF68 0x0012FF68 c Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret x main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop ebp E ret 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 c 61
62 Example1.c 9 eax ebp esp 0x0000F00D c 0x0012FF68 0x0012FF68 Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh x D pop ebp E ret 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z 0x0012FFB8 62
63 Example1.c 10 eax ebp esp 0x0000F00D 0x0012FFB8 c 0x0012FF6C c Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop ebp x E ret 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 0x004012E8 z c 63
64 Example1.c 11 eax ebp esp 0x0000F00D 0x0012FFB8 0x0012FF70 c Key: x executed instruction, c modified value z start value sub: push ebp mov ebp,esp mov eax,0beefh pop ebp ret main: push ebp mov ebp,esp call sub (401000h) mov eax,0f00dh D pop ebp E ret x 0x0012FF6C 0x0012FF68 0x0012FF64 0x0012FF60 0x0012FF5C 0x0012FF58 c Execution would continue at the value ret removed from the stack: 0x004012E8 64
65 Example1 Notes sub() is deadcode - its return value is not used for anything, and main always returns 0xF00D. If optimizations are turned on in the compiler, it would remove sub() Because there are no input parameters to sub(), there is no difference whether we compile as cdecl vs stdcall calling conventions 65
66 Let's do that in a tool Visual C Express Edition (which I will shorthand as VisualStudio or VS) Standard Windows development environment Available for free, but missing some features that pro developers might want Can't move applications to other systems without installing the redistributable libraries 66
67 Finding the VisualStudio solution file 67
68 Creating a new project - 1 Creating a new project 1 68
69 Creating a new project - 2 Creating a new project 2 69
70 Creating a new project - 3 Creating a new project 3 70
71 Adding files to the project 71
72 Setting project properties - 1 Setting project properties 72
73 Setting project properties - 2 Setting project properties 2 Unfortunately the debug information format alters the code which gets generated too much, making it not as simple as I would like for this class. 73
74 Setting project properties - 3 Setting project properties 3 This would just add extra complexity to the asm which we don't want for now 74
75 Setting project properties - 4 Setting project properties 4 It's all just a wrapper to set command line options Click this to change which config set is active Different options can be set for release vs debug builds 75
76 Setting project properties - 5 Setting project properties 5 C++ has more complicated compilergenerated code, and while our stuff is simple enough that the compiler probably wouldn't do anything different, it's good to do this just to be safe 76
77 Setting project properties - 6 Setting project properties 6 Another thing where I found out the hard way that it will increase the asm complexity 77
78 Building the project - 1 Building project 78
79 Building the project - 2 Building project 2 Information about whether the build succeeded will be here. If it fails, a separate error tab will open up 79
80 Setting breakpoints & start debugger Click to the left of the line to break at. 80
81 Step into Step over Step out Debugging the program 2 Continue Stop debugging Restart debugging Current stopped location 81
82 Showing assembly Right click: Only available while debugging 82
83 Watching registers Note that it knows the ebp register is going to be used in this instruction 83
84 Showing registers Here you can enter register names or variable names 84
85 Watching the stack change - 1 Watching the stack change 1 85
86 Watching the stack change - 2 Right click on the Watching the stack body of change the data in 2 the window and make sure everything's set like this Set address to esp (will always be the top of the stack) Set to 1 Click Reevaluate Automatically so that it will change the display as esp changes 86
87 Going through Example1.c in Visual Studio sub: push mov mov pop ret main: push mov call mov pop ret ebp ebp,esp eax,0beefh ebp ebp ebp,esp sub eax,0f00dh ebp 87
88 Example2.c with Input parameters #include <stdlib.h> int sub(int x, int y){ return 2*x+y; } int main(int argc, char ** argv){ int a; a = atoi(argv[1]); return sub(argc,a); } and Local Variables.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn 88
89 "r/m32" Addressing Forms Anywhere you see an r/m32 it means it could be taking a value either from a register, or a memory address. I'm just calling these r/m32 forms because anywhere you see r/m32 in the manual, the instruction can be a variation of the below forms. In Intel syntax, most of the time square brackets [] means to treat the value within as a memory address, and fetch the value at that address (like dereferencing a pointer) mov eax, ebx mov eax, [ebx] mov eax, [ebx+ecx*x] (X=1, 2, 4, 8) mov eax, [ebx+ecx*x+y] (Y= one byte, or 4 bytes, 0-2^32-1) Most complicated form is: [base + index*scale + disp]! More info: Intel v2a, Section page 2-4 in particular Tables 2-2 and
90 7 LEA - Load Effective Address Frequently used with pointer arithmetic, sometimes for just arithmetic in general Uses the r/m32 form but is the exception to the rule that the square brackets [ ] syntax means dereference ( value at ) Example: ebx = 0x2, edx = 0x1000 lea eax, [edx+ebx*2] eax = 0x1004, not the value at 0x1004 Not covered in book 90
91 8 9 ADD and SUB Adds or Subtracts, just as expected Destination operand can be r/m32 or register Source operand can be r/m32 or register or immediate No source and destination as r/m32s, because that could allow for memory to memory transfer, which isn't allowed on x86 Evaluates the operation as if it were on signed AND unsigned data, and sets flags as appropriate. Instructions modify OF, SF, ZF, AF, PF, and CF flags add esp, 8 sub eax, [ebx*2] Add p. 202, Sub p
92 Example2.c - 1.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp x.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0xcafe z 0xbabe z 0xfeed z 0x0012FF50 z 0x0012FF24 c 0x12FFB0 (char ** argv)z 0x2 (int argc) z Addr after call _main z 0x0012FF50(saved ebp)c Key: executed instruction x, modified value c, arbitrary example start value z 92
93 Example2.c - 2.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp x.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0xcafe 0xbabe 0xfeed 0x0012FF24 c 0x0012FF24 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 93
94 Example2.c - 3.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx x.text: mov eax, [ebp+0ch].text: Caller-save, or mov ecx, [eax+4].text: a push ecx space for local.text: b call dword ptr ds: imp atoi var? This time it.text: add esp, 4.text: turns out to be mov [ebp-4], eax.text: space for local var mov edx, [ebp-4].text: a since there is no push edx.text: b corresponding pop, mov eax, [ebp+8].text: e and the address is push eax.text: f call _sub used later to refer.text: add esp, 8 to the value we.text: mov esp, ebp.text: know is stored in a. pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0xcafe 0xbabe 0xfeed 0x0012FF24 0x0012FF20 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0xbabe (int a) c 94
95 Example2.c - 4.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch] x.text: mov ecx, [eax+4].text: a Getting the push ecx.text: b call dword ptr ds: imp atoi.text: base of the add esp, 4.text: argv char * mov [ebp-4], eax.text: mov edx, [ebp-4].text: a array (aka push edx.text: b mov eax, [ebp+8] argv[0]).text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x12FFB0 c 0xbabe 0xfeed 0x0012FF24 0x0012FF20 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0xbabe (int a) 95
96 Example2-5.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4] x.text: a push ecx.text: b Getting the call dword ptr ds: imp atoi.text: add esp, 4 char * at.text: mov [ebp-4], eax.text: argv[1] mov edx, [ebp-4].text: a push edx (I chose.text: b mov eax, [ebp+8].text: e 0x12FFD4 push eax.text: f arbitrarily since call _sub.text: add esp, 8 it's out of the.text: mov esp, ebp.text: stack scope pop ebp.text: a retn we're currently looking at) eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x12FFB0 0x12FFD4c (arbitraryz ) 0xfeed 0x0012FF24 0x0012FF20 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0xbabe (int a) 96
97 Example2-6.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c Saving some pop ebp.text: d slides retn.text: This will push _main: the push ebp.text: address of the mov ebp, esp.text: string at argv[1] push ecx.text: (0x12FFD4). atoi() mov eax, [ebp+0ch].text: will read the string mov ecx, [eax+4].text: a and turn in into an push ecx x.text: b int, put that int in call dword ptr ds: imp atoi x.text: eax, and return. add esp, 4 x.text: Then the adding 4 mov [ebp-4], eax.text: to esp will negate mov edx, [ebp-4].text: a the having pushed push edx.text: b the input parameter mov eax, [ebp+8].text: e and make push eax.text: f 0x12FF1C call _sub.text: ined again add esp, 8.text: (this is indicative of mov esp, ebp.text: cdecl) pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x100c (arbitraryz ) 0x12FFD4 0xfeed 0x0012FF24 0x0012FF20 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0xbabe (int a) c c 97
98 Example2-7.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: First setting a mov ecx, [eax+4].text: a equal to the return push ecx.text: b value. Then call dword ptr ds: imp atoi.text: pushing a as the add esp, 4.text: second parameter mov [ebp-4], eax x.text: in sub(). We can mov edx, [ebp-4] x.text: a see an obvious push edx x.text: b optimization would mov eax, [ebp+8].text: e have been to push eax.text: f replace the last two call _sub.text: instructions with add esp, 8.text: push eax. mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x100 0x12FFD4 0x100 c 0x0012FF24 0x0012FF1C c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) c 0x100 (int y) c 98
99 Example2-8.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8] x.text: e Pushing argc push eax x.text: f as the first call _sub.text: add esp, 8 parameter (int.text: mov esp, ebp.text: x) to sub() pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x2 c 0x12FFD4 0x100 0x0012FF24 0x0012FF18 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) 0x100 (int y) 0x2 (int x) c 99
100 Example2-9.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub x.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x2 0x12FFD4 0x100 0x0012FF24 0x0012FF14 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) 0x100 (int y) 0x2 (int x) 0x c 100
101 Example2-10.text: _sub: push ebp x.text: mov ebp, esp x.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x2 0x12FFD4 0x100 0x0012FF10 c 0x0012FF10 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) 0x100 (int y) 0x2 (int x) 0x x0012FF24(saved ebp)c 101
102 Example2-11.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8] x.text: mov ecx, [ebp+0ch] x.text: Move x into eax, lea eax, [ecx+eax*2] and y into ecx..text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax 0x2 c (no value change) ecx 0x100 c edx 0x100 ebp 0x0012FF10 esp 0x0012FF10 0x0012FF30 0x12FFB0 (char ** argv) 0x0012FF2C 0x2 (int argc) 0x0012FF28 Addr after call _main 0x0012FF24 0x0012FF50 (saved ebp) 0x0012FF20 0x100 (int a) 0x0012FF1C 0x100 (int y) 0x0012FF18 0x2 (int x) 0x0012FF14 0x x0012FF10 0x0012FF24 (saved ebp) 0x0012FF0C 102
103 Example2-12.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: Set the return value lea eax, [ecx+eax*2] x.text: c (eax) to 2*x + y. pop ebp.text: d Note: neither retn.text: pointer arith, nor _main: an push ebp.text: address which mov ebp, esp.text: was loaded. Just an push ecx.text: afficient way to do a mov eax, [ebp+0ch].text: calculation. mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x104 c 0x100 0x100 0x0012FF10 0x0012FF10 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) 0x100 (int y) 0x2 (int x) 0x x0012FF24 (saved ebp) 103
104 Example2-13.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp x.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x104 0x100 0x100 0x0012FF24 c 0x0012FF14 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) 0x100 (int y) 0x2 (int x) 0x c 104
105 Example2-14.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn x.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x104 0x100 0x100 0x0012FF24 0x0012FF18 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) 0x100 (int y) 0x2 (int x) c 105
106 Example2-15.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8 x.text: mov esp, ebp.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x104 0x100 0x100 0x0012FF24 0x0012FF20 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) 0x100 (int a) c c 106
107 Example2-16.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp x.text: pop ebp.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x104 0x100 0x100 0x0012FF24 0x0012FF24 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main 0x0012FF50 (saved ebp) c 107
108 Example2-17.text: _sub: push ebp.text: mov ebp, esp.text: mov eax, [ebp+8].text: mov ecx, [ebp+0ch].text: lea eax, [ecx+eax*2].text: c pop ebp.text: d retn.text: _main: push ebp.text: mov ebp, esp.text: push ecx.text: mov eax, [ebp+0ch].text: mov ecx, [eax+4].text: a push ecx.text: b call dword ptr ds: imp atoi.text: add esp, 4.text: mov [ebp-4], eax.text: mov edx, [ebp-4].text: a push edx.text: b mov eax, [ebp+8].text: e push eax.text: f call _sub.text: add esp, 8.text: mov esp, ebp.text: pop ebp x.text: a retn eax ecx edx ebp esp 0x0012FF30 0x0012FF2C 0x0012FF28 0x0012FF24 0x0012FF20 0x0012FF1C 0x0012FF18 0x0012FF14 0x0012FF10 0x0012FF0C 0x104 0x100 0x100 0x0012FF50 c 0x0012FF28 c 0x12FFB0 (char ** argv) 0x2 (int argc) Addr after call _main c 108
109 Going through Example2.c in Visual Studio sub: push mov mov pop ret main: push mov call mov pop ret ebp ebp,esp eax,0beefh ebp ebp ebp,esp sub eax,0f00dh ebp 109
110 Changing active project 110
111 Setting command line arguments Setting command line arguments 111
112 Instructions we now know (9) NOP PUSH/POP CALL/RET MOV LEA ADD/SUB 112
113 Back to Hello World.text: main.text: push ebp.text: mov ebp, esp.text: push offset ahelloworld ; "Hello world\n.text: call ds: imp printf.text: e add esp, 4.text: mov eax, 1234h.text: pop ebp.text: retn Are we all comfortable with this now? Windows Visual C , /GS (buffer overflow protection) option turned 113 off Disassembled with IDA Pro 4.9 Free Version
CS61: Systems Programing and Machine Organization
CS61: Systems Programing and Machine Organization Fall 2009 Section Notes for Week 2 (September 14 th - 18 th ) Topics to be covered: I. Binary Basics II. Signed Numbers III. Architecture Overview IV.
Hacking Techniques & Intrusion Detection. Ali Al-Shemery arabnix [at] gmail
Hacking Techniques & Intrusion Detection Ali Al-Shemery arabnix [at] gmail All materials is licensed under a Creative Commons Share Alike license http://creativecommonsorg/licenses/by-sa/30/ # whoami Ali
Off-by-One exploitation tutorial
Off-by-One exploitation tutorial By Saif El-Sherei www.elsherei.com Introduction: I decided to get a bit more into Linux exploitation, so I thought it would be nice if I document this as a good friend
CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 20: Stack Frames 7 March 08
CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 20: Stack Frames 7 March 08 CS 412/413 Spring 2008 Introduction to Compilers 1 Where We Are Source code if (b == 0) a = b; Low-level IR code
Assembly Language: Function Calls" Jennifer Rexford!
Assembly Language: Function Calls" Jennifer Rexford! 1 Goals of this Lecture" Function call problems:! Calling and returning! Passing parameters! Storing local variables! Handling registers without interference!
Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) [email protected] http://www.mzahran.com
CSCI-UA.0201-003 Computer Systems Organization Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) [email protected] http://www.mzahran.com Some slides adapted (and slightly modified)
CS:APP Chapter 4 Computer Architecture Instruction Set Architecture. CS:APP2e
CS:APP Chapter 4 Computer Architecture Instruction Set Architecture CS:APP2e Instruction Set Architecture Assembly Language View Processor state Registers, memory, Instructions addl, pushl, ret, How instructions
64-Bit NASM Notes. Invoking 64-Bit NASM
64-Bit NASM Notes The transition from 32- to 64-bit architectures is no joke, as anyone who has wrestled with 32/64 bit incompatibilities will attest We note here some key differences between 32- and 64-bit
Intel 8086 architecture
Intel 8086 architecture Today we ll take a look at Intel s 8086, which is one of the oldest and yet most prevalent processor architectures around. We ll make many comparisons between the MIPS and 8086
Instruction Set Architecture
CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant adapted by Jason Fritts http://csapp.cs.cmu.edu CS:APP2e Hardware Architecture - using Y86 ISA For learning aspects
Return-oriented programming without returns
Faculty of Computer Science Institute for System Architecture, Operating Systems Group Return-oriented programming without urns S. Checkoway, L. Davi, A. Dmitrienko, A. Sadeghi, H. Shacham, M. Winandy
X86-64 Architecture Guide
X86-64 Architecture Guide For the code-generation project, we shall expose you to a simplified version of the x86-64 platform. Example Consider the following Decaf program: class Program { int foo(int
Buffer Overflows. Security 2011
Buffer Overflows Security 2011 Memory Organiza;on Topics Kernel organizes memory in pages Typically 4k bytes Processes operate in a Virtual Memory Space Mapped to real 4k pages Could live in RAM or be
Stack Overflows. Mitchell Adair
Stack Overflows Mitchell Adair Outline Why? What? There once was a VM Virtual Memory Registers Stack stack1, stack2, stack3 Resources Why? Real problem Real money Real recognition Still prevalent Very
Software Vulnerabilities
Software Vulnerabilities -- stack overflow Code based security Code based security discusses typical vulnerabilities made by programmers that can be exploited by miscreants Implementing safe software in
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine
Systems Design & Programming Data Movement Instructions. Intel Assembly
Intel Assembly Data Movement Instruction: mov (covered already) push, pop lea (mov and offset) lds, les, lfs, lgs, lss movs, lods, stos ins, outs xchg, xlat lahf, sahf (not covered) in, out movsx, movzx
Chapter 7D The Java Virtual Machine
This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly
A Tiny Guide to Programming in 32-bit x86 Assembly Language
CS308, Spring 1999 A Tiny Guide to Programming in 32-bit x86 Assembly Language by Adam Ferrari, [email protected] (with changes by Alan Batson, [email protected] and Mike Lack, [email protected])
Computer Organization and Architecture
Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats Instruction Set Design One goal of instruction set design is to minimize instruction length Another goal
Introduction. Application Security. Reasons For Reverse Engineering. This lecture. Java Byte Code
Introduction Application Security Tom Chothia Computer Security, Lecture 16 Compiled code is really just data which can be edit and inspected. By examining low level code protections can be removed and
Unpacked BCD Arithmetic. BCD (ASCII) Arithmetic. Where and Why is BCD used? From the SQL Server Manual. Packed BCD, ASCII, Unpacked BCD
BCD (ASCII) Arithmetic The Intel Instruction set can handle both packed (two digits per byte) and unpacked BCD (one decimal digit per byte) We will first look at unpacked BCD Unpacked BCD can be either
An Introduction to Assembly Programming with the ARM 32-bit Processor Family
An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2
esrever gnireenigne tfosorcim seiranib
esrever gnireenigne tfosorcim seiranib Alexander Sotirov [email protected] CanSecWest / core06 Reverse Engineering Microsoft Binaries Alexander Sotirov [email protected] CanSecWest / core06 Overview
TODAY, FEW PROGRAMMERS USE ASSEMBLY LANGUAGE. Higher-level languages such
9 Inline Assembly Code TODAY, FEW PROGRAMMERS USE ASSEMBLY LANGUAGE. Higher-level languages such as C and C++ run on nearly all architectures and yield higher productivity when writing and maintaining
For a 64-bit system. I - Presentation Of The Shellcode
#How To Create Your Own Shellcode On Arch Linux? #Author : N3td3v!l #Contact-mail : [email protected] #Website : Nopotm.ir #Spcial tnx to : C0nn3ct0r And All Honest Hackerz and Security Managers I - Presentation
Using the RDTSC Instruction for Performance Monitoring
Using the Instruction for Performance Monitoring http://developer.intel.com/drg/pentiumii/appnotes/pm1.htm Using the Instruction for Performance Monitoring Information in this document is provided in connection
Lecture 27 C and Assembly
Ananda Gunawardena Lecture 27 C and Assembly This is a quick introduction to working with x86 assembly. Some of the instructions and register names must be check for latest commands and register names.
Format string exploitation on windows Using Immunity Debugger / Python. By Abysssec Inc WwW.Abysssec.Com
Format string exploitation on windows Using Immunity Debugger / Python By Abysssec Inc WwW.Abysssec.Com For real beneficiary this post you should have few assembly knowledge and you should know about classic
Machine-Level Programming II: Arithmetic & Control
Mellon Machine-Level Programming II: Arithmetic & Control 15-213 / 18-213: Introduction to Computer Systems 6 th Lecture, Jan 29, 2015 Instructors: Seth Copen Goldstein, Franz Franchetti, Greg Kesden 1
Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2
Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of
Introduction. Figure 1 Schema of DarunGrim2
Reversing Microsoft patches to reveal vulnerable code Harsimran Walia Computer Security Enthusiast 2011 Abstract The paper would try to reveal the vulnerable code for a particular disclosed vulnerability,
CPU Organization and Assembly Language
COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:
Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C
Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection
Hotpatching and the Rise of Third-Party Patches
Hotpatching and the Rise of Third-Party Patches Alexander Sotirov [email protected] BlackHat USA 2006 Overview In the next one hour, we will cover: Third-party security patches _ recent developments
Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek
Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture
Chapter 4 Processor Architecture
Chapter 4 Processor Architecture Modern microprocessors are among the most complex systems ever created by humans. A single silicon chip, roughly the size of a fingernail, can contain a complete high-performance
Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX
Overview CISC Developments Over Twenty Years Classic CISC design: Digital VAX VAXÕs RISC successor: PRISM/Alpha IntelÕs ubiquitous 80x86 architecture Ð 8086 through the Pentium Pro (P6) RJS 2/3/97 Philosophy
More MIPS: Recursion. Computer Science 104 Lecture 9
More MIPS: Recursion Computer Science 104 Lecture 9 Admin Homework Homework 1: graded. 50% As, 27% Bs Homework 2: Due Wed Midterm 1 This Wed 1 page of notes 2 Last time What did we do last time? 3 Last
Informatica e Sistemi in Tempo Reale
Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)
Abysssec Research. 1) Advisory information. 2) Vulnerable version
Abysssec Research 1) Advisory information Title Version Discovery Vendor Impact Contact Twitter CVE : Apple QuickTime FlashPix NumberOfTiles Remote Code Execution Vulnerability : QuickTime player 7.6.5
Overview of IA-32 assembly programming. Lars Ailo Bongo University of Tromsø
Overview of IA-32 assembly programming Lars Ailo Bongo University of Tromsø Contents 1 Introduction... 2 2 IA-32 assembly programming... 3 2.1 Assembly Language Statements... 3 2.1 Modes...4 2.2 Registers...4
Keil C51 Cross Compiler
Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation
Software security. Buffer overflow attacks SQL injections. Lecture 11 EIT060 Computer Security
Software security Buffer overflow attacks SQL injections Lecture 11 EIT060 Computer Security Buffer overflow attacks Buffer overrun is another common term Definition A condition at an interface under which
MACHINE ARCHITECTURE & LANGUAGE
in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based
x64 Cheat Sheet Fall 2015
CS 33 Intro Computer Systems Doeppner x64 Cheat Sheet Fall 2015 1 x64 Registers x64 assembly code uses sixteen 64-bit registers. Additionally, the lower bytes of some of these registers may be accessed
The programming language C. sws1 1
The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan
How To Write Portable Programs In C
Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important
High-speed image processing algorithms using MMX hardware
High-speed image processing algorithms using MMX hardware J. W. V. Miller and J. Wood The University of Michigan-Dearborn ABSTRACT Low-cost PC-based machine vision systems have become more common due to
Software Fingerprinting for Automated Malicious Code Analysis
Software Fingerprinting for Automated Malicious Code Analysis Philippe Charland Mission Critical Cyber Security Section October 25, 2012 Terms of Release: This document is approved for release to Defence
Return-oriented Programming: Exploitation without Code Injection
Return-oriented Programming: Exploitation without Code Injection Erik Buchanan, Ryan Roemer, Stefan Savage, Hovav Shacham University of California, San Diego Bad code versus bad behavior Bad Bad behavior
Traditional IBM Mainframe Operating Principles
C H A P T E R 1 7 Traditional IBM Mainframe Operating Principles WHEN YOU FINISH READING THIS CHAPTER YOU SHOULD BE ABLE TO: Distinguish between an absolute address and a relative address. Briefly explain
MSc Computer Science Dissertation
University of Oxford Computing Laboratory MSc Computer Science Dissertation Automatic Generation of Control Flow Hijacking Exploits for Software Vulnerabilities Author: Sean Heelan Supervisor: Dr. Daniel
HC12 Assembly Language Programming
HC12 Assembly Language Programming Programming Model Addressing Modes Assembler Directives HC12 Instructions Flow Charts 1 Assembler Directives In order to write an assembly language program it is necessary
Application Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification
Application Note 3/2003 PC Master Software Communication Protocol Specification By Pavel Kania and Michal Hanak S 3 L Applications Engineerings MCSL Roznov pod Radhostem Introduction The purpose of this
Where s the FEEB? The Effectiveness of Instruction Set Randomization
Where s the FEEB? The Effectiveness of Instruction Set Randomization Ana Nora Sovarel David Evans Nathanael Paul University of Virginia, Department of Computer Science http://www.cs.virginia.edu/feeb Abstract
Lecture 22: C Programming 4 Embedded Systems
Lecture 22: C Programming 4 Embedded Systems Today s Goals Basic C programming process Variables and constants in C Pointers to access addresses Using a High Level Language High-level languages More human
5. Calling conventions for different C++ compilers and operating systems
5. Calling conventions for different C++ compilers and operating systems By Agner Fog. Technical University of Denmark. Copyright 2004-2014. Last updated 2014-08-07. Contents 1 Introduction... 3 2 The
ARM Cortex-M3 Assembly Language
ARM Cortex-M3 Assembly Language When a high level language compiler processes source code, it generates the assembly language translation of all of the high level code into a processor s specific set of
Unix Security Technologies. Pete Markowsky <peterm[at] ccs.neu.edu>
Unix Security Technologies Pete Markowsky What is this about? The goal of this CPU/SWS are: Introduce you to classic vulnerabilities Get you to understand security advisories Make
A deeper look at Inline functions
A deeper look at Inline functions I think it s safe to say that all Overload readers know what C++ inline functions are. When we declare a function or member function as inline we are trying to avoid the
BCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example
BCD (ASCII) Arithmetic We will first look at unpacked BCD which means strings that look like '4567'. Bytes then look like 34h 35h 36h 37h OR: 04h 05h 06h 07h x86 processors also have instructions for packed
IA-32 Intel Architecture Software Developer s Manual
IA-32 Intel Architecture Software Developer s Manual Volume 2B: Instruction Set Reference, N-Z NOTE: The IA-32 Intel Architecture Software Developer s Manual consists of four volumes: Basic Architecture,
Stack Allocation. Run-Time Data Structures. Static Structures
Run-Time Data Structures Stack Allocation Static Structures For static structures, a fixed address is used throughout execution. This is the oldest and simplest memory organization. In current compilers,
W4118 Operating Systems. Junfeng Yang
W4118 Operating Systems Junfeng Yang Outline Linux overview Interrupt in Linux System call in Linux What is Linux A modern, open-source OS, based on UNIX standards 1991, 0.1 MLOC, single developer Linus
telnetd exploit FreeBSD Telnetd Remote Exploit Für Compass Security AG Öffentliche Version 1.0 Januar 2012
telnetd exploit FreeBSD Telnetd Remote Exploit Für Compass Security AG Öffentliche Version 1.0 Januar 2012 Content Part I Info Bug Telnet Exploit Part II Advanced Exploitation Meta Information Disclosed
CHAPTER 7: The CPU and Memory
CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides
Instruction Set Design
Instruction Set Design Instruction Set Architecture: to what purpose? ISA provides the level of abstraction between the software and the hardware One of the most important abstraction in CS It s narrow,
Applying Clang Static Analyzer to Linux Kernel
Applying Clang Static Analyzer to Linux Kernel 2012/6/7 FUJITSU COMPUTER TECHNOLOGIES LIMITED Hiroo MATSUMOTO 管 理 番 号 1154ka1 Copyright 2012 FUJITSU COMPUTER TECHNOLOGIES LIMITED Abstract Now there are
The Plan Today... System Calls and API's Basics of OS design Virtual Machines
System Calls + The Plan Today... System Calls and API's Basics of OS design Virtual Machines System Calls System programs interact with the OS (and ultimately hardware) through system calls. Called when
風 水. Heap Feng Shui in JavaScript. Alexander Sotirov. [email protected]
風 水 Heap Feng Shui in JavaScript Alexander Sotirov [email protected] Black Hat Europe 2007 Introduction What is Heap Feng Shui? the ancient art of arranging heap blocks in order to redirect the program
Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine
7 Objectives After completing this lab you will: know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine Introduction Branches and jumps provide ways to change
Application-Specific Attacks: Leveraging the ActionScript Virtual Machine
IBM Global Technology Services April 2008 Application-Specific Attacks: Leveraging the ActionScript Virtual Machine By Mark Dowd X-Force Researcher IBM Internet Security Systems ([email protected])
Syscall 5. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas
Syscall 5 System call 5 allows input of numerical data from the keyboard while a program is running. Syscall 5 is a bit unusual, in that it requires the use of register $v0 twice. In syscall 5 (as for
Instruction Set Architecture
Instruction Set Architecture Consider x := y+z. (x, y, z are memory variables) 1-address instructions 2-address instructions LOAD y (r :=y) ADD y,z (y := y+z) ADD z (r:=r+z) MOVE x,y (x := y) STORE x (x:=r)
Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C
Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive
Embedded C Programming
Microprocessors and Microcontrollers Embedded C Programming EE3954 by Maarten Uijt de Haag, Tim Bambeck EmbeddedC.1 References MPLAB XC8 C Compiler User s Guide EmbeddedC.2 Assembly versus C C Code High-level
TitanMist: Your First Step to Reversing Nirvana TitanMist. mist.reversinglabs.com
TitanMist: Your First Step to Reversing Nirvana TitanMist mist.reversinglabs.com Contents Introduction to TitanEngine.. 3 Introduction to TitanMist 4 Creating an unpacker for TitanMist.. 5 References and
Nemo 96HD/HD+ MODBUS
18/12/12 Pagina 1 di 28 MULTIFUNCTION FIRMWARE 2.30 Nemo 96HD/HD+ MODBUS COMMUNICATION PROTOCOL CONTENTS 1.0 ABSTRACT 2.0 DATA MESSAGE DESCRIPTION 2.1 Parameters description 2.2 Data format 2.3 Description
Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.
Code Generation I Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.7 Stack Machines A simple evaluation model No variables
Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis
Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis 1 1 Table of Contents 1 Table of Contents... 3 2 Overview... 5 3 Installation... 7 4 The CPU
Computer Architectures
Computer Architectures 2. Instruction Set Architectures 2015. február 12. Budapest Gábor Horváth associate professor BUTE Dept. of Networked Systems and Services [email protected] 2 Instruction set architectures
Machine-Code Generation for Functions
Machine-Code Generation for Functions Cosmin Oancea [email protected] University of Copenhagen December 2012 Structure of a Compiler Programme text Lexical analysis Binary machine code Symbol sequence
Administration. Instruction scheduling. Modern processors. Examples. Simplified architecture model. CS 412 Introduction to Compilers
CS 4 Introduction to Compilers ndrew Myers Cornell University dministration Prelim tomorrow evening No class Wednesday P due in days Optional reading: Muchnick 7 Lecture : Instruction scheduling pr 0 Modern
1 The Java Virtual Machine
1 The Java Virtual Machine About the Spec Format This document describes the Java virtual machine and the instruction set. In this introduction, each component of the machine is briefly described. This
MPLAB TM C30 Managed PSV Pointers. Beta support included with MPLAB C30 V3.00
MPLAB TM C30 Managed PSV Pointers Beta support included with MPLAB C30 V3.00 Contents 1 Overview 2 1.1 Why Beta?.............................. 2 1.2 Other Sources of Reference..................... 2 2
Betriebssysteme KU Security
Betriebssysteme KU Security IAIK Graz University of Technology 1 1. Drivers 2. Security - The simple stuff 3. Code injection attacks 4. Side-channel attacks 2 1. Drivers 2. Security - The simple stuff
l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language
198:211 Computer Architecture Topics: Processor Design Where are we now? C-Programming A real computer language Data Representation Everything goes down to bits and bytes Machine representation Language
İSTANBUL AYDIN UNIVERSITY
İSTANBUL AYDIN UNIVERSITY FACULTY OF ENGİNEERİNG SOFTWARE ENGINEERING THE PROJECT OF THE INSTRUCTION SET COMPUTER ORGANIZATION GÖZDE ARAS B1205.090015 Instructor: Prof. Dr. HASAN HÜSEYİN BALIK DECEMBER
5 Arrays and Pointers
5 Arrays and Pointers 5.1 One-dimensional arrays Arrays offer a convenient way to store and access blocks of data. Think of arrays as a sequential list that offers indexed access. For example, a list of
Caml Virtual Machine File & data formats Document version: 1.4 http://cadmium.x9c.fr
Caml Virtual Machine File & data formats Document version: 1.4 http://cadmium.x9c.fr Copyright c 2007-2010 Xavier Clerc [email protected] Released under the LGPL version 3 February 6, 2010 Abstract: This
what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?
Inside the CPU how does the CPU work? what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? some short, boring programs to illustrate the
Lecture 2. Binary and Hexadecimal Numbers
Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations
Chapter 5 Instructor's Manual
The Essentials of Computer Organization and Architecture Linda Null and Julia Lobur Jones and Bartlett Publishers, 2003 Chapter 5 Instructor's Manual Chapter Objectives Chapter 5, A Closer Look at Instruction
Bypassing Anti- Virus Scanners
Bypassing Anti- Virus Scanners Abstract Anti-Virus manufacturers nowadays implements more and more complex functions and algorithms in order to detect the latest and newest viruses along with their variants.
Adapting the PowerPC 403 ROM Monitor Software for a 512Kb Flash Device
Adapting the PowerPC 403 ROM Monitor Software for a 512Kb Flash Device IBM Microelectronics Dept D95/Bldg 060 3039 Cornwallis Road Research Triangle Park, NC 27709 Version: 1 December 15, 1997 Abstract
MICROPROCESSOR AND MICROCOMPUTER BASICS
Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit
a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.
CS143 Handout 18 Summer 2008 30 July, 2008 Processor Architectures Handout written by Maggie Johnson and revised by Julie Zelenski. Architecture Vocabulary Let s review a few relevant hardware definitions:
System/Networking performance analytics with perf. Hannes Frederic Sowa <[email protected]>
System/Networking performance analytics with perf Hannes Frederic Sowa Prerequisites Recent Linux Kernel CONFIG_PERF_* CONFIG_DEBUG_INFO Fedora: debuginfo-install kernel for
Practical taint analysis for protecting buggy binaries
Practical taint analysis for protecting buggy binaries So your exploit beats ASLR/DEP? I don't care Erik Bosman Traditional Stack Smashing buf[16] GET / HTTP/1.100baseretnarg1arg2 Traditional
