?? gzio.cod
字號:
00214 c2 0c 00 ret 12 ; 0000000cH
$LN30@gzread:
; 456 : s->z_err = Z_ERRNO;
00217 89 7e 38 mov DWORD PTR [esi+56], edi
$LN36@gzread:
; 489 : }
; 490 : s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
0021a 8b 46 0c mov eax, DWORD PTR [esi+12]
0021d 8b 4e 4c mov ecx, DWORD PTR [esi+76]
00220 2b c3 sub eax, ebx
00222 50 push eax
00223 53 push ebx
00224 51 push ecx
00225 e8 00 00 00 00 call _crc32@12
; 491 :
; 492 : if (len == s->stream.avail_out &&
; 493 : (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO))
0022a 8b 4e 10 mov ecx, DWORD PTR [esi+16]
0022d 89 46 4c mov DWORD PTR [esi+76], eax
00230 8b 44 24 1c mov eax, DWORD PTR _len$[esp+12]
00234 3b c1 cmp eax, ecx
00236 75 17 jne SHORT $LN2@gzread
00238 8b 76 38 mov esi, DWORD PTR [esi+56]
0023b 83 fe fd cmp esi, -3 ; fffffffdH
0023e 74 05 je SHORT $LN38@gzread
00240 83 fe ff cmp esi, -1
00243 75 0a jne SHORT $LN2@gzread
$LN38@gzread:
00245 5d pop ebp
00246 5f pop edi
00247 5e pop esi
; 494 : return -1;
00248 83 c8 ff or eax, -1
0024b 5b pop ebx
; 496 : }
0024c c2 0c 00 ret 12 ; 0000000cH
$LN2@gzread:
0024f 5d pop ebp
00250 5f pop edi
00251 5e pop esi
; 495 : return (int)(len - s->stream.avail_out);
00252 2b c1 sub eax, ecx
00254 5b pop ebx
; 496 : }
00255 c2 0c 00 ret 12 ; 0000000cH
$LN37@gzread:
00258 5f pop edi
00259 5e pop esi
; 404 :
; 405 : if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
0025a 83 c8 ff or eax, -1
0025d 5b pop ebx
; 496 : }
0025e c2 0c 00 ret 12 ; 0000000cH
$LN24@gzread:
00261 5e pop esi
; 401 : Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
; 402 :
; 403 : if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
00262 b8 fe ff ff ff mov eax, -2 ; fffffffeH
00267 5b pop ebx
; 496 : }
00268 c2 0c 00 ret 12 ; 0000000cH
_gzread@12 ENDP
_TEXT ENDS
PUBLIC _gzsetparams@12
; Function compile flags: /Ogtpy
; COMDAT _gzsetparams@12
_TEXT SEGMENT
_file$ = 8 ; size = 4
_level$ = 12 ; size = 4
_strategy$ = 16 ; size = 4
_gzsetparams@12 PROC ; COMDAT
; 238 : {
00000 56 push esi
; 239 : gz_stream *s = (gz_stream*)file;
; 240 :
; 241 : if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
00001 8b 74 24 08 mov esi, DWORD PTR _file$[esp]
00005 85 f6 test esi, esi
00007 74 50 je SHORT $LN3@gzsetparam
00009 80 7e 5c 77 cmp BYTE PTR [esi+92], 119 ; 00000077H
0000d 75 4a jne SHORT $LN3@gzsetparam
; 242 :
; 243 : /* Make room to allow flushing */
; 244 : if (s->stream.avail_out == 0) {
0000f 83 7e 10 00 cmp DWORD PTR [esi+16], 0
00013 75 30 jne SHORT $LN2@gzsetparam
; 245 :
; 246 : s->stream.next_out = s->outbuf;
; 247 : if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
00015 8b 4e 40 mov ecx, DWORD PTR [esi+64]
00018 8b 46 48 mov eax, DWORD PTR [esi+72]
0001b 51 push ecx
0001c 68 00 40 00 00 push 16384 ; 00004000H
00021 6a 01 push 1
00023 50 push eax
00024 89 46 0c mov DWORD PTR [esi+12], eax
00027 ff 15 00 00 00
00 call DWORD PTR __imp__fwrite
0002d 83 c4 10 add esp, 16 ; 00000010H
00030 3d 00 40 00 00 cmp eax, 16384 ; 00004000H
00035 74 07 je SHORT $LN1@gzsetparam
; 248 : s->z_err = Z_ERRNO;
00037 c7 46 38 ff ff
ff ff mov DWORD PTR [esi+56], -1
$LN1@gzsetparam:
; 249 : }
; 250 : s->stream.avail_out = Z_BUFSIZE;
0003e c7 46 10 00 40
00 00 mov DWORD PTR [esi+16], 16384 ; 00004000H
$LN2@gzsetparam:
; 251 : }
; 252 :
; 253 : return deflateParams (&(s->stream), level, strategy);
00045 8b 54 24 10 mov edx, DWORD PTR _strategy$[esp]
00049 8b 44 24 0c mov eax, DWORD PTR _level$[esp]
0004d 52 push edx
0004e 50 push eax
0004f 56 push esi
00050 e8 00 00 00 00 call _deflateParams@12
00055 5e pop esi
; 254 : }
00056 c2 0c 00 ret 12 ; 0000000cH
$LN3@gzsetparam:
; 239 : gz_stream *s = (gz_stream*)file;
; 240 :
; 241 : if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
00059 b8 fe ff ff ff mov eax, -2 ; fffffffeH
0005e 5e pop esi
; 254 : }
0005f c2 0c 00 ret 12 ; 0000000cH
_gzsetparams@12 ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _gz_open
_TEXT SEGMENT
_strategy$ = -88 ; size = 4
_m$ = -84 ; size = 4
_fmode$ = -80 ; size = 80
_path$ = 8 ; size = 4
_fd$ = 12 ; size = 4
_gz_open PROC ; COMDAT
; _mode$ = eax
; 97 : {
00000 83 ec 58 sub esp, 88 ; 00000058H
00003 53 push ebx
00004 55 push ebp
; 98 : int err;
; 99 : int level = Z_DEFAULT_COMPRESSION; /* compression level */
; 100 : int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
00005 33 db xor ebx, ebx
00007 83 cd ff or ebp, -1
; 101 : char *p = (char*)mode;
; 102 : gz_stream *s;
; 103 : char fmode[80]; /* copy of mode, without the compression level */
; 104 : char *m = fmode;
; 105 :
; 106 : if (!path || !mode) return Z_NULL;
0000a 39 5c 24 64 cmp DWORD PTR _path$[esp+92], ebx
0000e 8d 4c 24 10 lea ecx, DWORD PTR _fmode$[esp+96]
00012 57 push edi
00013 89 5c 24 0c mov DWORD PTR _strategy$[esp+100], ebx
00017 8b f8 mov edi, eax
00019 89 4c 24 10 mov DWORD PTR _m$[esp+100], ecx
0001d 0f 84 20 02 00
00 je $LN28@gz_open
00023 3b c3 cmp eax, ebx
00025 0f 84 18 02 00
00 je $LN28@gz_open
0002b 56 push esi
; 107 :
; 108 : s = (gz_stream *)ALLOC(sizeof(gz_stream));
0002c 6a 74 push 116 ; 00000074H
0002e ff 15 00 00 00
00 call DWORD PTR __imp__malloc
00034 8b f0 mov esi, eax
00036 83 c4 04 add esp, 4
; 109 : if (!s) return Z_NULL;
00039 3b f3 cmp esi, ebx
0003b 0f 84 38 01 00
00 je $LN41@gz_open
; 110 :
; 111 : s->stream.zalloc = (alloc_func)0;
; 112 : s->stream.zfree = (free_func)0;
; 113 : s->stream.opaque = (voidpf)0;
; 114 : s->stream.next_in = s->inbuf = Z_NULL;
; 115 : s->stream.next_out = s->outbuf = Z_NULL;
; 116 : s->stream.avail_in = s->stream.avail_out = 0;
; 117 : s->file = NULL;
; 118 : s->z_err = Z_OK;
; 119 : s->z_eof = 0;
; 120 : s->in = 0;
; 121 : s->out = 0;
; 122 : s->back = EOF;
; 123 : s->crc = crc32(0L, Z_NULL, 0);
00041 53 push ebx
00042 53 push ebx
00043 53 push ebx
00044 89 5e 20 mov DWORD PTR [esi+32], ebx
00047 89 5e 24 mov DWORD PTR [esi+36], ebx
0004a 89 5e 28 mov DWORD PTR [esi+40], ebx
0004d 89 5e 44 mov DWORD PTR [esi+68], ebx
00050 89 1e mov DWORD PTR [esi], ebx
00052 89 5e 48 mov DWORD PTR [esi+72], ebx
00055 89 5e 0c mov DWORD PTR [esi+12], ebx
00058 89 5e 10 mov DWORD PTR [esi+16], ebx
0005b 89 5e 04 mov DWORD PTR [esi+4], ebx
0005e 89 5e 40 mov DWORD PTR [esi+64], ebx
00061 89 5e 38 mov DWORD PTR [esi+56], ebx
00064 89 5e 3c mov DWORD PTR [esi+60], ebx
00067 89 5e 64 mov DWORD PTR [esi+100], ebx
0006a 89 5e 68 mov DWORD PTR [esi+104], ebx
0006d 89 6e 6c mov DWORD PTR [esi+108], ebp
00070 e8 00 00 00 00 call _crc32@12
00075 89 46 4c mov DWORD PTR [esi+76], eax
; 124 : s->msg = NULL;
; 125 : s->transparent = 0;
; 126 :
; 127 : s->path = (char*)ALLOC(strlen(path)+1);
00078 8b 44 24 6c mov eax, DWORD PTR _path$[esp+100]
0007c 89 5e 50 mov DWORD PTR [esi+80], ebx
0007f 89 5e 58 mov DWORD PTR [esi+88], ebx
00082 8d 50 01 lea edx, DWORD PTR [eax+1]
$LL37@gz_open:
00085 8a 08 mov cl, BYTE PTR [eax]
00087 83 c0 01 add eax, 1
0008a 3a cb cmp cl, bl
0008c 75 f7 jne SHORT $LL37@gz_open
0008e 2b c2 sub eax, edx
00090 83 c0 01 add eax, 1
00093 50 push eax
00094 ff 15 00 00 00
00 call DWORD PTR __imp__malloc
0009a 83 c4 04 add esp, 4
; 128 : if (s->path == NULL) {
0009d 3b c3 cmp eax, ebx
0009f 89 46 54 mov DWORD PTR [esi+84], eax
; 129 : return destroy(s), (gzFile)Z_NULL;
000a2 0f 84 cc 00 00
00 je $LN7@gz_open
; 130 : }
; 131 : strcpy(s->path, path); /* do this early for debugging */
000a8 8b 4c 24 6c mov ecx, DWORD PTR _path$[esp+100]
000ac 8b d0 mov edx, eax
000ae 8b ff npad 2
$LL32@gz_open:
000b0 8a 01 mov al, BYTE PTR [ecx]
000b2 88 02 mov BYTE PTR [edx], al
000b4 83 c1 01 add ecx, 1
000b7 83 c2 01 add edx, 1
000ba 3a c3 cmp al, bl
000bc 75 f2 jne SHORT $LL32@gz_open
; 132 :
; 133 : s->mode = '\0';
000be 88 5e 5c mov BYTE PTR [esi+92], bl
000c1 b1 72 mov cl, 114 ; 00000072H
$LL25@gz_open:
; 134 : do {
; 135 : if (*p == 'r') s->mode = 'r';
000c3 38 0f cmp BYTE PTR [edi], cl
000c5 75 03 jne SHORT $LN22@gz_open
000c7 88 4e 5c mov BYTE PTR [esi+92], cl
$LN22@gz_open:
; 136 : if (*p == 'w' || *p == 'a') s->mode = 'w';
000ca 8a 07 mov al, BYTE PTR [edi]
000cc 3c 77 cmp al, 119 ; 00000077H
000ce 74 04 je SHORT $LN20@gz_open
000d0 3c 61 cmp al, 97 ; 00000061H
000d2 75 04 jne SHORT $LN21@gz_open
$LN20@gz_open:
000d4 c6 46 5c 77 mov BYTE PTR [esi+92], 119 ; 00000077H
$LN21@gz_open:
; 137 : if (*p >= '0' && *p <= '9') {
000d8 8a 07 mov al, BYTE PTR [edi]
000da 3c 30 cmp al, 48 ; 00000030H
000dc 7c 0c jl SHORT $LN19@gz_open
000de 3c 39 cmp al, 57 ; 00000039H
000e0 7f 08 jg SHORT $LN19@gz_open
; 138 : level = *p - '0';
000e2 0f be e8 movsx ebp, al
000e5 83 ed 30 sub ebp, 48 ; 00000030H
000e8 eb 37 jmp SHORT $LN24@gz_open
$LN19@gz_open:
; 139 : } else if (*p == 'f') {
000ea 3c 66 cmp al, 102 ; 00000066H
000ec 75 0a jne SHORT $LN17@gz_open
; 140 : strategy = Z_FILTERED;
000ee c7 44 24 10 01
00 00 00 mov DWORD PTR _strategy$[esp+104], 1
000f6 eb 29 jmp SHORT $LN24@gz_open
$LN17@gz_open:
; 141 : } else if (*p == 'h') {
000f8 3c 68 cmp al, 104 ; 00000068H
000fa 75 0a jne SHORT $LN15@gz_open
; 142 : strategy = Z_HUFFMAN_ONLY;
000fc c7 44 24 10 02
00 00 00 mov DWORD PTR _strategy$[esp+104], 2
00104 eb 1b jmp SHORT $LN24@gz_open
$LN15@gz_open:
; 143 : } else if (*p == 'R') {
00106 3c 52 cmp al, 82 ; 00000052H
00108 75 0a jne SHORT $LN13@gz_open
; 144 : strategy = Z_RLE;
0010a c7 44 24 10 03
00 00 00 mov DWORD PTR _strategy$[esp+104], 3
; 145 : } else {
00112 eb 0d jmp SHORT $LN24@gz_open
$LN13@gz_open:
; 146 : *m++ = *p; /* copy the mode */
00114 8b 54 24 14 mov edx, DWORD PTR _m$[esp+104]
00118 88 02 mov BYTE PTR [edx], al
0011a 83 c2 01 add edx, 1
0011d 89 54 24 14 mov DWORD PTR _m$[esp+104], edx
$LN24@gz_open:
; 147 : }
; 148 : } while (*p++ && m != fmode + sizeof(fmode));
00121 83 c7 01 add edi, 1
00124 3a c3 cmp al, bl
00126 74 0a je SHORT $LN11@gz_open
00128 8d 54 24 68 lea edx, DWORD PTR _fmode$[esp+184]
0012c 39 54 24 14 cmp DWORD PTR _m$[esp+104], edx
00130 75 91 jne SHORT $LL25@gz_open
$LN11@gz_open:
; 149 : if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
00132 8a 46 5c mov al, BYTE PTR [esi+92]
00135 3a c3 cmp al, bl
00137 74 3b je SHORT $LN7@gz_open
; 150 :
; 151 : if (s->mode == 'w') {
00139 3c 77 cmp al, 119 ; 00000077H
0013b 75 46 jne SHORT $LN9@gz_open
; 152 : #ifdef NO_GZCOMPRESS
; 153 : err = Z_STREAM_ERROR;
; 154 : #else
; 155 : err = deflateInit2(&(s->stream), level,
; 156 : Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
0013d 8b 44 24 10 mov eax, DWORD PTR _strategy$[esp+104]
00141 6a 38 push 56 ; 00000038H
00143 68 00 00 00 00 push OFFSET ??_C@_05GDHACFMB@1?42?43?$AA@
00148 50 push eax
00149 6a 08 push 8
0014b 6a f1 push -15 ; fffffff1H
0014d 6a 08 push 8
0014f 55 push ebp
00150 56 push esi
00151 e8 00 00 00 00 call _deflateInit2_@32
; 157 : /* windowBits is passed < 0 to suppress zlib header */
; 158 :
; 159 : s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
00156 68 00 40 00 00 push 16384 ; 00004000H
0015b 8b f8 mov edi, eax
0015d ff 15 00 00 00
00 call DWORD PTR __imp__malloc
00163 83 c4 04 add esp, 4
; 160 : #endif
; 161 : if (err != Z_OK || s->outbuf == Z_NULL) {
00166 3b fb cmp edi, ebx
00168 89 46 48 mov DWORD PTR [esi+72], eax
0016b 89 46 0c mov DWORD PTR [esi+12], eax
0016e 75 04 jne SHORT $LN7@gz_open
00170 3b c3 cmp eax, ebx
00172 75 3a jne SHORT $LN5@gz_open
$LN7@gz_open:
; 162 : return destroy(s), (gzFile)Z_NULL;
00174 e8 00 00 00 00 call _destroy
$LN41@gz_open:
00179 5e pop esi
0017a 5f pop edi
0017b 5d pop ebp
0017c 33 c0 xor eax, eax
0017e 5b pop ebx
; 203 : }
0017f 83 c4 58 add esp, 88 ; 00000058H
001
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -