📄 gzio.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 14.00.50727.762
TITLE d:\src\VS2005\cpp\CeRemoteClient\zlib123\gzio.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB OLDNAMES
PUBLIC ??_C@_0BF@FJABJDFD@?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$AA@ ; `string'
PUBLIC ??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@ ; `string'
PUBLIC ??_C@_00CNPNBAHC@?$AA@ ; `string'
PUBLIC ??_C@_02LMMGGCAJ@?3?5?$AA@ ; `string'
EXTRN __vsnprintf:PROC
EXTRN _fflush:PROC
EXTRN _fseek:PROC
EXTRN _fputc:PROC
EXTRN _strerror:PROC
EXTRN _clearerr:PROC
EXTRN _sprintf:PROC
EXTRN __fdopen:PROC
EXTRN _fopen:PROC
EXTRN _fprintf:PROC
EXTRN _ftell:PROC
EXTRN _malloc:PROC
EXTRN _ferror:PROC
EXTRN _fread:PROC
EXTRN _fclose:PROC
EXTRN __errno:PROC
EXTRN _free:PROC
EXTRN _fwrite:PROC
; COMDAT ??_C@_02LMMGGCAJ@?3?5?$AA@
CONST SEGMENT
??_C@_02LMMGGCAJ@?3?5?$AA@ DB ': ', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_00CNPNBAHC@?$AA@
CONST SEGMENT
??_C@_00CNPNBAHC@?$AA@ DB 00H ; `string'
CONST ENDS
; COMDAT ??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@
CONST SEGMENT
??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@ DB '<fd:%d>', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BF@FJABJDFD@?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$AA@
CONST SEGMENT
??_C@_0BF@FJABJDFD@?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?$AA@ DB '%'
DB 'c%c%c%c%c%c%c%c%c%c', 00H ; `string'
ORG $+2
_gz_magic DD 01fH
DD 08bH
PUBLIC _gzclearerr@4
; Function compile flags: /Ogtpy
; File d:\src\vs2005\cpp\ceremoteclient\zlib123\gzio.c
; COMDAT _gzclearerr@4
_TEXT SEGMENT
_file$ = 8 ; size = 4
_gzclearerr@4 PROC ; COMDAT
; 1020 : gz_stream *s = (gz_stream*)file;
; 1021 :
; 1022 : if (s == NULL) return;
00000 8b 44 24 04 mov eax, DWORD PTR _file$[esp-4]
00004 33 c9 xor ecx, ecx
00006 3b c1 cmp eax, ecx
00008 74 16 je SHORT $LN3@gzclearerr
; 1023 : if (s->z_err != Z_STREAM_END) s->z_err = Z_OK;
0000a 83 78 38 01 cmp DWORD PTR [eax+56], 1
0000e 74 03 je SHORT $LN1@gzclearerr
00010 89 48 38 mov DWORD PTR [eax+56], ecx
$LN1@gzclearerr:
; 1024 : s->z_eof = 0;
00013 89 48 3c mov DWORD PTR [eax+60], ecx
; 1025 : clearerr(s->file);
00016 8b 40 40 mov eax, DWORD PTR [eax+64]
00019 50 push eax
0001a e8 00 00 00 00 call _clearerr
0001f 59 pop ecx
$LN3@gzclearerr:
; 1026 : }
00020 c2 04 00 ret 4
_gzclearerr@4 ENDP
_TEXT ENDS
PUBLIC _gzerror@8
; Function compile flags: /Ogtpy
; COMDAT _gzerror@8
_TEXT SEGMENT
_file$ = 8 ; size = 4
_errnum$ = 12 ; size = 4
_gzerror@8 PROC ; COMDAT
; 990 : {
00000 53 push ebx
; 991 : char *m;
; 992 : gz_stream *s = (gz_stream*)file;
; 993 :
; 994 : if (s == NULL) {
00001 8b 5c 24 08 mov ebx, DWORD PTR _file$[esp]
00005 85 db test ebx, ebx
00007 75 13 jne SHORT $LN6@gzerror
; 995 : *errnum = Z_STREAM_ERROR;
00009 8b 44 24 0c mov eax, DWORD PTR _errnum$[esp]
0000d c7 00 fe ff ff
ff mov DWORD PTR [eax], -2 ; fffffffeH
; 996 : return (const char*)ERR_MSG(Z_STREAM_ERROR);
00013 b8 00 00 00 00 mov eax, OFFSET ??_C@_0N@MKKNPMJD@stream?5error?$AA@
00018 5b pop ebx
; 1012 : }
00019 c2 08 00 ret 8
$LN6@gzerror:
; 997 : }
; 998 : *errnum = s->z_err;
0001c 8b 43 38 mov eax, DWORD PTR [ebx+56]
; 999 : if (*errnum == Z_OK) return (const char*)"";
0001f 85 c0 test eax, eax
00021 8b 4c 24 0c mov ecx, DWORD PTR _errnum$[esp]
00025 89 01 mov DWORD PTR [ecx], eax
00027 75 09 jne SHORT $LN5@gzerror
00029 b8 00 00 00 00 mov eax, OFFSET ??_C@_00CNPNBAHC@?$AA@
0002e 5b pop ebx
; 1012 : }
0002f c2 08 00 ret 8
$LN5@gzerror:
; 1000 :
; 1001 : m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
00032 83 f8 ff cmp eax, -1
00035 57 push edi
00036 75 14 jne SHORT $LN9@gzerror
00038 e8 00 00 00 00 call __errno
0003d 8b 10 mov edx, DWORD PTR [eax]
0003f 52 push edx
00040 e8 00 00 00 00 call _strerror
00045 83 c4 04 add esp, 4
00048 8b f8 mov edi, eax
0004a eb 03 jmp SHORT $LN10@gzerror
$LN9@gzerror:
0004c 8b 7b 18 mov edi, DWORD PTR [ebx+24]
$LN10@gzerror:
; 1002 :
; 1003 : if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
0004f 85 ff test edi, edi
00051 74 05 je SHORT $LN3@gzerror
00053 80 3f 00 cmp BYTE PTR [edi], 0
00056 75 10 jne SHORT $LN4@gzerror
$LN3@gzerror:
00058 8b 43 38 mov eax, DWORD PTR [ebx+56]
0005b 03 c0 add eax, eax
0005d 03 c0 add eax, eax
0005f b9 08 00 00 00 mov ecx, OFFSET _z_errmsg+8
00064 2b c8 sub ecx, eax
00066 8b 39 mov edi, DWORD PTR [ecx]
$LN4@gzerror:
; 1004 :
; 1005 : TRYFREE(s->msg);
00068 8b 43 50 mov eax, DWORD PTR [ebx+80]
0006b 85 c0 test eax, eax
0006d 74 09 je SHORT $LN2@gzerror
0006f 50 push eax
00070 e8 00 00 00 00 call _free
00075 83 c4 04 add esp, 4
$LN2@gzerror:
; 1006 : s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
00078 8b 43 54 mov eax, DWORD PTR [ebx+84]
0007b 8d 50 01 lea edx, DWORD PTR [eax+1]
0007e 8b ff npad 2
$LL13@gzerror:
00080 8a 08 mov cl, BYTE PTR [eax]
00082 83 c0 01 add eax, 1
00085 84 c9 test cl, cl
00087 75 f7 jne SHORT $LL13@gzerror
00089 2b c2 sub eax, edx
0008b 8b d0 mov edx, eax
0008d 8b c7 mov eax, edi
0008f 56 push esi
00090 8d 70 01 lea esi, DWORD PTR [eax+1]
$LL14@gzerror:
00093 8a 08 mov cl, BYTE PTR [eax]
00095 83 c0 01 add eax, 1
00098 84 c9 test cl, cl
0009a 75 f7 jne SHORT $LL14@gzerror
0009c 2b c6 sub eax, esi
0009e 8d 54 10 03 lea edx, DWORD PTR [eax+edx+3]
000a2 52 push edx
000a3 e8 00 00 00 00 call _malloc
000a8 83 c4 04 add esp, 4
; 1007 : if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
000ab 85 c0 test eax, eax
000ad 89 43 50 mov DWORD PTR [ebx+80], eax
000b0 75 0b jne SHORT $LN1@gzerror
000b2 5e pop esi
000b3 5f pop edi
000b4 b8 00 00 00 00 mov eax, OFFSET ??_C@_0BE@OGGJBMCE@insufficient?5memory?$AA@
000b9 5b pop ebx
; 1012 : }
000ba c2 08 00 ret 8
$LN1@gzerror:
; 1008 : strcpy(s->msg, s->path);
000bd 8b 4b 54 mov ecx, DWORD PTR [ebx+84]
000c0 8b d0 mov edx, eax
$LL11@gzerror:
000c2 8a 01 mov al, BYTE PTR [ecx]
000c4 88 02 mov BYTE PTR [edx], al
000c6 83 c1 01 add ecx, 1
000c9 83 c2 01 add edx, 1
000cc 84 c0 test al, al
000ce 75 f2 jne SHORT $LL11@gzerror
; 1009 : strcat(s->msg, ": ");
000d0 8b 43 50 mov eax, DWORD PTR [ebx+80]
000d3 83 c0 ff add eax, -1
$LL15@gzerror:
000d6 8a 48 01 mov cl, BYTE PTR [eax+1]
000d9 83 c0 01 add eax, 1
000dc 84 c9 test cl, cl
000de 75 f6 jne SHORT $LL15@gzerror
000e0 66 8b 0d 00 00
00 00 mov cx, WORD PTR ??_C@_02LMMGGCAJ@?3?5?$AA@
000e7 66 89 08 mov WORD PTR [eax], cx
000ea 8a 15 02 00 00
00 mov dl, BYTE PTR ??_C@_02LMMGGCAJ@?3?5?$AA@+2
000f0 88 50 02 mov BYTE PTR [eax+2], dl
; 1010 : strcat(s->msg, m);
000f3 8b c7 mov eax, edi
000f5 8b cf mov ecx, edi
$LL16@gzerror:
000f7 8a 10 mov dl, BYTE PTR [eax]
000f9 83 c0 01 add eax, 1
000fc 84 d2 test dl, dl
000fe 75 f7 jne SHORT $LL16@gzerror
00100 8b 7b 50 mov edi, DWORD PTR [ebx+80]
00103 2b c1 sub eax, ecx
00105 8b f1 mov esi, ecx
00107 83 c7 ff add edi, -1
0010a 8d 9b 00 00 00
00 npad 6
$LL17@gzerror:
00110 8a 4f 01 mov cl, BYTE PTR [edi+1]
00113 83 c7 01 add edi, 1
00116 84 c9 test cl, cl
00118 75 f6 jne SHORT $LL17@gzerror
0011a 8b c8 mov ecx, eax
0011c c1 e9 02 shr ecx, 2
0011f f3 a5 rep movsd
00121 8b c8 mov ecx, eax
00123 83 e1 03 and ecx, 3
00126 f3 a4 rep movsb
; 1011 : return (const char*)s->msg;
00128 8b 43 50 mov eax, DWORD PTR [ebx+80]
0012b 5e pop esi
0012c 5f pop edi
0012d 5b pop ebx
; 1012 : }
0012e c2 08 00 ret 8
_gzerror@8 ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _putLong
_TEXT SEGMENT
_putLong PROC ; COMDAT
; _file$ = ebx
; _x$ = eax
; 923 : {
00000 56 push esi
00001 57 push edi
00002 8b f0 mov esi, eax
; 924 : int n;
; 925 : for (n = 0; n < 4; n++) {
00004 bf 04 00 00 00 mov edi, 4
00009 8d a4 24 00 00
00 00 npad 7
$LL3@putLong:
; 926 : fputc((int)(x & 0xff), file);
00010 8b c6 mov eax, esi
00012 25 ff 00 00 00 and eax, 255 ; 000000ffH
00017 53 push ebx
00018 50 push eax
00019 e8 00 00 00 00 call _fputc
0001e 83 c4 08 add esp, 8
; 927 : x >>= 8;
00021 c1 ee 08 shr esi, 8
00024 83 ef 01 sub edi, 1
00027 75 e7 jne SHORT $LL3@putLong
00029 5f pop edi
0002a 5e pop esi
; 928 : }
; 929 : }
0002b c3 ret 0
_putLong ENDP
_TEXT ENDS
PUBLIC _gzeof@4
; Function compile flags: /Ogtpy
; COMDAT _gzeof@4
_TEXT SEGMENT
_file$ = 8 ; size = 4
_gzeof@4 PROC ; COMDAT
; 894 : gz_stream *s = (gz_stream*)file;
; 895 :
; 896 : /* With concatenated compressed files that can have embedded
; 897 : * crc trailers, z_eof is no longer the only/best indicator of EOF
; 898 : * on a gz_stream. Handle end-of-stream error explicitly here.
; 899 : */
; 900 : if (s == NULL || s->mode != 'r') return 0;
00000 8b 44 24 04 mov eax, DWORD PTR _file$[esp-4]
00004 85 c0 test eax, eax
00006 74 22 je SHORT $LN2@gzeof
00008 80 78 5c 72 cmp BYTE PTR [eax+92], 114 ; 00000072H
0000c 75 1c jne SHORT $LN2@gzeof
; 901 : if (s->z_eof) return 1;
0000e 83 78 3c 00 cmp DWORD PTR [eax+60], 0
00012 74 08 je SHORT $LN1@gzeof
00014 b8 01 00 00 00 mov eax, 1
; 903 : }
00019 c2 04 00 ret 4
$LN1@gzeof:
; 902 : return s->z_err == Z_STREAM_END;
0001c 33 c9 xor ecx, ecx
0001e 83 78 38 01 cmp DWORD PTR [eax+56], 1
00022 0f 94 c1 sete cl
00025 8b c1 mov eax, ecx
; 903 : }
00027 c2 04 00 ret 4
$LN2@gzeof:
; 894 : gz_stream *s = (gz_stream*)file;
; 895 :
; 896 : /* With concatenated compressed files that can have embedded
; 897 : * crc trailers, z_eof is no longer the only/best indicator of EOF
; 898 : * on a gz_stream. Handle end-of-stream error explicitly here.
; 899 : */
; 900 : if (s == NULL || s->mode != 'r') return 0;
0002a 33 c0 xor eax, eax
; 903 : }
0002c c2 04 00 ret 4
_gzeof@4 ENDP
_TEXT ENDS
PUBLIC _gzungetc@8
; Function compile flags: /Ogtpy
; COMDAT _gzungetc@8
_TEXT SEGMENT
_c$ = 8 ; size = 4
_file$ = 12 ; size = 4
_gzungetc@8 PROC ; COMDAT
; 519 : gz_stream *s = (gz_stream*)file;
; 520 :
; 521 : if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF;
00000 8b 4c 24 08 mov ecx, DWORD PTR _file$[esp-4]
00004 83 ca ff or edx, -1
00007 85 c9 test ecx, ecx
00009 74 3a je SHORT $LN2@gzungetc
0000b 80 79 5c 72 cmp BYTE PTR [ecx+92], 114 ; 00000072H
0000f 75 34 jne SHORT $LN2@gzungetc
00011 8b 44 24 04 mov eax, DWORD PTR _c$[esp-4]
00015 3b c2 cmp eax, edx
00017 74 2c je SHORT $LN2@gzungetc
00019 39 51 6c cmp DWORD PTR [ecx+108], edx
0001c 75 27 jne SHORT $LN2@gzungetc
; 522 : s->back = c;
; 523 : s->out--;
0001e 01 51 68 add DWORD PTR [ecx+104], edx
; 524 : s->last = (s->z_err == Z_STREAM_END);
00021 33 d2 xor edx, edx
00023 83 79 38 01 cmp DWORD PTR [ecx+56], 1
00027 89 41 6c mov DWORD PTR [ecx+108], eax
0002a 0f 94 c2 sete dl
; 525 : if (s->last) s->z_err = Z_OK;
0002d 85 d2 test edx, edx
0002f 89 51 70 mov DWORD PTR [ecx+112], edx
00032 74 07 je SHORT $LN1@gzungetc
00034 c7 41 38 00 00
00 00 mov DWORD PTR [ecx+56], 0
$LN1@gzungetc:
; 526 : s->z_eof = 0;
0003b c7 41 3c 00 00
00 00 mov DWORD PTR [ecx+60], 0
; 527 : return c;
; 528 : }
00042 c2 08 00 ret 8
$LN2@gzungetc:
; 519 : gz_stream *s = (gz_stream*)file;
; 520 :
; 521 : if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF;
00045 8b c2 mov eax, edx
; 527 : return c;
; 528 : }
00047 c2 08 00 ret 8
_gzungetc@8 ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _get_byte
_TEXT SEGMENT
_get_byte PROC ; COMDAT
; _s$ = esi
; 264 : if (s->z_eof) return EOF;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -