You are on page 1of 11

Module

 1:  64-­‐Bit  ASM  on  Linux  

4.  CPU  Registers  

Vivek  Ramachandran  
SWSE,  SMFE,  SPSE,  SGDE,  SISE,  SLAE64,  SLAE32  Course  Instructor  

hJp://SecurityTube-­‐Training.com    

©SecurityTube.net  
System  OrganizaTon  Basics  

CPU  

System  Bus   Memory  

I/O  Devices  

©SecurityTube.net  
CPU  

Registers  

Control  Unit   CPU  


Execu<on  Unit  
Flags  

• Control  Unit  –  Retrieve  /  Decode  instrucTons,  Retrieve  /  Store  data  in  


memory  

• Execu<on  Unit  –  Actual  execuTon  of  instrucTon  happens  here  

• Registers  -­‐    Internal  memory  locaTons  used  as  “variables”  

• Flags  –    Used  to  indicate  various  “event”  when  execuTon  is  happening  

©SecurityTube.net  
General  Purpose  Registers  
EAX  

RAX   AH   AL  
63   31   15   7   0  
EBX   AX  

RBX   BH   BL  
63   31   15   7   0  
ECX   BX  

RCX   CH   CL  
63   31   15   7   0  
EDX   CX  

RDX   DH   DL  
63   31   15   7   0  
©SecurityTube.net   DX  
General  Purpose  Registers  
ESI  

RSI   SIL  
63   31   15   7   0  
EDI   SI  

RDI   DIL  
63   31   15   7   0  
EBP   DI  

RBP   BPL  
63   31   15   7   0  
ESP   BP  

RSP   SPL  
63   31   15   7   0  
©SecurityTube.net   SP  
General  Purpose  Registers  
R8D  

R8   R8B  
63   31   15   7   0  
R9D   R8W  

R9   R9B  
63   31   15   7   0  
R10D   R9W  

R10   R10B  
63   31   15   7   0  
R11D   R10W  

R11   R11B  
63   31   15   7   0  
©SecurityTube.net   R11W  
General  Purpose  Registers  
R12D  

R12   R12B  
63   31   15   7   0  
R13D   R12W  

R13   R13B  
63   31   15   7   0  
R14D   R13W  

R14   R14B  
63   31   15   7   0  
R15D   R14W  

R15   R15B  
63   31   15   7   0  
©SecurityTube.net   R15W  
Very  Very  Important  

Source:  Intel  Manual    


©SecurityTube.net  
RFLAGS    =  Reserved  32-­‐bits  +  EFLAGS  
Register  

Ref:  Intel  manual  for  IA-­‐32   ©SecurityTube.net  


RIP  

RIP  
63   31   0  

•  InstrucTon  Pointer    
•  Holy  grail  for  Shellcoding,  Exploit  Research  etc.  
•  Support  RIP  RelaTve  Addressing  which  makes  
Shellcoding  easier  

©SecurityTube.net  
Intel  Manuals  

•  Architecture  and  Soaware  Development  Docs  

hJp://www.intel.com/content/www/us/en/
processors/architectures-­‐soaware-­‐developer-­‐
manuals.html    
 
 

©SecurityTube.net  

You might also like