# HG changeset patch # User Pascal Bellard # Date 1539894396 -7200 # Node ID 12f4a776eaa715787a90cd011b1ff8c0f3c7571a # Parent 575a66a350188a93481a599d1c5b244e2c2e97a1 upx: patch checkDefaultCompressionRatio() diff -r 575a66a35018 -r 12f4a776eaa7 linld/stuff/src/JUMP.ASM --- a/linld/stuff/src/JUMP.ASM Wed Oct 17 23:43:25 2018 +0300 +++ b/linld/stuff/src/JUMP.ASM Thu Oct 18 22:26:36 2018 +0200 @@ -34,28 +34,28 @@ ;*************************************************************** macro dos_shutdown - xor bx,bx - mov ds,bx + xor di,di + mov ds,di ifndef NO386 - push [dword bx+4] ; save step - mov [word bx+4],offset step19 + push [dword di+4] ; save step + mov [word di+4],offset step19 else mov ax,offset step19 - xchg ax,[word bx+4] - push [word bx+6] + xchg ax,[word di+4] + push [word di+6] push ax ; save step endif mov [word cs:sssp],sp - ;cmp [byte bx+7],0F0h + ;cmp [byte di+7],0F0h ;jnc notdos - mov [bx+6],cs + mov [di+6],cs pushf pushf pop ax inc ah ; set TF push ax popf - call [dword bx+4*19h] + call [dword di+4*19h] notdos: ifndef NO386 lss sp,[dword cs:sssp] @@ -65,24 +65,24 @@ pop ss xchg ax,sp endif - xor bx,bx - mov ds,bx + xor di,di + mov ds,di ifndef NO386 - pop [dword bx+4] ; restore step + pop [dword di+4] ; restore step else - pop [word bx+4] ; restore step - pop [word bx+6] + pop [word di+4] ; restore step + pop [word di+6] endif endm macro step19code step19: - push bx + push di push ds - mov bx,sp - lds bx,[dword ss:bx+4] ; read cs:ip - cmp [word bx],19CDh ; int 19h ? + mov di,sp + lds di,[dword ss:di+4] ; read cs:ip + cmp [word di],19CDh ; int 19h ? pop ds - pop bx + pop di je notdos iret endm @@ -105,13 +105,11 @@ mov [word sssp+2],ax xchg ax,bx mov ax,[_heap_top] - inc ah mov cl,4 shr ax,cl else p386 mov ax,[_heap_top] - inc ah ;shr ax,4 db 0C1h,0E8h sssp: @@ -150,6 +148,9 @@ mov ch,10h ; 4k rep movsb + ifdef NO386 + add bh,9 + endif cmp al,cl ; load high ? ifdef noelks jne @@isbzimage @@ -157,7 +158,6 @@ jne @@isbzimagez endif ifdef NO386 - add bh,9 push bx ; topseg()+0x0900 else push 9800h+(4096/16) ; 4096 bytes for cmdline @@ -169,9 +169,9 @@ ; self move ;cld pop es ; min 2048 bytes for stack + mov cx,offset movedend xor si,si ; A000 -9000 -0800(>movedend) xor di,di ; set ZF - mov cx,offset movedend rep movsb mov ax,[word _imgs+2+2] ; get pm->fallback high word @@ -188,22 +188,22 @@ push ax ; src ofs ho = pm.fallback push es - dos_shutdown ; clear bx + dos_shutdown ; clear di call near @@isbzimage ; pop cs ; ds=es=ss ;in al,70h ;or al,80h ; disable NMI ;out 70h,al - push bx ; src ofs lo - push bx ; src seg=0 + push di ; src ofs lo + push di ; src seg=0 ifdef NO386 - inc bx - push bx ; dst ofs hi - dec bx + inc di + push di ; dst ofs hi + dec di else push 1 ; dst ofs hi endif - push bx ; dst ofs lo : 64k + push di ; dst ofs lo : 64k extrn _memcpy32:near call _memcpy32 add sp,14 @@ -212,32 +212,28 @@ ifndef NO386 cmp [dword 1E6h],'SKLE' jne @@notelks -@@isbzimagez: - jne @@isbzimage + xor si,si else - cmp [word 1E6h],'LE' + mov si,1E6h + lodsw + cmp ax,'LE' jne @@notelks -@@isbzimagez: - jne @@isbzimage - cmp [word 1E8h],'SK' + lodsw + xor ax,'SK' jne @@notelks + xchg ax,si endif - mov cx,100h ; DS=ES=SS=0100 + push es + pop ss + mov cx,120h ; CS=0120 + push cx + push si ; IP=0000 + mov cl,0 ; DS=ES=SS=0100 mov es,cx mov ch,05h ; 500h mini - xor si,si - xor di,di rep +@@isbzimagez: movsw - push es - pop ss - ifdef NO386 - mov ax,120h ; CS=0120 - push ax - else - push 120h ; CS=0120 - endif - push cx ; IP=0000 @@notelks: endif @@isbzimage: diff -r 575a66a35018 -r 12f4a776eaa7 upx/receipt --- a/upx/receipt Wed Oct 17 23:43:25 2018 +0300 +++ b/upx/receipt Thu Oct 18 22:26:36 2018 +0200 @@ -21,6 +21,8 @@ [ -s $SOURCES_REPOSITORY/lzma-$TARBALL ] || wget -O $SOURCES_REPOSITORY/lzma-$TARBALL $PATCH tar -xf $SOURCES_REPOSITORY/lzma-$TARBALL + sed -i 's|c_len >= u_len)|c_len < u_len) return true; else|' \ + $src/src/packer.cpp rm -r $src/src/lzma-sdk mv $src/upx-lzma-sdk-$VERSION $src/src/lzma-sdk make CHECK_WHITESPACE=/bin/true all