📄 inftrees.cod
字号:
000e8 66 83 7c 74 50
00 cmp WORD PTR _count$[esp+esi*2+144], 0
000ee 75 19 jne SHORT $LN100@inflate_ta
000f0 83 c6 05 add esi, 5
000f3 83 fe 0f cmp esi, 15 ; 0000000fH
000f6 76 d0 jbe SHORT $LL52@inflate_ta
000f8 eb 12 jmp SHORT $LN82@inflate_ta
$LN97@inflate_ta:
000fa 83 c6 01 add esi, 1
000fd eb 0d jmp SHORT $LN82@inflate_ta
$LN98@inflate_ta:
000ff 83 c6 02 add esi, 2
00102 eb 08 jmp SHORT $LN82@inflate_ta
$LN99@inflate_ta:
00104 83 c6 03 add esi, 3
00107 eb 03 jmp SHORT $LN82@inflate_ta
$LN100@inflate_ta:
00109 83 c6 04 add esi, 4
$LN82@inflate_ta:
; 128 : if (root < min) root = min;
0010c 3b c6 cmp eax, esi
0010e 73 04 jae SHORT $LN48@inflate_ta
00110 89 74 24 10 mov DWORD PTR _root$[esp+136], esi
$LN48@inflate_ta:
; 129 :
; 130 : /* check for an over-subscribed or incomplete set of lengths */
; 131 : left = 1;
00114 ba 01 00 00 00 mov edx, 1
; 132 : for (len = 1; len <= MAXBITS; len++) {
00119 8b c2 mov eax, edx
0011b 57 push edi
0011c 8d 64 24 00 npad 4
$LL47@inflate_ta:
; 133 : left <<= 1;
; 134 : left -= count[len];
00120 0f b7 7c 44 4c movzx edi, WORD PTR _count$[esp+eax*2+140]
00125 03 d2 add edx, edx
00127 2b d7 sub edx, edi
; 135 : if (left < 0) return -1; /* over-subscribed */
00129 78 1b js SHORT $LN42@inflate_ta
0012b 83 c0 01 add eax, 1
0012e 83 f8 0f cmp eax, 15 ; 0000000fH
00131 76 ed jbe SHORT $LL47@inflate_ta
; 136 : }
; 137 : if (left > 0 && (type == CODES || max != 1))
00133 85 d2 test edx, edx
00135 7e 1a jle SHORT $LN122@inflate_ta
00137 83 bc 24 90 00
00 00 00 cmp DWORD PTR _type$[esp+136], 0
0013f 74 05 je SHORT $LN42@inflate_ta
00141 83 f9 01 cmp ecx, 1
00144 74 0b je SHORT $LN122@inflate_ta
$LN42@inflate_ta:
00146 5f pop edi
00147 5e pop esi
00148 5d pop ebp
; 138 : return -1; /* incomplete set */
00149 83 c8 ff or eax, -1
0014c 5b pop ebx
; 329 : }
0014d 83 c4 7c add esp, 124 ; 0000007cH
00150 c3 ret 0
$LN122@inflate_ta:
; 139 :
; 140 : /* generate offsets into symbol table for each length for sorting */
; 141 : offs[1] = 0;
00151 66 c7 44 24 6e
00 00 mov WORD PTR _offs$[esp+142], 0
; 142 : for (len = 1; len < MAXBITS; len++)
00158 b8 02 00 00 00 mov eax, 2
0015d 8d 49 00 npad 3
$LL41@inflate_ta:
; 143 : offs[len + 1] = offs[len] + count[len];
00160 66 8b 4c 04 6c mov cx, WORD PTR _offs$[esp+eax+140]
00165 66 03 4c 04 4c add cx, WORD PTR _count$[esp+eax+140]
0016a 83 c0 02 add eax, 2
0016d 83 f8 1e cmp eax, 30 ; 0000001eH
00170 66 89 4c 04 6c mov WORD PTR _offs$[esp+eax+140], cx
00175 72 e9 jb SHORT $LL41@inflate_ta
; 144 :
; 145 : /* sort symbols by length, by symbol order within each length */
; 146 : for (sym = 0; sym < codes; sym++)
00177 8b 8c 24 98 00
00 00 mov ecx, DWORD PTR _codes$[esp+136]
0017e 8b bc 24 a4 00
00 00 mov edi, DWORD PTR _work$[esp+136]
00185 33 c0 xor eax, eax
00187 85 c9 test ecx, ecx
00189 76 31 jbe SHORT $LN36@inflate_ta
0018b eb 03 8d 49 00 npad 5
$LL38@inflate_ta:
; 147 : if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
00190 66 83 7c 45 00
00 cmp WORD PTR [ebp+eax*2], 0
00196 74 1d je SHORT $LN37@inflate_ta
00198 0f b7 54 45 00 movzx edx, WORD PTR [ebp+eax*2]
0019d 0f b7 54 54 6c movzx edx, WORD PTR _offs$[esp+edx*2+140]
001a2 66 89 04 57 mov WORD PTR [edi+edx*2], ax
001a6 0f b7 54 45 00 movzx edx, WORD PTR [ebp+eax*2]
001ab 66 83 44 54 6c
01 add WORD PTR _offs$[esp+edx*2+140], 1
001b1 8d 54 54 6c lea edx, DWORD PTR _offs$[esp+edx*2+140]
$LN37@inflate_ta:
001b5 83 c0 01 add eax, 1
001b8 3b c1 cmp eax, ecx
001ba 72 d4 jb SHORT $LL38@inflate_ta
$LN36@inflate_ta:
; 148 :
; 149 : /*
; 150 : Create and fill in decoding tables. In this loop, the table being
; 151 : filled is at next and has curr index bits. The code being used is huff
; 152 : with length len. That code is converted to an index by dropping drop
; 153 : bits off of the bottom. For codes where len is less than drop + curr,
; 154 : those top drop + curr - len bits are incremented through all values to
; 155 : fill the table with replicated entries.
; 156 :
; 157 : root is the number of index bits for the root table. When len exceeds
; 158 : root, sub-tables are created pointed to by the root entry with an index
; 159 : of the low root bits of huff. This is saved in low to check for when a
; 160 : new sub-table should be started. drop is zero when the root table is
; 161 : being filled, and drop is root when sub-tables are being filled.
; 162 :
; 163 : When a new sub-table is needed, it is necessary to look ahead in the
; 164 : code lengths to determine what size sub-table is needed. The length
; 165 : counts are used for this, and so count[] is decremented as codes are
; 166 : entered in the tables.
; 167 :
; 168 : used keeps track of how many table entries have been allocated from the
; 169 : provided *table space. It is checked when a LENS table is being made
; 170 : against the space in *table, ENOUGH, minus the maximum space needed by
; 171 : the worst case distance code, MAXD. This should never happen, but the
; 172 : sufficiency of ENOUGH has not been proven exhaustively, hence the check.
; 173 : This assumes that when type == LENS, bits == 9.
; 174 :
; 175 : sym increments through all symbols, and the loop terminates when
; 176 : all codes of length max, i.e. all codes, have been processed. This
; 177 : routine permits incomplete codes, so another loop after this one fills
; 178 : in the rest of the decoding tables with invalid code markers.
; 179 : */
; 180 :
; 181 : /* set up for code type */
; 182 : switch (type) {
001bc 8b 94 24 90 00
00 00 mov edx, DWORD PTR _type$[esp+136]
001c3 8b c2 mov eax, edx
001c5 83 e8 00 sub eax, 0
001c8 b9 ff ff ff ff mov ecx, -1
001cd 74 41 je SHORT $LN32@inflate_ta
001cf 83 e8 01 sub eax, 1
001d2 74 16 je SHORT $LN31@inflate_ta
; 194 : default: /* DISTS */
; 195 : base = dbase;
001d4 c7 44 24 34 00
00 00 00 mov DWORD PTR _base$[esp+140], OFFSET ?dbase@?1??inflate_table@@9@9
; 196 : extra = dext;
001dc c7 44 24 30 00
00 00 00 mov DWORD PTR _extra$[esp+140], OFFSET ?dext@?1??inflate_table@@9@9
; 197 : end = -1;
001e4 89 4c 24 2c mov DWORD PTR _end$[esp+140], ecx
001e8 eb 36 jmp SHORT $LN33@inflate_ta
$LN31@inflate_ta:
; 186 : break;
; 187 : case LENS:
; 188 : base = lbase;
; 189 : base -= 257;
001ea b8 00 00 00 00 mov eax, OFFSET ?lbase@?1??inflate_table@@9@9
001ef 2d 02 02 00 00 sub eax, 514 ; 00000202H
001f4 89 44 24 34 mov DWORD PTR _base$[esp+140], eax
; 190 : extra = lext;
; 191 : extra -= 257;
001f8 b8 00 00 00 00 mov eax, OFFSET ?lext@?1??inflate_table@@9@9
001fd 2d 02 02 00 00 sub eax, 514 ; 00000202H
00202 89 44 24 30 mov DWORD PTR _extra$[esp+140], eax
; 192 : end = 256;
00206 c7 44 24 2c 00
01 00 00 mov DWORD PTR _end$[esp+140], 256 ; 00000100H
; 193 : break;
0020e eb 10 jmp SHORT $LN33@inflate_ta
$LN32@inflate_ta:
; 183 : case CODES:
; 184 : base = extra = work; /* dummy value--not used */
00210 89 7c 24 30 mov DWORD PTR _extra$[esp+140], edi
00214 89 7c 24 34 mov DWORD PTR _base$[esp+140], edi
; 185 : end = 19;
00218 c7 44 24 2c 13
00 00 00 mov DWORD PTR _end$[esp+140], 19 ; 00000013H
$LN33@inflate_ta:
; 198 : }
; 199 :
; 200 : /* initialize state for loop */
; 201 : huff = 0; /* starting code */
; 202 : sym = 0; /* starting code symbol */
; 203 : len = min; /* starting code length */
; 204 : next = *table; /* current table to fill in */
00220 8b 03 mov eax, DWORD PTR [ebx]
00222 89 44 24 20 mov DWORD PTR _next$[esp+140], eax
; 205 : curr = root; /* current table index bits */
; 206 : drop = 0; /* current bits to drop from code for index */
; 207 : low = (unsigned)(-1); /* trigger new sub-table when len > root */
00226 89 4c 24 38 mov DWORD PTR _low$[esp+140], ecx
; 208 : used = 1U << root; /* use root table entries */
0022a 8b 4c 24 14 mov ecx, DWORD PTR _root$[esp+140]
0022e b8 01 00 00 00 mov eax, 1
00233 d3 e0 shl eax, cl
00235 33 ed xor ebp, ebp
00237 33 db xor ebx, ebx
; 209 : mask = used - 1; /* mask for comparing low */
; 210 :
; 211 : /* check available table space */
; 212 : if (type == LENS && used >= ENOUGH - MAXD)
00239 83 fa 01 cmp edx, 1
0023c 8d 48 ff lea ecx, DWORD PTR [eax-1]
0023f 89 74 24 18 mov DWORD PTR _len$[esp+140], esi
00243 89 44 24 3c mov DWORD PTR tv635[esp+140], eax
00247 89 44 24 28 mov DWORD PTR _used$[esp+140], eax
0024b 89 4c 24 40 mov DWORD PTR _mask$[esp+140], ecx
0024f 75 0b jne SHORT $LN108@inflate_ta
00251 3d b0 05 00 00 cmp eax, 1456 ; 000005b0H
; 213 : return 1;
00256 0f 83 5d 02 00
00 jae $LN86@inflate_ta
$LN108@inflate_ta:
; 214 :
; 215 : /* process all codes and make table entries */
; 216 : for (;;) {
; 217 : /* create table entry */
; 218 : this.bits = (unsigned char)(len - drop);
0025c 89 7c 24 24 mov DWORD PTR tv1307[esp+140], edi
$LL28@inflate_ta:
; 219 : if ((int)(work[sym]) < end) {
00260 8b 74 24 24 mov esi, DWORD PTR tv1307[esp+140]
00264 8a 54 24 18 mov dl, BYTE PTR _len$[esp+140]
00268 0f b7 06 movzx eax, WORD PTR [esi]
0026b 2a d3 sub dl, bl
0026d 0f b7 c8 movzx ecx, ax
00270 88 54 24 11 mov BYTE PTR _this$[esp+141], dl
00274 8b 54 24 2c mov edx, DWORD PTR _end$[esp+140]
00278 3b ca cmp ecx, edx
0027a 7d 0c jge SHORT $LN126@inflate_ta
; 220 : this.op = (unsigned char)0;
0027c c6 44 24 10 00 mov BYTE PTR _this$[esp+140], 0
; 221 : this.val = work[sym];
00281 66 89 44 24 12 mov WORD PTR _this$[esp+142], ax
00286 eb 2d jmp SHORT $LN23@inflate_ta
$LN126@inflate_ta:
; 222 : }
; 223 : else if ((int)(work[sym]) > end) {
00288 7e 1f jle SHORT $LN24@inflate_ta
; 224 : this.op = (unsigned char)(extra[work[sym]]);
0028a 0f b7 06 movzx eax, WORD PTR [esi]
0028d 8b 4c 24 30 mov ecx, DWORD PTR _extra$[esp+140]
00291 03 c0 add eax, eax
00293 8a 14 08 mov dl, BYTE PTR [eax+ecx]
; 225 : this.val = base[work[sym]];
00296 8b 4c 24 34 mov ecx, DWORD PTR _base$[esp+140]
0029a 88 54 24 10 mov BYTE PTR _this$[esp+140], dl
0029e 66 8b 14 08 mov dx, WORD PTR [eax+ecx]
002a2 66 89 54 24 12 mov WORD PTR _this$[esp+142], dx
; 226 : }
; 227 : else {
002a7 eb 0c jmp SHORT $LN23@inflate_ta
$LN24@inflate_ta:
; 228 : this.op = (unsigned char)(32 + 64); /* end of block */
002a9 c6 44 24 10 60 mov BYTE PTR _this$[esp+140], 96 ; 00000060H
; 229 : this.val = 0;
002ae 66 c7 44 24 12
00 00 mov WORD PTR _this$[esp+142], 0
$LN23@inflate_ta:
; 230 : }
; 231 :
; 232 : /* replicate for those indices with low len bits equal to huff */
; 233 : incr = 1U << (len - drop);
002b5 8b 4c 24 18 mov ecx, DWORD PTR _len$[esp+140]
; 234 : fill = 1U << curr;
002b9 8b 44 24 3c mov eax, DWORD PTR tv635[esp+140]
002bd 2b cb sub ecx, ebx
002bf ba 01 00 00 00 mov edx, 1
002c4 d3 e2 shl edx, cl
002c6 8b cb mov ecx, ebx
002c8 8b fd mov edi, ebp
002ca d3 ef shr edi, cl
002cc 8b 4c 24 20 mov ecx, DWORD PTR _next$[esp+140]
; 235 : min = fill; /* save offset to next table */
002d0 89 44 24 44 mov DWORD PTR _min$[esp+140], eax
002d4 8d 34 95 00 00
00 00 lea esi, DWORD PTR [edx*4]
002db 03 f8 add edi, eax
002dd 8d 0c b9 lea ecx, DWORD PTR [ecx+edi*4]
002e0 8b 7c 24 10 mov edi, DWORD PTR _this$[esp+140]
$LL22@inflate_ta:
; 236 : do {
; 237 : fill -= incr;
002e4 2b c2 sub eax, edx
002e6 2b ce sub ecx, esi
; 238 : next[(huff >> drop) + fill] = this;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -