📄 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 __imp__sprintf:PROC
EXTRN __imp___fdopen:PROC
EXTRN __imp__fopen:PROC
EXTRN __imp__fprintf:PROC
EXTRN __imp__ftell:PROC
EXTRN __imp__ferror:PROC
EXTRN __imp__fread:PROC
EXTRN __imp___vsnprintf:PROC
EXTRN __imp__fflush:PROC
EXTRN __imp__fseek:PROC
EXTRN __imp__fwrite:PROC
EXTRN __imp__fclose:PROC
EXTRN __imp__fputc:PROC
EXTRN __imp__strerror:PROC
EXTRN __imp___errno:PROC
EXTRN __imp__free:PROC
EXTRN __imp__malloc:PROC
EXTRN __imp__clearerr: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 17 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 ff 15 00 00 00
00 call DWORD PTR __imp__clearerr
00020 59 pop ecx
$LN3@gzclearerr:
; 1026 : }
00021 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 16 jne SHORT $LN9@gzerror
00038 ff 15 00 00 00
00 call DWORD PTR __imp___errno
0003e 8b 10 mov edx, DWORD PTR [eax]
00040 52 push edx
00041 ff 15 00 00 00
00 call DWORD PTR __imp__strerror
00047 83 c4 04 add esp, 4
0004a 8b f8 mov edi, eax
0004c eb 03 jmp SHORT $LN10@gzerror
$LN9@gzerror:
0004e 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);
00051 85 ff test edi, edi
00053 74 05 je SHORT $LN3@gzerror
00055 80 3f 00 cmp BYTE PTR [edi], 0
00058 75 10 jne SHORT $LN4@gzerror
$LN3@gzerror:
0005a 8b 43 38 mov eax, DWORD PTR [ebx+56]
0005d 03 c0 add eax, eax
0005f 03 c0 add eax, eax
00061 b9 08 00 00 00 mov ecx, OFFSET _z_errmsg+8
00066 2b c8 sub ecx, eax
00068 8b 39 mov edi, DWORD PTR [ecx]
$LN4@gzerror:
; 1004 :
; 1005 : TRYFREE(s->msg);
0006a 8b 43 50 mov eax, DWORD PTR [ebx+80]
0006d 85 c0 test eax, eax
0006f 74 0a je SHORT $LN2@gzerror
00071 50 push eax
00072 ff 15 00 00 00
00 call DWORD PTR __imp__free
00078 83 c4 04 add esp, 4
$LN2@gzerror:
; 1006 : s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
0007b 8b 43 54 mov eax, DWORD PTR [ebx+84]
0007e 8d 50 01 lea edx, DWORD PTR [eax+1]
$LL13@gzerror:
00081 8a 08 mov cl, BYTE PTR [eax]
00083 83 c0 01 add eax, 1
00086 84 c9 test cl, cl
00088 75 f7 jne SHORT $LL13@gzerror
0008a 2b c2 sub eax, edx
0008c 8b d0 mov edx, eax
0008e 8b c7 mov eax, edi
00090 56 push esi
00091 8d 70 01 lea esi, DWORD PTR [eax+1]
$LL14@gzerror:
00094 8a 08 mov cl, BYTE PTR [eax]
00096 83 c0 01 add eax, 1
00099 84 c9 test cl, cl
0009b 75 f7 jne SHORT $LL14@gzerror
0009d 2b c6 sub eax, esi
0009f 8d 54 10 03 lea edx, DWORD PTR [eax+edx+3]
000a3 52 push edx
000a4 ff 15 00 00 00
00 call DWORD PTR __imp__malloc
000aa 83 c4 04 add esp, 4
; 1007 : if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
000ad 85 c0 test eax, eax
000af 89 43 50 mov DWORD PTR [ebx+80], eax
000b2 75 0b jne SHORT $LN1@gzerror
000b4 5e pop esi
000b5 5f pop edi
000b6 b8 00 00 00 00 mov eax, OFFSET ??_C@_0BE@OGGJBMCE@insufficient?5memory?$AA@
000bb 5b pop ebx
; 1012 : }
000bc c2 08 00 ret 8
$LN1@gzerror:
; 1008 : strcpy(s->msg, s->path);
000bf 8b 4b 54 mov ecx, DWORD PTR [ebx+84]
000c2 8b d0 mov edx, eax
$LL11@gzerror:
000c4 8a 01 mov al, BYTE PTR [ecx]
000c6 88 02 mov BYTE PTR [edx], al
000c8 83 c1 01 add ecx, 1
000cb 83 c2 01 add edx, 1
000ce 84 c0 test al, al
000d0 75 f2 jne SHORT $LL11@gzerror
; 1009 : strcat(s->msg, ": ");
000d2 8b 43 50 mov eax, DWORD PTR [ebx+80]
000d5 83 c0 ff add eax, -1
$LL15@gzerror:
000d8 8a 48 01 mov cl, BYTE PTR [eax+1]
000db 83 c0 01 add eax, 1
000de 84 c9 test cl, cl
000e0 75 f6 jne SHORT $LL15@gzerror
000e2 66 8b 0d 00 00
00 00 mov cx, WORD PTR ??_C@_02LMMGGCAJ@?3?5?$AA@
000e9 66 89 08 mov WORD PTR [eax], cx
000ec 8a 15 02 00 00
00 mov dl, BYTE PTR ??_C@_02LMMGGCAJ@?3?5?$AA@+2
000f2 88 50 02 mov BYTE PTR [eax+2], dl
; 1010 : strcat(s->msg, m);
000f5 8b c7 mov eax, edi
000f7 8b cf mov ecx, edi
000f9 8d a4 24 00 00
00 00 npad 7
$LL16@gzerror:
00100 8a 10 mov dl, BYTE PTR [eax]
00102 83 c0 01 add eax, 1
00105 84 d2 test dl, dl
00107 75 f7 jne SHORT $LL16@gzerror
00109 8b 7b 50 mov edi, DWORD PTR [ebx+80]
0010c 2b c1 sub eax, ecx
0010e 8b f1 mov esi, ecx
00110 83 c7 ff add edi, -1
$LL17@gzerror:
00113 8a 4f 01 mov cl, BYTE PTR [edi+1]
00116 83 c7 01 add edi, 1
00119 84 c9 test cl, cl
0011b 75 f6 jne SHORT $LL17@gzerror
0011d 8b c8 mov ecx, eax
0011f c1 e9 02 shr ecx, 2
00122 f3 a5 rep movsd
00124 8b c8 mov ecx, eax
00126 83 e1 03 and ecx, 3
00129 f3 a4 rep movsb
; 1011 : return (const char*)s->msg;
0012b 8b 43 50 mov eax, DWORD PTR [ebx+80]
0012e 5e pop esi
0012f 5f pop edi
00130 5b pop ebx
; 1012 : }
00131 c2 08 00 ret 8
_gzerror@8 ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _putLong
_TEXT SEGMENT
_file$ = 8 ; size = 4
_putLong PROC ; COMDAT
; _x$ = eax
; 923 : {
00000 53 push ebx
; 924 : int n;
; 925 : for (n = 0; n < 4; n++) {
00001 8b 1d 00 00 00
00 mov ebx, DWORD PTR __imp__fputc
00007 55 push ebp
00008 8b 6c 24 0c mov ebp, DWORD PTR _file$[esp+4]
0000c 56 push esi
0000d 57 push edi
0000e 8b f0 mov esi, eax
00010 bf 04 00 00 00 mov edi, 4
$LL3@putLong:
; 926 : fputc((int)(x & 0xff), file);
00015 8b c6 mov eax, esi
00017 25 ff 00 00 00 and eax, 255 ; 000000ffH
0001c 55 push ebp
0001d 50 push eax
0001e ff d3 call ebx
00020 83 c4 08 add esp, 8
; 927 : x >>= 8;
00023 c1 ee 08 shr esi, 8
00026 83 ef 01 sub edi, 1
00029 75 ea jne SHORT $LL3@putLong
0002b 5f pop edi
0002c 5e pop esi
0002d 5d pop ebp
0002e 5b pop ebx
; 928 : }
; 929 : }
0002f 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -