Introduce
시스템 해커는 어셈블리어어로 작성된 소프트웨어에서 취약점을 발견해야한다
Assembly Language
Assembler
개발자들이 작성한 어셈블리어 -> 컴퓨터가 이해 할 수 있는 기계어로 치환하는 통역사
Disassembler
기계어 -> 어셈블리 언어로 번역
Assembly Language and x86-64
Assembly Language
CPU 에서 사용되는 ISA (Instruction Set Architecture) 가 여러 종류인 것 과 같이 다양한 수의 어셈블리어가 존재한다
x64 Assembly Language
문법 구조
- 명령어(operation Code, Opcode)
- 피연산자 (Operand)
명령어 ; Opcode
- 데이터 이동 (Data Transfer)
mov, lea
- 산술 연산 (Arithmetic)
inc, dec, add, sub
- 논리 연산 (Logical)
and, or, xor, not
- 비교 (Comparison)
cmp, test
- 분기 (Branch)
jmp, je, jg
- 스택 (Stack)
push, pop
- 프룃져 (Procedure)
call, ret, leave
- 시스템 콜 (System Call)
sycall
Operand
- Immediate Value (상수)
- Register (레지스터)
- memory (메모리)

Type PTR : Size Directive (크기 지정자) 가 추가 될 수 있음
type
- BYTE : 1byte
- WORD : 2 byte
- DWORD : 4byte
- QWORD : 8byte
Opcode: x86-86 Assembly Language
Ddata Transfer




Arithmethic




Q . [rbx+rcx*8] 에서 rcx 는 왜 0x10(0x555555554010) 인지?
Logical ; 논리연산
And

Or



xor

not


Q. xor 연산
Comparison ; 비교
두 피연산자의 값을 비교하고, 플래그를 설정

Branch ; 분기
rip 를 이동시켜 실행흐름 변경
