Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1671 | mario79 | 1 | ;* Call: *************************************************************** |
2 | lzma_decompress: |
||
3 | push esi |
||
4 | push edi |
||
5 | push ebx |
||
6 | push ebp |
||
7 | mov esi,[esp+0x14] |
||
8 | xor ebp,ebp |
||
9 | mov edi,0xD6B8 |
||
10 | inc esi |
||
11 | lodsd |
||
12 | bswap eax |
||
13 | stosd |
||
14 | xor eax,eax |
||
15 | dec eax |
||
16 | stosd |
||
17 | stosd |
||
18 | stosd |
||
19 | stosd |
||
20 | xchg esi,eax |
||
21 | stosd |
||
22 | mov ecx,0x1F36 |
||
23 | mov eax,0x400 |
||
24 | mov edi,0x59E0 |
||
25 | rep stosd |
||
26 | mov edi,[esp+0x18] |
||
27 | mov ebx, edi |
||
28 | add ebx,[esp+0x1C] |
||
29 | ;-------------------------------------------------------------------- |
||
30 | .labl_00: |
||
31 | cmp edi,ebx |
||
32 | jnb .labl_19 |
||
33 | mov edx,edi |
||
34 | and edx,3 |
||
35 | push eax |
||
36 | mov eax,ebp |
||
37 | shl eax,6 |
||
38 | lea eax,[eax+edx*4+0x59E0] |
||
39 | call cm_pr_20 |
||
40 | pop eax |
||
41 | jb .labl_06 |
||
42 | movzx eax,al |
||
43 | shr eax,5 |
||
44 | imul eax,eax,0xC00 |
||
45 | add eax,0x76B8 |
||
46 | mov cl,1 |
||
47 | cmp ebp,7 |
||
48 | jb .labl_02 |
||
49 | mov dl,[edi+esi] |
||
50 | ;-------------------------------------------------------------------- |
||
51 | .labl_01: |
||
52 | add dl,dl |
||
53 | setb ch |
||
54 | push eax |
||
55 | lea eax,[eax+ecx*4+0x400] |
||
56 | call cm_pr_20 |
||
57 | pop eax |
||
58 | adc cl,cl |
||
59 | jb .labl_03 |
||
60 | xor ch,cl |
||
61 | test ch,1 |
||
62 | mov ch,0 |
||
63 | je .labl_01 |
||
64 | ;-------------------------------------------------------------------- |
||
65 | .labl_02: |
||
66 | push eax |
||
67 | lea eax,[eax+ecx*4] |
||
68 | call cm_pr_20 |
||
69 | pop eax |
||
70 | adc cl,cl |
||
71 | jnb .labl_02 |
||
72 | ;-------------------------------------------------------------------- |
||
73 | .labl_03: |
||
74 | mov eax,ebp |
||
75 | cmp al,4 |
||
76 | jb .labl_04 |
||
77 | cmp al,0xA |
||
78 | mov al,3 |
||
79 | jb .labl_04 |
||
80 | mov al,6 |
||
81 | ;-------------------------------------------------------------------- |
||
82 | .labl_04: |
||
83 | sub ebp,eax |
||
84 | xchg ecx,eax |
||
85 | ;-------------------------------------------------------------------- |
||
86 | .labl_05: |
||
87 | stosb |
||
88 | jmp .labl_00 |
||
89 | ;-------------------------------------------------------------------- |
||
90 | .labl_06: |
||
91 | lea eax,[0x5CE0+ebp*4] |
||
92 | call cm_pr_20 |
||
93 | jnb .labl_09 |
||
94 | add eax,0x30 ;'0' |
||
95 | call cm_pr_20 |
||
96 | jb .labl_07 |
||
97 | mov eax, ebp |
||
98 | shl eax,6 |
||
99 | lea eax,[eax+edx*4+0x5DA0] |
||
100 | call cm_pr_20 |
||
101 | jb .labl_08 |
||
102 | cmp ebp,7 |
||
103 | sbb ebp,ebp |
||
104 | lea ebp,[ebp+ebp+0xB] |
||
105 | mov al,[edi+esi] |
||
106 | jmp .labl_05 |
||
107 | ;-------------------------------------------------------------------- |
||
108 | .labl_07: |
||
109 | add eax,0x30 ;'0' |
||
110 | call cm_pr_20 |
||
111 | xchg esi,[0xD6C0] |
||
112 | jnb .labl_08 |
||
113 | add eax,0x30 ;'0' |
||
114 | call cm_pr_20 |
||
115 | xchg esi,[0xD6C4] |
||
116 | jnb .labl_08 |
||
117 | xchg esi,[0xD6C8] |
||
118 | ;-------------------------------------------------------------------- |
||
119 | .labl_08: |
||
120 | mov eax,0x6EB0 |
||
121 | call cm_pr_22 |
||
122 | push 8 |
||
123 | jmp .labl_17 |
||
124 | ;-------------------------------------------------------------------- |
||
125 | .labl_09: |
||
126 | xchg esi,[0xD6C0] |
||
127 | xchg esi,[0xD6C4] |
||
128 | mov [0xD6C8],esi |
||
129 | mov eax,0x66A8 |
||
130 | call cm_pr_22 |
||
131 | push 3 |
||
132 | pop eax |
||
133 | cmp eax,ecx |
||
134 | jb .labl_10 |
||
135 | mov eax,ecx |
||
136 | ;-------------------------------------------------------------------- |
||
137 | .labl_10: |
||
138 | push ecx |
||
139 | push 6 |
||
140 | pop ecx |
||
141 | shl eax,cl |
||
142 | shl eax,2 |
||
143 | add eax,0x60A0 |
||
144 | call cm_pr_23 |
||
145 | mov esi,ecx |
||
146 | cmp ecx,4 |
||
147 | jb .labl_16 |
||
148 | push ecx |
||
149 | xor eax,eax |
||
150 | inc eax |
||
151 | shr ecx,1 |
||
152 | adc al,al |
||
153 | dec ecx |
||
154 | shl eax,cl |
||
155 | mov esi, eax |
||
156 | pop edx |
||
157 | cmp edx,0xE |
||
158 | jnb .labl_11 |
||
159 | sub eax,edx |
||
160 | shl eax,2 |
||
161 | add eax,0x649C |
||
162 | jmp .labl_14 |
||
163 | ;-------------------------------------------------------------------- |
||
164 | .labl_11: |
||
165 | sub ecx,4 |
||
166 | xor eax,eax |
||
167 | ;-------------------------------------------------------------------- |
||
168 | .labl_12: |
||
169 | shr dword [0xD6BC],1 |
||
170 | add eax, eax |
||
171 | mov edx,[0xD6B8] |
||
172 | sub edx,[0xD6BC] |
||
173 | jb .labl_13 |
||
174 | mov [0xD6B8],edx |
||
175 | inc eax |
||
176 | ;-------------------------------------------------------------------- |
||
177 | .labl_13: |
||
178 | call cm_pr_21 |
||
179 | loop .labl_12 |
||
180 | mov cl,4 |
||
181 | shl eax,cl |
||
182 | add esi,eax |
||
183 | mov eax,0x6668 |
||
184 | ;-------------------------------------------------------------------- |
||
185 | .labl_14: |
||
186 | push edi |
||
187 | push ecx |
||
188 | xor edx,edx |
||
189 | inc edx |
||
190 | xor edi,edi |
||
191 | ;-------------------------------------------------------------------- |
||
192 | .labl_15: |
||
193 | push eax |
||
194 | lea eax,[eax+edx*4] |
||
195 | call cm_pr_20 |
||
196 | lahf |
||
197 | adc edx,edx |
||
198 | sahf |
||
199 | rcr edi,1 |
||
200 | pop eax |
||
201 | loop .labl_15 |
||
202 | pop ecx |
||
203 | rol edi,cl |
||
204 | add esi,edi |
||
205 | pop edi |
||
206 | ;-------------------------------------------------------------------- |
||
207 | .labl_16: |
||
208 | pop ecx |
||
209 | not esi |
||
210 | push 7 |
||
211 | ;-------------------------------------------------------------------- |
||
212 | .labl_17: |
||
213 | cmp ebp,7 |
||
214 | pop ebp |
||
215 | jb .labl_18 |
||
216 | inc ebp |
||
217 | inc ebp |
||
218 | inc ebp |
||
219 | ;-------------------------------------------------------------------- |
||
220 | .labl_18: |
||
221 | inc ecx |
||
222 | push esi |
||
223 | add esi,edi |
||
224 | rep movsb |
||
225 | lodsb |
||
226 | pop esi |
||
227 | jmp .labl_05 |
||
228 | ;-------------------------------------------------------------------- |
||
229 | .labl_19: |
||
230 | pop ebp |
||
231 | pop ebx |
||
232 | pop edi |
||
233 | pop esi |
||
234 | ret 0xC |
||
235 | ;***************************************************************************** |
||
236 | |||
237 | ;* Call: *************************************************************** |
||
238 | cm_pr_20: |
||
239 | push edx |
||
240 | mov edx,[0xD6BC] |
||
241 | shr edx,0xB |
||
242 | imul edx,[eax] |
||
243 | cmp [0xD6B8],edx |
||
244 | jnb .labl_01 |
||
245 | mov [0xD6BC],edx |
||
246 | mov edx,0x800 |
||
247 | sub edx,[eax] |
||
248 | shr edx,5 |
||
249 | add [eax],edx |
||
250 | ;-------------------------------------------------------------------- |
||
251 | .labl_00: |
||
252 | pushfd |
||
253 | call cm_pr_21 |
||
254 | popfd |
||
255 | pop edx |
||
256 | ret |
||
257 | ;-------------------------------------------------------------------- |
||
258 | .labl_01: |
||
259 | sub [0xD6BC],edx |
||
260 | sub [0xD6B8],edx |
||
261 | mov edx,[eax] |
||
262 | shr edx,5 |
||
263 | sub [eax],edx |
||
264 | stc |
||
265 | jmp .labl_00 |
||
266 | ;*********************************************************************** |
||
267 | |||
268 | ;* Call: *************************************************************** |
||
269 | cm_pr_21: |
||
270 | cmp [0xD6BF],byte 0 |
||
271 | jne .labl_00 |
||
272 | shl dword [0xD6BC],8 |
||
273 | shl dword [0xD6B8],8 |
||
274 | push eax |
||
275 | mov eax,[0xD6CC] |
||
276 | mov al,[eax] |
||
277 | inc dword [0xD6CC] |
||
278 | mov [0xD6B8],al |
||
279 | pop eax |
||
280 | ;-------------------------------------------------------------------- |
||
281 | .labl_00: |
||
282 | ret |
||
283 | ;*********************************************************************** |
||
284 | |||
285 | ;* Call: *************************************************************** |
||
286 | cm_pr_22: |
||
287 | call cm_pr_20 |
||
288 | jnb .labl_01 |
||
289 | add eax,4 |
||
290 | call cm_pr_20 |
||
291 | jb .labl_00 |
||
292 | mov cl,3 |
||
293 | shl edx,cl |
||
294 | lea eax,[eax+edx*4+0x204] |
||
295 | call cm_pr_23 |
||
296 | add ecx,8 |
||
297 | ret |
||
298 | ;-------------------------------------------------------------------- |
||
299 | .labl_00: |
||
300 | add eax,0x404 |
||
301 | mov cl,8 |
||
302 | call cm_pr_23 |
||
303 | add ecx,0x10 |
||
304 | ret |
||
305 | ;-------------------------------------------------------------------- |
||
306 | .labl_01: |
||
307 | mov cl,3 |
||
308 | shl edx,cl |
||
309 | lea eax,[eax+edx*4+8] |
||
310 | ;*********************************************************************** |
||
311 | |||
312 | ;* Call: *************************************************************** |
||
313 | cm_pr_23: |
||
314 | push edi |
||
315 | xor edx,edx |
||
316 | inc edx |
||
317 | mov edi,edx |
||
318 | xchg edi, eax |
||
319 | ;-------------------------------------------------------------------- |
||
320 | .labl_00: |
||
321 | push eax |
||
322 | lea eax,[edi+edx*4] |
||
323 | call cm_pr_20 |
||
324 | pop eax |
||
325 | adc dl,dl |
||
326 | add al,al |
||
327 | loop .labl_00 |
||
328 | sub dl,al |
||
329 | pop edi |
||
330 | mov ecx,edx |
||
331 | ret |
||
332 | ;*********************************************************************** |
||
333 |