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

📄 gzio.cod

📁 microsoft visual c++ 2005、windows mobile 5 远程控制PC.通过阅读项目源码能让你熟悉Active Sync RAPI
💻 COD
📖 第 1 页 / 共 5 页
字号:
; 312  : 
; 313  :     /* Peek ahead to check the gzip magic header */
; 314  :     if (s->stream.next_in[0] != gz_magic[0] ||
; 315  :         s->stream.next_in[1] != gz_magic[1]) {

  00075	8b 06		 mov	 eax, DWORD PTR [esi]
  00077	80 38 1f	 cmp	 BYTE PTR [eax], 31	; 0000001fH
  0007a	0f 85 ce 00 00
	00		 jne	 $LN19@check_head
  00080	80 78 01 8b	 cmp	 BYTE PTR [eax+1], 139	; 0000008bH
  00084	0f 85 c4 00 00
	00		 jne	 $LN19@check_head

; 317  :         return;
; 318  :     }
; 319  :     s->stream.avail_in -= 2;

  0008a	83 46 04 fe	 add	 DWORD PTR [esi+4], -2	; fffffffeH

; 320  :     s->stream.next_in += 2;

  0008e	83 c0 02	 add	 eax, 2
  00091	53		 push	 ebx
  00092	89 06		 mov	 DWORD PTR [esi], eax

; 321  : 
; 322  :     /* Check the rest of the gzip header */
; 323  :     method = get_byte(s);

  00094	e8 00 00 00 00	 call	 _get_byte
  00099	8b f8		 mov	 edi, eax

; 324  :     flags = get_byte(s);

  0009b	e8 00 00 00 00	 call	 _get_byte

; 325  :     if (method != Z_DEFLATED || (flags & RESERVED) != 0) {

  000a0	83 ff 08	 cmp	 edi, 8
  000a3	8b d8		 mov	 ebx, eax
  000a5	0f 85 98 00 00
	00		 jne	 $LN17@check_head
  000ab	f6 c3 e0	 test	 bl, -32			; ffffffe0H
  000ae	0f 85 8f 00 00
	00		 jne	 $LN17@check_head

; 327  :         return;
; 328  :     }
; 329  : 
; 330  :     /* Discard time, xflags and OS code: */
; 331  :     for (len = 0; len < 6; len++) (void)get_byte(s);

  000b4	bf 06 00 00 00	 mov	 edi, 6
  000b9	8d a4 24 00 00
	00 00		 npad	 7
$LL16@check_head:
  000c0	e8 00 00 00 00	 call	 _get_byte
  000c5	83 ef 01	 sub	 edi, 1
  000c8	75 f6		 jne	 SHORT $LL16@check_head

; 332  : 
; 333  :     if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */

  000ca	f6 c3 04	 test	 bl, 4
  000cd	74 24		 je	 SHORT $LN11@check_head

; 334  :         len  =  (uInt)get_byte(s);

  000cf	e8 00 00 00 00	 call	 _get_byte
  000d4	8b f8		 mov	 edi, eax

; 335  :         len += ((uInt)get_byte(s))<<8;

  000d6	e8 00 00 00 00	 call	 _get_byte
  000db	c1 e0 08	 shl	 eax, 8
  000de	03 f8		 add	 edi, eax
$LL12@check_head:

; 336  :         /* len is garbage if EOF but the loop below will quit anyway */
; 337  :         while (len-- != 0 && get_byte(s) != EOF) ;

  000e0	8b c7		 mov	 eax, edi
  000e2	83 ef 01	 sub	 edi, 1
  000e5	85 c0		 test	 eax, eax
  000e7	74 0a		 je	 SHORT $LN11@check_head
  000e9	e8 00 00 00 00	 call	 _get_byte
  000ee	83 f8 ff	 cmp	 eax, -1
  000f1	75 ed		 jne	 SHORT $LL12@check_head
$LN11@check_head:

; 338  :     }
; 339  :     if ((flags & ORIG_NAME) != 0) { /* skip the original file name */

  000f3	f6 c3 08	 test	 bl, 8
  000f6	74 0e		 je	 SHORT $LN8@check_head
$LL9@check_head:

; 340  :         while ((c = get_byte(s)) != 0 && c != EOF) ;

  000f8	e8 00 00 00 00	 call	 _get_byte
  000fd	85 c0		 test	 eax, eax
  000ff	74 05		 je	 SHORT $LN8@check_head
  00101	83 f8 ff	 cmp	 eax, -1
  00104	75 f2		 jne	 SHORT $LL9@check_head
$LN8@check_head:

; 341  :     }
; 342  :     if ((flags & COMMENT) != 0) {   /* skip the .gz file comment */

  00106	f6 c3 10	 test	 bl, 16			; 00000010H
  00109	74 13		 je	 SHORT $LN5@check_head
  0010b	eb 03 8d 49 00	 npad	 5
$LL6@check_head:

; 343  :         while ((c = get_byte(s)) != 0 && c != EOF) ;

  00110	e8 00 00 00 00	 call	 _get_byte
  00115	85 c0		 test	 eax, eax
  00117	74 05		 je	 SHORT $LN5@check_head
  00119	83 f8 ff	 cmp	 eax, -1
  0011c	75 f2		 jne	 SHORT $LL6@check_head
$LN5@check_head:

; 344  :     }
; 345  :     if ((flags & HEAD_CRC) != 0) {  /* skip the header crc */

  0011e	f6 c3 02	 test	 bl, 2
  00121	74 0f		 je	 SHORT $LN1@check_head

; 346  :         for (len = 0; len < 2; len++) (void)get_byte(s);

  00123	bf 02 00 00 00	 mov	 edi, 2
$LL3@check_head:
  00128	e8 00 00 00 00	 call	 _get_byte
  0012d	83 ef 01	 sub	 edi, 1
  00130	75 f6		 jne	 SHORT $LL3@check_head
$LN1@check_head:

; 347  :     }
; 348  :     s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;

  00132	8b 4e 3c	 mov	 ecx, DWORD PTR [esi+60]
  00135	f7 d9		 neg	 ecx
  00137	1b c9		 sbb	 ecx, ecx
  00139	5b		 pop	 ebx
  0013a	83 e1 fd	 and	 ecx, -3			; fffffffdH
  0013d	5f		 pop	 edi
  0013e	89 4e 38	 mov	 DWORD PTR [esi+56], ecx
  00141	5e		 pop	 esi

; 349  : }

  00142	c3		 ret	 0
$LN17@check_head:
  00143	5b		 pop	 ebx
  00144	5f		 pop	 edi

; 326  :         s->z_err = Z_DATA_ERROR;

  00145	c7 46 38 fd ff
	ff ff		 mov	 DWORD PTR [esi+56], -3	; fffffffdH
  0014c	5e		 pop	 esi

; 349  : }

  0014d	c3		 ret	 0
$LN19@check_head:
  0014e	5f		 pop	 edi

; 316  :         s->transparent = 1;

  0014f	c7 46 58 01 00
	00 00		 mov	 DWORD PTR [esi+88], 1
  00156	5e		 pop	 esi

; 349  : }

  00157	c3		 ret	 0
_check_header ENDP
; Function compile flags: /Ogtpy
;	COMDAT _do_flush
_TEXT	SEGMENT
_flush$ = 8						; size = 4
_do_flush PROC						; COMDAT
; _file$ = eax

; 708  : {

  00000	53		 push	 ebx
  00001	56		 push	 esi
  00002	8b f0		 mov	 esi, eax

; 709  :     uInt len;
; 710  :     int done = 0;

  00004	33 db		 xor	 ebx, ebx

; 711  :     gz_stream *s = (gz_stream*)file;
; 712  : 
; 713  :     if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;

  00006	85 f6		 test	 esi, esi
  00008	0f 84 a5 00 00
	00		 je	 $LN8@do_flush
  0000e	80 7e 5c 77	 cmp	 BYTE PTR [esi+92], 119	; 00000077H
  00012	0f 85 9b 00 00
	00		 jne	 $LN8@do_flush

; 714  : 
; 715  :     s->stream.avail_in = 0; /* should be zero already anyway */

  00018	89 5e 04	 mov	 DWORD PTR [esi+4], ebx
  0001b	57		 push	 edi
  0001c	8d 64 24 00	 npad	 4
$LL7@do_flush:

; 716  : 
; 717  :     for (;;) {
; 718  :         len = Z_BUFSIZE - s->stream.avail_out;

  00020	bf 00 40 00 00	 mov	 edi, 16384		; 00004000H
  00025	2b 7e 10	 sub	 edi, DWORD PTR [esi+16]

; 719  : 
; 720  :         if (len != 0) {

  00028	74 24		 je	 SHORT $LN5@do_flush

; 721  :             if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {

  0002a	8b 46 40	 mov	 eax, DWORD PTR [esi+64]
  0002d	8b 4e 48	 mov	 ecx, DWORD PTR [esi+72]
  00030	50		 push	 eax
  00031	57		 push	 edi
  00032	6a 01		 push	 1
  00034	51		 push	 ecx
  00035	e8 00 00 00 00	 call	 _fwrite
  0003a	83 c4 10	 add	 esp, 16			; 00000010H
  0003d	3b c7		 cmp	 eax, edi
  0003f	75 68		 jne	 SHORT $LN17@do_flush

; 723  :                 return Z_ERRNO;
; 724  :             }
; 725  :             s->stream.next_out = s->outbuf;

  00041	8b 56 48	 mov	 edx, DWORD PTR [esi+72]
  00044	89 56 0c	 mov	 DWORD PTR [esi+12], edx

; 726  :             s->stream.avail_out = Z_BUFSIZE;

  00047	c7 46 10 00 40
	00 00		 mov	 DWORD PTR [esi+16], 16384 ; 00004000H
$LN5@do_flush:

; 727  :         }
; 728  :         if (done) break;

  0004e	85 db		 test	 ebx, ebx
  00050	75 45		 jne	 SHORT $LN21@do_flush

; 729  :         s->out += s->stream.avail_out;
; 730  :         s->z_err = deflate(&(s->stream), flush);

  00052	8b 4c 24 10	 mov	 ecx, DWORD PTR _flush$[esp+8]
  00056	8b 46 10	 mov	 eax, DWORD PTR [esi+16]
  00059	01 46 68	 add	 DWORD PTR [esi+104], eax
  0005c	51		 push	 ecx
  0005d	56		 push	 esi
  0005e	e8 00 00 00 00	 call	 _deflate@8

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

  00063	8b 4e 10	 mov	 ecx, DWORD PTR [esi+16]
  00066	29 4e 68	 sub	 DWORD PTR [esi+104], ecx

; 732  : 
; 733  :         /* Ignore the second of two consecutive flushes: */
; 734  :         if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;

  00069	85 ff		 test	 edi, edi
  0006b	89 46 38	 mov	 DWORD PTR [esi+56], eax
  0006e	75 08		 jne	 SHORT $LN2@do_flush
  00070	83 f8 fb	 cmp	 eax, -5			; fffffffbH
  00073	75 03		 jne	 SHORT $LN2@do_flush
  00075	89 7e 38	 mov	 DWORD PTR [esi+56], edi
$LN2@do_flush:

; 735  : 
; 736  :         /* deflate has finished flushing only when it hasn't used up
; 737  :          * all the available space in the output buffer:
; 738  :          */
; 739  :         done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);

  00078	85 c9		 test	 ecx, ecx
  0007a	75 0a		 jne	 SHORT $LN20@do_flush
  0007c	83 7e 38 01	 cmp	 DWORD PTR [esi+56], 1
  00080	74 04		 je	 SHORT $LN20@do_flush
  00082	33 db		 xor	 ebx, ebx
  00084	eb 05		 jmp	 SHORT $LN13@do_flush
$LN20@do_flush:
  00086	bb 01 00 00 00	 mov	 ebx, 1
$LN13@do_flush:

; 740  : 
; 741  :         if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;

  0008b	8b 46 38	 mov	 eax, DWORD PTR [esi+56]
  0008e	85 c0		 test	 eax, eax
  00090	74 8e		 je	 SHORT $LL7@do_flush
  00092	83 f8 01	 cmp	 eax, 1
  00095	74 89		 je	 SHORT $LL7@do_flush
$LN21@do_flush:

; 742  :     }
; 743  :     return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;

  00097	8b 76 38	 mov	 esi, DWORD PTR [esi+56]
  0009a	8b c6		 mov	 eax, esi
  0009c	83 e8 01	 sub	 eax, 1
  0009f	f7 d8		 neg	 eax
  000a1	1b c0		 sbb	 eax, eax
  000a3	5f		 pop	 edi
  000a4	23 c6		 and	 eax, esi
  000a6	5e		 pop	 esi
  000a7	5b		 pop	 ebx

; 744  : }

  000a8	c3		 ret	 0
$LN17@do_flush:

; 722  :                 s->z_err = Z_ERRNO;

  000a9	83 c8 ff	 or	 eax, -1
  000ac	5f		 pop	 edi
  000ad	89 46 38	 mov	 DWORD PTR [esi+56], eax
  000b0	5e		 pop	 esi
  000b1	5b		 pop	 ebx

; 744  : }

  000b2	c3		 ret	 0
$LN8@do_flush:
  000b3	5e		 pop	 esi

; 711  :     gz_stream *s = (gz_stream*)file;
; 712  : 
; 713  :     if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;

  000b4	b8 fe ff ff ff	 mov	 eax, -2			; fffffffeH
  000b9	5b		 pop	 ebx

; 744  : }

  000ba	c3		 ret	 0
_do_flush ENDP
_TEXT	ENDS
PUBLIC	_gzwrite@12
; Function compile flags: /Ogtpy
;	COMDAT _gzwrite@12
_TEXT	SEGMENT
_file$ = 8						; size = 4
_buf$ = 12						; size = 4
_len$ = 16						; size = 4
_gzwrite@12 PROC					; COMDAT

; 563  : {

  00000	56		 push	 esi

; 564  :     gz_stream *s = (gz_stream*)file;
; 565  : 
; 566  :     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	0f 84 9a 00 00
	00		 je	 $LN6@gzwrite
  0000d	80 7e 5c 77	 cmp	 BYTE PTR [esi+92], 119	; 00000077H
  00011	0f 85 90 00 00
	00		 jne	 $LN6@gzwrite
  00017	55		 push	 ebp

; 567  : 
; 568  :     s->stream.next_in = (Bytef*)buf;

  00018	8b 6c 24 10	 mov	 ebp, DWORD PTR _buf$[esp+4]
  0001c	57		 push	 edi

; 569  :     s->stream.avail_in = len;

  0001d	8b 7c 24 18	 mov	 edi, DWORD PTR _len$[esp+8]

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

  00021	85 ff		 test	 edi, edi
  00023	89 2e		 mov	 DWORD PTR [esi], ebp
  00025	89 7e 04	 mov	 DWORD PTR [esi+4], edi
  00028	74 64		 je	 SHORT $LN12@gzwrite
  0002a	8d 9b 00 00 00
	00		 npad	 6
$LL5@gzwrite:

; 572  : 
; 573  :         if (s->stream.avail_out == 0) {

  00030	83 7e 10 00	 cmp	 DWORD PTR [esi+16], 0
  00034	75 24		 jne	 SHORT $LN3@gzwrite

; 574  : 
; 575  :             s->stream.next_out = s->outbuf;
; 576  :             if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {

  00036	8b 4e 40	 mov	 ecx, DWORD PTR [esi+64]
  00039	8b 46 48	 mov	 eax, DWORD PTR [esi+72]
  0003c	51		 push	 ecx
  0003d	68 00 40 00 00	 push	 16384			; 00004000H
  00042	6a 01		 push	 1
  00044	50		 push	 eax
  00045	89 46 0c	 mov	 DWORD PTR [esi+12], eax
  00048	e8 00 00 00 00	 call	 _fwrite
  0004d	83 c4 10	 add	 esp, 16			; 00000010H
  00050	3d 00 40 00 00	 cmp	 eax, 16384		; 00004000H
  00055	75 30		 jne	 SHORT $LN11@gzwrite

; 578  :                 break;
; 579  :             }
; 580  :             s->stream.avail_out = Z_BUFSIZE;

  00057	89 46 10	 mov	 DWORD PTR [esi+16], eax
$LN3@gzwrite:

; 581  :         }
; 582  :         s->in += s->stream.avail_in;

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

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

  0005d	8b 46 10	 mov	 eax, DWORD PTR [esi+16]
  00060	01 56 64	 add	 DWORD PTR [esi+100], edx
  00063	01 46 68	 add	 DWORD PTR [esi+104], eax

; 584  :         s->z_err = deflate(&(s->stream), Z_NO_FLUSH);

  00066	6a 00		 push	 0
  00068	56		 push	 esi
  00069	e8 00 00 00 00	 call	 _deflate@8

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

  0006e	8b 4e 04	 mov	 ecx, DWORD PTR [esi+4]

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

  00071	8b 56 10	 mov	 edx, DWORD PTR [esi+16]
  00074	29 4e 64	 sub	 DWORD PTR [esi+100], ecx
  00077	29 56 68	 sub	 DWORD PTR [esi+104], edx

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

  0007a	85 c0		 test	 eax, eax
  0007c	89 46 38	 mov	 DWORD PTR [esi+56], eax
  0007f	75 0d		 jne	 SHORT $LN12@gzwrite

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

  00081	85 c9		 test	 ecx, ecx
  00083	75 ab		 jne	 SHORT $LL5@gzwrite

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

  00085	eb 07		 jmp	 SHORT $LN12@gzwrite
$LN11@gzwrite:

; 577  :                 s->z_err = Z_ERRNO;

⌨️ 快捷键说明

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