wok-current rev 20481
upx: patch checkDefaultCompressionRatio()
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Oct 18 22:26:36 2018 +0200 (2018-10-18) |
parents | 575a66a35018 |
children | 6ef4249c53aa |
files | linld/stuff/src/JUMP.ASM upx/receipt |
line diff
1.1 --- a/linld/stuff/src/JUMP.ASM Wed Oct 17 23:43:25 2018 +0300 1.2 +++ b/linld/stuff/src/JUMP.ASM Thu Oct 18 22:26:36 2018 +0200 1.3 @@ -34,28 +34,28 @@ 1.4 ;*************************************************************** 1.5 1.6 macro dos_shutdown 1.7 - xor bx,bx 1.8 - mov ds,bx 1.9 + xor di,di 1.10 + mov ds,di 1.11 ifndef NO386 1.12 - push [dword bx+4] ; save step 1.13 - mov [word bx+4],offset step19 1.14 + push [dword di+4] ; save step 1.15 + mov [word di+4],offset step19 1.16 else 1.17 mov ax,offset step19 1.18 - xchg ax,[word bx+4] 1.19 - push [word bx+6] 1.20 + xchg ax,[word di+4] 1.21 + push [word di+6] 1.22 push ax ; save step 1.23 endif 1.24 mov [word cs:sssp],sp 1.25 - ;cmp [byte bx+7],0F0h 1.26 + ;cmp [byte di+7],0F0h 1.27 ;jnc notdos 1.28 - mov [bx+6],cs 1.29 + mov [di+6],cs 1.30 pushf 1.31 pushf 1.32 pop ax 1.33 inc ah ; set TF 1.34 push ax 1.35 popf 1.36 - call [dword bx+4*19h] 1.37 + call [dword di+4*19h] 1.38 notdos: 1.39 ifndef NO386 1.40 lss sp,[dword cs:sssp] 1.41 @@ -65,24 +65,24 @@ 1.42 pop ss 1.43 xchg ax,sp 1.44 endif 1.45 - xor bx,bx 1.46 - mov ds,bx 1.47 + xor di,di 1.48 + mov ds,di 1.49 ifndef NO386 1.50 - pop [dword bx+4] ; restore step 1.51 + pop [dword di+4] ; restore step 1.52 else 1.53 - pop [word bx+4] ; restore step 1.54 - pop [word bx+6] 1.55 + pop [word di+4] ; restore step 1.56 + pop [word di+6] 1.57 endif 1.58 endm 1.59 macro step19code 1.60 step19: 1.61 - push bx 1.62 + push di 1.63 push ds 1.64 - mov bx,sp 1.65 - lds bx,[dword ss:bx+4] ; read cs:ip 1.66 - cmp [word bx],19CDh ; int 19h ? 1.67 + mov di,sp 1.68 + lds di,[dword ss:di+4] ; read cs:ip 1.69 + cmp [word di],19CDh ; int 19h ? 1.70 pop ds 1.71 - pop bx 1.72 + pop di 1.73 je notdos 1.74 iret 1.75 endm 1.76 @@ -105,13 +105,11 @@ 1.77 mov [word sssp+2],ax 1.78 xchg ax,bx 1.79 mov ax,[_heap_top] 1.80 - inc ah 1.81 mov cl,4 1.82 shr ax,cl 1.83 else 1.84 p386 1.85 mov ax,[_heap_top] 1.86 - inc ah 1.87 ;shr ax,4 1.88 db 0C1h,0E8h 1.89 sssp: 1.90 @@ -150,6 +148,9 @@ 1.91 mov ch,10h ; 4k 1.92 rep 1.93 movsb 1.94 + ifdef NO386 1.95 + add bh,9 1.96 + endif 1.97 cmp al,cl ; load high ? 1.98 ifdef noelks 1.99 jne @@isbzimage 1.100 @@ -157,7 +158,6 @@ 1.101 jne @@isbzimagez 1.102 endif 1.103 ifdef NO386 1.104 - add bh,9 1.105 push bx ; topseg()+0x0900 1.106 else 1.107 push 9800h+(4096/16) ; 4096 bytes for cmdline 1.108 @@ -169,9 +169,9 @@ 1.109 ; self move 1.110 ;cld 1.111 pop es ; min 2048 bytes for stack 1.112 + mov cx,offset movedend 1.113 xor si,si ; A000 -9000 -0800(>movedend) 1.114 xor di,di ; set ZF 1.115 - mov cx,offset movedend 1.116 rep 1.117 movsb 1.118 mov ax,[word _imgs+2+2] ; get pm->fallback high word 1.119 @@ -188,22 +188,22 @@ 1.120 push ax ; src ofs ho = pm.fallback 1.121 1.122 push es 1.123 - dos_shutdown ; clear bx 1.124 + dos_shutdown ; clear di 1.125 call near @@isbzimage ; pop cs ; ds=es=ss 1.126 ;in al,70h 1.127 ;or al,80h ; disable NMI 1.128 ;out 70h,al 1.129 1.130 - push bx ; src ofs lo 1.131 - push bx ; src seg=0 1.132 + push di ; src ofs lo 1.133 + push di ; src seg=0 1.134 ifdef NO386 1.135 - inc bx 1.136 - push bx ; dst ofs hi 1.137 - dec bx 1.138 + inc di 1.139 + push di ; dst ofs hi 1.140 + dec di 1.141 else 1.142 push 1 ; dst ofs hi 1.143 endif 1.144 - push bx ; dst ofs lo : 64k 1.145 + push di ; dst ofs lo : 64k 1.146 extrn _memcpy32:near 1.147 call _memcpy32 1.148 add sp,14 1.149 @@ -212,32 +212,28 @@ 1.150 ifndef NO386 1.151 cmp [dword 1E6h],'SKLE' 1.152 jne @@notelks 1.153 -@@isbzimagez: 1.154 - jne @@isbzimage 1.155 + xor si,si 1.156 else 1.157 - cmp [word 1E6h],'LE' 1.158 + mov si,1E6h 1.159 + lodsw 1.160 + cmp ax,'LE' 1.161 jne @@notelks 1.162 -@@isbzimagez: 1.163 - jne @@isbzimage 1.164 - cmp [word 1E8h],'SK' 1.165 + lodsw 1.166 + xor ax,'SK' 1.167 jne @@notelks 1.168 + xchg ax,si 1.169 endif 1.170 - mov cx,100h ; DS=ES=SS=0100 1.171 + push es 1.172 + pop ss 1.173 + mov cx,120h ; CS=0120 1.174 + push cx 1.175 + push si ; IP=0000 1.176 + mov cl,0 ; DS=ES=SS=0100 1.177 mov es,cx 1.178 mov ch,05h ; 500h mini 1.179 - xor si,si 1.180 - xor di,di 1.181 rep 1.182 +@@isbzimagez: 1.183 movsw 1.184 - push es 1.185 - pop ss 1.186 - ifdef NO386 1.187 - mov ax,120h ; CS=0120 1.188 - push ax 1.189 - else 1.190 - push 120h ; CS=0120 1.191 - endif 1.192 - push cx ; IP=0000 1.193 @@notelks: 1.194 endif 1.195 @@isbzimage:
2.1 --- a/upx/receipt Wed Oct 17 23:43:25 2018 +0300 2.2 +++ b/upx/receipt Thu Oct 18 22:26:36 2018 +0200 2.3 @@ -21,6 +21,8 @@ 2.4 [ -s $SOURCES_REPOSITORY/lzma-$TARBALL ] || 2.5 wget -O $SOURCES_REPOSITORY/lzma-$TARBALL $PATCH 2.6 tar -xf $SOURCES_REPOSITORY/lzma-$TARBALL 2.7 + sed -i 's|c_len >= u_len)|c_len < u_len) return true; else|' \ 2.8 + $src/src/packer.cpp 2.9 rm -r $src/src/lzma-sdk 2.10 mv $src/upx-lzma-sdk-$VERSION $src/src/lzma-sdk 2.11 make CHECK_WHITESPACE=/bin/true all