Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.

Slides:



Advertisements
Similar presentations
University of Washington Procedures and Stacks II The Hardware/Software Interface CSE351 Winter 2013.
Advertisements

4/14/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
Binghamton University CS-220 Spring 2015 Binghamton University CS-220 Spring 2015 x86 Assembler.
High-Level Language Interface Chapter 17 S. Dandamudi.
Chapter 3 Elements of Assembly Language. 3.1 Assembly Language Statements.
CSC 221 Computer Organization and Assembly Language
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Carnegie Mellon 1 Odds and Ends Intro to x86-64 Memory Layout.
Overview of Assembly Language Chapter 4 S. Dandamudi.
3/17/20161 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
1 Machine-Level Programming II: Basics Comp 21000: Introduction to Computer Organization & Systems Spring 2016 Instructor: John Barr * Modified slides.
Type of addressing mode
Spring 2016Assembly Review Roadmap 1 car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Car c = new Car(); c.setMiles(100);
Credits and Disclaimers
Machine dependent Assembler Features
Credits and Disclaimers
ECE 3430 – Intro to Microcomputer Systems
Assembly Programming II CSE 351 Spring 2017
Credits and Disclaimers
Instructor: Your TA(s)
Y86-64 Instructions 8-byte integer operations (no floating point!)  “word” (it is considered a long word for historical reasons, because the original.
Microprocessor and Assembly Language
Understanding x86-64 Assembly for Reverse Engineering & Exploits
Licensing information
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
x86 Programming I CSE 351 Autumn 2016
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Machine-Level Programming III: Procedures /18-213/14-513/15-513: Introduction to Computer Systems 7th Lecture, September 18, 2018.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah –
Assembly Programming II CSE 410 Winter 2017
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
x86-64 Programming I CSE 351 Autumn 2017
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah –
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Machine Level Representation of Programs (IV)
x86-64 Programming I CSE 351 Winter 2018
x86-64 Programming I CSE 351 Winter 2018
Computer Architecture and System Programming Laboratory
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
x86-64 Programming I CSE 351 Autumn 2018
Machine-Level Programming II: Basics Comp 21000: Introduction to Computer Organization & Systems Instructor: John Barr * Modified slides from the book.
Machine-Level Programming II: Basics Comp 21000: Introduction to Computer Organization & Systems Spring 2016 Instructor: John Barr * Modified slides.
Machine-Level Programming I: Basics Comp 21000: Introduction to Computer Organization & Systems Instructor: John Barr * Modified slides from the book.
Ithaca College Machine-Level Programming VII: Procedures Comp 21000: Introduction to Computer Systems & Assembly Lang Spring 2017.
Credits and Disclaimers
Credits and Disclaimers
Credits and Disclaimers
Credits and Disclaimers
x86-64 Programming I CSE 351 Spring 2019
Instructor: Your TA(s)
Low level Programming.
Presentation transcript:

Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail

All materials is licensed under a Creative Commons “Share Alike” license. http://creativecommons.org/licenses/by-sa/3.0/ Attribution condition: You must indicate that derivative work "Is derived from Xeno Kovah's ‘Intro x86-64’ class, available at http://OpenSecurityTraining.info/IntroX86-64.html" Attribution condition: You must indicate that derivative work "Is derived from Xeno Kovah's 'Intro x86-64’ class, available at http://OpenSecurityTraining.info/IntroX86-64.html”

Intel vs. AT&T Syntax Intel: Destination <- Source(s) Windows. Think algebra or C: y = 2x + 1; mov rbp, rsp add rsp, 0x14 ; (rsp = rsp + 0x14) AT&T: Source(s) -> Destination *nix/GNU. Think elementary school: 1 + 2 = 3 mov %rsp, %rbp add $0x14,%rsp So registers get a % prefix and immediates get a $ My classes will use Intel syntax except in this section But it’s important to know both, so you can read documents in either format.

Intel vs AT&T Syntax 2 For instructions which can operate on different sizes, the mnemonic will have an indicator of the size. movb - operates on bytes mov/movw - operates on word (2 bytes) movl - operates on “long” (dword) (4 bytes) movq - operates on “quad word” (qword) (8 bytes) Intel indicates size with things like “mov dword ptr [rax], but it’s not in the actual mnemonic of the instruction Will occasionally see things like “movzwl” which is move with zero extend from a word to a long

Intel vs AT&T Syntax 3 In my opinion the hardest-to-read difference is for r/m32 values For intel it’s expressed as [base + index*scale + disp] For AT&T it’s expressed as disp(base, index, scale) Examples: call DWORD PTR [rbx+rsi*4-0xe8] callq *-0xe8(%rbx,%rsi,4) mov rax, DWORD PTR [rbp+0x8] movq 0x8(%rbp), %rax lea rax, [rbx-0xe8] leaq -0xe8(%rbx), %rax And some versions of the gnu tools, instead of using like “mov -0x4(%rbp)” will show it as “mov 0xFFFFFFFC(%rbp)” Some more links talking about the differences http://en.wikipedia.org/wiki/X86_assembly_lang uage http://www.w00w00.org/files/articles/att-vs- intel.txt <- haxors ;) http://sig9.com/articles/att-syntax

TODO Create a game that shows two instructions in AT&T syntax and Intel syntax, and asks the students whether they’re the same or not (The +100/-200 helps mitigate advantage of guessing)