📄 zip.cod
字号:
; 993 : }
; 994 :
; 995 :
; 996 : if(err != ZIP_OK)
00069 85 ed test ebp, ebp
0006b 75 29 jne SHORT $LN19@zipWriteIn
; 997 : break;
; 998 :
; 999 : if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
0006d 83 bb 80 00 00
00 08 cmp DWORD PTR [ebx+128], 8
00074 75 29 jne SHORT $LN7@zipWriteIn
00076 39 ab 84 00 00
00 cmp DWORD PTR [ebx+132], ebp
0007c 75 21 jne SHORT $LN7@zipWriteIn
; 1000 : {
; 1001 : uLong uTotalOutBefore = zi->ci.stream.total_out;
0007e 8b 73 44 mov esi, DWORD PTR [ebx+68]
; 1002 : err=deflate(&zi->ci.stream, Z_NO_FLUSH);
00081 55 push ebp
00082 57 push edi
00083 e8 00 00 00 00 call _deflate@8
; 1003 : zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
00088 8b 53 44 mov edx, DWORD PTR [ebx+68]
0008b 2b d6 sub edx, esi
0008d 01 53 6c add DWORD PTR [ebx+108], edx
00090 8b e8 mov ebp, eax
00092 85 ed test ebp, ebp
00094 74 ab je SHORT $LL12@zipWriteIn
$LN19@zipWriteIn:
00096 5f pop edi
00097 5e pop esi
; 1024 : }
; 1025 : }
; 1026 : }
; 1027 :
; 1028 : return err;
00098 8b c5 mov eax, ebp
0009a 5d pop ebp
0009b 5b pop ebx
; 1029 : }
0009c c2 0c 00 ret 12 ; 0000000cH
$LN7@zipWriteIn:
0009f 8b 43 40 mov eax, DWORD PTR [ebx+64]
000a2 8b 73 34 mov esi, DWORD PTR [ebx+52]
000a5 3b f0 cmp esi, eax
000a7 72 02 jb SHORT $LN4@zipWriteIn
; 1004 :
; 1005 : }
; 1006 : else
; 1007 : {
; 1008 : uInt copy_this,i;
; 1009 : if (zi->ci.stream.avail_in < zi->ci.stream.avail_out)
; 1010 : copy_this = zi->ci.stream.avail_in;
; 1011 : else
; 1012 : copy_this = zi->ci.stream.avail_out;
000a9 8b f0 mov esi, eax
$LN4@zipWriteIn:
; 1013 : for (i=0;i<copy_this;i++)
000ab 33 c0 xor eax, eax
000ad 85 f6 test esi, esi
000af 76 12 jbe SHORT $LN1@zipWriteIn
$LL3@zipWriteIn:
; 1014 : *(((char*)zi->ci.stream.next_out)+i) =
; 1015 : *(((const char*)zi->ci.stream.next_in)+i);
000b1 8b 0f mov ecx, DWORD PTR [edi]
000b3 8a 0c 08 mov cl, BYTE PTR [eax+ecx]
000b6 8b 53 3c mov edx, DWORD PTR [ebx+60]
000b9 88 0c 10 mov BYTE PTR [eax+edx], cl
000bc 83 c0 01 add eax, 1
000bf 3b c6 cmp eax, esi
000c1 72 ee jb SHORT $LL3@zipWriteIn
$LN1@zipWriteIn:
; 1016 : {
; 1017 : zi->ci.stream.avail_in -= copy_this;
000c3 29 73 34 sub DWORD PTR [ebx+52], esi
; 1018 : zi->ci.stream.avail_out-= copy_this;
000c6 29 73 40 sub DWORD PTR [ebx+64], esi
; 1019 : zi->ci.stream.next_in+= copy_this;
000c9 01 37 add DWORD PTR [edi], esi
; 1020 : zi->ci.stream.next_out+= copy_this;
000cb 01 73 3c add DWORD PTR [ebx+60], esi
; 1021 : zi->ci.stream.total_in+= copy_this;
000ce 01 73 38 add DWORD PTR [ebx+56], esi
; 1022 : zi->ci.stream.total_out+= copy_this;
000d1 01 73 44 add DWORD PTR [ebx+68], esi
; 1023 : zi->ci.pos_in_buffered_data += copy_this;
000d4 01 73 6c add DWORD PTR [ebx+108], esi
000d7 e9 65 ff ff ff jmp $LL12@zipWriteIn
_zipWriteInFileInZip@12 ENDP
_TEXT ENDS
PUBLIC _zipOpen2@16
EXTRN __chkstk:PROC
; Function compile flags: /Ogtpy
; COMDAT _zipOpen2@16
_TEXT SEGMENT
_err$ = -16592 ; size = 4
_byte_before_the_zipfile$80705 = -16588 ; size = 4
_size_central_dir$80706 = -16588 ; size = 4
_number_disk$80710 = -16588 ; size = 4
_uL$80709 = -16588 ; size = 4
_offset_central_dir$80707 = -16584 ; size = 4
_number_entry$80712 = -16584 ; size = 4
tv318 = -16580 ; size = 4
_size_comment$80714 = -16580 ; size = 4
_number_disk_with_CD$80711 = -16580 ; size = 4
_zi$ = -16576 ; size = 4
_number_entry_CD$80713 = -16572 ; size = 4
_ziinit$ = -16568 ; size = 16568
_pathname$ = 8 ; size = 4
_append$ = 12 ; size = 4
_globalcomment$ = 16 ; size = 4
_pzlib_filefunc_def$ = 20 ; size = 4
_zipOpen2@16 PROC ; COMDAT
; 504 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 83 e4 f8 and esp, -8 ; fffffff8H
00006 b8 d4 40 00 00 mov eax, 16596 ; 000040d4H
0000b e8 00 00 00 00 call __chkstk
00010 53 push ebx
00011 56 push esi
; 505 : zip_internal ziinit;
; 506 : zip_internal* zi;
; 507 : int err=ZIP_OK;
; 508 :
; 509 :
; 510 : if (pzlib_filefunc_def==NULL)
00012 8b 75 14 mov esi, DWORD PTR _pzlib_filefunc_def$[ebp]
00015 33 db xor ebx, ebx
00017 3b f3 cmp esi, ebx
00019 57 push edi
0001a 89 5c 24 10 mov DWORD PTR _err$[esp+16608], ebx
0001e 75 0b jne SHORT $LN34@zipOpen2
; 511 : fill_fopen_filefunc(&ziinit.z_filefunc);
00020 8d 44 24 28 lea eax, DWORD PTR _ziinit$[esp+16608]
00024 e8 00 00 00 00 call _fill_fopen_filefunc
; 512 : else
00029 eb 0b jmp SHORT $LN33@zipOpen2
$LN34@zipOpen2:
; 513 : ziinit.z_filefunc = *pzlib_filefunc_def;
0002b b9 08 00 00 00 mov ecx, 8
00030 8d 7c 24 28 lea edi, DWORD PTR _ziinit$[esp+16608]
00034 f3 a5 rep movsd
$LN33@zipOpen2:
; 514 :
; 515 : ziinit.filestream = (*(ziinit.z_filefunc.zopen_file))
; 516 : (ziinit.z_filefunc.opaque,
; 517 : pathname,
; 518 : (append == APPEND_STATUS_CREATE) ?
; 519 : (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) :
; 520 : (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING));
00036 8b 7d 0c mov edi, DWORD PTR _append$[ebp]
00039 8b 4d 08 mov ecx, DWORD PTR _pathname$[ebp]
0003c 8b 74 24 44 mov esi, DWORD PTR _ziinit$[esp+16636]
00040 33 c0 xor eax, eax
00042 3b fb cmp edi, ebx
00044 0f 94 c0 sete al
00047 8d 04 85 07 00
00 00 lea eax, DWORD PTR [eax*4+7]
0004e 50 push eax
0004f 51 push ecx
00050 56 push esi
00051 ff 54 24 34 call DWORD PTR _ziinit$[esp+16620]
00055 83 c4 0c add esp, 12 ; 0000000cH
; 521 :
; 522 : if (ziinit.filestream == NULL)
00058 3b c3 cmp eax, ebx
0005a 89 44 24 48 mov DWORD PTR _ziinit$[esp+16640], eax
; 523 : return NULL;
0005e 74 58 je SHORT $LN54@zipOpen2
; 524 : ziinit.begin_pos = ZTELL(ziinit.z_filefunc,ziinit.filestream);
00060 50 push eax
00061 56 push esi
00062 ff 54 24 3c call DWORD PTR _ziinit$[esp+16628]
00066 89 84 24 d8 40
00 00 mov DWORD PTR _ziinit$[esp+33168], eax
; 525 : ziinit.in_opened_file_inzip = 0;
; 526 : ziinit.ci.stream_initialised = 0;
; 527 : ziinit.number_entry = 0;
; 528 : ziinit.add_position_when_writting_offset = 0;
; 529 : init_linkedlist(&(ziinit.central_dir));
0006d 8d 44 24 54 lea eax, DWORD PTR _ziinit$[esp+16652]
00071 89 5c 24 5c mov DWORD PTR _ziinit$[esp+16660], ebx
00075 89 9c 24 98 00
00 00 mov DWORD PTR _ziinit$[esp+16720], ebx
0007c 89 9c 24 e0 40
00 00 mov DWORD PTR _ziinit$[esp+33176], ebx
00083 89 9c 24 dc 40
00 00 mov DWORD PTR _ziinit$[esp+33172], ebx
0008a e8 00 00 00 00 call _init_linkedlist
; 530 :
; 531 :
; 532 : zi = (zip_internal*)ALLOC(sizeof(zip_internal));
0008f 68 b8 40 00 00 push 16568 ; 000040b8H
00094 ff 15 00 00 00
00 call DWORD PTR __imp__malloc
0009a 8b f0 mov esi, eax
0009c 83 c4 0c add esp, 12 ; 0000000cH
; 533 : if (zi==NULL)
0009f 3b f3 cmp esi, ebx
000a1 89 74 24 20 mov DWORD PTR _zi$[esp+16608], esi
000a5 75 1c jne SHORT $LN31@zipOpen2
; 534 : {
; 535 : ZCLOSE(ziinit.z_filefunc,ziinit.filestream);
000a7 8b 54 24 48 mov edx, DWORD PTR _ziinit$[esp+16640]
000ab 8b 44 24 44 mov eax, DWORD PTR _ziinit$[esp+16636]
000af 52 push edx
000b0 50 push eax
000b1 ff 54 24 44 call DWORD PTR _ziinit$[esp+16636]
000b5 83 c4 08 add esp, 8
$LN54@zipOpen2:
; 536 : return NULL;
000b8 33 c0 xor eax, eax
; 679 : return (zipFile)zi;
; 680 : }
; 681 : }
000ba 5f pop edi
000bb 5e pop esi
000bc 5b pop ebx
000bd 8b e5 mov esp, ebp
000bf 5d pop ebp
000c0 c2 10 00 ret 16 ; 00000010H
$LN31@zipOpen2:
; 537 : }
; 538 :
; 539 : /* now we add file in a zipfile */
; 540 : # ifndef NO_ADDFILEINEXISTINGZIP
; 541 : ziinit.globalcomment = NULL;
000c3 33 c0 xor eax, eax
; 542 : if (append == APPEND_STATUS_ADDINZIP)
000c5 83 ff 02 cmp edi, 2
000c8 89 84 24 dc 40
00 00 mov DWORD PTR _ziinit$[esp+33172], eax
000cf 0f 85 9b 02 00
00 jne $LN6@zipOpen2
; 543 : {
; 544 : uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
; 545 :
; 546 : uLong size_central_dir; /* size of the central directory */
; 547 : uLong offset_central_dir; /* offset of start of central directory */
; 548 : uLong central_pos,uL;
; 549 :
; 550 : uLong number_disk; /* number of the current dist, used for
; 551 : spaning ZIP, unsupported, always 0*/
; 552 : uLong number_disk_with_CD; /* number the the disk with central dir, used
; 553 : for spaning ZIP, unsupported, always 0*/
; 554 : uLong number_entry;
; 555 : uLong number_entry_CD; /* total number of entries in
; 556 : the central dir
; 557 : (same than number_entry on nospan) */
; 558 : uLong size_comment;
; 559 :
; 560 : central_pos = ziplocal_SearchCentralDir(&ziinit.z_filefunc,ziinit.filestream);
000d5 8b 4c 24 48 mov ecx, DWORD PTR _ziinit$[esp+16640]
000d9 51 push ecx
000da 8d 5c 24 2c lea ebx, DWORD PTR _ziinit$[esp+16612]
000de e8 00 00 00 00 call _ziplocal_SearchCentralDir
000e3 8b f0 mov esi, eax
000e5 83 c4 04 add esp, 4
; 561 : if (central_pos==0)
; 562 : err=ZIP_ERRNO;
000e8 83 cf ff or edi, -1
000eb 85 f6 test esi, esi
000ed 75 04 jne SHORT $LN29@zipOpen2
000ef 89 7c 24 10 mov DWORD PTR _err$[esp+16608], edi
$LN29@zipOpen2:
; 563 :
; 564 : if (ZSEEK(ziinit.z_filefunc, ziinit.filestream,
; 565 : central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
000f3 8b 5c 24 48 mov ebx, DWORD PTR _ziinit$[esp+16640]
000f7 8b 54 24 44 mov edx, DWORD PTR _ziinit$[esp+16636]
000fb 6a 00 push 0
000fd 56 push esi
000fe 53 push ebx
000ff 52 push edx
00100 ff 54 24 48 call DWORD PTR _ziinit$[esp+16640]
00104 83 c4 10 add esp, 16 ; 00000010H
00107 85 c0 test eax, eax
00109 74 04 je SHORT $LN28@zipOpen2
; 566 : err=ZIP_ERRNO;
0010b 89 7c 24 10 mov DWORD PTR _err$[esp+16608], edi
$LN28@zipOpen2:
; 567 :
; 568 : /* the signature, already checked */
; 569 : if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&uL)!=ZIP_OK)
0010f 8d 44 24 14 lea eax, DWORD PTR _uL$80709[esp+16608]
00113 50 push eax
00114 8b c3 mov eax, ebx
00116 8d 4c 24 2c lea ecx, DWORD PTR _ziinit$[esp+16612]
0011a e8 00 00 00 00 call _ziplocal_getLong
0011f 83 c4 04 add esp, 4
00122 85 c0 test eax, eax
00124 74 04 je SHORT $LN27@zipOpen2
; 570 : err=ZIP_ERRNO;
00126 89 7c 24 10 mov DWORD PTR _err$[esp+16608], edi
$LN27@zipOpen2:
; 571 :
; 572 : /* number of this disk */
; 573 : if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk)!=ZIP_OK)
0012a 8b 44 24 48 mov eax, DWORD PTR _ziinit$[esp+16640]
0012e 8d 4c 24 14 lea ecx, DWORD PTR _number_disk$80710[esp+16608]
00132 51 push ecx
00133 8d 4c 24 2c lea ecx, DWORD PTR _ziinit$[esp+16612]
00137 e8 00 00 00 00 call _ziplocal_getShort
0013c 83 c4 04 add esp, 4
0013f 85 c0 test eax, eax
00141 74 04 je SHORT $LN26@zipOpen2
; 574 : err=ZIP_ERRNO;
00143 89 7c 24 10 mov DWORD PTR _err$[esp+16608], edi
$LN26@zipOpen2:
; 575 :
; 576 : /* number of the disk with the start of the central directory */
; 577 : if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk_with_CD)!=ZIP_OK)
00147 8b 44 24 48 mov eax, DWORD PTR _ziinit$[esp+16640]
0014b 8d 54 24 1c lea edx, DWORD PTR _number_disk_with_CD$80711[esp+16608]
0014f 52 push edx
00150 8d 4c 24 2c lea ecx, DWORD PTR _ziinit$[esp+16612]
00154 e8 00 00 00 00 call _ziplocal_getShort
00159 83 c4 04 add esp, 4
0015c 85 c0 test eax, eax
0015e 74 04 je SHORT $LN25@zipOpen2
; 578 : err=ZIP_ERRNO;
00160 89 7c 24 10 mov DWORD PTR _err$[esp+16608], edi
$LN25@zipOpen2:
; 579 :
; 580 : /* total number of entries in the central dir on this disk */
; 581 : if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry)!=ZIP_OK)
00164 8d 44 24 18 lea eax, DWORD PTR _number_entry$80712[esp+16608]
00168 50 push eax
00169 8b 44 24 4c mov eax, DWORD PTR _ziinit$[esp+16644]
0016d 8d 4c 24 2c lea ecx, DWORD PTR _ziinit$[esp+16612]
00171 e8 00 00 00 00 call _ziplocal_getShort
00176 83 c4 04 add esp, 4
00179 85 c0 test eax, eax
0017b 74 04 je SHORT $LN24@zipOpen2
; 582 : err=ZIP_ERRNO;
0017d 89 7c 24 10 mov DWORD PTR _err$[esp+16608], edi
$LN24@zipOpen2:
; 583 :
; 584 : /* total number of entries in the central dir */
; 585 : if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry_CD)!=ZIP_OK)
00181 8b 44 24 48 mov eax, DWORD PTR _ziinit$[esp+16640]
00185 8d 4c 24 24 lea ecx, DWORD PTR _number_entry_CD$80713[esp+16608]
00189 51 push ecx
0018a 8d 4c 24 2c lea ecx, DWORD PTR _ziinit$[esp+16612]
0018e e8 00 00 00 00 call _ziplocal_getShort
00193 83 c4 04 add esp, 4
00196 85 c0 test eax, eax
00198 74 04 je SHORT $LN23@zipOpen2
; 586 : err=ZIP_ERRNO;
0019a 89 7c 24 10 mov DWORD PTR _err$[esp+16608], edi
$LN23@zipOpen2:
; 587 :
; 588 : if ((number_entry_CD!=number_entry) ||
; 589 : (number_disk_with_CD!=0) ||
; 590 : (number_disk!=0))
0019e 8b 54 24 24 mov edx, DWORD PTR _number_entry_CD$80713[esp+16608]
001a2 3b 54 24 18 cmp edx, DWORD PTR _number_entry$80712[esp+16608]
001a6 75 0e jne SHORT $LN21@zipOpen2
001a8 83 7c 24 1c 00 cmp DWORD PTR _number_disk_with_CD$80711[esp+16608], 0
001ad 75 07 jne SHORT $LN21@zipOp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -