Introduction To Software Reverse Engineering With Ghidra Session 1
Introduction To Software Reverse Engineering With Ghidra Session 1
• @wrongbaud
• wrongbaud.github.io
Compile Assemble
Link
R0 RAX EAX AX AH
R1 RCX ECX CX CH
R2 RDX EDX DX DH
R3 RBX EBX BX BH
R4 RSP ESP SP
R5 RBP EBP BP
R6 RSI ESI SI
R7 RDI EDI DI
• Add: Adds the two values together, storing the result in the first
argument
• add rax, rbx
• Adds rbx to rax, the result is stored in rax
• rax += rbx
• Sub: Subtracts the second operand from the first one, storing the
result in the first operand
• sub rax, rbx
• Subtracts rbx from rax, stores the result in rax
• rax -= rbx
• Performs the binary operation AND on the two operands, storing the
result in the first
• and rax,rax
• rax = rax & rax
• push will grow the stack by 8 and store the operand contents on the
stack
• push rax
• Increases the value pointed to by rsp by 8, and stores rax there
• pop will load the value pointed to by rsp into the operand
• pop rbx
• Loads the value pointed by rsp into rbx, and decreases rsp by 8
PUSH RAX
PUSH RBX RBX
PUSH RCX
POP RAX
RAX
• Register to Register
• xor rax,rax; clears the value in RAX
• Indirect Access:
• add rax, [rbx]; adds the value pointed to by rbx into rax
• mov rbx, 1234[8*rax+rcx]
• move word at address 8*RAX+RCX+1234 into rbx
XRefs: Operands:
Address
These field: These
This arewhen
the the
represents
are generated Ghidra
Mnemonic:
Bytes: This isare
There thethe
instruction
opcodes that
that
registers/memory
memory
detects address
other locations
where
locations used
orthis by
data isthe
instructions
has been disassembled
represent from the
the instructionsopcode
instruction
located
that reference this address
• For the next session, review the c3/c4 exercises in the github
repository
• Feel free to bring all questions to Thursday’s office hour!