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

📄 gzio.cod

📁 microsoft visual c++ 2005、windows mobile 5 远程控制PC.通过阅读项目源码能让你熟悉Active Sync RAPI
💻 COD
📖 第 1 页 / 共 5 页
字号:
;	COMDAT _get_byte
_TEXT	SEGMENT
_get_byte PROC						; COMDAT
; _s$ = esi

; 264  :     if (s->z_eof) return EOF;

  00000	83 7e 3c 00	 cmp	 DWORD PTR [esi+60], 0
  00004	75 50		 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 53		 jne	 SHORT $LN3@get_byte

; 266  :         errno = 0;

  0000c	ff 15 00 00 00
	00		 call	 DWORD PTR __imp___errno
  00012	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);

  00018	8b 46 40	 mov	 eax, DWORD PTR [esi+64]
  0001b	8b 4e 44	 mov	 ecx, DWORD PTR [esi+68]
  0001e	50		 push	 eax
  0001f	68 00 40 00 00	 push	 16384			; 00004000H
  00024	6a 01		 push	 1
  00026	51		 push	 ecx
  00027	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__fread
  0002d	83 c4 10	 add	 esp, 16			; 00000010H

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

  00030	85 c0		 test	 eax, eax
  00032	89 46 04	 mov	 DWORD PTR [esi+4], eax
  00035	75 23		 jne	 SHORT $LN2@get_byte

; 269  :             s->z_eof = 1;
; 270  :             if (ferror(s->file)) s->z_err = Z_ERRNO;

  00037	8b 56 40	 mov	 edx, DWORD PTR [esi+64]
  0003a	52		 push	 edx
  0003b	c7 46 3c 01 00
	00 00		 mov	 DWORD PTR [esi+60], 1
  00042	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__ferror
  00048	83 c4 04	 add	 esp, 4
  0004b	85 c0		 test	 eax, eax
  0004d	74 07		 je	 SHORT $LN1@get_byte
  0004f	c7 46 38 ff ff
	ff ff		 mov	 DWORD PTR [esi+56], -1
$LN1@get_byte:

; 271  :             return EOF;

  00056	83 c8 ff	 or	 eax, -1

; 277  : }

  00059	c3		 ret	 0
$LN2@get_byte:

; 272  :         }
; 273  :         s->stream.next_in = s->inbuf;

  0005a	8b 46 44	 mov	 eax, DWORD PTR [esi+68]
  0005d	89 06		 mov	 DWORD PTR [esi], eax
$LN3@get_byte:

; 274  :     }
; 275  :     s->stream.avail_in--;
; 276  :     return *(s->stream.next_in)++;

  0005f	8b 06		 mov	 eax, DWORD PTR [esi]
  00061	83 46 04 ff	 add	 DWORD PTR [esi+4], -1
  00065	8a 08		 mov	 cl, BYTE PTR [eax]
  00067	83 c0 01	 add	 eax, 1
  0006a	89 06		 mov	 DWORD PTR [esi], eax
  0006c	0f b6 c1	 movzx	 eax, cl

; 277  : }

  0006f	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 4e		 je	 SHORT $LN2@gzrewind
  0000c	80 7e 5c 72	 cmp	 BYTE PTR [esi+92], 114	; 00000072H
  00010	75 48		 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	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__fseek
  00052	83 c4 0c	 add	 esp, 12			; 0000000cH
  00055	5f		 pop	 edi
  00056	5e		 pop	 esi

; 874  : }

  00057	c2 04 00	 ret	 4
$LN2@gzrewind:
  0005a	5f		 pop	 edi

; 860  :     gz_stream *s = (gz_stream*)file;
; 861  : 
; 862  :     if (s == NULL || s->mode != 'r') return -1;

  0005b	83 c8 ff	 or	 eax, -1
  0005e	5e		 pop	 esi

; 874  : }

  0005f	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	53		 push	 ebx

; 358  :     int err = Z_OK;

  00001	33 db		 xor	 ebx, ebx

; 359  : 
; 360  :     if (!s) return Z_STREAM_ERROR;

  00003	85 f6		 test	 esi, esi
  00005	75 05		 jne	 SHORT $LN13@destroy
  00007	8d 43 fe	 lea	 eax, DWORD PTR [ebx-2]
  0000a	5b		 pop	 ebx

; 388  : }

  0000b	c3		 ret	 0
$LN13@destroy:

; 361  : 
; 362  :     TRYFREE(s->msg);

  0000c	8b 46 50	 mov	 eax, DWORD PTR [esi+80]
  0000f	85 c0		 test	 eax, eax
  00011	57		 push	 edi
  00012	8b 3d 00 00 00
	00		 mov	 edi, DWORD PTR __imp__free
  00018	74 06		 je	 SHORT $LN12@destroy
  0001a	50		 push	 eax
  0001b	ff d7		 call	 edi
  0001d	83 c4 04	 add	 esp, 4
$LN12@destroy:

; 363  : 
; 364  :     if (s->stream.state != NULL) {

  00020	39 5e 1c	 cmp	 DWORD PTR [esi+28], ebx
  00023	74 1b		 je	 SHORT $LN8@destroy

; 365  :         if (s->mode == 'w') {

  00025	8a 46 5c	 mov	 al, BYTE PTR [esi+92]
  00028	3c 77		 cmp	 al, 119			; 00000077H
  0002a	75 08		 jne	 SHORT $LN10@destroy

; 366  : #ifdef NO_GZCOMPRESS
; 367  :             err = Z_STREAM_ERROR;
; 368  : #else
; 369  :             err = deflateEnd(&(s->stream));

  0002c	56		 push	 esi
  0002d	e8 00 00 00 00	 call	 _deflateEnd@4
  00032	eb 0a		 jmp	 SHORT $LN16@destroy
$LN10@destroy:

; 370  : #endif
; 371  :         } else if (s->mode == 'r') {

  00034	3c 72		 cmp	 al, 114			; 00000072H
  00036	75 08		 jne	 SHORT $LN8@destroy

; 372  :             err = inflateEnd(&(s->stream));

  00038	56		 push	 esi
  00039	e8 00 00 00 00	 call	 _inflateEnd@4
$LN16@destroy:
  0003e	8b d8		 mov	 ebx, eax
$LN8@destroy:

; 373  :         }
; 374  :     }
; 375  :     if (s->file != NULL && fclose(s->file)) {

  00040	8b 46 40	 mov	 eax, DWORD PTR [esi+64]
  00043	85 c0		 test	 eax, eax
  00045	74 1c		 je	 SHORT $LN6@destroy
  00047	50		 push	 eax
  00048	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__fclose
  0004e	83 c4 04	 add	 esp, 4
  00051	85 c0		 test	 eax, eax
  00053	74 0e		 je	 SHORT $LN6@destroy

; 376  : #ifdef ESPIPE
; 377  :         if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */

  00055	ff 15 00 00 00
	00		 call	 DWORD PTR __imp___errno
  0005b	83 38 1d	 cmp	 DWORD PTR [eax], 29	; 0000001dH
  0005e	74 03		 je	 SHORT $LN6@destroy

; 378  : #endif
; 379  :             err = Z_ERRNO;

  00060	83 cb ff	 or	 ebx, -1
$LN6@destroy:

; 380  :     }
; 381  :     if (s->z_err < 0) err = s->z_err;

  00063	8b 46 38	 mov	 eax, DWORD PTR [esi+56]
  00066	85 c0		 test	 eax, eax
  00068	7d 02		 jge	 SHORT $LN5@destroy
  0006a	8b d8		 mov	 ebx, eax
$LN5@destroy:

; 382  : 
; 383  :     TRYFREE(s->inbuf);

  0006c	8b 46 44	 mov	 eax, DWORD PTR [esi+68]
  0006f	85 c0		 test	 eax, eax
  00071	74 06		 je	 SHORT $LN4@destroy
  00073	50		 push	 eax
  00074	ff d7		 call	 edi
  00076	83 c4 04	 add	 esp, 4
$LN4@destroy:

; 384  :     TRYFREE(s->outbuf);

  00079	8b 46 48	 mov	 eax, DWORD PTR [esi+72]
  0007c	85 c0		 test	 eax, eax
  0007e	74 06		 je	 SHORT $LN3@destroy
  00080	50		 push	 eax
  00081	ff d7		 call	 edi
  00083	83 c4 04	 add	 esp, 4
$LN3@destroy:

; 385  :     TRYFREE(s->path);

  00086	8b 46 54	 mov	 eax, DWORD PTR [esi+84]
  00089	85 c0		 test	 eax, eax
  0008b	74 06		 je	 SHORT $LN2@destroy
  0008d	50		 push	 eax
  0008e	ff d7		 call	 edi
  00090	83 c4 04	 add	 esp, 4
$LN2@destroy:

; 386  :     TRYFREE(s);

  00093	56		 push	 esi
  00094	ff d7		 call	 edi
  00096	83 c4 04	 add	 esp, 4
  00099	5f		 pop	 edi

; 387  :     return err;

  0009a	8b c3		 mov	 eax, ebx
  0009c	5b		 pop	 ebx

; 388  : }

  0009d	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 6c		 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	ff 15 00 00 00
	00		 call	 DWORD PTR __imp___errno
  0001f	c7 00 00 00 00
	00		 mov	 DWORD PTR [eax], 0

; 303  :         len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);

  00025	8b 46 40	 mov	 eax, DWORD PTR [esi+64]
  00028	8b cf		 mov	 ecx, edi
  0002a	50		 push	 eax
  0002b	8b 46 44	 mov	 eax, DWORD PTR [esi+68]
  0002e	ba 00 40 00 00	 mov	 edx, 16384		; 00004000H
  00033	d3 fa		 sar	 edx, cl
  00035	03 c7		 add	 eax, edi
  00037	52		 push	 edx
  00038	6a 01		 push	 1
  0003a	50		 push	 eax
  0003b	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__fread
  00041	8b f8		 mov	 edi, eax
  00043	83 c4 10	 add	 esp, 16			; 00000010H

; 304  :         if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;

  00046	85 ff		 test	 edi, edi
  00048	75 18		 jne	 SHORT $LN22@check_head
  0004a	8b 4e 40	 mov	 ecx, DWORD PTR [esi+64]
  0004d	51		 push	 ecx
  0004e	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__ferror
  00054	83 c4 04	 add	 esp, 4
  00057	85 c0		 test	 eax, eax
  00059	74 07		 je	 SHORT $LN22@check_head
  0005b	c7 46 38 ff ff
	ff ff		 mov	 DWORD PTR [esi+56], -1
$LN22@check_head:

; 305  :         s->stream.avail_in += len;

  00062	01 7e 04	 add	 DWORD PTR [esi+4], edi
  00065	8b 46 04	 mov	 eax, DWORD PTR [esi+4]

; 306  :         s->stream.next_in = s->inbuf;
; 307  :         if (s->stream.avail_in < 2) {

  00068	83 f8 02	 cmp	 eax, 2

⌨️ 快捷键说明

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