[Register]
rbx = 0x401A40
=================================
[Memory]
0x401a40 | 0x0000000012345678
0x401a48 | 0x0000000000C0FFEE
0x401a50 | 0x00000000DEADBEEF
0x401a58 | 0x00000000CAFEBABE
0x401a60 | 0x0000000087654321
=================================
[Code]
1: mov rax, [rbx+8]
2: lea rax, [rbx+8]
mov: 데이터 복사 명령어
rax = 0x401A40+0x8 = 0x401A48
=> 0xCOFFEE
[Register]
rbx = 0x401A40
=================================
[Memory]
0x401a40 | 0x0000000012345678
0x401a48 | 0x0000000000C0FFEE
0x401a50 | 0x00000000DEADBEEF
0x401a58 | 0x00000000CAFEBABE
0x401a60 | 0x0000000087654321
=================================
[Code]
1: mov rax, [rbx+8]
2: lea rax, [rbx+8]
lea: call by reference(주소 리턴 명령어)
0x401A48
[Register]
rax = 0x31337
rbx = 0x555555554000
rcx = 0x2
=================================
[Memory]
0x555555554000| 0x0000000000000000
0x555555554008| 0x0000000000000001
0x555555554010| 0x0000000000000003
0x555555554018| 0x0000000000000005
0x555555554020| 0x000000000003133A
==================================
[Code]
1: add rax, [rbx+rcx*8]
2: add rcx, 2
3: sub rax, [rbx+rcx*8]
4: inc rax
0x31337 + 0x2*8 = 0x3133A
[Register]
rax = 0x31337
rbx = 0x555555554000
rcx = 0x2
=================================
[Memory]
0x555555554000| 0x0000000000000000
0x555555554008| 0x0000000000000001
0x555555554010| 0x0000000000000003
0x555555554018| 0x0000000000000005
0x555555554020| 0x000000000003133A
==================================
[Code]
1: add rax, [rbx+rcx*8]
2: add rcx, 2
3: sub rax, [rbx+rcx*8]
4: inc rax
1
rax=0x3133A
rcs=0x2
2
rax=0x3133A
rcs=0x4
3
rax=0x0
rcs=0x4
Q5. Code를 4까지 실행했을 때, rax에 저장된 값은?
4
rax=0x1
[Register]
rax = 0xffffffff00000000
rbx = 0x00000000ffffffff
rcx = 0x123456789abcdef0
==================================
[Code]
1: and rax, rcx
2: and rbx, rcx
3: or rax, rbx
rax = 11111111 11111111 11111111 11111111 00000000 00000000 00000000 00000000
rcx = 00010010 00110100 01010110 01111000 10011010 10101100 11101111 00000000
rax & rcx =
11111111 11111111 11111111 11111111 00000000 00000000 00000000 00000000
&
00010010 00110100 01010110 01111000 10011010 10101100 11101111 00000000
=
00010010 00110100 01010110 01111000 00000000 00000000 00000000 00000000
=> rax = 0x1234567800000000
Q7. Code를 2까지 실행했을 때, rbx에 저장된 값은?
rbx = 0x00000000ffffffff
rcx = 0x123456789abcdef0
=> rbx = 0x000000009abcdef0
Q8. Code를 3까지 실행했을 때, rax에 저장된 값은?
rax = 0x1234567800000000
rbx = 0x000000009abcdef0
=> rax = 0x123456789abcdef0
[Register]
rax = 0x35014541
rbx = 0xdeadbeef
==================================
[Code]
1: xor rax, rbx
2: xor rax, rbx
3: not eax
0x35014541 ^ 0xdeadbeef = 0xebacfbae
Q10. Code를 2까지 실행했을 때, rax에 저장된 값은?
0xdbe1f8ce ^ 0xdeadbeef = 0x35014541
Q11. Code를 3까지 실행했을 때, rax에 저장된 값은?
rax = 0x35014541
~rax = 0xCAFEBABE
'정보보안 > 시스템 해킹' 카테고리의 다른 글
ASLR&NX (0) | 2024.12.22 |
---|---|
시스템 해킹 입문하며 (0) | 2024.12.22 |
Stack Buffer Overflow (0) | 2024.11.25 |
Stack Canary (0) | 2024.11.25 |