📄 gzio.cod
字号:
00000 83 7e 3c 00 cmp DWORD PTR [esi+60], 0
00004 75 4d jne SHORT $LN1@get_byte
; 265 : if (s->stream.avail_in == 0) {
00006 83 7e 04 00 cmp DWORD PTR [esi+4], 0
0000a 75 50 jne SHORT $LN3@get_byte
; 266 : errno = 0;
0000c e8 00 00 00 00 call __errno
00011 c7 00 00 00 00
00 mov DWORD PTR [eax], 0
; 267 : s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
00017 8b 46 40 mov eax, DWORD PTR [esi+64]
0001a 8b 4e 44 mov ecx, DWORD PTR [esi+68]
0001d 50 push eax
0001e 68 00 40 00 00 push 16384 ; 00004000H
00023 6a 01 push 1
00025 51 push ecx
00026 e8 00 00 00 00 call _fread
0002b 83 c4 10 add esp, 16 ; 00000010H
; 268 : if (s->stream.avail_in == 0) {
0002e 85 c0 test eax, eax
00030 89 46 04 mov DWORD PTR [esi+4], eax
00033 75 22 jne SHORT $LN2@get_byte
; 269 : s->z_eof = 1;
; 270 : if (ferror(s->file)) s->z_err = Z_ERRNO;
00035 8b 56 40 mov edx, DWORD PTR [esi+64]
00038 52 push edx
00039 c7 46 3c 01 00
00 00 mov DWORD PTR [esi+60], 1
00040 e8 00 00 00 00 call _ferror
00045 83 c4 04 add esp, 4
00048 85 c0 test eax, eax
0004a 74 07 je SHORT $LN1@get_byte
0004c c7 46 38 ff ff
ff ff mov DWORD PTR [esi+56], -1
$LN1@get_byte:
; 271 : return EOF;
00053 83 c8 ff or eax, -1
; 277 : }
00056 c3 ret 0
$LN2@get_byte:
; 272 : }
; 273 : s->stream.next_in = s->inbuf;
00057 8b 46 44 mov eax, DWORD PTR [esi+68]
0005a 89 06 mov DWORD PTR [esi], eax
$LN3@get_byte:
; 274 : }
; 275 : s->stream.avail_in--;
; 276 : return *(s->stream.next_in)++;
0005c 8b 06 mov eax, DWORD PTR [esi]
0005e 83 46 04 ff add DWORD PTR [esi+4], -1
00062 8a 08 mov cl, BYTE PTR [eax]
00064 83 c0 01 add eax, 1
00067 89 06 mov DWORD PTR [esi], eax
00069 0f b6 c1 movzx eax, cl
; 277 : }
0006c c3 ret 0
_get_byte ENDP
; Function compile flags: /Ogtpy
; COMDAT _getLong
_TEXT SEGMENT
_getLong PROC ; COMDAT
; _s$ = eax
; 937 : {
00000 56 push esi
00001 57 push edi
00002 8b f0 mov esi, eax
; 938 : uLong x = (uLong)get_byte(s);
00004 e8 00 00 00 00 call _get_byte
00009 8b f8 mov edi, eax
; 939 : int c;
; 940 :
; 941 : x += ((uLong)get_byte(s))<<8;
0000b e8 00 00 00 00 call _get_byte
00010 c1 e0 08 shl eax, 8
00013 03 f8 add edi, eax
; 942 : x += ((uLong)get_byte(s))<<16;
00015 e8 00 00 00 00 call _get_byte
0001a c1 e0 10 shl eax, 16 ; 00000010H
0001d 03 f8 add edi, eax
; 943 : c = get_byte(s);
0001f e8 00 00 00 00 call _get_byte
; 944 : if (c == EOF) s->z_err = Z_DATA_ERROR;
00024 83 f8 ff cmp eax, -1
00027 75 07 jne SHORT $LN1@getLong
00029 c7 46 38 fd ff
ff ff mov DWORD PTR [esi+56], -3 ; fffffffdH
$LN1@getLong:
; 945 : x += ((uLong)c)<<24;
00030 c1 e0 18 shl eax, 24 ; 00000018H
00033 03 c7 add eax, edi
00035 5f pop edi
00036 5e pop esi
; 946 : return x;
; 947 : }
00037 c3 ret 0
_getLong ENDP
_TEXT ENDS
PUBLIC _gzrewind@4
; Function compile flags: /Ogtpy
; COMDAT _gzrewind@4
_TEXT SEGMENT
_file$ = 8 ; size = 4
_gzrewind@4 PROC ; COMDAT
; 859 : {
00000 56 push esi
; 860 : gz_stream *s = (gz_stream*)file;
; 861 :
; 862 : if (s == NULL || s->mode != 'r') return -1;
00001 8b 74 24 08 mov esi, DWORD PTR _file$[esp]
00005 57 push edi
00006 33 ff xor edi, edi
00008 3b f7 cmp esi, edi
0000a 74 4d je SHORT $LN2@gzrewind
0000c 80 7e 5c 72 cmp BYTE PTR [esi+92], 114 ; 00000072H
00010 75 47 jne SHORT $LN2@gzrewind
; 863 :
; 864 : s->z_err = Z_OK;
; 865 : s->z_eof = 0;
; 866 : s->back = EOF;
; 867 : s->stream.avail_in = 0;
; 868 : s->stream.next_in = s->inbuf;
00012 8b 46 44 mov eax, DWORD PTR [esi+68]
; 869 : s->crc = crc32(0L, Z_NULL, 0);
00015 57 push edi
00016 57 push edi
00017 57 push edi
00018 89 7e 38 mov DWORD PTR [esi+56], edi
0001b 89 7e 3c mov DWORD PTR [esi+60], edi
0001e c7 46 6c ff ff
ff ff mov DWORD PTR [esi+108], -1
00025 89 7e 04 mov DWORD PTR [esi+4], edi
00028 89 06 mov DWORD PTR [esi], eax
0002a e8 00 00 00 00 call _crc32@12
; 870 : if (!s->transparent) (void)inflateReset(&s->stream);
0002f 39 7e 58 cmp DWORD PTR [esi+88], edi
00032 89 46 4c mov DWORD PTR [esi+76], eax
00035 75 06 jne SHORT $LN1@gzrewind
00037 56 push esi
00038 e8 00 00 00 00 call _inflateReset@4
$LN1@gzrewind:
; 871 : s->in = 0;
; 872 : s->out = 0;
; 873 : return fseek(s->file, s->start, SEEK_SET);
0003d 8b 4e 60 mov ecx, DWORD PTR [esi+96]
00040 8b 56 40 mov edx, DWORD PTR [esi+64]
00043 57 push edi
00044 51 push ecx
00045 52 push edx
00046 89 7e 64 mov DWORD PTR [esi+100], edi
00049 89 7e 68 mov DWORD PTR [esi+104], edi
0004c e8 00 00 00 00 call _fseek
00051 83 c4 0c add esp, 12 ; 0000000cH
00054 5f pop edi
00055 5e pop esi
; 874 : }
00056 c2 04 00 ret 4
$LN2@gzrewind:
00059 5f pop edi
; 860 : gz_stream *s = (gz_stream*)file;
; 861 :
; 862 : if (s == NULL || s->mode != 'r') return -1;
0005a 83 c8 ff or eax, -1
0005d 5e pop esi
; 874 : }
0005e c2 04 00 ret 4
_gzrewind@4 ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _destroy
_TEXT SEGMENT
_destroy PROC ; COMDAT
; _s$ = esi
; 357 : {
00000 57 push edi
; 358 : int err = Z_OK;
00001 33 ff xor edi, edi
; 359 :
; 360 : if (!s) return Z_STREAM_ERROR;
00003 85 f6 test esi, esi
00005 75 07 jne SHORT $LN13@destroy
00007 b8 fe ff ff ff mov eax, -2 ; fffffffeH
0000c 5f pop edi
; 388 : }
0000d c3 ret 0
$LN13@destroy:
; 361 :
; 362 : TRYFREE(s->msg);
0000e 8b 46 50 mov eax, DWORD PTR [esi+80]
00011 85 c0 test eax, eax
00013 74 09 je SHORT $LN12@destroy
00015 50 push eax
00016 e8 00 00 00 00 call _free
0001b 83 c4 04 add esp, 4
$LN12@destroy:
; 363 :
; 364 : if (s->stream.state != NULL) {
0001e 39 7e 1c cmp DWORD PTR [esi+28], edi
00021 74 1b je SHORT $LN8@destroy
; 365 : if (s->mode == 'w') {
00023 8a 46 5c mov al, BYTE PTR [esi+92]
00026 3c 77 cmp al, 119 ; 00000077H
00028 75 08 jne SHORT $LN10@destroy
; 366 : #ifdef NO_GZCOMPRESS
; 367 : err = Z_STREAM_ERROR;
; 368 : #else
; 369 : err = deflateEnd(&(s->stream));
0002a 56 push esi
0002b e8 00 00 00 00 call _deflateEnd@4
00030 eb 0a jmp SHORT $LN16@destroy
$LN10@destroy:
; 370 : #endif
; 371 : } else if (s->mode == 'r') {
00032 3c 72 cmp al, 114 ; 00000072H
00034 75 08 jne SHORT $LN8@destroy
; 372 : err = inflateEnd(&(s->stream));
00036 56 push esi
00037 e8 00 00 00 00 call _inflateEnd@4
$LN16@destroy:
0003c 8b f8 mov edi, eax
$LN8@destroy:
; 373 : }
; 374 : }
; 375 : if (s->file != NULL && fclose(s->file)) {
0003e 8b 46 40 mov eax, DWORD PTR [esi+64]
00041 85 c0 test eax, eax
00043 74 1a je SHORT $LN6@destroy
00045 50 push eax
00046 e8 00 00 00 00 call _fclose
0004b 83 c4 04 add esp, 4
0004e 85 c0 test eax, eax
00050 74 0d je SHORT $LN6@destroy
; 376 : #ifdef ESPIPE
; 377 : if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
00052 e8 00 00 00 00 call __errno
00057 83 38 1d cmp DWORD PTR [eax], 29 ; 0000001dH
0005a 74 03 je SHORT $LN6@destroy
; 378 : #endif
; 379 : err = Z_ERRNO;
0005c 83 cf ff or edi, -1
$LN6@destroy:
; 380 : }
; 381 : if (s->z_err < 0) err = s->z_err;
0005f 8b 46 38 mov eax, DWORD PTR [esi+56]
00062 85 c0 test eax, eax
00064 7d 02 jge SHORT $LN5@destroy
00066 8b f8 mov edi, eax
$LN5@destroy:
; 382 :
; 383 : TRYFREE(s->inbuf);
00068 8b 46 44 mov eax, DWORD PTR [esi+68]
0006b 85 c0 test eax, eax
0006d 74 09 je SHORT $LN4@destroy
0006f 50 push eax
00070 e8 00 00 00 00 call _free
00075 83 c4 04 add esp, 4
$LN4@destroy:
; 384 : TRYFREE(s->outbuf);
00078 8b 46 48 mov eax, DWORD PTR [esi+72]
0007b 85 c0 test eax, eax
0007d 74 09 je SHORT $LN3@destroy
0007f 50 push eax
00080 e8 00 00 00 00 call _free
00085 83 c4 04 add esp, 4
$LN3@destroy:
; 385 : TRYFREE(s->path);
00088 8b 46 54 mov eax, DWORD PTR [esi+84]
0008b 85 c0 test eax, eax
0008d 74 09 je SHORT $LN2@destroy
0008f 50 push eax
00090 e8 00 00 00 00 call _free
00095 83 c4 04 add esp, 4
$LN2@destroy:
; 386 : TRYFREE(s);
00098 56 push esi
00099 e8 00 00 00 00 call _free
0009e 83 c4 04 add esp, 4
; 387 : return err;
000a1 8b c7 mov eax, edi
000a3 5f pop edi
; 388 : }
000a4 c3 ret 0
_destroy ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _check_header
_TEXT SEGMENT
_check_header PROC ; COMDAT
; _s$ = eax
; 290 : {
00000 56 push esi
00001 8b f0 mov esi, eax
00003 57 push edi
; 291 : int method; /* method byte */
; 292 : int flags; /* flags byte */
; 293 : uInt len;
; 294 : int c;
; 295 :
; 296 : /* Assure two bytes in the buffer so we can peek ahead -- handle case
; 297 : where first byte of header is at the end of the buffer after the last
; 298 : gzip segment */
; 299 : len = s->stream.avail_in;
00004 8b 7e 04 mov edi, DWORD PTR [esi+4]
; 300 : if (len < 2) {
00007 83 ff 02 cmp edi, 2
0000a 73 69 jae SHORT $LN21@check_head
; 301 : if (len) s->inbuf[0] = s->stream.next_in[0];
0000c 85 ff test edi, edi
0000e 74 09 je SHORT $LN23@check_head
00010 8b 06 mov eax, DWORD PTR [esi]
00012 8b 4e 44 mov ecx, DWORD PTR [esi+68]
00015 8a 10 mov dl, BYTE PTR [eax]
00017 88 11 mov BYTE PTR [ecx], dl
$LN23@check_head:
; 302 : errno = 0;
00019 e8 00 00 00 00 call __errno
0001e c7 00 00 00 00
00 mov DWORD PTR [eax], 0
; 303 : len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
00024 8b 46 40 mov eax, DWORD PTR [esi+64]
00027 8b cf mov ecx, edi
00029 50 push eax
0002a 8b 46 44 mov eax, DWORD PTR [esi+68]
0002d ba 00 40 00 00 mov edx, 16384 ; 00004000H
00032 d3 fa sar edx, cl
00034 03 c7 add eax, edi
00036 52 push edx
00037 6a 01 push 1
00039 50 push eax
0003a e8 00 00 00 00 call _fread
0003f 8b f8 mov edi, eax
00041 83 c4 10 add esp, 16 ; 00000010H
; 304 : if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
00044 85 ff test edi, edi
00046 75 17 jne SHORT $LN22@check_head
00048 8b 4e 40 mov ecx, DWORD PTR [esi+64]
0004b 51 push ecx
0004c e8 00 00 00 00 call _ferror
00051 83 c4 04 add esp, 4
00054 85 c0 test eax, eax
00056 74 07 je SHORT $LN22@check_head
00058 c7 46 38 ff ff
ff ff mov DWORD PTR [esi+56], -1
$LN22@check_head:
; 305 : s->stream.avail_in += len;
0005f 01 7e 04 add DWORD PTR [esi+4], edi
00062 8b 46 04 mov eax, DWORD PTR [esi+4]
; 306 : s->stream.next_in = s->inbuf;
; 307 : if (s->stream.avail_in < 2) {
00065 83 f8 02 cmp eax, 2
00068 8b 56 44 mov edx, DWORD PTR [esi+68]
0006b 89 16 mov DWORD PTR [esi], edx
0006d 73 06 jae SHORT $LN21@check_head
0006f 5f pop edi
; 308 : s->transparent = s->stream.avail_in;
00070 89 46 58 mov DWORD PTR [esi+88], eax
00073 5e pop esi
; 349 : }
00074 c3 ret 0
$LN21@check_head:
; 309 : return;
; 310 : }
; 311 : }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -