📄 zip.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 14.00.50727.762
TITLE d:\src\VS2005\cpp\CeRemoteClient\zlib123\contrib\minizip\zip.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB OLDNAMES
PUBLIC _zip_copyright
PUBLIC ??_C@_01JOAMLHOP@?9?$AA@ ; `string'
EXTRN _rand:PROC
EXTRN _srand:PROC
EXTRN __time64:PROC
?calls@?1??crypthead@@9@9 DD 01H DUP (?) ; `crypthead'::`2'::calls
; COMDAT ??_C@_01JOAMLHOP@?9?$AA@
CONST SEGMENT
??_C@_01JOAMLHOP@?9?$AA@ DB '-', 00H ; `string'
_zip_copyright DB ' zip 1.01 Copyright 1998-2004 Gilles Vollant - http://'
DB 'www.winimage.com/zLibDll', 00H
; Function compile flags: /Ogtpy
; File d:\src\vs2005\cpp\ceremoteclient\zlib123\contrib\minizip\zip.c
; COMDAT _ziplocal_SearchCentralDir
_TEXT SEGMENT
_uMaxBack$ = -16 ; size = 4
_uBackRead$ = -12 ; size = 4
_uPosFound$ = -8 ; size = 4
_uSizeFile$ = -4 ; size = 4
_filestream$ = 8 ; size = 4
_ziplocal_SearchCentralDir PROC ; COMDAT
; _pzlib_filefunc_def$ = ebx
; 443 : {
00000 83 ec 10 sub esp, 16 ; 00000010H
; 444 : unsigned char* buf;
; 445 : uLong uSizeFile;
; 446 : uLong uBackRead;
; 447 : uLong uMaxBack=0xffff; /* maximum size of global comment */
; 448 : uLong uPosFound=0;
; 449 :
; 450 : if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
00003 8b 43 1c mov eax, DWORD PTR [ebx+28]
00006 8b 4b 10 mov ecx, DWORD PTR [ebx+16]
00009 55 push ebp
0000a 56 push esi
0000b 8b 74 24 1c mov esi, DWORD PTR _filestream$[esp+20]
0000f 6a 02 push 2
00011 6a 00 push 0
00013 56 push esi
00014 bd ff ff 00 00 mov ebp, 65535 ; 0000ffffH
00019 50 push eax
0001a 89 6c 24 18 mov DWORD PTR _uMaxBack$[esp+40], ebp
0001e c7 44 24 20 00
00 00 00 mov DWORD PTR _uPosFound$[esp+40], 0
00026 ff d1 call ecx
00028 83 c4 10 add esp, 16 ; 00000010H
0002b 85 c0 test eax, eax
0002d 74 08 je SHORT $LN14@ziplocal_S
0002f 5e pop esi
; 451 : return 0;
00030 33 c0 xor eax, eax
00032 5d pop ebp
; 495 : }
00033 83 c4 10 add esp, 16 ; 00000010H
00036 c3 ret 0
$LN14@ziplocal_S:
; 452 :
; 453 :
; 454 : uSizeFile = ZTELL(*pzlib_filefunc_def,filestream);
00037 8b 53 1c mov edx, DWORD PTR [ebx+28]
0003a 8b 43 0c mov eax, DWORD PTR [ebx+12]
0003d 57 push edi
0003e 56 push esi
0003f 52 push edx
00040 ff d0 call eax
00042 8b f8 mov edi, eax
00044 83 c4 08 add esp, 8
; 455 :
; 456 : if (uMaxBack>uSizeFile)
00047 3b fd cmp edi, ebp
00049 89 7c 24 18 mov DWORD PTR _uSizeFile$[esp+28], edi
0004d 73 06 jae SHORT $LN13@ziplocal_S
; 457 : uMaxBack = uSizeFile;
0004f 89 7c 24 0c mov DWORD PTR _uMaxBack$[esp+28], edi
00053 8b e8 mov ebp, eax
$LN13@ziplocal_S:
; 458 :
; 459 : buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
00055 68 04 04 00 00 push 1028 ; 00000404H
0005a e8 00 00 00 00 call _malloc
0005f 8b f0 mov esi, eax
00061 83 c4 04 add esp, 4
; 460 : if (buf==NULL)
00064 85 f6 test esi, esi
00066 75 07 jne SHORT $LN12@ziplocal_S
00068 5f pop edi
00069 5e pop esi
0006a 5d pop ebp
; 495 : }
0006b 83 c4 10 add esp, 16 ; 00000010H
0006e c3 ret 0
$LN12@ziplocal_S:
; 461 : return 0;
; 462 :
; 463 : uBackRead = 4;
0006f b8 04 00 00 00 mov eax, 4
; 464 : while (uBackRead<uMaxBack)
00074 3b e8 cmp ebp, eax
00076 0f 86 ae 00 00
00 jbe $LN28@ziplocal_S
0007c eb 0e jmp SHORT $LN11@ziplocal_S
0007e 8b ff npad 2
$LL27@ziplocal_S:
00080 8b 6c 24 0c mov ebp, DWORD PTR _uMaxBack$[esp+28]
00084 8b 7c 24 18 mov edi, DWORD PTR _uSizeFile$[esp+28]
00088 8b 44 24 10 mov eax, DWORD PTR _uBackRead$[esp+28]
$LN11@ziplocal_S:
; 465 : {
; 466 : uLong uReadSize,uReadPos ;
; 467 : int i;
; 468 : if (uBackRead+BUFREADCOMMENT>uMaxBack)
0008c 05 00 04 00 00 add eax, 1024 ; 00000400H
00091 3b c5 cmp eax, ebp
; 469 : uBackRead = uMaxBack;
00093 89 6c 24 10 mov DWORD PTR _uBackRead$[esp+28], ebp
00097 77 04 ja SHORT $LN8@ziplocal_S
; 470 : else
; 471 : uBackRead+=BUFREADCOMMENT;
00099 89 44 24 10 mov DWORD PTR _uBackRead$[esp+28], eax
$LN8@ziplocal_S:
; 472 : uReadPos = uSizeFile-uBackRead ;
0009d 8b ef mov ebp, edi
0009f 2b 6c 24 10 sub ebp, DWORD PTR _uBackRead$[esp+28]
; 473 :
; 474 : uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
; 475 : (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
000a3 8b c7 mov eax, edi
000a5 2b c5 sub eax, ebp
000a7 3d 04 04 00 00 cmp eax, 1028 ; 00000404H
000ac bf 04 04 00 00 mov edi, 1028 ; 00000404H
000b1 77 02 ja SHORT $LN18@ziplocal_S
000b3 8b f8 mov edi, eax
$LN18@ziplocal_S:
; 476 : if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
000b5 8b 4c 24 20 mov ecx, DWORD PTR _filestream$[esp+24]
000b9 8b 53 1c mov edx, DWORD PTR [ebx+28]
000bc 8b 43 10 mov eax, DWORD PTR [ebx+16]
000bf 6a 00 push 0
000c1 55 push ebp
000c2 51 push ecx
000c3 52 push edx
000c4 ff d0 call eax
000c6 83 c4 10 add esp, 16 ; 00000010H
000c9 85 c0 test eax, eax
000cb 75 5d jne SHORT $LN28@ziplocal_S
; 477 : break;
; 478 :
; 479 : if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
000cd 8b 4c 24 20 mov ecx, DWORD PTR _filestream$[esp+24]
000d1 8b 53 1c mov edx, DWORD PTR [ebx+28]
000d4 8b 43 04 mov eax, DWORD PTR [ebx+4]
000d7 57 push edi
000d8 56 push esi
000d9 51 push ecx
000da 52 push edx
000db ff d0 call eax
000dd 83 c4 10 add esp, 16 ; 00000010H
000e0 3b c7 cmp eax, edi
000e2 75 46 jne SHORT $LN28@ziplocal_S
; 480 : break;
; 481 :
; 482 : for (i=(int)uReadSize-3; (i--)>0;)
000e4 8d 47 fd lea eax, DWORD PTR [edi-3]
000e7 85 c0 test eax, eax
000e9 7e 31 jle SHORT $LN26@ziplocal_S
000eb eb 03 8d 49 00 npad 5
$LL5@ziplocal_S:
000f0 83 e8 01 sub eax, 1
; 483 : if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
; 484 : ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
000f3 80 3c 30 50 cmp BYTE PTR [eax+esi], 80 ; 00000050H
000f7 75 15 jne SHORT $LN3@ziplocal_S
000f9 80 7c 30 01 4b cmp BYTE PTR [eax+esi+1], 75 ; 0000004bH
000fe 75 0e jne SHORT $LN3@ziplocal_S
00100 80 7c 30 02 05 cmp BYTE PTR [eax+esi+2], 5
00105 75 07 jne SHORT $LN3@ziplocal_S
00107 80 7c 30 03 06 cmp BYTE PTR [eax+esi+3], 6
0010c 74 06 je SHORT $LN21@ziplocal_S
$LN3@ziplocal_S:
; 480 : break;
; 481 :
; 482 : for (i=(int)uReadSize-3; (i--)>0;)
0010e 85 c0 test eax, eax
00110 7f de jg SHORT $LL5@ziplocal_S
; 487 : break;
; 488 : }
; 489 :
; 490 : if (uPosFound!=0)
00112 eb 08 jmp SHORT $LN26@ziplocal_S
$LN21@ziplocal_S:
; 485 : {
; 486 : uPosFound = uReadPos+i;
00114 03 c5 add eax, ebp
00116 89 44 24 14 mov DWORD PTR _uPosFound$[esp+28], eax
; 487 : break;
; 488 : }
; 489 :
; 490 : if (uPosFound!=0)
0011a 75 0e jne SHORT $LN28@ziplocal_S
$LN26@ziplocal_S:
; 464 : while (uBackRead<uMaxBack)
0011c 8b 4c 24 0c mov ecx, DWORD PTR _uMaxBack$[esp+28]
00120 39 4c 24 10 cmp DWORD PTR _uBackRead$[esp+28], ecx
00124 0f 82 56 ff ff
ff jb $LL27@ziplocal_S
$LN28@ziplocal_S:
; 491 : break;
; 492 : }
; 493 : TRYFREE(buf);
0012a 56 push esi
0012b e8 00 00 00 00 call _free
; 494 : return uPosFound;
00130 8b 44 24 18 mov eax, DWORD PTR _uPosFound$[esp+32]
00134 83 c4 04 add esp, 4
00137 5f pop edi
00138 5e pop esi
00139 5d pop ebp
; 495 : }
0013a 83 c4 10 add esp, 16 ; 00000010H
0013d c3 ret 0
_ziplocal_SearchCentralDir ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _ziplocal_getByte
_TEXT SEGMENT
_c$ = -1 ; size = 1
_pi$ = 8 ; size = 4
_ziplocal_getByte PROC ; COMDAT
; _pzlib_filefunc_def$ = esi
; _filestream$ = edi
; 344 : {
00000 51 push ecx
; 345 : unsigned char c;
; 346 : int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
00001 8b 4e 1c mov ecx, DWORD PTR [esi+28]
00004 8b 56 04 mov edx, DWORD PTR [esi+4]
00007 6a 01 push 1
00009 8d 44 24 07 lea eax, DWORD PTR _c$[esp+8]
0000d 50 push eax
0000e 57 push edi
0000f 51 push ecx
00010 ff d2 call edx
00012 83 c4 10 add esp, 16 ; 00000010H
; 347 : if (err==1)
00015 83 f8 01 cmp eax, 1
00018 75 0f jne SHORT $LN4@ziplocal_g
; 348 : {
; 349 : *pi = (int)c;
0001a 0f b6 44 24 03 movzx eax, BYTE PTR _c$[esp+4]
0001f 8b 4c 24 08 mov ecx, DWORD PTR _pi$[esp]
00023 89 01 mov DWORD PTR [ecx], eax
; 350 : return ZIP_OK;
00025 33 c0 xor eax, eax
; 355 : return ZIP_ERRNO;
; 356 : else
; 357 : return ZIP_EOF;
; 358 : }
; 359 : }
00027 59 pop ecx
00028 c3 ret 0
$LN4@ziplocal_g:
; 351 : }
; 352 : else
; 353 : {
; 354 : if (ZERROR(*pzlib_filefunc_def,filestream))
00029 8b 56 1c mov edx, DWORD PTR [esi+28]
0002c 8b 46 18 mov eax, DWORD PTR [esi+24]
0002f 57 push edi
00030 52 push edx
00031 ff d0 call eax
00033 83 c4 08 add esp, 8
00036 f7 d8 neg eax
00038 1b c0 sbb eax, eax
; 355 : return ZIP_ERRNO;
; 356 : else
; 357 : return ZIP_EOF;
; 358 : }
; 359 : }
0003a 59 pop ecx
0003b c3 ret 0
_ziplocal_getByte ENDP
; Function compile flags: /Ogtpy
_TEXT ENDS
; COMDAT _ziplocal_TmzDateToDosDate
_TEXT SEGMENT
_ziplocal_TmzDateToDosDate PROC ; COMDAT
; _ptm$ = edx
; 322 : uLong year = (uLong)ptm->tm_year;
00000 8b 4a 14 mov ecx, DWORD PTR [edx+20]
; 323 : if (year>1980)
00003 81 f9 bc 07 00
00 cmp ecx, 1980 ; 000007bcH
00009 76 08 jbe SHORT $LN3@ziplocal_T
; 324 : year-=1980;
0000b 81 e9 bc 07 00
00 sub ecx, 1980 ; 000007bcH
00011 eb 08 jmp SHORT $LN1@ziplocal_T
$LN3@ziplocal_T:
; 325 : else if (year>80)
00013 83 f9 50 cmp ecx, 80 ; 00000050H
00016 76 03 jbe SHORT $LN1@ziplocal_T
; 326 : year-=80;
00018 83 e9 50 sub ecx, 80 ; 00000050H
$LN1@ziplocal_T:
; 327 : return
; 328 : (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) |
; 329 : ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
0001b 8b 42 08 mov eax, DWORD PTR [edx+8]
0001e c1 e0 06 shl eax, 6
00021 03 42 04 add eax, DWORD PTR [edx+4]
00024 56 push esi
00025 8b 32 mov esi, DWORD PTR [edx]
00027 d1 ee shr esi, 1
00029 c1 e0 05 shl eax, 5
0002c 03 c6 add eax, esi
0002e 8b 72 10 mov esi, DWORD PTR [edx+16]
00031 c1 e1 04 shl ecx, 4
00034 8d 4c 31 01 lea ecx, DWORD PTR [ecx+esi+1]
00038 c1 e1 05 shl ecx, 5
0003b 03 4a 0c add ecx, DWORD PTR [edx+12]
0003e 5e pop esi
0003f c1 e1 10 shl ecx, 16 ; 00000010H
00042 0b c1 or eax, ecx
; 330 : }
00044 c3 ret 0
_ziplocal_TmzDateToDosDate ENDP
_TEXT ENDS
EXTRN _memset:PROC
; Function compile flags: /Ogtpy
; COMDAT _ziplocal_putValue_inmemory
_TEXT SEGMENT
_ziplocal_putValue_inmemory PROC ; COMDAT
; _dest$ = esi
; _x$ = ecx
; _nbByte$ = edx
; 299 : unsigned char* buf=(unsigned char*)dest;
; 300 : int n;
; 301 : for (n = 0; n < nbByte; n++) {
00000 33 c0 xor eax, eax
00002 85 d2 test edx, edx
00004 7e 0d jle SHORT $LN5@ziplocal_p
$LL7@ziplocal_p:
; 302 : buf[n] = (unsigned char)(x & 0xff);
00006 88 0c 30 mov BYTE PTR [eax+esi], cl
00009 83 c0 01 add eax, 1
; 303 : x >>= 8;
0000c c1 e9 08 shr ecx, 8
0000f 3b c2 cmp eax, edx
00011 7c f3 jl SHORT $LL7@ziplocal_p
$LN5@ziplocal_p:
; 304 : }
; 305 :
; 306 : if (x != 0)
00013 85 c9 test ecx, ecx
00015 74 13 je SHORT $LN3@ziplocal_p
; 307 : { /* data overflow - hack for ZIP64 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -