📄 inflate.cod
字号:
0001d 81 e3 01 ff ff
ff and ebx, -255 ; ffffff01H
00023 0f b6 ea movzx ebp, dl
00026 81 c3 ff 00 00
00 add ebx, 255 ; 000000ffH
0002c 3b eb cmp ebp, ebx
0002e 75 05 jne SHORT $LN4@syncsearch
; 1251 : got++;
00030 83 c1 01 add ecx, 1
00033 eb 11 jmp SHORT $LN1@syncsearch
$LN4@syncsearch:
; 1252 : else if (buf[next])
00035 84 d2 test dl, dl
00037 74 04 je SHORT $LN2@syncsearch
; 1253 : got = 0;
00039 33 c9 xor ecx, ecx
; 1254 : else
0003b eb 09 jmp SHORT $LN1@syncsearch
$LN2@syncsearch:
; 1255 : got = 4 - got;
0003d ba 04 00 00 00 mov edx, 4
00042 2b d1 sub edx, ecx
00044 8b ca mov ecx, edx
$LN1@syncsearch:
; 1256 : next++;
00046 83 c0 01 add eax, 1
00049 3b 44 24 0c cmp eax, DWORD PTR _len$[esp+4]
0004d 72 c1 jb SHORT $LL6@syncsearch
$LN12@syncsearch:
0004f 5d pop ebp
00050 5b pop ebx
$LN11@syncsearch:
; 1257 : }
; 1258 : *have = got;
00051 89 0f mov DWORD PTR [edi], ecx
; 1259 : return next;
; 1260 : }
00053 c3 ret 0
_syncsearch ENDP
_TEXT ENDS
PUBLIC _inflateEnd@4
; Function compile flags: /Ogtpy
; COMDAT _inflateEnd@4
_TEXT SEGMENT
_strm$ = 8 ; size = 4
_inflateEnd@4 PROC ; COMDAT
; 1157 : {
00000 56 push esi
; 1158 : struct inflate_state FAR *state;
; 1159 : if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
00001 8b 74 24 08 mov esi, DWORD PTR _strm$[esp]
00005 85 f6 test esi, esi
00007 74 3c je SHORT $LN2@inflateEnd
00009 8b 46 1c mov eax, DWORD PTR [esi+28]
0000c 85 c0 test eax, eax
0000e 74 35 je SHORT $LN2@inflateEnd
00010 8b 4e 24 mov ecx, DWORD PTR [esi+36]
00013 85 c9 test ecx, ecx
00015 74 2e je SHORT $LN2@inflateEnd
; 1161 : state = (struct inflate_state FAR *)strm->state;
; 1162 : if (state->window != Z_NULL) ZFREE(strm, state->window);
00017 8b 40 34 mov eax, DWORD PTR [eax+52]
0001a 85 c0 test eax, eax
0001c 74 0a je SHORT $LN1@inflateEnd
0001e 50 push eax
0001f 8b 46 28 mov eax, DWORD PTR [esi+40]
00022 50 push eax
00023 ff d1 call ecx
00025 83 c4 08 add esp, 8
$LN1@inflateEnd:
; 1163 : ZFREE(strm, strm->state);
00028 8b 4e 1c mov ecx, DWORD PTR [esi+28]
0002b 8b 56 28 mov edx, DWORD PTR [esi+40]
0002e 8b 46 24 mov eax, DWORD PTR [esi+36]
00031 51 push ecx
00032 52 push edx
00033 ff d0 call eax
00035 83 c4 08 add esp, 8
; 1164 : strm->state = Z_NULL;
00038 c7 46 1c 00 00
00 00 mov DWORD PTR [esi+28], 0
; 1165 : Tracev((stderr, "inflate: end\n"));
; 1166 : return Z_OK;
0003f 33 c0 xor eax, eax
00041 5e pop esi
; 1167 : }
00042 c2 04 00 ret 4
$LN2@inflateEnd:
; 1160 : return Z_STREAM_ERROR;
00045 b8 fe ff ff ff mov eax, -2 ; fffffffeH
0004a 5e pop esi
; 1167 : }
0004b c2 04 00 ret 4
_inflateEnd@4 ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _updatewindow
_TEXT SEGMENT
_updatewindow PROC ; COMDAT
; _strm$ = ebx
; _out$ = eax
; 326 : {
00000 55 push ebp
00001 56 push esi
; 327 : struct inflate_state FAR *state;
; 328 : unsigned copy, dist;
; 329 :
; 330 : state = (struct inflate_state FAR *)strm->state;
00002 8b 73 1c mov esi, DWORD PTR [ebx+28]
; 331 :
; 332 : /* if it hasn't been done already, allocate space for the window */
; 333 : if (state->window == Z_NULL) {
00005 33 ed xor ebp, ebp
00007 39 6e 34 cmp DWORD PTR [esi+52], ebp
0000a 57 push edi
0000b 8b f8 mov edi, eax
0000d 75 27 jne SHORT $LN9@updatewind
; 334 : state->window = (unsigned char FAR *)
; 335 : ZALLOC(strm, 1U << state->wbits,
; 336 : sizeof(unsigned char));
0000f 8b 4e 24 mov ecx, DWORD PTR [esi+36]
00012 8b 53 20 mov edx, DWORD PTR [ebx+32]
00015 b8 01 00 00 00 mov eax, 1
0001a d3 e0 shl eax, cl
0001c 8b 4b 28 mov ecx, DWORD PTR [ebx+40]
0001f 6a 01 push 1
00021 50 push eax
00022 51 push ecx
00023 ff d2 call edx
00025 83 c4 0c add esp, 12 ; 0000000cH
; 337 : if (state->window == Z_NULL) return 1;
00028 3b c5 cmp eax, ebp
0002a 89 46 34 mov DWORD PTR [esi+52], eax
0002d 75 07 jne SHORT $LN9@updatewind
0002f 5f pop edi
00030 5e pop esi
00031 8d 45 01 lea eax, DWORD PTR [ebp+1]
00034 5d pop ebp
; 371 : }
00035 c3 ret 0
$LN9@updatewind:
; 338 : }
; 339 :
; 340 : /* if window not in use yet, initialize */
; 341 : if (state->wsize == 0) {
00036 39 6e 28 cmp DWORD PTR [esi+40], ebp
00039 75 13 jne SHORT $LN8@updatewind
; 342 : state->wsize = 1U << state->wbits;
0003b 8b 4e 24 mov ecx, DWORD PTR [esi+36]
0003e b8 01 00 00 00 mov eax, 1
00043 d3 e0 shl eax, cl
; 343 : state->write = 0;
00045 89 6e 30 mov DWORD PTR [esi+48], ebp
; 344 : state->whave = 0;
00048 89 6e 2c mov DWORD PTR [esi+44], ebp
0004b 89 46 28 mov DWORD PTR [esi+40], eax
$LN8@updatewind:
; 345 : }
; 346 :
; 347 : /* copy state->wsize or less output bytes into the circular window */
; 348 : copy = out - strm->avail_out;
0004e 2b 7b 10 sub edi, DWORD PTR [ebx+16]
; 349 : if (copy >= state->wsize) {
00051 8b 46 28 mov eax, DWORD PTR [esi+40]
00054 3b f8 cmp edi, eax
00056 72 22 jb SHORT $LN7@updatewind
; 350 : zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
00058 8b 4b 0c mov ecx, DWORD PTR [ebx+12]
0005b 8b 56 34 mov edx, DWORD PTR [esi+52]
0005e 50 push eax
0005f 2b c8 sub ecx, eax
00061 51 push ecx
00062 52 push edx
00063 e8 00 00 00 00 call _memcpy
; 351 : state->write = 0;
; 352 : state->whave = state->wsize;
00068 8b 46 28 mov eax, DWORD PTR [esi+40]
0006b 83 c4 0c add esp, 12 ; 0000000cH
0006e 5f pop edi
0006f 89 6e 30 mov DWORD PTR [esi+48], ebp
00072 89 46 2c mov DWORD PTR [esi+44], eax
00075 5e pop esi
; 368 : }
; 369 : }
; 370 : return 0;
00076 33 c0 xor eax, eax
00078 5d pop ebp
; 371 : }
00079 c3 ret 0
$LN7@updatewind:
; 353 : }
; 354 : else {
; 355 : dist = state->wsize - state->write;
0007a 2b 46 30 sub eax, DWORD PTR [esi+48]
0007d 8b e8 mov ebp, eax
; 356 : if (dist > copy) dist = copy;
0007f 3b ef cmp ebp, edi
00081 76 02 jbe SHORT $LN5@updatewind
00083 8b ef mov ebp, edi
$LN5@updatewind:
; 357 : zmemcpy(state->window + state->write, strm->next_out - copy, dist);
00085 8b 4b 0c mov ecx, DWORD PTR [ebx+12]
00088 8b 56 34 mov edx, DWORD PTR [esi+52]
0008b 03 56 30 add edx, DWORD PTR [esi+48]
0008e 55 push ebp
0008f 2b cf sub ecx, edi
00091 51 push ecx
00092 52 push edx
00093 e8 00 00 00 00 call _memcpy
00098 83 c4 0c add esp, 12 ; 0000000cH
; 358 : copy -= dist;
0009b 2b fd sub edi, ebp
; 359 : if (copy) {
0009d 74 22 je SHORT $LN4@updatewind
; 360 : zmemcpy(state->window, strm->next_out - copy, copy);
0009f 8b 43 0c mov eax, DWORD PTR [ebx+12]
000a2 8b 4e 34 mov ecx, DWORD PTR [esi+52]
000a5 57 push edi
000a6 2b c7 sub eax, edi
000a8 50 push eax
000a9 51 push ecx
000aa e8 00 00 00 00 call _memcpy
; 361 : state->write = copy;
; 362 : state->whave = state->wsize;
000af 8b 56 28 mov edx, DWORD PTR [esi+40]
000b2 83 c4 0c add esp, 12 ; 0000000cH
000b5 89 7e 30 mov DWORD PTR [esi+48], edi
000b8 5f pop edi
000b9 89 56 2c mov DWORD PTR [esi+44], edx
000bc 5e pop esi
; 368 : }
; 369 : }
; 370 : return 0;
000bd 33 c0 xor eax, eax
000bf 5d pop ebp
; 371 : }
000c0 c3 ret 0
$LN4@updatewind:
; 363 : }
; 364 : else {
; 365 : state->write += dist;
000c1 01 6e 30 add DWORD PTR [esi+48], ebp
000c4 8b 4e 30 mov ecx, DWORD PTR [esi+48]
; 366 : if (state->write == state->wsize) state->write = 0;
000c7 8b 46 28 mov eax, DWORD PTR [esi+40]
000ca 3b c8 cmp ecx, eax
000cc 75 07 jne SHORT $LN2@updatewind
000ce c7 46 30 00 00
00 00 mov DWORD PTR [esi+48], 0
$LN2@updatewind:
; 367 : if (state->whave < state->wsize) state->whave += dist;
000d5 8b 4e 2c mov ecx, DWORD PTR [esi+44]
000d8 3b c8 cmp ecx, eax
000da 73 05 jae SHORT $LN1@updatewind
000dc 03 cd add ecx, ebp
000de 89 4e 2c mov DWORD PTR [esi+44], ecx
$LN1@updatewind:
000e1 5f pop edi
000e2 5e pop esi
; 368 : }
; 369 : }
; 370 : return 0;
000e3 33 c0 xor eax, eax
000e5 5d pop ebp
; 371 : }
000e6 c3 ret 0
_updatewindow ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _fixedtables
_TEXT SEGMENT
_fixedtables PROC ; COMDAT
; _state$ = eax
; 208 : #ifdef BUILDFIXED
; 209 : static int virgin = 1;
; 210 : static code *lenfix, *distfix;
; 211 : static code fixed[544];
; 212 :
; 213 : /* build fixed huffman tables if first call (may not be thread safe) */
; 214 : if (virgin) {
; 215 : unsigned sym, bits;
; 216 : static code *next;
; 217 :
; 218 : /* literal/length table */
; 219 : sym = 0;
; 220 : while (sym < 144) state->lens[sym++] = 8;
; 221 : while (sym < 256) state->lens[sym++] = 9;
; 222 : while (sym < 280) state->lens[sym++] = 7;
; 223 : while (sym < 288) state->lens[sym++] = 8;
; 224 : next = fixed;
; 225 : lenfix = next;
; 226 : bits = 9;
; 227 : inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
; 228 :
; 229 : /* distance table */
; 230 : sym = 0;
; 231 : while (sym < 32) state->lens[sym++] = 5;
; 232 : distfix = next;
; 233 : bits = 5;
; 234 : inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
; 235 :
; 236 : /* do this just once */
; 237 : virgin = 0;
; 238 : }
; 239 : #else /* !BUILDFIXED */
; 240 : # include "inffixed.h"
; 241 : #endif /* BUILDFIXED */
; 242 : state->lencode = lenfix;
00000 c7 40 4c 00 00
00 00 mov DWORD PTR [eax+76], OFFSET ?lenfix@?1??fixedtables@@9@9
; 243 : state->lenbits = 9;
00007 c7 40 54 09 00
00 00 mov DWORD PTR [eax+84], 9
; 244 : state->distcode = distfix;
0000e c7 40 50 00 00
00 00 mov DWORD PTR [eax+80], OFFSET ?distfix@?1??fixedtables@@9@9
; 245 : state->distbits = 5;
00015 c7 40 58 05 00
00 00 mov DWORD PTR [eax+88], 5
; 246 : }
0001c c3 ret 0
_fixedtables ENDP
_TEXT ENDS
PUBLIC _inflateReset@4
; Function compile flags: /Ogtpy
; COMDAT _inflateReset@4
_TEXT SEGMENT
_strm$ = 8 ; size = 4
_inflateReset@4 PROC ; COMDAT
; 106 : struct inflate_state FAR *state;
; 107 :
; 108 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
00000 8b 54 24 04 mov edx, DWORD PTR _strm$[esp-4]
00004 33 c9 xor ecx, ecx
00006 3b d1 cmp edx, ecx
00008 74 4f je SHORT $LN1@inflateRes
0000a 8b 42 1c mov eax, DWORD PTR [edx+28]
0000d 3b c1 cmp eax, ecx
0000f 74 48 je SHORT $LN1@inflateRes
; 109 : state = (struct inflate_state FAR *)strm->state;
; 110 : strm->total_in = strm->total_out = state->total = 0;
00011 89 48 1c mov DWORD PTR [eax+28], ecx
00014 89 4a 14 mov DWORD PTR [edx+20], ecx
00017 89 4a 08 mov DWORD PTR [edx+8], ecx
; 111 : strm->msg = Z_NULL;
0001a 89 4a 18 mov DWORD PTR [edx+24], ecx
; 112 : strm->adler = 1; /* to support ill-conceived Java test suite */
0001d c7 42 30 01 00
00 00 mov DWORD PTR [edx+48], 1
; 113 : state->mode = HEAD;
00024 89 08 mov DWORD PTR [eax], ecx
; 114 : state->last = 0;
00026 89 48 04 mov DWORD PTR [eax+4], ecx
; 115 : state->havedict = 0;
00029 89 48 0c mov DWORD PTR [eax+12], ecx
; 116 : state->dmax = 32768U;
; 117 : state->head = Z_NULL;
0002c 89 48 20 mov DWORD PTR [eax+32], ecx
; 118 : state->wsize = 0;
0002f 89 48 28 mov DWORD PTR [eax+40], ecx
; 119 : state->whave = 0;
00032 89 48 2c mov DWORD PTR [eax+44], ecx
; 120 : state->write = 0;
00035 89 48 30 mov DWORD PTR [eax+48], ecx
; 121 : state->hold = 0;
00038 89 48 38 mov DWORD PTR [eax+56], ecx
; 122 : state->bits = 0;
0003b 89 48 3c mov DWORD PTR [eax+60], ecx
; 123 : state->lencode = state->distcode = state->next = state->codes;
0003e 8d 88 30 05 00
00 lea ecx, DWORD PTR [eax+1328]
00044 c7 40 14 00 80
00 00 mov DWORD PTR [eax+20], 32768 ; 00008000H
0004b 89 48 6c mov DWORD PTR [eax+108], ecx
0004e 89 48 50 mov DWORD PTR [eax+80], ecx
00051 89 48 4c mov DWORD PTR [eax+76], ecx
; 124 : Tracev((stderr, "inflate: reset\n"));
; 125 : return Z_OK;
00054 33 c0 xor eax, eax
; 126 : }
00056 c2 04 00 ret 4
$LN1@inflateRes:
; 106 : struct inflate_state FAR *state;
; 107 :
; 108 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
00059 b8 fe ff ff ff mov eax, -2 ; fffffffeH
; 126 : }
0005e c2 04 00 ret 4
_inflateReset@4 ENDP
PUBLIC _inflateSync@4
; Function compile flags: /Ogtpy
; COMDAT _inflateSync@4
_TEXT SEGMENT
_buf$ = 8 ; size = 4
_strm$ = 8 ; size = 4
_inflateSync@4 PROC ; COMDAT
; 1264 : {
00000 53 push ebx
00001 55 push ebp
; 1265 : unsigned len; /* number of bytes to look at or looked at */
; 1266 : unsigned long in, out; /* temporary to save total_in and total_out */
; 1267 : unsigned char buf[4]; /* to restore bit buffer to byte string */
; 1268 : struct inflate_state FAR *state;
; 1269 :
; 1270 : /* check parameters */
; 1271 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
00002 8b 6c 24 0c mov ebp, DWORD PTR _strm$[esp+4]
00006 85 ed test ebp, ebp
00008 0f 84 cb 00 00
00 je $LN6@inflateSyn@2
0000e 8b 5d 1c mov ebx, DWORD PTR [ebp+28]
00011 85 db test ebx, ebx
00013 0f 84 c0 00 00
00 je $LN6@inflateSyn@2
; 1272 : state = (struct inflate_state FAR *)strm->state;
; 1273 : if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
00019 83 7d 04 00 cmp DWORD PTR [ebp+4], 0
0001d 57 push edi
0001e bf 08 00 00 00 mov edi, 8
00023 75 0e jne SHORT $LN5@inflateSyn@2
00025 39 7b 3c cmp DWORD PTR [ebx+60], edi
00028 73 09 jae SHORT $LN5@inflateSyn@2
0002a 8d 47 f3 lea eax, DWORD PTR [edi-13]
0002d 5f pop edi
0002e 5d pop ebp
0002f 5b pop ebx
; 1303 : }
00030 c2 04 00 ret 4
$LN5@inflateSyn@2:
; 1274 :
; 1275 : /* if first time, start search in bit buffer */
; 1276 : if (state->mode != SYNC) {
00033 83 3b 1d cmp DWORD PTR [ebx], 29 ; 0000001dH
00036 56 push esi
00037 74 53 je SHORT $LN4@inflateSyn@2
; 1277 : state->mode = SYNC;
; 1278 : state->hold <<= state->bits & 7;
00039 8b 43 3c mov eax, DWORD PTR [ebx+60]
0003c 8b c8 mov ecx, eax
0003e 83 e1 07 and ecx, 7
00041 d3 63 38 shl DWORD PTR [ebx+56], cl
; 1279 : state->bits -= state->bits & 7;
00044 2b c1 sub eax, ecx
; 1280 : len = 0;
00046 33 c9 xor ecx, ecx
; 1281 : while (state->bits >= 8) {
00048 3b c7 cmp eax, edi
0004a c7 03 1d 00 00
00 mov DWORD PTR [ebx], 29 ; 0000001dH
00050 89 43 3c mov DWORD PTR [ebx+60], eax
00053 72 21 jb SHORT $LN2@inflateSyn@2
00055 8d 71 f8 lea esi, DWORD PTR [ecx-8]
00058 eb 06 8d 9b 00
00 00 00 npad 8
$LL3@inflateSyn@2:
; 1282 : buf[len++] = (unsigned char)(state->hold);
00060 8a 43 38 mov al, BYTE PTR [ebx+56]
; 1283 : state->hold >>= 8;
00063 c1 6b 38 08 shr DWORD PTR [ebx+56], 8
; 1284 : state->bits -= 8;
00067 01 73 3c add DWORD PTR [ebx+60], esi
0006a 88 44 0c 14 mov BYTE PTR _buf$[esp+ecx+12], al
0006e 83 c1 01 add ecx, 1
00071 39 7b 3c cmp DWORD PTR [ebx+60], edi
00074 73 ea jae SHORT $LL3@inflateSyn@2
$LN2@inflateSyn@2:
; 1285 : }
; 1286 : state->have = 0;
00076 8d 7b 68 lea edi, DWORD PTR [ebx+104]
; 1287 : syncsearch(&(state->have), buf, len);
00079 51 push ecx
0007a 8d 74 24 18 lea esi, DWORD PTR _buf$[esp+16]
0007e c7 07 00 00 00
00 mov DWORD PTR [edi], 0
00084 e8 00 00 00 00 call _syncsearch
00089 83 c4 04 add esp, 4
$LN4@inflateSyn@2:
; 1288 : }
; 1289 :
; 1290 : /* search available input */
; 1291 : len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
0008c 8b 4d 04 mov ecx, DWORD PTR [ebp+4]
0008f 8b 75 00 mov esi, DWORD PTR [ebp]
00092 8d 7b 68 lea edi, DWORD PTR [ebx+104]
00095 51 push ecx
00096 e8 00 00 00 00 call _syncsearch
; 1292 : strm->avail_in -= len;
; 1293 : strm->next_in += len;
; 1294 : strm->total_in += len;
0009b 01 45 08 add DWORD PTR [ebp+8], eax
0009e 29 45 04 sub DWORD PTR [ebp+4], eax
000a1 01 45 00 add DWORD PTR [ebp], eax
000a4 8b 75 08 mov esi, DWORD PTR [ebp+8]
000a7 83 c4 04 add esp, 4
; 1295 :
; 1296 : /* return no joy or set up to restart inflate() on a new block */
; 1297 : if (state->have != 4) return Z_DATA_ERROR;
000aa 83 3f 04 cmp DWORD PTR [edi], 4
000ad 74 0c je SHORT $LN1@inflateSyn@2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -