Rev 659 | Rev 662 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
659 | serge | 1 | |
2 | |||
3 | |||
4 | locals |
||
5 | image dd ? |
||
6 | endl |
||
7 | |||
8 | |||
9 | test eax, eax |
||
10 | jz .fail |
||
11 | |||
12 | |||
13 | |||
14 | |||
15 | |||
16 | |||
17 | test eax, eax |
||
18 | jz .cleanup |
||
19 | |||
20 | |||
21 | ret |
||
22 | .cleanup: |
||
23 | stdcall kernel_free,[image] |
||
24 | .fail: |
||
25 | xor eax, eax |
||
26 | ret |
||
27 | endp |
||
28 | |||
29 | |||
30 | |||
31 | map_PE: |
||
32 | cld |
||
33 | push ebp |
||
34 | push edi |
||
35 | push esi |
||
36 | push ebx |
||
37 | sub esp, 28 |
||
38 | |||
39 | |||
40 | mov ebx, [esp+48] |
||
41 | mov dword [esp+20], 0 |
||
42 | add edx, [edx+60] |
||
43 | movzx eax, word [edx+6] |
||
44 | mov [esp+16], edx |
||
45 | mov [esp+12], eax |
||
46 | jmp .L6 |
||
47 | .L7: |
||
48 | mov eax, [edx+264] |
||
49 | mov ebp, [edx+260] |
||
50 | mov esi, [esp+52] |
||
51 | add esi, [edx+268] |
||
52 | mov ecx, eax |
||
53 | lea edi, [ebx+ebp] |
||
54 | |||
55 | |||
56 | rep movsd |
||
57 | |||
58 | |||
59 | cmp ecx, eax |
||
60 | jbe .L8 |
||
61 | sub ecx, eax |
||
62 | |||
63 | |||
64 | rep stosb |
||
65 | |||
66 | |||
67 | inc dword [esp+20] |
||
68 | add edx, 40 |
||
69 | .L6: |
||
70 | mov eax, [esp+12] |
||
71 | cmp [esp+20], eax |
||
72 | jne .L7 |
||
73 | |||
74 | |||
75 | cmp dword [edx+164], 0 |
||
76 | je .L11 |
||
77 | |||
78 | |||
79 | mov ecx, ebx |
||
80 | sub edi, [edx+52] |
||
81 | add ecx, [edx+160] |
||
82 | mov eax, edi |
||
83 | shr eax, 16 |
||
84 | mov [esp+4], eax |
||
85 | jmp .L13 |
||
86 | .L14: |
||
87 | lea esi, [eax-8] |
||
88 | xor ebp, ebp |
||
89 | shr esi,1 |
||
90 | jmp .L15 |
||
91 | .L16: |
||
92 | movzx eax, word [ecx+8+ebp*2] |
||
93 | mov edx, eax |
||
94 | shr eax, 12 |
||
95 | and edx, 4095 |
||
96 | add edx, [ecx] |
||
97 | cmp ax, 2 |
||
98 | je .L19 |
||
99 | |||
100 | |||
101 | je .L20 |
||
102 | |||
103 | |||
104 | jne .L17 |
||
105 | |||
106 | |||
107 | add word [edx+ebx], ax |
||
108 | .L19: |
||
109 | add word [edx+ebx], di |
||
110 | .L20: |
||
111 | add [edx+ebx], edi |
||
112 | .L17: |
||
113 | inc ebp |
||
114 | .L15: |
||
115 | cmp ebp, esi |
||
116 | jne .L16 |
||
117 | add ecx, [ecx+4] |
||
118 | .L13: |
||
119 | mov eax, [ecx+4] |
||
120 | test eax, eax |
||
121 | jne .L14 |
||
122 | .L11: |
||
123 | mov edx, [esp+16] |
||
124 | cmp dword [edx+132], 0 |
||
125 | je .L22 |
||
126 | |||
127 | |||
128 | add eax, [edx+128] |
||
129 | lea esi, [eax+20] |
||
130 | .L24: |
||
131 | cmp dword [esi-16], 0 |
||
132 | jne .L25 |
||
133 | |||
134 | |||
135 | je .L22 |
||
136 | .L25: |
||
137 | mov ecx, [esi-20] |
||
138 | mov ebp, ebx |
||
139 | add ebp, [esi-4] |
||
140 | add ecx, ebx |
||
141 | mov [esp+24], ecx |
||
142 | .L27: |
||
143 | mov edx, [esp+24] |
||
144 | mov eax, [edx] |
||
145 | test eax, eax |
||
146 | je .L28 |
||
147 | |||
148 | |||
149 | js .L28 |
||
150 | |||
151 | |||
152 | mov edi, kernel_export |
||
153 | mov dword [ebp], -1 |
||
154 | mov [esp+8], eax |
||
155 | .L31: |
||
156 | push ecx |
||
157 | push 16 |
||
158 | push dword [edi] |
||
159 | push dword [esp+20] |
||
160 | call strncmp |
||
161 | pop edx |
||
162 | test eax, eax |
||
163 | jne .L32 |
||
164 | |||
165 | |||
166 | mov [ebp], eax |
||
167 | jmp .L34 |
||
168 | .L32: |
||
169 | add edi, 8 |
||
170 | cmp dword [edi], 0 |
||
171 | jne .L31 |
||
172 | .L34: |
||
173 | add dword [esp+24], 4 |
||
174 | add ebp, 4 |
||
175 | jmp .L27 |
||
176 | .L28: |
||
177 | add esi, 20 |
||
178 | jmp .L24 |
||
179 | .L22: |
||
180 | |||
181 | |||
182 | add ebx, [ecx+40] |
||
183 | |||
184 | |||
185 | mov eax, ebx |
||
186 | |||
187 | |||
188 | pop esi |
||
189 | pop edi |
||
190 | pop ebp |
||
191 | |||
192 | |||
193 |