⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gzio.cod

📁 microsoft visual c++ 2005、windows mobile 5 远程控制PC.通过阅读项目源码能让你熟悉Active Sync RAPI
💻 COD
📖 第 1 页 / 共 5 页
字号:
  00079	89 46 38	 mov	 DWORD PTR [esi+56], eax
  0007c	75 0d		 jne	 SHORT $LN15@gzwrite

; 570  : 
; 571  :     while (s->stream.avail_in != 0) {

  0007e	85 c9		 test	 ecx, ecx
  00080	75 ae		 jne	 SHORT $LL5@gzwrite

; 587  :         if (s->z_err != Z_OK) break;

  00082	eb 07		 jmp	 SHORT $LN15@gzwrite
$LN11@gzwrite:

; 577  :                 s->z_err = Z_ERRNO;

  00084	c7 46 38 ff ff
	ff ff		 mov	 DWORD PTR [esi+56], -1
$LN15@gzwrite:
  0008b	5f		 pop	 edi
$LN14@gzwrite:

; 588  :     }
; 589  :     s->crc = crc32(s->crc, (const Bytef *)buf, len);

  0008c	8b 44 24 10	 mov	 eax, DWORD PTR _buf$[esp+4]
  00090	8b 4e 4c	 mov	 ecx, DWORD PTR [esi+76]
  00093	53		 push	 ebx
  00094	50		 push	 eax
  00095	51		 push	 ecx
  00096	e8 00 00 00 00	 call	 _crc32@12
  0009b	89 46 4c	 mov	 DWORD PTR [esi+76], eax

; 590  : 
; 591  :     return (int)(len - s->stream.avail_in);

  0009e	8b c3		 mov	 eax, ebx
  000a0	2b 46 04	 sub	 eax, DWORD PTR [esi+4]
  000a3	5b		 pop	 ebx
  000a4	5e		 pop	 esi

; 592  : }

  000a5	c2 0c 00	 ret	 12			; 0000000cH
$LN6@gzwrite:

; 564  :     gz_stream *s = (gz_stream*)file;
; 565  : 
; 566  :     if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;

  000a8	b8 fe ff ff ff	 mov	 eax, -2			; fffffffeH
  000ad	5e		 pop	 esi

; 592  : }

  000ae	c2 0c 00	 ret	 12			; 0000000cH
_gzwrite@12 ENDP
_TEXT	ENDS
PUBLIC	_gzread@12
; Function compile flags: /Ogtpy
;	COMDAT _gzread@12
_TEXT	SEGMENT
_file$ = 8						; size = 4
_next_out$ = 12						; size = 4
_buf$ = 12						; size = 4
_len$ = 16						; size = 4
_gzread@12 PROC						; COMDAT

; 399  :     gz_stream *s = (gz_stream*)file;
; 400  :     Bytef *start = (Bytef*)buf; /* starting point for crc computation */

  00000	8b 44 24 08	 mov	 eax, DWORD PTR _buf$[esp-4]
  00004	53		 push	 ebx
  00005	56		 push	 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;

  00006	8b 74 24 0c	 mov	 esi, DWORD PTR _file$[esp+4]
  0000a	85 f6		 test	 esi, esi
  0000c	8b d8		 mov	 ebx, eax
  0000e	0f 84 4d 02 00
	00		 je	 $LN24@gzread
  00014	80 7e 5c 72	 cmp	 BYTE PTR [esi+92], 114	; 00000072H
  00018	0f 85 43 02 00
	00		 jne	 $LN24@gzread

; 404  : 
; 405  :     if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;

  0001e	8b 4e 38	 mov	 ecx, DWORD PTR [esi+56]
  00021	83 f9 fd	 cmp	 ecx, -3			; fffffffdH
  00024	57		 push	 edi
  00025	0f 84 2d 02 00
	00		 je	 $LN37@gzread
  0002b	83 cf ff	 or	 edi, -1
  0002e	3b cf		 cmp	 ecx, edi
  00030	0f 84 22 02 00
	00		 je	 $LN37@gzread

; 406  :     if (s->z_err == Z_STREAM_END) return 0;  /* EOF */

  00036	ba 01 00 00 00	 mov	 edx, 1
  0003b	3b ca		 cmp	 ecx, edx
  0003d	75 08		 jne	 SHORT $LN21@gzread
  0003f	5f		 pop	 edi
  00040	5e		 pop	 esi
  00041	33 c0		 xor	 eax, eax
  00043	5b		 pop	 ebx

; 496  : }

  00044	c2 0c 00	 ret	 12			; 0000000cH
$LN21@gzread:

; 407  : 
; 408  :     next_out = (Byte*)buf;
; 409  :     s->stream.next_out = (Bytef*)buf;
; 410  :     s->stream.avail_out = len;

  00047	8b 4c 24 18	 mov	 ecx, DWORD PTR _len$[esp+8]

; 411  : 
; 412  :     if (s->stream.avail_out && s->back != EOF) {

  0004b	85 c9		 test	 ecx, ecx
  0004d	89 44 24 14	 mov	 DWORD PTR _next_out$[esp+8], eax
  00051	89 46 0c	 mov	 DWORD PTR [esi+12], eax
  00054	89 4e 10	 mov	 DWORD PTR [esi+16], ecx
  00057	74 30		 je	 SHORT $LN34@gzread
  00059	39 7e 6c	 cmp	 DWORD PTR [esi+108], edi
  0005c	74 2b		 je	 SHORT $LN34@gzread

; 413  :         *next_out++ = s->back;

  0005e	8a 4e 6c	 mov	 cl, BYTE PTR [esi+108]
  00061	88 08		 mov	 BYTE PTR [eax], cl

; 414  :         s->stream.next_out++;

  00063	01 56 0c	 add	 DWORD PTR [esi+12], edx

; 415  :         s->stream.avail_out--;

  00066	01 7e 10	 add	 DWORD PTR [esi+16], edi

; 416  :         s->back = EOF;
; 417  :         s->out++;

  00069	01 56 68	 add	 DWORD PTR [esi+104], edx
  0006c	83 c0 01	 add	 eax, 1

; 418  :         start++;
; 419  :         if (s->last) {

  0006f	83 7e 70 00	 cmp	 DWORD PTR [esi+112], 0
  00073	89 44 24 14	 mov	 DWORD PTR _next_out$[esp+8], eax
  00077	89 7e 6c	 mov	 DWORD PTR [esi+108], edi
  0007a	8b d8		 mov	 ebx, eax
  0007c	74 0b		 je	 SHORT $LN34@gzread
  0007e	5f		 pop	 edi

; 420  :             s->z_err = Z_STREAM_END;

  0007f	89 56 38	 mov	 DWORD PTR [esi+56], edx
  00082	5e		 pop	 esi

; 421  :             return 1;

  00083	8b c2		 mov	 eax, edx
  00085	5b		 pop	 ebx

; 496  : }

  00086	c2 0c 00	 ret	 12			; 0000000cH
$LN34@gzread:

; 422  :         }
; 423  :     }
; 424  : 
; 425  :     while (s->stream.avail_out != 0) {

  00089	83 7e 10 00	 cmp	 DWORD PTR [esi+16], 0
  0008d	55		 push	 ebp
  0008e	0f 84 86 01 00
	00		 je	 $LN36@gzread
  00094	8b 2d 00 00 00
	00		 mov	 ebp, DWORD PTR __imp___errno
  0009a	8d 9b 00 00 00
	00		 npad	 6
$LL18@gzread:

; 426  : 
; 427  :         if (s->transparent) {

  000a0	83 7e 58 00	 cmp	 DWORD PTR [esi+88], 0
  000a4	0f 85 fa 00 00
	00		 jne	 $LN29@gzread

; 447  :             return (int)len;
; 448  :         }
; 449  :         if (s->stream.avail_in == 0 && !s->z_eof) {

  000aa	83 7e 04 00	 cmp	 DWORD PTR [esi+4], 0
  000ae	75 4e		 jne	 SHORT $LN11@gzread
  000b0	83 7e 3c 00	 cmp	 DWORD PTR [esi+60], 0
  000b4	75 48		 jne	 SHORT $LN11@gzread

; 450  : 
; 451  :             errno = 0;

  000b6	ff d5		 call	 ebp
  000b8	c7 00 00 00 00
	00		 mov	 DWORD PTR [eax], 0

; 452  :             s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);

  000be	8b 56 40	 mov	 edx, DWORD PTR [esi+64]
  000c1	8b 46 44	 mov	 eax, DWORD PTR [esi+68]
  000c4	52		 push	 edx
  000c5	68 00 40 00 00	 push	 16384			; 00004000H
  000ca	6a 01		 push	 1
  000cc	50		 push	 eax
  000cd	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__fread
  000d3	83 c4 10	 add	 esp, 16			; 00000010H

; 453  :             if (s->stream.avail_in == 0) {

  000d6	85 c0		 test	 eax, eax
  000d8	89 46 04	 mov	 DWORD PTR [esi+4], eax
  000db	75 1c		 jne	 SHORT $LN9@gzread

; 454  :                 s->z_eof = 1;
; 455  :                 if (ferror(s->file)) {

  000dd	8b 4e 40	 mov	 ecx, DWORD PTR [esi+64]
  000e0	51		 push	 ecx
  000e1	c7 46 3c 01 00
	00 00		 mov	 DWORD PTR [esi+60], 1
  000e8	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__ferror
  000ee	83 c4 04	 add	 esp, 4
  000f1	85 c0		 test	 eax, eax
  000f3	0f 85 1e 01 00
	00		 jne	 $LN30@gzread
$LN9@gzread:

; 457  :                     break;
; 458  :                 }
; 459  :             }
; 460  :             s->stream.next_in = s->inbuf;

  000f9	8b 56 44	 mov	 edx, DWORD PTR [esi+68]
  000fc	89 16		 mov	 DWORD PTR [esi], edx
$LN11@gzread:

; 461  :         }
; 462  :         s->in += s->stream.avail_in;

  000fe	8b 46 04	 mov	 eax, DWORD PTR [esi+4]

; 463  :         s->out += s->stream.avail_out;

  00101	8b 4e 10	 mov	 ecx, DWORD PTR [esi+16]
  00104	01 46 64	 add	 DWORD PTR [esi+100], eax
  00107	01 4e 68	 add	 DWORD PTR [esi+104], ecx

; 464  :         s->z_err = inflate(&(s->stream), Z_NO_FLUSH);

  0010a	6a 00		 push	 0
  0010c	56		 push	 esi
  0010d	e8 00 00 00 00	 call	 _inflate@8

; 465  :         s->in -= s->stream.avail_in;

  00112	8b 56 04	 mov	 edx, DWORD PTR [esi+4]

; 466  :         s->out -= s->stream.avail_out;

  00115	8b 4e 10	 mov	 ecx, DWORD PTR [esi+16]
  00118	29 56 64	 sub	 DWORD PTR [esi+100], edx
  0011b	29 4e 68	 sub	 DWORD PTR [esi+104], ecx

; 467  : 
; 468  :         if (s->z_err == Z_STREAM_END) {

  0011e	83 f8 01	 cmp	 eax, 1
  00121	89 46 38	 mov	 DWORD PTR [esi+56], eax
  00124	75 4f		 jne	 SHORT $LN35@gzread

; 469  :             /* Check CRC and original size */
; 470  :             s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));

  00126	8b 7e 0c	 mov	 edi, DWORD PTR [esi+12]
  00129	8b 46 4c	 mov	 eax, DWORD PTR [esi+76]
  0012c	8b d7		 mov	 edx, edi
  0012e	2b d3		 sub	 edx, ebx
  00130	52		 push	 edx
  00131	53		 push	 ebx
  00132	50		 push	 eax
  00133	e8 00 00 00 00	 call	 _crc32@12
  00138	89 46 4c	 mov	 DWORD PTR [esi+76], eax

; 471  :             start = s->stream.next_out;
; 472  : 
; 473  :             if (getLong(s) != s->crc) {

  0013b	8b c6		 mov	 eax, esi
  0013d	8b df		 mov	 ebx, edi
  0013f	e8 00 00 00 00	 call	 _getLong
  00144	3b 46 4c	 cmp	 eax, DWORD PTR [esi+76]
  00147	75 52		 jne	 SHORT $LN32@gzread

; 476  :                 (void)getLong(s);

  00149	8b c6		 mov	 eax, esi
  0014b	e8 00 00 00 00	 call	 _getLong

; 477  :                 /* The uncompressed length returned by above getlong() may be
; 478  :                  * different from s->out in case of concatenated .gz files.
; 479  :                  * Check for such files:
; 480  :                  */
; 481  :                 check_header(s);

  00150	8b c6		 mov	 eax, esi
  00152	e8 00 00 00 00	 call	 _check_header

; 482  :                 if (s->z_err == Z_OK) {

  00157	83 7e 38 00	 cmp	 DWORD PTR [esi+56], 0
  0015b	0f 85 b9 00 00
	00		 jne	 $LN36@gzread

; 483  :                     inflateReset(&(s->stream));

  00161	56		 push	 esi
  00162	e8 00 00 00 00	 call	 _inflateReset@4

; 484  :                     s->crc = crc32(0L, Z_NULL, 0);

  00167	6a 00		 push	 0
  00169	6a 00		 push	 0
  0016b	6a 00		 push	 0
  0016d	e8 00 00 00 00	 call	 _crc32@12
  00172	89 46 4c	 mov	 DWORD PTR [esi+76], eax
$LN35@gzread:

; 485  :                 }
; 486  :             }
; 487  :         }
; 488  :         if (s->z_err != Z_OK || s->z_eof) break;

  00175	83 7e 38 00	 cmp	 DWORD PTR [esi+56], 0
  00179	0f 85 9b 00 00
	00		 jne	 $LN36@gzread
  0017f	83 7e 3c 00	 cmp	 DWORD PTR [esi+60], 0
  00183	0f 85 91 00 00
	00		 jne	 $LN36@gzread

; 422  :         }
; 423  :     }
; 424  : 
; 425  :     while (s->stream.avail_out != 0) {

  00189	83 7e 10 00	 cmp	 DWORD PTR [esi+16], 0
  0018d	0f 84 87 00 00
	00		 je	 $LN36@gzread
  00193	83 cf ff	 or	 edi, -1
  00196	e9 05 ff ff ff	 jmp	 $LL18@gzread
$LN32@gzread:

; 474  :                 s->z_err = Z_DATA_ERROR;

  0019b	c7 46 38 fd ff
	ff ff		 mov	 DWORD PTR [esi+56], -3	; fffffffdH

; 475  :             } else {

  001a2	eb 76		 jmp	 SHORT $LN36@gzread
$LN29@gzread:

; 428  :             /* Copy first the lookahead bytes: */
; 429  :             uInt n = s->stream.avail_in;

  001a4	8b 7e 04	 mov	 edi, DWORD PTR [esi+4]

; 430  :             if (n > s->stream.avail_out) n = s->stream.avail_out;

  001a7	8b 46 10	 mov	 eax, DWORD PTR [esi+16]
  001aa	3b f8		 cmp	 edi, eax
  001ac	76 02		 jbe	 SHORT $LN15@gzread
  001ae	8b f8		 mov	 edi, eax
$LN15@gzread:

; 431  :             if (n > 0) {

  001b0	85 ff		 test	 edi, edi
  001b2	76 25		 jbe	 SHORT $LN14@gzread

; 432  :                 zmemcpy(s->stream.next_out, s->stream.next_in, n);

  001b4	8b 0e		 mov	 ecx, DWORD PTR [esi]
  001b6	8b 56 0c	 mov	 edx, DWORD PTR [esi+12]
  001b9	57		 push	 edi
  001ba	51		 push	 ecx
  001bb	52		 push	 edx
  001bc	e8 00 00 00 00	 call	 _memcpy

; 433  :                 next_out += n;

  001c1	8b 44 24 24	 mov	 eax, DWORD PTR _next_out$[esp+24]

; 434  :                 s->stream.next_out = next_out;
; 435  :                 s->stream.next_in   += n;

  001c5	01 3e		 add	 DWORD PTR [esi], edi

; 436  :                 s->stream.avail_out -= n;

  001c7	29 7e 10	 sub	 DWORD PTR [esi+16], edi
  001ca	03 c7		 add	 eax, edi
  001cc	83 c4 0c	 add	 esp, 12			; 0000000cH

; 437  :                 s->stream.avail_in  -= n;

  001cf	29 7e 04	 sub	 DWORD PTR [esi+4], edi
  001d2	89 44 24 18	 mov	 DWORD PTR _next_out$[esp+12], eax
  001d6	89 46 0c	 mov	 DWORD PTR [esi+12], eax
$LN14@gzread:

; 438  :             }
; 439  :             if (s->stream.avail_out > 0) {

  001d9	8b 46 10	 mov	 eax, DWORD PTR [esi+16]
  001dc	85 c0		 test	 eax, eax
  001de	76 18		 jbe	 SHORT $LN13@gzread

; 440  :                 s->stream.avail_out -=
; 441  :                     (uInt)fread(next_out, 1, s->stream.avail_out, s->file);

  001e0	8b 4e 40	 mov	 ecx, DWORD PTR [esi+64]
  001e3	8b 54 24 18	 mov	 edx, DWORD PTR _next_out$[esp+12]
  001e7	51		 push	 ecx
  001e8	50		 push	 eax
  001e9	6a 01		 push	 1
  001eb	52		 push	 edx
  001ec	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__fread
  001f2	83 c4 10	 add	 esp, 16			; 00000010H
  001f5	29 46 10	 sub	 DWORD PTR [esi+16], eax
$LN13@gzread:

; 442  :             }
; 443  :             len -= s->stream.avail_out;

  001f8	8b 44 24 1c	 mov	 eax, DWORD PTR _len$[esp+12]
  001fc	2b 46 10	 sub	 eax, DWORD PTR [esi+16]

; 444  :             s->in  += len;

  001ff	01 46 64	 add	 DWORD PTR [esi+100], eax

; 445  :             s->out += len;

  00202	01 46 68	 add	 DWORD PTR [esi+104], eax

; 446  :             if (len == 0) s->z_eof = 1;

  00205	85 c0		 test	 eax, eax
  00207	75 07		 jne	 SHORT $LN40@gzread
  00209	c7 46 3c 01 00
	00 00		 mov	 DWORD PTR [esi+60], 1
$LN40@gzread:
  00210	5d		 pop	 ebp
  00211	5f		 pop	 edi
  00212	5e		 pop	 esi
  00213	5b		 pop	 ebx

; 496  : }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -