home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Utilitare / pec / pec2setup.exe / lzma / pec2codec / decode.asm < prev    next >
Encoding:
Assembly Source File  |  2004-05-17  |  22.5 KB  |  1,093 lines

  1. ;;
  2. ;; PECompact v2 LZMA CODEC
  3. ;; Copyright (C) 2004 Joergen Ibsen (www.ibsensoftware.com)
  4. ;;
  5. ;; This library is free software; you can redistribute it and/or
  6. ;; modify it under the terms of the GNU Lesser General Public
  7. ;; License as published by the Free Software Foundation; either
  8. ;; version 2.1 of the License, or (at your option) any later version.
  9. ;;
  10. ;; This library is distributed in the hope that it will be useful,
  11. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. ;; Lesser General Public License for more details.
  14. ;;
  15. ;; You should have received a copy of the GNU Lesser General Public
  16. ;; License along with this library; if not, write to the Free Software
  17. ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. ;;
  19.  
  20. .386
  21. include listing.inc
  22. .model flat
  23.  
  24. option casemap:none
  25. option proc:private
  26.  
  27. public _GetDecodeSmallFuncSize@0
  28. public _DecodeSmall@12
  29.  
  30. _TEXT segment
  31.  
  32. _GetDecodeSmallFuncSize@0:
  33.  
  34.     mov    eax, _DecodeSmall@12_end - _DecodeSmall@12
  35.     ret
  36.  
  37. align 4
  38.  
  39. _DecodeSmall@12:
  40.  
  41.     _src$ = 4 + 4*4
  42.     _dst$ = 4 + 4*4 + 4
  43.     _ext$ = 4 + 4*4 + 8
  44.  
  45.     push   esi
  46.     push   edi
  47.     push   ebx
  48.     push   ebp
  49.  
  50.     ; header format:
  51.     ;
  52.     ;   DWORD  lzmaInternalSize
  53.     ;   DWORD  orgSize
  54.     ;   DWORD  cmpSize
  55.     ;   BYTE   pb
  56.     ;   BYTE   lp
  57.     ;   BYTE   lc
  58.     ;   <compressed lzma data>
  59.  
  60.     mov    ebx, [esp + _ext$]
  61.  
  62.     test   ebx, ebx
  63.     jz     _ret_failure
  64.  
  65.     call   @F
  66.     db     "kernel32.dll",0
  67.   @@:
  68.     call   dword ptr [ebx]
  69.  
  70.     test   eax, eax
  71.     jz     _ret_failure
  72.  
  73.     mov    esi, eax           ; esi = hKernel32
  74.  
  75.     call   @F
  76.     db     "VirtualFree",0
  77.   @@:
  78.     push   esi
  79.     call   dword ptr [ebx + 4]
  80.  
  81.     test   eax, eax
  82.     jz     _ret_failure
  83.  
  84.     mov    ebp, eax           ; ebp -> VirtualFree
  85.  
  86.     call   @F
  87.     db     "VirtualAlloc",0
  88.   @@:
  89.     push   esi
  90.     call   dword ptr [ebx + 4]
  91.  
  92.     test   eax, eax
  93.     jz     _ret_failure
  94.  
  95.     mov    esi, [esp + _src$] ; esi -> lpvSource
  96.     mov    edi, [esp + _dst$] ; edi -> lpvDestination
  97.  
  98.     push   4                  ; PAGE_READWRITE
  99.     push   4096               ; MEM_COMMIT
  100.     push   dword ptr [esi]    ; lzmaInternalSize
  101.     push   0                  ; NULL
  102.     call   eax                ; VirtualAlloc
  103.  
  104.     test   eax, eax
  105.     jz     _ret_failure
  106.  
  107.     mov    ebx, eax           ; ebx -> lzmaInternalData
  108.  
  109.     ; LzmaDecode(lzmaInternalData, lzmaInternalSize,
  110.     ;            lc, lp, pb,
  111.     ;            (unsigned char *)lpvSource + 8 + 13, cmpSize - 13,
  112.     ;            lpvDest, orgSize,
  113.     ;            &outSizeProcessed);
  114.  
  115.     push   eax                      ; &outSizeProcessed
  116.     push   esp                      ;
  117.     push   dword ptr [esi + 4]      ; orgSize
  118.     push   edi                      ; lpvDest
  119.     push   dword ptr [esi + 8]      ; cmpSize
  120.     lea    eax, [esi + 15]          ; lpvSource
  121.     push   eax                      ;
  122.     movzx  eax, byte ptr [esi + 12] ; pb
  123.     push   eax                      ;
  124.     movzx  eax, byte ptr [esi + 13] ; lp
  125.     push   eax                      ;
  126.     movzx  eax, byte ptr [esi + 14] ; lc
  127.     push   eax                      ;
  128.     push   dword ptr [esi]          ; lzmaInternalSize
  129.     push   ebx                      ; lzmaInternalData
  130.     call   _LzmaDecode
  131.     add    esp, 10*4
  132.  
  133.     test   eax, eax
  134.  
  135.     pop    eax                ; eax = outSizeProcessed
  136.  
  137.     jz     @F
  138.  
  139.     xor    eax, eax
  140.     dec    eax
  141.  
  142.   @@:
  143.     push   eax
  144.  
  145.     push   16384              ; MEM_DECOMMIT
  146.     push   dword ptr [esi]    ; lzmaInternalSize
  147.     push   ebx                ; lzmaInternalData
  148.     call   ebp                ; VirtualFree
  149.  
  150.     pop    eax
  151.  
  152.     jmp    _ret_eax
  153.  
  154.   _ret_failure:
  155.     xor    eax, eax
  156.     dec    eax
  157.  
  158.   _ret_eax:
  159.     pop    ebp
  160.     pop    ebx
  161.     pop    edi
  162.     pop    esi
  163.  
  164.     ret    12
  165.  
  166. ; =================================================================
  167.  
  168. ; LzmaDecode.c
  169. ; LZMA Decoder
  170. ; LZMA SDK 4.01 Copyright (c) 1999-2004 Igor Pavlov (2004-02-15)
  171.  
  172. ; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.3052
  173.  
  174. _RangeDecoderReadByte PROC NEAR                ; COMDAT
  175. ; _rd$ = edx
  176. ; Line 136
  177.     mov    ecx, DWORD PTR [edx]
  178.     cmp    ecx, DWORD PTR [edx+4]
  179.     jne    SHORT $L73231
  180. ; Line 145
  181.     mov    DWORD PTR [edx+16], 1
  182. ; Line 146
  183.     or    al, 255                    ; 000000ffH
  184. ; Line 150
  185.     ret    0
  186. $L73231:
  187. ; Line 149
  188.     mov    al, BYTE PTR [ecx]
  189.     inc    ecx
  190.     mov    DWORD PTR [edx], ecx
  191. ; Line 150
  192.     ret    0
  193. _RangeDecoderReadByte ENDP
  194. ; Function compile flags: /Ogsy
  195. _RangeDecoderInit PROC NEAR                ; COMDAT
  196. ; _rd$ = edx
  197. ; _stream$ = eax
  198. ; _bufferSize$ = ecx
  199. ; Line 171
  200.     and    DWORD PTR [edx+16], 0
  201. ; Line 172
  202.     and    DWORD PTR [edx+12], 0
  203.     push    esi
  204.     mov    DWORD PTR [edx], eax
  205.     add    eax, ecx
  206. ; Line 173
  207.     or    DWORD PTR [edx+8], -1
  208.     push    5
  209.     mov    DWORD PTR [edx+4], eax
  210.     pop    esi
  211. $L73241:
  212. ; Line 175
  213.     call    _RangeDecoderReadByte
  214.     mov    ecx, DWORD PTR [edx+12]
  215.     movzx    eax, al
  216.     shl    ecx, 8
  217.     or    eax, ecx
  218.     dec    esi
  219.     mov    DWORD PTR [edx+12], eax
  220.     jne    SHORT $L73241
  221.     pop    esi
  222. ; Line 176
  223.     ret    0
  224. _RangeDecoderInit ENDP
  225. ; Function compile flags: /Ogsy
  226. tv83 = -4                        ; size = 4
  227. _RangeDecoderDecodeDirectBits PROC NEAR            ; COMDAT
  228. ; _rd$ = edx
  229. ; _numTotalBits$ = eax
  230. ; Line 183
  231.     push    ebp
  232.     mov    ebp, esp
  233.     push    ecx
  234.     push    ebx
  235.     push    esi
  236. ; Line 184
  237.     mov    esi, DWORD PTR [edx+8]
  238. ; Line 185
  239.     xor    ebx, ebx
  240. ; Line 187
  241.     test    eax, eax
  242.     push    edi
  243.     mov    edi, DWORD PTR [edx+12]
  244.     jle    SHORT $L73256
  245. ; Line 184
  246.     mov    DWORD PTR tv83[ebp], eax
  247. $L73254:
  248. ; Line 190
  249.     shr    esi, 1
  250. ; Line 192
  251.     shl    ebx, 1
  252. ; Line 193
  253.     cmp    edi, esi
  254.     jb    SHORT $L73257
  255. ; Line 195
  256.     sub    edi, esi
  257. ; Line 196
  258.     or    ebx, 1
  259. $L73257:
  260. ; Line 204
  261.     cmp    esi, 16777216                ; 01000000H
  262.     jae    SHORT $L73255
  263.     shl    esi, 8
  264.     call    _RangeDecoderReadByte
  265.     movzx    eax, al
  266.     shl    edi, 8
  267.     or    edi, eax
  268. $L73255:
  269. ; Line 187
  270.     dec    DWORD PTR tv83[ebp]
  271.     jne    SHORT $L73254
  272. $L73256:
  273. ; Line 206
  274.     mov    DWORD PTR [edx+12], edi
  275.     pop    edi
  276.     mov    DWORD PTR [edx+8], esi
  277.     pop    esi
  278. ; Line 207
  279.     mov    eax, ebx
  280.     pop    ebx
  281. ; Line 208
  282.     leave
  283.     ret    0
  284. _RangeDecoderDecodeDirectBits ENDP
  285. ; Function compile flags: /Ogsy
  286. _RangeDecoderBitDecode PROC NEAR            ; COMDAT
  287. ; _prob$ = ecx
  288. ; _rd$ = edx
  289. ; Line 212
  290.     mov    eax, DWORD PTR [edx+8]
  291.     push    esi
  292.     movzx    esi, WORD PTR [ecx]
  293.     push    edi
  294.     mov    edi, eax
  295.     shr    edi, 11                    ; 0000000bH
  296.     imul    edi, esi
  297. ; Line 213
  298.     mov    esi, DWORD PTR [edx+12]
  299.     cmp    esi, edi
  300.     jae    SHORT $L73267
  301. ; Line 215
  302.     mov    DWORD PTR [edx+8], edi
  303. ; Line 216
  304.     xor    eax, eax
  305.     mov    ax, WORD PTR [ecx]
  306.     movzx    esi, ax
  307.     mov    edi, 2048                ; 00000800H
  308.     sub    edi, esi
  309.     sar    edi, 5
  310.     add    edi, eax
  311.     mov    WORD PTR [ecx], di
  312. ; Line 217
  313.     cmp    DWORD PTR [edx+8], 16777216        ; 01000000H
  314.     jae    SHORT $L73269
  315. ; Line 219
  316.     call    _RangeDecoderReadByte
  317.     mov    ecx, DWORD PTR [edx+12]
  318.     movzx    eax, al
  319.     shl    ecx, 8
  320.     or    eax, ecx
  321. ; Line 220
  322.     shl    DWORD PTR [edx+8], 8
  323.     mov    DWORD PTR [edx+12], eax
  324. $L73269:
  325. ; Line 222
  326.     xor    eax, eax
  327.     jmp    SHORT $L73270
  328. $L73267:
  329. ; Line 226
  330.     sub    eax, edi
  331. ; Line 227
  332.     sub    esi, edi
  333.     mov    DWORD PTR [edx+8], eax
  334.     mov    DWORD PTR [edx+12], esi
  335. ; Line 228
  336.     xor    eax, eax
  337.     mov    ax, WORD PTR [ecx]
  338.     xor    esi, esi
  339.     mov    si, ax
  340.     shr    si, 5
  341.     sub    eax, esi
  342.     mov    WORD PTR [ecx], ax
  343. ; Line 229
  344.     cmp    DWORD PTR [edx+8], 16777216        ; 01000000H
  345.     jae    SHORT $L73272
  346. ; Line 231
  347.     call    _RangeDecoderReadByte
  348.     mov    ecx, DWORD PTR [edx+12]
  349.     movzx    eax, al
  350.     shl    ecx, 8
  351.     or    eax, ecx
  352. ; Line 232
  353.     shl    DWORD PTR [edx+8], 8
  354.     mov    DWORD PTR [edx+12], eax
  355. $L73272:
  356. ; Line 234
  357.     xor    eax, eax
  358.     inc    eax
  359. $L73270:
  360.     pop    edi
  361.     pop    esi
  362. ; Line 236
  363.     ret    0
  364. _RangeDecoderBitDecode ENDP
  365. ; Function compile flags: /Ogsy
  366. _probs$ = 8                        ; size = 4
  367. _numLevels$ = 12                    ; size = 4
  368. _rd$ = 16                        ; size = 4
  369. _RangeDecoderBitTreeDecode PROC NEAR            ; COMDAT
  370. ; Line 249
  371.     push    ebp
  372.     mov    ebp, esp
  373. ; Line 250
  374.     xor    eax, eax
  375.     inc    eax
  376. ; Line 255
  377.     cmp    DWORD PTR _numLevels$[ebp], 0
  378.     jle    SHORT $L73285
  379.     push    esi
  380.     push    edi
  381.     mov    edi, DWORD PTR _numLevels$[ebp]
  382. $L73283:
  383. ; Line 261
  384.     mov    edx, DWORD PTR _rd$[ebp]
  385.     lea    esi, DWORD PTR [eax+eax]
  386.     mov    eax, DWORD PTR _probs$[ebp]
  387.     lea    ecx, DWORD PTR [esi+eax]
  388.     call    _RangeDecoderBitDecode
  389.     add    eax, esi
  390.     dec    edi
  391.     jne    SHORT $L73283
  392.     pop    edi
  393.     pop    esi
  394. $L73285:
  395. ; Line 267
  396.     mov    ecx, DWORD PTR _numLevels$[ebp]
  397.     xor    edx, edx
  398.     inc    edx
  399.     shl    edx, cl
  400.     sub    eax, edx
  401. ; Line 268
  402.     pop    ebp
  403.     ret    0
  404. _RangeDecoderBitTreeDecode ENDP
  405. ; Function compile flags: /Ogsy
  406. _probs$ = 8                        ; size = 4
  407. _numLevels$ = 12                    ; size = 4
  408. _rd$ = 16                        ; size = 4
  409. _RangeDecoderReverseBitTreeDecode PROC NEAR        ; COMDAT
  410. ; Line 271
  411.     push    ebx
  412. ; Line 272
  413.     xor    edx, edx
  414.     push    edi
  415. ; Line 274
  416.     xor    ebx, ebx
  417.     inc    edx
  418. ; Line 278
  419.     xor    edi, edi
  420.     cmp    DWORD PTR _numLevels$[esp+4], ebx
  421.     jle    SHORT $L73299
  422.     push    esi
  423. $L73297:
  424. ; Line 284
  425.     mov    eax, DWORD PTR _probs$[esp+8]
  426.     lea    esi, DWORD PTR [edx+edx]
  427.     mov    edx, DWORD PTR _rd$[esp+8]
  428.     lea    ecx, DWORD PTR [esi+eax]
  429.     call    _RangeDecoderBitDecode
  430. ; Line 286
  431.     mov    ecx, edi
  432.     lea    edx, DWORD PTR [esi+eax]
  433.     shl    eax, cl
  434.     or    ebx, eax
  435.     inc    edi
  436.     cmp    edi, DWORD PTR _numLevels$[esp+8]
  437.     jl    SHORT $L73297
  438.     pop    esi
  439. $L73299:
  440.     pop    edi
  441. ; Line 292
  442.     mov    eax, ebx
  443.     pop    ebx
  444. ; Line 293
  445.     ret    0
  446. _RangeDecoderReverseBitTreeDecode ENDP
  447. ; Function compile flags: /Ogsy
  448. _probs$ = 8                        ; size = 4
  449. _rd$ = 12                        ; size = 4
  450. _LzmaLiteralDecode PROC NEAR                ; COMDAT
  451. ; Line 297
  452.     xor    eax, eax
  453.     inc    eax
  454.     push    esi
  455. $L73308:
  456. ; Line 307
  457.     mov    edx, DWORD PTR _rd$[esp]
  458.     lea    esi, DWORD PTR [eax+eax]
  459.     mov    eax, DWORD PTR _probs$[esp]
  460.     lea    ecx, DWORD PTR [esi+eax]
  461.     call    _RangeDecoderBitDecode
  462.     or    eax, esi
  463. ; Line 310
  464.     cmp    eax, 256                ; 00000100H
  465.     jl    SHORT $L73308
  466.     pop    esi
  467. ; Line 315
  468.     ret    0
  469. _LzmaLiteralDecode ENDP
  470. ; Function compile flags: /Ogsy
  471. _probs$ = 8                        ; size = 4
  472. _matchByte$ = 12                    ; size = 1
  473. _LzmaLiteralDecodeMatch PROC NEAR            ; COMDAT
  474. ; _rd$ = edx
  475. ; Line 318
  476.     push    ebx
  477.     push    esi
  478. ; Line 319
  479.     xor    ebx, ebx
  480.     push    edi
  481.     inc    ebx
  482.     mov    edi, 256                ; 00000100H
  483. $L73320:
  484. ; Line 326
  485.     movzx    esi, BYTE PTR _matchByte$[esp+8]
  486. ; Line 334
  487.     mov    ecx, DWORD PTR _probs$[esp+8]
  488.     shl    BYTE PTR _matchByte$[esp+8], 1
  489.     shr    esi, 7
  490.     lea    eax, DWORD PTR [esi+1]
  491.     shl    eax, 8
  492.     add    eax, ebx
  493.     lea    ecx, DWORD PTR [ecx+eax*2]
  494.     call    _RangeDecoderBitDecode
  495. ; Line 335
  496.     add    ebx, ebx
  497.     or    ebx, eax
  498. ; Line 337
  499.     cmp    esi, eax
  500.     jne    SHORT $L73465
  501. ; Line 351
  502.     cmp    ebx, edi
  503.     jl    SHORT $L73320
  504.     jmp    SHORT $L73322
  505. $L73327:
  506. ; Line 345
  507.     mov    eax, DWORD PTR _probs$[esp+8]
  508.     lea    esi, DWORD PTR [ebx+ebx]
  509.     lea    ecx, DWORD PTR [esi+eax]
  510.     call    _RangeDecoderBitDecode
  511.     or    eax, esi
  512.     mov    ebx, eax
  513. $L73465:
  514. ; Line 339
  515.     cmp    ebx, edi
  516.     jl    SHORT $L73327
  517. $L73322:
  518.     pop    edi
  519.     pop    esi
  520. ; Line 355
  521.     mov    al, bl
  522.     pop    ebx
  523. ; Line 356
  524.     ret    0
  525. _LzmaLiteralDecodeMatch ENDP
  526. ; Function compile flags: /Ogsy
  527. _LzmaLenDecode PROC NEAR                ; COMDAT
  528. ; _p$ = ecx
  529. ; _rd$ = edx
  530. ; _posState$ = eax
  531. ; Line 376
  532.     push    esi
  533.     push    edi
  534.     mov    esi, eax
  535.     mov    edi, ecx
  536. ; Line 377
  537.     call    _RangeDecoderBitDecode
  538.     test    eax, eax
  539.     jne    SHORT $L73337
  540. ; Line 379
  541.     push    edx
  542.     shl    esi, 4
  543.     lea    eax, DWORD PTR [esi+edi+4]
  544.     push    3
  545.     push    eax
  546.     call    _RangeDecoderBitTreeDecode
  547.     add    esp, 12                    ; 0000000cH
  548.     jmp    SHORT $L73336
  549. $L73337:
  550. ; Line 380
  551.     lea    ecx, DWORD PTR [edi+2]
  552.     call    _RangeDecoderBitDecode
  553.     test    eax, eax
  554. ; Line 382
  555.     push    edx
  556.     jne    SHORT $L73338
  557.     shl    esi, 4
  558.     lea    eax, DWORD PTR [esi+edi+260]
  559.     push    3
  560.     push    eax
  561.     call    _RangeDecoderBitTreeDecode
  562.     add    esp, 12                    ; 0000000cH
  563.     add    eax, 8
  564.     jmp    SHORT $L73336
  565. $L73338:
  566. ; Line 384
  567.     push    8
  568.     add    edi, 516                ; 00000204H
  569.     push    edi
  570.     call    _RangeDecoderBitTreeDecode
  571.     add    esp, 12                    ; 0000000cH
  572.     add    eax, 16                    ; 00000010H
  573. $L73336:
  574.     pop    edi
  575.     pop    esi
  576. ; Line 385
  577.     ret    0
  578. _LzmaLenDecode ENDP
  579. _rd$ = -56                        ; size = 20
  580. _literalPosMask$ = -36                    ; size = 4
  581. _posStateMask$ = -32                    ; size = 4
  582. _rep3$ = -28                        ; size = 4
  583. _previousIsMatch$ = -24                    ; size = 4
  584. _rep1$ = -20                        ; size = 4
  585. _rep2$ = -16                        ; size = 4
  586. _state$ = -12                        ; size = 4
  587. _nowPos$ = -8                        ; size = 4
  588. _rep0$ = -4                        ; size = 4
  589. _buffer$ = 8                        ; size = 4
  590. _len$ = 12                        ; size = 4
  591. _bufferSize$ = 12                    ; size = 4
  592. _lc$ = 16                        ; size = 4
  593. _code$73502 = 20                    ; size = 4
  594. tv176 = 20                        ; size = 4
  595. _posState$73385 = 20                    ; size = 4
  596. _lp$ = 20                        ; size = 4
  597. $T73491 = 23                        ; size = 1
  598. tv329 = 24                        ; size = 4
  599. _pb$ = 24                        ; size = 4
  600. _inStream$ = 28                        ; size = 4
  601. _inSize$ = 32                        ; size = 4
  602. _outStream$ = 36                    ; size = 4
  603. _outSize$ = 40                        ; size = 4
  604. _outSizeProcessed$ = 44                    ; size = 4
  605. _LzmaDecode PROC NEAR                    ; COMDAT
  606. ; Line 531
  607.     push    ebp
  608.     mov    ebp, esp
  609.     sub    esp, 56                    ; 00000038H
  610. ; Line 532
  611.     mov    edx, DWORD PTR _lp$[ebp]
  612.     mov    eax, DWORD PTR _lc$[ebp]
  613.     push    ebx
  614.     push    esi
  615. ; Line 539
  616.     xor    esi, esi
  617.     inc    esi
  618.     lea    ecx, DWORD PTR [eax+edx]
  619.     mov    DWORD PTR _rep0$[ebp], esi
  620.     mov    DWORD PTR _rep1$[ebp], esi
  621.     mov    DWORD PTR _rep2$[ebp], esi
  622.     mov    DWORD PTR _rep3$[ebp], esi
  623.     mov    eax, 768                ; 00000300H
  624.     shl    eax, cl
  625. ; Line 541
  626.     mov    ecx, DWORD PTR _pb$[ebp]
  627.     shl    esi, cl
  628.     xor    bl, bl
  629.     add    eax, 1846                ; 00000736H
  630.     push    edi
  631.     xor    edi, edi
  632.     dec    esi
  633.     mov    DWORD PTR _posStateMask$[ebp], esi
  634. ; Line 542
  635.     xor    esi, esi
  636.     inc    esi
  637.     mov    ecx, edx
  638.     shl    esi, cl
  639. ; Line 544
  640.     lea    ecx, DWORD PTR [eax+eax]
  641.     mov    DWORD PTR _state$[ebp], edi
  642.     mov    DWORD PTR _previousIsMatch$[ebp], edi
  643.     dec    esi
  644.     cmp    DWORD PTR _bufferSize$[ebp], ecx
  645.     mov    DWORD PTR _nowPos$[ebp], edi
  646.     mov    DWORD PTR _literalPosMask$[ebp], esi
  647.     jae    SHORT $L73378
  648. ; Line 545
  649.     push    2
  650.     pop    eax
  651.     jmp    SHORT $L73359
  652. $L73378:
  653. ; Line 546
  654.     test    eax, eax
  655.     mov    esi, DWORD PTR _buffer$[ebp]
  656.     jbe    SHORT $L73379
  657.     mov    ecx, eax
  658.     shr    ecx, 1
  659.     mov    eax, 67109888                ; 04000400H
  660.     mov    edi, esi
  661.     rep stosd
  662.     adc    ecx, ecx
  663.     rep stosw
  664.     mov    edi, DWORD PTR _state$[ebp]
  665. $L73379:
  666. ; Line 554
  667.     mov    eax, DWORD PTR _inStream$[ebp]
  668.     mov    ecx, DWORD PTR _inSize$[ebp]
  669.     and    DWORD PTR _rd$[ebp+16], 0
  670.     and    DWORD PTR _rd$[ebp+12], 0
  671.     mov    DWORD PTR _rd$[ebp], eax
  672.     add    eax, ecx
  673.     or    DWORD PTR _rd$[ebp+8], -1
  674.     mov    DWORD PTR _rd$[ebp+4], eax
  675.     mov    DWORD PTR tv176[ebp], 5
  676. $L73475:
  677.     lea    edx, DWORD PTR _rd$[ebp]
  678.     call    _RangeDecoderReadByte
  679.     mov    ecx, DWORD PTR _rd$[ebp+12]
  680.     movzx    eax, al
  681.     shl    ecx, 8
  682.     or    eax, ecx
  683.     dec    DWORD PTR tv176[ebp]
  684.     mov    DWORD PTR _rd$[ebp+12], eax
  685.     jne    SHORT $L73475
  686. ; Line 557
  687.     mov    eax, DWORD PTR _outSizeProcessed$[ebp]
  688.     and    DWORD PTR [eax], 0
  689. ; Line 558
  690.     cmp    DWORD PTR _outSize$[ebp], 0
  691.     ja    SHORT $L73383
  692. $L73531:
  693. ; Line 747
  694.     mov    eax, DWORD PTR _nowPos$[ebp]
  695.     mov    ecx, DWORD PTR _outSizeProcessed$[ebp]
  696.     mov    DWORD PTR [ecx], eax
  697. ; Line 748
  698.     xor    eax, eax
  699. $L73359:
  700.     pop    edi
  701.     pop    esi
  702.     pop    ebx
  703. ; Line 749
  704.     leave
  705.     ret    0
  706. $L73529:
  707. ; Line 558
  708.     mov    edi, DWORD PTR _state$[ebp]
  709. $L73383:
  710. ; Line 566
  711.     mov    eax, DWORD PTR _posStateMask$[ebp]
  712.     and    eax, DWORD PTR _nowPos$[ebp]
  713. ; Line 571
  714.     cmp    DWORD PTR _rd$[ebp+16], 0
  715.     mov    DWORD PTR _posState$73385[ebp], eax
  716.     jne    $L73520
  717. ; Line 573
  718.     mov    ecx, edi
  719.     shl    ecx, 4
  720.     add    ecx, eax
  721.     lea    ecx, DWORD PTR [esi+ecx*2]
  722.     lea    edx, DWORD PTR _rd$[ebp]
  723.     call    _RangeDecoderBitDecode
  724.     test    eax, eax
  725.     jne    $L73388
  726. ; Line 582
  727.     mov    edx, DWORD PTR _literalPosMask$[ebp]
  728.     and    edx, DWORD PTR _nowPos$[ebp]
  729.     xor    ecx, ecx
  730.     mov    cl, 8
  731.     sub    cl, BYTE PTR _lc$[ebp]
  732.     movzx    eax, bl
  733.     shr    eax, cl
  734.     mov    ecx, DWORD PTR _lc$[ebp]
  735.     shl    edx, cl
  736.     add    eax, edx
  737.     lea    eax, DWORD PTR [eax+eax*2]
  738.     shl    eax, 9
  739. ; Line 584
  740.     cmp    DWORD PTR _state$[ebp], 4
  741.     lea    esi, DWORD PTR [eax+esi+3692]
  742.     jge    SHORT $L73390
  743.     and    DWORD PTR _state$[ebp], 0
  744. ; Line 585
  745.     jmp    SHORT $L73393
  746. $L73390:
  747.     cmp    DWORD PTR _state$[ebp], 10        ; 0000000aH
  748.     jge    SHORT $L73392
  749.     sub    DWORD PTR _state$[ebp], 3
  750. ; Line 586
  751.     jmp    SHORT $L73393
  752. $L73392:
  753.     sub    DWORD PTR _state$[ebp], 6
  754. $L73393:
  755. ; Line 598
  756.     xor    ebx, ebx
  757.     cmp    DWORD PTR _previousIsMatch$[ebp], ebx
  758.     je    SHORT $L73394
  759.     mov    eax, DWORD PTR _nowPos$[ebp]
  760.     sub    eax, DWORD PTR _rep0$[ebp]
  761.     mov    ecx, DWORD PTR _outStream$[ebp]
  762.     mov    al, BYTE PTR [eax+ecx]
  763.     mov    BYTE PTR $T73491[ebp], al
  764.     inc    ebx
  765. $L73482:
  766.     movzx    edi, BYTE PTR $T73491[ebp]
  767.     shl    BYTE PTR $T73491[ebp], 1
  768.     shr    edi, 7
  769.     lea    eax, DWORD PTR [edi+1]
  770.     shl    eax, 8
  771.     add    eax, ebx
  772.     lea    ecx, DWORD PTR [esi+eax*2]
  773.     lea    edx, DWORD PTR _rd$[ebp]
  774.     call    _RangeDecoderBitDecode
  775.     add    ebx, ebx
  776.     or    ebx, eax
  777.     cmp    edi, eax
  778.     jne    SHORT $L73533
  779.     cmp    ebx, 256                ; 00000100H
  780.     jl    SHORT $L73482
  781.     jmp    SHORT $L73484
  782. $L73488:
  783.     lea    edi, DWORD PTR [ebx+ebx]
  784.     lea    ecx, DWORD PTR [edi+esi]
  785.     lea    edx, DWORD PTR _rd$[ebp]
  786.     call    _RangeDecoderBitDecode
  787.     or    eax, edi
  788.     mov    ebx, eax
  789. $L73533:
  790.     cmp    ebx, 256                ; 00000100H
  791.     jl    SHORT $L73488
  792. $L73484:
  793. ; Line 599
  794.     and    DWORD PTR _previousIsMatch$[ebp], 0
  795. ; Line 601
  796.     jmp    SHORT $L73396
  797. $L73394:
  798. ; Line 602
  799.     inc    ebx
  800. $L73495:
  801.     lea    edi, DWORD PTR [ebx+ebx]
  802.     lea    ecx, DWORD PTR [edi+esi]
  803.     lea    edx, DWORD PTR _rd$[ebp]
  804.     call    _RangeDecoderBitDecode
  805.     or    eax, edi
  806.     mov    ebx, eax
  807.     cmp    ebx, 256                ; 00000100H
  808.     jl    SHORT $L73495
  809. $L73396:
  810. ; Line 603
  811.     mov    ecx, DWORD PTR _nowPos$[ebp]
  812.     mov    eax, DWORD PTR _outStream$[ebp]
  813.     inc    DWORD PTR _nowPos$[ebp]
  814. ; Line 610
  815.     mov    esi, DWORD PTR _buffer$[ebp]
  816.     mov    BYTE PTR [ecx+eax], bl
  817.     jmp    $L73421
  818. $L73388:
  819. ; Line 612
  820.     xor    ebx, ebx
  821.     inc    ebx
  822. ; Line 613
  823.     lea    ecx, DWORD PTR [esi+edi*2+384]
  824.     lea    edx, DWORD PTR _rd$[ebp]
  825.     mov    DWORD PTR _previousIsMatch$[ebp], ebx
  826.     call    _RangeDecoderBitDecode
  827.     cmp    eax, ebx
  828.     jne    $L73398
  829. ; Line 615
  830.     lea    ecx, DWORD PTR [esi+edi*2+408]
  831.     call    _RangeDecoderBitDecode
  832.     test    eax, eax
  833.     jne    SHORT $L73399
  834. ; Line 617
  835.     lea    eax, DWORD PTR [edi+15]
  836.     shl    eax, 4
  837.     add    eax, DWORD PTR _posState$73385[ebp]
  838.     lea    ecx, DWORD PTR [esi+eax*2]
  839.     call    _RangeDecoderBitDecode
  840.     test    eax, eax
  841.     jne    SHORT $L73530
  842. ; Line 628
  843.     cmp    DWORD PTR _nowPos$[ebp], eax
  844.     je    $L73523
  845. ; Line 640
  846.     mov    ecx, DWORD PTR _nowPos$[ebp]
  847.     cmp    edi, 7
  848.     setge    al
  849.     sub    ecx, DWORD PTR _rep0$[ebp]
  850.     lea    eax, DWORD PTR [eax+eax+9]
  851.     mov    DWORD PTR _state$[ebp], eax
  852.     mov    eax, DWORD PTR _outStream$[ebp]
  853.     mov    bl, BYTE PTR [ecx+eax]
  854. ; Line 642
  855.     mov    ecx, DWORD PTR _nowPos$[ebp]
  856.     inc    DWORD PTR _nowPos$[ebp]
  857.     mov    BYTE PTR [ecx+eax], bl
  858. ; Line 643
  859.     jmp    $L73421
  860. $L73399:
  861. ; Line 649
  862.     lea    ecx, DWORD PTR [esi+edi*2+432]
  863.     call    _RangeDecoderBitDecode
  864.     test    eax, eax
  865.     jne    SHORT $L73404
  866. ; Line 650
  867.     mov    eax, DWORD PTR _rep1$[ebp]
  868. ; Line 651
  869.     jmp    SHORT $L73405
  870. $L73404:
  871. ; Line 653
  872.     lea    ecx, DWORD PTR [esi+edi*2+456]
  873.     lea    edx, DWORD PTR _rd$[ebp]
  874.     call    _RangeDecoderBitDecode
  875.     test    eax, eax
  876.     jne    SHORT $L73406
  877. ; Line 654
  878.     mov    eax, DWORD PTR _rep2$[ebp]
  879. ; Line 655
  880.     jmp    SHORT $L73407
  881. $L73406:
  882. ; Line 658
  883.     mov    ecx, DWORD PTR _rep2$[ebp]
  884.     mov    eax, DWORD PTR _rep3$[ebp]
  885.     mov    DWORD PTR _rep3$[ebp], ecx
  886. $L73407:
  887. ; Line 660
  888.     mov    ecx, DWORD PTR _rep1$[ebp]
  889.     mov    DWORD PTR _rep2$[ebp], ecx
  890. $L73405:
  891. ; Line 662
  892.     mov    ecx, DWORD PTR _rep0$[ebp]
  893.     mov    DWORD PTR _rep1$[ebp], ecx
  894. ; Line 663
  895.     mov    DWORD PTR _rep0$[ebp], eax
  896. $L73530:
  897. ; Line 665
  898.     mov    eax, DWORD PTR _posState$73385[ebp]
  899.     lea    ecx, DWORD PTR [esi+2664]
  900.     lea    edx, DWORD PTR _rd$[ebp]
  901.     call    _LzmaLenDecode
  902.     mov    edx, eax
  903. ; Line 666
  904.     xor    eax, eax
  905.     cmp    edi, 7
  906.     setge    al
  907.     dec    eax
  908.     and    eax, -3                    ; fffffffdH
  909.     add    eax, 11                    ; 0000000bH
  910.     mov    DWORD PTR _state$[ebp], eax
  911. ; Line 668
  912.     jmp    $L73408
  913. $L73398:
  914. ; Line 671
  915.     mov    eax, DWORD PTR _rep2$[ebp]
  916.     mov    DWORD PTR _rep3$[ebp], eax
  917. ; Line 672
  918.     mov    eax, DWORD PTR _rep1$[ebp]
  919.     mov    DWORD PTR _rep2$[ebp], eax
  920. ; Line 673
  921.     mov    eax, DWORD PTR _rep0$[ebp]
  922.     mov    DWORD PTR _rep1$[ebp], eax
  923. ; Line 674
  924.     xor    eax, eax
  925.     cmp    edi, 7
  926.     setge    al
  927. ; Line 675
  928.     lea    ecx, DWORD PTR [esi+1636]
  929.     dec    eax
  930.     and    eax, -3                    ; fffffffdH
  931.     add    eax, 10                    ; 0000000aH
  932.     mov    DWORD PTR _state$[ebp], eax
  933.     mov    eax, DWORD PTR _posState$73385[ebp]
  934.     call    _LzmaLenDecode
  935. ; Line 678
  936.     cmp    eax, 4
  937.     mov    DWORD PTR _len$[ebp], eax
  938.     jl    SHORT $L73471
  939.     push    3
  940.     pop    eax
  941. $L73471:
  942.     lea    ecx, DWORD PTR _rd$[ebp]
  943.     push    ecx
  944.     shl    eax, 7
  945.     lea    eax, DWORD PTR [eax+esi+864]
  946.     push    6
  947.     push    eax
  948.     call    _RangeDecoderBitTreeDecode
  949.     add    esp, 12                    ; 0000000cH
  950. ; Line 679
  951.     cmp    eax, 4
  952.     jl    $L73410
  953. ; Line 681
  954.     mov    ecx, eax
  955. ; Line 682
  956.     mov    edi, eax
  957.     and    edi, ebx
  958.     sar    ecx, 1
  959.     dec    ecx
  960.     or    edi, 2
  961.     shl    edi, cl
  962. ; Line 683
  963.     cmp    eax, 14                    ; 0000000eH
  964.     mov    DWORD PTR _rep0$[ebp], edi
  965.     jge    SHORT $L73413
  966. ; Line 686
  967.     lea    edx, DWORD PTR _rd$[ebp]
  968.     push    edx
  969.     push    ecx
  970.     mov    ecx, edi
  971.     sub    ecx, eax
  972.     lea    eax, DWORD PTR [esi+ecx*2+1374]
  973.     push    eax
  974.     call    _RangeDecoderReverseBitTreeDecode
  975.     add    esp, 12                    ; 0000000cH
  976.     add    edi, eax
  977.     mov    DWORD PTR _rep0$[ebp], edi
  978. ; Line 688
  979.     jmp    SHORT $L73415
  980. $L73413:
  981. ; Line 691
  982.     mov    eax, DWORD PTR _rd$[ebp+12]
  983.     mov    ebx, DWORD PTR _rd$[ebp+8]
  984.     add    ecx, -4                    ; fffffffcH
  985.     xor    edi, edi
  986.     test    ecx, ecx
  987.     mov    DWORD PTR _code$73502[ebp], eax
  988.     jle    SHORT $L73507
  989.     mov    DWORD PTR tv329[ebp], ecx
  990. $L73532:
  991.     shr    ebx, 1
  992.     shl    edi, 1
  993.     cmp    DWORD PTR _code$73502[ebp], ebx
  994.     jb    SHORT $L73508
  995.     sub    DWORD PTR _code$73502[ebp], ebx
  996.     or    edi, 1
  997. $L73508:
  998.     cmp    ebx, 16777216                ; 01000000H
  999.     jae    SHORT $L73506
  1000.     lea    edx, DWORD PTR _rd$[ebp]
  1001.     shl    ebx, 8
  1002.     call    _RangeDecoderReadByte
  1003.     mov    ecx, DWORD PTR _code$73502[ebp]
  1004.     movzx    eax, al
  1005.     shl    ecx, 8
  1006.     or    eax, ecx
  1007.     mov    DWORD PTR _code$73502[ebp], eax
  1008. $L73506:
  1009.     dec    DWORD PTR tv329[ebp]
  1010.     jne    SHORT $L73532
  1011. $L73507:
  1012.     mov    eax, DWORD PTR _code$73502[ebp]
  1013.     mov    DWORD PTR _rd$[ebp+12], eax
  1014. ; Line 692
  1015.     lea    eax, DWORD PTR _rd$[ebp]
  1016.     push    eax
  1017.     lea    eax, DWORD PTR [esi+1604]
  1018.     push    4
  1019.     push    eax
  1020.     mov    DWORD PTR _rd$[ebp+8], ebx
  1021.     call    _RangeDecoderReverseBitTreeDecode
  1022.     shl    edi, 4
  1023.     add    edi, DWORD PTR _rep0$[ebp]
  1024. ; Line 695
  1025.     xor    ebx, ebx
  1026.     add    edi, eax
  1027.     add    esp, 12                    ; 0000000cH
  1028.     mov    DWORD PTR _rep0$[ebp], edi
  1029.     inc    ebx
  1030.     jmp    SHORT $L73415
  1031. $L73410:
  1032. ; Line 696
  1033.     mov    DWORD PTR _rep0$[ebp], eax
  1034. $L73415:
  1035. ; Line 697
  1036.     inc    DWORD PTR _rep0$[ebp]
  1037.     mov    edx, DWORD PTR _len$[ebp]
  1038. $L73408:
  1039. ; Line 699
  1040.     cmp    DWORD PTR _rep0$[ebp], 0
  1041.     je    $L73531
  1042. ; Line 709
  1043.     mov    ecx, DWORD PTR _nowPos$[ebp]
  1044.     cmp    DWORD PTR _rep0$[ebp], ecx
  1045.     ja    SHORT $L73523
  1046. ; Line 713
  1047.     mov    edi, DWORD PTR _outStream$[ebp]
  1048.     mov    eax, ecx
  1049.     sub    eax, DWORD PTR _rep0$[ebp]
  1050.     inc    edx
  1051.     inc    edx
  1052.     add    eax, edi
  1053. $L73419:
  1054. ; Line 725
  1055.     mov    bl, BYTE PTR [eax]
  1056. ; Line 727
  1057.     mov    BYTE PTR [ecx+edi], bl
  1058.     inc    ecx
  1059.     inc    eax
  1060. ; Line 728
  1061.     dec    edx
  1062. ; Line 730
  1063.     test    edx, edx
  1064.     mov    DWORD PTR _nowPos$[ebp], ecx
  1065.     jle    SHORT $L73421
  1066.     cmp    ecx, DWORD PTR _outSize$[ebp]
  1067.     jb    SHORT $L73419
  1068. $L73421:
  1069. ; Line 558
  1070.     mov    eax, DWORD PTR _nowPos$[ebp]
  1071.     cmp    eax, DWORD PTR _outSize$[ebp]
  1072.     jb    $L73529
  1073. ; Line 709
  1074.     jmp    $L73531
  1075. $L73520:
  1076. ; Line 572
  1077.     xor    eax, eax
  1078.     inc    eax
  1079.     jmp    $L73359
  1080. $L73523:
  1081. ; Line 711
  1082.     mov    eax, ebx
  1083.     jmp    $L73359
  1084. _LzmaDecode ENDP
  1085.  
  1086. ; =================================================================
  1087.  
  1088. _DecodeSmall@12_end:
  1089.  
  1090. _TEXT ENDS
  1091.  
  1092. END
  1093.