list.c
lines 18 to 25 of 42
18
__attribute__
(
(
noinline
)
)
static
struct
node
*
reverse
(
struct
n
…
19
struct
node
*
prev
=
NULL
;
20
while
(
head
)
{
21
struct
node
*
next
=
head
-
>
next
;
22
head
-
>
next
=
prev
;
23
prev
=
head
;
24
head
=
next
;
25
}
disassembly
reverse
10019
16
20
mov
rbp, rsp
10019
19
xor
eax, eax
10019
1b
nop
[rax + rax]
10019
20
mov
rcx, rax
10019
23
mov
rax, rdi
10019
26
21
mov
rdi, [rdi + 8]
1004098
1004070
9
10019
2a
22
mov
[rax + 8], rcx
10019
2e
20
test
rdi, rdi
10019
31
jne
1001920
10019
33
pop
rbp
10019
34
26
ret
registers
stack
heap
code
data
rwx
read-only
rbx
0
rdx
0
rsi
10040c0
r8
7ffff7e19ac0
r9
0x20
32
r10
0x10
16
r11
7ffff7e19ac8
r12
7fffffffee38
r13
1
r14
7ffff7ffd000
r15
10029c0
rax
1004090
4
rcx
10040b0
1
rdi
1004070
9
rbp
7fffffffece0
7fffffffed00
7fffffffedb0
7fffffffee10
0
rsp
7fffffffece0
7fffffffed00
7fffffffedb0
7fffffffee10
0
rip
1001926
reverse+22
cf
PF
af
zf
sf
IF
df
of
stack
thirteen words from rsp · the frames they belong to
rbp rsp
+0
saved rbp
7fffffffe
ce0
7fffffffed00
+8
7fffffffe
ce8
10018b0
main+80
+10
7fffffffe
cf0
7ffff7e20de8
+18
saved rbx
7fffffffe
cf8
0
+20
saved rbp
7fffffffe
d00
7fffffffedb0
+28
7fffffffe
d08
7ffff7c27781
libc+27781
+30
7fffffffe
d10
7ffff7fe0c60
ld.so+22c60
+38
7fffffffe
d18
7fffffffee38
+40
7fffffffe
d20
0x1f7fbe000
+48
7fffffffe
d28
1001860
main+0
+50
7fffffffe
d30
7fffffffed70
+58
7fffffffe
d38
+60
7fffffffe
d40
0
reverse
main
libc+27781
its bytes
the heap, 1004050 to 10040bf
10040
50
10
00
00
00
00
00
00
00
16
30
40
00
01
00
00
00
00
1004030
10040
60
00
00
00
00
00
00
00
00
21
00
00
00
00
00
00
00
malloc's: a chunk of 32
10040
70
09
00
00
00
00
00
00
00
9
50
40
00
01
00
00
00
00
1004050
10040
80
00
00
00
00
00
00
00
00
21
00
00
00
00
00
00
00
malloc's: a chunk of 32
10040
90
04
00
00
00
00
00
00
00
4
70
40
00
01
00
00
00
00
1004070
10040
a0
00
00
00
00
00
00
00
00
21
00
00
00
00
00
00
00
malloc's: a chunk of 32
10040
b0
01
00
00
00
00
00
00
00
1
00
00
00
00
00
00
00
00
NULL
the list
10040b0
1
rcx
1004090
4
rax
1004070
9
rdi
1004050
16
1004030
25
1004010
36
moment 3 of 4
The load read the word at 1004098: the address of the next node.
rdi holds it now, and points at the node whose value is 9.