home *** CD-ROM | disk | FTP | other *** search
- ;;
- ;; PECompact v2 LZMA CODEC
- ;; Copyright (C) 2004 Joergen Ibsen (www.ibsensoftware.com)
- ;;
- ;; This library is free software; you can redistribute it and/or
- ;; modify it under the terms of the GNU Lesser General Public
- ;; License as published by the Free Software Foundation; either
- ;; version 2.1 of the License, or (at your option) any later version.
- ;;
- ;; This library is distributed in the hope that it will be useful,
- ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ;; Lesser General Public License for more details.
- ;;
- ;; You should have received a copy of the GNU Lesser General Public
- ;; License along with this library; if not, write to the Free Software
- ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- ;;
-
- .386
- include listing.inc
- .model flat
-
- option casemap:none
- option proc:private
-
- public _GetDecodeFastFuncSize@0
- public _DecodeFast@12
-
- _TEXT segment
-
- _GetDecodeFastFuncSize@0:
-
- mov eax, _DecodeFast@12_end - _DecodeFast@12
- ret
-
- align 4
-
- _DecodeFast@12:
-
- _src$ = 4 + 4*4
- _dst$ = 4 + 4*4 + 4
- _ext$ = 4 + 4*4 + 8
-
- push esi
- push edi
- push ebx
- push ebp
-
- ; header format:
- ;
- ; DWORD lzmaInternalSize
- ; DWORD orgSize
- ; DWORD cmpSize
- ; BYTE pb
- ; BYTE lp
- ; BYTE lc
- ; <compressed lzma data>
-
- mov ebx, [esp + _ext$]
-
- test ebx, ebx
- jz _ret_failure
-
- call @F
- db "kernel32.dll",0
- @@:
- call dword ptr [ebx]
-
- test eax, eax
- jz _ret_failure
-
- mov esi, eax ; esi = hKernel32
-
- call @F
- db "VirtualFree",0
- @@:
- push esi
- call dword ptr [ebx + 4]
-
- test eax, eax
- jz _ret_failure
-
- mov ebp, eax ; ebp -> VirtualFree
-
- call @F
- db "VirtualAlloc",0
- @@:
- push esi
- call dword ptr [ebx + 4]
-
- test eax, eax
- jz _ret_failure
-
- mov esi, [esp + _src$] ; esi -> lpvSource
- mov edi, [esp + _dst$] ; edi -> lpvDestination
-
- push 4 ; PAGE_READWRITE
- push 4096 ; MEM_COMMIT
- push dword ptr [esi] ; lzmaInternalSize
- push 0 ; NULL
- call eax ; VirtualAlloc
-
- test eax, eax
- jz _ret_failure
-
- mov ebx, eax ; ebx -> lzmaInternalData
-
- ; LzmaDecode(lzmaInternalData, lzmaInternalSize,
- ; lc, lp, pb,
- ; (unsigned char *)lpvSource + 8 + 13, cmpSize - 13,
- ; lpvDest, orgSize,
- ; &outSizeProcessed);
-
- push eax ; &outSizeProcessed
- push esp ;
- push dword ptr [esi + 4] ; orgSize
- push edi ; lpvDest
- push dword ptr [esi + 8] ; cmpSize
- lea eax, [esi + 15] ; lpvSource
- push eax ;
- movzx eax, byte ptr [esi + 12] ; pb
- push eax ;
- movzx eax, byte ptr [esi + 13] ; lp
- push eax ;
- movzx eax, byte ptr [esi + 14] ; lc
- push eax ;
- push dword ptr [esi] ; lzmaInternalSize
- push ebx ; lzmaInternalData
- call _LzmaDecode
- add esp, 10*4
-
- test eax, eax
-
- pop eax ; eax = outSizeProcessed
-
- jz @F
-
- xor eax, eax
- dec eax
-
- @@:
- push eax
-
- push 16384 ; MEM_DECOMMIT
- push dword ptr [esi] ; lzmaInternalSize
- push ebx ; lzmaInternalData
- call ebp ; VirtualFree
-
- pop eax
-
- jmp _ret_eax
-
- _ret_failure:
- xor eax, eax
- dec eax
-
- _ret_eax:
- pop ebp
- pop ebx
- pop edi
- pop esi
-
- ret 12
-
- ; =================================================================
-
- ; LzmaDecode.c
- ; LZMA Decoder
- ; LZMA SDK 4.01 Copyright (c) 1999-2004 Igor Pavlov (2004-02-15)
-
- ; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.3052
-
- _RangeDecoderReadByte PROC NEAR
- ; _rd$ = edx
- ; Line 136
- mov ecx, DWORD PTR [edx]
- cmp ecx, DWORD PTR [edx+4]
- jne SHORT $L73280
- ; Line 145
- mov DWORD PTR [edx+16], 1
- ; Line 146
- or al, 255 ; 000000ffH
- ; Line 150
- ret 0
- $L73280:
- ; Line 149
- mov al, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [edx], ecx
- ; Line 150
- ret 0
- _RangeDecoderReadByte ENDP
- ; Function compile flags: /Ogty
- _RangeDecoderInit PROC NEAR
- ; _rd$ = eax
- ; _stream$ = ecx
- ; _bufferSize$ = edx
- ; Line 162
- push esi
- ; Line 169
- lea esi, DWORD PTR [ecx+edx]
- ; Line 171
- xor edx, edx
- ; Line 175
- cmp ecx, esi
- push edi
- mov DWORD PTR [eax], ecx
- mov DWORD PTR [eax+4], esi
- mov DWORD PTR [eax+16], edx
- mov DWORD PTR [eax+12], edx
- mov DWORD PTR [eax+8], -1
- mov edi, 1
- jne SHORT $L73520
- mov DWORD PTR [eax+16], edi
- or dl, 255 ; 000000ffH
- jmp SHORT $L73519
- $L73520:
- mov dl, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [eax], ecx
- $L73519:
- movzx ecx, dl
- mov DWORD PTR [eax+12], ecx
- mov ecx, DWORD PTR [eax]
- cmp ecx, esi
- jne SHORT $L73526
- mov DWORD PTR [eax+16], edi
- or dl, 255 ; 000000ffH
- jmp SHORT $L73527
- $L73526:
- mov dl, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [eax], ecx
- $L73527:
- mov ecx, DWORD PTR [eax+12]
- shl ecx, 8
- movzx edx, dl
- or ecx, edx
- mov DWORD PTR [eax+12], ecx
- mov ecx, DWORD PTR [eax]
- cmp ecx, esi
- jne SHORT $L73529
- mov DWORD PTR [eax+16], edi
- or dl, 255 ; 000000ffH
- jmp SHORT $L73530
- $L73529:
- mov dl, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [eax], ecx
- $L73530:
- mov ecx, DWORD PTR [eax+12]
- shl ecx, 8
- movzx edx, dl
- or ecx, edx
- mov DWORD PTR [eax+12], ecx
- mov ecx, DWORD PTR [eax]
- cmp ecx, esi
- jne SHORT $L73532
- mov DWORD PTR [eax+16], edi
- or dl, 255 ; 000000ffH
- jmp SHORT $L73533
- $L73532:
- mov dl, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [eax], ecx
- $L73533:
- mov ecx, DWORD PTR [eax+12]
- shl ecx, 8
- movzx edx, dl
- or ecx, edx
- mov DWORD PTR [eax+12], ecx
- mov ecx, DWORD PTR [eax]
- cmp ecx, esi
- jne SHORT $L73535
- mov ecx, DWORD PTR [eax+12]
- or dl, 255 ; 000000ffH
- movzx edx, dl
- shl ecx, 8
- mov DWORD PTR [eax+16], edi
- or ecx, edx
- pop edi
- mov DWORD PTR [eax+12], ecx
- pop esi
- ; Line 176
- ret 0
- ; Line 175
- $L73535:
- mov dl, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [eax], ecx
- mov ecx, DWORD PTR [eax+12]
- movzx edx, dl
- shl ecx, 8
- or ecx, edx
- pop edi
- mov DWORD PTR [eax+12], ecx
- pop esi
- ; Line 176
- ret 0
- _RangeDecoderInit ENDP
- ; Function compile flags: /Ogty
- tv71 = -4 ; size = 4
- _RangeDecoderDecodeDirectBits PROC NEAR
- ; _rd$ = ecx
- ; _numTotalBits$ = eax
- ; Line 183
- push ecx
- ; Line 184
- mov edx, DWORD PTR [ecx+8]
- push esi
- mov esi, eax
- ; Line 185
- xor eax, eax
- ; Line 187
- test esi, esi
- push edi
- mov edi, DWORD PTR [ecx+12]
- jle SHORT $L73305
- mov DWORD PTR tv71[esp+12], esi
- push ebx
- $L73303:
- ; Line 190
- shr edx, 1
- ; Line 192
- shl eax, 1
- ; Line 193
- cmp edi, edx
- jb SHORT $L73306
- ; Line 195
- sub edi, edx
- ; Line 196
- or eax, 1
- $L73306:
- ; Line 204
- cmp edx, 16777216 ; 01000000H
- jae SHORT $L73304
- mov esi, DWORD PTR [ecx]
- mov ebx, DWORD PTR [ecx+4]
- shl edx, 8
- cmp esi, ebx
- jne SHORT $L73540
- mov DWORD PTR [ecx+16], 1
- or bl, 255 ; 000000ffH
- jmp SHORT $L73539
- $L73540:
- mov bl, BYTE PTR [esi]
- inc esi
- mov DWORD PTR [ecx], esi
- $L73539:
- movzx esi, bl
- shl edi, 8
- or edi, esi
- $L73304:
- dec DWORD PTR tv71[esp+16]
- jne SHORT $L73303
- pop ebx
- $L73305:
- ; Line 206
- mov DWORD PTR [ecx+12], edi
- pop edi
- mov DWORD PTR [ecx+8], edx
- pop esi
- ; Line 208
- pop ecx
- ret 0
- _RangeDecoderDecodeDirectBits ENDP
- ; Function compile flags: /Ogty
- _RangeDecoderBitDecode PROC NEAR
- ; _prob$ = edi
- ; _rd$ = eax
- ; Line 212
- mov edx, DWORD PTR [eax+8]
- mov ecx, edx
- shr ecx, 11 ; 0000000bH
- imul ecx, DWORD PTR [edi]
- push esi
- ; Line 213
- mov esi, DWORD PTR [eax+12]
- cmp esi, ecx
- jae SHORT $L73316
- ; Line 215
- mov DWORD PTR [eax+8], ecx
- ; Line 216
- mov ecx, DWORD PTR [edi]
- mov edx, 2048 ; 00000800H
- sub edx, ecx
- shr edx, 5
- add edx, ecx
- mov DWORD PTR [edi], edx
- ; Line 217
- mov ecx, DWORD PTR [eax+8]
- cmp ecx, 16777216 ; 01000000H
- jae SHORT $L73318
- ; Line 219
- mov esi, DWORD PTR [eax]
- cmp esi, DWORD PTR [eax+4]
- jne SHORT $L73548
- mov DWORD PTR [eax+16], 1
- or dl, 255 ; 000000ffH
- jmp SHORT $L73547
- $L73548:
- mov dl, BYTE PTR [esi]
- inc esi
- mov DWORD PTR [eax], esi
- $L73547:
- mov esi, DWORD PTR [eax+12]
- movzx edx, dl
- shl esi, 8
- or esi, edx
- ; Line 220
- shl ecx, 8
- mov DWORD PTR [eax+12], esi
- mov DWORD PTR [eax+8], ecx
- $L73318:
- ; Line 222
- xor eax, eax
- pop esi
- ; Line 236
- ret 0
- $L73316:
- ; Line 226
- sub edx, ecx
- ; Line 227
- sub esi, ecx
- mov DWORD PTR [eax+8], edx
- mov DWORD PTR [eax+12], esi
- ; Line 228
- mov ecx, DWORD PTR [edi]
- mov edx, ecx
- shr edx, 5
- sub ecx, edx
- mov DWORD PTR [edi], ecx
- ; Line 229
- mov ecx, DWORD PTR [eax+8]
- cmp ecx, 16777216 ; 01000000H
- jae SHORT $L73321
- ; Line 231
- mov esi, DWORD PTR [eax]
- cmp esi, DWORD PTR [eax+4]
- jne SHORT $L73553
- mov DWORD PTR [eax+16], 1
- or dl, 255 ; 000000ffH
- jmp SHORT $L73552
- $L73553:
- mov dl, BYTE PTR [esi]
- inc esi
- mov DWORD PTR [eax], esi
- $L73552:
- mov esi, DWORD PTR [eax+12]
- movzx edx, dl
- shl esi, 8
- or esi, edx
- ; Line 232
- shl ecx, 8
- mov DWORD PTR [eax+12], esi
- mov DWORD PTR [eax+8], ecx
- $L73321:
- ; Line 234
- mov eax, 1
- pop esi
- ; Line 236
- ret 0
- _RangeDecoderBitDecode ENDP
- ; Function compile flags: /Ogty
- tv84 = -4 ; size = 4
- _numLevels$ = 8 ; size = 4
- _RangeDecoderBitTreeDecode PROC NEAR
- ; _probs$ = ecx
- ; _rd$ = ebx
- ; Line 249
- push ecx
- ; Line 255
- mov edx, DWORD PTR _numLevels$[esp]
- test edx, edx
- push ebp
- mov ebp, DWORD PTR [ebx+12]
- push esi
- push edi
- mov edi, DWORD PTR [ebx+8]
- mov eax, 1
- jle SHORT $L73336
- ; Line 250
- mov DWORD PTR tv84[esp+16], edx
- npad 5
- $L73334:
- ; Line 259
- mov edx, DWORD PTR [ecx+eax*4]
- mov esi, edi
- shr esi, 11 ; 0000000bH
- imul esi, edx
- cmp ebp, esi
- jae SHORT $L73339
- mov edi, esi
- mov esi, 2048 ; 00000800H
- sub esi, edx
- shr esi, 5
- add esi, edx
- mov DWORD PTR [ecx+eax*4], esi
- shl eax, 1
- jmp SHORT $L73340
- $L73339:
- sub edi, esi
- sub ebp, esi
- mov esi, edx
- shr esi, 5
- sub edx, esi
- mov DWORD PTR [ecx+eax*4], edx
- lea eax, DWORD PTR [eax+eax+1]
- $L73340:
- cmp edi, 16777216 ; 01000000H
- jae SHORT $L73335
- mov esi, DWORD PTR [ebx]
- mov edx, DWORD PTR [ebx+4]
- shl edi, 8
- cmp esi, edx
- jne SHORT $L73559
- mov DWORD PTR [ebx+16], 1
- or dl, 255 ; 000000ffH
- jmp SHORT $L73558
- $L73559:
- mov dl, BYTE PTR [esi]
- inc esi
- mov DWORD PTR [ebx], esi
- $L73558:
- movzx edx, dl
- shl ebp, 8
- or ebp, edx
- $L73335:
- dec DWORD PTR tv84[esp+16]
- jne SHORT $L73334
- ; Line 255
- mov edx, DWORD PTR _numLevels$[esp+12]
- $L73336:
- ; Line 267
- mov esi, 1
- mov ecx, edx
- shl esi, cl
- mov DWORD PTR [ebx+8], edi
- pop edi
- mov DWORD PTR [ebx+12], ebp
- sub eax, esi
- pop esi
- pop ebp
- ; Line 268
- pop ecx
- ret 0
- _RangeDecoderBitTreeDecode ENDP
- ; Function compile flags: /Ogty
- _i$ = -8 ; size = 4
- _symbol$ = -4 ; size = 4
- _probs$ = 8 ; size = 4
- _numLevels$ = 12 ; size = 4
- _rd$ = 16 ; size = 4
- _RangeDecoderReverseBitTreeDecode PROC NEAR
- ; Line 271
- sub esp, 8
- mov eax, DWORD PTR _rd$[esp+4]
- mov ecx, DWORD PTR _probs$[esp+4]
- push ebx
- ; Line 276
- mov ebx, DWORD PTR [eax+8]
- push ebp
- mov ebp, DWORD PTR [eax+12]
- push esi
- ; Line 278
- mov esi, DWORD PTR _numLevels$[esp+16]
- xor edx, edx
- cmp esi, edx
- push edi
- mov edi, 1
- mov DWORD PTR _symbol$[esp+24], edx
- mov DWORD PTR _i$[esp+24], edx
- jle $L73358
- $L73356:
- ; Line 282
- mov edx, DWORD PTR [ecx+edi*4]
- mov esi, ebx
- shr esi, 11 ; 0000000bH
- imul esi, edx
- cmp ebp, esi
- jae SHORT $L73361
- mov ebx, esi
- mov esi, 2048 ; 00000800H
- sub esi, edx
- shr esi, 5
- add esi, edx
- mov DWORD PTR [ecx+edi*4], esi
- shl edi, 1
- jmp SHORT $L73362
- $L73361:
- mov ecx, DWORD PTR _i$[esp+24]
- mov eax, 1
- shl eax, cl
- mov ecx, DWORD PTR _symbol$[esp+24]
- sub ebx, esi
- sub ebp, esi
- or ecx, eax
- mov eax, DWORD PTR _rd$[esp+20]
- mov DWORD PTR _symbol$[esp+24], ecx
- mov ecx, edx
- shr ecx, 5
- sub edx, ecx
- mov ecx, DWORD PTR _probs$[esp+20]
- mov DWORD PTR [ecx+edi*4], edx
- lea edi, DWORD PTR [edi+edi+1]
- $L73362:
- cmp ebx, 16777216 ; 01000000H
- jae SHORT $L73357
- mov esi, DWORD PTR [eax]
- mov edx, DWORD PTR [eax+4]
- shl ebx, 8
- cmp esi, edx
- jne SHORT $L73567
- mov DWORD PTR [eax+16], 1
- or dl, 255 ; 000000ffH
- jmp SHORT $L73566
- $L73567:
- mov dl, BYTE PTR [esi]
- inc esi
- mov DWORD PTR [eax], esi
- $L73566:
- movzx edx, dl
- shl ebp, 8
- or ebp, edx
- $L73357:
- mov edx, DWORD PTR _i$[esp+24]
- mov esi, DWORD PTR _numLevels$[esp+20]
- inc edx
- cmp edx, esi
- mov DWORD PTR _i$[esp+24], edx
- jl $L73356
- $L73358:
- pop edi
- pop esi
- ; Line 290
- mov DWORD PTR [eax+12], ebp
- mov DWORD PTR [eax+8], ebx
- ; Line 292
- mov eax, DWORD PTR _symbol$[esp+16]
- pop ebp
- pop ebx
- ; Line 293
- add esp, 8
- ret 0
- _RangeDecoderReverseBitTreeDecode ENDP
- ; Function compile flags: /Ogty
- _rd$ = 8 ; size = 4
- _LzmaLiteralDecode PROC NEAR
- ; _probs$ = ebx
- ; Line 296
- push ebp
- mov ebp, DWORD PTR _rd$[esp]
- push esi
- ; Line 299
- mov esi, DWORD PTR [ebp+8]
- push edi
- mov edi, DWORD PTR [ebp+12]
- mov eax, 1
- $L73374:
- ; Line 305
- mov ecx, DWORD PTR [ebx+eax*4]
- mov edx, esi
- shr edx, 11 ; 0000000bH
- imul edx, ecx
- cmp edi, edx
- jae SHORT $L73379
- mov esi, edx
- mov edx, 2048 ; 00000800H
- sub edx, ecx
- shr edx, 5
- add edx, ecx
- mov DWORD PTR [ebx+eax*4], edx
- shl eax, 1
- jmp SHORT $L73380
- $L73379:
- sub esi, edx
- sub edi, edx
- mov edx, ecx
- shr edx, 5
- sub ecx, edx
- mov DWORD PTR [ebx+eax*4], ecx
- lea eax, DWORD PTR [eax+eax+1]
- $L73380:
- cmp esi, 16777216 ; 01000000H
- jae SHORT $L73375
- mov ecx, DWORD PTR [ebp]
- mov edx, DWORD PTR [ebp+4]
- shl esi, 8
- cmp ecx, edx
- jne SHORT $L73575
- mov DWORD PTR [ebp+16], 1
- or dl, 255 ; 000000ffH
- jmp SHORT $L73574
- $L73575:
- mov dl, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [ebp], ecx
- $L73574:
- movzx ecx, dl
- shl edi, 8
- or edi, ecx
- $L73375:
- ; Line 310
- cmp eax, 256 ; 00000100H
- jl SHORT $L73374
- ; Line 312
- mov DWORD PTR [ebp+12], edi
- pop edi
- mov DWORD PTR [ebp+8], esi
- pop esi
- pop ebp
- ; Line 315
- ret 0
- _LzmaLiteralDecode ENDP
- ; Function compile flags: /Ogty
- _code$ = -8 ; size = 4
- _bit$73397 = -4 ; size = 4
- _probs$ = 8 ; size = 4
- _rd$ = 12 ; size = 4
- _matchByte$ = 16 ; size = 1
- _LzmaLiteralDecodeMatch PROC NEAR
- ; Line 318
- sub esp, 8
- mov ecx, DWORD PTR _rd$[esp+4]
- push ebx
- ; Line 321
- mov ebx, DWORD PTR [ecx+12]
- push ebp
- push esi
- mov esi, DWORD PTR [ecx+8]
- push edi
- mov eax, 1
- mov DWORD PTR _code$[esp+24], ebx
- npad 6
- $L73394:
- ; Line 326
- mov cl, BYTE PTR _matchByte$[esp+20]
- ; Line 330
- mov edx, DWORD PTR _probs$[esp+20]
- movzx ebp, cl
- shl cl, 1
- mov BYTE PTR _matchByte$[esp+20], cl
- shr ebp, 7
- lea ecx, DWORD PTR [ebp+1]
- shl ecx, 8
- add ecx, eax
- lea edi, DWORD PTR [edx+ecx*4]
- ; Line 331
- mov edx, DWORD PTR [edi]
- mov ecx, esi
- shr ecx, 11 ; 0000000bH
- imul ecx, edx
- cmp ebx, ecx
- jae SHORT $L73401
- mov esi, ecx
- mov ecx, 2048 ; 00000800H
- sub ecx, edx
- shr ecx, 5
- add ecx, edx
- mov DWORD PTR _bit$73397[esp+24], 0
- mov DWORD PTR [edi], ecx
- shl eax, 1
- jmp SHORT $L73402
- $L73401:
- mov ebx, DWORD PTR _code$[esp+24]
- sub ebx, ecx
- sub esi, ecx
- mov ecx, edx
- shr ecx, 5
- sub edx, ecx
- mov DWORD PTR _bit$73397[esp+24], 1
- mov DWORD PTR _code$[esp+24], ebx
- mov DWORD PTR [edi], edx
- lea eax, DWORD PTR [eax+eax+1]
- $L73402:
- cmp esi, 16777216 ; 01000000H
- mov edi, DWORD PTR _rd$[esp+20]
- jae SHORT $L73404
- mov ecx, DWORD PTR [edi]
- mov edx, DWORD PTR [edi+4]
- shl esi, 8
- cmp ecx, edx
- jne SHORT $L73582
- mov DWORD PTR [edi+16], 1
- or dl, 255 ; 000000ffH
- jmp SHORT $L73581
- $L73582:
- mov dl, BYTE PTR [ecx]
- inc ecx
- mov DWORD PTR [edi], ecx
- $L73581:
- movzx edx, dl
- shl ebx, 8
- or ebx, edx
- mov DWORD PTR _code$[esp+24], ebx
- $L73404:
- ; Line 337
- cmp ebp, DWORD PTR _bit$73397[esp+24]
- jne SHORT $L73591
- ; Line 351
- cmp eax, 256 ; 00000100H
- jl $L73394
- ; Line 353
- mov DWORD PTR [edi+8], esi
- mov DWORD PTR [edi+12], ebx
- pop edi
- pop esi
- pop ebp
- pop ebx
- ; Line 356
- add esp, 8
- ret 0
- $L73591:
- ; Line 339
- cmp eax, 256 ; 00000100H
- jge SHORT $L73396
- $L73407:
- ; Line 343
- mov ebp, DWORD PTR _probs$[esp+20]
- mov ecx, DWORD PTR [ebp+eax*4]
- mov edx, esi
- shr edx, 11 ; 0000000bH
- imul edx, ecx
- cmp ebx, edx
- jae SHORT $L73411
- mov esi, edx
- mov edx, 2048 ; 00000800H
- sub edx, ecx
- shr edx, 5
- add edx, ecx
- mov DWORD PTR [ebp+eax*4], edx
- shl eax, 1
- jmp SHORT $L73412
- $L73411:
- sub esi, edx
- sub ebx, edx
- mov edx, ecx
- shr edx, 5
- sub ecx, edx
- mov DWORD PTR [ebp+eax*4], ecx
- lea eax, DWORD PTR [eax+eax+1]
- $L73412:
- cmp esi, 16777216 ; 01000000H
- jae SHORT $L73414
- mov ebp, DWORD PTR [edi]
- mov ecx, DWORD PTR [edi+4]
- shl esi, 8
- cmp ebp, ecx
- jne SHORT $L73587
- mov DWORD PTR [edi+16], 1
- or cl, 255 ; 000000ffH
- jmp SHORT $L73586
- $L73587:
- mov cl, BYTE PTR [ebp]
- inc ebp
- mov DWORD PTR [edi], ebp
- $L73586:
- movzx ecx, cl
- shl ebx, 8
- or ebx, ecx
- $L73414:
- ; Line 339
- cmp eax, 256 ; 00000100H
- jl SHORT $L73407
- $L73396:
- ; Line 353
- mov DWORD PTR [edi+8], esi
- mov DWORD PTR [edi+12], ebx
- pop edi
- pop esi
- pop ebp
- pop ebx
- ; Line 356
- add esp, 8
- ret 0
- _LzmaLiteralDecodeMatch ENDP
- ; Function compile flags: /Ogty
- _p$ = 8 ; size = 4
- _LzmaLenDecode PROC NEAR
- ; _rd$ = ecx
- ; _posState$ = eax
- ; Line 376
- push ebx
- push ebp
- mov ebp, DWORD PTR _p$[esp+4]
- push esi
- mov ebx, ecx
- push edi
- mov esi, eax
- ; Line 377
- mov eax, ebx
- mov edi, ebp
- call _RangeDecoderBitDecode
- test eax, eax
- jne SHORT $L73423
- ; Line 379
- shl esi, 5
- push 3
- lea ecx, DWORD PTR [esi+ebp+8]
- call _RangeDecoderBitTreeDecode
- add esp, 4
- pop edi
- pop esi
- pop ebp
- pop ebx
- ; Line 385
- ret 0
- $L73423:
- ; Line 380
- lea edi, DWORD PTR [ebp+4]
- mov eax, ebx
- call _RangeDecoderBitDecode
- test eax, eax
- jne SHORT $L73424
- ; Line 382
- shl esi, 5
- push 3
- lea ecx, DWORD PTR [esi+ebp+520]
- call _RangeDecoderBitTreeDecode
- add esp, 4
- pop edi
- pop esi
- pop ebp
- add eax, 8
- pop ebx
- ; Line 385
- ret 0
- $L73424:
- ; Line 384
- push 8
- lea ecx, DWORD PTR [ebp+1032]
- call _RangeDecoderBitTreeDecode
- add esp, 4
- pop edi
- pop esi
- pop ebp
- add eax, 16 ; 00000010H
- pop ebx
- ; Line 385
- ret 0
- _LzmaLenDecode ENDP
- _rep2$ = -44 ; size = 4
- _rep1$ = -40 ; size = 4
- _previousIsMatch$ = -36 ; size = 4
- _rep3$ = -32 ; size = 4
- _posStateMask$ = -28 ; size = 4
- _literalPosMask$ = -24 ; size = 4
- _rd$ = -20 ; size = 20
- _buffer$ = 8 ; size = 4
- _matchByte$73481 = 12 ; size = 1
- _bufferSize$ = 12 ; size = 4
- _lc$ = 16 ; size = 4
- _state$ = 20 ; size = 4
- _lp$ = 20 ; size = 4
- _posState$73471 = 24 ; size = 4
- _pb$ = 24 ; size = 4
- _inStream$ = 28 ; size = 4
- _inSize$ = 32 ; size = 4
- _outStream$ = 36 ; size = 4
- _outSize$ = 40 ; size = 4
- _outSizeProcessed$ = 44 ; size = 4
- _LzmaDecode PROC NEAR
- ; Line 531
- sub esp, 44 ; 0000002cH
- ; Line 532
- mov eax, DWORD PTR _lc$[esp+40]
- push ebx
- push ebp
- push esi
- push edi
- mov edi, DWORD PTR _lp$[esp+56]
- lea ecx, DWORD PTR [eax+edi]
- ; Line 539
- mov edx, 1
- mov esi, edx
- mov DWORD PTR _rep1$[esp+60], edx
- mov DWORD PTR _rep2$[esp+60], edx
- mov DWORD PTR _rep3$[esp+60], edx
- mov eax, 768 ; 00000300H
- shl eax, cl
- ; Line 541
- mov ecx, DWORD PTR _pb$[esp+56]
- shl edx, cl
- xor ebp, ebp
- add eax, 1846 ; 00000736H
- xor bl, bl
- dec edx
- mov DWORD PTR _posStateMask$[esp+60], edx
- ; Line 542
- mov ecx, edi
- mov edx, esi
- shl edx, cl
- ; Line 544
- lea ecx, DWORD PTR [eax*4]
- mov DWORD PTR _state$[esp+56], ebp
- mov DWORD PTR _previousIsMatch$[esp+60], ebp
- dec edx
- mov DWORD PTR _literalPosMask$[esp+60], edx
- cmp DWORD PTR _bufferSize$[esp+56], ecx
- jae SHORT $L73464
- pop edi
- pop esi
- pop ebp
- ; Line 545
- mov eax, 2
- pop ebx
- ; Line 749
- add esp, 44 ; 0000002cH
- ret 0
- $L73464:
- ; Line 546
- test eax, eax
- jbe SHORT $L73465
- mov edi, DWORD PTR _buffer$[esp+56]
- mov ecx, eax
- mov eax, 1024 ; 00000400H
- rep stosd
- $L73465:
- ; Line 554
- mov edx, DWORD PTR _inSize$[esp+56]
- mov ecx, DWORD PTR _inStream$[esp+56]
- lea eax, DWORD PTR _rd$[esp+60]
- call _RangeDecoderInit
- ; Line 558
- mov eax, DWORD PTR _outSize$[esp+56]
- test eax, eax
- mov edx, DWORD PTR _outSizeProcessed$[esp+56]
- mov DWORD PTR [edx], 0
- jbe $L73609
- $L73469:
- ; Line 566
- mov eax, DWORD PTR _posStateMask$[esp+60]
- ; Line 571
- mov ecx, DWORD PTR _rd$[esp+76]
- and eax, ebp
- test ecx, ecx
- mov DWORD PTR _posState$73471[esp+56], eax
- jne $L73604
- ; Line 573
- mov ecx, DWORD PTR _state$[esp+56]
- mov edx, DWORD PTR _buffer$[esp+56]
- shl ecx, 4
- add ecx, eax
- lea edi, DWORD PTR [edx+ecx*4]
- lea eax, DWORD PTR _rd$[esp+60]
- call _RangeDecoderBitDecode
- test eax, eax
- jne $L73474
- ; Line 582
- mov edx, DWORD PTR _lc$[esp+56]
- mov edi, DWORD PTR _literalPosMask$[esp+60]
- xor ecx, ecx
- mov cl, 8
- sub cl, dl
- movzx eax, bl
- shr eax, cl
- and edi, ebp
- mov ecx, edx
- shl edi, cl
- mov ecx, DWORD PTR _buffer$[esp+56]
- add eax, edi
- lea eax, DWORD PTR [eax+eax*2]
- shl eax, 10 ; 0000000aH
- lea ebx, DWORD PTR [eax+ecx+7384]
- ; Line 584
- mov eax, DWORD PTR _state$[esp+56]
- cmp eax, 4
- jge SHORT $L73476
- mov DWORD PTR _state$[esp+56], 0
- ; Line 585
- jmp SHORT $L73479
- $L73476:
- cmp eax, 10 ; 0000000aH
- jge SHORT $L73478
- sub eax, 3
- ; Line 586
- jmp SHORT $L73610
- $L73478:
- sub eax, 6
- $L73610:
- mov DWORD PTR _state$[esp+56], eax
- $L73479:
- ; Line 587
- mov eax, DWORD PTR _previousIsMatch$[esp+60]
- test eax, eax
- je SHORT $L73480
- ; Line 596
- mov eax, DWORD PTR _outStream$[esp+56]
- mov edx, ebp
- sub edx, esi
- mov cl, BYTE PTR [edx+eax]
- mov BYTE PTR _matchByte$73481[esp+56], cl
- ; Line 598
- mov edx, DWORD PTR _matchByte$73481[esp+56]
- push edx
- lea eax, DWORD PTR _rd$[esp+64]
- push eax
- push ebx
- call _LzmaLiteralDecodeMatch
- add esp, 12 ; 0000000cH
- ; Line 599
- mov DWORD PTR _previousIsMatch$[esp+60], 0
- ; Line 601
- jmp SHORT $L73611
- $L73480:
- ; Line 602
- lea ecx, DWORD PTR _rd$[esp+60]
- push ecx
- call _LzmaLiteralDecode
- add esp, 4
- $L73611:
- ; Line 603
- mov edx, DWORD PTR _outStream$[esp+56]
- mov bl, al
- mov BYTE PTR [edx+ebp], bl
- $L73612:
- inc ebp
- $L73507:
- ; Line 558
- cmp ebp, DWORD PTR _outSize$[esp+56]
- jb $L73469
- $L73609:
- ; Line 747
- mov eax, DWORD PTR _outSizeProcessed$[esp+56]
- pop edi
- pop esi
- mov DWORD PTR [eax], ebp
- pop ebp
- ; Line 748
- xor eax, eax
- pop ebx
- ; Line 749
- add esp, 44 ; 0000002cH
- ret 0
- $L73474:
- ; Line 613
- mov eax, DWORD PTR _buffer$[esp+56]
- mov ebx, DWORD PTR _state$[esp+56]
- lea edi, DWORD PTR [eax+ebx*4+768]
- lea eax, DWORD PTR _rd$[esp+60]
- mov DWORD PTR _previousIsMatch$[esp+60], 1
- call _RangeDecoderBitDecode
- cmp eax, 1
- jne $L73484
- ; Line 615
- mov ecx, DWORD PTR _buffer$[esp+56]
- lea edi, DWORD PTR [ecx+ebx*4+816]
- lea eax, DWORD PTR _rd$[esp+60]
- call _RangeDecoderBitDecode
- test eax, eax
- ; Line 617
- mov eax, DWORD PTR _buffer$[esp+56]
- jne SHORT $L73485
- mov edi, DWORD PTR _posState$73471[esp+56]
- lea edx, DWORD PTR [ebx+15]
- shl edx, 4
- add edx, edi
- lea edi, DWORD PTR [eax+edx*4]
- lea eax, DWORD PTR _rd$[esp+60]
- call _RangeDecoderBitDecode
- test eax, eax
- jne SHORT $L73488
- ; Line 628
- test ebp, ebp
- je $L73604
- ; Line 640
- mov eax, DWORD PTR _outStream$[esp+56]
- xor ecx, ecx
- cmp ebx, 7
- setge cl
- mov edx, ebp
- sub edx, esi
- mov bl, BYTE PTR [edx+eax]
- ; Line 642
- mov BYTE PTR [eax+ebp], bl
- lea ecx, DWORD PTR [ecx+ecx+9]
- mov DWORD PTR _state$[esp+56], ecx
- ; Line 643
- jmp $L73612
- $L73485:
- ; Line 649
- lea edi, DWORD PTR [eax+ebx*4+864]
- lea eax, DWORD PTR _rd$[esp+60]
- call _RangeDecoderBitDecode
- test eax, eax
- jne SHORT $L73490
- ; Line 650
- mov eax, DWORD PTR _rep1$[esp+60]
- ; Line 651
- jmp SHORT $L73491
- $L73490:
- ; Line 653
- mov ecx, DWORD PTR _buffer$[esp+56]
- lea edi, DWORD PTR [ecx+ebx*4+912]
- lea eax, DWORD PTR _rd$[esp+60]
- call _RangeDecoderBitDecode
- test eax, eax
- jne SHORT $L73492
- ; Line 654
- mov eax, DWORD PTR _rep2$[esp+60]
- ; Line 655
- jmp SHORT $L73493
- $L73492:
- ; Line 658
- mov edx, DWORD PTR _rep2$[esp+60]
- mov eax, DWORD PTR _rep3$[esp+60]
- mov DWORD PTR _rep3$[esp+60], edx
- $L73493:
- ; Line 660
- mov ecx, DWORD PTR _rep1$[esp+60]
- mov DWORD PTR _rep2$[esp+60], ecx
- $L73491:
- ; Line 662
- mov DWORD PTR _rep1$[esp+60], esi
- ; Line 663
- mov esi, eax
- $L73488:
- ; Line 665
- mov edx, DWORD PTR _buffer$[esp+56]
- mov eax, DWORD PTR _posState$73471[esp+56]
- add edx, 5328 ; 000014d0H
- push edx
- lea ecx, DWORD PTR _rd$[esp+64]
- call _LzmaLenDecode
- mov edi, eax
- ; Line 666
- xor eax, eax
- add esp, 4
- cmp ebx, 7
- setge al
- dec eax
- and eax, -3 ; fffffffdH
- add eax, 11 ; 0000000bH
- mov DWORD PTR _state$[esp+56], eax
- ; Line 668
- jmp $L73494
- $L73484:
- ; Line 672
- mov edx, DWORD PTR _rep1$[esp+60]
- mov ecx, DWORD PTR _rep2$[esp+60]
- ; Line 674
- xor eax, eax
- cmp ebx, 7
- setge al
- mov DWORD PTR _rep3$[esp+60], ecx
- mov DWORD PTR _rep1$[esp+60], esi
- ; Line 675
- mov esi, DWORD PTR _buffer$[esp+56]
- lea ecx, DWORD PTR [esi+3272]
- push ecx
- lea ecx, DWORD PTR _rd$[esp+64]
- dec eax
- and eax, -3 ; fffffffdH
- add eax, 10 ; 0000000aH
- mov DWORD PTR _state$[esp+60], eax
- mov eax, DWORD PTR _posState$73471[esp+60]
- mov DWORD PTR _rep2$[esp+64], edx
- call _LzmaLenDecode
- mov edi, eax
- add esp, 4
- ; Line 678
- cmp edi, 4
- jl SHORT $L73596
- mov eax, 3
- $L73596:
- shl eax, 8
- push 6
- lea ecx, DWORD PTR [eax+esi+1728]
- lea ebx, DWORD PTR _rd$[esp+64]
- call _RangeDecoderBitTreeDecode
- add esp, 4
- ; Line 679
- cmp eax, 4
- ; Line 682
- mov esi, eax
- jl SHORT $L73501
- mov ecx, eax
- and esi, 1
- sar ecx, 1
- dec ecx
- or esi, 2
- shl esi, cl
- ; Line 683
- cmp eax, 14 ; 0000000eH
- jge SHORT $L73499
- ; Line 686
- mov edx, ebx
- push edx
- mov edx, DWORD PTR _buffer$[esp+60]
- push ecx
- mov ecx, esi
- sub ecx, eax
- lea eax, DWORD PTR [edx+ecx*4+2748]
- push eax
- ; Line 688
- jmp SHORT $L73613
- $L73499:
- ; Line 691
- lea eax, DWORD PTR [ecx-4]
- lea ecx, DWORD PTR _rd$[esp+60]
- call _RangeDecoderDecodeDirectBits
- ; Line 692
- mov edx, DWORD PTR _buffer$[esp+56]
- shl eax, 4
- lea ecx, DWORD PTR _rd$[esp+60]
- push ecx
- add esi, eax
- push 4
- add edx, 3208 ; 00000c88H
- push edx
- $L73613:
- call _RangeDecoderReverseBitTreeDecode
- add esp, 12 ; 0000000cH
- add esi, eax
- $L73501:
- ; Line 697
- inc esi
- $L73494:
- ; Line 699
- test esi, esi
- je $L73609
- ; Line 709
- cmp esi, ebp
- ja SHORT $L73604
- ; Line 713
- mov ecx, DWORD PTR _outStream$[esp+56]
- mov eax, ebp
- sub eax, esi
- add edi, 2
- add eax, ecx
- $L73505:
- ; Line 725
- mov bl, BYTE PTR [eax]
- ; Line 727
- inc ebp
- mov BYTE PTR [ecx+ebp-1], bl
- inc eax
- ; Line 728
- dec edi
- ; Line 730
- test edi, edi
- jle $L73507
- cmp ebp, DWORD PTR _outSize$[esp+56]
- jb SHORT $L73505
- ; Line 747
- mov eax, DWORD PTR _outSizeProcessed$[esp+56]
- pop edi
- pop esi
- mov DWORD PTR [eax], ebp
- pop ebp
- ; Line 748
- xor eax, eax
- pop ebx
- ; Line 749
- add esp, 44 ; 0000002cH
- ret 0
- $L73604:
- pop edi
- pop esi
- pop ebp
- ; Line 711
- mov eax, 1
- pop ebx
- ; Line 749
- add esp, 44 ; 0000002cH
- ret 0
- _LzmaDecode ENDP
-
- ; =================================================================
-
- _DecodeFast@12_end:
-
- _TEXT ENDS
-
- END
-