Rev 1148 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1148 | Rev 6673 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; |
1 | ; |
2 | ; project name: KFar_Arc - plugin for KFar, which supports various archives |
2 | ; project name: KFar_Arc - plugin for KFar, which supports various archives |
3 | ; target platform: KolibriOS |
3 | ; target platform: KolibriOS |
4 | ; compiler: FASM 1.67.14 |
4 | ; compiler: FASM 1.67.14 |
5 | ; version: 0.17 |
5 | ; version: 0.17 |
6 | ; last update: 2009-09-03 (Sep 03, 2009) |
6 | ; last update: 2016-11-04 (Nov 04, 2016) |
7 | ; minimal KFar version: 0.43 |
7 | ; minimal KFar version: 0.43 |
8 | ; minimal kernel: no limit |
8 | ; minimal kernel: no limit |
9 | ; |
9 | ; |
10 | ; author: Diamond |
10 | ; author: Diamond |
11 | ; email: diamondz@land.ru |
11 | ; email: diamondz@land.ru |
Line 30... | Line 30... | ||
30 | include 'ppmd.inc' ; PPMD-decoder for *.7z |
30 | include 'ppmd.inc' ; PPMD-decoder for *.7z |
31 | include '7zbranch.inc' ; branch filters for *.7z |
31 | include '7zbranch.inc' ; branch filters for *.7z |
32 | include '7zaes.inc' ; AES cryptor for *.7z |
32 | include '7zaes.inc' ; AES cryptor for *.7z |
33 | include 'zip.inc' ; *.zip |
33 | include 'zip.inc' ; *.zip |
34 | include 'deflate.inc' ; Deflate[64] decoder for *.7z and *.zip |
34 | include 'deflate.inc' ; Deflate[64] decoder for *.7z and *.zip |
- | 35 | include '../zlib/zlib.asm' ; deflate coder |
|
Line 35... | Line 36... | ||
35 | 36 | ||
36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
37 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
37 | ;;;;;;;;;;;;;;; Interface for KFar ;;;;;;;;;;;;;; |
38 | ;;;;;;;;;;;;;;; Interface for KFar ;;;;;;;;;;;;;; |
38 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
39 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 1240... | Line 1241... | ||
1240 | mov [_ebp], ebp |
1241 | mov [_ebp], ebp |
1241 | mov [error_proc], .error |
1242 | mov [error_proc], .error |
1242 | mov ecx, 10000h |
1243 | mov ecx, 10000h |
1243 | jmp [eax+streamInfo.fillBuf] |
1244 | jmp [eax+streamInfo.fillBuf] |
1244 | @@: |
1245 | @@: |
1245 | push 68 |
1246 | push SF_SYS_MISC |
1246 | pop eax |
1247 | pop eax |
1247 | push 20 |
1248 | push SSF_MEM_REALLOC |
1248 | pop ebx |
1249 | pop ebx |
1249 | int 0x40 |
1250 | int 0x40 |
1250 | test eax, eax |
1251 | test eax, eax |
1251 | jz .nomem |
1252 | jz .nomem |
1252 | mov edx, eax |
1253 | mov edx, eax |
Line 1278... | Line 1279... | ||
1278 | @@: |
1279 | @@: |
1279 | test ecx, ecx |
1280 | test ecx, ecx |
1280 | jnz @f |
1281 | jnz @f |
1281 | inc ecx |
1282 | inc ecx |
1282 | @@: |
1283 | @@: |
1283 | push 68 |
1284 | push SF_SYS_MISC |
1284 | pop eax |
1285 | pop eax |
1285 | push 20 |
1286 | push SSF_MEM_REALLOC |
1286 | pop ebx |
1287 | pop ebx |
1287 | int 0x40 |
1288 | int 0x40 |
1288 | test eax, eax |
1289 | test eax, eax |
1289 | jz .nomem |
1290 | jz .nomem |
1290 | sub ecx, edi |
1291 | sub ecx, edi |
Line 1295... | Line 1296... | ||
1295 | rep movsd |
1296 | rep movsd |
1296 | mov ecx, edx |
1297 | mov ecx, edx |
1297 | and ecx, 3 |
1298 | and ecx, 3 |
1298 | rep movsb |
1299 | rep movsb |
1299 | push eax |
1300 | push eax |
1300 | push 68 |
1301 | push SF_SYS_MISC |
1301 | pop eax |
1302 | pop eax |
1302 | push 13 |
1303 | push SSF_MEM_FREE |
1303 | pop ebx |
1304 | pop ebx |
1304 | lea ecx, [ebp-streamInfo.size-8] |
1305 | lea ecx, [ebp-streamInfo.size-8] |
1305 | int 40h |
1306 | int 40h |
1306 | pop eax |
1307 | pop eax |
1307 | jmp .ret |
1308 | jmp .ret |
1308 | .nomem: |
1309 | .nomem: |
1309 | push 68 |
1310 | push SF_SYS_MISC |
1310 | pop eax |
1311 | pop eax |
1311 | push 13 |
1312 | push SSF_MEM_FREE |
1312 | pop ebx |
1313 | pop ebx |
1313 | test edx, edx |
1314 | test edx, edx |
1314 | jz @f |
1315 | jz @f |
1315 | mov ecx, edx |
1316 | mov ecx, edx |
1316 | push eax |
1317 | push eax |
Line 1340... | Line 1341... | ||
1340 | @@: |
1341 | @@: |
1341 | popad |
1342 | popad |
1342 | ret |
1343 | ret |
Line 1343... | Line 1344... | ||
1343 | 1344 | ||
1344 | mypgalloc: |
1345 | mypgalloc: |
1345 | push 68 |
1346 | push SF_SYS_MISC |
1346 | pop eax |
1347 | pop eax |
1347 | push 12 |
1348 | push SSF_MEM_ALLOC |
1348 | pop ebx |
1349 | pop ebx |
1349 | int 0x40 |
1350 | int 0x40 |
Line 1350... | Line 1351... | ||
1350 | ret |
1351 | ret |
Line 1369... | Line 1370... | ||
1369 | dd aRead, myread |
1370 | dd aRead, myread |
1370 | dd aSetpos, mysetpos |
1371 | dd aSetpos, mysetpos |
1371 | dd aClose, myclose |
1372 | dd aClose, myclose |
1372 | dd aDeflateUnpack, deflate_unpack |
1373 | dd aDeflateUnpack, deflate_unpack |
1373 | dd aDeflateUnpack2,deflate_unpack2 |
1374 | dd aDeflateUnpack2,deflate_unpack2 |
- | 1375 | dd adeflateInit, deflateInit |
|
- | 1376 | dd adeflateInit2, deflateInit2 |
|
- | 1377 | dd adeflateReset, deflateReset |
|
- | 1378 | dd adeflate, deflate |
|
- | 1379 | dd adeflateEnd, deflateEnd |
|
- | 1380 | dd azError, zError |
|
- | 1381 | dd acalc_crc32, calc_crc32 |
|
1374 | dd 0 |
1382 | dd 0 |
Line 1375... | Line 1383... | ||
1375 | 1383 | ||
1376 | ; exported names |
1384 | ; exported names |
1377 | aVersion db 'version',0 |
1385 | aVersion db 'version',0 |
Line 1387... | Line 1395... | ||
1387 | aRead db 'read',0 |
1395 | aRead db 'read',0 |
1388 | aSetpos db 'setpos',0 |
1396 | aSetpos db 'setpos',0 |
1389 | aClose db 'close',0 |
1397 | aClose db 'close',0 |
1390 | aDeflateUnpack db 'deflate_unpack',0 |
1398 | aDeflateUnpack db 'deflate_unpack',0 |
1391 | aDeflateUnpack2 db 'deflate_unpack2',0 |
1399 | aDeflateUnpack2 db 'deflate_unpack2',0 |
- | 1400 | adeflateInit db 'deflateInit',0 |
|
- | 1401 | adeflateInit2 db 'deflateInit2',0 |
|
- | 1402 | adeflateReset db 'deflateReset',0 |
|
- | 1403 | adeflate db 'deflate',0 |
|
- | 1404 | adeflateEnd db 'deflateEnd',0 |
|
- | 1405 | azError db 'zError',0 |
|
- | 1406 | acalc_crc32 db 'calc_crc32',0 |
|
Line 1392... | Line 1407... | ||
1392 | 1407 | ||
1393 | ; common strings |
1408 | ; common strings |
1394 | if lang eq ru |
1409 | if lang eq ru |
1395 | aContinue db 'த®«¦¨âì',0 |
1410 | aContinue db 'த®«¦¨âì',0 |
Line 1510... | Line 1525... | ||
1510 | IncludeIGlobals |
1525 | IncludeIGlobals |
Line 1511... | Line 1526... | ||
1511 | 1526 | ||
1512 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1527 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1513 | ;;;;;;;;;;;;;;; Uninitialized data ;;;;;;;;;;;;;; |
1528 | ;;;;;;;;;;;;;;; Uninitialized data ;;;;;;;;;;;;;; |
- | 1529 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 1530 | purge data ;used in 'macros.inc' |
|
Line 1514... | Line 1531... | ||
1514 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1531 | purge section ;used in 'macros.inc' |
1515 | 1532 | ||
1516 | section '.udata' data readable writable align 16 |
1533 | section '.udata' data readable writable align 16 |
1517 | kfar_info dd ? |
1534 | kfar_info dd ? |