📄 iowin32.cod
字号:
00037 83 f8 26 cmp eax, 38 ; 00000026H
0003a 75 02 jne SHORT $LN1@win32_writ
; 156 : dwErr = 0;
0003c 33 c0 xor eax, eax
$LN1@win32_writ:
; 157 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
0003e 89 46 04 mov DWORD PTR [esi+4], eax
$LN7@win32_writ:
; 158 : }
; 159 :
; 160 : return ret;
00041 8b 44 24 04 mov eax, DWORD PTR _ret$[esp+8]
$LN2@win32_writ:
00045 5e pop esi
; 161 : }
00046 59 pop ecx
00047 c3 ret 0
_win32_write_file_func ENDP
_TEXT ENDS
PUBLIC _win32_read_file_func
; Function compile flags: /Ogtpy
; COMDAT _win32_read_file_func
_TEXT SEGMENT
_ret$ = -4 ; size = 4
_opaque$ = 8 ; size = 4
_stream$ = 12 ; size = 4
_buf$ = 16 ; size = 4
_size$ = 20 ; size = 4
_win32_read_file_func PROC ; COMDAT
; 122 : {
00000 51 push ecx
00001 56 push esi
; 123 : uLong ret=0;
; 124 : HANDLE hFile = NULL;
; 125 : if (stream!=NULL)
00002 8b 74 24 10 mov esi, DWORD PTR _stream$[esp+4]
00006 33 c0 xor eax, eax
00008 85 f6 test esi, esi
0000a 89 44 24 04 mov DWORD PTR _ret$[esp+8], eax
0000e 74 35 je SHORT $LN2@win32_read
; 126 : hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
00010 8b 0e mov ecx, DWORD PTR [esi]
; 127 : if (hFile != NULL)
00012 85 c9 test ecx, ecx
00014 74 2f je SHORT $LN2@win32_read
; 128 : if (!ReadFile(hFile, buf, size, &ret, NULL))
00016 8b 54 24 18 mov edx, DWORD PTR _size$[esp+4]
0001a 50 push eax
0001b 8d 44 24 08 lea eax, DWORD PTR _ret$[esp+12]
0001f 50 push eax
00020 8b 44 24 1c mov eax, DWORD PTR _buf$[esp+12]
00024 52 push edx
00025 50 push eax
00026 51 push ecx
00027 ff 15 00 00 00
00 call DWORD PTR __imp__ReadFile@20
0002d 85 c0 test eax, eax
0002f 75 10 jne SHORT $LN7@win32_read
; 129 : {
; 130 : DWORD dwErr = GetLastError();
00031 ff 15 00 00 00
00 call DWORD PTR __imp__GetLastError@0
; 131 : if (dwErr == ERROR_HANDLE_EOF)
00037 83 f8 26 cmp eax, 38 ; 00000026H
0003a 75 02 jne SHORT $LN1@win32_read
; 132 : dwErr = 0;
0003c 33 c0 xor eax, eax
$LN1@win32_read:
; 133 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
0003e 89 46 04 mov DWORD PTR [esi+4], eax
$LN7@win32_read:
; 134 : }
; 135 :
; 136 : return ret;
00041 8b 44 24 04 mov eax, DWORD PTR _ret$[esp+8]
$LN2@win32_read:
00045 5e pop esi
; 137 : }
00046 59 pop ecx
00047 c3 ret 0
_win32_read_file_func ENDP
_TEXT ENDS
PUBLIC _win32_open_file_func
; Function compile flags: /Ogtpy
; COMDAT _win32_open_file_func
_TEXT SEGMENT
_opaque$ = 8 ; size = 4
_filename$ = 12 ; size = 4
_dwCreationDisposition$ = 16 ; size = 4
_mode$ = 16 ; size = 4
_win32_open_file_func PROC ; COMDAT
; 70 : const char* mode_fopen = NULL;
; 71 : DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
; 72 : HANDLE hFile = 0;
; 73 : voidpf ret=NULL;
; 74 :
; 75 : dwDesiredAccess = dwShareMode = dwFlagsAndAttributes = 0;
; 76 :
; 77 : if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
00000 8b 4c 24 0c mov ecx, DWORD PTR _mode$[esp-4]
00004 53 push ebx
00005 8b d9 mov ebx, ecx
00007 55 push ebp
00008 80 e3 03 and bl, 3
0000b 33 ed xor ebp, ebp
0000d 33 d2 xor edx, edx
0000f 33 c0 xor eax, eax
00011 80 fb 01 cmp bl, 1
00014 56 push esi
00015 75 0d jne SHORT $LN10@win32_open
; 78 : {
; 79 : dwDesiredAccess = GENERIC_READ;
00017 b8 00 00 00 80 mov eax, -2147483648 ; 80000000H
; 80 : dwCreationDisposition = OPEN_EXISTING;
0001c 8d 4d 03 lea ecx, DWORD PTR [ebp+3]
; 81 : dwShareMode = FILE_SHARE_READ;
0001f 8d 55 01 lea edx, DWORD PTR [ebp+1]
; 82 : }
; 83 : else
00022 eb 26 jmp SHORT $LN6@win32_open
$LN10@win32_open:
; 84 : if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
00024 f6 c1 04 test cl, 4
00027 74 0c je SHORT $LN8@win32_open
; 85 : {
; 86 : dwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
00029 b8 00 00 00 c0 mov eax, -1073741824 ; c0000000H
; 87 : dwCreationDisposition = OPEN_EXISTING;
0002e b9 03 00 00 00 mov ecx, 3
; 88 : }
; 89 : else
00033 eb 15 jmp SHORT $LN6@win32_open
$LN8@win32_open:
; 90 : if (mode & ZLIB_FILEFUNC_MODE_CREATE)
00035 f6 c1 08 test cl, 8
00038 74 0c je SHORT $LN17@win32_open
; 91 : {
; 92 : dwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
0003a b8 00 00 00 c0 mov eax, -1073741824 ; c0000000H
; 93 : dwCreationDisposition = CREATE_ALWAYS;
0003f b9 02 00 00 00 mov ecx, 2
00044 eb 04 jmp SHORT $LN6@win32_open
$LN17@win32_open:
00046 8b 4c 24 18 mov ecx, DWORD PTR _dwCreationDisposition$[esp+8]
$LN6@win32_open:
; 94 : }
; 95 :
; 96 : if ((filename!=NULL) && (dwDesiredAccess != 0))
0004a 8b 74 24 14 mov esi, DWORD PTR _filename$[esp+8]
0004e 85 f6 test esi, esi
00050 74 4d je SHORT $LN14@win32_open
00052 85 c0 test eax, eax
00054 74 49 je SHORT $LN14@win32_open
00056 57 push edi
; 97 : hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL,
; 98 : dwCreationDisposition, dwFlagsAndAttributes, NULL);
00057 6a 00 push 0
00059 6a 00 push 0
0005b 51 push ecx
0005c 6a 00 push 0
0005e 52 push edx
0005f 50 push eax
00060 56 push esi
00061 ff 15 00 00 00
00 call DWORD PTR __imp__CreateFileA@28
00067 8b f8 mov edi, eax
; 99 :
; 100 : if (hFile == INVALID_HANDLE_VALUE)
00069 83 ff ff cmp edi, -1
; 101 : hFile = NULL;
; 102 :
; 103 : if (hFile != NULL)
0006c 74 37 je SHORT $LN16@win32_open
0006e 85 ff test edi, edi
00070 74 33 je SHORT $LN16@win32_open
; 104 : {
; 105 : WIN32FILE_IOWIN w32fiow;
; 106 : w32fiow.hf = hFile;
; 107 : w32fiow.error = 0;
; 108 : ret = malloc(sizeof(WIN32FILE_IOWIN));
00072 6a 08 push 8
00074 33 db xor ebx, ebx
00076 ff 15 00 00 00
00 call DWORD PTR __imp__malloc
0007c 8b f0 mov esi, eax
0007e 83 c4 04 add esp, 4
; 109 : if (ret==NULL)
00081 85 f6 test esi, esi
00083 75 0e jne SHORT $LN2@win32_open
; 110 : CloseHandle(hFile);
00085 57 push edi
00086 ff 15 00 00 00
00 call DWORD PTR __imp__CloseHandle@4
0008c 5f pop edi
; 112 : }
; 113 : return ret;
0008d 8b c6 mov eax, esi
0008f 5e pop esi
00090 5d pop ebp
00091 5b pop ebx
; 114 : }
00092 c3 ret 0
$LN2@win32_open:
; 111 : else *((WIN32FILE_IOWIN*)ret) = w32fiow;
00093 89 3e mov DWORD PTR [esi], edi
00095 5f pop edi
00096 89 5e 04 mov DWORD PTR [esi+4], ebx
; 112 : }
; 113 : return ret;
00099 8b c6 mov eax, esi
0009b 5e pop esi
0009c 5d pop ebp
0009d 5b pop ebx
; 114 : }
0009e c3 ret 0
$LN14@win32_open:
0009f 5e pop esi
; 112 : }
; 113 : return ret;
000a0 8b c5 mov eax, ebp
000a2 5d pop ebp
000a3 5b pop ebx
; 114 : }
000a4 c3 ret 0
$LN16@win32_open:
000a5 5f pop edi
000a6 5e pop esi
; 112 : }
; 113 : return ret;
000a7 8b c5 mov eax, ebp
000a9 5d pop ebp
000aa 5b pop ebx
; 114 : }
000ab c3 ret 0
_win32_open_file_func ENDP
PUBLIC _fill_win32_filefunc
; Function compile flags: /Ogtpy
; COMDAT _fill_win32_filefunc
_TEXT SEGMENT
_pzlib_filefunc_def$ = 8 ; size = 4
_fill_win32_filefunc PROC ; COMDAT
; 262 : pzlib_filefunc_def->zopen_file = win32_open_file_func;
00000 8b 44 24 04 mov eax, DWORD PTR _pzlib_filefunc_def$[esp-4]
00004 c7 00 00 00 00
00 mov DWORD PTR [eax], OFFSET _win32_open_file_func
; 263 : pzlib_filefunc_def->zread_file = win32_read_file_func;
0000a c7 40 04 00 00
00 00 mov DWORD PTR [eax+4], OFFSET _win32_read_file_func
; 264 : pzlib_filefunc_def->zwrite_file = win32_write_file_func;
00011 c7 40 08 00 00
00 00 mov DWORD PTR [eax+8], OFFSET _win32_write_file_func
; 265 : pzlib_filefunc_def->ztell_file = win32_tell_file_func;
00018 c7 40 0c 00 00
00 00 mov DWORD PTR [eax+12], OFFSET _win32_tell_file_func
; 266 : pzlib_filefunc_def->zseek_file = win32_seek_file_func;
0001f c7 40 10 00 00
00 00 mov DWORD PTR [eax+16], OFFSET _win32_seek_file_func
; 267 : pzlib_filefunc_def->zclose_file = win32_close_file_func;
00026 c7 40 14 00 00
00 00 mov DWORD PTR [eax+20], OFFSET _win32_close_file_func
; 268 : pzlib_filefunc_def->zerror_file = win32_error_file_func;
0002d c7 40 18 00 00
00 00 mov DWORD PTR [eax+24], OFFSET _win32_error_file_func
; 269 : pzlib_filefunc_def->opaque=NULL;
00034 c7 40 1c 00 00
00 00 mov DWORD PTR [eax+28], 0
; 270 : }
0003b c3 ret 0
_fill_win32_filefunc ENDP
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -