kfar_arc: bugfix in loading of 7z archives

git-svn-id: svn://kolibrios.org@893 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2008-11-02 11:44:00 +00:00
parent c6b57fbd1a
commit 5c194bbe10
3 changed files with 23 additions and 9 deletions

View File

@ -1834,7 +1834,7 @@ _7z.decode:
mov esi, [.pStreams]
mov eax, [esi+eax*4]
call fillBuf
mov ecx, [eax+streamInfo.bufSize]
mov ecx, [eax+streamInfo.bufDataLen]
mov esi, [eax+streamInfo.bufPtr]
mov edi, [.outBufferPtr]
add edi, [.outBufferRead]

View File

@ -2,8 +2,8 @@
; project name: KFar_Arc - plugin for KFar, which supports various archives
; target platform: KolibriOS
; compiler: FASM 1.67.14
; version: 0.12
; last update: 2007-10-06 (Oct 06, 2007)
; version: 0.13
; last update: 2008-11-02 (Nov 02, 2008)
; minimal KFar version: 0.41
; minimal kernel: no limit
;

View File

@ -132,14 +132,22 @@ end virtual
lea eax, [ebp + eax + .p+.Literal*4]
cmp ebx, .kNumLitStates
jb .literal
xor edx, edx
mov edx, edi
sub edx, [ebp+.rep0]
mov dl, [edi + edx]
cmp edx, [ebp+streamInfo.bufPtr]
jb .before_buf
@@:
mov dl, [edx]
call .LzmaLiteralDecodeMatch
jmp @f
jmp .got_byte
.before_buf:
add edx, [ebp+streamInfo.bufSize]
cmp edx, [ebp+streamInfo.bufPtr]
jb return.err
jmp @b
.literal:
call .LzmaLiteralDecode
@@:
.got_byte:
mov [ebp+.previousByte], al
stosb
mov al, bl
@ -167,9 +175,15 @@ end virtual
cmp bl, 7
setae bl
lea ebx, [9 + ebx + ebx]
xor edx, edx
mov edx, edi
sub edx, [ebp+.rep0]
mov al, [edi + edx]
cmp edx, [ebp+streamInfo.bufPtr]
jae @f
add edx, [ebp+streamInfo.bufSize]
cmp edx, [ebp+streamInfo.bufPtr]
jb return.err
@@:
mov al, [edx]
stosb
mov [ebp+.previousByte], al
jmp .main_loop