summaryrefslogtreecommitdiff
path: root/exploits/7350wurm/doc/free.txt
blob: 33fa2baa724532e0744580ff6f17688ce1e92431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

break *0x8058afb

0x400aacc8 <__libc_free>:       push   %ebp
0x400aacc9 <__libc_free+1>:     mov    %esp,%ebp
0x400aaccb <__libc_free+3>:     push   %edi
0x400aaccc <__libc_free+4>:     push   %esi
0x400aaccd <__libc_free+5>:     push   %ebx
0x400aacce <__libc_free+6>:     call   0x400aacd3 <__libc_free+11>
0x400aacd3 <__libc_free+11>:    pop    %ebx
0x400aacd4 <__libc_free+12>:    add    $0x957b9,%ebx
0x400aacda <__libc_free+18>:    mov    0x8(%ebp),%ecx			; ecx = parameter
0x400aacdd <__libc_free+21>:    mov    0x848(%ebx),%eax
0x400aace3 <__libc_free+27>:    mov    (%eax),%eax			; __free_hook
0x400aace5 <__libc_free+29>:    test   %eax,%eax			; == NULL ?
0x400aace7 <__libc_free+31>:    je     0x400aacf4 <__libc_free+44>	; -> skip

0x400aace9 <__libc_free+33>:    pushl  0x4(%ebp)
0x400aacec <__libc_free+36>:    push   %ecx
0x400aaced <__libc_free+37>:    call   *%eax
0x400aacef <__libc_free+39>:    jmp    0x400aad8a <__libc_free+194>

0x400aacf4 <__libc_free+44>:    test   %ecx,%ecx			; free (NULL) ?
0x400aacf6 <__libc_free+46>:    je     0x400aad8a <__libc_free+194>	; -> exit

0x400aacfc <__libc_free+52>:    lea    0xfffffff8(%ecx),%esi		; esi = ecx - 8
0x400aacff <__libc_free+55>:    mov    0xfffffffc(%ecx),%eax		; eax = [ecx - 4] (size)
0x400aad02 <__libc_free+58>:    test   $0x2,%al				; mmapped ?
0x400aad04 <__libc_free+60>:    je     0x400aad30 <__libc_free+104>

0x400aad06 <__libc_free+62>:    and    $0xfc,%al			; MUNMAP
0x400aad08 <__libc_free+64>:    decl   0xfffff010(%ebx)
0x400aad0e <__libc_free+70>:    mov    %eax,%edx
0x400aad10 <__libc_free+72>:    add    0xfffffff8(%ecx),%edx
0x400aad13 <__libc_free+75>:    sub    %edx,0xfffff018(%ebx)
0x400aad19 <__libc_free+81>:    mov    0xfffffff8(%ecx),%edx
0x400aad1c <__libc_free+84>:    add    %edx,%eax
0x400aad1e <__libc_free+86>:    push   %eax
0x400aad1f <__libc_free+87>:    sub    %edx,%esi
0x400aad21 <__libc_free+89>:    push   %esi
0x400aad22 <__libc_free+90>:    call   0x400ffd80 <__munmap>
0x400aad27 <__libc_free+95>:    jmp    0x400aad8a <__libc_free+194>
0x400aad29 <__libc_free+97>:    lea    0x0(%esi,1),%esi

0x400aad30 <__libc_free+104>:   lea    0xffffebb4(%ebx),%eax
0x400aad36 <__libc_free+110>:   cmp    0xffffebbc(%ebx),%esi
0x400aad3c <__libc_free+116>:   jae    0x400aad46 <__libc_free+126>
0x400aad3e <__libc_free+118>:   cmp    0xfffff008(%ebx),%esi
0x400aad44 <__libc_free+124>:   jae    0x400aad52 <__libc_free+138>
0x400aad46 <__libc_free+126>:   mov    %esi,%edx
0x400aad48 <__libc_free+128>:   and    $0xfff00000,%edx

segfault
0x400aad4e <__libc_free+134>:   mov    (%edx),%edi
0x400aad50 <__libc_free+136>:   jmp    0x400aad54 <__libc_free+140>
0x400aad52 <__libc_free+138>:   mov    %eax,%edi
0x400aad54 <__libc_free+140>:   cmpl   $0x0,0x738(%ebx)
0x400aad5b <__libc_free+147>:   je     0x400aad6c <__libc_free+164>
0x400aad5d <__libc_free+149>:   lea    0x410(%edi),%eax
0x400aad63 <__libc_free+155>:   push   %eax
0x400aad64 <__libc_free+156>:   call   0x400684ec <_ufc_foobar+223884>
0x400aad69 <__libc_free+161>:   add    $0x4,%esp
0x400aad6c <__libc_free+164>:   mov    %esi,%edx
0x400aad6e <__libc_free+166>:   mov    %edi,%eax
0x400aad70 <__libc_free+168>:   call   0x400aad94 <chunk_free>
0x400aad75 <__libc_free+173>:   cmpl   $0x0,0x74c(%ebx)
0x400aad7c <__libc_free+180>:   je     0x400aad8a <__libc_free+194>
0x400aad7e <__libc_free+182>:   lea    0x410(%edi),%eax
0x400aad84 <__libc_free+188>:   push   %eax
0x400aad85 <__libc_free+189>:   call   0x40068d7c <_ufc_foobar+226076>
0x400aad8a <__libc_free+194>:   lea    0xfffffff4(%ebp),%esp
0x400aad8d <__libc_free+197>:   pop    %ebx
0x400aad8e <__libc_free+198>:   pop    %esi
0x400aad8f <__libc_free+199>:   pop    %edi
0x400aad90 <__libc_free+200>:   leave  
0x400aad91 <__libc_free+201>:   ret    
0x400aad92 <__libc_free+202>:   mov    %esi,%esi