Compare commits
152 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89cfa22c3f | |||
| e7522f4bdf | |||
| 504deeff42 | |||
| b7785b64cf | |||
| f914cb6858 | |||
| 91051d2521 | |||
| 51536a7acd | |||
| 263ccab6e3 | |||
| 9f87755dcb | |||
| 60b4cca5e5 | |||
| d2718e99a4 | |||
| 69a00c0ab3 | |||
| 3272d23917 | |||
| 7f0545cae7 | |||
| 68f35deb86 | |||
| c4f4035072 | |||
| a7d8845952 | |||
| a3378393b0 | |||
| 3dfe0ad478 | |||
| 9a3b7a4f3f | |||
| 78579b1103 | |||
| 7d50344512 | |||
| 7a00c12065 | |||
| af71e67681 | |||
| b3e20fc324 | |||
| bd1014abb6 | |||
| 7f76664a5d | |||
| 0a5a80b05d | |||
| 2d63da0660 | |||
| 8387527d2e | |||
| 5d03ba7d63 | |||
| 0ece50c122 | |||
| f2ac297252 | |||
| 0ca8ae17d4 | |||
| 88ca87cf9e | |||
| 0d69d228e4 | |||
| a3afe95306 | |||
| 9fb4af8658 | |||
| 9bb6ba9311 | |||
| faa42ba341 | |||
| 596827a912 | |||
| 89b4292445 | |||
| dd88737414 | |||
| 5456cfc304 | |||
| 1e66096ea7 | |||
| 2b6ae3908c | |||
| 1924612479 | |||
| 2af5bdeaab | |||
| b28565b38d | |||
| fec602362b | |||
| 6753c5f45a | |||
| 2f3c108d42 | |||
| ce6d99bdb4 | |||
| 86d4125893 | |||
| 3a18f00379 | |||
| e6274904a7 | |||
| 3677395444 | |||
| 22ba35b3b5 | |||
| 9c1ab9979b | |||
| eaa463e1c9 | |||
| 6984be48c3 | |||
| b739bd3d79 | |||
| 23f3e4396c | |||
| c264750924 | |||
| c155f0a5d5 | |||
| 76734f086d | |||
| 4f2d1172dd | |||
| 75caf4e297 | |||
| 509ab8261f | |||
| 1e05b40d4f | |||
| 451390f835 | |||
| 58cce9d2f8 | |||
| 2eb6e3b0ea | |||
| fb1181ed26 | |||
| 6d5e1d529d | |||
| 0e0ca08924 | |||
| 5d948a67a8 | |||
| 6a4db2ecab | |||
| f700273624 | |||
| 0c198e0ccc | |||
| 71ffbbc420 | |||
| 4fd09b889d | |||
| 4cb2a3eebe | |||
| c25186b1f6 | |||
| 779033d0bc | |||
| 3e31560e7d | |||
| d23d7e8775 | |||
| f6fdf5cb7f | |||
| 1879ccd27d | |||
| 08c0796719 | |||
| edc7994ce5 | |||
| bcfcfbd064 | |||
| 9e79b3258d | |||
| 243873cd2d | |||
| c7b8a4b0c1 | |||
| e39e0c7140 | |||
| d4a3f11dbb | |||
| 0962f266b3 | |||
| 69e4d3fdad | |||
| c0908f463a | |||
| b00a61a17b | |||
| 553c2f886a | |||
| 4fd9c5772a | |||
| 04e0e06d85 | |||
| 4d7829d72b | |||
| 6b751aac57 | |||
| 813349fd23 | |||
| 16a2744782 | |||
| 7b6870db22 | |||
| 3e38e7d52c | |||
| 8142d3474d | |||
| 8773649de6 | |||
| c117920ff9 | |||
| c8dd2a3eb8 | |||
| 90b1817e92 | |||
| d6c3ff5997 | |||
| 984ec25132 | |||
| a7bff34784 | |||
| a6e7afbc91 | |||
| 33f1d63b64 | |||
| f95e171e11 | |||
| c82b50b212 | |||
| 2b402b77f1 | |||
| adcb551020 | |||
| 2680aabe06 | |||
| d5c0533b74 | |||
| 609307668b | |||
| cdaf36572a | |||
| 033c8d5d51 | |||
| 6216ec1d6a | |||
| 6c9c67f6c5 | |||
| 5bd32b5521 | |||
| 549336f75b | |||
| f0e75f30b3 | |||
| 144c09f175 | |||
| ee50c0f97c | |||
| ade921bf02 | |||
| 676cacff04 | |||
| a3097d5e25 | |||
| fd78148558 | |||
| a4d79d7375 | |||
| df04e8183d | |||
| c43c484a62 | |||
| 0608c35669 | |||
| 7dd4d06e26 | |||
| 1ee0310b86 | |||
| cc0a52038f | |||
| 6aed1fe231 | |||
| 680608fe18 | |||
| ec6acbc602 | |||
| cb7ee4c5d2 | |||
| 88d5798f45 |
-13
@@ -1,13 +0,0 @@
|
|||||||
.bzr*
|
|
||||||
.darcs*
|
|
||||||
.git*
|
|
||||||
.hg*
|
|
||||||
_darcs
|
|
||||||
B
|
|
||||||
build*
|
|
||||||
doxygen
|
|
||||||
maint
|
|
||||||
ChangeLog.cvs*
|
|
||||||
GNUmakefile
|
|
||||||
MMakefile
|
|
||||||
TODO.*
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
syntax: regexp
|
||||||
|
|
||||||
|
^ChangeLog
|
||||||
|
^build
|
||||||
|
^maint
|
||||||
|
|
||||||
|
syntax: glob
|
||||||
|
|
||||||
|
*.a
|
||||||
|
*.d
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
*.lib
|
||||||
|
*.map
|
||||||
|
*.o
|
||||||
|
*.out
|
||||||
|
*.py[cdo]
|
||||||
|
*.so
|
||||||
|
*.res
|
||||||
|
*.ttp
|
||||||
|
|
||||||
|
doc/*.1
|
||||||
|
doc/*.doc
|
||||||
|
doc/*.html
|
||||||
|
|
||||||
|
src/MMakefile
|
||||||
|
src/compress_nrv*
|
||||||
|
src/*.rc
|
||||||
|
|
||||||
|
stub/MMakefile
|
||||||
|
stub/l_t_*.i
|
||||||
|
stub/stamp-h
|
||||||
|
stub/*.ash
|
||||||
|
stub/*.asx
|
||||||
|
stub/*.asy
|
||||||
|
stub/*.bin
|
||||||
|
stub/*.lst
|
||||||
|
|
||||||
|
stub/util/armpe/armpe_tester
|
||||||
|
|
||||||
|
stub/util/sstrip/amd64-linux-sstrip
|
||||||
|
stub/util/sstrip/i386-linux-sstrip
|
||||||
|
stub/util/sstrip/sstrip
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
140415ffbcef86a42b4d672249927364430d3d38 RELEASE_111
|
||||||
|
223ac5b23f9731ceac9ff8d65167df4900776e36 RELEASE_190
|
||||||
|
2c753c5bf38e7322715e2a5c6c5381111bd7a61a RELEASE_194
|
||||||
|
2ee65b77f9117651e2e5517b2edede23698d73ca RELEASE_196
|
||||||
|
70402aeee6e0e4fc2889658ed8cee44461c0b0a8 RELEASE_200
|
||||||
|
a935d577fc7dd9c2c87761c9c702805da6ce1e51 RELEASE_193
|
||||||
|
b0353253b0b3d062eb5adb50d4b665a96620da45 RELEASE_195
|
||||||
|
c2e0cd4d621b047f254f2def42132a03683ff52c RELEASE_192
|
||||||
|
eb1ce56dce7dd1835964362470610925963b9043 RELEASE_110
|
||||||
|
ed96891ef795bceec6b7ff3ca1ca7764431bfb39 RELEASE_191
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2006 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2006 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
http://upx.sourceforge.net
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,32 +12,22 @@ default:
|
|||||||
@echo "UPX info: please choose a target for 'make'"
|
@echo "UPX info: please choose a target for 'make'"
|
||||||
|
|
||||||
all mostlyclean clean distclean maintainer-clean:
|
all mostlyclean clean distclean maintainer-clean:
|
||||||
|
ifneq ($(wildcard $(HOME)/local/bin/bin-upx),)
|
||||||
|
# these need special build tools
|
||||||
$(MAKE) -C src/stub/util/sstrip $@
|
$(MAKE) -C src/stub/util/sstrip $@
|
||||||
$(MAKE) -C src/stub $@
|
$(MAKE) -C src/stub $@
|
||||||
|
endif
|
||||||
$(MAKE) -C src $@
|
$(MAKE) -C src $@
|
||||||
$(MAKE) -C doc $@
|
$(MAKE) -C doc $@
|
||||||
|
|
||||||
dist: distclean
|
dist: distclean
|
||||||
false
|
false
|
||||||
|
|
||||||
|
# automatically generate ChangeLog from hg
|
||||||
ifneq ($(wildcard CVS/R*),)
|
ChangeLog:
|
||||||
CVS_ROOT := $(shell cat CVS/Root)
|
hg log --style=changelog > $@
|
||||||
CVS_REPO := $(shell cat CVS/Repository)
|
|
||||||
endif
|
|
||||||
|
|
||||||
cvs-info:
|
|
||||||
@echo 'CVS info: $(CVS_ROOT) $(CVS_REPO)'
|
|
||||||
|
|
||||||
cvs-admin-ko:
|
|
||||||
cvs admin -ko .
|
|
||||||
cvs -q -z6 update -P -d
|
|
||||||
|
|
||||||
# automatically generate ChangeLog from CVS
|
|
||||||
ChangeLog ChangeLog.cvs:
|
|
||||||
perl $(srcdir)/scripts/cvs2cl.pl --utc -f ChangeLog.cvs
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all mostlyclean clean distclean maintainer-clean
|
.PHONY: default all mostlyclean clean distclean maintainer-clean
|
||||||
.PHONY: dist cvs-info cvs-admin-ko ChangeLog ChangeLog.cvs
|
.PHONY: dist ChangeLog
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,35 @@
|
|||||||
User visible changes for UPX
|
User visible changes for UPX
|
||||||
==================================================================
|
==================================================================
|
||||||
|
|
||||||
[ UNSTABLE BETA VERSION - please see README.1ST for some more info ]
|
Changes in 2.01 (06 Jun 2006):
|
||||||
|
* arm/pe: better DLL support
|
||||||
|
* dos/exe: device driver support added
|
||||||
|
* linux/386: Fix --force-execve for PaX, grSecurity, and strict SELinux.
|
||||||
|
/tmp must support execve(); therefore /tmp cannot be mounted 'noexec'.
|
||||||
|
* win32/pe & arm/pe: added new option '--keep-resource=' for
|
||||||
|
excluding selected resources from compression
|
||||||
|
|
||||||
|
Changes in 2.00 (27 Apr 2006):
|
||||||
|
* linux/386: the stub now prints an error message if some strict
|
||||||
|
SELinux mode does prevent runtime decompression and execution
|
||||||
|
(for a fully SELinux-compatible but otherwise inferior compression
|
||||||
|
format you can use the '--force-execve' option)
|
||||||
|
* linux/386: worked around a problem where certain Linux kernels
|
||||||
|
clobber the %ebx register during a syscall
|
||||||
|
* win32/pe: disable filters for files with broken PE headers
|
||||||
|
|
||||||
|
Changes in 1.96 beta (13 Apr 2006):
|
||||||
|
* arm/pe: added filter support
|
||||||
|
* win32/pe: removed an unnecessary check so that Delphi 2006 and
|
||||||
|
Digital Mars C++ programs finally are supported
|
||||||
|
|
||||||
|
Changes in 1.95 beta (09 Apr 2006):
|
||||||
|
* arm/pe: added DLL support
|
||||||
|
* arm/pe: added thumb mode stub support
|
||||||
|
* arm/pe: added unpacking support
|
||||||
|
* win32/pe: really worked around R6002 runtime errors
|
||||||
|
|
||||||
Changes in 1.94 beta (11 Mar 2006):
|
Changes in 1.94 beta (11 Mar 2006):
|
||||||
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
|
|
||||||
* new format: added support for arm/pe (ARM executables running on WinCE)
|
* new format: added support for arm/pe (ARM executables running on WinCE)
|
||||||
* new format: added support for linux elf/amd64
|
* new format: added support for linux elf/amd64
|
||||||
* new format: added support for linux elf/ppc32
|
* new format: added support for linux elf/ppc32
|
||||||
@@ -18,8 +43,8 @@ Changes in 1.93 beta (07 Feb 2005):
|
|||||||
* vmlinuz/386: fixes to support more kernels
|
* vmlinuz/386: fixes to support more kernels
|
||||||
|
|
||||||
Changes in 1.92 beta (20 Jul 2004):
|
Changes in 1.92 beta (20 Jul 2004):
|
||||||
* win32/pe: added option `--strip-loadconf' to strip the SEH
|
* win32/pe: added option '--strip-loadconf' to strip the SEH load
|
||||||
load config section
|
config section [NOTE: this option is obsolete since UPX 1.94]
|
||||||
* win32/pe: try to detect .NET (win32/net) files [not yet supported by UPX]
|
* win32/pe: try to detect .NET (win32/net) files [not yet supported by UPX]
|
||||||
* vmlinux/386: new format that directly supports building Linux kernels
|
* vmlinux/386: new format that directly supports building Linux kernels
|
||||||
* source code: now compiles cleanly under Win64
|
* source code: now compiles cleanly under Win64
|
||||||
@@ -30,7 +55,7 @@ Changes in 1.91 beta (30 Jun 2004):
|
|||||||
* vmlinuz/386: added support for recent kernels
|
* vmlinuz/386: added support for recent kernels
|
||||||
* watcom/le: don't crash on files without relocations
|
* watcom/le: don't crash on files without relocations
|
||||||
* win32/pe: stricter checks of some PE values
|
* win32/pe: stricter checks of some PE values
|
||||||
* option `--brute' now implies `--crp-ms=999999'.
|
* option '--brute' now implies '--crp-ms=999999'.
|
||||||
* source code: much improved portability using ACC, the
|
* source code: much improved portability using ACC, the
|
||||||
Automatic Compiler Configuration
|
Automatic Compiler Configuration
|
||||||
* source code: compile fixes for strict ISO C++ compilers
|
* source code: compile fixes for strict ISO C++ compilers
|
||||||
@@ -39,9 +64,9 @@ Changes in 1.91 beta (30 Jun 2004):
|
|||||||
|
|
||||||
Changes in 1.90 beta (11 Nov 2002):
|
Changes in 1.90 beta (11 Nov 2002):
|
||||||
* implemented several new options for finer compression control:
|
* implemented several new options for finer compression control:
|
||||||
`--all-methods', `--all-filters' and `--brute'
|
'--all-methods', '--all-filters' and '--brute'
|
||||||
* ps1/exe: new format - UPX now supports PlayStation One programs
|
* ps1/exe: new format - UPX now supports PlayStation One programs
|
||||||
* linux/386: added the option `--force-execve'
|
* linux/386: added the option '--force-execve'
|
||||||
* vmlinuz/386: better kernel detection and sanity checks
|
* vmlinuz/386: better kernel detection and sanity checks
|
||||||
* re-synced with upx 1.24 branch
|
* re-synced with upx 1.24 branch
|
||||||
* documentation updates
|
* documentation updates
|
||||||
@@ -86,9 +111,9 @@ Changes in 1.22 (27 Jun 2002)
|
|||||||
Digital Mars C++ and Watcom C++
|
Digital Mars C++ and Watcom C++
|
||||||
|
|
||||||
Changes in 1.21 (01 Jun 2002)
|
Changes in 1.21 (01 Jun 2002)
|
||||||
* New option `--crp-ms=' for slightly better compression at the cost
|
* New option '--crp-ms=' for slightly better compression at the cost
|
||||||
of higher memory requirements during compression.
|
of higher memory requirements during compression.
|
||||||
Try `upx --best --crp-ms=100000'. See the docs for more info.
|
Try 'upx --best --crp-ms=100000'. See the docs for more info.
|
||||||
* source code: portability fixes
|
* source code: portability fixes
|
||||||
* source code: compile fixes for g++ 3.0 and g++ 3.1
|
* source code: compile fixes for g++ 3.0 and g++ 3.1
|
||||||
|
|
||||||
@@ -126,7 +151,7 @@ Changes in 1.05 (24 Jan 2001)
|
|||||||
at the unstable UPX 1.1x beta versions for that)
|
at the unstable UPX 1.1x beta versions for that)
|
||||||
|
|
||||||
Changes in 1.04 (19 Dec 2000)
|
Changes in 1.04 (19 Dec 2000)
|
||||||
* dos/exe: fixed an internal error when using `--no-reloc'
|
* dos/exe: fixed an internal error when using '--no-reloc'
|
||||||
* win32/pe: fixed a rare bug in the relocation handling code
|
* win32/pe: fixed a rare bug in the relocation handling code
|
||||||
* some tunings for the default compression level
|
* some tunings for the default compression level
|
||||||
|
|
||||||
@@ -134,7 +159,7 @@ Changes in 1.03 (30 Nov 2000)
|
|||||||
* linked with a new version of the NRV compression library:
|
* linked with a new version of the NRV compression library:
|
||||||
- improved compression ratio a little bit
|
- improved compression ratio a little bit
|
||||||
- overall significantly faster compression
|
- overall significantly faster compression
|
||||||
- much faster when using high compression levels like `-9' or `--best'
|
- much faster when using high compression levels like '-9' or '--best'
|
||||||
- much faster with large files
|
- much faster with large files
|
||||||
* atari/tos: added support for FreeMiNT
|
* atari/tos: added support for FreeMiNT
|
||||||
* the 32-bit DOS version now uses the new CWSDSTUB extender
|
* the 32-bit DOS version now uses the new CWSDSTUB extender
|
||||||
@@ -142,7 +167,7 @@ Changes in 1.03 (30 Nov 2000)
|
|||||||
Changes in 1.02 (13 Sep 2000)
|
Changes in 1.02 (13 Sep 2000)
|
||||||
* watcom/le: fixed a problem with the Causeway extender
|
* watcom/le: fixed a problem with the Causeway extender
|
||||||
* win32/pe: don't automatically strip relocs if they seem needed
|
* win32/pe: don't automatically strip relocs if they seem needed
|
||||||
* support multiple backup generations when using `-k'
|
* support multiple backup generations when using '-k'
|
||||||
* updated the console screen driver
|
* updated the console screen driver
|
||||||
|
|
||||||
Changes in 1.01 (09 Apr 2000)
|
Changes in 1.01 (09 Apr 2000)
|
||||||
@@ -170,7 +195,7 @@ Changes in 0.99.1 (29 Feb 2000)
|
|||||||
|
|
||||||
Changes in 0.99 (25 Feb 2000)
|
Changes in 0.99 (25 Feb 2000)
|
||||||
* FULL SOURCE CODE RELEASED UNDER THE TERMS OF THE GNU GPL
|
* FULL SOURCE CODE RELEASED UNDER THE TERMS OF THE GNU GPL
|
||||||
* win32/pe: changed default to `--strip-relocs=1'
|
* win32/pe: changed default to '--strip-relocs=1'
|
||||||
* dos/com and dos/sys: fixed a bad decompressor problem
|
* dos/com and dos/sys: fixed a bad decompressor problem
|
||||||
* linux/386: the counter for the progress indicator was off by one
|
* linux/386: the counter for the progress indicator was off by one
|
||||||
|
|
||||||
@@ -193,7 +218,7 @@ Changes in 0.91 (13 Nov 1999)
|
|||||||
* dos/exe: correctly restore cs when uncompressing
|
* dos/exe: correctly restore cs when uncompressing
|
||||||
|
|
||||||
Changes in 0.90 (10 Nov 1999)
|
Changes in 0.90 (10 Nov 1999)
|
||||||
* all formats: `--overlay=copy' now is the default overlay mode
|
* all formats: '--overlay=copy' now is the default overlay mode
|
||||||
* improved compression ratio for most files
|
* improved compression ratio for most files
|
||||||
* win32/pe: uncompression is finally supported
|
* win32/pe: uncompression is finally supported
|
||||||
* win32/pe: never compress REGISTRY resources
|
* win32/pe: never compress REGISTRY resources
|
||||||
@@ -203,7 +228,7 @@ Changes in 0.90 (10 Nov 1999)
|
|||||||
* win32/pe: somewhat less memory is required during compression
|
* win32/pe: somewhat less memory is required during compression
|
||||||
* linux/386: fixed compression of scripts which was broken since 0.71
|
* linux/386: fixed compression of scripts which was broken since 0.71
|
||||||
* linux/386: more FreeBSD compatibility issues
|
* linux/386: more FreeBSD compatibility issues
|
||||||
* changed option: `-i' now prints some more details during compression
|
* changed option: '-i' now prints some more details during compression
|
||||||
(not finished yet)
|
(not finished yet)
|
||||||
|
|
||||||
Changes in 0.84 (04 Oct 1999)
|
Changes in 0.84 (04 Oct 1999)
|
||||||
@@ -219,7 +244,7 @@ Changes in 0.83 (17 Sep 1999)
|
|||||||
Changes in 0.82 (16 Aug 1999)
|
Changes in 0.82 (16 Aug 1999)
|
||||||
* dos/exe: fixed a decompressor bug which could cause crash on some files
|
* dos/exe: fixed a decompressor bug which could cause crash on some files
|
||||||
* linux/386: section headers are now stripped from the stub so that
|
* linux/386: section headers are now stripped from the stub so that
|
||||||
`strip' won't ruin a compressed file any longer
|
'strip' won't ruin a compressed file any longer
|
||||||
* wc/le: support for stack not in the last object disabled again
|
* wc/le: support for stack not in the last object disabled again
|
||||||
* win32/pe: removed some unneeded data
|
* win32/pe: removed some unneeded data
|
||||||
|
|
||||||
@@ -228,32 +253,32 @@ Changes in 0.81 (04 Aug 1999)
|
|||||||
* dos/com: fixed an internal error that could happen with very small files
|
* dos/com: fixed an internal error that could happen with very small files
|
||||||
|
|
||||||
Changes in 0.80 (03 Aug 1999)
|
Changes in 0.80 (03 Aug 1999)
|
||||||
* you can set some default options in the environment var `UPX'
|
* you can set some default options in the environment var 'UPX'
|
||||||
* dos/com: the decompressor stub now checks for enough free memory
|
* dos/com: the decompressor stub now checks for enough free memory
|
||||||
* dos/exe: decompressor rewritten, some bugs are fixed
|
* dos/exe: decompressor rewritten, some bugs are fixed
|
||||||
* dos/exe: new option `--no-reloc': no relocation data is put into
|
* dos/exe: new option '--no-reloc': no relocation data is put into
|
||||||
the DOS header
|
the DOS header
|
||||||
* tmt/adam: added support for more stubs, detect already packed files
|
* tmt/adam: added support for more stubs, detect already packed files
|
||||||
* tmt/adam: new option `--copy-overlay'
|
* tmt/adam: new option '--copy-overlay'
|
||||||
* wc/le: reduced memory requirement during uncompression
|
* wc/le: reduced memory requirement during uncompression
|
||||||
* wc/le: support files which do not contain their stack in the last object
|
* wc/le: support files which do not contain their stack in the last object
|
||||||
* wc/le: fixed a bug which could cause a crash, improved relocation
|
* wc/le: fixed a bug which could cause a crash, improved relocation
|
||||||
handling
|
handling
|
||||||
* wc/le: new option `--copy-overlay'
|
* wc/le: new option '--copy-overlay'
|
||||||
* win32/pe: `--compress-icons=2' is now the default
|
* win32/pe: '--compress-icons=2' is now the default
|
||||||
* win32/pe: even better TLS support
|
* win32/pe: even better TLS support
|
||||||
* win32/pe: versioninfo works on NT
|
* win32/pe: versioninfo works on NT
|
||||||
* win32/pe: import by ordinal from kernel32.dll works
|
* win32/pe: import by ordinal from kernel32.dll works
|
||||||
* win32/pe: other import improvements: importing a nonexistant DLL
|
* win32/pe: other import improvements: importing a nonexistant DLL
|
||||||
results in a usual Windows message, importing a nonexistant function
|
results in a usual Windows message, importing a nonexistant function
|
||||||
results in program exit (instead of crash ;-)
|
results in program exit (instead of crash ;-)
|
||||||
* win32/pe: new option: `--compress-resources=0'
|
* win32/pe: new option: '--compress-resources=0'
|
||||||
* win32/pe: reduced memory requirement during uncompression, some
|
* win32/pe: reduced memory requirement during uncompression, some
|
||||||
files might even require LESS memory when they're compressed
|
files might even require LESS memory when they're compressed
|
||||||
* win32/pe: TYPELIBs should work now
|
* win32/pe: TYPELIBs should work now
|
||||||
* win32/pe: improved relocation handling, 16-bit relocations should work
|
* win32/pe: improved relocation handling, 16-bit relocations should work
|
||||||
* win32/pe: new option `--strip-relocs' (only if you know what you are doing)
|
* win32/pe: new option '--strip-relocs' (only if you know what you are doing)
|
||||||
* win32/pe: new option `--copy-overlay'
|
* win32/pe: new option '--copy-overlay'
|
||||||
* important internal changes: now the stubs are built at runtime
|
* important internal changes: now the stubs are built at runtime
|
||||||
|
|
||||||
Changes in 0.72 (12 May 1999)
|
Changes in 0.72 (12 May 1999)
|
||||||
@@ -267,20 +292,20 @@ Changes in 0.72 (12 May 1999)
|
|||||||
* linux/386: minor decompressor stub updates, nicer progress bar
|
* linux/386: minor decompressor stub updates, nicer progress bar
|
||||||
|
|
||||||
Changes in 0.71 (19 Apr 1999)
|
Changes in 0.71 (19 Apr 1999)
|
||||||
* dos/exe: added option `--no-overlay'
|
* dos/exe: added option '--no-overlay'
|
||||||
* linux/386: various improvements in the stub, most notably the
|
* linux/386: various improvements in the stub, most notably the
|
||||||
overhead for an extra cleanup process has been removed
|
overhead for an extra cleanup process has been removed
|
||||||
* win32/pe: added support for export forwarders
|
* win32/pe: added support for export forwarders
|
||||||
* win32/pe: added support for DLLs without entry point or imports
|
* win32/pe: added support for DLLs without entry point or imports
|
||||||
* win32/pe: yet another .bss fix
|
* win32/pe: yet another .bss fix
|
||||||
* win32/pe: new option `--compress-icons=2': compress all icons
|
* win32/pe: new option '--compress-icons=2': compress all icons
|
||||||
which are not in the first icon directory
|
which are not in the first icon directory
|
||||||
* win32/pe: rearranged stub to avoid false alerts from some virus scanners
|
* win32/pe: rearranged stub to avoid false alerts from some virus scanners
|
||||||
|
|
||||||
Changes in 0.70 (30 Mar 1999)
|
Changes in 0.70 (30 Mar 1999)
|
||||||
* added support for linux/386 executables
|
* added support for linux/386 executables
|
||||||
* improved compression ratio quite a bit
|
* improved compression ratio quite a bit
|
||||||
* added new compression level `--best' to squeeze out even some more bytes
|
* added new compression level '--best' to squeeze out even some more bytes
|
||||||
* win32/pe: TLS support is much better now
|
* win32/pe: TLS support is much better now
|
||||||
* win32/pe: --compress-icons=0 should now work as well
|
* win32/pe: --compress-icons=0 should now work as well
|
||||||
* the usual minor fixes for win32/pe
|
* the usual minor fixes for win32/pe
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2006 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2006 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
http://upx.sourceforge.net
|
||||||
|
|
||||||
|
|
||||||
@@ -56,8 +56,6 @@ Existing formats:
|
|||||||
|
|
||||||
- dos/exe: implement filter support
|
- dos/exe: implement filter support
|
||||||
|
|
||||||
- dos/sys: add support for sys/exe combos
|
|
||||||
|
|
||||||
- linux/i386:
|
- linux/i386:
|
||||||
- use the new assembly preprocessor stuff (ie. process the file
|
- use the new assembly preprocessor stuff (ie. process the file
|
||||||
headers internally)
|
headers internally)
|
||||||
@@ -68,8 +66,7 @@ Existing formats:
|
|||||||
|
|
||||||
- win32/pe: display a nice dialog box in the stub in case
|
- win32/pe: display a nice dialog box in the stub in case
|
||||||
of problems (like importing a DLL or function fails)
|
of problems (like importing a DLL or function fails)
|
||||||
- win32/pe: finer control over resource compression, per section
|
- win32/pe: per section compression
|
||||||
compression
|
|
||||||
|
|
||||||
|
|
||||||
Compression ratio:
|
Compression ratio:
|
||||||
|
|||||||
@@ -8,36 +8,11 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2006 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2006 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
http://upx.sourceforge.net
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WARNING - UNSTABLE BETA VERSION
|
|
||||||
===============================
|
|
||||||
|
|
||||||
All versions 1.9x are unstable beta releases - use them only for testing,
|
|
||||||
and never distribute a program that is packed with them !
|
|
||||||
There will be hidden bugs. Really.
|
|
||||||
|
|
||||||
The current stable release is 1.25, and the next stable release
|
|
||||||
will be called version 2.00.
|
|
||||||
|
|
||||||
The main news since 1.25 are:
|
|
||||||
- slightly better compression using the new NRV2E algorithm
|
|
||||||
- new options for compression tuning (e.g. `--brute')
|
|
||||||
- support for bootable Linux kernels ("vmlinuz/386")
|
|
||||||
- support for Linux kernel building ("vmlinux/386")
|
|
||||||
- direct Linux ELF-to-memory decompression ("linux/elf386") and
|
|
||||||
shell-to-memory decompression ("linux/sh386")
|
|
||||||
- support for arm/WinCE ("arm/pe") exes
|
|
||||||
- support for mach/ppc32
|
|
||||||
- support for Linux elf/ppc32
|
|
||||||
- support for Linux elf/amd64
|
|
||||||
- support for playstation exes ("ps1/exe")
|
|
||||||
- lots of new bugs ;-) take care
|
|
||||||
|
|
||||||
|
|
||||||
WELCOME
|
WELCOME
|
||||||
=======
|
=======
|
||||||
|
|
||||||
@@ -62,7 +37,7 @@ and run exactly as before, with no runtime or memory penalty for most
|
|||||||
of the supported formats.
|
of the supported formats.
|
||||||
|
|
||||||
UPX supports a number of different executable formats, including
|
UPX supports a number of different executable formats, including
|
||||||
Windows 95/98/ME/NT/2000/XP programs and DLLs, DOS programs,
|
Windows 95/98/ME/NT/2000/XP/CE programs and DLLs, DOS programs,
|
||||||
and Linux executables and kernels.
|
and Linux executables and kernels.
|
||||||
|
|
||||||
UPX is free software distributed under the term of the GNU General
|
UPX is free software distributed under the term of the GNU General
|
||||||
@@ -80,8 +55,8 @@ UPX aims to be Commercial Quality Freeware.
|
|||||||
SHORT DOCUMENTATION
|
SHORT DOCUMENTATION
|
||||||
===================
|
===================
|
||||||
|
|
||||||
`upx program.exe' will compress a program or DLL. For best compression
|
'upx program.exe' will compress a program or DLL. For best compression
|
||||||
results try `upx --best program.exe'.
|
results try 'upx --brute program.exe'.
|
||||||
|
|
||||||
Please see the file UPX.DOC for the full documentation. The files
|
Please see the file UPX.DOC for the full documentation. The files
|
||||||
NEWS and BUGS also contain various tidbits of information.
|
NEWS and BUGS also contain various tidbits of information.
|
||||||
@@ -95,7 +70,7 @@ UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.
|
|||||||
Having said that, we think that UPX is quite stable now. Indeed we
|
Having said that, we think that UPX is quite stable now. Indeed we
|
||||||
have compressed lots of files without any problems. Also, the
|
have compressed lots of files without any problems. Also, the
|
||||||
current version has undergone several months of beta testing -
|
current version has undergone several months of beta testing -
|
||||||
actually it's more than 4 years since our first public beta.
|
actually it's almost 8 years since our first public beta.
|
||||||
|
|
||||||
This is the first production quality release, and we plan that future
|
This is the first production quality release, and we plan that future
|
||||||
releases will be backward compatible with this version.
|
releases will be backward compatible with this version.
|
||||||
@@ -135,6 +110,7 @@ COPYRIGHT
|
|||||||
|
|
||||||
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2006 Laszlo Molnar
|
Copyright (C) 1996-2006 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2006 John F. Reiser
|
||||||
|
|
||||||
This program may be used freely, and you are welcome to
|
This program may be used freely, and you are welcome to
|
||||||
redistribute it under certain conditions.
|
redistribute it under certain conditions.
|
||||||
|
|||||||
+17
-22
@@ -8,31 +8,26 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2006 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2006 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
http://upx.sourceforge.net
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WARNING - UNSTABLE BETA VERSION
|
MAJOR NEWS IN UPX 2
|
||||||
===============================
|
===================
|
||||||
|
|
||||||
All versions 1.9x are unstable beta releases - use them only for testing,
|
|
||||||
and never distribute a program that is packed with them !
|
|
||||||
There will be hidden bugs. Really.
|
|
||||||
|
|
||||||
The current stable release is 1.25, and the next stable release
|
|
||||||
will be called version 2.00.
|
|
||||||
|
|
||||||
The main news since 1.25 are:
|
The main news since 1.25 are:
|
||||||
- slightly better compression using the new NRV2E algorithm
|
|
||||||
- new options for compression tuning (e.g. `--brute')
|
* new format: added support for arm/pe (ARM executables running on WinCE)
|
||||||
- support for bootable Linux kernels ("vmlinuz/386")
|
* new format: added support for linux elf/amd64
|
||||||
- support for Linux kernel building ("vmlinux/386")
|
* new format: added support for linux elf/ppc32
|
||||||
- direct Linux ELF-to-memory decompression ("linux/elf386") and
|
* new format: added support for mach/ppc32 (Apple Mac OS X)
|
||||||
shell-to-memory decompression ("linux/sh386")
|
* new format: added support for bootable Linux kernels ("vmlinuz/386")
|
||||||
- support for arm/WinCE ("arm/pe") exes
|
* new format: added support for Playstation exes ("ps1/exe")
|
||||||
- support for mach/ppc32
|
|
||||||
- support for Linux elf/ppc32
|
* slightly better compression using the new NRV2E algorithm
|
||||||
- support for Linux elf/amd64
|
* new options for compression tuning (e.g. '--brute')
|
||||||
- support for playstation exes ("ps1/exe")
|
* improved win32/pe compatibility
|
||||||
- lots of new bugs ;-) take care
|
* direct ELF-to-memory decompression
|
||||||
|
* various bug fixes
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -69,11 +69,7 @@ Tools needed to build/modify the UPX sources
|
|||||||
- A C++ compiler supporting inner classes, templates, exceptions
|
- A C++ compiler supporting inner classes, templates, exceptions
|
||||||
and RTTI.
|
and RTTI.
|
||||||
|
|
||||||
- GNU make 3.80 for Win32
|
- GNU make 3.80 or better
|
||||||
http://www.cygwin.com/
|
|
||||||
|
|
||||||
- GNU make 3.80 for DOS
|
|
||||||
http://www.delorie.com/djgpp/
|
|
||||||
|
|
||||||
|
|
||||||
To compile the packer sources
|
To compile the packer sources
|
||||||
@@ -96,26 +92,31 @@ To compile the packer sources
|
|||||||
If you want to modify the stub sources you'll also need
|
If you want to modify the stub sources you'll also need
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
- Nasm 0.98.38 - the Netwide Assembler
|
|
||||||
http://upx.sourceforge.net/download/tools/
|
|
||||||
http://sourceforge.net/projects/nasm/
|
|
||||||
|
|
||||||
- A68K - a 68000 macro assembler
|
- A68K - a 68000 macro assembler
|
||||||
http://upx.sourceforge.net/download/tools/
|
http://upx.sourceforge.net/download/tools/
|
||||||
|
|
||||||
|
- ASM5900 - a MIPS R3000 assembler
|
||||||
|
http://upx.sourceforge.net/download/tools/
|
||||||
|
|
||||||
- djasm - an assembler for the djgpp stub
|
- djasm - an assembler for the djgpp stub
|
||||||
http://upx.sourceforge.net/download/tools/
|
http://upx.sourceforge.net/download/tools/
|
||||||
|
|
||||||
- Perl 5.6 or better
|
- nasm 0.98.39 - the Netwide Assembler
|
||||||
|
http://upx.sourceforge.net/download/tools/
|
||||||
|
http://sourceforge.net/projects/nasm/
|
||||||
|
|
||||||
- Linux (for the linux/386 stubs)
|
- Perl & Python
|
||||||
|
|
||||||
|
- Certain versions of some i386-linux tools:
|
||||||
|
- gcc-2.95.3
|
||||||
|
- gcc-3.4.6
|
||||||
|
- binutils-2.16.1
|
||||||
|
|
||||||
- Other cross compilers targeted at the following architectures:
|
- Other cross compilers targeted at the following architectures:
|
||||||
|
- arm-9tdmi-linux-gnu
|
||||||
- powerpc-750-linux-gnu
|
- powerpc-750-linux-gnu
|
||||||
- x86_64-unknown-linux-gnu
|
- x86_64-unknown-linux-gnu
|
||||||
- arm-wince-pe
|
|
||||||
|
|
||||||
- ASM5900 - a MIPS R3000 assembler
|
|
||||||
|
|
||||||
Misc. notes
|
Misc. notes
|
||||||
-----------
|
-----------
|
||||||
@@ -130,8 +131,7 @@ Misc. notes
|
|||||||
- Use gcc extensions and other compiler specific stuff only through
|
- Use gcc extensions and other compiler specific stuff only through
|
||||||
macros.
|
macros.
|
||||||
- Keep in mind that it should be possible to build UPX on braindead
|
- Keep in mind that it should be possible to build UPX on braindead
|
||||||
file systems (FAT). Don't use long file names or other things
|
case insensitive file systems (FAT).
|
||||||
that break building under plain DOS.
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2006 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2006 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
http://upx.sourceforge.net
|
||||||
|
|
||||||
|
|
||||||
@@ -39,12 +39,12 @@ Ice
|
|||||||
for debugging the PE headersize problem down
|
for debugging the PE headersize problem down
|
||||||
Joergen Ibsen <jibz@hotmail.com> and d'b
|
Joergen Ibsen <jibz@hotmail.com> and d'b
|
||||||
for the relocation & address optimization ideas
|
for the relocation & address optimization ideas
|
||||||
John F. Reiser <jreiser@BitWagon.com>
|
|
||||||
for the new Linux executable formats
|
|
||||||
John S. Fine <johnfine@erols.com>
|
John S. Fine <johnfine@erols.com>
|
||||||
for the new version of the dos/exe decompressor
|
for the new version of the dos/exe decompressor
|
||||||
Lukundoo <Lukundoo@softhome.net>
|
Lukundoo <Lukundoo@softhome.net>
|
||||||
for beta testing
|
for beta testing
|
||||||
|
Michael Devore
|
||||||
|
for initial dos/exe device driver support
|
||||||
Oleg V. Volkov <rover@lglobus.ru>
|
Oleg V. Volkov <rover@lglobus.ru>
|
||||||
for various FreeBSD specific informations
|
for various FreeBSD specific informations
|
||||||
The Owl & G-RoM
|
The Owl & G-RoM
|
||||||
|
|||||||
@@ -105,9 +105,6 @@ FORMAT WIN32/PE
|
|||||||
|
|
||||||
- decrease runtime memory overhead
|
- decrease runtime memory overhead
|
||||||
|
|
||||||
2 - easy - mfx + ml) new switch(es) : do not compress resource types x,y,z
|
|
||||||
or resource names a,b,c
|
|
||||||
|
|
||||||
3 - difficult) don't compress the BSS section and other holes.
|
3 - difficult) don't compress the BSS section and other holes.
|
||||||
|
|
||||||
4 - medium - ml) fix when objectalign < 0x1000
|
4 - medium - ml) fix when objectalign < 0x1000
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
upx.1
|
|
||||||
upx.doc
|
|
||||||
upx.html
|
|
||||||
upx.man
|
|
||||||
upx.ps
|
|
||||||
upx.tex
|
|
||||||
+4
-4
@@ -1,9 +1,11 @@
|
|||||||
|
MAKEFLAGS += -rR
|
||||||
|
.SUFFIXES:
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
|
|
||||||
top_srcdir = ..
|
top_srcdir = ..
|
||||||
|
|
||||||
PACKAGE = upx
|
PACKAGE = upx
|
||||||
VERSION_DATE = 11 Mar 2006
|
VERSION_DATE := $(shell sed -n 's/^.*UPX_VERSION_DATE_ISO .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
|
||||||
VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
|
VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
|
||||||
|
|
||||||
TRIMSPACE = cat
|
TRIMSPACE = cat
|
||||||
@@ -62,7 +64,5 @@ maintainer-clean: distclean
|
|||||||
### dependencies
|
### dependencies
|
||||||
###
|
###
|
||||||
|
|
||||||
$(BUILT_SOURCES): $(top_srcdir)/src/version.h Makefile
|
$(BUILT_SOURCES): $(top_srcdir)/src/version.h $(MAKEFILE_LIST)
|
||||||
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
|
|||||||
+28
-7
@@ -13,7 +13,7 @@ B<upx> S<[ I<command> ]> S<[ I<options> ]> I<filename>...
|
|||||||
=head1 ABSTRACT
|
=head1 ABSTRACT
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2006 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2006 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
http://upx.sourceforge.net
|
||||||
|
|
||||||
|
|
||||||
@@ -75,9 +75,10 @@ B<UPX> is a versatile executable packer with the following features:
|
|||||||
* rtm32/pe
|
* rtm32/pe
|
||||||
* tmt/adam
|
* tmt/adam
|
||||||
* vmlinuz/386 [bootable Linux kernel]
|
* vmlinuz/386 [bootable Linux kernel]
|
||||||
|
* vmlinux/386
|
||||||
* watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
|
* watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
|
||||||
* win32/pe
|
* win32/pe (exe and dll)
|
||||||
* arm/pe
|
* arm/pe (exe and dll)
|
||||||
* linux/elfamd64
|
* linux/elfamd64
|
||||||
* linux/elfppc32
|
* linux/elfppc32
|
||||||
* mach/elfppc32
|
* mach/elfppc32
|
||||||
@@ -339,9 +340,6 @@ Extra options available for this executable format:
|
|||||||
|
|
||||||
=head2 NOTES FOR DOS/SYS
|
=head2 NOTES FOR DOS/SYS
|
||||||
|
|
||||||
You can only compress plain sys files, sys/exe (two in one)
|
|
||||||
combos are not supported.
|
|
||||||
|
|
||||||
Compressed programs only work on a 286+.
|
Compressed programs only work on a 286+.
|
||||||
|
|
||||||
Packed programs will be byte-identical to the original after uncompression.
|
Packed programs will be byte-identical to the original after uncompression.
|
||||||
@@ -840,12 +838,19 @@ smaller, but it's still there.
|
|||||||
If you're running executables from network, then compressed programs
|
If you're running executables from network, then compressed programs
|
||||||
will load faster, and require less bandwidth during execution.
|
will load faster, and require less bandwidth during execution.
|
||||||
|
|
||||||
DLLs are supported.
|
DLLs are supported. But UPX compressed DLLs can not share common data and
|
||||||
|
code when they got used by multiple applications. So compressing msvcrt.dll
|
||||||
|
is a waste of memory, but compressing the dll plugins of a particular
|
||||||
|
application may be a better idea.
|
||||||
|
|
||||||
Screensavers are supported, with the restriction that the filename
|
Screensavers are supported, with the restriction that the filename
|
||||||
must end with ".scr" (as screensavers are handled slightly different
|
must end with ".scr" (as screensavers are handled slightly different
|
||||||
than normal exe files).
|
than normal exe files).
|
||||||
|
|
||||||
|
UPX compressed PE files has some minor memory overhead (usually in the
|
||||||
|
10 - 30 kbytes range) which can be seen by specifying the "-i" command
|
||||||
|
line switch during compression.
|
||||||
|
|
||||||
Extra options available for this executable format:
|
Extra options available for this executable format:
|
||||||
|
|
||||||
--compress-exports=0 Don't compress the export section.
|
--compress-exports=0 Don't compress the export section.
|
||||||
@@ -865,6 +870,22 @@ Extra options available for this executable format:
|
|||||||
|
|
||||||
--compress-resources=0 Don't compress any resources at all.
|
--compress-resources=0 Don't compress any resources at all.
|
||||||
|
|
||||||
|
--keep-resource=list Don't compress resources specified by the list.
|
||||||
|
The members of the list are separated by commas.
|
||||||
|
A list member has the following format: I<type[/name]>.
|
||||||
|
I<Type> is the type of the resource. Standard types
|
||||||
|
must be specified as decimal numbers, user types can be
|
||||||
|
specified by decimal IDs or strings. I<Name> is the
|
||||||
|
identifier of the resource. It can be a decimal number
|
||||||
|
or a string. For example:
|
||||||
|
|
||||||
|
--keep-resource=2/MYBITMAP,5,6/12345
|
||||||
|
|
||||||
|
UPX won't compress the named bitmap resource "MYBITMAP",
|
||||||
|
it leaves every dialog (5) resource uncompressed, and
|
||||||
|
it won't touch the string table resource with identifier
|
||||||
|
12345.
|
||||||
|
|
||||||
--force Force compression even when there is an
|
--force Force compression even when there is an
|
||||||
unexpected value in a header field.
|
unexpected value in a header field.
|
||||||
Use with care.
|
Use with care.
|
||||||
|
|||||||
-3220
File diff suppressed because it is too large
Load Diff
@@ -1,19 +0,0 @@
|
|||||||
*.0??
|
|
||||||
*.d
|
|
||||||
*.dat
|
|
||||||
*.idb
|
|
||||||
*.img
|
|
||||||
*.map
|
|
||||||
*.raw
|
|
||||||
*.rc
|
|
||||||
*.rel
|
|
||||||
*.res
|
|
||||||
*.pdb
|
|
||||||
*.out
|
|
||||||
*.upx
|
|
||||||
.gdbinit
|
|
||||||
GNUmakefile
|
|
||||||
MMakefile
|
|
||||||
compress_nrv.*
|
|
||||||
upx
|
|
||||||
version1*.h
|
|
||||||
+21
-3
@@ -262,9 +262,12 @@ struct BE16
|
|||||||
BE16& operator += (unsigned v) { set_be16(d, get_be16(d) + v); return *this; }
|
BE16& operator += (unsigned v) { set_be16(d, get_be16(d) + v); return *this; }
|
||||||
BE16& operator -= (unsigned v) { set_be16(d, get_be16(d) - v); return *this; }
|
BE16& operator -= (unsigned v) { set_be16(d, get_be16(d) - v); return *this; }
|
||||||
BE16& operator *= (unsigned v) { set_be16(d, get_be16(d) * v); return *this; }
|
BE16& operator *= (unsigned v) { set_be16(d, get_be16(d) * v); return *this; }
|
||||||
|
BE16& operator /= (unsigned v) { set_be16(d, get_be16(d) / v); return *this; }
|
||||||
BE16& operator &= (unsigned v) { set_be16(d, get_be16(d) & v); return *this; }
|
BE16& operator &= (unsigned v) { set_be16(d, get_be16(d) & v); return *this; }
|
||||||
BE16& operator |= (unsigned v) { set_be16(d, get_be16(d) | v); return *this; }
|
BE16& operator |= (unsigned v) { set_be16(d, get_be16(d) | v); return *this; }
|
||||||
BE16& operator ^= (unsigned v) { set_be16(d, get_be16(d) ^ v); return *this; }
|
BE16& operator ^= (unsigned v) { set_be16(d, get_be16(d) ^ v); return *this; }
|
||||||
|
BE16& operator <<= (unsigned v) { set_be16(d, get_be16(d) << v); return *this; }
|
||||||
|
BE16& operator >>= (unsigned v) { set_be16(d, get_be16(d) >> v); return *this; }
|
||||||
|
|
||||||
operator unsigned () const { return get_be16(d); }
|
operator unsigned () const { return get_be16(d); }
|
||||||
}
|
}
|
||||||
@@ -279,9 +282,12 @@ struct BE32
|
|||||||
BE32& operator += (unsigned v) { set_be32(d, get_be32(d) + v); return *this; }
|
BE32& operator += (unsigned v) { set_be32(d, get_be32(d) + v); return *this; }
|
||||||
BE32& operator -= (unsigned v) { set_be32(d, get_be32(d) - v); return *this; }
|
BE32& operator -= (unsigned v) { set_be32(d, get_be32(d) - v); return *this; }
|
||||||
BE32& operator *= (unsigned v) { set_be32(d, get_be32(d) * v); return *this; }
|
BE32& operator *= (unsigned v) { set_be32(d, get_be32(d) * v); return *this; }
|
||||||
|
BE32& operator /= (unsigned v) { set_be32(d, get_be32(d) / v); return *this; }
|
||||||
BE32& operator &= (unsigned v) { set_be32(d, get_be32(d) & v); return *this; }
|
BE32& operator &= (unsigned v) { set_be32(d, get_be32(d) & v); return *this; }
|
||||||
BE32& operator |= (unsigned v) { set_be32(d, get_be32(d) | v); return *this; }
|
BE32& operator |= (unsigned v) { set_be32(d, get_be32(d) | v); return *this; }
|
||||||
BE32& operator ^= (unsigned v) { set_be32(d, get_be32(d) ^ v); return *this; }
|
BE32& operator ^= (unsigned v) { set_be32(d, get_be32(d) ^ v); return *this; }
|
||||||
|
BE32& operator <<= (unsigned v) { set_be32(d, get_be32(d) << v); return *this; }
|
||||||
|
BE32& operator >>= (unsigned v) { set_be32(d, get_be32(d) >> v); return *this; }
|
||||||
|
|
||||||
operator unsigned () const { return get_be32(d); }
|
operator unsigned () const { return get_be32(d); }
|
||||||
}
|
}
|
||||||
@@ -296,9 +302,12 @@ struct BE64
|
|||||||
BE64& operator += (acc_uint64l_t v) { set_be64(d, get_be64(d) + v); return *this; }
|
BE64& operator += (acc_uint64l_t v) { set_be64(d, get_be64(d) + v); return *this; }
|
||||||
BE64& operator -= (acc_uint64l_t v) { set_be64(d, get_be64(d) - v); return *this; }
|
BE64& operator -= (acc_uint64l_t v) { set_be64(d, get_be64(d) - v); return *this; }
|
||||||
BE64& operator *= (acc_uint64l_t v) { set_be64(d, get_be64(d) * v); return *this; }
|
BE64& operator *= (acc_uint64l_t v) { set_be64(d, get_be64(d) * v); return *this; }
|
||||||
|
BE64& operator /= (acc_uint64l_t v) { set_be64(d, get_be64(d) / v); return *this; }
|
||||||
BE64& operator &= (acc_uint64l_t v) { set_be64(d, get_be64(d) & v); return *this; }
|
BE64& operator &= (acc_uint64l_t v) { set_be64(d, get_be64(d) & v); return *this; }
|
||||||
BE64& operator |= (acc_uint64l_t v) { set_be64(d, get_be64(d) | v); return *this; }
|
BE64& operator |= (acc_uint64l_t v) { set_be64(d, get_be64(d) | v); return *this; }
|
||||||
BE64& operator ^= (acc_uint64l_t v) { set_be64(d, get_be64(d) ^ v); return *this; }
|
BE64& operator ^= (acc_uint64l_t v) { set_be64(d, get_be64(d) ^ v); return *this; }
|
||||||
|
BE64& operator <<= (unsigned v) { set_be64(d, get_be64(d) << v); return *this; }
|
||||||
|
BE64& operator >>= (unsigned v) { set_be64(d, get_be64(d) >> v); return *this; }
|
||||||
|
|
||||||
operator acc_uint64l_t () const { return get_be64(d); }
|
operator acc_uint64l_t () const { return get_be64(d); }
|
||||||
}
|
}
|
||||||
@@ -313,9 +322,12 @@ struct LE16
|
|||||||
LE16& operator += (unsigned v) { set_le16(d, get_le16(d) + v); return *this; }
|
LE16& operator += (unsigned v) { set_le16(d, get_le16(d) + v); return *this; }
|
||||||
LE16& operator -= (unsigned v) { set_le16(d, get_le16(d) - v); return *this; }
|
LE16& operator -= (unsigned v) { set_le16(d, get_le16(d) - v); return *this; }
|
||||||
LE16& operator *= (unsigned v) { set_le16(d, get_le16(d) * v); return *this; }
|
LE16& operator *= (unsigned v) { set_le16(d, get_le16(d) * v); return *this; }
|
||||||
|
LE16& operator /= (unsigned v) { set_le16(d, get_le16(d) / v); return *this; }
|
||||||
LE16& operator &= (unsigned v) { set_le16(d, get_le16(d) & v); return *this; }
|
LE16& operator &= (unsigned v) { set_le16(d, get_le16(d) & v); return *this; }
|
||||||
LE16& operator |= (unsigned v) { set_le16(d, get_le16(d) | v); return *this; }
|
LE16& operator |= (unsigned v) { set_le16(d, get_le16(d) | v); return *this; }
|
||||||
LE16& operator ^= (unsigned v) { set_le16(d, get_le16(d) ^ v); return *this; }
|
LE16& operator ^= (unsigned v) { set_le16(d, get_le16(d) ^ v); return *this; }
|
||||||
|
LE16& operator <<= (unsigned v) { set_le16(d, get_le16(d) << v); return *this; }
|
||||||
|
LE16& operator >>= (unsigned v) { set_le16(d, get_le16(d) >> v); return *this; }
|
||||||
|
|
||||||
operator unsigned () const { return get_le16(d); }
|
operator unsigned () const { return get_le16(d); }
|
||||||
}
|
}
|
||||||
@@ -330,9 +342,12 @@ struct LE32
|
|||||||
LE32& operator += (unsigned v) { set_le32(d, get_le32(d) + v); return *this; }
|
LE32& operator += (unsigned v) { set_le32(d, get_le32(d) + v); return *this; }
|
||||||
LE32& operator -= (unsigned v) { set_le32(d, get_le32(d) - v); return *this; }
|
LE32& operator -= (unsigned v) { set_le32(d, get_le32(d) - v); return *this; }
|
||||||
LE32& operator *= (unsigned v) { set_le32(d, get_le32(d) * v); return *this; }
|
LE32& operator *= (unsigned v) { set_le32(d, get_le32(d) * v); return *this; }
|
||||||
|
LE32& operator /= (unsigned v) { set_le32(d, get_le32(d) / v); return *this; }
|
||||||
LE32& operator &= (unsigned v) { set_le32(d, get_le32(d) & v); return *this; }
|
LE32& operator &= (unsigned v) { set_le32(d, get_le32(d) & v); return *this; }
|
||||||
LE32& operator |= (unsigned v) { set_le32(d, get_le32(d) | v); return *this; }
|
LE32& operator |= (unsigned v) { set_le32(d, get_le32(d) | v); return *this; }
|
||||||
LE32& operator ^= (unsigned v) { set_le32(d, get_le32(d) ^ v); return *this; }
|
LE32& operator ^= (unsigned v) { set_le32(d, get_le32(d) ^ v); return *this; }
|
||||||
|
LE32& operator <<= (unsigned v) { set_le32(d, get_le32(d) << v); return *this; }
|
||||||
|
LE32& operator >>= (unsigned v) { set_le32(d, get_le32(d) >> v); return *this; }
|
||||||
|
|
||||||
operator unsigned () const { return get_le32(d); }
|
operator unsigned () const { return get_le32(d); }
|
||||||
}
|
}
|
||||||
@@ -347,9 +362,12 @@ struct LE64
|
|||||||
LE64& operator += (acc_uint64l_t v) { set_le64(d, get_le64(d) + v); return *this; }
|
LE64& operator += (acc_uint64l_t v) { set_le64(d, get_le64(d) + v); return *this; }
|
||||||
LE64& operator -= (acc_uint64l_t v) { set_le64(d, get_le64(d) - v); return *this; }
|
LE64& operator -= (acc_uint64l_t v) { set_le64(d, get_le64(d) - v); return *this; }
|
||||||
LE64& operator *= (acc_uint64l_t v) { set_le64(d, get_le64(d) * v); return *this; }
|
LE64& operator *= (acc_uint64l_t v) { set_le64(d, get_le64(d) * v); return *this; }
|
||||||
|
LE64& operator /= (acc_uint64l_t v) { set_le64(d, get_le64(d) / v); return *this; }
|
||||||
LE64& operator &= (acc_uint64l_t v) { set_le64(d, get_le64(d) & v); return *this; }
|
LE64& operator &= (acc_uint64l_t v) { set_le64(d, get_le64(d) & v); return *this; }
|
||||||
LE64& operator |= (acc_uint64l_t v) { set_le64(d, get_le64(d) | v); return *this; }
|
LE64& operator |= (acc_uint64l_t v) { set_le64(d, get_le64(d) | v); return *this; }
|
||||||
LE64& operator ^= (acc_uint64l_t v) { set_le64(d, get_le64(d) ^ v); return *this; }
|
LE64& operator ^= (acc_uint64l_t v) { set_le64(d, get_le64(d) ^ v); return *this; }
|
||||||
|
LE64& operator <<= (unsigned v) { set_le64(d, get_le64(d) << v); return *this; }
|
||||||
|
LE64& operator >>= (unsigned v) { set_le64(d, get_le64(d) >> v); return *this; }
|
||||||
|
|
||||||
operator acc_uint64l_t () const { return get_le64(d); }
|
operator acc_uint64l_t () const { return get_le64(d); }
|
||||||
}
|
}
|
||||||
@@ -430,7 +448,7 @@ int __acc_cdecl_qsort le64_compare_signed(const void *, const void *);
|
|||||||
# ifndef LE16
|
# ifndef LE16
|
||||||
# define LE16 LE16_unaligned
|
# define LE16 LE16_unaligned
|
||||||
# endif
|
# endif
|
||||||
# ifndef LE16
|
# ifndef LE32
|
||||||
# define LE32 LE32_unaligned
|
# define LE32 LE32_unaligned
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@@ -440,7 +458,7 @@ int __acc_cdecl_qsort le64_compare_signed(const void *, const void *);
|
|||||||
# ifndef LE16
|
# ifndef LE16
|
||||||
# define LE16 LE16_unaligned
|
# define LE16 LE16_unaligned
|
||||||
# endif
|
# endif
|
||||||
# ifndef LE16
|
# ifndef LE32
|
||||||
# define LE32 LE32_unaligned
|
# define LE32 LE32_unaligned
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@@ -450,7 +468,7 @@ int __acc_cdecl_qsort le64_compare_signed(const void *, const void *);
|
|||||||
# ifndef LE16
|
# ifndef LE16
|
||||||
# define LE16 LE16_unaligned
|
# define LE16 LE16_unaligned
|
||||||
# endif
|
# endif
|
||||||
# ifndef LE16
|
# ifndef LE32
|
||||||
# define LE32 LE32_unaligned
|
# define LE32 LE32_unaligned
|
||||||
# endif
|
# endif
|
||||||
# pragma warning(disable: 4244) // Wx: conversion, possible loss of data
|
# pragma warning(disable: 4244) // Wx: conversion, possible loss of data
|
||||||
|
|||||||
@@ -292,6 +292,9 @@
|
|||||||
#define index upx_index
|
#define index upx_index
|
||||||
#define outp upx_outp
|
#define outp upx_outp
|
||||||
|
|
||||||
|
#undef PAGE_MASK
|
||||||
|
#undef PAGE_SIZE
|
||||||
|
|
||||||
|
|
||||||
#undef __attribute_packed
|
#undef __attribute_packed
|
||||||
#if (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
|
#if (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -383,6 +383,46 @@ static int s_ct32_e8e9_bswap_be(Filter *f)
|
|||||||
|
|
||||||
#undef CT32
|
#undef CT32
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
// 24-bit ARM calltrick ("naive")
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define CT24ARM(f, cond, addvalue, get, set) \
|
||||||
|
upx_byte *b = f->buf; \
|
||||||
|
upx_byte *b_end = b + f->buf_len - 4; \
|
||||||
|
do { \
|
||||||
|
if (cond) \
|
||||||
|
{ \
|
||||||
|
unsigned a = (unsigned) (b - f->buf); \
|
||||||
|
f->lastcall = a; \
|
||||||
|
set(b, get(b) + (addvalue)); \
|
||||||
|
f->calls++; \
|
||||||
|
} \
|
||||||
|
b += 4; \
|
||||||
|
} while (b < b_end); \
|
||||||
|
if (f->lastcall) f->lastcall += 4; \
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
#define ARMCT_COND (((b[3] & 0x0f) == 0x0b))
|
||||||
|
|
||||||
|
static int f_ct24arm_le(Filter *f)
|
||||||
|
{
|
||||||
|
CT24ARM(f, ARMCT_COND, a / 4 + f->addvalue, get_le24, set_le24)
|
||||||
|
}
|
||||||
|
|
||||||
|
static int u_ct24arm_le(Filter *f)
|
||||||
|
{
|
||||||
|
CT24ARM(f, ARMCT_COND, 0 - a / 4 - f->addvalue, get_le24, set_le24)
|
||||||
|
}
|
||||||
|
|
||||||
|
static int s_ct24arm_le(Filter *f)
|
||||||
|
{
|
||||||
|
CT24ARM(f, ARMCT_COND, a + f->addvalue, get_le24, set_dummy)
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef CT24ARM
|
||||||
|
#undef ARMCT_COND
|
||||||
|
|
||||||
/*
|
/*
|
||||||
vi:ts=4:et:nowrap
|
vi:ts=4:et:nowrap
|
||||||
|
|||||||
+4
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -224,6 +224,9 @@ const FilterImp::FilterEntry FilterImp::filters[] = {
|
|||||||
{ 0x46, 6, 0x00ffffff, f_ctok32_e8e9_bswap_le, u_ctok32_e8e9_bswap_le, s_ctok32_e8e9_bswap_le },
|
{ 0x46, 6, 0x00ffffff, f_ctok32_e8e9_bswap_le, u_ctok32_e8e9_bswap_le, s_ctok32_e8e9_bswap_le },
|
||||||
{ 0x49, 6, 0x00ffffff, f_ctok32_e8e9_bswap_le, u_ctok32_e8e9_bswap_le, s_ctok32_e8e9_bswap_le },
|
{ 0x49, 6, 0x00ffffff, f_ctok32_e8e9_bswap_le, u_ctok32_e8e9_bswap_le, s_ctok32_e8e9_bswap_le },
|
||||||
|
|
||||||
|
// 24-bit calltrick for arm
|
||||||
|
{ 0x50, 8, 0x01ffffff, f_ct24arm_le, u_ct24arm_le, s_ct24arm_le },
|
||||||
|
|
||||||
// 32-bit cto calltrick with jmp and jcc(swap 0x0f/0x8Y) and relative renumbering
|
// 32-bit cto calltrick with jmp and jcc(swap 0x0f/0x8Y) and relative renumbering
|
||||||
{ 0x80, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le },
|
{ 0x80, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le },
|
||||||
{ 0x81, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le },
|
{ 0x81, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le },
|
||||||
|
|||||||
+6
-4
@@ -229,6 +229,7 @@ void show_help(int x)
|
|||||||
" --compress-icons=1 compress all but the first icon\n"
|
" --compress-icons=1 compress all but the first icon\n"
|
||||||
" --compress-icons=2 compress all but the first icon directory [default]\n"
|
" --compress-icons=2 compress all but the first icon directory [default]\n"
|
||||||
" --compress-resources=0 do not compress any resources at all\n"
|
" --compress-resources=0 do not compress any resources at all\n"
|
||||||
|
" --keep-resource=list do not compress resources specified by list\n"
|
||||||
" --strip-relocs=0 do not strip relocations\n"
|
" --strip-relocs=0 do not strip relocations\n"
|
||||||
" --strip-relocs=1 strip relocations [default]\n"
|
" --strip-relocs=1 strip relocations [default]\n"
|
||||||
" --all-methods try all available compression methods\n"
|
" --all-methods try all available compression methods\n"
|
||||||
@@ -256,13 +257,14 @@ void show_help(int x)
|
|||||||
" dos/sys,"
|
" dos/sys,"
|
||||||
"\n "
|
"\n "
|
||||||
//" elks/8086,"
|
//" elks/8086,"
|
||||||
" linux/386,"
|
" linux/amd64,"
|
||||||
" linux/elf386,"
|
" linux/i386,"
|
||||||
" linux/sh386,"
|
" linux/ppc32,"
|
||||||
|
" mach/ppc32,"
|
||||||
" ps1/exe,"
|
" ps1/exe,"
|
||||||
" rtm32/pe,"
|
" rtm32/pe,"
|
||||||
" tmt/adam,"
|
|
||||||
"\n "
|
"\n "
|
||||||
|
" tmt/adam,"
|
||||||
" vmlinux/386,"
|
" vmlinux/386,"
|
||||||
" vmlinuz/386,"
|
" vmlinuz/386,"
|
||||||
" watcom/le,"
|
" watcom/le,"
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -72,6 +72,7 @@ void init_options(struct options_t *o)
|
|||||||
o->win32_pe.compress_rt[i] = -1;
|
o->win32_pe.compress_rt[i] = -1;
|
||||||
o->win32_pe.compress_rt[24] = false; // 24 == RT_MANIFEST
|
o->win32_pe.compress_rt[24] = false; // 24 == RT_MANIFEST
|
||||||
o->win32_pe.strip_relocs = -1;
|
o->win32_pe.strip_relocs = -1;
|
||||||
|
o->win32_pe.keep_resource = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct options_t global_options;
|
static struct options_t global_options;
|
||||||
@@ -702,6 +703,11 @@ static int do_option(int optc, const char *arg)
|
|||||||
opt->win32_pe.strip_relocs = 0;
|
opt->win32_pe.strip_relocs = 0;
|
||||||
//printf("strip_relocs: %d\n", opt->win32_pe.strip_relocs);
|
//printf("strip_relocs: %d\n", opt->win32_pe.strip_relocs);
|
||||||
break;
|
break;
|
||||||
|
case 635:
|
||||||
|
if (!mfx_optarg || !mfx_optarg[0])
|
||||||
|
e_optarg(arg);
|
||||||
|
opt->win32_pe.keep_resource = mfx_optarg;
|
||||||
|
break;
|
||||||
case 650:
|
case 650:
|
||||||
opt->atari_tos.split_segments = true;
|
opt->atari_tos.split_segments = true;
|
||||||
break;
|
break;
|
||||||
@@ -859,6 +865,7 @@ static const struct mfx_option longopts[] =
|
|||||||
{"compress-resources", 2, 0, 632},
|
{"compress-resources", 2, 0, 632},
|
||||||
{"strip-loadconf", 0x12, 0, 633}, // OBSOLETE - IGNORED
|
{"strip-loadconf", 0x12, 0, 633}, // OBSOLETE - IGNORED
|
||||||
{"strip-relocs", 0x12, 0, 634},
|
{"strip-relocs", 0x12, 0, 634},
|
||||||
|
{"keep-resource", 0x31, 0, 635},
|
||||||
// ps1/exe
|
// ps1/exe
|
||||||
{"boot-only", 0x10, 0, 670},
|
{"boot-only", 0x10, 0, 670},
|
||||||
{"no-align", 0x10, 0, 671},
|
{"no-align", 0x10, 0, 671},
|
||||||
@@ -941,6 +948,7 @@ static const struct mfx_option longopts[] =
|
|||||||
{"compress-resources", 2, 0, 632},
|
{"compress-resources", 2, 0, 632},
|
||||||
{"strip-loadconf", 0x12, 0, 633}, // OBSOLETE - IGNORED
|
{"strip-loadconf", 0x12, 0, 633}, // OBSOLETE - IGNORED
|
||||||
{"strip-relocs", 0x12, 0, 634},
|
{"strip-relocs", 0x12, 0, 634},
|
||||||
|
{"keep-resource", 0x31, 0, 635},
|
||||||
|
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
@@ -1070,6 +1078,8 @@ static int test(void)
|
|||||||
assert( (v1 < v2)); assert(!(v1 > v2));
|
assert( (v1 < v2)); assert(!(v1 > v2));
|
||||||
v2 += 2;
|
v2 += 2;
|
||||||
assert(v1 == 1); assert(v2 == 0);
|
assert(v1 == 1); assert(v2 == 0);
|
||||||
|
v1 <<= 1; v1 |= v2; v1 >>= 1; v2 &= v1; v2 /= v1; v2 *= v1;
|
||||||
|
assert(v1 == 1); assert(v2 == 0);
|
||||||
return (v1 ^ v2) == 1;
|
return (v1 ^ v2) == 1;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1118,7 +1128,7 @@ void upx_sanity_check(void)
|
|||||||
assert(memcmp(UPX_VERSION_DATE + strlen(UPX_VERSION_DATE) - 4, UPX_VERSION_YEAR, 4) == 0);
|
assert(memcmp(UPX_VERSION_DATE + strlen(UPX_VERSION_DATE) - 4, UPX_VERSION_YEAR, 4) == 0);
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
# if 1
|
# if 1 && !defined(UPX_OFFICIAL_BUILD)
|
||||||
assert(TestBELE<LE16>::test());
|
assert(TestBELE<LE16>::test());
|
||||||
assert(TestBELE<LE32>::test());
|
assert(TestBELE<LE32>::test());
|
||||||
assert(TestBELE<LE64>::test());
|
assert(TestBELE<LE64>::test());
|
||||||
|
|||||||
+5
-3
@@ -60,6 +60,8 @@ static int mcheck_init()
|
|||||||
MemBuffer::MemBuffer() :
|
MemBuffer::MemBuffer() :
|
||||||
b(NULL), b_size(0)
|
b(NULL), b_size(0)
|
||||||
{
|
{
|
||||||
|
if (use_mcheck < 0)
|
||||||
|
mcheck_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
MemBuffer::MemBuffer(unsigned size) :
|
MemBuffer::MemBuffer(unsigned size) :
|
||||||
@@ -87,7 +89,7 @@ void MemBuffer::dealloc()
|
|||||||
set_be32(b + b_size, 0);
|
set_be32(b + b_size, 0);
|
||||||
set_be32(b + b_size + 4, 0);
|
set_be32(b + b_size + 4, 0);
|
||||||
//
|
//
|
||||||
::free(b - 8);
|
::free(b - 16);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
::free(b);
|
::free(b);
|
||||||
@@ -173,7 +175,7 @@ void MemBuffer::alloc(unsigned size)
|
|||||||
assert(b_size == 0);
|
assert(b_size == 0);
|
||||||
//
|
//
|
||||||
assert((int)size > 0);
|
assert((int)size > 0);
|
||||||
unsigned total = use_mcheck ? size + 16 : size;
|
unsigned total = use_mcheck ? size + 32 : size;
|
||||||
assert((int)total > 0);
|
assert((int)total > 0);
|
||||||
unsigned char *p = (unsigned char *) malloc(total);
|
unsigned char *p = (unsigned char *) malloc(total);
|
||||||
if (!p)
|
if (!p)
|
||||||
@@ -185,7 +187,7 @@ void MemBuffer::alloc(unsigned size)
|
|||||||
b_size = size;
|
b_size = size;
|
||||||
if (use_mcheck)
|
if (use_mcheck)
|
||||||
{
|
{
|
||||||
b = p + 8;
|
b = p + 16;
|
||||||
// store magic constants to detect buffer overruns
|
// store magic constants to detect buffer overruns
|
||||||
set_be32(b - 8, b_size);
|
set_be32(b - 8, b_size);
|
||||||
set_be32(b - 4, MAGIC1(b));
|
set_be32(b - 4, MAGIC1(b));
|
||||||
|
|||||||
+99
-22
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#ifndef __ACC_H_INCLUDED
|
#ifndef __ACC_H_INCLUDED
|
||||||
#define __ACC_H_INCLUDED 1
|
#define __ACC_H_INCLUDED 1
|
||||||
#define ACC_VERSION 20060309L
|
#define ACC_VERSION 20060404L
|
||||||
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
|
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
|
||||||
# define __CYGWIN__ __CYGWIN32__
|
# define __CYGWIN__ __CYGWIN32__
|
||||||
#endif
|
#endif
|
||||||
@@ -330,6 +330,9 @@
|
|||||||
# define ACC_INFO_OS "freestanding"
|
# define ACC_INFO_OS "freestanding"
|
||||||
#elif defined(ACC_OS_EMBEDDED)
|
#elif defined(ACC_OS_EMBEDDED)
|
||||||
# define ACC_INFO_OS "embedded"
|
# define ACC_INFO_OS "embedded"
|
||||||
|
#elif 1 && defined(__IAR_SYSTEMS_ICC__)
|
||||||
|
# define ACC_OS_EMBEDDED 1
|
||||||
|
# define ACC_INFO_OS "embedded"
|
||||||
#elif defined(__CYGWIN__) && defined(__GNUC__)
|
#elif defined(__CYGWIN__) && defined(__GNUC__)
|
||||||
# define ACC_OS_CYGWIN 1
|
# define ACC_OS_CYGWIN 1
|
||||||
# define ACC_INFO_OS "cygwin"
|
# define ACC_INFO_OS "cygwin"
|
||||||
@@ -573,6 +576,14 @@
|
|||||||
# define ACC_CC_HIGHC 1
|
# define ACC_CC_HIGHC 1
|
||||||
# define ACC_INFO_CC "MetaWare High C"
|
# define ACC_INFO_CC "MetaWare High C"
|
||||||
# define ACC_INFO_CCVER "unknown"
|
# define ACC_INFO_CCVER "unknown"
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__)
|
||||||
|
# define ACC_CC_IARC 1
|
||||||
|
# define ACC_INFO_CC "IAR C"
|
||||||
|
# if defined(__VER__)
|
||||||
|
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__VER__)
|
||||||
|
# else
|
||||||
|
# define ACC_INFO_CCVER "unknown"
|
||||||
|
# endif
|
||||||
#elif defined(__IBMC__)
|
#elif defined(__IBMC__)
|
||||||
# define ACC_CC_IBMC 1
|
# define ACC_CC_IBMC 1
|
||||||
# define ACC_INFO_CC "IBM C"
|
# define ACC_INFO_CC "IBM C"
|
||||||
@@ -704,6 +715,16 @@
|
|||||||
# define ACC_ARCH_ARM 1
|
# define ACC_ARCH_ARM 1
|
||||||
# define ACC_ARCH_ARM_THUMB 1
|
# define ACC_ARCH_ARM_THUMB 1
|
||||||
# define ACC_INFO_ARCH "arm_thumb"
|
# define ACC_INFO_ARCH "arm_thumb"
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
|
||||||
|
# define ACC_ARCH_ARM 1
|
||||||
|
# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
|
||||||
|
# define ACC_ARCH_ARM_THUMB 1
|
||||||
|
# define ACC_INFO_ARCH "arm_thumb"
|
||||||
|
# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
|
||||||
|
# define ACC_INFO_ARCH "arm"
|
||||||
|
# else
|
||||||
|
# define ACC_INFO_ARCH "arm"
|
||||||
|
# endif
|
||||||
#elif defined(__arm__) || defined(_M_ARM)
|
#elif defined(__arm__) || defined(_M_ARM)
|
||||||
# define ACC_ARCH_ARM 1
|
# define ACC_ARCH_ARM 1
|
||||||
# define ACC_INFO_ARCH "arm"
|
# define ACC_INFO_ARCH "arm"
|
||||||
@@ -719,6 +740,9 @@
|
|||||||
#elif defined(__cris__)
|
#elif defined(__cris__)
|
||||||
# define ACC_ARCH_CRIS 1
|
# define ACC_ARCH_CRIS 1
|
||||||
# define ACC_INFO_ARCH "cris"
|
# define ACC_INFO_ARCH "cris"
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
|
||||||
|
# define ACC_ARCH_EZ80 1
|
||||||
|
# define ACC_INFO_ARCH "ez80"
|
||||||
#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
|
#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
|
||||||
# define ACC_ARCH_H8300 1
|
# define ACC_ARCH_H8300 1
|
||||||
# define ACC_INFO_ARCH "h8300"
|
# define ACC_INFO_ARCH "h8300"
|
||||||
@@ -743,10 +767,13 @@
|
|||||||
#elif (UINT_MAX == ACC_0xffffL) && defined(__m32c__)
|
#elif (UINT_MAX == ACC_0xffffL) && defined(__m32c__)
|
||||||
# define ACC_ARCH_M16C 1
|
# define ACC_ARCH_M16C 1
|
||||||
# define ACC_INFO_ARCH "m16c"
|
# define ACC_INFO_ARCH "m16c"
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
|
||||||
|
# define ACC_ARCH_M16C 1
|
||||||
|
# define ACC_INFO_ARCH "m16c"
|
||||||
#elif defined(__m32r__)
|
#elif defined(__m32r__)
|
||||||
# define ACC_ARCH_M32R 1
|
# define ACC_ARCH_M32R 1
|
||||||
# define ACC_INFO_ARCH "m32r"
|
# define ACC_INFO_ARCH "m32r"
|
||||||
#elif (ACC_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(_M_M68K)
|
#elif (ACC_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K)
|
||||||
# define ACC_ARCH_M68K 1
|
# define ACC_ARCH_M68K 1
|
||||||
# define ACC_INFO_ARCH "m68k"
|
# define ACC_INFO_ARCH "m68k"
|
||||||
#elif (UINT_MAX == ACC_0xffffL) && defined(__C251__)
|
#elif (UINT_MAX == ACC_0xffffL) && defined(__C251__)
|
||||||
@@ -755,12 +782,18 @@
|
|||||||
#elif (UINT_MAX == ACC_0xffffL) && defined(__C51__)
|
#elif (UINT_MAX == ACC_0xffffL) && defined(__C51__)
|
||||||
# define ACC_ARCH_MCS51 1
|
# define ACC_ARCH_MCS51 1
|
||||||
# define ACC_INFO_ARCH "mcs51"
|
# define ACC_INFO_ARCH "mcs51"
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
|
||||||
|
# define ACC_ARCH_MCS51 1
|
||||||
|
# define ACC_INFO_ARCH "mcs51"
|
||||||
#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
|
#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
|
||||||
# define ACC_ARCH_MIPS 1
|
# define ACC_ARCH_MIPS 1
|
||||||
# define ACC_INFO_ARCH "mips"
|
# define ACC_INFO_ARCH "mips"
|
||||||
#elif (UINT_MAX == ACC_0xffffL) && defined(__MSP430__)
|
#elif (UINT_MAX == ACC_0xffffL) && defined(__MSP430__)
|
||||||
# define ACC_ARCH_MSP430 1
|
# define ACC_ARCH_MSP430 1
|
||||||
# define ACC_INFO_ARCH "msp430"
|
# define ACC_INFO_ARCH "msp430"
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
|
||||||
|
# define ACC_ARCH_MSP430 1
|
||||||
|
# define ACC_INFO_ARCH "msp430"
|
||||||
#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
|
#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
|
||||||
# define ACC_ARCH_POWERPC 1
|
# define ACC_ARCH_POWERPC 1
|
||||||
# define ACC_INFO_ARCH "powerpc"
|
# define ACC_INFO_ARCH "powerpc"
|
||||||
@@ -1256,6 +1289,12 @@ extern "C" {
|
|||||||
# define ACC_ABI_LITTLE_ENDIAN 1
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
#elif (ACC_ARCH_M68K || ACC_ARCH_S390)
|
#elif (ACC_ARCH_M68K || ACC_ARCH_S390)
|
||||||
# define ACC_ABI_BIG_ENDIAN 1
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
|
#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
|
||||||
|
# if (__LITTLE_ENDIAN__ == 1)
|
||||||
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
|
# else
|
||||||
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
|
# endif
|
||||||
#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
||||||
# define ACC_ABI_BIG_ENDIAN 1
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
|
#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
|
||||||
@@ -1328,6 +1367,9 @@ extern "C" {
|
|||||||
#elif (ACC_CC_MWERKS) && defined(__MSL__)
|
#elif (ACC_CC_MWERKS) && defined(__MSL__)
|
||||||
# define ACC_LIBC_MSL __MSL__
|
# define ACC_LIBC_MSL __MSL__
|
||||||
# define ACC_INFO_LIBC "msl"
|
# define ACC_INFO_LIBC "msl"
|
||||||
|
#elif 1 && defined(__IAR_SYSTEMS_ICC__)
|
||||||
|
# define ACC_LIBC_ISOC90 1
|
||||||
|
# define ACC_INFO_LIBC "isoc90"
|
||||||
#else
|
#else
|
||||||
# define ACC_LIBC_DEFAULT 1
|
# define ACC_LIBC_DEFAULT 1
|
||||||
# define ACC_INFO_LIBC "default"
|
# define ACC_INFO_LIBC "default"
|
||||||
@@ -1815,11 +1857,11 @@ extern "C" {
|
|||||||
#elif (ACC_OS_EMX)
|
#elif (ACC_OS_EMX)
|
||||||
# define HAVE_ALLOCA_H 1
|
# define HAVE_ALLOCA_H 1
|
||||||
# define HAVE_IO_H 1
|
# define HAVE_IO_H 1
|
||||||
#elif (ACC_OS_TOS && ACC_CC_GNUC)
|
#elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
|
||||||
# if !defined(__MINT__)
|
# if !defined(__MINT__)
|
||||||
# undef HAVE_MALLOC_H
|
# undef HAVE_MALLOC_H
|
||||||
# endif
|
# endif
|
||||||
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
||||||
# undef HAVE_DIRENT_H
|
# undef HAVE_DIRENT_H
|
||||||
# undef HAVE_FCNTL_H
|
# undef HAVE_FCNTL_H
|
||||||
# undef HAVE_MALLOC_H
|
# undef HAVE_MALLOC_H
|
||||||
@@ -1982,7 +2024,10 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99)
|
#if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99)
|
||||||
# undef HAVE_DIRENT_H
|
# undef HAVE_DIRENT_H
|
||||||
|
# undef HAVE_FCNTL_H
|
||||||
|
# undef HAVE_MALLOC_H
|
||||||
# undef HAVE_UNISTD_H
|
# undef HAVE_UNISTD_H
|
||||||
|
# undef HAVE_UTIME_H
|
||||||
# undef HAVE_SYS_STAT_H
|
# undef HAVE_SYS_STAT_H
|
||||||
# undef HAVE_SYS_TIME_H
|
# undef HAVE_SYS_TIME_H
|
||||||
# undef HAVE_SYS_TYPES_H
|
# undef HAVE_SYS_TYPES_H
|
||||||
@@ -2027,6 +2072,7 @@ extern "C" {
|
|||||||
#define HAVE_FSTAT 1
|
#define HAVE_FSTAT 1
|
||||||
#define HAVE_GETTIMEOFDAY 1
|
#define HAVE_GETTIMEOFDAY 1
|
||||||
#define HAVE_GMTIME 1
|
#define HAVE_GMTIME 1
|
||||||
|
#define HAVE_ISATTY 1
|
||||||
#define HAVE_LOCALTIME 1
|
#define HAVE_LOCALTIME 1
|
||||||
#define HAVE_LONGJMP 1
|
#define HAVE_LONGJMP 1
|
||||||
#define HAVE_LSTAT 1
|
#define HAVE_LSTAT 1
|
||||||
@@ -2034,9 +2080,11 @@ extern "C" {
|
|||||||
#define HAVE_MEMCPY 1
|
#define HAVE_MEMCPY 1
|
||||||
#define HAVE_MEMMOVE 1
|
#define HAVE_MEMMOVE 1
|
||||||
#define HAVE_MEMSET 1
|
#define HAVE_MEMSET 1
|
||||||
|
#define HAVE_MKDIR 1
|
||||||
#define HAVE_MKTIME 1
|
#define HAVE_MKTIME 1
|
||||||
#define HAVE_QSORT 1
|
#define HAVE_QSORT 1
|
||||||
#define HAVE_RAISE 1
|
#define HAVE_RAISE 1
|
||||||
|
#define HAVE_RMDIR 1
|
||||||
#define HAVE_SETJMP 1
|
#define HAVE_SETJMP 1
|
||||||
#define HAVE_SIGNAL 1
|
#define HAVE_SIGNAL 1
|
||||||
#define HAVE_SNPRINTF 1
|
#define HAVE_SNPRINTF 1
|
||||||
@@ -2094,12 +2142,12 @@ extern "C" {
|
|||||||
#elif (ACC_OS_EMX)
|
#elif (ACC_OS_EMX)
|
||||||
# undef HAVE_CHOWN
|
# undef HAVE_CHOWN
|
||||||
# undef HAVE_LSTAT
|
# undef HAVE_LSTAT
|
||||||
#elif (ACC_OS_TOS && ACC_CC_GNUC)
|
#elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
|
||||||
# if !defined(__MINT__)
|
# if !defined(__MINT__)
|
||||||
# undef HAVE_SNPRINTF
|
# undef HAVE_SNPRINTF
|
||||||
# undef HAVE_VSNPRINTF
|
# undef HAVE_VSNPRINTF
|
||||||
# endif
|
# endif
|
||||||
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
||||||
# undef HAVE_ALLOCA
|
# undef HAVE_ALLOCA
|
||||||
# undef HAVE_ACCESS
|
# undef HAVE_ACCESS
|
||||||
# undef HAVE_CHMOD
|
# undef HAVE_CHMOD
|
||||||
@@ -2290,6 +2338,15 @@ extern "C" {
|
|||||||
# undef HAVE_STAT
|
# undef HAVE_STAT
|
||||||
# undef HAVE_UMASK
|
# undef HAVE_UMASK
|
||||||
# undef HAVE_UTIME
|
# undef HAVE_UTIME
|
||||||
|
# if 1
|
||||||
|
# undef HAVE_ALLOCA
|
||||||
|
# undef HAVE_ISATTY
|
||||||
|
# undef HAVE_MKDIR
|
||||||
|
# undef HAVE_RMDIR
|
||||||
|
# undef HAVE_STRDUP
|
||||||
|
# undef HAVE_STRICMP
|
||||||
|
# undef HAVE_STRNICMP
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -3571,7 +3628,7 @@ ACCLIB_EXTERN_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoi
|
|||||||
#if !defined(ACC_FN_NAME_MAX)
|
#if !defined(ACC_FN_NAME_MAX)
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
||||||
# define ACC_FN_NAME_MAX 12
|
# define ACC_FN_NAME_MAX 12
|
||||||
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
||||||
# define ACC_FN_NAME_MAX 12
|
# define ACC_FN_NAME_MAX 12
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
||||||
#elif (ACC_OS_DOS32)
|
#elif (ACC_OS_DOS32)
|
||||||
@@ -3593,7 +3650,7 @@ ACCLIB_EXTERN(int, acc_fnmatch) (const acc_hchar_p, const acc_hchar_p, int);
|
|||||||
# if (ACC_OS_DOS32 && defined(__BORLANDC__))
|
# if (ACC_OS_DOS32 && defined(__BORLANDC__))
|
||||||
# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
||||||
# elif (ACC_OS_OS2 || ACC_OS_OS216)
|
# elif (ACC_OS_OS2 || ACC_OS_OS216)
|
||||||
# elif (ACC_OS_TOS && ACC_CC_GNUC)
|
# elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
|
||||||
# elif (ACC_OS_WIN32 && !defined(ACC_HAVE_WINDOWS_H))
|
# elif (ACC_OS_WIN32 && !defined(ACC_HAVE_WINDOWS_H))
|
||||||
# elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
# elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
||||||
# undef __ACCLIB_USE_OPENDIR
|
# undef __ACCLIB_USE_OPENDIR
|
||||||
@@ -3671,6 +3728,7 @@ ACCLIB_EXTERN(int, acc_closedir) (acc_dir_p);
|
|||||||
ACCLIB_EXTERN(acclib_handle_t, acc_get_osfhandle) (int);
|
ACCLIB_EXTERN(acclib_handle_t, acc_get_osfhandle) (int);
|
||||||
ACCLIB_EXTERN(int, acc_isatty) (int);
|
ACCLIB_EXTERN(int, acc_isatty) (int);
|
||||||
ACCLIB_EXTERN(int, acc_mkdir) (const char*, unsigned);
|
ACCLIB_EXTERN(int, acc_mkdir) (const char*, unsigned);
|
||||||
|
ACCLIB_EXTERN(int, acc_rmdir) (const char*);
|
||||||
ACCLIB_EXTERN(int, acc_response) (int*, char***);
|
ACCLIB_EXTERN(int, acc_response) (int*, char***);
|
||||||
ACCLIB_EXTERN(int, acc_set_binmode) (int, int);
|
ACCLIB_EXTERN(int, acc_set_binmode) (int, int);
|
||||||
ACCLIB_EXTERN(acc_int32l_t, acc_muldiv32) (acc_int32l_t, acc_int32l_t, acc_int32l_t);
|
ACCLIB_EXTERN(acc_int32l_t, acc_muldiv32) (acc_int32l_t, acc_int32l_t, acc_int32l_t);
|
||||||
@@ -3745,7 +3803,7 @@ struct acc_pclock_handle_t {
|
|||||||
const char* name;
|
const char* name;
|
||||||
int (*gettime) (acc_pclock_handle_p, acc_pclock_p);
|
int (*gettime) (acc_pclock_handle_p, acc_pclock_p);
|
||||||
#if defined(acc_int64l_t)
|
#if defined(acc_int64l_t)
|
||||||
acc_int64l_t ticks_base;
|
acc_uint64l_t ticks_base;
|
||||||
#endif
|
#endif
|
||||||
#if defined(__ACCLIB_PCLOCK_USE_PERFCTR)
|
#if defined(__ACCLIB_PCLOCK_USE_PERFCTR)
|
||||||
acc_perfctr_handle_t pch;
|
acc_perfctr_handle_t pch;
|
||||||
@@ -4094,7 +4152,8 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
|
|||||||
ACCCHK_ASSERT((~0l & ~0u) == ~0u)
|
ACCCHK_ASSERT((~0l & ~0u) == ~0u)
|
||||||
ACCCHK_ASSERT((~0ul & ~0) == ~0ul)
|
ACCCHK_ASSERT((~0ul & ~0) == ~0ul)
|
||||||
ACCCHK_ASSERT((~0ul & ~0u) == ~0u)
|
ACCCHK_ASSERT((~0ul & ~0u) == ~0u)
|
||||||
#if (SIZEOF_INT == 2)
|
#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
|
||||||
|
#elif (SIZEOF_INT == 2)
|
||||||
ACCCHK_ASSERT((~0l & ~0u) == 0xffffU)
|
ACCCHK_ASSERT((~0l & ~0u) == 0xffffU)
|
||||||
ACCCHK_ASSERT((~0ul & ~0u) == 0xffffU)
|
ACCCHK_ASSERT((~0ul & ~0u) == 0xffffU)
|
||||||
#elif (SIZEOF_INT == 4)
|
#elif (SIZEOF_INT == 4)
|
||||||
@@ -4205,7 +4264,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
|
|||||||
ACCCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
|
ACCCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
|
||||||
ACCCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
|
ACCCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
|
||||||
#endif
|
#endif
|
||||||
#if (ACC_CC_TURBOC && (__TURBOC__ < 0x0150))
|
#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
|
||||||
#elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
|
#elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
|
||||||
#else
|
#else
|
||||||
ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
|
ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
|
||||||
@@ -4223,7 +4282,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
|
|||||||
ACCCHK_ASSERT(sizeof(acc_int16e_t) == sizeof(acc_uint16e_t))
|
ACCCHK_ASSERT(sizeof(acc_int16e_t) == sizeof(acc_uint16e_t))
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(acc_int16e_t)
|
ACCCHK_ASSERT_IS_SIGNED_T(acc_int16e_t)
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint16e_t)
|
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint16e_t)
|
||||||
#if (ACC_CC_TURBOC && (__TURBOC__ < 0x0150))
|
#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
|
||||||
#else
|
#else
|
||||||
ACCCHK_ASSERT(((acc_uint16e_t)(~(acc_uint16e_t)0ul) >> 15) == 1)
|
ACCCHK_ASSERT(((acc_uint16e_t)(~(acc_uint16e_t)0ul) >> 15) == 1)
|
||||||
#endif
|
#endif
|
||||||
@@ -4773,7 +4832,7 @@ ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p dest, const acc_hvoid_p src
|
|||||||
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY)
|
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY)
|
||||||
acc_hbyte_p p1 = (acc_hbyte_p) dest;
|
acc_hbyte_p p1 = (acc_hbyte_p) dest;
|
||||||
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
|
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
|
||||||
if (len <= 0 || p1 == p2)
|
if (!(len > 0) || p1 == p2)
|
||||||
return dest;
|
return dest;
|
||||||
do
|
do
|
||||||
*p1++ = *p2++;
|
*p1++ = *p2++;
|
||||||
@@ -4788,7 +4847,7 @@ ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p dest, const acc_hvoid_p sr
|
|||||||
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE)
|
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE)
|
||||||
acc_hbyte_p p1 = (acc_hbyte_p) dest;
|
acc_hbyte_p p1 = (acc_hbyte_p) dest;
|
||||||
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
|
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
|
||||||
if (len <= 0 || p1 == p2)
|
if (!(len > 0) || p1 == p2)
|
||||||
return dest;
|
return dest;
|
||||||
if (p1 < p2)
|
if (p1 < p2)
|
||||||
{
|
{
|
||||||
@@ -5125,7 +5184,7 @@ ACC_EXTERN_C int __far __pascal GlobalUnlock(const void __near*);
|
|||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
|
ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
|
||||||
{
|
{
|
||||||
acc_hvoid_p p = 0;
|
acc_hvoid_p p = 0;
|
||||||
if (size <= 0)
|
if (!(size > 0))
|
||||||
return p;
|
return p;
|
||||||
#if 0 && defined(__palmos__)
|
#if 0 && defined(__palmos__)
|
||||||
p = MemPtrNew(size);
|
p = MemPtrNew(size);
|
||||||
@@ -5405,7 +5464,7 @@ static int acc_pclock_read_clock(acc_pclock_handle_p h, acc_pclock_p c)
|
|||||||
ticks = clock();
|
ticks = clock();
|
||||||
secs = (double)ticks / (CLOCKS_PER_SEC);
|
secs = (double)ticks / (CLOCKS_PER_SEC);
|
||||||
nsecs = (acc_uint64l_t) (secs * 1000000000.0);
|
nsecs = (acc_uint64l_t) (secs * 1000000000.0);
|
||||||
c->tv_sec = nsecs / 1000000000ul;
|
c->tv_sec = (acc_int64l_t) (nsecs / 1000000000ul);
|
||||||
c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
|
c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
|
||||||
#else
|
#else
|
||||||
ticks = clock();
|
ticks = clock();
|
||||||
@@ -5463,7 +5522,7 @@ static int acc_pclock_read_getprocesstimes(acc_pclock_handle_p h, acc_pclock_p c
|
|||||||
h->ticks_base = ticks;
|
h->ticks_base = ticks;
|
||||||
else
|
else
|
||||||
ticks -= h->ticks_base;
|
ticks -= h->ticks_base;
|
||||||
c->tv_sec = ticks / 10000000ul;
|
c->tv_sec = (acc_int64l_t) (ticks / 10000000ul);
|
||||||
c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100u;
|
c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100u;
|
||||||
ACC_UNUSED(h); return 0;
|
ACC_UNUSED(h); return 0;
|
||||||
}
|
}
|
||||||
@@ -5537,7 +5596,7 @@ static int acc_pclock_read_getthreadtimes(acc_pclock_handle_p h, acc_pclock_p c)
|
|||||||
h->ticks_base = ticks;
|
h->ticks_base = ticks;
|
||||||
else
|
else
|
||||||
ticks -= h->ticks_base;
|
ticks -= h->ticks_base;
|
||||||
c->tv_sec = ticks / 10000000ul;
|
c->tv_sec = (acc_int64l_t) (ticks / 10000000ul);
|
||||||
c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100;
|
c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100;
|
||||||
ACC_UNUSED(h); return 0;
|
ACC_UNUSED(h); return 0;
|
||||||
}
|
}
|
||||||
@@ -5819,7 +5878,7 @@ ACCLIB_PUBLIC(int, acc_uclock_close) (acc_uclock_handle_p h)
|
|||||||
ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
|
ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
|
||||||
{
|
{
|
||||||
#if (__ACCLIB_UCLOCK_USE_RDTSC)
|
#if (__ACCLIB_UCLOCK_USE_RDTSC)
|
||||||
acc_tsc_read((acc_uint32e_t*) &c->tsc);
|
acc_tsc_read((acc_uint32e_t*) (void*) &c->tsc);
|
||||||
#endif
|
#endif
|
||||||
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
|
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
|
||||||
if (h->pch.h) {
|
if (h->pch.h) {
|
||||||
@@ -5999,7 +6058,7 @@ ACCLIB_PUBLIC(acclib_handle_t, acc_get_osfhandle) (int fd)
|
|||||||
}
|
}
|
||||||
ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary)
|
ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary)
|
||||||
{
|
{
|
||||||
#if (ACC_OS_TOS && defined(__MINT__))
|
#if (ACC_ARCH_M68K && ACC_OS_TOS && defined(__MINT__))
|
||||||
FILE* fp; int old_binary;
|
FILE* fp; int old_binary;
|
||||||
if (fd == STDIN_FILENO) fp = stdin;
|
if (fd == STDIN_FILENO) fp = stdin;
|
||||||
else if (fd == STDOUT_FILENO) fp = stdout;
|
else if (fd == STDOUT_FILENO) fp = stdout;
|
||||||
@@ -6008,7 +6067,7 @@ ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary)
|
|||||||
old_binary = fp->__mode.__binary;
|
old_binary = fp->__mode.__binary;
|
||||||
__set_binmode(fp, binary ? 1 : 0);
|
__set_binmode(fp, binary ? 1 : 0);
|
||||||
return old_binary ? 1 : 0;
|
return old_binary ? 1 : 0;
|
||||||
#elif (ACC_OS_TOS)
|
#elif (ACC_ARCH_M68K && ACC_OS_TOS)
|
||||||
ACC_UNUSED(fd); ACC_UNUSED(binary);
|
ACC_UNUSED(fd); ACC_UNUSED(binary);
|
||||||
return -1;
|
return -1;
|
||||||
#elif (ACC_OS_DOS16 && (ACC_CC_AZTECC || ACC_CC_PACIFICC))
|
#elif (ACC_OS_DOS16 && (ACC_CC_AZTECC || ACC_CC_PACIFICC))
|
||||||
@@ -6092,11 +6151,18 @@ ACCLIB_PUBLIC(int, acc_isatty) (int fd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_ISATTY)
|
||||||
return (isatty(fd)) ? 1 : 0;
|
return (isatty(fd)) ? 1 : 0;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
|
ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
|
||||||
{
|
{
|
||||||
#if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
#if !defined(HAVE_MKDIR)
|
||||||
|
ACC_UNUSED(name); ACC_UNUSED(mode);
|
||||||
|
return -1;
|
||||||
|
#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
||||||
ACC_UNUSED(mode);
|
ACC_UNUSED(mode);
|
||||||
return Dcreate(name);
|
return Dcreate(name);
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
||||||
@@ -6114,6 +6180,17 @@ ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
|
|||||||
return mkdir(name, mode);
|
return mkdir(name, mode);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
ACCLIB_PUBLIC(int, acc_rmdir) (const char* name)
|
||||||
|
{
|
||||||
|
#if !defined(HAVE_RMDIR)
|
||||||
|
ACC_UNUSED(name);
|
||||||
|
return -1;
|
||||||
|
#elif ((ACC_OS_DOS16 || ACC_OS_DOS32) && (ACC_CC_HIGHC || ACC_CC_PACIFICC))
|
||||||
|
return rmdir((char *) name);
|
||||||
|
#else
|
||||||
|
return rmdir(name);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
ACCLIB_PUBLIC(acc_int32l_t, acc_muldiv32) (acc_int32l_t a, acc_int32l_t b, acc_int32l_t x)
|
ACCLIB_PUBLIC(acc_int32l_t, acc_muldiv32) (acc_int32l_t a, acc_int32l_t b, acc_int32l_t x)
|
||||||
{
|
{
|
||||||
acc_int32l_t r = 0;
|
acc_int32l_t r = 0;
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ struct options_t {
|
|||||||
int compress_resources;
|
int compress_resources;
|
||||||
signed char compress_rt[25]; // 25 == RT_LAST
|
signed char compress_rt[25]; // 25 == RT_LAST
|
||||||
int strip_relocs;
|
int strip_relocs;
|
||||||
|
const char *keep_resource;
|
||||||
} win32_pe;
|
} win32_pe;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+645
-155
File diff suppressed because it is too large
Load Diff
+9
-3
@@ -37,7 +37,7 @@ class PackArmPe_Export;
|
|||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// w32/pe
|
// arm/pe
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
class PackArmPe : public Packer
|
class PackArmPe : public Packer
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
// unpacker capabilities
|
// unpacker capabilities
|
||||||
virtual bool canUnpackVersion(int version) const
|
virtual bool canUnpackVersion(int version) const
|
||||||
{ UNUSED(version); return false; }
|
{ return version == 13; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int readFileHeader();
|
virtual int readFileHeader();
|
||||||
@@ -72,7 +72,7 @@ protected:
|
|||||||
unsigned pe_offset;
|
unsigned pe_offset;
|
||||||
|
|
||||||
unsigned processImports();
|
unsigned processImports();
|
||||||
void processImports(unsigned);
|
void processImports(unsigned, unsigned);
|
||||||
void rebuildImports(upx_byte *&);
|
void rebuildImports(upx_byte *&);
|
||||||
upx_byte *oimport;
|
upx_byte *oimport;
|
||||||
unsigned soimport;
|
unsigned soimport;
|
||||||
@@ -118,6 +118,12 @@ protected:
|
|||||||
unsigned crelocs; // rva of preprocessed fixups
|
unsigned crelocs; // rva of preprocessed fixups
|
||||||
int big_relocs;
|
int big_relocs;
|
||||||
|
|
||||||
|
bool use_thumb_stub;
|
||||||
|
|
||||||
|
void createLinker(const void *pdata, int plen, int pinfo);
|
||||||
|
int rpatch_le32(void *b, int blen, const void *old, unsigned new_,
|
||||||
|
PackArmPe_Reloc &, unsigned);
|
||||||
|
|
||||||
struct pe_header_t
|
struct pe_header_t
|
||||||
{
|
{
|
||||||
// 0x0
|
// 0x0
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+21
-2
@@ -80,7 +80,6 @@ int PackExe::fillExeHeader(struct exe_header_t *eh) const
|
|||||||
memset(&oh,0,sizeof(oh));
|
memset(&oh,0,sizeof(oh));
|
||||||
oh.ident = 'M' + 'Z' * 256;
|
oh.ident = 'M' + 'Z' * 256;
|
||||||
oh.headsize16 = 2;
|
oh.headsize16 = 2;
|
||||||
oh.ip = 0;
|
|
||||||
|
|
||||||
oh.sp = ih.sp > 0x200 ? (unsigned) ih.sp : 0x200;
|
oh.sp = ih.sp > 0x200 ? (unsigned) ih.sp : 0x200;
|
||||||
|
|
||||||
@@ -108,7 +107,11 @@ int PackExe::buildLoader(const Filter *)
|
|||||||
|
|
||||||
// prepare loader
|
// prepare loader
|
||||||
initLoader(nrv_loader,sizeof(nrv_loader));
|
initLoader(nrv_loader,sizeof(nrv_loader));
|
||||||
|
if (device_driver)
|
||||||
|
addLoader("DEVICEENTRY", NULL);
|
||||||
addLoader("EXEENTRY",
|
addLoader("EXEENTRY",
|
||||||
|
device_driver ? "DEVICESUB" : "EXESUB",
|
||||||
|
"JNCDOCOPY",
|
||||||
relocsize ? "EXERELPU" : "",
|
relocsize ? "EXERELPU" : "",
|
||||||
"EXEMAIN4,+G5DXXXX,UPX1HEAD,EXECUTPO",
|
"EXEMAIN4,+G5DXXXX,UPX1HEAD,EXECUTPO",
|
||||||
NULL
|
NULL
|
||||||
@@ -162,6 +165,7 @@ int PackExe::buildLoader(const Filter *)
|
|||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
addLoader("EXEMAIN8",
|
addLoader("EXEMAIN8",
|
||||||
|
device_driver ? "DEVICEEND" : "",
|
||||||
(flag & SS) ? "EXESTACK" : "",
|
(flag & SS) ? "EXESTACK" : "",
|
||||||
(flag & SP) ? "EXESTASP" : "",
|
(flag & SP) ? "EXESTASP" : "",
|
||||||
(flag & USEJUMP) ? "EXEJUMPF" : "",
|
(flag & USEJUMP) ? "EXEJUMPF" : "",
|
||||||
@@ -367,6 +371,8 @@ void PackExe::pack(OutputFile *fo)
|
|||||||
|
|
||||||
checkAlreadyPacked(ibuf, UPX_MIN(ih_imagesize, 127u));
|
checkAlreadyPacked(ibuf, UPX_MIN(ih_imagesize, 127u));
|
||||||
|
|
||||||
|
device_driver = get_le32(ibuf) == 0xffffffffu;
|
||||||
|
|
||||||
// relocations
|
// relocations
|
||||||
has_9a = false;
|
has_9a = false;
|
||||||
upx_byte *w = ibuf + ih_imagesize;
|
upx_byte *w = ibuf + ih_imagesize;
|
||||||
@@ -523,6 +529,19 @@ void PackExe::pack(OutputFile *fo)
|
|||||||
oh.m512 = outputlen & 511;
|
oh.m512 = outputlen & 511;
|
||||||
oh.p512 = (outputlen + 511) >> 9;
|
oh.p512 = (outputlen + 511) >> 9;
|
||||||
|
|
||||||
|
oh.ip = 0;
|
||||||
|
if (device_driver)
|
||||||
|
{
|
||||||
|
patch_le16(loader, e_len, "OP", oh.sp);
|
||||||
|
patch_le16(loader, e_len, "OS", oh.ss);
|
||||||
|
// copy .sys header
|
||||||
|
memcpy(loader + 4, ibuf + 4, 2);
|
||||||
|
memcpy(loader + 8, ibuf + 8, 2);
|
||||||
|
// copy original strategy
|
||||||
|
memcpy(loader + 10, ibuf + 6, 2);
|
||||||
|
oh.ip = getLoaderSection("EXEENTRY") - 2;
|
||||||
|
}
|
||||||
|
|
||||||
//fprintf(stderr,"\ne_len=%x d_len=%x clen=%x oo=%x ulen=%x destp=%x copys=%x images=%x",e_len,d_len,packedsize,ph.overlap_overhead,ph.u_len,destpara,copysize,ih_imagesize);
|
//fprintf(stderr,"\ne_len=%x d_len=%x clen=%x oo=%x ulen=%x destp=%x copys=%x images=%x",e_len,d_len,packedsize,ph.overlap_overhead,ph.u_len,destpara,copysize,ih_imagesize);
|
||||||
|
|
||||||
// write header + write loader + compressed file
|
// write header + write loader + compressed file
|
||||||
@@ -567,7 +586,7 @@ int PackExe::canUnpack()
|
|||||||
return false;
|
return false;
|
||||||
const off_t off = ih.headsize16 * 16;
|
const off_t off = ih.headsize16 * 16;
|
||||||
fi->seek(off, SEEK_SET);
|
fi->seek(off, SEEK_SET);
|
||||||
bool b = readPackHeader(128);
|
bool b = readPackHeader(256);
|
||||||
return b && (off + (off_t) ph.c_len <= file_size);
|
return b && (off + (off_t) ph.c_len <= file_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -98,6 +98,7 @@ protected:
|
|||||||
unsigned relocsize;
|
unsigned relocsize;
|
||||||
|
|
||||||
bool has_9a;
|
bool has_9a;
|
||||||
|
bool device_driver;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
NORELOC = 1,
|
NORELOC = 1,
|
||||||
|
|||||||
+229
-50
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -267,6 +270,134 @@ umax(unsigned a, unsigned b)
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
PackLinuxElf32x86::buildLinuxLoader(
|
||||||
|
upx_byte const *const proto,
|
||||||
|
unsigned const szproto,
|
||||||
|
upx_byte const *const fold,
|
||||||
|
unsigned const szfold,
|
||||||
|
Filter const *ft
|
||||||
|
)
|
||||||
|
{
|
||||||
|
initLoader(proto, szproto);
|
||||||
|
|
||||||
|
struct b_info h; memset(&h, 0, sizeof(h));
|
||||||
|
unsigned fold_hdrlen = 0;
|
||||||
|
if (0 < szfold) {
|
||||||
|
cprElfHdr1 const *const hf = (cprElfHdr1 const *)fold;
|
||||||
|
fold_hdrlen = sizeof(hf->ehdr) + hf->ehdr.e_phentsize * hf->ehdr.e_phnum +
|
||||||
|
sizeof(l_info);
|
||||||
|
if (0 == get_le32(fold_hdrlen + fold)) {
|
||||||
|
// inconsistent SIZEOF_HEADERS in *.lds (ld, binutils)
|
||||||
|
fold_hdrlen = umax(0x80, fold_hdrlen);
|
||||||
|
}
|
||||||
|
h.sz_unc = (szfold < fold_hdrlen) ? 0 : (szfold - fold_hdrlen);
|
||||||
|
h.b_method = (unsigned char) ph.method;
|
||||||
|
h.b_ftid = (unsigned char) ph.filter;
|
||||||
|
h.b_cto8 = (unsigned char) ph.filter_cto;
|
||||||
|
}
|
||||||
|
unsigned char const *const uncLoader = fold_hdrlen + fold;
|
||||||
|
|
||||||
|
unsigned char *const cprLoader = new unsigned char[sizeof(h) + h.sz_unc];
|
||||||
|
if (0 < szfold) {
|
||||||
|
unsigned sz_cpr;
|
||||||
|
int r = upx_compress(uncLoader, h.sz_unc, sizeof(h) + cprLoader, &sz_cpr,
|
||||||
|
NULL, ph.method, 10, NULL, NULL );
|
||||||
|
if (r != UPX_E_OK || h.sz_cpr >= h.sz_unc)
|
||||||
|
throwInternalError("loader compression failed");
|
||||||
|
h.sz_cpr = sz_cpr;
|
||||||
|
}
|
||||||
|
memcpy(cprLoader, &h, sizeof(h));
|
||||||
|
|
||||||
|
// This adds the definition to the "library", to be used later.
|
||||||
|
linker->addSection("FOLDEXEC", cprLoader, sizeof(h) + h.sz_cpr);
|
||||||
|
delete [] cprLoader;
|
||||||
|
|
||||||
|
int const n_mru = ft->n_mru; // FIXME: belongs to filter? packerf?
|
||||||
|
|
||||||
|
// Here is a quick summary of the format of the output file:
|
||||||
|
linker->setLoaderAlignOffset(
|
||||||
|
// Elf32_Edhr
|
||||||
|
sizeof(elfout.ehdr) +
|
||||||
|
// Elf32_Phdr: 1 for exec86, 2 for sh86, 3 for elf86
|
||||||
|
(elfout.ehdr.e_phentsize * elfout.ehdr.e_phnum) +
|
||||||
|
// checksum UPX! lsize version format
|
||||||
|
sizeof(l_info) +
|
||||||
|
// PT_DYNAMIC with DT_NEEDED "forwarded" from original file
|
||||||
|
((elfout.ehdr.e_phnum==3) ? (unsigned) elfout.phdr[2].p_memsz : 0) +
|
||||||
|
// p_progid, p_filesize, p_blocksize
|
||||||
|
sizeof(p_info) +
|
||||||
|
// compressed data
|
||||||
|
b_len + ph.c_len );
|
||||||
|
// entry to stub
|
||||||
|
addLoader("LEXEC000", NULL);
|
||||||
|
|
||||||
|
if (ft->id) {
|
||||||
|
{ // decompr, unfilter are separate
|
||||||
|
addLoader("LXUNF000", NULL);
|
||||||
|
addLoader("LXUNF002", NULL);
|
||||||
|
if (0x80==(ft->id & 0xF0)) {
|
||||||
|
if (256==n_mru) {
|
||||||
|
addLoader("MRUBYTE0", NULL);
|
||||||
|
}
|
||||||
|
else if (n_mru) {
|
||||||
|
addLoader("LXMRU005", NULL);
|
||||||
|
}
|
||||||
|
if (n_mru) {
|
||||||
|
addLoader("LXMRU006", NULL);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addLoader("LXMRU007", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (0x40==(ft->id & 0xF0)) {
|
||||||
|
addLoader("LXUNF008", NULL);
|
||||||
|
}
|
||||||
|
addLoader("LXUNF010", NULL);
|
||||||
|
}
|
||||||
|
if (n_mru) {
|
||||||
|
addLoader("LEXEC009", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addLoader("LEXEC010", NULL);
|
||||||
|
addLoader(getDecompressor(), NULL);
|
||||||
|
addLoader("LEXEC015", NULL);
|
||||||
|
if (ft->id) {
|
||||||
|
{ // decompr, unfilter are separate
|
||||||
|
if (0x80!=(ft->id & 0xF0)) {
|
||||||
|
addLoader("LXUNF042", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addFilter32(ft->id);
|
||||||
|
{ // decompr, unfilter are separate
|
||||||
|
if (0x80==(ft->id & 0xF0)) {
|
||||||
|
if (0==n_mru) {
|
||||||
|
addLoader("LXMRU058", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addLoader("LXUNF035", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addLoader("LEXEC017", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
addLoader("IDENTSTR", NULL);
|
||||||
|
addLoader("LEXEC020", NULL);
|
||||||
|
addLoader("FOLDEXEC", NULL);
|
||||||
|
|
||||||
|
char *ptr_cto = (char *)const_cast<unsigned char *>(getLoader());
|
||||||
|
int sz_cto = getLoaderSize();
|
||||||
|
if (0x20==(ft->id & 0xF0) || 0x30==(ft->id & 0xF0)) { // push byte '?' ; cto8
|
||||||
|
patch_le16(ptr_cto, sz_cto, "\x6a?", 0x6a + (ft->cto << 8));
|
||||||
|
checkPatch(NULL, 0, 0, 0); // reset
|
||||||
|
}
|
||||||
|
// PackHeader and overlay_offset at the end of the output file,
|
||||||
|
// after the compressed data.
|
||||||
|
|
||||||
|
return getLoaderSize();
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PackLinuxElf32ppc::buildLinuxLoader(
|
PackLinuxElf32ppc::buildLinuxLoader(
|
||||||
upx_byte const *const proto,
|
upx_byte const *const proto,
|
||||||
@@ -277,7 +408,7 @@ PackLinuxElf32ppc::buildLinuxLoader(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
int const MAX_LOADER_LEN = 4096;
|
int const MAX_LOADER_LEN = 8000;
|
||||||
int *const eof_empty = new int[MAX_LOADER_LEN/sizeof(int)];
|
int *const eof_empty = new int[MAX_LOADER_LEN/sizeof(int)];
|
||||||
eof_empty[0] = -1;
|
eof_empty[0] = -1;
|
||||||
initLoader(eof_empty, MAX_LOADER_LEN, 0, 0);
|
initLoader(eof_empty, MAX_LOADER_LEN, 0, 0);
|
||||||
@@ -317,9 +448,9 @@ PackLinuxElf32ppc::buildLinuxLoader(
|
|||||||
//int const GAP = 128; // must match stub/l_mac_ppc.S
|
//int const GAP = 128; // must match stub/l_mac_ppc.S
|
||||||
//segcmdo.vmsize += sz_unc - sz_cpr + GAP + 64;
|
//segcmdo.vmsize += sz_unc - sz_cpr + GAP + 64;
|
||||||
|
|
||||||
linker->addSection("ELFPPC32", proto, szproto);
|
linker->addSection("ELF32PPC", proto, szproto);
|
||||||
|
|
||||||
addLoader("ELFPPC32", NULL);
|
addLoader("ELF32PPC", NULL);
|
||||||
addLoader("FOLDEXEC", NULL);
|
addLoader("FOLDEXEC", NULL);
|
||||||
return getLoaderSize();
|
return getLoaderSize();
|
||||||
}
|
}
|
||||||
@@ -508,14 +639,6 @@ PackLinuxElf64amd::canPack()
|
|||||||
// throwCantPack("invalid Phdr p_offset; try `--force-execve'");
|
// throwCantPack("invalid Phdr p_offset; try `--force-execve'");
|
||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// detect possible conflict upon invocation
|
|
||||||
acc_uint64l_t const p_vaddr = get_native64(&phdr->p_vaddr);
|
|
||||||
if (p_vaddr < (unsigned)(0x100000 + file_size)
|
|
||||||
|| p_vaddr < (unsigned)(0x100000 + file_size) ) {
|
|
||||||
throwAlreadyPackedByUPX(); // not necessarily, but mostly true
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
exetype = 1;
|
exetype = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -544,6 +667,22 @@ PackLinuxElf32::getbrk(const Elf32_Phdr *phdr, int e_phnum) const
|
|||||||
return brka;
|
return brka;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
off_t
|
||||||
|
PackLinuxElf32::getbase(const Elf32_Phdr *phdr, int e_phnum) const
|
||||||
|
{
|
||||||
|
off_t base = ~0u;
|
||||||
|
for (int j = 0; j < e_phnum; ++phdr, ++j) {
|
||||||
|
if (phdr->PT_LOAD == phdr->p_type) {
|
||||||
|
if (phdr->p_vaddr < (unsigned) base)
|
||||||
|
base = phdr->p_vaddr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (0!=base) {
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
return 0x12000;
|
||||||
|
}
|
||||||
|
|
||||||
off_t
|
off_t
|
||||||
PackLinuxElf64::getbrk(const Elf64_Phdr *phdr, int e_phnum) const
|
PackLinuxElf64::getbrk(const Elf64_Phdr *phdr, int e_phnum) const
|
||||||
{
|
{
|
||||||
@@ -587,12 +726,16 @@ PackLinuxElf32::generateElfHdr(
|
|||||||
|
|
||||||
// Info for OS kernel to set the brk()
|
// Info for OS kernel to set the brk()
|
||||||
if (brka) {
|
if (brka) {
|
||||||
|
#define PAGE_MASK (~0u<<12)
|
||||||
|
// linux-2.6.14 binfmt_elf.c: SIGKILL if (0==.p_memsz) on a page boundary
|
||||||
|
unsigned const brkb = brka | ((0==(~PAGE_MASK & brka)) ? 0x20 : 0);
|
||||||
set_native32(&h2->phdr[1].p_type, PT_LOAD32); // be sure
|
set_native32(&h2->phdr[1].p_type, PT_LOAD32); // be sure
|
||||||
set_native32(&h2->phdr[1].p_offset, 0xfff&brka);
|
set_native32(&h2->phdr[1].p_offset, ~PAGE_MASK & brkb);
|
||||||
set_native32(&h2->phdr[1].p_vaddr, brka);
|
set_native32(&h2->phdr[1].p_vaddr, brkb);
|
||||||
set_native32(&h2->phdr[1].p_paddr, brka);
|
set_native32(&h2->phdr[1].p_paddr, brkb);
|
||||||
h2->phdr[1].p_filesz = 0;
|
h2->phdr[1].p_filesz = 0;
|
||||||
h2->phdr[1].p_memsz = 0;
|
h2->phdr[1].p_memsz = 0;
|
||||||
|
#undef PAGE_MASK
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,12 +768,37 @@ PackLinuxElf64::generateElfHdr(
|
|||||||
|
|
||||||
// Info for OS kernel to set the brk()
|
// Info for OS kernel to set the brk()
|
||||||
if (brka) {
|
if (brka) {
|
||||||
|
#define PAGE_MASK (~0ul<<12)
|
||||||
|
// linux-2.6.14 binfmt_elf.c: SIGKILL if (0==.p_memsz) on a page boundary
|
||||||
|
unsigned const brkb = brka | ((0==(~PAGE_MASK & brka)) ? 0x20 : 0);
|
||||||
set_native32(&h2->phdr[1].p_type, PT_LOAD32); // be sure
|
set_native32(&h2->phdr[1].p_type, PT_LOAD32); // be sure
|
||||||
set_native64(&h2->phdr[1].p_offset, 0xfff&brka);
|
set_native64(&h2->phdr[1].p_offset, ~PAGE_MASK & brkb);
|
||||||
set_native64(&h2->phdr[1].p_vaddr, brka);
|
set_native64(&h2->phdr[1].p_vaddr, brkb);
|
||||||
set_native64(&h2->phdr[1].p_paddr, brka);
|
set_native64(&h2->phdr[1].p_paddr, brkb);
|
||||||
h2->phdr[1].p_filesz = 0;
|
h2->phdr[1].p_filesz = 0;
|
||||||
h2->phdr[1].p_memsz = 0;
|
h2->phdr[1].p_memsz = 0;
|
||||||
|
#undef PAGE_MASK
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PackLinuxElf32x86::generateElfHdr(
|
||||||
|
OutputFile *fo,
|
||||||
|
void const *proto,
|
||||||
|
unsigned const brka
|
||||||
|
)
|
||||||
|
{
|
||||||
|
super::generateElfHdr(fo, proto, brka);
|
||||||
|
|
||||||
|
if (ph.format==UPX_F_LINUX_ELF_i386) {
|
||||||
|
cprElfHdr2 *const h2 = (cprElfHdr2 *)&elfout;
|
||||||
|
assert(2==get_native16(&h2->ehdr.e_phnum));
|
||||||
|
set_native32(&h2->phdr[0].p_flags, ~Elf32_Phdr::PF_W & get_native32(&h2->phdr[0].p_flags));
|
||||||
|
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
||||||
|
fo->write(h2, sizeof(*h2));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assert(false); // unknown ph.format, PackLinuxElf32x86::generateElfHdr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,7 +814,7 @@ PackLinuxElf32ppc::generateElfHdr(
|
|||||||
if (ph.format==UPX_F_LINUX_ELFPPC32) {
|
if (ph.format==UPX_F_LINUX_ELFPPC32) {
|
||||||
cprElfHdr2 *const h2 = (cprElfHdr2 *)&elfout;
|
cprElfHdr2 *const h2 = (cprElfHdr2 *)&elfout;
|
||||||
assert(2==get_native16(&h2->ehdr.e_phnum));
|
assert(2==get_native16(&h2->ehdr.e_phnum));
|
||||||
set_native32(&h2->phdr[0].p_flags, Elf32_Phdr::PF_W | get_native32(&h2->phdr[0].p_flags));
|
set_native32(&h2->phdr[0].p_flags, ~Elf32_Phdr::PF_W & get_native32(&h2->phdr[0].p_flags));
|
||||||
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
||||||
fo->write(h2, sizeof(*h2));
|
fo->write(h2, sizeof(*h2));
|
||||||
}
|
}
|
||||||
@@ -667,7 +835,7 @@ PackLinuxElf64amd::generateElfHdr(
|
|||||||
if (ph.format==UPX_F_LINUX_ELF64_AMD) {
|
if (ph.format==UPX_F_LINUX_ELF64_AMD) {
|
||||||
cprElfHdr2 *const h2 = (cprElfHdr2 *)&elfout;
|
cprElfHdr2 *const h2 = (cprElfHdr2 *)&elfout;
|
||||||
assert(2==get_native16(&h2->ehdr.e_phnum));
|
assert(2==get_native16(&h2->ehdr.e_phnum));
|
||||||
set_native32(&h2->phdr[0].p_flags, Elf64_Phdr::PF_W | get_native32(&h2->phdr[0].p_flags));
|
set_native32(&h2->phdr[0].p_flags, ~Elf64_Phdr::PF_W & get_native32(&h2->phdr[0].p_flags));
|
||||||
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
||||||
fo->write(h2, sizeof(*h2));
|
fo->write(h2, sizeof(*h2));
|
||||||
}
|
}
|
||||||
@@ -941,8 +1109,6 @@ void PackLinuxElf64amd::pack3(OutputFile *fo, Filter &ft)
|
|||||||
fo->write(&zero, frag);
|
fo->write(&zero, frag);
|
||||||
len += frag;
|
len += frag;
|
||||||
|
|
||||||
#undef PAGE_MASK
|
|
||||||
#undef PAGE_SIZE
|
|
||||||
#define PAGE_MASK (~0u<<12)
|
#define PAGE_MASK (~0u<<12)
|
||||||
#define PAGE_SIZE (-PAGE_MASK)
|
#define PAGE_SIZE (-PAGE_MASK)
|
||||||
upx_byte *const p = const_cast<upx_byte *>(getLoader());
|
upx_byte *const p = const_cast<upx_byte *>(getLoader());
|
||||||
@@ -1015,10 +1181,17 @@ void PackLinuxElf32::pack4(OutputFile *fo, Filter &ft)
|
|||||||
set_native32(&elfout.phdr[0].p_filesz, len);
|
set_native32(&elfout.phdr[0].p_filesz, len);
|
||||||
super::pack4(fo, ft); // write PackHeader and overlay_offset
|
super::pack4(fo, ft); // write PackHeader and overlay_offset
|
||||||
|
|
||||||
|
// Cannot pre-round .p_memsz. If .p_filesz < .p_memsz, then kernel
|
||||||
|
// tries to make .bss, which requires PF_W.
|
||||||
|
// But strict SELinux (or PaX, grSecurity) disallows PF_W with PF_X.
|
||||||
|
#if 0 /*{*/
|
||||||
#define PAGE_MASK (~0u<<12)
|
#define PAGE_MASK (~0u<<12)
|
||||||
// pre-calculate for benefit of runtime disappearing act via munmap()
|
// pre-calculate for benefit of runtime disappearing act via munmap()
|
||||||
set_native32(&elfout.phdr[0].p_memsz, PAGE_MASK & (~PAGE_MASK + len));
|
set_native32(&elfout.phdr[0].p_memsz, PAGE_MASK & (~PAGE_MASK + len));
|
||||||
#undef PAGE_MASK
|
#undef PAGE_MASK
|
||||||
|
#else /*}{*/
|
||||||
|
set_native32(&elfout.phdr[0].p_memsz, len);
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
// rewrite Elf header
|
// rewrite Elf header
|
||||||
if (Elf32_Ehdr::ET_DYN==ehdri.e_type) {
|
if (Elf32_Ehdr::ET_DYN==ehdri.e_type) {
|
||||||
@@ -1045,10 +1218,17 @@ void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft)
|
|||||||
set_native64(&elfout.phdr[0].p_filesz, len);
|
set_native64(&elfout.phdr[0].p_filesz, len);
|
||||||
super::pack4(fo, ft); // write PackHeader and overlay_offset
|
super::pack4(fo, ft); // write PackHeader and overlay_offset
|
||||||
|
|
||||||
|
// Cannot pre-round .p_memsz. If .p_filesz < .p_memsz, then kernel
|
||||||
|
// tries to make .bss, which requires PF_W.
|
||||||
|
// But strict SELinux (or PaX, grSecurity) disallows PF_W with PF_X.
|
||||||
|
#if 0 /*{*/
|
||||||
#define PAGE_MASK (~0u<<12)
|
#define PAGE_MASK (~0u<<12)
|
||||||
// pre-calculate for benefit of runtime disappearing act via munmap()
|
// pre-calculate for benefit of runtime disappearing act via munmap()
|
||||||
set_native64(&elfout.phdr[0].p_memsz, PAGE_MASK & (~PAGE_MASK + len));
|
set_native64(&elfout.phdr[0].p_memsz, PAGE_MASK & (~PAGE_MASK + len));
|
||||||
#undef PAGE_MASK
|
#undef PAGE_MASK
|
||||||
|
#else /*}{*/
|
||||||
|
set_native64(&elfout.phdr[0].p_memsz, len);
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
// rewrite Elf header
|
// rewrite Elf header
|
||||||
fo->seek(0, SEEK_SET);
|
fo->seek(0, SEEK_SET);
|
||||||
@@ -1270,20 +1450,20 @@ void PackLinuxElf64::unpack(OutputFile *fo)
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
PackLinuxI386elf::PackLinuxI386elf(InputFile *f) :
|
PackLinuxElf32x86::PackLinuxElf32x86(InputFile *f) :
|
||||||
super(f), phdri(NULL),
|
super(f), phdri(NULL),
|
||||||
file_image(NULL), dynseg(NULL), hashtab(NULL), dynstr(NULL), dynsym(NULL)
|
file_image(NULL), dynseg(NULL), hashtab(NULL), dynstr(NULL), dynsym(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PackLinuxI386elf::~PackLinuxI386elf()
|
PackLinuxElf32x86::~PackLinuxElf32x86()
|
||||||
{
|
{
|
||||||
delete[] file_image;
|
delete[] file_image;
|
||||||
delete[] phdri;
|
delete[] phdri;
|
||||||
}
|
}
|
||||||
|
|
||||||
int const *
|
int const *
|
||||||
PackLinuxI386elf::getFilters() const
|
PackLinuxElf32x86::getFilters() const
|
||||||
{
|
{
|
||||||
static const int filters[] = {
|
static const int filters[] = {
|
||||||
0x49, 0x46,
|
0x49, 0x46,
|
||||||
@@ -1306,7 +1486,7 @@ PackLinuxI386elf::getFilters() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PackLinuxI386elf::buildLoader(const Filter *ft)
|
PackLinuxElf32x86::buildLoader(const Filter *ft)
|
||||||
{
|
{
|
||||||
unsigned char tmp[sizeof(linux_i386elf_fold)];
|
unsigned char tmp[sizeof(linux_i386elf_fold)];
|
||||||
memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold));
|
memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold));
|
||||||
@@ -1329,10 +1509,10 @@ PackLinuxI386elf::buildLoader(const Filter *ft)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PackLinuxI386elf::patchLoader() { }
|
void PackLinuxElf32x86::patchLoader() { }
|
||||||
|
|
||||||
|
|
||||||
bool PackLinuxI386elf::canPack()
|
bool PackLinuxElf32x86::canPack()
|
||||||
{
|
{
|
||||||
unsigned char buf[sizeof(Elf32_Ehdr) + 14*sizeof(Elf32_Phdr)];
|
unsigned char buf[sizeof(Elf32_Ehdr) + 14*sizeof(Elf32_Phdr)];
|
||||||
COMPILE_TIME_ASSERT(sizeof(buf) <= 512);
|
COMPILE_TIME_ASSERT(sizeof(buf) <= 512);
|
||||||
@@ -1344,7 +1524,8 @@ bool PackLinuxI386elf::canPack()
|
|||||||
Elf32_Ehdr const *const ehdr = (Elf32_Ehdr const *)buf;
|
Elf32_Ehdr const *const ehdr = (Elf32_Ehdr const *)buf;
|
||||||
|
|
||||||
// now check the ELF header
|
// now check the ELF header
|
||||||
if (checkEhdr(ehdr) != 0)
|
if (checkEhdr(ehdr, Elf32_Ehdr::EM_386,
|
||||||
|
Elf32_Ehdr::ELFCLASS32, Elf32_Ehdr::ELFDATA2LSB) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// additional requirements for linux/elf386
|
// additional requirements for linux/elf386
|
||||||
@@ -1440,7 +1621,7 @@ bool PackLinuxI386elf::canPack()
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
PackLinuxI386elf::elf_get_offset_from_address(unsigned const addr) const
|
PackLinuxElf32x86::elf_get_offset_from_address(unsigned const addr) const
|
||||||
{
|
{
|
||||||
Elf32_Phdr const *phdr = phdri;
|
Elf32_Phdr const *phdr = phdri;
|
||||||
int j = ehdri.e_phnum;
|
int j = ehdri.e_phnum;
|
||||||
@@ -1454,7 +1635,7 @@ PackLinuxI386elf::elf_get_offset_from_address(unsigned const addr) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void const *
|
void const *
|
||||||
PackLinuxI386elf::elf_find_dynamic(unsigned int const key) const
|
PackLinuxElf32x86::elf_find_dynamic(unsigned int const key) const
|
||||||
{
|
{
|
||||||
Elf32_Dyn const *dynp= dynseg;
|
Elf32_Dyn const *dynp= dynseg;
|
||||||
if (dynp)
|
if (dynp)
|
||||||
@@ -1468,7 +1649,7 @@ PackLinuxI386elf::elf_find_dynamic(unsigned int const key) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned PackLinuxI386elf::elf_hash(char const *p)
|
unsigned PackLinuxElf32x86::elf_hash(char const *p)
|
||||||
{
|
{
|
||||||
unsigned h;
|
unsigned h;
|
||||||
for (h= 0; 0!=*p; ++p) {
|
for (h= 0; 0!=*p; ++p) {
|
||||||
@@ -1482,7 +1663,7 @@ unsigned PackLinuxI386elf::elf_hash(char const *p)
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
Elf32_Sym const *PackLinuxI386elf::elf_lookup(char const *name) const
|
Elf32_Sym const *PackLinuxElf32x86::elf_lookup(char const *name) const
|
||||||
{
|
{
|
||||||
if (hashtab && dynsym && dynstr) {
|
if (hashtab && dynsym && dynstr) {
|
||||||
unsigned const nbucket = hashtab[0];
|
unsigned const nbucket = hashtab[0];
|
||||||
@@ -1501,7 +1682,7 @@ Elf32_Sym const *PackLinuxI386elf::elf_lookup(char const *name) const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackLinuxI386elf::pack1(OutputFile *fo, Filter &)
|
void PackLinuxElf32x86::pack1(OutputFile *fo, Filter &)
|
||||||
{
|
{
|
||||||
fi->seek(0, SEEK_SET);
|
fi->seek(0, SEEK_SET);
|
||||||
fi->readx(&ehdri, sizeof(ehdri));
|
fi->readx(&ehdri, sizeof(ehdri));
|
||||||
@@ -1512,10 +1693,11 @@ void PackLinuxI386elf::pack1(OutputFile *fo, Filter &)
|
|||||||
fi->seek(ehdri.e_phoff, SEEK_SET);
|
fi->seek(ehdri.e_phoff, SEEK_SET);
|
||||||
fi->readx(phdri, sz_phdrs);
|
fi->readx(phdri, sz_phdrs);
|
||||||
|
|
||||||
|
progid = getRandomId();
|
||||||
generateElfHdr(fo, linux_i386elf_fold, getbrk(phdri, ehdri.e_phnum) );
|
generateElfHdr(fo, linux_i386elf_fold, getbrk(phdri, ehdri.e_phnum) );
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned PackLinuxI386elf::find_LOAD_gap(
|
unsigned PackLinuxElf32x86::find_LOAD_gap(
|
||||||
Elf32_Phdr const *const phdri,
|
Elf32_Phdr const *const phdri,
|
||||||
unsigned const k,
|
unsigned const k,
|
||||||
unsigned const e_phnum
|
unsigned const e_phnum
|
||||||
@@ -1549,7 +1731,7 @@ unsigned PackLinuxI386elf::find_LOAD_gap(
|
|||||||
return lo - hi;
|
return lo - hi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackLinuxI386elf::pack2(OutputFile *fo, Filter &ft)
|
void PackLinuxElf32x86::pack2(OutputFile *fo, Filter &ft)
|
||||||
{
|
{
|
||||||
Extent x;
|
Extent x;
|
||||||
unsigned k;
|
unsigned k;
|
||||||
@@ -1610,7 +1792,7 @@ void PackLinuxI386elf::pack2(OutputFile *fo, Filter &ft)
|
|||||||
set_native32(&elfout.phdr[0].p_filesz, fo->getBytesWritten());
|
set_native32(&elfout.phdr[0].p_filesz, fo->getBytesWritten());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackLinuxI386elf::pack3(OutputFile *fo, Filter &ft)
|
void PackLinuxElf32x86::pack3(OutputFile *fo, Filter &ft)
|
||||||
{
|
{
|
||||||
unsigned disp;
|
unsigned disp;
|
||||||
unsigned len = fo->getBytesWritten();
|
unsigned len = fo->getBytesWritten();
|
||||||
@@ -1620,7 +1802,7 @@ void PackLinuxI386elf::pack3(OutputFile *fo, Filter &ft)
|
|||||||
set_native32(&disp, len);
|
set_native32(&disp, len);
|
||||||
fo->write(&disp, sizeof(disp));
|
fo->write(&disp, sizeof(disp));
|
||||||
|
|
||||||
// We have packed multiple blocks, so PackLinuxI386::buildLinuxLoader
|
// We have packed multiple blocks, so PackLinuxElfxx::buildLinuxLoader
|
||||||
// needs an adjusted ph.c_len in order to get alignment correct.
|
// needs an adjusted ph.c_len in order to get alignment correct.
|
||||||
unsigned const save_c_len = ph.c_len;
|
unsigned const save_c_len = ph.c_len;
|
||||||
ph.c_len = sizeof(disp) + len - (
|
ph.c_len = sizeof(disp) + len - (
|
||||||
@@ -1642,17 +1824,10 @@ void PackLinuxI386elf::pack3(OutputFile *fo, Filter &ft)
|
|||||||
super::pack3(fo, ft);
|
super::pack3(fo, ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackLinuxI386elf::pack4(OutputFile *fo, Filter &ft)
|
void PackLinuxElf32x86::pack4(OutputFile *fo, Filter &ft)
|
||||||
{
|
{
|
||||||
super::pack4(fo, ft); // write PackHeader and overlay_offset
|
super::pack4(fo, ft); // write PackHeader and overlay_offset
|
||||||
|
|
||||||
#if 0 /*{ where was this done already? FIXME */
|
|
||||||
#define PAGE_MASK (~0u<<12)
|
|
||||||
// pre-calculate for benefit of runtime disappearing act via munmap()
|
|
||||||
set_native32(&elfout.phdr[0].p_memsz, PAGE_MASK & (~PAGE_MASK + len));
|
|
||||||
#undef PAGE_MASK
|
|
||||||
#endif /*}*/
|
|
||||||
|
|
||||||
// rewrite Elf header
|
// rewrite Elf header
|
||||||
if (Elf32_Ehdr::ET_DYN==ehdri.e_type) {
|
if (Elf32_Ehdr::ET_DYN==ehdri.e_type) {
|
||||||
// File being compressed was -pie.
|
// File being compressed was -pie.
|
||||||
@@ -1663,14 +1838,15 @@ void PackLinuxI386elf::pack4(OutputFile *fo, Filter &ft)
|
|||||||
elfout.ehdr.e_entry -= base;
|
elfout.ehdr.e_entry -= base;
|
||||||
elfout.phdr[0].p_vaddr -= base;
|
elfout.phdr[0].p_vaddr -= base;
|
||||||
elfout.phdr[0].p_paddr -= base;
|
elfout.phdr[0].p_paddr -= base;
|
||||||
elfout.phdr[0].p_flags |= Elf32_Phdr::PF_W;
|
// Strict SELinux (or PaX, grSecurity) disallows PF_W with PF_X
|
||||||
|
//elfout.phdr[0].p_flags |= Elf32_Phdr::PF_W;
|
||||||
}
|
}
|
||||||
fo->seek(0, SEEK_SET);
|
fo->seek(0, SEEK_SET);
|
||||||
fo->rewrite(&elfout, sizeof(Elf32_Ehdr) + sizeof(Elf32_Phdr));
|
fo->rewrite(&elfout, sizeof(Elf32_Ehdr) + sizeof(Elf32_Phdr));
|
||||||
//fo->rewrite(&linfo, sizeof(linfo));
|
//fo->rewrite(&linfo, sizeof(linfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackLinuxI386elf::unpack(OutputFile *fo)
|
void PackLinuxElf32x86::unpack(OutputFile *fo)
|
||||||
{
|
{
|
||||||
#define MAX_ELF_HDR 512
|
#define MAX_ELF_HDR 512
|
||||||
char bufehdr[MAX_ELF_HDR];
|
char bufehdr[MAX_ELF_HDR];
|
||||||
@@ -1682,7 +1858,10 @@ void PackLinuxI386elf::unpack(OutputFile *fo)
|
|||||||
fi->seek(0, SEEK_SET);
|
fi->seek(0, SEEK_SET);
|
||||||
fi->readx(bufehdr, MAX_ELF_HDR);
|
fi->readx(bufehdr, MAX_ELF_HDR);
|
||||||
unsigned const e_entry = get_native32(&ehdr->e_entry);
|
unsigned const e_entry = get_native32(&ehdr->e_entry);
|
||||||
if (e_entry < 0x401180) { /* old style, 8-byte b_info */
|
unsigned const e_type = get_native16(&ehdr->e_type);
|
||||||
|
if (e_entry < 0x401180 && Elf32_Ehdr::ET_EXEC==e_type) {
|
||||||
|
// beware ET_DYN.e_entry==0x10f0 or so
|
||||||
|
/* old style, 8-byte b_info */
|
||||||
szb_info = 2*sizeof(unsigned);
|
szb_info = 2*sizeof(unsigned);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+39
-16
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -56,13 +59,6 @@ protected:
|
|||||||
void const *proto,
|
void const *proto,
|
||||||
unsigned const brka
|
unsigned const brka
|
||||||
) = 0;
|
) = 0;
|
||||||
virtual int buildLinuxLoader(
|
|
||||||
upx_byte const *const proto, // assembly-only sections
|
|
||||||
unsigned const szproto,
|
|
||||||
upx_byte const *const fold, // linked assembly + C section
|
|
||||||
unsigned const szfold,
|
|
||||||
Filter const *ft
|
|
||||||
) = 0;
|
|
||||||
virtual void unpack(OutputFile *fo) = 0;
|
virtual void unpack(OutputFile *fo) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -99,6 +95,7 @@ protected:
|
|||||||
virtual void updateLoader(OutputFile *fo);
|
virtual void updateLoader(OutputFile *fo);
|
||||||
virtual unsigned find_LOAD_gap(Elf32_Phdr const *const phdri, unsigned const k,
|
virtual unsigned find_LOAD_gap(Elf32_Phdr const *const phdri, unsigned const k,
|
||||||
unsigned const e_phnum);
|
unsigned const e_phnum);
|
||||||
|
virtual off_t getbase(const Elf32_Phdr *phdr, int e_phnum) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Elf32_Ehdr ehdri; // from input file
|
Elf32_Ehdr ehdri; // from input file
|
||||||
@@ -203,6 +200,20 @@ protected:
|
|||||||
virtual void set_native16(void *b, unsigned v) const { set_be16(b, v); }
|
virtual void set_native16(void *b, unsigned v) const { set_be16(b, v); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PackLinuxElf32Le : public PackLinuxElf32
|
||||||
|
{
|
||||||
|
typedef PackLinuxElf32 super;
|
||||||
|
protected:
|
||||||
|
PackLinuxElf32Le(InputFile *f) : super(f) { }
|
||||||
|
|
||||||
|
virtual acc_uint64l_t get_native64(const void *b) const { return get_le64(b); }
|
||||||
|
virtual unsigned get_native32(const void *b) const { return get_le32(b); }
|
||||||
|
virtual unsigned get_native16(const void *b) const { return get_le16(b); }
|
||||||
|
virtual void set_native64(void *b, acc_uint64l_t v) const { set_le64(b, v); }
|
||||||
|
virtual void set_native32(void *b, unsigned v) const { set_le32(b, v); }
|
||||||
|
virtual void set_native16(void *b, unsigned v) const { set_le16(b, v); }
|
||||||
|
};
|
||||||
|
|
||||||
class PackLinuxElf64Le : public PackLinuxElf64
|
class PackLinuxElf64Le : public PackLinuxElf64
|
||||||
{
|
{
|
||||||
typedef PackLinuxElf64 super;
|
typedef PackLinuxElf64 super;
|
||||||
@@ -234,6 +245,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual void pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual const int *getCompressionMethods(int method, int level) const;
|
virtual const int *getCompressionMethods(int method, int level) const;
|
||||||
|
virtual int buildLoader(const Filter *);
|
||||||
virtual int buildLinuxLoader(
|
virtual int buildLinuxLoader(
|
||||||
upx_byte const *const proto, // assembly-only sections
|
upx_byte const *const proto, // assembly-only sections
|
||||||
unsigned const szproto,
|
unsigned const szproto,
|
||||||
@@ -241,7 +253,6 @@ protected:
|
|||||||
unsigned const szfold,
|
unsigned const szfold,
|
||||||
Filter const *ft
|
Filter const *ft
|
||||||
);
|
);
|
||||||
virtual int buildLoader(const Filter *);
|
|
||||||
virtual void generateElfHdr(
|
virtual void generateElfHdr(
|
||||||
OutputFile *,
|
OutputFile *,
|
||||||
void const *proto,
|
void const *proto,
|
||||||
@@ -266,6 +277,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual void pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual const int *getCompressionMethods(int method, int level) const;
|
virtual const int *getCompressionMethods(int method, int level) const;
|
||||||
|
virtual int buildLoader(const Filter *);
|
||||||
virtual int buildLinuxLoader(
|
virtual int buildLinuxLoader(
|
||||||
upx_byte const *const proto, // assembly-only sections
|
upx_byte const *const proto, // assembly-only sections
|
||||||
unsigned const szproto,
|
unsigned const szproto,
|
||||||
@@ -273,7 +285,6 @@ protected:
|
|||||||
unsigned const szfold,
|
unsigned const szfold,
|
||||||
Filter const *ft
|
Filter const *ft
|
||||||
);
|
);
|
||||||
virtual int buildLoader(const Filter *);
|
|
||||||
virtual void generateElfHdr(
|
virtual void generateElfHdr(
|
||||||
OutputFile *,
|
OutputFile *,
|
||||||
void const *proto,
|
void const *proto,
|
||||||
@@ -285,17 +296,16 @@ protected:
|
|||||||
// linux/elf386
|
// linux/elf386
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
class PackLinuxI386elf : public PackLinuxI386
|
class PackLinuxElf32x86 : public PackLinuxElf32Le
|
||||||
{
|
{
|
||||||
typedef PackLinuxI386 super;
|
typedef PackLinuxElf32Le super;
|
||||||
public:
|
public:
|
||||||
PackLinuxI386elf(InputFile *f);
|
PackLinuxElf32x86(InputFile *f);
|
||||||
virtual ~PackLinuxI386elf();
|
virtual ~PackLinuxElf32x86();
|
||||||
virtual int getVersion() const { return 13; }
|
virtual int getVersion() const { return 13; }
|
||||||
virtual int getFormat() const { return UPX_F_LINUX_ELF_i386; }
|
virtual int getFormat() const { return UPX_F_LINUX_ELF_i386; }
|
||||||
virtual const char *getName() const { return "linux/elf386"; }
|
virtual const char *getName() const { return "linux/elf386"; }
|
||||||
virtual const int *getFilters() const;
|
virtual const int *getFilters() const;
|
||||||
virtual int buildLoader(const Filter *);
|
|
||||||
|
|
||||||
virtual void unpack(OutputFile *fo);
|
virtual void unpack(OutputFile *fo);
|
||||||
|
|
||||||
@@ -310,6 +320,19 @@ protected:
|
|||||||
virtual void pack4(OutputFile *, Filter &); // append pack header
|
virtual void pack4(OutputFile *, Filter &); // append pack header
|
||||||
|
|
||||||
virtual void patchLoader();
|
virtual void patchLoader();
|
||||||
|
virtual int buildLoader(const Filter *);
|
||||||
|
virtual int buildLinuxLoader(
|
||||||
|
upx_byte const *const proto, // assembly-only sections
|
||||||
|
unsigned const szproto,
|
||||||
|
upx_byte const *const fold, // linked assembly + C section
|
||||||
|
unsigned const szfold,
|
||||||
|
Filter const *ft
|
||||||
|
);
|
||||||
|
virtual void generateElfHdr(
|
||||||
|
OutputFile *,
|
||||||
|
void const *proto,
|
||||||
|
unsigned const brka
|
||||||
|
);
|
||||||
|
|
||||||
Elf32_Ehdr ehdri; // from input file
|
Elf32_Ehdr ehdri; // from input file
|
||||||
Elf32_Phdr *phdri; // for input file
|
Elf32_Phdr *phdri; // for input file
|
||||||
|
|||||||
+43
-98
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -108,12 +111,22 @@ PackLinuxI386::generateElfHdr(
|
|||||||
|
|
||||||
// Info for OS kernel to set the brk()
|
// Info for OS kernel to set the brk()
|
||||||
if (brka) {
|
if (brka) {
|
||||||
|
#define PAGE_MASK (~0ul<<12)
|
||||||
|
// linux-2.6.14 binfmt_elf.c: SIGKILL if (0==.p_memsz) on a page boundary
|
||||||
|
unsigned const brkb = brka | ((0==(~PAGE_MASK & brka)) ? 0x20 : 0);
|
||||||
h2->phdr[1].p_type = PT_LOAD; // be sure
|
h2->phdr[1].p_type = PT_LOAD; // be sure
|
||||||
h2->phdr[1].p_offset = 0xfff&brka;
|
h2->phdr[1].p_offset = ~PAGE_MASK & brkb;
|
||||||
h2->phdr[1].p_vaddr = brka;
|
h2->phdr[1].p_vaddr = brkb;
|
||||||
h2->phdr[1].p_paddr = brka;
|
h2->phdr[1].p_paddr = brkb;
|
||||||
h2->phdr[1].p_filesz = 0;
|
h2->phdr[1].p_filesz = 0;
|
||||||
h2->phdr[1].p_memsz = 0;
|
h2->phdr[1].p_memsz = 0;
|
||||||
|
if (0==h2->phdr[1].p_flags) {
|
||||||
|
h2->phdr[1].p_flags = Elf32_Phdr::PF_R|Elf32_Phdr::PF_W;
|
||||||
|
}
|
||||||
|
if (0==h2->phdr[1].p_align) {
|
||||||
|
h2->phdr[1].p_align = 0x1000;
|
||||||
|
}
|
||||||
|
#undef PAGE_MASK
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ph.format==UPX_F_LINUX_i386 ) {
|
if (ph.format==UPX_F_LINUX_i386 ) {
|
||||||
@@ -121,14 +134,9 @@ PackLinuxI386::generateElfHdr(
|
|||||||
memset(&h1->linfo, 0, sizeof(h1->linfo));
|
memset(&h1->linfo, 0, sizeof(h1->linfo));
|
||||||
fo->write(h1, sizeof(*h1));
|
fo->write(h1, sizeof(*h1));
|
||||||
}
|
}
|
||||||
else if (ph.format==UPX_F_LINUX_ELF_i386) {
|
|
||||||
assert(h2->ehdr.e_phnum==2);
|
|
||||||
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
|
||||||
fo->write(h2, sizeof(*h2));
|
|
||||||
}
|
|
||||||
else if (ph.format==UPX_F_LINUX_SH_i386) {
|
else if (ph.format==UPX_F_LINUX_SH_i386) {
|
||||||
assert(h2->ehdr.e_phnum==1);
|
assert(h2->ehdr.e_phnum==1);
|
||||||
h2->ehdr.e_phnum = 2;
|
h2->ehdr.e_phnum = 1;
|
||||||
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
||||||
fo->write(h2, sizeof(*h2));
|
fo->write(h2, sizeof(*h2));
|
||||||
}
|
}
|
||||||
@@ -215,11 +223,19 @@ PackLinuxI386::pack4(OutputFile *fo, Filter &ft)
|
|||||||
fo->write(shstrtab, sizeof(shstrtab));
|
fo->write(shstrtab, sizeof(shstrtab));
|
||||||
#endif // }
|
#endif // }
|
||||||
|
|
||||||
|
|
||||||
|
// Cannot pre-round .p_memsz. If .p_filesz < .p_memsz, then kernel
|
||||||
|
// tries to make .bss, which requires PF_W.
|
||||||
|
// But strict SELinux (or PaX, grSecurity) disallows PF_W with PF_X.
|
||||||
|
#if 0 /*{*/
|
||||||
#undef PAGE_MASK
|
#undef PAGE_MASK
|
||||||
#define PAGE_MASK (~0u<<12)
|
#define PAGE_MASK (~0u<<12)
|
||||||
// pre-calculate for benefit of runtime disappearing act via munmap()
|
// pre-calculate for benefit of runtime disappearing act via munmap()
|
||||||
elfout.phdr[0].p_memsz = PAGE_MASK & (~PAGE_MASK + elfout.phdr[0].p_filesz);
|
elfout.phdr[0].p_memsz = PAGE_MASK & (~PAGE_MASK + elfout.phdr[0].p_filesz);
|
||||||
#undef PAGE_MASK
|
#undef PAGE_MASK
|
||||||
|
#else /*}{*/
|
||||||
|
elfout.phdr[0].p_memsz = elfout.phdr[0].p_filesz;
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
// rewrite Elf header
|
// rewrite Elf header
|
||||||
fo->seek(0, SEEK_SET);
|
fo->seek(0, SEEK_SET);
|
||||||
@@ -250,8 +266,12 @@ PackLinuxI386::buildLinuxLoader(
|
|||||||
unsigned fold_hdrlen = 0;
|
unsigned fold_hdrlen = 0;
|
||||||
if (0 < szfold) {
|
if (0 < szfold) {
|
||||||
cprElfHdr1 const *const hf = (cprElfHdr1 const *)fold;
|
cprElfHdr1 const *const hf = (cprElfHdr1 const *)fold;
|
||||||
fold_hdrlen = umax(0x80, sizeof(hf->ehdr) +
|
fold_hdrlen = sizeof(hf->ehdr) + hf->ehdr.e_phentsize * hf->ehdr.e_phnum +
|
||||||
hf->ehdr.e_phentsize * hf->ehdr.e_phnum + sizeof(l_info) );
|
sizeof(l_info);
|
||||||
|
if (0 == get_le32(fold_hdrlen + fold)) {
|
||||||
|
// inconsistent SIZEOF_HEADERS in *.lds (ld, binutils)
|
||||||
|
fold_hdrlen = umax(0x80, fold_hdrlen);
|
||||||
|
}
|
||||||
h.sz_unc = (szfold < fold_hdrlen) ? 0 : (szfold - fold_hdrlen);
|
h.sz_unc = (szfold < fold_hdrlen) ? 0 : (szfold - fold_hdrlen);
|
||||||
h.b_method = (unsigned char) ph.method;
|
h.b_method = (unsigned char) ph.method;
|
||||||
h.b_ftid = (unsigned char) ph.filter;
|
h.b_ftid = (unsigned char) ph.filter;
|
||||||
@@ -259,19 +279,14 @@ PackLinuxI386::buildLinuxLoader(
|
|||||||
}
|
}
|
||||||
unsigned char const *const uncLoader = fold_hdrlen + fold;
|
unsigned char const *const uncLoader = fold_hdrlen + fold;
|
||||||
|
|
||||||
unsigned char *const cprLoader = new unsigned char[sizeof(h) + h.sz_unc];
|
unsigned char *const cprLoader = new unsigned char[h.sz_unc];
|
||||||
if (0 < szfold) {
|
if (0 < szfold) {
|
||||||
unsigned sz_cpr;
|
unsigned sz_cpr = h.sz_unc;
|
||||||
int r = upx_compress(uncLoader, h.sz_unc, sizeof(h) + cprLoader, &sz_cpr,
|
memcpy(cprLoader, uncLoader, sz_cpr);
|
||||||
NULL, ph.method, 10, NULL, NULL );
|
|
||||||
h.sz_cpr = sz_cpr;
|
h.sz_cpr = sz_cpr;
|
||||||
if (r != UPX_E_OK || h.sz_cpr >= h.sz_unc)
|
|
||||||
throwInternalError("loader compression failed");
|
|
||||||
}
|
}
|
||||||
memcpy(cprLoader, &h, sizeof(h));
|
|
||||||
|
|
||||||
// This adds the definition to the "library", to be used later.
|
// This adds the definition to the "library", to be used later.
|
||||||
linker->addSection("FOLDEXEC", cprLoader, sizeof(h) + h.sz_cpr);
|
linker->addSection("FOLDEXEC", cprLoader, h.sz_cpr);
|
||||||
delete [] cprLoader;
|
delete [] cprLoader;
|
||||||
|
|
||||||
n_mru = ft->n_mru;
|
n_mru = ft->n_mru;
|
||||||
@@ -294,28 +309,6 @@ PackLinuxI386::buildLinuxLoader(
|
|||||||
addLoader("LEXEC000", NULL);
|
addLoader("LEXEC000", NULL);
|
||||||
|
|
||||||
if (ft->id) {
|
if (ft->id) {
|
||||||
if (ph.format==UPX_F_LINUX_ELF_i386) { // decompr, unfilter are separate
|
|
||||||
addLoader("LXUNF000", NULL);
|
|
||||||
addLoader("LXUNF002", NULL);
|
|
||||||
if (0x80==(ft->id & 0xF0)) {
|
|
||||||
if (256==n_mru) {
|
|
||||||
addLoader("MRUBYTE0", NULL);
|
|
||||||
}
|
|
||||||
else if (n_mru) {
|
|
||||||
addLoader("LXMRU005", NULL);
|
|
||||||
}
|
|
||||||
if (n_mru) {
|
|
||||||
addLoader("LXMRU006", NULL);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
addLoader("LXMRU007", NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (0x40==(ft->id & 0xF0)) {
|
|
||||||
addLoader("LXUNF008", NULL);
|
|
||||||
}
|
|
||||||
addLoader("LXUNF010", NULL);
|
|
||||||
}
|
|
||||||
if (n_mru) {
|
if (n_mru) {
|
||||||
addLoader("LEXEC009", NULL);
|
addLoader("LEXEC009", NULL);
|
||||||
}
|
}
|
||||||
@@ -324,12 +317,7 @@ PackLinuxI386::buildLinuxLoader(
|
|||||||
addLoader(getDecompressor(), NULL);
|
addLoader(getDecompressor(), NULL);
|
||||||
addLoader("LEXEC015", NULL);
|
addLoader("LEXEC015", NULL);
|
||||||
if (ft->id) {
|
if (ft->id) {
|
||||||
if (ph.format==UPX_F_LINUX_ELF_i386) { // decompr, unfilter are separate
|
{ // decompr, unfilter not separate
|
||||||
if (0x80!=(ft->id & 0xF0)) {
|
|
||||||
addLoader("LXUNF042", NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { // decompr, unfilter not separate
|
|
||||||
if (0x80==(ft->id & 0xF0)) {
|
if (0x80==(ft->id & 0xF0)) {
|
||||||
addLoader("LEXEC110", NULL);
|
addLoader("LEXEC110", NULL);
|
||||||
if (n_mru) {
|
if (n_mru) {
|
||||||
@@ -340,18 +328,13 @@ PackLinuxI386::buildLinuxLoader(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
addFilter32(ft->id);
|
addFilter32(ft->id);
|
||||||
if (ph.format==UPX_F_LINUX_ELF_i386) { // decompr, unfilter are separate
|
{ // decompr always unfilters
|
||||||
if (0x80==(ft->id & 0xF0)) {
|
|
||||||
if (0==n_mru) {
|
|
||||||
addLoader("LXMRU058", NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
addLoader("LXUNF035", NULL);
|
|
||||||
}
|
|
||||||
else { // decompr always unfilters
|
|
||||||
addLoader("LEXEC017", NULL);
|
addLoader("LEXEC017", NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
addLoader("LEXEC017", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
addLoader("IDENTSTR", NULL);
|
addLoader("IDENTSTR", NULL);
|
||||||
addLoader("LEXEC020", NULL);
|
addLoader("LEXEC020", NULL);
|
||||||
@@ -384,22 +367,12 @@ PackLinuxI386::buildLoader(Filter const *ft)
|
|||||||
patch_le32(buf,sz_fold,"UPX3",progid);
|
patch_le32(buf,sz_fold,"UPX3",progid);
|
||||||
patch_le32(buf,sz_fold,"UPX2",exetype > 0 ? 0 : 0x7fffffff);
|
patch_le32(buf,sz_fold,"UPX2",exetype > 0 ? 0 : 0x7fffffff);
|
||||||
|
|
||||||
// get fresh filter
|
|
||||||
Filter fold_ft = *ft;
|
|
||||||
fold_ft.init(ft->id, ft->addvalue);
|
|
||||||
int preferred_ctos[2] = {ft->cto, -1};
|
|
||||||
fold_ft.preferred_ctos = preferred_ctos;
|
|
||||||
|
|
||||||
// filter
|
|
||||||
optimizeFilter(&fold_ft, buf, sz_fold);
|
|
||||||
bool success = fold_ft.filter(buf + sizeof(cprElfHdr2), sz_fold - sizeof(cprElfHdr2));
|
|
||||||
(void)success;
|
|
||||||
|
|
||||||
return buildLinuxLoader(
|
return buildLinuxLoader(
|
||||||
linux_i386exec_loader, sizeof(linux_i386exec_loader),
|
linux_i386exec_loader, sizeof(linux_i386exec_loader),
|
||||||
buf, sz_fold, ft );
|
buf, sz_fold, ft );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: getLoaderPrefixSize is unused?
|
||||||
int PackLinuxI386::getLoaderPrefixSize() const
|
int PackLinuxI386::getLoaderPrefixSize() const
|
||||||
{
|
{
|
||||||
return 116;
|
return 116;
|
||||||
@@ -451,34 +424,6 @@ int PackLinuxI386::checkEhdr(const Elf32_Ehdr *ehdr) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
off_t PackLinuxI386::getbrk(const Elf32_Phdr *phdr, int e_phnum) const
|
|
||||||
{
|
|
||||||
off_t brka = 0;
|
|
||||||
for (int j = 0; j < e_phnum; ++phdr, ++j) {
|
|
||||||
if (phdr->PT_LOAD == phdr->p_type) {
|
|
||||||
off_t b = phdr->p_vaddr + phdr->p_memsz;
|
|
||||||
if (b > brka)
|
|
||||||
brka = b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return brka;
|
|
||||||
}
|
|
||||||
|
|
||||||
off_t PackLinuxI386::getbase(const Elf32_Phdr *phdr, int e_phnum) const
|
|
||||||
{
|
|
||||||
off_t base = ~0u;
|
|
||||||
for (int j = 0; j < e_phnum; ++phdr, ++j) {
|
|
||||||
if (phdr->PT_LOAD == phdr->p_type) {
|
|
||||||
if (phdr->p_vaddr < (unsigned) base)
|
|
||||||
base = phdr->p_vaddr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (0!=base) {
|
|
||||||
return base;
|
|
||||||
}
|
|
||||||
return 0x12000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
//
|
//
|
||||||
|
|||||||
+4
-3
@@ -22,7 +22,10 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -75,8 +78,6 @@ protected:
|
|||||||
|
|
||||||
// ELF util
|
// ELF util
|
||||||
virtual int checkEhdr(const Elf32_Ehdr *ehdr) const;
|
virtual int checkEhdr(const Elf32_Ehdr *ehdr) const;
|
||||||
virtual off_t getbrk(const Elf32_Phdr *phdr, int e_phnum) const;
|
|
||||||
virtual off_t getbase(const Elf32_Phdr *phdr, int e_phnum) const;
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
UPX_ELF_MAGIC = 0x5850557f // "\x7fUPX"
|
UPX_ELF_MAGIC = 0x5850557f // "\x7fUPX"
|
||||||
|
|||||||
+12
-9
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -52,16 +55,16 @@ static const
|
|||||||
static const
|
static const
|
||||||
#include "stub/fold_pti86.h"
|
#include "stub/fold_pti86.h"
|
||||||
|
|
||||||
PackLinuxI386interp::PackLinuxI386interp(InputFile *f) :
|
PackLinuxElf32x86interp::PackLinuxElf32x86interp(InputFile *f) :
|
||||||
super(f)
|
super(f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PackLinuxI386interp::~PackLinuxI386interp()
|
PackLinuxElf32x86interp::~PackLinuxElf32x86interp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PackLinuxI386interp::canPack()
|
bool PackLinuxElf32x86interp::canPack()
|
||||||
{
|
{
|
||||||
if (opt->o_unix.make_ptinterp) {
|
if (opt->o_unix.make_ptinterp) {
|
||||||
return true;
|
return true;
|
||||||
@@ -72,7 +75,7 @@ bool PackLinuxI386interp::canPack()
|
|||||||
return super::canPack();
|
return super::canPack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackLinuxI386interp::pack1(OutputFile *fo, Filter &)
|
void PackLinuxElf32x86interp::pack1(OutputFile *fo, Filter &)
|
||||||
{
|
{
|
||||||
fi->seek(0, SEEK_SET);
|
fi->seek(0, SEEK_SET);
|
||||||
fi->readx(&ehdri, sizeof(ehdri));
|
fi->readx(&ehdri, sizeof(ehdri));
|
||||||
@@ -121,7 +124,7 @@ void PackLinuxI386interp::pack1(OutputFile *fo, Filter &)
|
|||||||
#undef E
|
#undef E
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackLinuxI386interp::pack2(OutputFile *fo, Filter &ft)
|
void PackLinuxElf32x86interp::pack2(OutputFile *fo, Filter &ft)
|
||||||
{
|
{
|
||||||
if (opt->o_unix.make_ptinterp) {
|
if (opt->o_unix.make_ptinterp) {
|
||||||
return; // ignore current input file!
|
return; // ignore current input file!
|
||||||
@@ -132,7 +135,7 @@ void PackLinuxI386interp::pack2(OutputFile *fo, Filter &ft)
|
|||||||
#undef PAGE_MASK
|
#undef PAGE_MASK
|
||||||
#define PAGE_MASK (~0u<<12)
|
#define PAGE_MASK (~0u<<12)
|
||||||
|
|
||||||
void PackLinuxI386interp::pack3(OutputFile *fo, Filter &/*ft*/)
|
void PackLinuxElf32x86interp::pack3(OutputFile *fo, Filter &/*ft*/)
|
||||||
{
|
{
|
||||||
unsigned base = getbase(phdri, ehdri.e_phnum);
|
unsigned base = getbase(phdri, ehdri.e_phnum);
|
||||||
unsigned sz = PAGE_MASK & (~PAGE_MASK + elfout.phdr[0].p_filesz);
|
unsigned sz = PAGE_MASK & (~PAGE_MASK + elfout.phdr[0].p_filesz);
|
||||||
@@ -191,7 +194,7 @@ void PackLinuxI386interp::pack3(OutputFile *fo, Filter &/*ft*/)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PackLinuxI386interp::unpack(OutputFile *fo)
|
void PackLinuxElf32x86interp::unpack(OutputFile *fo)
|
||||||
{
|
{
|
||||||
#define MAX_INTERP_HDR 512
|
#define MAX_INTERP_HDR 512
|
||||||
char bufehdr[MAX_INTERP_HDR];
|
char bufehdr[MAX_INTERP_HDR];
|
||||||
|
|||||||
+9
-6
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -35,12 +38,12 @@
|
|||||||
// linux/interp386
|
// linux/interp386
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
class PackLinuxI386interp : public PackLinuxI386elf
|
class PackLinuxElf32x86interp : public PackLinuxElf32x86
|
||||||
{
|
{
|
||||||
typedef PackLinuxI386elf super;
|
typedef PackLinuxElf32x86 super;
|
||||||
public:
|
public:
|
||||||
PackLinuxI386interp(InputFile *f);
|
PackLinuxElf32x86interp(InputFile *f);
|
||||||
virtual ~PackLinuxI386interp();
|
virtual ~PackLinuxElf32x86interp();
|
||||||
virtual int getVersion() const { return 13; }
|
virtual int getVersion() const { return 13; }
|
||||||
virtual int getFormat() const { return UPX_F_LINUX_ELFI_i386; }
|
virtual int getFormat() const { return UPX_F_LINUX_ELFI_i386; }
|
||||||
virtual const char *getName() const { return "linux/elfi386"; }
|
virtual const char *getName() const { return "linux/elfi386"; }
|
||||||
|
|||||||
+5
-2
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+7
-4
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -35,9 +38,9 @@
|
|||||||
// linux/sep386
|
// linux/sep386
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
class PackLinuxI386sep : public PackLinuxI386elf
|
class PackLinuxI386sep : public PackLinuxI386
|
||||||
{
|
{
|
||||||
typedef PackLinuxI386elf super;
|
typedef PackLinuxI386 super;
|
||||||
public:
|
public:
|
||||||
PackLinuxI386sep(InputFile *f) : super(f) { }
|
PackLinuxI386sep(InputFile *f) : super(f) { }
|
||||||
virtual int getFormat() const { return UPX_F_LINUX_SEP_i386; }
|
virtual int getFormat() const { return UPX_F_LINUX_SEP_i386; }
|
||||||
|
|||||||
+21
-3
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -59,6 +62,15 @@ PackLinuxI386sh::~PackLinuxI386sh()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned
|
||||||
|
umax(unsigned a, unsigned b)
|
||||||
|
{
|
||||||
|
if (a <= b) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PackLinuxI386sh::buildLoader(Filter const *ft)
|
PackLinuxI386sh::buildLoader(Filter const *ft)
|
||||||
{
|
{
|
||||||
@@ -78,7 +90,13 @@ PackLinuxI386sh::buildLoader(Filter const *ft)
|
|||||||
|
|
||||||
// filter
|
// filter
|
||||||
optimizeFilter(&fold_ft, buf, sz_fold);
|
optimizeFilter(&fold_ft, buf, sz_fold);
|
||||||
bool success = fold_ft.filter(buf + sizeof(cprElfHdr2), sz_fold - sizeof(cprElfHdr2));
|
unsigned fold_hdrlen = sizeof(l_info) + sizeof(Elf32_Ehdr) +
|
||||||
|
sizeof(Elf32_Phdr) * get_native32(&((Elf32_Ehdr const *)(void *)buf)->e_phnum);
|
||||||
|
if (0 == get_le32(fold_hdrlen + buf)) {
|
||||||
|
// inconsistent SIZEOF_HEADERS in *.lds (ld, binutils)
|
||||||
|
fold_hdrlen = umax(0x80, fold_hdrlen);
|
||||||
|
}
|
||||||
|
bool success = fold_ft.filter(buf + fold_hdrlen, sz_fold - fold_hdrlen);
|
||||||
UNUSED(success);
|
UNUSED(success);
|
||||||
|
|
||||||
return buildLinuxLoader(
|
return buildLinuxLoader(
|
||||||
|
|||||||
+5
-2
@@ -22,8 +22,11 @@
|
|||||||
If not, write to the Free Software Foundation, Inc.,
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar John F. Reiser
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu jreiser@BitWagon.com
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+83
-18
@@ -180,26 +180,67 @@ PackMachPPC32::pack3(OutputFile *fo, Filter &ft) // append loader
|
|||||||
super::pack3(fo, ft);
|
super::pack3(fo, ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine length of gap between PT_LOAD phdri[k] and closest PT_LOAD
|
||||||
|
// which follows in the file (or end-of-file). Optimize for common case
|
||||||
|
// where the PT_LOAD are adjacent ascending by .p_offset. Assume no overlap.
|
||||||
|
|
||||||
|
unsigned PackMachPPC32::find_SEGMENT_gap(
|
||||||
|
unsigned const k
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Mach_segment_command::LC_SEGMENT!=msegcmd[k].cmd
|
||||||
|
|| 0==msegcmd[k].filesize ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
unsigned const hi = get_native32(&msegcmd[k].fileoff) +
|
||||||
|
get_native32(&msegcmd[k].filesize);
|
||||||
|
unsigned lo = ph.u_file_size;
|
||||||
|
unsigned j = k;
|
||||||
|
for (;;) { // circular search, optimize for adjacent ascending
|
||||||
|
++j;
|
||||||
|
if (n_segment==j) {
|
||||||
|
j = 0;
|
||||||
|
}
|
||||||
|
if (k==j) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (Mach_segment_command::LC_SEGMENT==msegcmd[j].cmd
|
||||||
|
&& 0!=msegcmd[j].filesize ) {
|
||||||
|
unsigned const t = get_native32(&msegcmd[j].fileoff);
|
||||||
|
if ((t - hi) < (lo - hi)) {
|
||||||
|
lo = t;
|
||||||
|
if (hi==lo) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lo - hi;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PackMachPPC32::pack2(OutputFile *fo, Filter &ft) // append compressed body
|
PackMachPPC32::pack2(OutputFile *fo, Filter &ft) // append compressed body
|
||||||
{
|
{
|
||||||
Extent x;
|
Extent x;
|
||||||
unsigned k;
|
unsigned k;
|
||||||
|
|
||||||
ui_total_passes = n_segment;
|
// count passes, set ptload vars
|
||||||
|
ui_total_passes = 0;
|
||||||
|
for (k = 0; k < n_segment; ++k) {
|
||||||
|
if (Mach_segment_command::LC_SEGMENT==msegcmd[k].cmd
|
||||||
|
&& 0!=msegcmd[k].filesize ) {
|
||||||
|
ui_total_passes++;
|
||||||
|
if (find_SEGMENT_gap(k)) {
|
||||||
|
ui_total_passes++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// compress extents
|
// compress extents
|
||||||
unsigned total_in = 0;
|
unsigned total_in = 0;
|
||||||
unsigned total_out = 0;
|
unsigned total_out = 0;
|
||||||
|
|
||||||
ui_pass = -1; // Compressing Mach headers is invisible to UI.
|
unsigned hdr_ulen = mhdri.sizeofcmds;
|
||||||
x.offset = 0;
|
|
||||||
x.size = mhdri.sizeofcmds;
|
|
||||||
{
|
|
||||||
int const old_level = ph.level; ph.level = 10;
|
|
||||||
packExtent(x, total_in, total_out, 0, fo);
|
|
||||||
ph.level = old_level;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui_pass = 0;
|
ui_pass = 0;
|
||||||
ft.addvalue = 0;
|
ft.addvalue = 0;
|
||||||
@@ -217,14 +258,18 @@ PackMachPPC32::pack2(OutputFile *fo, Filter &ft) // append compressed body
|
|||||||
}
|
}
|
||||||
packExtent(x, total_in, total_out,
|
packExtent(x, total_in, total_out,
|
||||||
((Mach_segment_command::VM_PROT_EXECUTE & msegcmd[k].initprot)
|
((Mach_segment_command::VM_PROT_EXECUTE & msegcmd[k].initprot)
|
||||||
? &ft : 0 ), fo );
|
? &ft : 0 ), fo, hdr_ulen );
|
||||||
|
hdr_ulen = 0;
|
||||||
++nx;
|
++nx;
|
||||||
}
|
}
|
||||||
if ((off_t)total_in < file_size) { // non-LC_SEGMENT stuff
|
for (k = 0; k < n_segment; ++k) {
|
||||||
x.offset = total_in;
|
x.size = find_SEGMENT_gap(k);
|
||||||
x.size = file_size - total_in;
|
if (x.size) {
|
||||||
|
x.offset = get_native32(&msegcmd[k].fileoff) +
|
||||||
|
get_native32(&msegcmd[k].filesize);
|
||||||
packExtent(x, total_in, total_out, 0, fo);
|
packExtent(x, total_in, total_out, 0, fo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((off_t)total_in != file_size)
|
if ((off_t)total_in != file_size)
|
||||||
throwEOFException();
|
throwEOFException();
|
||||||
@@ -296,6 +341,21 @@ PackMachPPC32::unpack(OutputFile *fo)
|
|||||||
fi->readx(ibuf, ph.c_len);
|
fi->readx(ibuf, ph.c_len);
|
||||||
Mach_header *const mhdr = (Mach_header *)new upx_byte[ph.u_len];
|
Mach_header *const mhdr = (Mach_header *)new upx_byte[ph.u_len];
|
||||||
decompress(ibuf, (upx_byte *)mhdr, false);
|
decompress(ibuf, (upx_byte *)mhdr, false);
|
||||||
|
unsigned const ncmds = mhdr->ncmds;
|
||||||
|
|
||||||
|
msegcmd = new Mach_segment_command[ncmds];
|
||||||
|
unsigned char *ptr = (unsigned char *)(1+mhdr);
|
||||||
|
for (unsigned j= 0; j < ncmds; ++j) {
|
||||||
|
msegcmd[j] = *(Mach_segment_command *)ptr;
|
||||||
|
ptr += (unsigned) ((Mach_segment_command *)ptr)->cmdsize;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Put LC_SEGMENT together at the beginning, ascending by .vmaddr.
|
||||||
|
qsort(msegcmd, ncmds, sizeof(*msegcmd), compare_segment_command);
|
||||||
|
n_segment = 0;
|
||||||
|
for (unsigned j= 0; j < ncmds; ++j) {
|
||||||
|
n_segment += (Mach_segment_command::LC_SEGMENT==msegcmd[j].cmd);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned total_in = 0;
|
unsigned total_in = 0;
|
||||||
unsigned total_out = 0;
|
unsigned total_out = 0;
|
||||||
@@ -307,7 +367,7 @@ PackMachPPC32::unpack(OutputFile *fo)
|
|||||||
fi->seek(- (off_t)(sizeof(bhdr) + ph.c_len), SEEK_CUR);
|
fi->seek(- (off_t)(sizeof(bhdr) + ph.c_len), SEEK_CUR);
|
||||||
for (
|
for (
|
||||||
k = 0;
|
k = 0;
|
||||||
k < mhdr->ncmds;
|
k < ncmds;
|
||||||
(++k), (sc = (Mach_segment_command const *)(sc->cmdsize + (char const *)sc))
|
(++k), (sc = (Mach_segment_command const *)(sc->cmdsize + (char const *)sc))
|
||||||
) {
|
) {
|
||||||
if (Mach_segment_command::LC_SEGMENT==sc->cmd
|
if (Mach_segment_command::LC_SEGMENT==sc->cmd
|
||||||
@@ -316,11 +376,16 @@ PackMachPPC32::unpack(OutputFile *fo)
|
|||||||
unpackExtent(filesize, fo, total_in, total_out, c_adler, u_adler, false, sizeof(bhdr));
|
unpackExtent(filesize, fo, total_in, total_out, c_adler, u_adler, false, sizeof(bhdr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unsigned const rest = orig_file_size - total_out;
|
for (unsigned j = 0; j < ncmds; ++j) {
|
||||||
if (0!=rest) { // non-LC_SEGMENT stuff
|
unsigned const size = find_SEGMENT_gap(j);
|
||||||
|
if (size) {
|
||||||
|
unsigned const where = get_native32(&msegcmd[k].fileoff) +
|
||||||
|
get_native32(&msegcmd[k].filesize);
|
||||||
if (fo)
|
if (fo)
|
||||||
fo->seek(0, SEEK_END);
|
fo->seek(where, SEEK_SET);
|
||||||
unpackExtent(rest, fo, total_in, total_out, c_adler, u_adler, false, sizeof(bhdr));
|
unpackExtent(size, fo, total_in, total_out,
|
||||||
|
c_adler, u_adler, false, sizeof(bhdr));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -177,6 +177,7 @@ public:
|
|||||||
virtual void unpack(OutputFile *fo);
|
virtual void unpack(OutputFile *fo);
|
||||||
|
|
||||||
virtual bool canPack();
|
virtual bool canPack();
|
||||||
|
virtual unsigned find_SEGMENT_gap(unsigned const k);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int buildLoader(const Filter *ft);
|
virtual int buildLoader(const Filter *ft);
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ static const
|
|||||||
|
|
||||||
PackPs1::PackPs1(InputFile *f) :
|
PackPs1::PackPs1(InputFile *f) :
|
||||||
super(f),
|
super(f),
|
||||||
isCon(true^opt->ps1_exe.boot_only), is32Bit(true^opt->ps1_exe.do_8bit),
|
isCon(!opt->ps1_exe.boot_only), is32Bit(!opt->ps1_exe.do_8bit),
|
||||||
overlap(0), sa_cnt(0)
|
overlap(0), sa_cnt(0)
|
||||||
{
|
{
|
||||||
COMPILE_TIME_ASSERT(sizeof(ps1_exe_t) == 188);
|
COMPILE_TIME_ASSERT(sizeof(ps1_exe_t) == 188);
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+109
-33
@@ -159,6 +159,8 @@ PackW32Pe::PackW32Pe(InputFile *f) : super(f)
|
|||||||
kernel32ordinal = false;
|
kernel32ordinal = false;
|
||||||
tlsindex = 0;
|
tlsindex = 0;
|
||||||
big_relocs = 0;
|
big_relocs = 0;
|
||||||
|
sorelocs = 0;
|
||||||
|
soxrelocs = 0;
|
||||||
soloadconf = 0;
|
soloadconf = 0;
|
||||||
use_dep_hack = true;
|
use_dep_hack = true;
|
||||||
use_clear_dirty_stack = true;
|
use_clear_dirty_stack = true;
|
||||||
@@ -480,37 +482,42 @@ void PackW32Pe::processRelocs() // pass1
|
|||||||
for (; ic; ic--)
|
for (; ic; ic--)
|
||||||
fix[ic] = new LE32 [counts[ic]];
|
fix[ic] = new LE32 [counts[ic]];
|
||||||
|
|
||||||
|
unsigned xcounts[4];
|
||||||
|
memset(xcounts, 0, sizeof(xcounts));
|
||||||
|
|
||||||
// prepare sorting
|
// prepare sorting
|
||||||
unsigned pos,type;
|
unsigned pos,type;
|
||||||
while (rel.next(pos,type))
|
while (rel.next(pos,type))
|
||||||
{
|
{
|
||||||
|
if (pos >= ih.imagesize)
|
||||||
|
continue; // skip out-of-bounds record
|
||||||
if (type == 3)
|
if (type == 3)
|
||||||
set_le32(ibuf + pos,get_le32(ibuf + pos) - ih.imagebase - rvamin);
|
set_le32(ibuf + pos,get_le32(ibuf + pos) - ih.imagebase - rvamin);
|
||||||
if (type < 4)
|
if (type < 4)
|
||||||
*fix[type]++ = pos - rvamin;
|
fix[type][xcounts[type]++] = pos - rvamin;
|
||||||
}
|
}
|
||||||
fix[3] -= counts[3];
|
|
||||||
|
|
||||||
ibuf.fill(IDADDR(PEDIR_RELOC), IDSIZE(PEDIR_RELOC), FILLVAL);
|
ibuf.fill(IDADDR(PEDIR_RELOC), IDSIZE(PEDIR_RELOC), FILLVAL);
|
||||||
orelocs = new upx_byte [rnum * 4 + 1024]; // 1024 - safety
|
orelocs = new upx_byte [rnum * 4 + 1024]; // 1024 - safety
|
||||||
sorelocs = ptr_diff(optimizeReloc32((upx_byte*) fix[3],counts[3],orelocs,ibuf + rvamin,1,&big_relocs),orelocs);
|
sorelocs = ptr_diff(optimizeReloc32((upx_byte*) fix[3], xcounts[3],
|
||||||
|
orelocs, ibuf + rvamin,1, &big_relocs),
|
||||||
|
orelocs);
|
||||||
|
delete [] fix[3];
|
||||||
|
|
||||||
// append relocs type "LOW" then "HIGH"
|
// append relocs type "LOW" then "HIGH"
|
||||||
for (ic = 2; ic ; ic--)
|
for (ic = 2; ic ; ic--)
|
||||||
{
|
{
|
||||||
fix[ic] -= counts[ic];
|
memcpy(orelocs + sorelocs,fix[ic],4 * xcounts[ic]);
|
||||||
memcpy(orelocs + sorelocs,fix[ic],4 * counts[ic]);
|
sorelocs += 4 * xcounts[ic];
|
||||||
sorelocs += 4 * counts[ic];
|
|
||||||
delete [] fix[ic];
|
delete [] fix[ic];
|
||||||
|
|
||||||
set_le32(orelocs + sorelocs,0);
|
set_le32(orelocs + sorelocs,0);
|
||||||
if (counts[ic])
|
if (xcounts[ic])
|
||||||
{
|
{
|
||||||
sorelocs += 4;
|
sorelocs += 4;
|
||||||
big_relocs |= 2 * ic;
|
big_relocs |= 2 * ic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] fix[3];
|
|
||||||
info("Relocations: original size: %u bytes, preprocessed size: %u bytes",(unsigned) IDSIZE(PEDIR_RELOC),sorelocs);
|
info("Relocations: original size: %u bytes, preprocessed size: %u bytes",(unsigned) IDSIZE(PEDIR_RELOC),sorelocs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -573,7 +580,6 @@ unsigned PackW32Pe::processImports() // pass 1
|
|||||||
LE32 *lookupt;
|
LE32 *lookupt;
|
||||||
unsigned npos;
|
unsigned npos;
|
||||||
bool isk32;
|
bool isk32;
|
||||||
unsigned _; // padding to 32
|
|
||||||
|
|
||||||
static int __acc_cdecl_qsort compare(const void *p1, const void *p2)
|
static int __acc_cdecl_qsort compare(const void *p1, const void *p2)
|
||||||
{
|
{
|
||||||
@@ -589,8 +595,7 @@ unsigned PackW32Pe::processImports() // pass 1
|
|||||||
if (!u2->shname) return -1;
|
if (!u2->shname) return -1;
|
||||||
return strlen(u1->shname) - strlen(u2->shname);
|
return strlen(u1->shname) - strlen(u2->shname);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
__attribute_packed;
|
|
||||||
|
|
||||||
// +1 for dllnum=0
|
// +1 for dllnum=0
|
||||||
Array(struct udll, dlls, dllnum+1);
|
Array(struct udll, dlls, dllnum+1);
|
||||||
@@ -661,9 +666,9 @@ unsigned PackW32Pe::processImports() // pass 1
|
|||||||
|
|
||||||
unsigned k32namepos = ptr_diff(dllnames,oimpdlls);
|
unsigned k32namepos = ptr_diff(dllnames,oimpdlls);
|
||||||
|
|
||||||
memcpy(importednames,llgpa,sizeof(llgpa));
|
memcpy(importednames, llgpa, sizeof(llgpa));
|
||||||
if (!isdll)
|
if (!isdll)
|
||||||
memcpy(importednames + sizeof(llgpa) - 1,exitp,sizeof(exitp));
|
memcpy(importednames + sizeof(llgpa) - 1, exitp, sizeof(exitp));
|
||||||
strcpy(dllnames,kernel32dll);
|
strcpy(dllnames,kernel32dll);
|
||||||
im->dllname = k32namepos;
|
im->dllname = k32namepos;
|
||||||
im->iat = ptr_diff(ordinals,oimpdlls);
|
im->iat = ptr_diff(ordinals,oimpdlls);
|
||||||
@@ -1173,10 +1178,9 @@ public:
|
|||||||
bool clear();
|
bool clear();
|
||||||
|
|
||||||
void dump() const { dump(root,0); }
|
void dump() const { dump(root,0); }
|
||||||
/*
|
|
||||||
unsigned iname() const {return current->parent->id;}
|
unsigned iname() const {return current->parent->id;}
|
||||||
const upx_byte *nname() const {return current->parent->name;}
|
const upx_byte *nname() const {return current->parent->name;}
|
||||||
|
/*
|
||||||
unsigned ilang() const {return current->id;}
|
unsigned ilang() const {return current->id;}
|
||||||
const upx_byte *nlang() const {return current->name;}
|
const upx_byte *nlang() const {return current->name;}
|
||||||
*/
|
*/
|
||||||
@@ -1199,10 +1203,7 @@ void Resource::check(const res_dir *node,unsigned level)
|
|||||||
{
|
{
|
||||||
int ic = node->identr + node->namedentr;
|
int ic = node->identr + node->namedentr;
|
||||||
if (ic == 0)
|
if (ic == 0)
|
||||||
{
|
return;
|
||||||
//throwCantPack("unsupported resource structure");
|
|
||||||
throwCantPack("empty resource sections are not supported");
|
|
||||||
}
|
|
||||||
for (const res_dir_entry *rde = node->entries; --ic >= 0; rde++)
|
for (const res_dir_entry *rde = node->entries; --ic >= 0; rde++)
|
||||||
if (((rde->child & 0x80000000) == 0) ^ (level == 2))
|
if (((rde->child & 0x80000000) == 0) ^ (level == 2))
|
||||||
throwCantPack("unsupported resource structure");
|
throwCantPack("unsupported resource structure");
|
||||||
@@ -1228,10 +1229,14 @@ Resource::upx_rnode *Resource::convert(const void *rnode,upx_rnode *parent,unsig
|
|||||||
}
|
}
|
||||||
|
|
||||||
const res_dir *node = (const res_dir *) rnode;
|
const res_dir *node = (const res_dir *) rnode;
|
||||||
|
int ic = node->identr + node->namedentr;
|
||||||
|
if (ic == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
upx_rbranch *branch = new upx_rbranch;
|
upx_rbranch *branch = new upx_rbranch;
|
||||||
branch->name = NULL;
|
branch->name = NULL;
|
||||||
branch->parent = parent;
|
branch->parent = parent;
|
||||||
int ic = branch->nc = node->identr + node->namedentr;
|
branch->nc = ic;
|
||||||
branch->children = new upx_rnode*[ic];
|
branch->children = new upx_rnode*[ic];
|
||||||
branch->data = *node;
|
branch->data = *node;
|
||||||
|
|
||||||
@@ -1298,12 +1303,14 @@ upx_byte *Resource::build()
|
|||||||
void Resource::destroy(upx_rnode *node,unsigned level)
|
void Resource::destroy(upx_rnode *node,unsigned level)
|
||||||
{
|
{
|
||||||
delete [] node->name; node->name = NULL;
|
delete [] node->name; node->name = NULL;
|
||||||
if (level == 3)
|
if (level != 3)
|
||||||
return;
|
{
|
||||||
upx_rbranch * const branch = (upx_rbranch *) node;
|
upx_rbranch * const branch = (upx_rbranch *) node;
|
||||||
for (int ic = branch->nc; --ic >= 0; )
|
for (int ic = branch->nc; --ic >= 0; )
|
||||||
destroy(branch->children[ic],level + 1);
|
destroy(branch->children[ic],level + 1);
|
||||||
delete [] branch->children; branch->children = NULL;
|
delete [] branch->children; branch->children = NULL;
|
||||||
|
}
|
||||||
|
delete node;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lame_print_unicode(const upx_byte *p)
|
static void lame_print_unicode(const upx_byte *p)
|
||||||
@@ -1373,6 +1380,52 @@ void PackW32Pe::processResources(Resource *res,unsigned newaddr)
|
|||||||
delete [] p;
|
delete [] p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool match(unsigned itype, const unsigned char *ntype,
|
||||||
|
unsigned iname, const unsigned char *nname,
|
||||||
|
const char *keep)
|
||||||
|
{
|
||||||
|
// format of string keep: type1[/name1],type2[/name2], ....
|
||||||
|
// typex and namex can be string or number
|
||||||
|
// hopefully resource names do not have '/' or ',' characters inside
|
||||||
|
|
||||||
|
struct helper
|
||||||
|
{
|
||||||
|
static bool match(unsigned num, const unsigned char *unistr,
|
||||||
|
const char *keep)
|
||||||
|
{
|
||||||
|
if (!unistr)
|
||||||
|
return (unsigned) atoi(keep) == num;
|
||||||
|
|
||||||
|
unsigned ic;
|
||||||
|
for (ic = 0; ic < get_le16(unistr); ic++)
|
||||||
|
if (unistr[2 + ic * 2] != (unsigned char) keep[ic])
|
||||||
|
return false;
|
||||||
|
return keep[ic] == 0 || keep[ic] == ',' || keep[ic] == '/';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// FIXME this comparison is not too exact
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
char *delim1 = strchr(keep, '/');
|
||||||
|
char *delim2 = strchr(keep, ',');
|
||||||
|
if (helper::match(itype, ntype, keep))
|
||||||
|
{
|
||||||
|
if (!delim1)
|
||||||
|
return true;
|
||||||
|
if (delim2 && delim2 < delim1)
|
||||||
|
return true;
|
||||||
|
if (helper::match(iname, nname, delim1 + 1))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (delim2 == NULL)
|
||||||
|
break;
|
||||||
|
keep = delim2 + 1;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void PackW32Pe::processResources(Resource *res)
|
void PackW32Pe::processResources(Resource *res)
|
||||||
{
|
{
|
||||||
const unsigned vaddr = IDADDR(PEDIR_RESOURCE);
|
const unsigned vaddr = IDADDR(PEDIR_RESOURCE);
|
||||||
@@ -1441,6 +1494,10 @@ void PackW32Pe::processResources(Resource *res)
|
|||||||
do_compress = false; // u"REGISTRY"
|
do_compress = false; // u"REGISTRY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (do_compress && opt->win32_pe.keep_resource[0])
|
||||||
|
do_compress ^= match(res->itype(), res->ntype(), res->iname(),
|
||||||
|
res->nname(), opt->win32_pe.keep_resource);
|
||||||
|
|
||||||
if (do_compress)
|
if (do_compress)
|
||||||
{
|
{
|
||||||
csize += res->size();
|
csize += res->size();
|
||||||
@@ -1483,6 +1540,7 @@ void PackW32Pe::processResources(Resource *res)
|
|||||||
info("Resources: compressed %u (%u bytes), not compressed %u (%u bytes)",cnum,csize,unum,usize);
|
info("Resources: compressed %u (%u bytes), not compressed %u (%u bytes)",cnum,csize,unum,usize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// Load Configuration handling
|
// Load Configuration handling
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
@@ -1673,12 +1731,12 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
// check the PE header
|
// check the PE header
|
||||||
// FIXME: add more checks
|
// FIXME: add more checks
|
||||||
if (!opt->force && (
|
if (!opt->force && (
|
||||||
ih.cpu < 0x14c || ih.cpu > 0x150
|
(ih.cpu < 0x14c || ih.cpu > 0x150)
|
||||||
|| ih.opthdrsize != 0xE0
|
|| (ih.opthdrsize != 0xe0)
|
||||||
|| (ih.flags & EXECUTABLE) == 0
|
|| ((ih.flags & EXECUTABLE) == 0)
|
||||||
|| (ih.subsystem != 2 && ih.subsystem != 3 && ih.subsystem != 1)
|
|| (ih.subsystem != 2 && ih.subsystem != 3 && ih.subsystem != 1)
|
||||||
|| (ih.entry == 0 && !isdll)
|
|| (ih.entry == 0 && !isdll)
|
||||||
|| ih.ddirsentries != 16
|
|| (ih.ddirsentries != 16)
|
||||||
|| IDSIZE(PEDIR_EXCEPTION) // is this used on i386?
|
|| IDSIZE(PEDIR_EXCEPTION) // is this used on i386?
|
||||||
// || IDSIZE(PEDIR_COPYRIGHT)
|
// || IDSIZE(PEDIR_COPYRIGHT)
|
||||||
))
|
))
|
||||||
@@ -1701,7 +1759,7 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
|
|
||||||
if (memcmp(isection[0].name,"UPX",3) == 0)
|
if (memcmp(isection[0].name,"UPX",3) == 0)
|
||||||
throwAlreadyPackedByUPX();
|
throwAlreadyPackedByUPX();
|
||||||
if (!opt->force && (IDSIZE(15) || ih.entry > isection[1].vaddr))
|
if (!opt->force && IDSIZE(15))
|
||||||
throwCantPack("file is possibly packed/protected (try --force)");
|
throwCantPack("file is possibly packed/protected (try --force)");
|
||||||
if (ih.entry && ih.entry < rvamin)
|
if (ih.entry && ih.entry < rvamin)
|
||||||
throwCantPack("run a virus scanner on this file!");
|
throwCantPack("run a virus scanner on this file!");
|
||||||
@@ -1852,6 +1910,14 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
ft.addvalue = ih.codebase - rvamin;
|
ft.addvalue = ih.codebase - rvamin;
|
||||||
// compress
|
// compress
|
||||||
int strategy = allow_filter ? 0 : -3;
|
int strategy = allow_filter ? 0 : -3;
|
||||||
|
|
||||||
|
// disable filters for files with broken headers
|
||||||
|
if (ih.codebase + ih.codesize > ph.u_len)
|
||||||
|
{
|
||||||
|
ft.buf_len = 1;
|
||||||
|
strategy = -3;
|
||||||
|
}
|
||||||
|
|
||||||
compressWithFilters(&ft, 2048, strategy,
|
compressWithFilters(&ft, 2048, strategy,
|
||||||
NULL, 0, 0, ih.codebase, rvamin);
|
NULL, 0, 0, ih.codebase, rvamin);
|
||||||
// info: see buildLoader()
|
// info: see buildLoader()
|
||||||
@@ -1915,11 +1981,11 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
// file. If this check fails the runtime does "interesting" things
|
// file. If this check fails the runtime does "interesting" things
|
||||||
// like not running the floating point initialization code - the result
|
// like not running the floating point initialization code - the result
|
||||||
// is an R6002 runtime error.
|
// is an R6002 runtime error.
|
||||||
// These supposed to be read only addresses are covered by the section
|
// These supposed to be read only addresses are covered by the sections
|
||||||
// UPX0 in the compressed files, so we have to patch the PE header
|
// UPX0 & UPX1 in the compressed files, so we have to patch the PE header
|
||||||
// in the memory. And the page on which the PE header is stored is read
|
// in the memory. And the page on which the PE header is stored is read
|
||||||
// only so we must make it rw, fix the flag (i.e. clear
|
// only so we must make it rw, fix the flags (i.e. clear
|
||||||
// PEFL_WRITE of osection[0].flags), and make it ro again.
|
// PEFL_WRITE of osection[x].flags), and make it ro again.
|
||||||
|
|
||||||
// rva of the most significant byte of member "flags" in section "UPX0"
|
// rva of the most significant byte of member "flags" in section "UPX0"
|
||||||
const unsigned swri = pe_offset + sizeof(oh) + sizeof(pe_section_t) - 1;
|
const unsigned swri = pe_offset + sizeof(oh) + sizeof(pe_section_t) - 1;
|
||||||
@@ -1927,11 +1993,18 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
if (swri >= 0x1000)
|
if (swri >= 0x1000)
|
||||||
throwCantPack("swri >= 0x1000! Send a bug report please!");
|
throwCantPack("swri >= 0x1000! Send a bug report please!");
|
||||||
patch_le32(loader, codesize, "SWRI", swri);
|
patch_le32(loader, codesize, "SWRI", swri);
|
||||||
|
patch_le32(loader, codesize, "IMGL", 0x1000); // one page
|
||||||
patch_le32(loader, codesize, "IMGB", 0u - rvamin);
|
patch_le32(loader, codesize, "IMGB", 0u - rvamin);
|
||||||
#else
|
#else
|
||||||
// make sure we only touch exactly one page
|
// make sure we only touch the minimum number of pages
|
||||||
const unsigned addr = 0u - rvamin + swri;
|
const unsigned addr = 0u - rvamin + swri;
|
||||||
patch_le32(loader, codesize, "SWRI", addr & 0xfff); // page offset
|
patch_le32(loader, codesize, "SWRI", addr & 0xfff); // page offset
|
||||||
|
// check whether osection[0].flags and osection[1].flags
|
||||||
|
// are on the same page
|
||||||
|
if ((addr & 0xfff) + 0x28 >= 0x1000)
|
||||||
|
patch_le32(loader, codesize, "IMGL", 0x2000); // two pages
|
||||||
|
else
|
||||||
|
patch_le32(loader, codesize, "IMGL", 0x1000); // one page
|
||||||
patch_le32(loader, codesize, "IMGB", addr &~ 0xfff); // page mask
|
patch_le32(loader, codesize, "IMGB", addr &~ 0xfff); // page mask
|
||||||
#endif
|
#endif
|
||||||
patch_le32(loader, codesize, "VPRO", myimport + get_le32(oimpdlls + 16) + 8);
|
patch_le32(loader, codesize, "VPRO", myimport + get_le32(oimpdlls + 16) + 8);
|
||||||
@@ -2102,6 +2175,9 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
// set_le32(ibuf + ic,get_le32("UPX "));
|
// set_le32(ibuf + ic,get_le32("UPX "));
|
||||||
ibuf.clear(0, oh.filealign);
|
ibuf.clear(0, oh.filealign);
|
||||||
|
|
||||||
|
info("Image size change: %u -> %u kBytes",
|
||||||
|
ih.imagesize / 1024, oh.imagesize / 1024);
|
||||||
|
|
||||||
infoHeader("[Writing compressed file]");
|
infoHeader("[Writing compressed file]");
|
||||||
|
|
||||||
// write loader + compressed file
|
// write loader + compressed file
|
||||||
@@ -2419,7 +2495,7 @@ void PackW32Pe::rebuildTls()
|
|||||||
|
|
||||||
void PackW32Pe::rebuildResources(upx_byte *& extrainfo)
|
void PackW32Pe::rebuildResources(upx_byte *& extrainfo)
|
||||||
{
|
{
|
||||||
if (ODSIZE(PEDIR_RESOURCE) == 0)
|
if (ODSIZE(PEDIR_RESOURCE) == 0 || IDSIZE(PEDIR_RESOURCE) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
icondir_count = get_le16(extrainfo);
|
icondir_count = get_le16(extrainfo);
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+34
-22
@@ -295,7 +295,7 @@ bool Packer::checkFinalCompressionRatio(const OutputFile *fo) const
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
void Packer::decompress(const upx_bytep in, upx_bytep out,
|
void Packer::decompress(const upx_bytep in, upx_bytep out,
|
||||||
bool verify_checksum, Filter *fp)
|
bool verify_checksum, Filter *ft)
|
||||||
{
|
{
|
||||||
unsigned adler;
|
unsigned adler;
|
||||||
|
|
||||||
@@ -316,8 +316,8 @@ void Packer::decompress(const upx_bytep in, upx_bytep out,
|
|||||||
// verify checksum of decompressed data
|
// verify checksum of decompressed data
|
||||||
if (verify_checksum)
|
if (verify_checksum)
|
||||||
{
|
{
|
||||||
if (fp) {
|
if (ft) {
|
||||||
fp->unfilter(out, ph.u_len);
|
ft->unfilter(out, ph.u_len);
|
||||||
}
|
}
|
||||||
adler = upx_adler32(out, ph.u_len, ph.saved_u_adler);
|
adler = upx_adler32(out, ph.u_len, ph.saved_u_adler);
|
||||||
if (adler != ph.u_adler)
|
if (adler != ph.u_adler)
|
||||||
@@ -358,7 +358,7 @@ bool Packer::testOverlappingDecompression(const upx_bytep buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Packer::verifyOverlappingDecompression(Filter *fp)
|
void Packer::verifyOverlappingDecompression(Filter *ft)
|
||||||
{
|
{
|
||||||
assert(ph.c_len < ph.u_len);
|
assert(ph.c_len < ph.u_len);
|
||||||
assert((int)ph.overlap_overhead > 0);
|
assert((int)ph.overlap_overhead > 0);
|
||||||
@@ -384,7 +384,7 @@ void Packer::verifyOverlappingDecompression(Filter *fp)
|
|||||||
if (offset + ph.c_len > obuf.getSize())
|
if (offset + ph.c_len > obuf.getSize())
|
||||||
return;
|
return;
|
||||||
memmove(obuf + offset, obuf, ph.c_len);
|
memmove(obuf + offset, obuf, ph.c_len);
|
||||||
decompress(obuf + offset, obuf, true, fp);
|
decompress(obuf + offset, obuf, true, ft);
|
||||||
obuf.checkState();
|
obuf.checkState();
|
||||||
#endif /* !UNUPX */
|
#endif /* !UNUPX */
|
||||||
}
|
}
|
||||||
@@ -1055,6 +1055,14 @@ char const *Packer::getIdentstr(unsigned *size, int small)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Packer::createLinker(const void *pdata, int plen, int pinfo)
|
||||||
|
{
|
||||||
|
if (getFormat() < 128)
|
||||||
|
linker = new Linker(pdata, plen, pinfo); // little endian
|
||||||
|
else
|
||||||
|
linker = new BeLinker(pdata, plen, pinfo); // big endian
|
||||||
|
}
|
||||||
|
|
||||||
void Packer::initLoader(const void *pdata, int plen, int pinfo, int small)
|
void Packer::initLoader(const void *pdata, int plen, int pinfo, int small)
|
||||||
{
|
{
|
||||||
if (pinfo < 0)
|
if (pinfo < 0)
|
||||||
@@ -1064,10 +1072,7 @@ void Packer::initLoader(const void *pdata, int plen, int pinfo, int small)
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete linker; linker = NULL;
|
delete linker; linker = NULL;
|
||||||
if (getFormat() < 128)
|
createLinker(pdata, plen, pinfo);
|
||||||
linker = new Linker(pdata, plen, pinfo); // little endian
|
|
||||||
else
|
|
||||||
linker = new BeLinker(pdata, plen, pinfo); // big endian
|
|
||||||
|
|
||||||
unsigned size;
|
unsigned size;
|
||||||
char const * const ident = getIdentstr(&size, small);
|
char const * const ident = getIdentstr(&size, small);
|
||||||
@@ -1302,7 +1307,7 @@ void Packer::compressWithFilters(Filter *parm_ft,
|
|||||||
best_ph.c_len = orig_ph.u_len;
|
best_ph.c_len = orig_ph.u_len;
|
||||||
best_ph.overlap_overhead = 0;
|
best_ph.overlap_overhead = 0;
|
||||||
unsigned best_ph_lsize = 0;
|
unsigned best_ph_lsize = 0;
|
||||||
unsigned best_hdr_clen = 0;
|
unsigned best_hdr_c_len = 0;
|
||||||
|
|
||||||
// preconditions
|
// preconditions
|
||||||
assert(orig_ph.filter == 0);
|
assert(orig_ph.filter == 0);
|
||||||
@@ -1396,8 +1401,9 @@ void Packer::compressWithFilters(Filter *parm_ft,
|
|||||||
int nfilters_success = 0;
|
int nfilters_success = 0;
|
||||||
for (int m = 0; m < nmethods; m++) // for all methods
|
for (int m = 0; m < nmethods; m++) // for all methods
|
||||||
{
|
{
|
||||||
unsigned hdr_clen = 0;
|
unsigned hdr_c_len = 0;
|
||||||
if (hdr_buf && hdr_u_len) {
|
if (hdr_buf && hdr_u_len)
|
||||||
|
{
|
||||||
unsigned result[16];
|
unsigned result[16];
|
||||||
upx_compress_config_t conf;
|
upx_compress_config_t conf;
|
||||||
memset(&conf, 0xff, sizeof(conf));
|
memset(&conf, 0xff, sizeof(conf));
|
||||||
@@ -1405,9 +1411,12 @@ void Packer::compressWithFilters(Filter *parm_ft,
|
|||||||
otemp_buf.allocForCompression(compress_buf_len);
|
otemp_buf.allocForCompression(compress_buf_len);
|
||||||
otemp = &otemp_buf;
|
otemp = &otemp_buf;
|
||||||
}
|
}
|
||||||
int r = upx_compress(hdr_buf, hdr_u_len, *otemp, &hdr_clen,
|
int r = upx_compress(hdr_buf, hdr_u_len, *otemp, &hdr_c_len,
|
||||||
0, methods[m], 10, &conf, result);
|
0, methods[m], 10, &conf, result);
|
||||||
(void)r;
|
if (r != UPX_E_OK)
|
||||||
|
throwInternalError("header compression failed");
|
||||||
|
if (hdr_c_len >= hdr_u_len)
|
||||||
|
throwInternalError("header compression size increase");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < nfilters; i++) // for all filters
|
for (int i = 0; i < nfilters; i++) // for all filters
|
||||||
{
|
{
|
||||||
@@ -1417,6 +1426,7 @@ void Packer::compressWithFilters(Filter *parm_ft,
|
|||||||
ph = orig_ph;
|
ph = orig_ph;
|
||||||
ph.method = methods[m];
|
ph.method = methods[m];
|
||||||
ph.filter = filters[i];
|
ph.filter = filters[i];
|
||||||
|
ph.overlap_overhead = 0;
|
||||||
// get fresh filter
|
// get fresh filter
|
||||||
Filter ft = orig_ft;
|
Filter ft = orig_ft;
|
||||||
ft.init(ph.filter, orig_ft.addvalue);
|
ft.init(ph.filter, orig_ft.addvalue);
|
||||||
@@ -1457,26 +1467,27 @@ void Packer::compressWithFilters(Filter *parm_ft,
|
|||||||
if (compress(ibuf + compress_buf_off, *otemp, max_offset, max_match))
|
if (compress(ibuf + compress_buf_off, *otemp, max_offset, max_match))
|
||||||
{
|
{
|
||||||
unsigned lsize = 0;
|
unsigned lsize = 0;
|
||||||
if (ph.c_len + lsize < best_ph.c_len + best_ph_lsize)
|
if (ph.c_len + lsize + hdr_c_len <= best_ph.c_len + best_ph_lsize + best_hdr_c_len)
|
||||||
{
|
{
|
||||||
// get results
|
// get results
|
||||||
ph.overlap_overhead = findOverlapOverhead(*otemp, overlap_range);
|
ph.overlap_overhead = findOverlapOverhead(*otemp, overlap_range);
|
||||||
lsize = buildLoader(&ft);
|
lsize = buildLoader(&ft);
|
||||||
|
assert(lsize > 0);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
printf("\n%2d %02x: %d +%4d +%3d = %d (best: %d +%4d +%3d = %d)\n", ph.method, ph.filter,
|
printf("\n%2d %02x: %d +%4d +%3d = %d (best: %d +%4d +%3d = %d)\n", ph.method, ph.filter,
|
||||||
ph.c_len, lsize, hdr_clen, ph.c_len + lsize + hdr_clen,
|
ph.c_len, lsize, hdr_c_len, ph.c_len + lsize + hdr_c_len,
|
||||||
best_ph.c_len, best_ph_lsize, best_hdr_clen, best_ph.c_len + best_ph_lsize + best_hdr_clen);
|
best_ph.c_len, best_ph_lsize, best_hdr_c_len, best_ph.c_len + best_ph_lsize + best_hdr_c_len);
|
||||||
#endif
|
#endif
|
||||||
bool update = false;
|
bool update = false;
|
||||||
if (ph.c_len + lsize + hdr_clen < best_ph.c_len + best_ph_lsize + best_hdr_clen)
|
if (ph.c_len + lsize + hdr_c_len < best_ph.c_len + best_ph_lsize + best_hdr_c_len)
|
||||||
update = true;
|
update = true;
|
||||||
else if (ph.c_len + lsize + hdr_clen == best_ph.c_len + best_ph_lsize + best_hdr_clen)
|
else if (ph.c_len + lsize + hdr_c_len == best_ph.c_len + best_ph_lsize + best_hdr_c_len)
|
||||||
{
|
{
|
||||||
// prefer smaller loaders
|
// prefer smaller loaders
|
||||||
if (lsize + hdr_clen < best_ph_lsize + best_hdr_clen)
|
if (lsize + hdr_c_len < best_ph_lsize + best_hdr_c_len)
|
||||||
update = true;
|
update = true;
|
||||||
else if (lsize + hdr_clen == best_ph_lsize + best_hdr_clen)
|
else if (lsize + hdr_c_len == best_ph_lsize + best_hdr_c_len)
|
||||||
{
|
{
|
||||||
// prefer less overlap_overhead
|
// prefer less overlap_overhead
|
||||||
if (ph.overlap_overhead < best_ph.overlap_overhead)
|
if (ph.overlap_overhead < best_ph.overlap_overhead)
|
||||||
@@ -1485,13 +1496,14 @@ void Packer::compressWithFilters(Filter *parm_ft,
|
|||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
|
assert((int)ph.overlap_overhead > 0);
|
||||||
// update obuf[] with best version
|
// update obuf[] with best version
|
||||||
if (otemp != &obuf)
|
if (otemp != &obuf)
|
||||||
memcpy(obuf, *otemp, ph.c_len);
|
memcpy(obuf, *otemp, ph.c_len);
|
||||||
// save compression results
|
// save compression results
|
||||||
best_ph = ph;
|
best_ph = ph;
|
||||||
best_ph_lsize = lsize;
|
best_ph_lsize = lsize;
|
||||||
best_hdr_clen = hdr_clen;
|
best_hdr_c_len = hdr_c_len;
|
||||||
best_ft = ft;
|
best_ft = ft;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ protected:
|
|||||||
virtual bool compress(upx_bytep in, upx_bytep out,
|
virtual bool compress(upx_bytep in, upx_bytep out,
|
||||||
unsigned max_offset = 0, unsigned max_match = 0);
|
unsigned max_offset = 0, unsigned max_match = 0);
|
||||||
virtual void decompress(const upx_bytep in, upx_bytep out,
|
virtual void decompress(const upx_bytep in, upx_bytep out,
|
||||||
bool verify_checksum = true, Filter *fp = 0);
|
bool verify_checksum = true, Filter *ft = NULL);
|
||||||
virtual bool checkCompressionRatio(unsigned u_len, unsigned c_len) const;
|
virtual bool checkCompressionRatio(unsigned u_len, unsigned c_len) const;
|
||||||
virtual bool checkFinalCompressionRatio(const OutputFile *fo) const;
|
virtual bool checkFinalCompressionRatio(const OutputFile *fo) const;
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ protected:
|
|||||||
unsigned range = 0,
|
unsigned range = 0,
|
||||||
unsigned upper_limit = ~0u) const;
|
unsigned upper_limit = ~0u) const;
|
||||||
// destructive decompress + verify
|
// destructive decompress + verify
|
||||||
virtual void verifyOverlappingDecompression(Filter *fp = 0);
|
virtual void verifyOverlappingDecompression(Filter *ft = NULL);
|
||||||
|
|
||||||
|
|
||||||
// packheader handling
|
// packheader handling
|
||||||
@@ -271,6 +271,7 @@ protected:
|
|||||||
protected:
|
protected:
|
||||||
// linker
|
// linker
|
||||||
Linker *linker;
|
Linker *linker;
|
||||||
|
virtual void createLinker(const void *pdata, int plen, int pinfo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// private to checkPatch()
|
// private to checkPatch()
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -212,14 +212,14 @@ static Packer* try_packers(InputFile *f, try_function func)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (opt->o_unix.use_ptinterp) {
|
if (opt->o_unix.use_ptinterp) {
|
||||||
if ((p = func(new PackLinuxI386interp(f),f)) != NULL)
|
if ((p = func(new PackLinuxElf32x86interp(f),f)) != NULL)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
if ((p = func(new PackLinuxElf64amd(f),f)) != NULL)
|
if ((p = func(new PackLinuxElf64amd(f),f)) != NULL)
|
||||||
return p;
|
return p;
|
||||||
if ((p = func(new PackLinuxElf32ppc(f),f)) != NULL)
|
if ((p = func(new PackLinuxElf32ppc(f),f)) != NULL)
|
||||||
return p;
|
return p;
|
||||||
if ((p = func(new PackLinuxI386elf(f),f)) != NULL)
|
if ((p = func(new PackLinuxElf32x86(f),f)) != NULL)
|
||||||
return p;
|
return p;
|
||||||
if ((p = func(new PackLinuxI386sh(f),f)) != NULL)
|
if ((p = func(new PackLinuxI386sh(f),f)) != NULL)
|
||||||
return p;
|
return p;
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
markus@oberhumer.com ml1050@users.sourceforge.net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
.*-stamp
|
|
||||||
*.ah
|
|
||||||
*.asx
|
|
||||||
*.asy
|
|
||||||
*.bin
|
|
||||||
*.d
|
|
||||||
*.i
|
|
||||||
*.lst
|
|
||||||
*.map
|
|
||||||
*.out
|
|
||||||
*.o
|
|
||||||
*.tmp
|
|
||||||
GNUmakefile
|
|
||||||
MMakefile
|
|
||||||
stamp-h
|
|
||||||
stubify.exe
|
|
||||||
upxb
|
|
||||||
upxd
|
|
||||||
+56
-38
@@ -32,7 +32,7 @@ top_srcdir = ../..
|
|||||||
|
|
||||||
# These are the files we want to create.
|
# These are the files we want to create.
|
||||||
STUBS = \
|
STUBS = \
|
||||||
l_armpe.h \
|
l_armpea.h l_armpet.h \
|
||||||
l_com.h \
|
l_com.h \
|
||||||
l_djgpp2.h stubify.h \
|
l_djgpp2.h stubify.h \
|
||||||
l_exe.h \
|
l_exe.h \
|
||||||
@@ -101,28 +101,23 @@ O2BIN = perl -w $(srcdir)/scripts/o2bin.pl
|
|||||||
### i386-linux
|
### i386-linux
|
||||||
###
|
###
|
||||||
|
|
||||||
LD_LINUX_I386 = ld-2.13.2 -m elf_i386
|
LD_LINUX_I386 = i386-linux-ld-2.16.1 -m elf_i386
|
||||||
LD_LINUX_I386 = ld -m elf_i386
|
OBJCOPY_LINUX_I386 = i386-linux-objcopy-2.16.1 -F elf32-i386
|
||||||
OBJCOPY_LINUX_I386 = objcopy -F elf32-i386
|
|
||||||
OBJSTRIP_LINUX_I386 = $(OBJCOPY_LINUX_I386) -R .comment -R .note
|
OBJSTRIP_LINUX_I386 = $(OBJCOPY_LINUX_I386) -R .comment -R .note
|
||||||
STRIPELF_LINUX_I386 = ./util/sstrip/i386-linux-sstrip
|
STRIPELF_LINUX_I386 = ./util/sstrip/i386-linux-sstrip
|
||||||
|
|
||||||
# gcc 2.7.2.3 (fold_*86.bin: 1839 / 1011 / xxxx / 1390)
|
# gcc 2.7.2.3 (fold_*86.bin: 1900 / 1011 / 1786 / 1401)
|
||||||
CC_LINUX_I386_GCC272 = gcc-2.72 -m386 -O2 -MMD
|
CC_LINUX_I386_GCC272 = i386-linux-gcc-2.72 -m386 -O2 -MMD
|
||||||
CC_LINUX_I386_GCC272 += -malign-functions=0 -malign-jumps=0 -malign-loops=0
|
CC_LINUX_I386_GCC272 += -malign-functions=0 -malign-jumps=0 -malign-loops=0
|
||||||
|
|
||||||
# gcc 2.95.3 (fold_*86.bin: 1721 / 995 / xxxx / 1321)
|
# gcc 2.95.3 (fold_*86.bin: 1770 / 995 / 1661 / 1314)
|
||||||
CC_LINUX_I386_GCC295 = gcc-2.95.3 -march=i386 -mcpu=k6 -fno-exceptions -MMD
|
CC_LINUX_I386_GCC295 = i386-linux-gcc-2.95.3 -march=i386 -mcpu=k6 -fno-exceptions -MMD
|
||||||
CC_LINUX_I386_GCC295 += -Os -fno-omit-frame-pointer
|
CC_LINUX_I386_GCC295 += -Os -fno-omit-frame-pointer
|
||||||
CC_LINUX_I386_GCC295 += -malign-functions=0 -malign-jumps=0 -malign-loops=0
|
CC_LINUX_I386_GCC295 += -malign-functions=0 -malign-jumps=0 -malign-loops=0
|
||||||
CC_LINUX_I386_GCC295 += -Werror
|
CC_LINUX_I386_GCC295 += -Werror
|
||||||
|
|
||||||
# gcc 3.4.5 (fold_*86.bin: 1670 / 947 / 1552 / 1212)
|
# gcc 3.4.6 (fold_*86.bin: 1651 / 947 / 1537 / 1190)
|
||||||
# gcc 3.4.6 (fold_*86.bin: 1670 / 947 / 1552 / 1212) [unchanged from 3.4.5]
|
CC_LINUX_I386_GCC34 = i386-linux-gcc-3.4.6
|
||||||
# gcc 4.0.3 (fold_*86.bin: 1741 / 995 / 1639 / 1202)
|
|
||||||
# gcc 4.1.0 (fold_*86.bin: 1644 / 947 / 1524 / 1144)
|
|
||||||
## ==> TODO: upgrade to 4.1.0
|
|
||||||
CC_LINUX_I386_GCC34 = gcc-3.4.5
|
|
||||||
CC_LINUX_I386_GCC34 += -m32 -march=i386 -mtune=k6 -fno-exceptions -MMD
|
CC_LINUX_I386_GCC34 += -m32 -march=i386 -mtune=k6 -fno-exceptions -MMD
|
||||||
CC_LINUX_I386_GCC34 += -Os -fno-omit-frame-pointer
|
CC_LINUX_I386_GCC34 += -Os -fno-omit-frame-pointer
|
||||||
CC_LINUX_I386_GCC34 += -momit-leaf-frame-pointer
|
CC_LINUX_I386_GCC34 += -momit-leaf-frame-pointer
|
||||||
@@ -131,8 +126,20 @@ CC_LINUX_I386_GCC34 += -mpreferred-stack-boundary=2
|
|||||||
CC_LINUX_I386_GCC34 += -fweb
|
CC_LINUX_I386_GCC34 += -fweb
|
||||||
CC_LINUX_I386_GCC34 += -Werror
|
CC_LINUX_I386_GCC34 += -Werror
|
||||||
|
|
||||||
|
# gcc 4.1.0 (fold_*86.bin: 1725 / 963 / 1620 / 1202)
|
||||||
|
# gcc 4.0.3 (fold_*86.bin: 1731 / 995 / 1625 / 1195)
|
||||||
|
CC_LINUX_I386_GCC41 = i386-linux-gcc-4.1.0
|
||||||
|
CC_LINUX_I386_GCC41 += -m32 -march=i386 -mtune=k6 -fno-exceptions -MMD
|
||||||
|
CC_LINUX_I386_GCC41 += -Os -fno-omit-frame-pointer
|
||||||
|
CC_LINUX_I386_GCC41 += -momit-leaf-frame-pointer
|
||||||
|
CC_LINUX_I386_GCC41 += -fno-align-functions -fno-align-jumps -fno-align-labels -fno-align-loops
|
||||||
|
CC_LINUX_I386_GCC41 += -mpreferred-stack-boundary=2
|
||||||
|
CC_LINUX_I386_GCC41 += -fweb
|
||||||
|
CC_LINUX_I386_GCC41 += -Werror
|
||||||
|
|
||||||
CC_LINUX_I386 = $(CC_LINUX_I386_GCC272)
|
CC_LINUX_I386 = $(CC_LINUX_I386_GCC272)
|
||||||
CC_LINUX_I386 = $(CC_LINUX_I386_GCC295)
|
CC_LINUX_I386 = $(CC_LINUX_I386_GCC295)
|
||||||
|
CC_LINUX_I386 = $(CC_LINUX_I386_GCC41)
|
||||||
CC_LINUX_I386 = $(CC_LINUX_I386_GCC34)
|
CC_LINUX_I386 = $(CC_LINUX_I386_GCC34)
|
||||||
CC_LINUX_I386 += -nostdinc
|
CC_LINUX_I386 += -nostdinc
|
||||||
CC_LINUX_I386 += -Wall -W -Wcast-align -Wcast-qual -Wwrite-strings
|
CC_LINUX_I386 += -Wall -W -Wcast-align -Wcast-qual -Wwrite-strings
|
||||||
@@ -143,7 +150,7 @@ CC_LINUX_I386 += -funsigned-char
|
|||||||
### MIPS R3000
|
### MIPS R3000
|
||||||
###
|
###
|
||||||
|
|
||||||
CPP_MR3K = gcc-2.95.3 -nostdinc -I$(UCL_UPX) -I$(srcdir) -E -x assembler-with-cpp -Wall -Wp,-P,-C,-traditional
|
CPP_MR3K = i386-linux-gcc-2.95.3 -nostdinc -I$(UCL_UPX) -I$(srcdir) -E -x assembler-with-cpp -Wall -Wp,-P,-C,-traditional
|
||||||
APP_MR3K = perl -w $(srcdir)/scripts/app_mr3k.pl
|
APP_MR3K = perl -w $(srcdir)/scripts/app_mr3k.pl
|
||||||
ASM_MR3K = asm5900 --nologo -q
|
ASM_MR3K = asm5900 --nologo -q
|
||||||
|
|
||||||
@@ -182,10 +189,11 @@ ifneq ($(wildcard $d),)
|
|||||||
endif
|
endif
|
||||||
d = /opt/cc-i386-linux/crosstool/powerpc-750-linux-gnu/gcc-3.4.3.20050210-glibc-2.2.5/bin
|
d = /opt/cc-i386-linux/crosstool/powerpc-750-linux-gnu/gcc-3.4.3.20050210-glibc-2.2.5/bin
|
||||||
ifneq ($(wildcard $d),)
|
ifneq ($(wildcard $d),)
|
||||||
GCC_PPC32 := $d/powerpc-750-linux-gnu-gcc -m32 -nostdinc -MMD
|
GCC_PPC32 := $d/powerpc-750-linux-gnu-gcc -m32 -nostdinc -MMD -fno-exceptions -fno-asynchronous-unwind-tables
|
||||||
LD_PPC32 := $d/powerpc-750-linux-gnu-ld
|
LD_PPC32 := $d/powerpc-750-linux-gnu-ld
|
||||||
OBJCOPY_PPC32 := $d/powerpc-750-linux-gnu-objcopy
|
OBJCOPY_PPC32 := $d/powerpc-750-linux-gnu-objcopy
|
||||||
endif
|
endif
|
||||||
|
GCC_PPC32 += -Wall -W -Wcast-align -Wcast-qual -Wwrite-strings -Werror
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -209,16 +217,17 @@ ifneq ($(wildcard $d),)
|
|||||||
LD_AMD64 := $d/x86_64-unknown-linux-gnu-ld -m elf_x86_64
|
LD_AMD64 := $d/x86_64-unknown-linux-gnu-ld -m elf_x86_64
|
||||||
OBJCOPY_AMD64 := $d/x86_64-unknown-linux-gnu-objcopy -F elf64-x86-64
|
OBJCOPY_AMD64 := $d/x86_64-unknown-linux-gnu-objcopy -F elf64-x86-64
|
||||||
endif
|
endif
|
||||||
|
GCC_AMD64 += -Wall -W -Wcast-align -Wcast-qual -Wwrite-strings -Werror
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### ARM-PE-WINCE
|
### ARM-PE-WINCE
|
||||||
###
|
###
|
||||||
|
|
||||||
GCC_WINCE := arm-wince-pe-gcc -Os
|
GCC_ARM := arm-9tdmi-linux-gnu-gcc -march=armv4 -nostdinc -MMD
|
||||||
LD_WINCE := arm-wince-pe-ld
|
GCC_ARM += -Wall -W -Wcast-align -Wcast-qual -Wwrite-strings -Werror
|
||||||
OBJCOPY_WINCE := arm-wince-pe-objcopy
|
GCC_ARM_T := $(GCC_ARM) -march=armv4t
|
||||||
BIN2H_WINCE := perl -ne 'print "db\t", join(",", map { sprintf "%\#02x", $$_ } unpack("C*", $$_)), "\n"'
|
OBJCOPY_ARM := arm-9tdmi-linux-gnu-objcopy
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
@@ -238,7 +247,7 @@ stubs: $(STUBS)
|
|||||||
|
|
||||||
mostlyclean:
|
mostlyclean:
|
||||||
-rm -f *.bin *.bkp *.d *.i *.lst *.map stubify.exe
|
-rm -f *.bin *.bkp *.d *.i *.lst *.map stubify.exe
|
||||||
-rm -f *.o *.asx *.asy
|
-rm -f *.ah *.asx *.asy *.o *.out
|
||||||
|
|
||||||
clean: mostlyclean
|
clean: mostlyclean
|
||||||
ifneq ($(strip $(wildcard stamp-h)),)
|
ifneq ($(strip $(wildcard stamp-h)),)
|
||||||
@@ -264,10 +273,10 @@ strings: all
|
|||||||
# // rules
|
# // rules
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
%.asx : %.asm
|
%.asx : %.asm $(srcdir)/scripts/app_i386.pl
|
||||||
$(APP_I386) $< $@
|
$(APP_I386) $< $@
|
||||||
|
|
||||||
%.asy : %.ash
|
%.asy : %.ash $(srcdir)/scripts/app_i386.pl
|
||||||
$(APP_I386) $< $@
|
$(APP_I386) $< $@
|
||||||
|
|
||||||
|
|
||||||
@@ -319,6 +328,7 @@ l_w32pe.h: l_w32pe.asx
|
|||||||
$(NASM) -f bin -o $T.bin $<
|
$(NASM) -f bin -o $T.bin $<
|
||||||
$(BIN2H) $T.bin nrv_loader $@
|
$(BIN2H) $T.bin nrv_loader $@
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // atari/tos rules
|
# // atari/tos rules
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
@@ -414,7 +424,8 @@ l_lx_elfppc32.h: l_lx_elfppc32.S ppc_d_nrv2e.S
|
|||||||
$(BIN2H) $T.bin linux_elfppc32_loader $@
|
$(BIN2H) $T.bin linux_elfppc32_loader $@
|
||||||
|
|
||||||
l_lx_elf64amd.h: l_lx_elf64amd.S amd_d_nrv2e.S
|
l_lx_elf64amd.h: l_lx_elf64amd.S amd_d_nrv2e.S
|
||||||
$(GCC_AMD64) -c $T.S
|
$(GCC_AMD64) -c $<
|
||||||
|
$(OBJSTRIP_AMD64) $T.o
|
||||||
$(LD_AMD64) -o $T.bin --oformat binary $T.o
|
$(LD_AMD64) -o $T.bin --oformat binary $T.o
|
||||||
$(BIN2H) $T.bin linux_elf64amd_loader $@
|
$(BIN2H) $T.bin linux_elf64amd_loader $@
|
||||||
|
|
||||||
@@ -436,6 +447,7 @@ l_lx_sh.o: l_lx_sh.c linux.hh $(MAKEFILE_DEPS)
|
|||||||
|
|
||||||
l_lx_pti.o: l_lx_pti.c linux.hh $(MAKEFILE_DEPS)
|
l_lx_pti.o: l_lx_pti.c linux.hh $(MAKEFILE_DEPS)
|
||||||
$(CC_LINUX_I386) -c $<
|
$(CC_LINUX_I386) -c $<
|
||||||
|
$(OBJSTRIP_LINUX_I386) $@
|
||||||
|
|
||||||
fold_elf86.o: fold_elf86.asm
|
fold_elf86.o: fold_elf86.asm
|
||||||
$(NASM) -f elf -o $@ $<
|
$(NASM) -f elf -o $@ $<
|
||||||
@@ -450,18 +462,20 @@ fold_elf86.h: l_lx_elf.o fold_elf86.o l_lx_elf86.lds
|
|||||||
$(BIN2H) $T.bin linux_i386elf_fold $@
|
$(BIN2H) $T.bin linux_i386elf_fold $@
|
||||||
|
|
||||||
m_lx_elfppc32.o: m_lx_elfppc32.c $(MAKEFILE_DEPS)
|
m_lx_elfppc32.o: m_lx_elfppc32.c $(MAKEFILE_DEPS)
|
||||||
$(GCC_PPC32) -Os -c $<
|
$(GCC_PPC32) -c -Os $<
|
||||||
$(OBJSTRIP_PPC32) $@
|
$(OBJSTRIP_PPC32) $@
|
||||||
|
|
||||||
a_lx_elf64amd.o: a_lx_elf64.c $(MAKEFILE_DEPS)
|
a_lx_elf64amd.o: a_lx_elf64.c $(MAKEFILE_DEPS)
|
||||||
$(GCC_AMD64) -c -Os -o $@ $<
|
$(GCC_AMD64) -c -Os -fno-exceptions -fno-asynchronous-unwind-tables -o $@ $<
|
||||||
|
$(OBJSTRIP_AMD64) $@
|
||||||
|
|
||||||
fold_elfppc32.o: fold_elfppc32.S ppc_bxx.S $(MAKEFILE_DEPS)
|
fold_elfppc32.o: fold_elfppc32.S ppc_bxx.S $(MAKEFILE_DEPS)
|
||||||
$(GCC_PPC32) -c $<
|
$(GCC_PPC32) -c $<
|
||||||
$(OBJSTRIP_PPC32) $@
|
$(OBJSTRIP_PPC32) $@
|
||||||
|
|
||||||
fold_elf64amd.o: fold_elf64amd.S amd_bxx.S $(MAKEFILE_DEPS)
|
fold_elf64amd.o: fold_elf64amd.S amd_bxx.S $(MAKEFILE_DEPS)
|
||||||
$(GCC_AMD64) -c -O $T.S
|
$(GCC_AMD64) -c $<
|
||||||
|
$(OBJSTRIP_AMD64) $@
|
||||||
|
|
||||||
fold_elfppc32.h: m_lx_elfppc32.o fold_elfppc32.o l_lx_elfppc32.lds
|
fold_elfppc32.h: m_lx_elfppc32.o fold_elfppc32.o l_lx_elfppc32.lds
|
||||||
$(LD_PPC32) -T $(srcdir)/l_lx_elfppc32.lds -Map $T.map -o $T.bin --strip-all \
|
$(LD_PPC32) -T $(srcdir)/l_lx_elfppc32.lds -Map $T.map -o $T.bin --strip-all \
|
||||||
@@ -499,7 +513,8 @@ fold_sh86.h: l_lx_sh.o fold_sh86.o l_lx_sh86.lds
|
|||||||
$(BIN2H) $T.bin linux_i386sh_fold $@
|
$(BIN2H) $T.bin linux_i386sh_fold $@
|
||||||
|
|
||||||
fold_pti86.o: fold_pti86.asm
|
fold_pti86.o: fold_pti86.asm
|
||||||
$(NASM) -i$(UCL_I386)/ -f elf -o $@ $<
|
$(NASM) -f elf -i$(UCL_I386)/ -o $@ $<
|
||||||
|
$(OBJSTRIP_LINUX_I386) $@
|
||||||
|
|
||||||
fold_pti86.h: l_lx_pti.o fold_pti86.o l_lx_pti86.lds
|
fold_pti86.h: l_lx_pti.o fold_pti86.o l_lx_pti86.lds
|
||||||
$(LD_LINUX_I386) -T $(srcdir)/l_lx_pti86.lds -Map $T.map -o $T.bin $T.o l_lx_pti.o
|
$(LD_LINUX_I386) -T $(srcdir)/l_lx_pti86.lds -Map $T.map -o $T.bin $T.o l_lx_pti.o
|
||||||
@@ -523,27 +538,30 @@ fold_machppc32.o: fold_machppc32.S ppc_bxx.S $(MAKEFILE_DEPS)
|
|||||||
$(OBJSTRIP_PPC32) $@
|
$(OBJSTRIP_PPC32) $@
|
||||||
|
|
||||||
upxb: l_lx_sep.o l_lx_sep86.asm
|
upxb: l_lx_sep.o l_lx_sep86.asm
|
||||||
$(NASM) -i$(UCL_I386)/ -f elf -dNRV2B -o $T.o l_lx_sep86.asm
|
$(NASM) -f elf -i$(UCL_I386)/ -dNRV2B -o $T.o l_lx_sep86.asm
|
||||||
|
$(OBJSTRIP_LINUX_I386) $T.o
|
||||||
$(LD_LINUX_I386) -T $(srcdir)/l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o
|
$(LD_LINUX_I386) -T $(srcdir)/l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o
|
||||||
$(OBJSTRIP_LINUX_I386) $@
|
$(OBJSTRIP_LINUX_I386) $@
|
||||||
$(STRIPELF_LINUX_I386) $@
|
$(STRIPELF_LINUX_I386) $@
|
||||||
$(BRANDELF) $@
|
$(BRANDELF) $@
|
||||||
|
|
||||||
upxd: l_lx_sep.o l_lx_sep86.asm
|
upxd: l_lx_sep.o l_lx_sep86.asm
|
||||||
$(NASM) -i$(UCL_I386)/ -f elf -dNRV2D -o $T.o l_lx_sep86.asm
|
$(NASM) -f elf -i$(UCL_I386)/ -dNRV2D -o $T.o l_lx_sep86.asm
|
||||||
|
$(OBJSTRIP_LINUX_I386) $T.o
|
||||||
$(LD_LINUX_I386) -T $(srcdir)/l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o
|
$(LD_LINUX_I386) -T $(srcdir)/l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o
|
||||||
$(OBJSTRIP_LINUX_I386) $@
|
$(OBJSTRIP_LINUX_I386) $@
|
||||||
$(STRIPELF_LINUX_I386) $@
|
$(STRIPELF_LINUX_I386) $@
|
||||||
$(BRANDELF) $@
|
$(BRANDELF) $@
|
||||||
|
|
||||||
l_armpe.h: l_armpe.asx l_armpe_s.S l_armpe_c.c
|
l_armpea.h: l_armpea.S armv4_n2e_d8.S $(MAKEFILE_LIST)
|
||||||
$(GCC_WINCE) -c l_armpe_s.S l_armpe_c.c
|
$(GCC_ARM) $T.S -o $T.out -nostdlib
|
||||||
$(LD_WINCE) -nostdlib -o l_armpe_.out l_armpe_s.o l_armpe_c.o
|
$(OBJCOPY_ARM) --only-section .text -O binary $T.out $T.bin
|
||||||
$(OBJCOPY_WINCE) --only-section .text -O binary l_armpe_.out l_armpe_.bin
|
$(BIN2H) $T.bin nrv_loader_arm $@
|
||||||
$(BIN2H_WINCE) <l_armpe_.bin >l_armpe_.ah
|
|
||||||
$(NASM) -f bin -o $T.bin $<
|
|
||||||
$(BIN2H) $T.bin nrv_loader $@
|
|
||||||
|
|
||||||
|
l_armpet.h: l_armpet.S arm_nrv2e_d8.S arm_nrv2b_d8.S $(MAKEFILE_LIST)
|
||||||
|
$(GCC_ARM_T) $T.S -o $T.out -nostdlib
|
||||||
|
$(OBJCOPY_ARM) --only-section .text -O binary $T.out $T.bin
|
||||||
|
$(BIN2H) $T.bin nrv_loader_thumb $@
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // dependencies
|
# // dependencies
|
||||||
@@ -577,6 +595,7 @@ l_w32pe.h: $(DEPS2) $(DEPS3)
|
|||||||
|
|
||||||
l_lx_elf86.h: l_lx_elf86.asm macros.ash macros.asy $(DEPS3)
|
l_lx_elf86.h: l_lx_elf86.asm macros.ash macros.asy $(DEPS3)
|
||||||
l_lx_exec86.h: l_lx_exec86.asm macros.ash macros.asy $(DEPS3)
|
l_lx_exec86.h: l_lx_exec86.asm macros.ash macros.asy $(DEPS3)
|
||||||
|
l_lx_pti86.h: l_lx_pti86.asm macros.ash macros.asy $(DEPS3)
|
||||||
l_lx_sh86.h: l_lx_sh86.asm macros.ash macros.asy $(DEPS3)
|
l_lx_sh86.h: l_lx_sh86.asm macros.ash macros.asy $(DEPS3)
|
||||||
|
|
||||||
|
|
||||||
@@ -588,5 +607,4 @@ start-interp.o: start-interp.S
|
|||||||
interp.o: interp.c
|
interp.o: interp.c
|
||||||
gcc -c -g $<
|
gcc -c -g $<
|
||||||
|
|
||||||
|
|
||||||
# vi:nowrap
|
# vi:nowrap
|
||||||
|
|||||||
+18
-9
@@ -170,6 +170,8 @@ upx_bzero(char *p, size_t len)
|
|||||||
} while (--len);
|
} while (--len);
|
||||||
}
|
}
|
||||||
#define bzero upx_bzero
|
#define bzero upx_bzero
|
||||||
|
#else
|
||||||
|
#define bzero(a,b) __builtin_memset(a,0,b)
|
||||||
#endif /*}*/
|
#endif /*}*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -222,9 +224,9 @@ xfind_pages(unsigned mflags, Elf64_Phdr const *phdr, int phnum,
|
|||||||
lo -= ~PAGE_MASK & lo; // round down to page boundary
|
lo -= ~PAGE_MASK & lo; // round down to page boundary
|
||||||
hi = PAGE_MASK & (hi - lo - PAGE_MASK -1); // page length
|
hi = PAGE_MASK & (hi - lo - PAGE_MASK -1); // page length
|
||||||
szlo = PAGE_MASK & (szlo - PAGE_MASK -1); // page length
|
szlo = PAGE_MASK & (szlo - PAGE_MASK -1); // page length
|
||||||
addr = mmap((void *)lo, hi, PROT_READ|PROT_WRITE|PROT_EXEC, mflags, 0, 0);
|
addr = mmap((void *)lo, hi, PROT_NONE, mflags, -1, 0);
|
||||||
*p_brk = hi + addr; // the logical value of brk(0)
|
*p_brk = hi + addr; // the logical value of brk(0)
|
||||||
munmap(szlo + addr, hi - szlo); // desirable if PT_LOAD non-contiguous
|
//mprotect(szlo + addr, hi - szlo, PROT_NONE); // no access, but keep the frames!
|
||||||
return (unsigned long)addr - lo;
|
return (unsigned long)addr - lo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,18 +260,24 @@ do_xmap(
|
|||||||
mlen += frag;
|
mlen += frag;
|
||||||
addr -= frag;
|
addr -= frag;
|
||||||
|
|
||||||
if (addr != mmap(addr, mlen, PROT_READ | PROT_WRITE,
|
if (addr != mmap(addr, mlen, prot | (xi ? PROT_WRITE : 0),
|
||||||
MAP_FIXED | MAP_PRIVATE | (xi ? MAP_ANONYMOUS : 0),
|
MAP_FIXED | MAP_PRIVATE | (xi ? MAP_ANONYMOUS : 0),
|
||||||
fdi, phdr->p_offset - frag) ) {
|
(xi ? -1 : fdi), phdr->p_offset - frag) ) {
|
||||||
err_exit(8);
|
err_exit(8);
|
||||||
}
|
}
|
||||||
if (xi) {
|
if (xi) {
|
||||||
unpackExtent(xi, &xo, f_decompress, f_unf);
|
unpackExtent(xi, &xo, f_decompress, f_unf);
|
||||||
}
|
}
|
||||||
bzero(addr, frag); // fragment at lo end
|
// Linux does not fixup the low end, so neither do we.
|
||||||
|
//if (PROT_WRITE & prot) {
|
||||||
|
// bzero(addr, frag); // fragment at lo end
|
||||||
|
//}
|
||||||
frag = (-mlen) &~ PAGE_MASK; // distance to next page boundary
|
frag = (-mlen) &~ PAGE_MASK; // distance to next page boundary
|
||||||
|
if (PROT_WRITE & prot) { // note: read-only .bss not supported here
|
||||||
bzero(mlen+addr, frag); // fragment at hi end
|
bzero(mlen+addr, frag); // fragment at hi end
|
||||||
if (xi && 0==phdr->p_offset) {
|
}
|
||||||
|
if (xi) {
|
||||||
|
if (0==phdr->p_offset) {
|
||||||
Elf64_Ehdr *const ehdr = (Elf64_Ehdr *)addr;
|
Elf64_Ehdr *const ehdr = (Elf64_Ehdr *)addr;
|
||||||
*(int *)&ehdr->e_ident[12] = 0x90c3050f; // syscall; ret; nop
|
*(int *)&ehdr->e_ident[12] = 0x90c3050f; // syscall; ret; nop
|
||||||
}
|
}
|
||||||
@@ -277,10 +285,11 @@ do_xmap(
|
|||||||
err_exit(10);
|
err_exit(10);
|
||||||
ERR_LAB
|
ERR_LAB
|
||||||
}
|
}
|
||||||
|
}
|
||||||
addr += mlen + frag; /* page boundary on hi end */
|
addr += mlen + frag; /* page boundary on hi end */
|
||||||
if (addr < haddr) { // need pages for .bss
|
if (addr < haddr) { // need pages for .bss
|
||||||
if (addr != mmap(addr, haddr - addr, prot,
|
if (addr != mmap(addr, haddr - addr, prot,
|
||||||
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 ) ) {
|
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0 ) ) {
|
||||||
err_exit(9);
|
err_exit(9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,8 +326,8 @@ upx_main( // returns entry address
|
|||||||
Extent xo, xi1, xi2;
|
Extent xo, xi1, xi2;
|
||||||
xo.buf = (char *)ehdr;
|
xo.buf = (char *)ehdr;
|
||||||
xo.size = bi->sz_unc;
|
xo.size = bi->sz_unc;
|
||||||
xi2.buf = (char *)bi; xi2.size = sz_compressed;
|
xi2.buf = CONST_CAST(char *, bi); xi2.size = sz_compressed;
|
||||||
xi1.buf = (char *)bi; xi1.size = sz_compressed;
|
xi1.buf = CONST_CAST(char *, bi); xi1.size = sz_compressed;
|
||||||
|
|
||||||
// ehdr = Uncompress Ehdr and Phdrs
|
// ehdr = Uncompress Ehdr and Phdrs
|
||||||
unpackExtent(&xi2, &xo, f_decompress, 0); // never filtered?
|
unpackExtent(&xi2, &xo, f_decompress, 0); // never filtered?
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<jreiser@users.sourceforge.net>
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ALIGN(1<<3)
|
.p2align 3
|
||||||
lit_n2b:
|
lit_n2b:
|
||||||
incq %rsi; movb %dl,(%rdi)
|
incq %rsi; movb %dl,(%rdi)
|
||||||
incq %rdi
|
incq %rdi
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<jreiser@users.sourceforge.net>
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ALIGN(1<<3)
|
.p2align 3
|
||||||
lit_n2e:
|
lit_n2e:
|
||||||
incq %rsi; movb %dl,(%rdi)
|
incq %rsi; movb %dl,(%rdi)
|
||||||
incq %rdi
|
incq %rdi
|
||||||
|
|||||||
+7
-12
@@ -35,12 +35,12 @@
|
|||||||
#define tmp r3
|
#define tmp r3
|
||||||
#define bits r4
|
#define bits r4
|
||||||
#define off r5
|
#define off r5
|
||||||
#define g1b r6
|
/* r6 UNUSED */
|
||||||
#define wrnk r7 /* 0xd00 M2_MAX_OFFSET before "wrinkle" */
|
#define wrnk r7 /* 0xd00 M2_MAX_OFFSET before "wrinkle" */
|
||||||
|
|
||||||
/* r12 ("ip") is assumed to be a scratch register. */
|
/* r12 ("ip") is assumed to be a scratch register. */
|
||||||
|
|
||||||
#define GETBIT blx g1b
|
#define GETBIT add bits,bits; mov lr,pc; beq get1_n2b
|
||||||
|
|
||||||
#define getnextb(reg) GETBIT; adc reg,reg
|
#define getnextb(reg) GETBIT; adc reg,reg
|
||||||
#define jnextb0 GETBIT; bcc
|
#define jnextb0 GETBIT; bcc
|
||||||
@@ -53,15 +53,14 @@ ucl_nrv2b_decompress_8: .globl ucl_nrv2b_decompress_8 @ ARM mode
|
|||||||
bx r12 @ enter THUMB mode
|
bx r12 @ enter THUMB mode
|
||||||
|
|
||||||
.code 16 @ THUMB mode
|
.code 16 @ THUMB mode
|
||||||
go_thumb_n2b:
|
.thumb_func
|
||||||
|
go_thumb_n2b: .globl go_thumb_n2b
|
||||||
add r1,len,src @ r1= eof_src;
|
add r1,len,src @ r1= eof_src;
|
||||||
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
||||||
mov bits,#1; neg off,bits @ off= -1 initial condition
|
mov bits,#1; neg off,bits @ off= -1 initial condition
|
||||||
lsl bits,#31 @ 1<<31: refill next time
|
lsl bits,#31 @ 1<<31: refill next time
|
||||||
mov wrnk,#0xd
|
mov wrnk,#0xd
|
||||||
lsl wrnk,#8 @ 0xd00
|
lsl wrnk,#8 @ 0xd00
|
||||||
adr g1b,get1_n2b @ load pc-relative address
|
|
||||||
add g1b,#1 @ force THUMB mode
|
|
||||||
b top_n2b
|
b top_n2b
|
||||||
|
|
||||||
eof_n2b:
|
eof_n2b:
|
||||||
@@ -69,25 +68,21 @@ eof_n2b:
|
|||||||
sub src,r1 @ 0 if actual src length equals expected length
|
sub src,r1 @ 0 if actual src length equals expected length
|
||||||
sub dst,r3 @ actual dst length
|
sub dst,r3 @ actual dst length
|
||||||
str dst,[r4]
|
str dst,[r4]
|
||||||
pop {r4,r5,r6,r7, pc} @ return
|
pop {r4,r5,r6,r7 /*,pc*/}
|
||||||
|
pop {r1}; bx r1 @ "pop {,pc}" fails return to ARM mode on ARMv4T
|
||||||
|
|
||||||
|
|
||||||
.align 2 @ 1<<2 for benefit of loading address with 'adr' above
|
|
||||||
get1_n2b:
|
get1_n2b:
|
||||||
adc bits,bits; bne get1r_n2b @ CarryOut has data bit
|
|
||||||
ldrb bits,[src] @ zero-extend next byte
|
ldrb bits,[src] @ zero-extend next byte
|
||||||
adc bits,bits @ double and insert CarryIn as low bit
|
adc bits,bits @ double and insert CarryIn as low bit
|
||||||
add src,#1
|
add src,#1
|
||||||
lsl bits,#24 @ move to top byte, and set CarryOut from old bit 8
|
lsl bits,#24 @ move to top byte, and set CarryOut from old bit 8
|
||||||
get1r_n2b:
|
mov pc,lr
|
||||||
bx lr
|
|
||||||
|
|
||||||
lit_n2b:
|
lit_n2b:
|
||||||
ldrb tmp,[src]; add src,#1
|
ldrb tmp,[src]; add src,#1
|
||||||
strb tmp,[dst]; add dst,#1
|
strb tmp,[dst]; add dst,#1
|
||||||
top_n2b:
|
top_n2b:
|
||||||
jnextb1 lit_n2b
|
jnextb1 lit_n2b
|
||||||
|
|
||||||
mov len,#1 @ the msb
|
mov len,#1 @ the msb
|
||||||
getoff_n2b: @ ss11 len= [2..)
|
getoff_n2b: @ ss11 len= [2..)
|
||||||
getnextb(len)
|
getnextb(len)
|
||||||
|
|||||||
+69
-22
@@ -28,6 +28,7 @@
|
|||||||
John F. Reiser
|
John F. Reiser
|
||||||
<jreiser@users.sourceforge.net>
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
#define SAFE 0 /* 1 for src+dst bounds checking: cost 40 bytes */
|
||||||
|
|
||||||
#define src r0
|
#define src r0
|
||||||
#define len r1 /* overlaps 'cnt' */
|
#define len r1 /* overlaps 'cnt' */
|
||||||
@@ -35,12 +36,34 @@
|
|||||||
#define tmp r3
|
#define tmp r3
|
||||||
#define bits r4
|
#define bits r4
|
||||||
#define off r5
|
#define off r5
|
||||||
#define g1b r6
|
#define wrnk r6 /* 0x500 M2_MAX_OFFSET before "wrinkle" */
|
||||||
#define wrnk r7 /* 0x500 M2_MAX_OFFSET before "wrinkle" */
|
#define srclim r7
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
#define dstlim r12
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
#define cnt r1 /* overlaps 'len' while reading an offset */
|
#define cnt r1 /* overlaps 'len' while reading an offset */
|
||||||
|
|
||||||
#define GETBIT blx g1b
|
#if 1==SAFE /*{*/
|
||||||
|
#define CHECK_SRC cmp src,srclim; bhs bad_src_n2e
|
||||||
|
#define CHECK_DST cmp dst,dstlim; bhs bad_dst_n2e
|
||||||
|
#else /*}{*/
|
||||||
|
#define CHECK_SRC /*empty*/
|
||||||
|
#define CHECK_DST /*empty*/
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
|
#if 0 /*{ DEBUG only: check newly-decompressed against original dst */
|
||||||
|
#define CHECK_BYTE \
|
||||||
|
push {wrnk}; \
|
||||||
|
ldrb wrnk,[dst]; \
|
||||||
|
cmp wrnk,tmp; beq 0f; bkpt; \
|
||||||
|
0: pop {wrnk}
|
||||||
|
#else /*}{*/
|
||||||
|
#define CHECK_BYTE /*empty*/
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
|
/* "mov lr,pc; bxx ..." implements conditional subroutine call */
|
||||||
|
#define GETBIT add bits,bits; mov lr,pc; beq get1_n2e
|
||||||
|
|
||||||
#define getnextb(reg) GETBIT; adc reg,reg
|
#define getnextb(reg) GETBIT; adc reg,reg
|
||||||
#define jnextb0 GETBIT; bcc
|
#define jnextb0 GETBIT; bcc
|
||||||
@@ -48,39 +71,55 @@
|
|||||||
|
|
||||||
ucl_nrv2e_decompress_8: .globl ucl_nrv2e_decompress_8 @ ARM mode
|
ucl_nrv2e_decompress_8: .globl ucl_nrv2e_decompress_8 @ ARM mode
|
||||||
.type ucl_nrv2e_decompress_8, %function
|
.type ucl_nrv2e_decompress_8, %function
|
||||||
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst) */
|
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst)
|
||||||
|
Actual decompressed length is stored through plen_dst.
|
||||||
|
For SAFE mode: at call, *plen_dst must be allowed length of output buffer.
|
||||||
|
*/
|
||||||
adr r12,1+thumb_nrv2e_d8; bx r12 @ enter THUMB mode
|
adr r12,1+thumb_nrv2e_d8; bx r12 @ enter THUMB mode
|
||||||
.code 16 @ THUMB mode
|
.code 16 @ THUMB mode
|
||||||
|
.globl thumb_nrv2e_d8
|
||||||
|
.thumb_func
|
||||||
thumb_nrv2e_d8:
|
thumb_nrv2e_d8:
|
||||||
add r1,len,src @ r1= eof_src;
|
push {r2,r3, r4,r5,r6,r7, lr}
|
||||||
push {r1,r2,r3, r4,r5,r6,r7, lr}
|
#define sp_DST0 0 /* stack offset of original dst */
|
||||||
|
add srclim,len,src @ srclim= eof_src;
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
ldr tmp,[r3] @ len_dst
|
||||||
|
add tmp,dst
|
||||||
|
mov dstlim,tmp
|
||||||
|
#endif /*}*/
|
||||||
mov bits,#1; neg off,bits @ off= -1 initial condition
|
mov bits,#1; neg off,bits @ off= -1 initial condition
|
||||||
lsl bits,#31 @ 1<<31; refill next time
|
lsl bits,#31 @ 1<<31; refill next time
|
||||||
mov wrnk,#5
|
mov wrnk,#5
|
||||||
lsl wrnk,#8 @ 0x500
|
lsl wrnk,#8 @ 0x500 @ nrv2e M2_MAX_OFFSET
|
||||||
adr g1b,get1_n2e @ load pc-relative address
|
|
||||||
add g1b,#1 @ force THUMB mode
|
|
||||||
b top_n2e
|
b top_n2e
|
||||||
|
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
bad_dst_n2e: # return value will be 2
|
||||||
|
add src,srclim,#1
|
||||||
|
bad_src_n2e: # return value will be 1
|
||||||
|
add src,#1
|
||||||
|
#endif /*}*/
|
||||||
eof_n2e:
|
eof_n2e:
|
||||||
pop {r1,r3,r4} @ r1= eof_src; r3= orig_dst; r4= plen_dst
|
pop {r3,r4} @ r3= orig_dst; r4= plen_dst
|
||||||
sub src,r1 @ 0 if actual src length equals expected length
|
sub src,srclim @ 0 if actual src length equals expected length
|
||||||
sub dst,r3 @ actual dst length
|
sub dst,r3 @ actual dst length
|
||||||
str dst,[r4]
|
str dst,[r4]
|
||||||
pop {r4,r5,r6,r7, pc} @ return
|
pop {r4,r5,r6,r7 /*,pc*/}
|
||||||
|
pop {r1}; bx r1 @ "pop {,pc}" fails return to ARM mode on ARMv4T
|
||||||
|
|
||||||
.align 2 @ 1<<2 for benefit of loading address with 'adr' above
|
get1_n2e: @ In: Carry set [from adding 0x80000000 (1<<31) to itself]
|
||||||
get1_n2e:
|
|
||||||
adc bits,bits; bne get1r_n2e @ CarryOut has data bit
|
|
||||||
ldrb bits,[src] @ zero-extend next byte
|
ldrb bits,[src] @ zero-extend next byte
|
||||||
adc bits,bits @ double and insert CarryIn as low bit
|
adc bits,bits @ double and insert CarryIn as low bit
|
||||||
|
CHECK_SRC
|
||||||
add src,#1
|
add src,#1
|
||||||
lsl bits,#24 @ move to top byte, and set CarryOut from old bit 8
|
lsl bits,#24 @ move to top byte, and set CarryOut from old bit 8
|
||||||
get1r_n2e:
|
mov pc,lr @ return, stay in current (THUMB) mode
|
||||||
bx lr
|
|
||||||
|
|
||||||
lit_n2e:
|
lit_n2e:
|
||||||
ldrb tmp,[src]; add src,#1
|
CHECK_SRC; ldrb tmp,[src]; add src,#1
|
||||||
strb tmp,[dst]; add dst,#1
|
CHECK_BYTE
|
||||||
|
CHECK_DST; strb tmp,[dst]; add dst,#1
|
||||||
top_n2e:
|
top_n2e:
|
||||||
jnextb1 lit_n2e
|
jnextb1 lit_n2e
|
||||||
mov cnt,#1; b getoff_n2e
|
mov cnt,#1; b getoff_n2e
|
||||||
@@ -96,7 +135,7 @@ getoff_n2e:
|
|||||||
mov len,#0 @ Carry unaffected
|
mov len,#0 @ Carry unaffected
|
||||||
blo offprev_n2e @ cnt was 2; tests Carry only
|
blo offprev_n2e @ cnt was 2; tests Carry only
|
||||||
lsl tmp,#8
|
lsl tmp,#8
|
||||||
ldrb off,[src]; add src,#1 @ low 7+1 bits
|
CHECK_SRC; ldrb off,[src]; add src,#1 @ low 7+1 bits
|
||||||
orr off,tmp
|
orr off,tmp
|
||||||
mvn off,off; beq eof_n2e @ off= ~off
|
mvn off,off; beq eof_n2e @ off= ~off
|
||||||
asr off,#1; bcs lenlast_n2e
|
asr off,#1; bcs lenlast_n2e
|
||||||
@@ -117,16 +156,24 @@ lenlast_n2e:
|
|||||||
getnextb(len) @ 0,1,2,3
|
getnextb(len) @ 0,1,2,3
|
||||||
add len,#2
|
add len,#2
|
||||||
gotlen_n2e: @ 'cmn': add the inputs, set condition codes, discard the sum
|
gotlen_n2e: @ 'cmn': add the inputs, set condition codes, discard the sum
|
||||||
cmn off,wrnk; bcs near_n2e @ within M2_MAX_OFFSET
|
cmn wrnk,off; bcs near_n2e @ within M2_MAX_OFFSET
|
||||||
add len,#1 @ too far away, so minimum match length is 3
|
add len,#1 @ too far away, so minimum match length is 3
|
||||||
near_n2e:
|
near_n2e:
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
ldr tmp,[sp,#sp_DST0]
|
||||||
|
sub tmp,dst
|
||||||
|
sub tmp,off; bhi bad_dst_n2e @ reaching back too far
|
||||||
|
|
||||||
|
add tmp,dst,cnt
|
||||||
|
cmp tmp,dstlim; bhi bad_dst_n2e @ too much output
|
||||||
|
#endif /*}*/
|
||||||
ldrb tmp,[dst] @ force cacheline allocate
|
ldrb tmp,[dst] @ force cacheline allocate
|
||||||
copy_n2e:
|
copy_n2e:
|
||||||
ldrb tmp,[dst,off]
|
ldrb tmp,[dst,off]
|
||||||
|
CHECK_BYTE
|
||||||
strb tmp,[dst]; add dst,#1
|
strb tmp,[dst]; add dst,#1
|
||||||
sub len,#1; bne copy_n2e
|
sub len,#1; bne copy_n2e
|
||||||
b top_n2e
|
b top_n2e
|
||||||
|
|
||||||
.size ucl_nrv2e_decompress_8, .-ucl_nrv2e_decompress_8
|
.size ucl_nrv2e_decompress_8, .-ucl_nrv2e_decompress_8
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -0,0 +1,181 @@
|
|||||||
|
/* armv4_n2e_d8.S -- ARM decompressor for NRV2E
|
||||||
|
|
||||||
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
|
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996-2004 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2006 John F. Reiser
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
and/or modify them under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of
|
||||||
|
the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
#define SAFE 0 /* 1 for src+dst bounds checking: cost 76 bytes */
|
||||||
|
|
||||||
|
#define src r0
|
||||||
|
#define len r1 /* overlaps 'cnt' */
|
||||||
|
#define dst r2
|
||||||
|
#define tmp r3
|
||||||
|
#define bits r4
|
||||||
|
#define off r5
|
||||||
|
/* r6 UNUSED in ARM code unless DEBUG mode */
|
||||||
|
#define srclim r7
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
#define dstlim r12
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
|
#define cnt r1 /* overlaps 'len' while reading an offset */
|
||||||
|
|
||||||
|
/* macros reduce "noise" when comparing this ARM code to corresponding THUMB code */
|
||||||
|
#define PUSH stmdb sp!,
|
||||||
|
#define POP ldmia sp!,
|
||||||
|
#define ADD2( dst,src) add dst,dst,src
|
||||||
|
#define ADD2S(dst,src) adds dst,dst,src
|
||||||
|
#define ADC2( dst,src) adc dst,dst,src
|
||||||
|
#define ADC2S(dst,src) adcs dst,dst,src
|
||||||
|
#define SUB2( dst,src) sub dst,dst,src
|
||||||
|
#define SUB2S(dst,src) subs dst,dst,src
|
||||||
|
#define LDRB3(reg,psrc,incr) ldrb reg,psrc,incr
|
||||||
|
#define STRB3(reg,pdst,incr) strb reg,pdst,incr
|
||||||
|
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
#define CHECK_SRC cmp srclim,src; bls bad_src_n2e /* Out: 1==Carry for get8_n2e */
|
||||||
|
#define CHECK_DST cmp dst,dstlim; bhs bad_dst_n2e
|
||||||
|
#else /*}{*/
|
||||||
|
#define CHECK_SRC /*empty*/
|
||||||
|
#define CHECK_DST /*empty*/
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
|
#if 0 /*{ DEBUG only: check newly-decompressed against original dst */
|
||||||
|
#define CHECK_BYTE \
|
||||||
|
ldrb r6,[dst]; \
|
||||||
|
cmp r6,tmp; beq 0f; bkpt; 0:
|
||||||
|
#else /*}{*/
|
||||||
|
#define CHECK_BYTE /*empty*/
|
||||||
|
#endif /*}*/
|
||||||
|
|
||||||
|
#define GETBIT ADD2S(bits,bits); bleq get8_n2e
|
||||||
|
|
||||||
|
#define getnextb(reg) GETBIT; ADC2(reg,reg) /* Out: condition code not changed */
|
||||||
|
#define jnextb0 GETBIT; bcc
|
||||||
|
#define jnextb1 GETBIT; bcs
|
||||||
|
|
||||||
|
ucl_nrv2e_decompress_8: .globl ucl_nrv2e_decompress_8 @ ARM mode
|
||||||
|
.type ucl_nrv2e_decompress_8, %function
|
||||||
|
/* error = (*)(char const *src, int len_src, char *dst, int *plen_dst)
|
||||||
|
Actual decompressed length is stored through plen_dst.
|
||||||
|
For SAFE mode: at call, *plen_dst must be allowed length of output buffer.
|
||||||
|
*/
|
||||||
|
PUSH {r2,r3, r4,r5,r6,r7, lr}
|
||||||
|
#define sp_DST0 0 /* stack offset of original dst */
|
||||||
|
add srclim,len,src @ srclim= eof_src;
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
ldr tmp,[r3] @ len_dst
|
||||||
|
add dstlim,tmp,dst
|
||||||
|
#endif /*}*/
|
||||||
|
mvn off,#~-1 @ off= -1 initial condition
|
||||||
|
mov bits,#1<<31 @ refill next time
|
||||||
|
b top_n2e
|
||||||
|
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
bad_dst_n2e: # return value will be 2
|
||||||
|
bkpt
|
||||||
|
add src,srclim,#1
|
||||||
|
bad_src_n2e: # return value will be 1
|
||||||
|
ADD2(src,#1)
|
||||||
|
#endif /*}*/
|
||||||
|
eof_n2e:
|
||||||
|
POP {r3,r4} @ r3= orig_dst; r4= plen_dst
|
||||||
|
SUB2(src,srclim) @ 0 if actual src length equals expected length
|
||||||
|
SUB2(dst,r3) @ actual dst length
|
||||||
|
str dst,[r4]
|
||||||
|
POP {r4,r5,r6,r7 ,pc}
|
||||||
|
|
||||||
|
get8_n2e: @ In: Carry set [from adding 0x80000000 (1<<31) to itself]
|
||||||
|
CHECK_SRC; LDRB3(bits,[src],#1) @ zero-extend next byte
|
||||||
|
adc bits,bits,bits @ double and insert CarryIn as low bit
|
||||||
|
movs bits,bits,lsl #24 @ move to top byte, and set CarryOut from old bit 8
|
||||||
|
mov pc,lr
|
||||||
|
|
||||||
|
lit_n2e:
|
||||||
|
CHECK_SRC; LDRB3(tmp,[src],#1)
|
||||||
|
CHECK_BYTE
|
||||||
|
CHECK_DST; STRB3(tmp,[dst],#1)
|
||||||
|
top_n2e:
|
||||||
|
jnextb1 lit_n2e
|
||||||
|
mov cnt,#1; b getoff_n2e
|
||||||
|
|
||||||
|
off_n2e:
|
||||||
|
SUB2(cnt,#1)
|
||||||
|
getnextb(cnt)
|
||||||
|
getoff_n2e:
|
||||||
|
getnextb(cnt)
|
||||||
|
jnextb0 off_n2e
|
||||||
|
|
||||||
|
subs tmp,cnt,#3 @ set Carry
|
||||||
|
mov len,#0 @ Carry unaffected
|
||||||
|
blo offprev_n2e @ cnt was 2; tests Carry only
|
||||||
|
CHECK_SRC; LDRB3(off,[src],#1) @ low 7+1 bits
|
||||||
|
orr off,off,tmp,lsl #8
|
||||||
|
mvns off,off; beq eof_n2e @ off= ~off
|
||||||
|
movs off,off,asr #1; bcs lenlast_n2e
|
||||||
|
b lenmore_n2e
|
||||||
|
|
||||||
|
offprev_n2e:
|
||||||
|
jnextb1 lenlast_n2e
|
||||||
|
lenmore_n2e:
|
||||||
|
mov len,#1
|
||||||
|
jnextb1 lenlast_n2e
|
||||||
|
len_n2e:
|
||||||
|
getnextb(len)
|
||||||
|
jnextb0 len_n2e
|
||||||
|
ADD2(len,#6-2)
|
||||||
|
b gotlen_n2e
|
||||||
|
|
||||||
|
lenlast_n2e:
|
||||||
|
getnextb(len) @ 0,1,2,3
|
||||||
|
ADD2(len,#2)
|
||||||
|
gotlen_n2e: @ 'cmn': add the inputs, set condition codes, discard the sum
|
||||||
|
cmn off,#5<<8; bcs near_n2e @ within M2_MAX_OFFSET
|
||||||
|
ADD2(len,#1) @ too far away, so minimum match length is 3
|
||||||
|
near_n2e:
|
||||||
|
#if 1==SAFE /*{*/
|
||||||
|
ldr tmp,[sp,#sp_DST0]
|
||||||
|
SUB2( tmp,dst)
|
||||||
|
SUB2S(tmp,off); bhi bad_dst_n2e @ reaching back too far
|
||||||
|
|
||||||
|
add tmp,dst,cnt
|
||||||
|
cmp tmp,dstlim; bhi bad_dst_n2e @ too much output
|
||||||
|
#endif /*}*/
|
||||||
|
ldrb tmp,[dst] @ force cacheline allocate
|
||||||
|
copy_n2e:
|
||||||
|
ldrb tmp,[dst,off]
|
||||||
|
CHECK_BYTE
|
||||||
|
STRB3(tmp,[dst],#1)
|
||||||
|
SUB2S(len,#1); bne copy_n2e
|
||||||
|
b top_n2e
|
||||||
|
|
||||||
|
.size ucl_nrv2e_decompress_8, .-ucl_nrv2e_decompress_8
|
||||||
|
|
||||||
|
/*
|
||||||
|
vi:ts=8:et:nowrap
|
||||||
|
*/
|
||||||
|
|
||||||
+68
-85
@@ -1,4 +1,4 @@
|
|||||||
/* fold_elf64amd.h -- created from fold_elf64amd.bin, 1964 (0x7ac) bytes
|
/* fold_elf64amd.h -- created from fold_elf64amd.bin, 1696 (0x6a0) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,22 +27,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define LINUX_ELF64AMD_FOLD_SIZE 1964
|
#define LINUX_ELF64AMD_FOLD_SIZE 1696
|
||||||
#define LINUX_ELF64AMD_FOLD_ADLER32 0xbcebb18a
|
#define LINUX_ELF64AMD_FOLD_ADLER32 0x8e868b92
|
||||||
#define LINUX_ELF64AMD_FOLD_CRC32 0x2dba754c
|
#define LINUX_ELF64AMD_FOLD_CRC32 0xfc2cafa4
|
||||||
|
|
||||||
unsigned char linux_elf64amd_fold[1964] = {
|
unsigned char linux_elf64amd_fold[1696] = {
|
||||||
127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||||
2, 0, 62, 0, 1, 0, 0, 0,188, 0, 16, 0, 0, 0, 0, 0, /* 0x 10 */
|
2, 0, 62, 0, 1, 0, 0, 0,188, 0, 16, 0, 0, 0, 0, 0, /* 0x 10 */
|
||||||
64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 20 */
|
64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 20 */
|
||||||
0, 0, 0, 0, 64, 0, 56, 0, 2, 0, 0, 0, 0, 0, 0, 0, /* 0x 30 */
|
0, 0, 0, 0, 64, 0, 56, 0, 2, 0, 0, 0, 0, 0, 0, 0, /* 0x 30 */
|
||||||
1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 40 */
|
1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 40 */
|
||||||
0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, /* 0x 50 */
|
0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||||
172, 6, 0, 0, 0, 0, 0, 0,172, 6, 0, 0, 0, 0, 0, 0, /* 0x 60 */
|
160, 6, 0, 0, 0, 0, 0, 0,160, 6, 0, 0, 0, 0, 0, 0, /* 0x 60 */
|
||||||
0, 0, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, /* 0x 70 */
|
0, 0, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, /* 0x 70 */
|
||||||
172, 6, 0, 0, 0, 0, 0, 0,172, 6, 16, 0, 0, 0, 0, 0, /* 0x 80 */
|
160, 6, 0, 0, 0, 0, 0, 0,160, 6, 16, 0, 0, 0, 0, 0, /* 0x 80 */
|
||||||
172, 6, 16, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, /* 0x 90 */
|
160, 6, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 90 */
|
||||||
4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, /* 0x a0 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, /* 0x a0 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 80, 0, 0, /* 0x b0 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 80, 0, 0, /* 0x b0 */
|
||||||
0,131,249, 73,117, 74, 72,137,241, 72,137,254,235, 44,138, 7, /* 0x c0 */
|
0,131,249, 73,117, 74, 72,137,241, 72,137,254,235, 44,138, 7, /* 0x c0 */
|
||||||
72,131,199, 1, 60,128,114, 10, 60,143,119, 6,128,127,254, 15, /* 0x d0 */
|
72,131,199, 1, 60,128,114, 10, 60,143,119, 6,128,127,254, 15, /* 0x d0 */
|
||||||
@@ -51,7 +51,7 @@ unsigned char linux_elf64amd_fold[1964] = {
|
|||||||
72,131,199, 1, 72,255,201,117,217,235, 5, 72,255,201,117,190, /* 0x 100 */
|
72,131,199, 1, 72,255,201,117,217,235, 5, 72,255,201,117,190, /* 0x 100 */
|
||||||
195, 72,141,116, 36, 56, 72,173, 72,133,192,117,249, 72,173, 72, /* 0x 110 */
|
195, 72,141,116, 36, 56, 72,173, 72,133,192,117,249, 72,173, 72, /* 0x 110 */
|
||||||
133,192,117,249, 65, 89, 72,137,241, 94, 95, 72,129,236, 0, 8, /* 0x 120 */
|
133,192,117,249, 65, 89, 72,137,241, 94, 95, 72,129,236, 0, 8, /* 0x 120 */
|
||||||
0, 0, 72,137,226, 73,137,232,232, 77, 4, 0, 0, 72,129,196, /* 0x 130 */
|
0, 0, 72,137,226, 73,137,232,232, 65, 4, 0, 0, 72,129,196, /* 0x 130 */
|
||||||
0, 8, 0, 0, 94, 95, 89, 80,106, 11, 88,255,225,176, 11,235, /* 0x 140 */
|
0, 8, 0, 0, 94, 95, 89, 80,106, 11, 88,255,225,176, 11,235, /* 0x 140 */
|
||||||
13,176, 10,235, 9,176, 12,235, 5,176, 9, 73,137,202, 15,182, /* 0x 150 */
|
13,176, 10,235, 9,176, 12,235, 5,176, 9, 73,137,202, 15,182, /* 0x 150 */
|
||||||
192, 15, 5, 72, 61, 0,240,255,255,114, 4, 72,131,200,255,195, /* 0x 160 */
|
192, 15, 5, 72, 61, 0,240,255,255,114, 4, 72,131,200,255,195, /* 0x 160 */
|
||||||
@@ -80,79 +80,62 @@ unsigned char linux_elf64amd_fold[1964] = {
|
|||||||
57,200,116, 17, 72,255,200, 15,148,194, 49,192,133,246, 15,149, /* 0x 2d0 */
|
57,200,116, 17, 72,255,200, 15,148,194, 49,192,133,246, 15,149, /* 0x 2d0 */
|
||||||
192,133,194,116, 8, 72,137, 15, 76,137, 71, 8,195, 72,131,199, /* 0x 2e0 */
|
192,133,194,116, 8, 72,137, 15, 76,137, 71, 8,195, 72,131,199, /* 0x 2e0 */
|
||||||
16,235,215,195, 65, 87,184, 0, 0, 0, 0, 73,137,255, 65, 86, /* 0x 2f0 */
|
16,235,215,195, 65, 87,184, 0, 0, 0, 0, 73,137,255, 65, 86, /* 0x 2f0 */
|
||||||
73,137,254, 65, 85, 65, 84, 85, 83, 72,131,236, 88, 76, 3,119, /* 0x 300 */
|
65, 85, 65, 84, 73,137,252, 85, 83, 72,131,236,104, 76, 3,103, /* 0x 300 */
|
||||||
32,102,131,127, 16, 3, 72,137,116, 36, 48, 15,183,119, 56, 72, /* 0x 310 */
|
32,102,131,127, 16, 3,137, 84, 36, 60, 15,183, 87, 56, 72,137, /* 0x 310 */
|
||||||
137, 76, 36, 32,185, 16, 0, 0, 0,137, 84, 36, 44, 76,137, 68, /* 0x 320 */
|
76, 36, 48,185, 16, 0, 0, 0, 72,137,116, 36, 64, 76,137, 68, /* 0x 320 */
|
||||||
36, 24, 76,137, 76, 36, 16, 15, 68,200, 76,137,242, 73,131,205, /* 0x 330 */
|
36, 40, 76,137, 76, 36, 32, 15, 68,200, 76,137,230, 72,131,205, /* 0x 330 */
|
||||||
255, 49,237, 69, 49,228,131,193, 34,255,206,120, 38,131, 58, 1, /* 0x 340 */
|
255, 49,219,131,193, 34,255,202,120, 33,131, 62, 1,117, 22, 72, /* 0x 340 */
|
||||||
117, 27, 72,139, 66, 16, 76, 57,232,115, 7, 76,139, 98, 32, 73, /* 0x 350 */
|
139, 70, 16, 72, 57,232, 72, 15, 66,232, 72, 3, 70, 40, 72, 57, /* 0x 350 */
|
||||||
137,197, 72, 3, 66, 40, 72, 57,197, 72, 15, 66,232, 72,131,194, /* 0x 360 */
|
195, 72, 15, 66,216, 72,131,198, 56,235,219, 72,129,229, 0,240, /* 0x 360 */
|
||||||
56,235,214, 76,137,232, 73,129,229, 0,240,255,255, 69, 49,201, /* 0x 370 */
|
255,255, 49,210, 69, 49,201, 72, 41,235, 65,131,200,255, 72,137, /* 0x 370 */
|
||||||
76, 41,237, 37,255, 15, 0, 0, 69, 49,192, 72,129,197,255, 15, /* 0x 380 */
|
239, 72,129,195,255, 15, 0, 0, 72,129,227, 0,240,255,255, 72, /* 0x 380 */
|
||||||
0, 0, 77,141,164, 4,255, 15, 0, 0,186, 7, 0, 0, 0, 72, /* 0x 390 */
|
137,222,232,194,253,255,255, 72,141, 20, 24, 72, 41,232,102, 65, /* 0x 390 */
|
||||||
129,229, 0,240,255,255, 76,137,239, 72,137,238, 73,129,228, 0, /* 0x 3a0 */
|
131,127, 56, 0, 72,137, 68, 36, 24,199, 68, 36, 20, 0, 0, 0, /* 0x 3a0 */
|
||||||
240,255,255,232,161,253,255,255, 72,137,195, 72,141, 4, 40, 76, /* 0x 3b0 */
|
0, 72,137, 84, 36, 72, 15,132,139, 1, 0, 0, 72,131,124, 36, /* 0x 3b0 */
|
||||||
41,229, 74,141, 60, 35, 72,137,238, 76, 41,235, 72,137, 68, 36, /* 0x 3c0 */
|
64, 0,116, 37, 65,131, 60, 36, 6,117, 30, 72,139, 84, 36, 24, /* 0x 3c0 */
|
||||||
56,232,119,253,255,255,102, 65,131,127, 56, 0, 72,137, 92, 36, /* 0x 3d0 */
|
73, 3, 84, 36, 16,190, 3, 0, 0, 0, 72,139,124, 36, 48,232, /* 0x 3d0 */
|
||||||
8,199, 68, 36, 4, 0, 0, 0, 0, 15,132,100, 1, 0, 0, 72, /* 0x 3e0 */
|
222,254,255,255,233, 71, 1, 0, 0, 65,131, 60, 36, 1, 15,133, /* 0x 3e0 */
|
||||||
131,124, 36, 48, 0,116, 35, 65,131, 62, 6,117, 29, 72,139, 84, /* 0x 3f0 */
|
60, 1, 0, 0, 72,139, 68, 36, 24, 73, 3, 68, 36, 16, 65,190, /* 0x 3f0 */
|
||||||
36, 8, 73, 3, 86, 16,190, 3, 0, 0, 0, 72,139,124, 36, 32, /* 0x 400 */
|
64, 98, 81,115, 65,139, 76, 36, 4, 65,131,200,255, 73,139, 84, /* 0x 400 */
|
||||||
232,173,254,255,255,233, 34, 1, 0, 0, 65,131, 62, 1, 15,133, /* 0x 410 */
|
36, 32, 72,137,197, 72,137, 68, 36, 88, 73,139, 68, 36, 40,131, /* 0x 410 */
|
||||||
24, 1, 0, 0, 72,139,124, 36, 8, 73, 3,126, 16,186, 3, 0, /* 0x 420 */
|
225, 7, 72,137,235, 72,137, 84, 36, 80,193,225, 2,129,227,255, /* 0x 420 */
|
||||||
0, 0, 65,139, 78, 4,199, 4, 36, 64, 98, 81,115, 73,139, 70, /* 0x 430 */
|
15, 0, 0, 72, 1,232, 65,211,238, 72, 41,221, 72,137, 68, 36, /* 0x 430 */
|
||||||
32, 77,139, 78, 8, 68,139, 68, 36, 44,131,225, 7, 72,137,253, /* 0x 440 */
|
8, 73,139, 68, 36, 8, 65,131,230, 7, 76,141, 44, 26,185, 50, /* 0x 440 */
|
||||||
72,137,251,129,229,255, 15, 0, 0,193,225, 2,211, 44, 36, 72, /* 0x 450 */
|
0, 0, 0, 72, 41,216, 72,131,124, 36, 64, 0,117, 7, 68,139, /* 0x 450 */
|
||||||
41,235,131, 36, 36, 7, 73,137,253, 77, 3,110, 40, 72,131,124, /* 0x 460 */
|
68, 36, 60,177, 18, 68,137,242, 73,137,193, 76,137,238,131,202, /* 0x 460 */
|
||||||
36, 48, 1, 76,141, 36, 40, 72,137,124, 36, 72, 72,137,223, 76, /* 0x 470 */
|
2, 72,131,124, 36, 64, 0, 72,137,239, 65, 15, 68,214,232,214, /* 0x 470 */
|
||||||
137,230, 72,137, 68, 36, 64, 25,201, 73, 41,233,131,225,224,131, /* 0x 480 */
|
252,255,255, 72, 57,197,117,105, 72,131,124, 36, 64, 0,116, 25, /* 0x 480 */
|
||||||
193, 50,232,194,252,255,255, 72, 57,195,117,105, 72,131,124, 36, /* 0x 490 */
|
72,139, 76, 36, 32, 72,139, 84, 36, 40, 72,141,116, 36, 80, 72, /* 0x 490 */
|
||||||
48, 0,116, 25, 72,139, 76, 36, 16, 72,139, 84, 36, 24, 72,141, /* 0x 4a0 */
|
139,124, 36, 64,232, 15,253,255,255, 76,137,235, 72,247,219,129, /* 0x 4a0 */
|
||||||
116, 36, 64, 72,139,124, 36, 48,232,251,252,255,255, 72,137,233, /* 0x 4b0 */
|
227,255, 15, 0, 0, 65,246,198, 2,116, 13, 74,141,124, 45, 0, /* 0x 4b0 */
|
||||||
76,137,229, 49,192, 72,247,221, 72,137,223,252,129,229,255, 15, /* 0x 4c0 */
|
49,192, 72,137,217,252,243,170, 72,131,124, 36, 64, 0,116, 43, /* 0x 4c0 */
|
||||||
0, 0, 72,131,124, 36, 48, 0,243,170, 74,141, 60, 35, 72,137, /* 0x 4d0 */
|
73,131,124, 36, 8, 0,117, 7,199, 69, 12, 15, 5,195,144, 68, /* 0x 4d0 */
|
||||||
233,243,170,116, 14, 73,131,126, 8, 0,117, 7,199, 67, 12, 15, /* 0x 4e0 */
|
137,242, 76,137,238, 72,137,239,232,100,252,255,255,133,192,116, /* 0x 4e0 */
|
||||||
5,195,144,139, 20, 36, 76,137,230, 72,137,223,232, 80,252,255, /* 0x 4f0 */
|
10,191,127, 0, 0, 0,232,129,252,255,255, 73,141, 68, 29, 0, /* 0x 4f0 */
|
||||||
255,133,192,116, 10,191,127, 0, 0, 0,232,109,252,255,255, 73, /* 0x 500 */
|
72, 1,197, 72, 59,108, 36, 8,115, 38, 72, 41,108, 36, 8, 69, /* 0x 500 */
|
||||||
141, 4, 44, 72, 1,195, 76, 57,235,115, 33,139, 20, 36, 73, 41, /* 0x 510 */
|
49,201, 65,131,200,255, 72,139,116, 36, 8,185, 50, 0, 0, 0, /* 0x 510 */
|
||||||
221, 69, 49,201, 69, 49,192,185, 50, 0, 0, 0, 76,137,238, 72, /* 0x 520 */
|
68,137,242, 72,137,239,232, 46,252,255,255, 72, 57,197,117,193, /* 0x 520 */
|
||||||
137,223,232, 34,252,255,255, 72, 57,195,117,201,255, 68, 36, 4, /* 0x 530 */
|
255, 68, 36, 20, 65, 15,183, 71, 56, 73,131,196, 56, 57, 68, 36, /* 0x 530 */
|
||||||
65, 15,183, 71, 56, 73,131,198, 56, 57, 68, 36, 4, 15,140,156, /* 0x 540 */
|
20, 15,140,117,254,255,255, 72,131,124, 36, 64, 0,116, 18,102, /* 0x 540 */
|
||||||
254,255,255, 72,131,124, 36, 48, 0,116, 18,102, 65,131,127, 16, /* 0x 550 */
|
65,131,127, 16, 3,116, 10, 72,139,124, 36, 72,232,244,251,255, /* 0x 550 */
|
||||||
3,116, 10, 72,139,124, 36, 56,232,232,251,255,255, 73,139, 71, /* 0x 560 */
|
255, 73,139, 71, 24, 72, 1, 68, 36, 24, 72,139, 68, 36, 24, 72, /* 0x 560 */
|
||||||
24, 72, 1, 68, 36, 8, 72,139, 68, 36, 8, 72,131,196, 88, 91, /* 0x 570 */
|
131,196,104, 91, 93, 65, 92, 65, 93, 65, 94, 65, 95,195, 65, 86, /* 0x 570 */
|
||||||
93, 65, 92, 65, 93, 65, 94, 65, 95,195, 65, 86, 76,141,114, 64, /* 0x 580 */
|
76,141,114, 64, 65, 85, 77,137,205, 65, 84, 77,137,196, 85, 72, /* 0x 580 */
|
||||||
65, 85, 77,137,205, 65, 84, 77,137,196, 85, 72,137,213, 83, 72, /* 0x 590 */
|
137,213, 83, 72,137,203, 49,201, 72,131,236, 48,139, 7, 72,137, /* 0x 590 */
|
||||||
137,203, 49,201, 72,131,236, 48,139, 7, 72,137, 52, 36, 72,137, /* 0x 5a0 */
|
52, 36, 72,137,116, 36, 16, 72,141,116, 36, 32, 72,137, 84, 36, /* 0x 5a0 */
|
||||||
116, 36, 16, 72,141,116, 36, 32, 72,137, 84, 36, 40, 72,137,124, /* 0x 5b0 */
|
40, 72,137,124, 36, 8, 76,137,194, 72,137,124, 36, 24, 72,137, /* 0x 5b0 */
|
||||||
36, 8, 76,137,194, 72,137,124, 36, 24, 72,137,231, 72,137, 68, /* 0x 5c0 */
|
231, 72,137, 68, 36, 32,232,237,251,255,255, 73,139, 86, 16,190, /* 0x 5c0 */
|
||||||
36, 32,232,225,251,255,255, 73,139, 86, 16,190, 3, 0, 0, 0, /* 0x 5d0 */
|
3, 0, 0, 0, 72,137,223, 72,131,194, 64,232,226,252,255,255, /* 0x 5d0 */
|
||||||
72,137,223, 72,131,194, 64,232,214,252,255,255, 72, 15,183, 85, /* 0x 5e0 */
|
72, 15,183, 85, 56,190, 5, 0, 0, 0, 72,137,223,232,208,252, /* 0x 5e0 */
|
||||||
56,190, 5, 0, 0, 0, 72,137,223,232,196,252,255,255, 72,139, /* 0x 5f0 */
|
255,255, 72,139, 85, 24,190, 9, 0, 0, 0, 72,137,223,232,191, /* 0x 5f0 */
|
||||||
85, 24,190, 9, 0, 0, 0, 72,137,223,232,179,252,255,255, 72, /* 0x 600 */
|
252,255,255, 72,141,116, 36, 16, 77,137,233, 77,137,224, 49,210, /* 0x 600 */
|
||||||
141,116, 36, 16, 77,137,233, 77,137,224, 49,210, 72,137,217, 72, /* 0x 610 */
|
72,137,217, 72,137,239,232,217,252,255,255, 69, 49,237,102,131, /* 0x 610 */
|
||||||
137,239,232,205,252,255,255, 69, 49,237,102,131,125, 56, 0, 73, /* 0x 620 */
|
125, 56, 0, 73,137,196,116,104, 65,131, 62, 3,117, 82, 73,139, /* 0x 620 */
|
||||||
137,196,116,104, 65,131, 62, 3,117, 82, 73,139,126, 16, 49,210, /* 0x 630 */
|
126, 16, 49,210, 49,246,232, 57,251,255,255,133,192,137,195,120, /* 0x 630 */
|
||||||
49,246,232, 45,251,255,255,133,192,137,195,120, 23,186, 0, 4, /* 0x 640 */
|
23,186, 0, 4, 0, 0, 72,137,238,137,199,232, 32,251,255,255, /* 0x 640 */
|
||||||
0, 0, 72,137,238,137,199,232, 20,251,255,255, 72, 61, 0, 4, /* 0x 650 */
|
72, 61, 0, 4, 0, 0,116, 10,191,127, 0, 0, 0,232, 26,251, /* 0x 650 */
|
||||||
0, 0,116, 10,191,127, 0, 0, 0,232, 14,251,255,255, 72,137, /* 0x 660 */
|
255,255, 72,137,239, 69, 49,201, 69, 49,192, 49,201,137,218, 49, /* 0x 660 */
|
||||||
239, 69, 49,201, 69, 49,192, 49,201,137,218, 49,246,232,114,252, /* 0x 670 */
|
246,232,126,252,255,255,137,223, 73,137,196,232,248,250,255,255, /* 0x 670 */
|
||||||
255,255,137,223, 73,137,196,232,236,250,255,255, 15,183, 69, 56, /* 0x 680 */
|
15,183, 69, 56, 65,255,197, 73,131,198, 56, 65, 57,197,124,152, /* 0x 680 */
|
||||||
65,255,197, 73,131,198, 56, 65, 57,197,124,152, 72,131,196, 48, /* 0x 690 */
|
72,131,196, 48, 76,137,224, 91, 93, 65, 92, 65, 93, 65, 94,195 /* 0x 690 */
|
||||||
76,137,224, 91, 93, 65, 92, 65, 93, 65, 94,195, 0, 0, 0, 0, /* 0x 6a0 */
|
|
||||||
20, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,120, 16, 12, 7, 8, /* 0x 6b0 */
|
|
||||||
144, 1, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 28, 0, 0, 0, /* 0x 6c0 */
|
|
||||||
128, 1, 16, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, /* 0x 6d0 */
|
|
||||||
65, 14, 16, 46, 8, 87, 14, 8, 46, 0, 95, 14, 0, 0, 0, 0, /* 0x 6e0 */
|
|
||||||
44, 0, 0, 0, 68, 0, 0, 0,184, 1, 16, 0, 0, 0, 0, 0, /* 0x 6f0 */
|
|
||||||
10, 1, 0, 0, 0, 0, 0, 0, 66, 14, 16,141, 2, 69, 14, 24, /* 0x 700 */
|
|
||||||
140, 3, 68, 14, 32,134, 4, 68, 14, 40,131, 5, 71, 14, 80, 0, /* 0x 710 */
|
|
||||||
20, 0, 0, 0,116, 0, 0, 0,194, 2, 16, 0, 0, 0, 0, 0, /* 0x 720 */
|
|
||||||
50, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0,140, 0, 0, 0, /* 0x 730 */
|
|
||||||
244, 2, 16, 0, 0, 0, 0, 0,150, 2, 0, 0, 0, 0, 0, 0, /* 0x 740 */
|
|
||||||
66, 14, 16,143, 2, 74, 14, 24,142, 3, 69, 14, 32, 66, 14, 40, /* 0x 750 */
|
|
||||||
65, 14, 48, 65, 14, 56, 68, 14,144, 1,131, 7,134, 6,140, 5, /* 0x 760 */
|
|
||||||
141, 4, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0,204, 0, 0, 0, /* 0x 770 */
|
|
||||||
138, 5, 16, 0, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 0, 0, /* 0x 780 */
|
|
||||||
66, 14, 16,142, 2, 70, 14, 24,141, 3, 69, 14, 32,140, 4, 68, /* 0x 790 */
|
|
||||||
14, 40,134, 5, 68, 14, 48,131, 6, 73, 14, 96 /* 0x 7a0 */
|
|
||||||
};
|
};
|
||||||
|
|||||||
+32
-33
@@ -97,32 +97,36 @@ L50:
|
|||||||
%define MAX_ELF_HDR 512
|
%define MAX_ELF_HDR 512
|
||||||
|
|
||||||
sub esp, dword MAX_ELF_HDR + OVERHEAD ; alloca
|
sub esp, dword MAX_ELF_HDR + OVERHEAD ; alloca
|
||||||
mov edx, esp ; %edx= &tmp
|
push ebx ; start of unmap region (&Elf32_Ehdr of this stub)
|
||||||
push ebx ; save &Elf32_Ehdr of this stub
|
|
||||||
xor ecx, ecx ; 0
|
; Cannot pre-round .p_memsz because kernel requires PF_W to setup .bss,
|
||||||
push ecx ; assume not ET_DYN
|
; but strict SELinux (or PaX, grsecurity) prohibits PF_W with PF_X.
|
||||||
lea eax, [szElf32_Ehdr + 2*szElf32_Phdr + szl_info + szp_info + ebx] ; 1st &b_info
|
mov edx, [p_memsz + szElf32_Ehdr + ebx] ; phdr[0].p_memsz
|
||||||
mov esi, [e_entry + ebx] ; beyond compressed data
|
lea edx, [-1 + 2*PAGE_SIZE + edx + ebx] ; 1 page for round, 1 for unfold
|
||||||
|
and edx, -PAGE_SIZE
|
||||||
|
|
||||||
|
push edx ; end of unmap region
|
||||||
|
sub eax, eax ; 0
|
||||||
cmp word [e_type + ebx], byte ET_DYN
|
cmp word [e_type + ebx], byte ET_DYN
|
||||||
jne L53
|
jne L53
|
||||||
pop ecx ; is ET_DYN: discard false assumption
|
xchg eax, edx ; dynbase for ET_DYN; assumes mmap(0, ...) is placed after us!
|
||||||
add esi, ebx ; relocate e_entry
|
|
||||||
mov ch, PAGE_SIZE>>8 ; %ecx= PAGE_SIZE
|
|
||||||
add ebx, [p_memsz + szElf32_Ehdr + ebx]
|
|
||||||
add ebx, ecx
|
|
||||||
push ebx ; dynbase
|
|
||||||
L53:
|
L53:
|
||||||
|
push eax ; dynbase
|
||||||
|
|
||||||
|
mov esi, [e_entry + ebx] ; end of compressed data
|
||||||
|
lea eax, [szElf32_Ehdr + 2*szElf32_Phdr + szl_info + szp_info + ebx] ; 1st &b_info
|
||||||
sub esi, eax ; length of compressed data
|
sub esi, eax ; length of compressed data
|
||||||
mov ebx, [ eax] ; length of uncompressed ELF headers
|
mov ebx, [ eax] ; length of uncompressed ELF headers
|
||||||
mov ecx, [4+ eax] ; length of compressed ELF headers
|
mov ecx, [4+ eax] ; length of compressed ELF headers
|
||||||
add ecx, byte szb_info
|
add ecx, byte szb_info
|
||||||
|
lea edx, [3*4 + esp] ; &tmp
|
||||||
pusha ; (AT_table, sz_cpr, f_expand, &tmp_ehdr, {sz_unc, &tmp}, {sz_cpr, &b1st_info} )
|
pusha ; (AT_table, sz_cpr, f_expand, &tmp_ehdr, {sz_unc, &tmp}, {sz_cpr, &b1st_info} )
|
||||||
inc edi ; swap with above 'pusha' to inhibit auxv_up for PT_INTERP
|
inc edi ; swap with above 'pusha' to inhibit auxv_up for PT_INTERP
|
||||||
EXTERN upx_main
|
EXTERN upx_main
|
||||||
call upx_main ; returns entry address
|
call upx_main ; returns entry address
|
||||||
add esp, byte 8*4 ; remove 8 params from pusha
|
add esp, byte (8 +1)*4 ; remove 8 params from pusha, also dynbase
|
||||||
pop ecx ; dynbase
|
pop ecx ; end of unmap region
|
||||||
pop ebx ; &Elf32_Ehdr of this stub
|
pop ebx ; start of unmap region (&Elf32_Ehdr of this stub)
|
||||||
add esp, dword MAX_ELF_HDR + OVERHEAD ; un-alloca
|
add esp, dword MAX_ELF_HDR + OVERHEAD ; un-alloca
|
||||||
push eax ; save entry address
|
push eax ; save entry address
|
||||||
|
|
||||||
@@ -135,23 +139,6 @@ L60:
|
|||||||
jne L60 ; not AT_NULL
|
jne L60 ; not AT_NULL
|
||||||
; edi now points at [AT_NULL]a_un.a_ptr which contains result of make_hatch()
|
; edi now points at [AT_NULL]a_un.a_ptr which contains result of make_hatch()
|
||||||
|
|
||||||
; _dl_start and company (ld-linux.so.2) once assumed that it had virgin stack,
|
|
||||||
; and did not initialize all its stack local variables to zero.
|
|
||||||
; See bug libc/1165 at http://bugs.gnu.org/cgi-bin/gnatsweb.pl
|
|
||||||
; Found 1999-06-16 glibc-2.1.1
|
|
||||||
; Fixed 1999-12-29 glibc-2.1.2
|
|
||||||
;
|
|
||||||
;%define N_STKCLR (0x100 + MAX_ELF_HDR + OVERHEAD)/4
|
|
||||||
;%define N_STKCLR 8
|
|
||||||
; lea edi, [esp - 4*N_STKCLR]
|
|
||||||
; pusha ; values will be zeroed
|
|
||||||
; mov esi,esp ; save
|
|
||||||
; mov esp,edi ; Linux does not grow stack below esp
|
|
||||||
; mov ecx, N_STKCLR
|
|
||||||
; ; xor eax,eax ; eax already 0 from L60
|
|
||||||
; rep stosd
|
|
||||||
; mov esp,esi ; restore
|
|
||||||
|
|
||||||
push eax
|
push eax
|
||||||
push eax
|
push eax
|
||||||
push eax
|
push eax
|
||||||
@@ -159,7 +146,7 @@ L60:
|
|||||||
push eax
|
push eax
|
||||||
push eax
|
push eax
|
||||||
push eax
|
push eax
|
||||||
push eax ; 32 bytes of zeroes now on stack
|
push eax ; 32 bytes of zeroes now on stack, ready for 'popa'
|
||||||
|
|
||||||
sub ecx, ebx ; length to unmap
|
sub ecx, ebx ; length to unmap
|
||||||
mov al, __NR_munmap ; eax was 0 from L60
|
mov al, __NR_munmap ; eax was 0 from L60
|
||||||
@@ -209,5 +196,17 @@ L32:
|
|||||||
pop edi ; &auxtab
|
pop edi ; &auxtab
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
%define __NR_mmap 90
|
||||||
|
|
||||||
|
global mmap
|
||||||
|
mmap:
|
||||||
|
push ebx
|
||||||
|
lea ebx, [2*4 + esp]
|
||||||
|
push byte __NR_mmap
|
||||||
|
pop eax
|
||||||
|
int 0x80
|
||||||
|
pop ebx
|
||||||
|
ret
|
||||||
|
|
||||||
; vi:ts=8:et:nowrap
|
; vi:ts=8:et:nowrap
|
||||||
|
|
||||||
|
|||||||
+102
-106
@@ -1,4 +1,4 @@
|
|||||||
/* fold_elf86.h -- created from fold_elf86.bin, 1670 (0x686) bytes
|
/* fold_elf86.h -- created from fold_elf86.bin, 1607 (0x647) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,114 +27,110 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define LINUX_I386ELF_FOLD_SIZE 1670
|
#define LINUX_I386ELF_FOLD_SIZE 1607
|
||||||
#define LINUX_I386ELF_FOLD_ADLER32 0x2e7cd8c9
|
#define LINUX_I386ELF_FOLD_ADLER32 0xdf50b4ab
|
||||||
#define LINUX_I386ELF_FOLD_CRC32 0x2993f845
|
#define LINUX_I386ELF_FOLD_CRC32 0x537b9a31
|
||||||
|
|
||||||
unsigned char linux_i386elf_fold[1670] = {
|
unsigned char linux_i386elf_fold[1607] = {
|
||||||
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
||||||
2, 0, 3, 0, 1, 0, 0, 0,128, 0,192, 0, 52, 0, 0, 0, /* 0x 10 */
|
2, 0, 3, 0, 1, 0, 0, 0,128, 16,192, 0, 52, 0, 0, 0, /* 0x 10 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
|
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
|
||||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 0, /* 0x 30 */
|
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16,192, 0, /* 0x 30 */
|
||||||
0, 0,192, 0,134, 6, 0, 0,136, 6, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
0, 16,192, 0, 71, 6, 0, 0, 72, 6, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||||
0, 16, 0, 0, 1, 0, 0, 0,134, 6, 0, 0,136, 6,192, 0, /* 0x 50 */
|
0, 16, 0, 0, 1, 0, 0, 0, 71, 6, 0, 0, 72, 22,192, 0, /* 0x 50 */
|
||||||
136, 6,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
|
72, 22,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
|
||||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||||
41,201,186,120, 2, 0, 0,137,230,137,231,232,112, 0, 0, 0, /* 0x 80 */
|
41,201,186,120, 2, 0, 0,137,230,137,231,232,121, 0, 0, 0, /* 0x 80 */
|
||||||
137,230,209,234, 25,192, 41,193,141, 36,196,133,210,117,243,137, /* 0x 90 */
|
137,230,209,234, 25,192, 41,193,141, 36,196,133,210,117,243,137, /* 0x 90 */
|
||||||
231,232, 90, 0, 0, 0,129,236, 0, 10, 0, 0,137,226, 83, 49, /* 0x a0 */
|
231,232, 99, 0, 0, 0,129,236, 0, 10, 0, 0, 83,139, 83, 72, /* 0x a0 */
|
||||||
201, 81,141,131,140, 0, 0, 0,139,115, 24,102,131,123, 16, 3, /* 0x b0 */
|
141,148, 26,255, 31, 0, 0,129,226, 0,240,255,255, 82, 41,192, /* 0x b0 */
|
||||||
117, 11, 89, 1,222,181, 16, 3, 91, 72, 1,203, 83, 41,198,139, /* 0x c0 */
|
102,131,123, 16, 3,117, 1,146, 80,139,115, 24,141,131,140, 0, /* 0x c0 */
|
||||||
24,139, 72, 4,131,193, 12, 96, 71,232,163, 4, 0, 0,131,196, /* 0x d0 */
|
0, 0, 41,198,139, 24,139, 72, 4,131,193, 12,141, 84, 36, 12, /* 0x d0 */
|
||||||
32, 89, 91,129,196, 0, 10, 0, 0, 80, 79, 41,192, 60,175,175, /* 0x e0 */
|
96, 71,232, 90, 4, 0, 0,131,196, 36, 89, 91,129,196, 0, 10, /* 0x e0 */
|
||||||
117,252, 80, 80, 80, 80, 80, 80, 80, 80, 41,217,176, 91,255, 39, /* 0x f0 */
|
0, 0, 80, 79, 41,192, 60,175,175,117,252, 80, 80, 80, 80, 80, /* 0x f0 */
|
||||||
173,171,133,192,117,250,173,171,133,192,117,250, 87,173,171,131, /* 0x 100 */
|
80, 80, 80, 41,217,176, 91,255, 39,173,171,133,192,117,250,173, /* 0x 100 */
|
||||||
248, 32,115, 3, 15,179,194,133,192,173,171,117,240,131,239, 8, /* 0x 110 */
|
171,133,192,117,250, 87,173,171,131,248, 32,115, 3, 15,179,194, /* 0x 110 */
|
||||||
1,201, 64,243,171, 72,171,171, 95,195, 0, 0, 85, 87,137,207, /* 0x 120 */
|
133,192,173,171,117,240,131,239, 8, 1,201, 64,243,171, 72,171, /* 0x 120 */
|
||||||
86,137,198, 83, 57, 8,139,104, 4,115, 8,106,127, 91,106, 1, /* 0x 130 */
|
171, 95,195, 83,141, 92, 36, 8,106, 90, 88,205,128, 91,195, 0, /* 0x 130 */
|
||||||
88,205,128,133,255,116, 11,137,249,138, 69, 0, 69,136, 2, 66, /* 0x 140 */
|
87, 86,137,206, 83,137,195, 57, 8,139,120, 4,115, 10,106,127, /* 0x 140 */
|
||||||
226,247, 91, 1,126, 4, 41, 62, 94, 95, 93,195, 83,141, 92, 36, /* 0x 150 */
|
91,106, 1, 88,205,128,235,254,133,201,116, 8,138, 7, 71,136, /* 0x 150 */
|
||||||
8,106, 90, 88,205,128, 91,195, 85,137,229, 87, 86,137,199, 83, /* 0x 160 */
|
2, 66,226,248, 1,115, 4, 41, 51, 91, 94, 95,195, 85,137,229, /* 0x 160 */
|
||||||
137,214,131,236, 24,139, 69, 8,131, 58, 0,137, 69,220, 15,132, /* 0x 170 */
|
87, 86,137,198, 83,137,211,131,236, 24,139, 69, 8,139,125, 12, /* 0x 170 */
|
||||||
189, 0, 0, 0,141, 85,228,137,248,185, 12, 0, 0, 0,232,153, /* 0x 180 */
|
137, 69,220,131, 58, 0, 15,132,184, 0, 0, 0,141, 85,228,185, /* 0x 180 */
|
||||||
255,255,255,131,125,228, 0,139, 69,232,117, 18, 61, 85, 80, 88, /* 0x 190 */
|
12, 0, 0, 0,137,240,232,165,255,255,255,139, 69,228,139, 77, /* 0x 190 */
|
||||||
33,117, 15,131, 63, 0, 15,132,149, 0, 0, 0,235, 4,133,192, /* 0x 1a0 */
|
232,133,192,117, 19,129,249, 85, 80, 88, 33,117, 15,131, 62, 0, /* 0x 1a0 */
|
||||||
117, 8,106,127, 91,106, 1, 88,205,128,139, 77,232,139, 69,228, /* 0x 1b0 */
|
15,132,142, 0, 0, 0,235, 4,133,201,117, 10,106,127, 91,106, /* 0x 1b0 */
|
||||||
57,193,119,238, 59, 6,119,234, 57,193,115, 88, 15,182, 69,236, /* 0x 1c0 */
|
1, 88,205,128,235,254, 57,193,119,242, 59, 3,119,238, 57,193, /* 0x 1c0 */
|
||||||
80,141, 69,224, 80,255,118, 4, 81,255,119, 4,255, 85,220,131, /* 0x 1d0 */
|
115, 85, 15,182, 69,236, 80,141, 69,224, 80,255,115, 4, 81,255, /* 0x 1d0 */
|
||||||
196, 20,133,192,117,204,139, 85,224, 59, 85,228,117,196,138, 69, /* 0x 1e0 */
|
118, 4,255, 85,220,131,196, 20,133,192,117,208,139, 85,224, 59, /* 0x 1e0 */
|
||||||
237,132,192,116, 37,131,125, 12, 0,116, 31,129,250, 0, 2, 0, /* 0x 1f0 */
|
85,228,117,200,138, 69,237,132,192,116, 34,133,255,116, 30,129, /* 0x 1f0 */
|
||||||
0,119, 4, 57, 22,117, 19, 15,182,192, 80, 15,182, 69,238, 80, /* 0x 200 */
|
250, 0, 2, 0, 0,119, 4, 57, 19,117, 18, 15,182,192, 80, 15, /* 0x 200 */
|
||||||
82,255,118, 4,255, 85, 12,131,196, 16,139, 69,232, 1, 71, 4, /* 0x 210 */
|
182, 69,238, 80, 82,255,115, 4,255,215,131,196, 16,139, 69,232, /* 0x 210 */
|
||||||
41, 7,235, 10,139, 86, 4,137,248,232,254,254,255,255,139, 85, /* 0x 220 */
|
1, 70, 4, 41, 6,235, 10,139, 83, 4,137,240,232, 15,255,255, /* 0x 220 */
|
||||||
228,139, 6, 1, 86, 4, 41,208,133,192,137, 6,233, 61,255,255, /* 0x 230 */
|
255,139, 85,228,139, 3, 1, 83, 4, 41,208,133,192,137, 3,233, /* 0x 230 */
|
||||||
255,141,101,244, 91, 94, 95,201,195,133,210,137,209,116, 6,198, /* 0x 240 */
|
66,255,255,255,141,101,244, 91, 94, 95,201,195,133,192, 83,137, /* 0x 240 */
|
||||||
0, 0, 64,226,250,195,133,192, 83,137,211,116, 29,168, 1,117, /* 0x 250 */
|
211,116, 29,168, 1,117, 25,139, 16, 57,218,116, 7, 74,117, 11, /* 0x 250 */
|
||||||
25,139, 16, 57,218,116, 7, 74,117, 11,133,219,116, 7,137, 24, /* 0x 260 */
|
133,219,116, 7,137, 24,137, 72, 4,235, 5,131,192, 8,235,231, /* 0x 260 */
|
||||||
137, 72, 4,235, 5,131,192, 8,235,231, 91,195, 85,137,229, 87, /* 0x 270 */
|
91,195, 85,137,229, 87, 86, 83,131,236, 64,137, 85,224,139, 77, /* 0x 270 */
|
||||||
86, 83,131,236, 72,137, 85,224,139, 77,224,137, 69,228,139, 93, /* 0x 280 */
|
224,137, 69,228,139, 85, 12, 3, 73, 28,139, 69, 8,137, 85,216, /* 0x 280 */
|
||||||
224,199, 69,208, 0, 0, 0, 0, 3, 73, 28,139, 69, 8,139, 85, /* 0x 290 */
|
139, 93,224,139, 85,224,137, 69,220, 49,192,102,131,123, 16, 2, /* 0x 290 */
|
||||||
12,137, 69,220, 49,192,102,131,123, 16, 2,137, 85,216,137, 77, /* 0x 2a0 */
|
137, 77,212,137,203, 15,183, 74, 44, 15,148,192,131,207,255,193, /* 0x 2a0 */
|
||||||
212,137,202, 15,183, 75, 44, 15,148,192,131,206,255,193,224, 4, /* 0x 2b0 */
|
224, 4,137,202, 49,246,131,192, 34, 74,120, 28,131, 59, 1,117, /* 0x 2b0 */
|
||||||
137,207,131,192, 34, 49,219, 79,137, 69,180,120, 34,131, 58, 1, /* 0x 2c0 */
|
18,139, 83, 8, 57,250,115, 2,137,215, 3, 83, 20, 57,214,115, /* 0x 2c0 */
|
||||||
117, 24,139, 66, 8, 57,240,115, 8,139,122, 16,137,198,137,125, /* 0x 2d0 */
|
2,137,214,131,195, 32,226,228,137,251,106, 0,129,227, 0,240, /* 0x 2d0 */
|
||||||
208, 3, 66, 20, 57,195,115, 2,137,195,131,194, 32,226,222,137, /* 0x 2e0 */
|
255,255,106,255, 41,222, 80,129,198,255, 15, 0, 0,106, 0,129, /* 0x 2e0 */
|
||||||
247,106, 0,129,231, 0,240,255,255,106, 0, 41,251,255,117,180, /* 0x 2f0 */
|
230, 0,240,255,255, 86, 83,232, 55,254,255,255,139, 77,224,141, /* 0x 2f0 */
|
||||||
129,195,255, 15, 0, 0,106, 7,129,227, 0,240,255,255,139, 85, /* 0x 300 */
|
52, 48,131,196, 24, 41,216,102,131,121, 44, 0,137,117,240,137, /* 0x 300 */
|
||||||
208, 83,137,240, 37,255, 15, 0, 0, 87,137, 93,172,141,180, 2, /* 0x 310 */
|
69,208,199, 69,204, 0, 0, 0, 0, 15,132,218, 1, 0, 0,139, /* 0x 310 */
|
||||||
255, 15, 0, 0,232, 51,254,255,255,137,194,131,196, 24, 1,218, /* 0x 320 */
|
93,212,139, 3,131,248, 6,117, 24,139, 77,208,186, 3, 0, 0, /* 0x 320 */
|
||||||
129,230, 0,240,255,255,137, 85,240,137,194, 41,243, 1,242,137, /* 0x 330 */
|
0, 3, 75, 8,139, 69,216,232, 16,255,255,255,233,161, 1, 0, /* 0x 330 */
|
||||||
217,137, 69,176,137,211,106, 91, 88,205,128,139,117,176,139, 69, /* 0x 340 */
|
0, 72, 15,133,154, 1, 0, 0,139, 69,212,199, 69,200, 64, 98, /* 0x 340 */
|
||||||
224, 41,254, 49,255,102,131,120, 44, 0, 15,132,221, 1, 0, 0, /* 0x 350 */
|
81,115,139, 85,212,139, 72, 24,139, 90, 20,131,225, 7,193,225, /* 0x 350 */
|
||||||
139, 85,212,139, 2,131,248, 6,117, 23,139, 74, 8,186, 3, 0, /* 0x 360 */
|
2,211,109,200,139, 72, 16,139, 69,208, 3, 66, 8,137, 77,232, /* 0x 360 */
|
||||||
0, 0,139, 69,216, 1,241,232,218,254,255,255,233,168, 1, 0, /* 0x 370 */
|
131,101,200, 7,137,194, 1,195,129,226,255, 15, 0, 0,137,199, /* 0x 370 */
|
||||||
0, 72, 15,133,161, 1, 0, 0,139, 93,212,199, 69,200, 64, 98, /* 0x 380 */
|
141, 52, 17,139, 77,212,137, 69,236, 41,215,139, 65, 4,137, 93, /* 0x 380 */
|
||||||
81,115,139, 75, 24,139, 67, 8,131,225, 7,139, 83, 16, 1,240, /* 0x 390 */
|
196, 41,208,131,125,220, 0, 80,139, 69,228,116, 3,131,200,255, /* 0x 390 */
|
||||||
193,225, 2,211,109,200,139, 75, 20,137,195,129,227,255, 15, 0, /* 0x 3a0 */
|
131,125,220, 1, 80, 25,192,131,224,224,131,192, 50,131,125,220, /* 0x 3a0 */
|
||||||
0,137, 85,232, 1,218, 1,193,137, 85,196,139, 85,212,137, 69, /* 0x 3b0 */
|
0, 80,139, 69,200,116, 3,131,200, 2,131,125,220, 0, 80,137, /* 0x 3b0 */
|
||||||
236, 41,216,137, 69,192,139, 66, 4,131,101,200, 7, 41,216,131, /* 0x 3c0 */
|
240,116, 3,141, 70, 3, 80, 87,232,102,253,255,255,131,196, 24, /* 0x 3c0 */
|
||||||
125,220, 1, 80,255,117,228, 25,192,137, 77,188,131,224,224,137, /* 0x 3d0 */
|
57,199, 15,133,187, 0, 0, 0,131,125,220, 0,116, 31, 49,192, /* 0x 3d0 */
|
||||||
93,184,131,192, 50,131,125,220, 0, 80,139, 69,196,106, 3,116, /* 0x 3e0 */
|
246, 69,200, 4,116, 6,139, 69,228,131,192, 2, 80,139, 69,220, /* 0x 3e0 */
|
||||||
3,131,192, 3, 80,255,117,192,232, 95,253,255,255,131,196, 24, /* 0x 3f0 */
|
255,117,228,141, 85,232,232,114,253,255,255, 88, 90,137,243,247, /* 0x 3f0 */
|
||||||
57, 69,192, 15,133,198, 0, 0, 0,131,125,220, 0,116, 34,139, /* 0x 400 */
|
219,129,227,255, 15, 0, 0,246, 69,200, 2,137, 93,192,116, 15, /* 0x 400 */
|
||||||
77,212, 49,192,246, 65, 24, 1,116, 6,139, 69,228,131,192, 2, /* 0x 410 */
|
133,219,141, 4, 55,116, 8,137,217,198, 0, 0, 64,226,250,131, /* 0x 410 */
|
||||||
80,139, 69,220,255,117,228,141, 85,232,232, 57,253,255,255, 88, /* 0x 420 */
|
125,220, 0,116,120,139, 69,212,131, 56, 1,117, 86,246, 64, 24, /* 0x 420 */
|
||||||
90,139, 85,184,139, 69,192,232, 13,254,255,255,139, 93,196,139, /* 0x 430 */
|
1,116, 80,139, 80, 20,139, 88, 8,141, 12, 26, 3, 77,208, 59, /* 0x 430 */
|
||||||
69,192,247,219, 3, 69,196,129,227,255, 15, 0, 0,137,218,137, /* 0x 440 */
|
80, 16,117, 14,137,200,247,216, 37,255, 15, 0, 0,131,248, 3, /* 0x 440 */
|
||||||
93,184,232,242,253,255,255,131,125,220, 0,116, 96,139, 69,212, /* 0x 450 */
|
119, 17,139, 85,212,107, 69,208, 52,131,122, 4, 0,141, 76, 3, /* 0x 450 */
|
||||||
131, 56, 1,117, 88,246, 64, 24, 1,116, 82,139, 80, 20,139, 88, /* 0x 460 */
|
12,117, 15,139, 1, 61,205,128, 97,195,116, 6,199, 1,205,128, /* 0x 460 */
|
||||||
8,141, 4, 26,141, 12, 48,139, 69,212, 59, 80, 16,117, 14,137, /* 0x 470 */
|
97,195,133,201,116, 13,139, 69,216, 49,210,131,224,254,232,201, /* 0x 470 */
|
||||||
200,247,216, 37,255, 15, 0, 0,131,248, 3,119, 16,139, 85,212, /* 0x 480 */
|
253,255,255,137,251,137,241,139, 85,200,106,125, 88,205,128,133, /* 0x 480 */
|
||||||
107,198, 52,131,122, 4, 0,141, 76, 3, 12,117, 15,139, 1, 61, /* 0x 490 */
|
192,116, 10,106,127, 91,106, 1, 88,205,128,235,254,139, 85,192, /* 0x 490 */
|
||||||
205,128, 97,195,116, 6,199, 1,205,128, 97,195,133,201,116, 13, /* 0x 4a0 */
|
141, 4, 22,141, 28, 7, 59, 93,196,115, 30,106, 0,106,255,106, /* 0x 4a0 */
|
||||||
139, 69,216, 49,210,131,224,254,232,153,253,255,255,139, 93,192, /* 0x 4b0 */
|
50,255,117,200, 41, 93,196,255,117,196, 83,232,115,252,255,255, /* 0x 4b0 */
|
||||||
139, 77,196,139, 85,200,106,125, 88,205,128,133,192,116, 8,106, /* 0x 4c0 */
|
131,196, 24, 57,195,116, 27,235,202,131,125,220, 0,116, 19,141, /* 0x 4c0 */
|
||||||
127, 91,106, 1, 88,205,128,139, 69,196, 3, 69,184, 1, 69,192, /* 0x 4d0 */
|
78, 3,129,225,255, 15, 0, 0,131,249, 3,119, 5,106, 91, 88, /* 0x 4d0 */
|
||||||
139, 69,188, 57, 69,192,115, 31,106, 0, 43, 69,192,106, 0,106, /* 0x 4e0 */
|
205,128,139, 77,224,255, 69,204, 15,183, 65, 44,131, 69,212, 32, /* 0x 4e0 */
|
||||||
50,255,117,200, 80,255,117,192,232, 95,252,255,255,131,196, 24, /* 0x 4f0 */
|
57, 69,204, 15,140, 38,254,255,255,131,125,220, 0,117, 14,139, /* 0x 4f0 */
|
||||||
57, 69,192,116, 36,235,200,131,125,220, 0,116, 28,131, 69,196, /* 0x 500 */
|
93,228,106, 6, 88,205,128,133,192,116, 20,235,134,139, 69,224, /* 0x 500 */
|
||||||
3,129,101,196,255, 15, 0, 0,131,125,196, 3,119, 11,139, 93, /* 0x 510 */
|
102,131,120, 16, 3,116, 8,139, 93,240,106, 45, 88,205,128,131, /* 0x 510 */
|
||||||
192,139, 77,196,106, 91, 88,205,128,139, 85,224, 71,131, 69,212, /* 0x 520 */
|
125, 16, 0,116, 8,139, 77,208,139, 85, 16,137, 10,139, 93,224, /* 0x 520 */
|
||||||
32, 15,183, 66, 44, 57,199, 15,140, 35,254,255,255,131,125,220, /* 0x 530 */
|
139, 91, 24, 1, 93,208,139, 69,208,141,101,244, 91, 94, 95,201, /* 0x 530 */
|
||||||
0,117, 17,139, 93,228,106, 6, 88,205,128,133,192,116, 23,233, /* 0x 540 */
|
195, 85,137,229, 87, 86, 83,131,236, 24,139,125, 28,106, 0,139, /* 0x 540 */
|
||||||
123,255,255,255,139,125,224,102,131,127, 16, 3,116, 8,139, 93, /* 0x 550 */
|
69, 16,141, 87, 52,139,117, 8, 80,139, 93, 32,137, 69,236,137, /* 0x 550 */
|
||||||
240,106, 45, 88,205,128,131,125, 16, 0,116, 5,139, 69, 16,137, /* 0x 560 */
|
85,232,141, 69, 32,141, 85, 24,232, 0,252,255,255,139, 69, 12, /* 0x 560 */
|
||||||
48,139, 85,224, 3,114, 24,141,101,244, 91,137,240, 94, 95,201, /* 0x 570 */
|
15,183, 79, 44,186, 5, 0, 0, 0,137, 69, 32,137,240, 41, 93, /* 0x 570 */
|
||||||
195, 85,137,229, 87, 86, 83,131,236, 12,139,125, 28,106, 0,139, /* 0x 580 */
|
36,232,198,252,255,255, 15,183, 79, 42,186, 4, 0, 0, 0,137, /* 0x 580 */
|
||||||
69, 16,141, 87, 52,139,117, 8, 80,139, 93, 32,137, 69,236,137, /* 0x 590 */
|
240,232,182,252,255,255,139, 93,232,139, 77, 40,186, 3, 0, 0, /* 0x 590 */
|
||||||
85,232,141, 69, 32,141, 85, 24,232,187,251,255,255,139, 69, 12, /* 0x 5a0 */
|
0, 3, 75, 8,137,240,131,193, 52,232,158,252,255,255,141, 69, /* 0x 5a0 */
|
||||||
15,183, 79, 44,186, 5, 0, 0, 0,137, 69, 32,137,240, 41, 93, /* 0x 5b0 */
|
240,137,250, 80,141, 69, 32, 86, 80,139, 69,236,232,177,252,255, /* 0x 5b0 */
|
||||||
36,232,144,252,255,255, 15,183, 79, 42,186, 4, 0, 0, 0,137, /* 0x 5c0 */
|
255,186, 9, 0, 0, 0,137,193,137,195,137,240,232,123,252,255, /* 0x 5c0 */
|
||||||
240,232,128,252,255,255,139, 93,232,139, 77, 40,186, 3, 0, 0, /* 0x 5d0 */
|
255,102,139, 79, 44,131,196, 20, 49,210,102,133,201,116, 94,139, /* 0x 5d0 */
|
||||||
0, 3, 75, 8,137,240,131,193, 52,232,104,252,255,255,141, 69, /* 0x 5e0 */
|
69,232,131, 56, 3,117, 74,139, 93,240, 49,201, 3, 88, 8,137, /* 0x 5e0 */
|
||||||
240,137,250, 80,141, 69, 32, 86, 80,139, 69,236,232,123,252,255, /* 0x 5f0 */
|
202,106, 5, 88,205,128,133,192,137,198,120, 21,186, 0, 2, 0, /* 0x 5f0 */
|
||||||
255,186, 9, 0, 0, 0,137,193,137,195,137,240,232, 69,252,255, /* 0x 600 */
|
0,137,195,137,249,106, 3, 88,205,128, 61, 0, 2, 0, 0,116, /* 0x 600 */
|
||||||
255,102,139, 79, 44,131,196, 20, 49,210,102,133,201,116, 93,139, /* 0x 610 */
|
10,106,127, 91,106, 1, 88,205,128,235,254,106, 0,137,250,106, /* 0x 610 */
|
||||||
69,232,131, 56, 3,117, 73,139, 93,240, 49,201, 3, 88, 8,137, /* 0x 620 */
|
0,137,240,106, 0,232, 72,252,255,255,131,196, 12,137,195,235, /* 0x 620 */
|
||||||
202,106, 5, 88,205,128,133,192,137,198,120, 20,102,186, 0, 2, /* 0x 630 */
|
12, 66, 15,183,193,131, 69,232, 32, 57,194,124,162,141,101,244, /* 0x 630 */
|
||||||
137,195,137,249,106, 3, 88,205,128, 61, 0, 2, 0, 0,116, 10, /* 0x 640 */
|
137,216, 91, 94, 95,201,195 /* 0x 640 */
|
||||||
106,127, 91,106, 1, 88,205,128,235,246,106, 0,137,250,106, 0, /* 0x 650 */
|
|
||||||
137,240,106, 0,232, 19,252,255,255,131,196, 12,137,195,235, 12, /* 0x 660 */
|
|
||||||
66, 15,183,193,131, 69,232, 32, 57,194,124,163,141,101,244,137, /* 0x 670 */
|
|
||||||
216, 91, 94, 95,201,195 /* 0x 680 */
|
|
||||||
};
|
};
|
||||||
|
|||||||
+98
-102
@@ -1,4 +1,4 @@
|
|||||||
/* fold_elfppc32.h -- created from fold_elfppc32.bin, 2324 (0x914) bytes
|
/* fold_elfppc32.h -- created from fold_elfppc32.bin, 2260 (0x8d4) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,18 +27,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define LINUX_ELFPPC32_FOLD_SIZE 2324
|
#define LINUX_ELFPPC32_FOLD_SIZE 2260
|
||||||
#define LINUX_ELFPPC32_FOLD_ADLER32 0x0789a535
|
#define LINUX_ELFPPC32_FOLD_ADLER32 0x6c8685d0
|
||||||
#define LINUX_ELFPPC32_FOLD_CRC32 0x665028e2
|
#define LINUX_ELFPPC32_FOLD_CRC32 0xa1bffc23
|
||||||
|
|
||||||
unsigned char linux_elfppc32_fold[2324] = {
|
unsigned char linux_elfppc32_fold[2260] = {
|
||||||
127, 69, 76, 70, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
127, 69, 76, 70, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||||
0, 2, 0, 20, 0, 0, 0, 1, 0, 16, 0,128, 0, 0, 0, 52, /* 0x 10 */
|
0, 2, 0, 20, 0, 0, 0, 1, 0, 16, 0,128, 0, 0, 0, 52, /* 0x 10 */
|
||||||
0, 0, 7,252, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 40, /* 0x 20 */
|
0, 0, 7,188, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 40, /* 0x 20 */
|
||||||
0, 7, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 0, 16, 0, 0, /* 0x 30 */
|
0, 7, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 0, 16, 0, 0, /* 0x 30 */
|
||||||
0, 16, 0, 0, 0, 0, 7,196, 0, 0, 7,196, 0, 0, 0, 5, /* 0x 40 */
|
0, 16, 0, 0, 0, 0, 7,132, 0, 0, 7,132, 0, 0, 0, 5, /* 0x 40 */
|
||||||
0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 7,196, 0, 16, 7,196, /* 0x 50 */
|
0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 7,132, 0, 16, 7,132, /* 0x 50 */
|
||||||
0, 16, 7,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, /* 0x 60 */
|
0, 16, 7,132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, /* 0x 60 */
|
||||||
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||||
72, 0, 0,125, 40, 6, 0,208, 76,130, 0, 32, 84,132,240,191, /* 0x 80 */
|
72, 0, 0,125, 40, 6, 0,208, 76,130, 0, 32, 84,132,240,191, /* 0x 80 */
|
||||||
77,130, 0, 32, 60, 0, 0, 16,124, 4, 0, 64, 65,128, 0, 8, /* 0x 90 */
|
77,130, 0, 32, 60, 0, 0, 16,124, 4, 0, 64, 65,128, 0, 8, /* 0x 90 */
|
||||||
@@ -50,7 +50,7 @@ unsigned char linux_elfppc32_fold[2324] = {
|
|||||||
47,130, 0, 0, 64,158,255,244, 78,128, 0, 32,125, 8, 2,166, /* 0x f0 */
|
47,130, 0, 0, 64,158,255,244, 78,128, 0, 32,125, 8, 2,166, /* 0x f0 */
|
||||||
129, 33, 0, 0, 75,255,255,229, 75,255,255,225,128,159,255,248, /* 0x 100 */
|
129, 33, 0, 0, 75,255,255,229, 75,255,255,225,128,159,255,248, /* 0x 100 */
|
||||||
85, 30, 0, 38, 56,161,248, 0,127,231,251,120,124,100,248, 80, /* 0x 110 */
|
85, 30, 0, 38, 56,161,248, 0,127,231,251,120,124,100,248, 80, /* 0x 110 */
|
||||||
56, 33,247,240, 84,125, 0, 38,128,195, 0, 24, 72, 0, 5, 73, /* 0x 120 */
|
56, 33,247,240, 84,125, 0, 38,128,195, 0, 24, 72, 0, 5, 9, /* 0x 120 */
|
||||||
124,127, 27,120,127,163,235,120,124,157,240, 80, 72, 0, 0, 81, /* 0x 130 */
|
124,127, 27,120,127,163,235,120,124,157,240, 80, 72, 0, 0, 81, /* 0x 130 */
|
||||||
127,232, 3,166,184, 65, 8, 20,128, 33, 8, 16, 78,128, 0, 32, /* 0x 140 */
|
127,232, 3,166,184, 65, 8, 20,128, 33, 8, 16, 78,128, 0, 32, /* 0x 140 */
|
||||||
56, 0, 0, 90, 68, 0, 0, 2, 64,163, 0, 8, 56, 96,255,255, /* 0x 150 */
|
56, 0, 0, 90, 68, 0, 0, 2, 64,163, 0, 8, 56, 96,255,255, /* 0x 150 */
|
||||||
@@ -86,96 +86,92 @@ unsigned char linux_elfppc32_fold[2324] = {
|
|||||||
129, 63, 0, 0,128, 31, 0, 4,125, 43, 72, 80, 47,137, 0, 0, /* 0x 330 */
|
129, 63, 0, 0,128, 31, 0, 4,125, 43, 72, 80, 47,137, 0, 0, /* 0x 330 */
|
||||||
124, 0, 90, 20,144, 31, 0, 4,145, 63, 0, 0, 75,255,254,228, /* 0x 340 */
|
124, 0, 90, 20,144, 31, 0, 4,145, 63, 0, 0, 75,255,254,228, /* 0x 340 */
|
||||||
128, 1, 0, 68,187,129, 0, 48, 56, 33, 0, 64,124, 8, 3,166, /* 0x 350 */
|
128, 1, 0, 68,187,129, 0, 48, 56, 33, 0, 64,124, 8, 3,166, /* 0x 350 */
|
||||||
78,128, 0, 32,124,128, 35,121,124, 9, 3,166, 77,130, 0, 32, /* 0x 360 */
|
78,128, 0, 32, 44, 3, 0, 0, 77,130, 0, 32, 48, 4,255,255, /* 0x 360 */
|
||||||
56, 0, 0, 0,152, 3, 0, 0, 56, 99, 0, 1, 66, 0,255,248, /* 0x 370 */
|
125, 96, 33, 16,128, 3, 0, 0,127,128, 32, 0,104, 9, 0, 1, /* 0x 370 */
|
||||||
78,128, 0, 32, 44, 3, 0, 0, 77,130, 0, 32, 48, 4,255,255, /* 0x 380 */
|
33, 73, 0, 0,125, 42, 73, 20,125, 42, 88, 57, 65,158, 0, 8, /* 0x 380 */
|
||||||
125, 96, 33, 16,128, 3, 0, 0,127,128, 32, 0,104, 9, 0, 1, /* 0x 390 */
|
65,162, 0, 16,144,163, 0, 4,144,131, 0, 0, 78,128, 0, 32, /* 0x 390 */
|
||||||
33, 73, 0, 0,125, 42, 73, 20,125, 42, 88, 57, 65,158, 0, 8, /* 0x 3a0 */
|
56, 99, 0, 8, 75,255,255,208,124, 8, 2,166,148, 33,255,160, /* 0x 3a0 */
|
||||||
65,162, 0, 16,144,163, 0, 4,144,131, 0, 0, 78,128, 0, 32, /* 0x 3b0 */
|
125,128, 0, 38,190, 65, 0, 40,124,121, 27,120,124,151, 35,120, /* 0x 3b0 */
|
||||||
56, 99, 0, 8, 75,255,255,208,124, 8, 2,166,148, 33,255,160, /* 0x 3c0 */
|
144, 1, 0,100,124,178, 43,120,161, 67, 0, 44,124,211, 51,120, /* 0x 3c0 */
|
||||||
125,128, 0, 38,190, 65, 0, 40,124,121, 27,120,124,151, 35,120, /* 0x 3d0 */
|
160, 3, 0, 16,124,244, 59,120, 53, 74,255,255,129, 35, 0, 28, /* 0x 3d0 */
|
||||||
144, 1, 0,100,124,181, 43,120,161, 67, 0, 44,124,210, 51,120, /* 0x 3e0 */
|
104, 0, 0, 3,145,129, 0, 36,124, 0, 0,208,127,163, 74, 20, /* 0x 3e0 */
|
||||||
160, 3, 0, 16,124,243, 59,120, 53, 74,255,255,129, 35, 0, 28, /* 0x 3f0 */
|
84, 3, 46,246,125, 21, 67,120, 56, 99, 8, 34,127,171,235,120, /* 0x 3f0 */
|
||||||
104, 0, 0, 3,145,129, 0, 36,124, 0, 0,208,127, 99, 74, 20, /* 0x 400 */
|
59,224,255,255, 59,192, 0, 0, 65,128, 0, 68, 57, 74, 0, 1, /* 0x 400 */
|
||||||
84, 3, 46,246,125, 20, 67,120, 56, 99, 8, 34,127,107,219,120, /* 0x 410 */
|
125, 73, 3,166,128, 11, 0, 0, 47,128, 0, 1, 64,190, 0, 40, /* 0x 410 */
|
||||||
59,128,255,255, 59,192, 0, 0, 59,224, 0, 0, 65,128, 0, 72, /* 0x 420 */
|
129, 43, 0, 8,127,137,248, 64, 64,156, 0, 8,125, 63, 75,120, /* 0x 420 */
|
||||||
57, 74, 0, 1,125, 73, 3,166,128, 11, 0, 0, 47,128, 0, 1, /* 0x 430 */
|
128, 11, 0, 20,124, 0, 74, 20,127,158, 0, 64, 64,156, 0, 8, /* 0x 430 */
|
||||||
64,190, 0, 44,129, 43, 0, 8,127,137,224, 64, 64,156, 0, 12, /* 0x 440 */
|
124, 30, 3,120, 57,107, 0, 32, 66, 0,255,204, 87,255, 0, 38, /* 0x 440 */
|
||||||
131,235, 0, 16,125, 60, 75,120,128, 11, 0, 20,124, 0, 74, 20, /* 0x 450 */
|
124,102, 27,120,125, 63,240, 80,127,227,251,120, 57, 41, 15,255, /* 0x 450 */
|
||||||
127,158, 0, 64, 64,156, 0, 8,124, 30, 3,120, 57,107, 0, 32, /* 0x 460 */
|
56,160, 0, 0, 85, 62, 0, 38, 56,224,255,255,127,196,243,120, /* 0x 460 */
|
||||||
66, 0,255,200, 87,128, 5, 62, 87,156, 0, 38,125, 60,240, 80, /* 0x 470 */
|
57, 0, 0, 0, 75,255,252,221,160, 25, 0, 44, 58,192, 0, 0, /* 0x 470 */
|
||||||
127,255, 2, 20, 57, 41, 15,255, 56, 31, 15,255, 85, 62, 0, 38, /* 0x 480 */
|
127, 31, 24, 80,127,150, 0, 0,124, 3,242, 20,144, 1, 0, 8, /* 0x 480 */
|
||||||
84, 31, 0, 38,124,102, 27,120,127,196,243,120, 56,160, 0, 7, /* 0x 490 */
|
64,156, 1,128, 46, 23, 0, 0, 65,146, 0, 40,128, 29, 0, 0, /* 0x 490 */
|
||||||
126,167,171,120, 57, 0, 0, 0,127,131,227,120, 75,255,252,165, /* 0x 4a0 */
|
47,128, 0, 6, 64,190, 0, 28,128,189, 0, 8,126, 99,155,120, /* 0x 4a0 */
|
||||||
124,159,240, 80,124, 3,242, 20,124,125, 27,120, 56,160, 0, 0, /* 0x 4b0 */
|
56,128, 0, 3,124,165,194, 20, 75,255,254,173, 72, 0, 1, 64, /* 0x 4b0 */
|
||||||
124, 99,250, 20,144, 1, 0, 8, 75,255,252,189,160, 25, 0, 44, /* 0x 4c0 */
|
128, 29, 0, 0, 47,128, 0, 1, 64,190, 1, 52,128, 29, 0, 24, /* 0x 4c0 */
|
||||||
58,192, 0, 0,127, 28,232, 80,127,150, 0, 0, 64,156, 1,116, /* 0x 4d0 */
|
61, 32,115, 81,129, 93, 0, 8, 97, 41, 98, 64, 84, 0, 22,250, /* 0x 4d0 */
|
||||||
45,151, 0, 0, 65,142, 0, 40,128, 27, 0, 0, 47,128, 0, 6, /* 0x 4e0 */
|
129,125, 0, 20,125, 41, 4, 48, 85, 94, 5, 62, 48, 23,255,255, /* 0x 4e0 */
|
||||||
64,190, 0, 28,128,187, 0, 8,126, 67,147,120, 56,128, 0, 3, /* 0x 4f0 */
|
124,160,185, 16,128, 29, 0, 16, 85, 58, 7,126,127,106, 90, 20, /* 0x 4f0 */
|
||||||
124,165,194, 20, 75,255,254,129, 72, 0, 1, 52,128, 27, 0, 0, /* 0x 500 */
|
84,165, 8, 60,127,254, 80, 80,144, 1, 0, 16,127,128,242, 20, /* 0x 500 */
|
||||||
47,128, 0, 1, 64,190, 1, 40,128, 27, 0, 24, 61, 32,115, 81, /* 0x 510 */
|
145, 65, 0, 20,127,255,194, 20,127,123,194, 20,124,165,211,120, /* 0x 510 */
|
||||||
129, 91, 0, 8, 97, 41, 98, 64, 84, 0, 22,250,129,123, 0, 20, /* 0x 520 */
|
65,146, 0, 12, 56,192, 0, 50, 72, 0, 0, 8, 56,192, 0, 18, /* 0x 520 */
|
||||||
125, 41, 4, 48, 85, 94, 5, 62, 48, 23,255,255,124,160,185, 16, /* 0x 530 */
|
64,146, 0, 12,126, 71,147,120, 72, 0, 0, 8, 56,224,255,255, /* 0x 530 */
|
||||||
128, 27, 0, 16, 85, 58, 7,126,127,170, 90, 20, 84,165, 8, 60, /* 0x 540 */
|
129, 29, 0, 4,127,227,251,120,127,132,227,120,125, 30, 64, 80, /* 0x 540 */
|
||||||
127,254, 80, 80,144, 1, 0, 16,127,128,242, 20,145, 65, 0, 20, /* 0x 550 */
|
75,255,252, 1,127,159, 24, 0, 64,158, 0,104, 65,178, 0, 24, /* 0x 550 */
|
||||||
127,255,194, 20,127,189,194, 20,124,165,211,120, 65,142, 0, 12, /* 0x 560 */
|
126,227,187,120, 56,129, 0, 16,126,133,163,120,126,166,171,120, /* 0x 560 */
|
||||||
56,192, 0, 50, 72, 0, 0, 8, 56,192, 0, 18,129, 27, 0, 4, /* 0x 570 */
|
75,255,252,153,115, 64, 0, 2,124, 28, 0,208, 84, 30, 5, 62, /* 0x 570 */
|
||||||
127,227,251,120,127,132,227,120,126,167,171,120,125, 30, 64, 80, /* 0x 580 */
|
65,130, 0, 36, 47,158, 0, 0,125, 63,226, 20, 65,158, 0, 24, /* 0x 580 */
|
||||||
75,255,251,193,127,159, 24, 0, 64,158, 0,104, 65,174, 0, 24, /* 0x 590 */
|
127,201, 3,166, 56, 0, 0, 0,152, 9, 0, 0, 57, 41, 0, 1, /* 0x 590 */
|
||||||
126,227,187,120, 56,129, 0, 16,126,101,155,120,126,134,163,120, /* 0x 5a0 */
|
66, 0,255,248, 65,178, 0, 36,127,227,251,120,127,132,227,120, /* 0x 5a0 */
|
||||||
75,255,252, 89, 87, 64,255,254, 46, 0, 0, 0, 65,178, 0, 16, /* 0x 5b0 */
|
127, 69,211,120, 75,255,251,209, 47,131, 0, 0, 65,190, 0, 12, /* 0x 5b0 */
|
||||||
127,196,243,120,127,227,251,120, 75,255,253,157,124, 28, 0,208, /* 0x 5c0 */
|
56, 96, 0,127, 75,255,251,161,124, 28,242, 20,127,255, 2, 20, /* 0x 5c0 */
|
||||||
84, 30, 5, 62, 65,178, 0, 16,124,127,226, 20,127,196,243,120, /* 0x 5d0 */
|
127,159,216, 64, 64,188, 0, 40,124,159,216, 80,127, 69,211,120, /* 0x 5d0 */
|
||||||
75,255,253,133, 65,174, 0, 36,127,227,251,120,127,132,227,120, /* 0x 5e0 */
|
127,227,251,120, 56,192, 0, 50, 56,224,255,255, 57, 0, 0, 0, /* 0x 5e0 */
|
||||||
127, 69,211,120, 75,255,251,145, 47,131, 0, 0, 65,190, 0, 12, /* 0x 5f0 */
|
75,255,251, 97,127,159, 24, 0, 64,190,255,200,160, 25, 0, 44, /* 0x 5f0 */
|
||||||
56, 96, 0,127, 75,255,251, 97,124, 28,242, 20,127,255, 2, 20, /* 0x 600 */
|
58,214, 0, 1, 59,189, 0, 32,127,150, 0, 0, 75,255,254,132, /* 0x 600 */
|
||||||
127,159,232, 64, 64,188, 0, 40,124,159,232, 80,127, 69,211,120, /* 0x 610 */
|
128,121, 0, 24,128, 1, 0,100,129,129, 0, 36,124, 99,194, 20, /* 0x 610 */
|
||||||
127,227,251,120, 56,192, 0, 50, 56,224, 0, 0, 57, 0, 0, 0, /* 0x 620 */
|
124, 8, 3,166,186, 65, 0, 40,125,128,129, 32, 56, 33, 0, 96, /* 0x 620 */
|
||||||
75,255,251, 33,127,159, 24, 0, 64,190,255,200,160, 25, 0, 44, /* 0x 630 */
|
78,128, 0, 32,124, 8, 2,166,148, 33,255,192, 56,132,255,232, /* 0x 630 */
|
||||||
58,214, 0, 1, 59,123, 0, 32,127,150, 0, 0, 75,255,254,144, /* 0x 640 */
|
191, 97, 0, 44,144,129, 0, 8,124,191, 43,120,144, 1, 0, 68, /* 0x 640 */
|
||||||
128,121, 0, 24,128, 1, 0,100,129,129, 0, 36,124, 99,194, 20, /* 0x 650 */
|
56, 3, 0, 24,144, 1, 0, 12,124,229, 59,120,128, 3, 0, 24, /* 0x 650 */
|
||||||
124, 8, 3,166,186, 65, 0, 40,125,129,129, 32, 56, 33, 0, 96, /* 0x 660 */
|
56,192, 0, 0,200, 1, 0, 8, 56, 97, 0, 8, 56,129, 0, 16, /* 0x 660 */
|
||||||
78,128, 0, 32,124, 8, 2,166,148, 33,255,192, 56,132,255,232, /* 0x 670 */
|
59,223, 0, 52,125, 61, 75,120,124,251, 59,120,144, 1, 0, 16, /* 0x 670 */
|
||||||
191, 97, 0, 44,144,129, 0, 8,124,191, 43,120,144, 1, 0, 68, /* 0x 680 */
|
125, 28, 67,120,216, 1, 0, 24,147,225, 0, 20, 75,255,251,125, /* 0x 680 */
|
||||||
56, 3, 0, 24,144, 1, 0, 12,124,229, 59,120,128, 3, 0, 24, /* 0x 690 */
|
128,190, 0, 8,127,163,235,120, 56,128, 0, 3, 56,165, 0, 52, /* 0x 690 */
|
||||||
56,192, 0, 0,200, 1, 0, 8, 56, 97, 0, 8, 56,129, 0, 16, /* 0x 6a0 */
|
75,255,252,197,160,191, 0, 44,127,163,235,120, 56,128, 0, 5, /* 0x 6a0 */
|
||||||
59,223, 0, 52,125, 61, 75,120,124,251, 59,120,144, 1, 0, 16, /* 0x 6b0 */
|
75,255,252,181,128,191, 0, 24,127,163,235,120, 56,128, 0, 9, /* 0x 6b0 */
|
||||||
125, 28, 67,120,216, 1, 0, 24,147,225, 0, 20, 75,255,251, 61, /* 0x 6c0 */
|
75,255,252,165,127,103,219,120,127,136,227,120,127,227,251,120, /* 0x 6c0 */
|
||||||
128,190, 0, 8,127,163,235,120, 56,128, 0, 3, 56,165, 0, 52, /* 0x 6d0 */
|
127,166,235,120, 56,129, 0, 24, 56,160, 0, 0, 59, 96, 0, 0, /* 0x 6d0 */
|
||||||
75,255,252,165,160,191, 0, 44,127,163,235,120, 56,128, 0, 5, /* 0x 6e0 */
|
75,255,252,201,160, 31, 0, 44,124,124, 27,120,127,155, 0, 0, /* 0x 6e0 */
|
||||||
75,255,252,149,128,191, 0, 24,127,163,235,120, 56,128, 0, 9, /* 0x 6f0 */
|
64,156, 0,124,128, 30, 0, 0, 59,123, 0, 1, 56,128, 0, 0, /* 0x 6f0 */
|
||||||
75,255,252,133,127,103,219,120,127,136,227,120,127,227,251,120, /* 0x 700 */
|
56,160, 0, 0, 47,128, 0, 3, 64,190, 0, 88,128,126, 0, 8, /* 0x 700 */
|
||||||
127,166,235,120, 56,129, 0, 24, 56,160, 0, 0, 59, 96, 0, 0, /* 0x 710 */
|
75,255,250,101,127,228,251,120,124,125, 27,121, 56,160, 2, 0, /* 0x 710 */
|
||||||
75,255,252,169,160, 31, 0, 44,124,124, 27,120,127,155, 0, 0, /* 0x 720 */
|
65,128, 0, 40, 75,255,250, 73, 56,128, 0, 0, 47,131, 2, 0, /* 0x 720 */
|
||||||
64,156, 0,124,128, 30, 0, 0, 59,123, 0, 1, 56,128, 0, 0, /* 0x 730 */
|
127,165,235,120,127,227,251,120, 56,192, 0, 0, 56,224, 0, 0, /* 0x 730 */
|
||||||
56,160, 0, 0, 47,128, 0, 3, 64,190, 0, 88,128,126, 0, 8, /* 0x 740 */
|
57, 0, 0, 0, 65,190, 0, 12, 56, 96, 0,127, 75,255,250, 25, /* 0x 740 */
|
||||||
75,255,250, 37,127,228,251,120,124,125, 27,121, 56,160, 2, 0, /* 0x 750 */
|
75,255,252, 89,124,124, 27,120,127,163,235,120, 75,255,250, 33, /* 0x 750 */
|
||||||
65,128, 0, 40, 75,255,250, 9, 56,128, 0, 0, 47,131, 2, 0, /* 0x 760 */
|
160, 31, 0, 44, 59,222, 0, 32, 75,255,255,132,128, 1, 0, 68, /* 0x 760 */
|
||||||
127,165,235,120,127,227,251,120, 56,192, 0, 0, 56,224, 0, 0, /* 0x 770 */
|
127,131,227,120,187, 97, 0, 44, 56, 33, 0, 64,124, 8, 3,166, /* 0x 770 */
|
||||||
57, 0, 0, 0, 65,190, 0, 12, 56, 96, 0,127, 75,255,249,217, /* 0x 780 */
|
78,128, 0, 32, 0, 46,115,104,115,116,114,116, 97, 98, 0, 46, /* 0x 780 */
|
||||||
75,255,252, 57,124,124, 27,120,127,163,235,120, 75,255,249,225, /* 0x 790 */
|
116,101,120,116, 0, 46, 98,115,115, 0, 46,115,100, 97,116, 97, /* 0x 790 */
|
||||||
160, 31, 0, 44, 59,222, 0, 32, 75,255,255,132,128, 1, 0, 68, /* 0x 7a0 */
|
0, 46,115,100, 97,116, 97, 50, 0, 46,110,111,116,101, 46, 71, /* 0x 7a0 */
|
||||||
127,131,227,120,187, 97, 0, 44, 56, 33, 0, 64,124, 8, 3,166, /* 0x 7b0 */
|
78, 85, 45,115,116, 97, 99,107, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 7b0 */
|
||||||
78,128, 0, 32, 0, 46,115,104,115,116,114,116, 97, 98, 0, 46, /* 0x 7c0 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 7c0 */
|
||||||
116,101,120,116, 0, 46, 98,115,115, 0, 46,115,100, 97,116, 97, /* 0x 7d0 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 7d0 */
|
||||||
0, 46,115,100, 97,116, 97, 50, 0, 46,110,111,116,101, 46, 71, /* 0x 7e0 */
|
0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 0, 0, 6, /* 0x 7e0 */
|
||||||
78, 85, 45,115,116, 97, 99,107, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 7f0 */
|
0, 16, 0,128, 0, 0, 0,128, 0, 0, 7, 4, 0, 0, 0, 0, /* 0x 7f0 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 800 */
|
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 17, /* 0x 800 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 810 */
|
0, 0, 0, 8, 0, 0, 0, 3, 0, 16, 7,132, 0, 0, 7,132, /* 0x 810 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 0, 0, 6, /* 0x 820 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x 820 */
|
||||||
0, 16, 0,128, 0, 0, 0,128, 0, 0, 7, 68, 0, 0, 0, 0, /* 0x 830 */
|
0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 1, 0, 0, 0, 3, /* 0x 830 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 17, /* 0x 840 */
|
0, 16, 7,132, 0, 0, 7,132, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 840 */
|
||||||
0, 0, 0, 8, 0, 0, 0, 3, 0, 16, 7,196, 0, 0, 7,196, /* 0x 850 */
|
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 29, /* 0x 850 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x 860 */
|
0, 0, 0, 1, 0, 0, 0, 2, 0, 16, 7,132, 0, 0, 7,132, /* 0x 860 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 1, 0, 0, 0, 3, /* 0x 870 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, /* 0x 870 */
|
||||||
0, 16, 7,196, 0, 0, 7,196, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 880 */
|
0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 7, 0, 0, 0, 0, /* 0x 880 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 29, /* 0x 890 */
|
0, 0, 0, 0, 0, 0, 7,132, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 890 */
|
||||||
0, 0, 0, 1, 0, 0, 0, 2, 0, 16, 7,196, 0, 0, 7,196, /* 0x 8a0 */
|
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x 8a0 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, /* 0x 8b0 */
|
0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,132, /* 0x 8b0 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 7, 0, 0, 0, 0, /* 0x 8c0 */
|
0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x 8c0 */
|
||||||
0, 0, 0, 0, 0, 0, 7,196, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 8d0 */
|
0, 0, 0, 0 /* 0x 8d0 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x 8e0 */
|
|
||||||
0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,196, /* 0x 8f0 */
|
|
||||||
0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 0x 900 */
|
|
||||||
0, 0, 0, 0 /* 0x 910 */
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,19 +44,29 @@
|
|||||||
%define szp_info 12
|
%define szp_info 12
|
||||||
|
|
||||||
fold_begin: ; enter: %ebx= &Elf32_Ehdr of this program
|
fold_begin: ; enter: %ebx= &Elf32_Ehdr of this program
|
||||||
pop eax ; discard &dstlen
|
|
||||||
pop eax ; discard dstlen
|
|
||||||
|
|
||||||
pop eax ; Pop the argument count
|
pop eax ; Pop the argument count
|
||||||
mov ecx, esp ; argv starts just at the current stack top
|
mov ecx, esp ; argv starts just at the current stack top
|
||||||
lea edx, [esp+eax*4+4] ; envp = &argv[argc + 1]
|
lea edx, [esp+eax*4+4] ; envp = &argv[argc + 1]
|
||||||
mov esi, [e_entry + ebx]
|
mov edi, [ebx + e_entry]
|
||||||
add ebx, szElf32_Ehdr + szElf32_Phdr + szl_info
|
lea esi, [ebx + szElf32_Ehdr + szElf32_Phdr + szl_info]
|
||||||
sub esi, ebx ; length
|
sub edi, esi ; length
|
||||||
lea edi, [2 + ebp] ; f_unfilter, maybe
|
lea ebx, [2 + ebp] ; f_unfilter, maybe
|
||||||
pusha ; (f_unf, cprLen, f_decpr, xx, cprSrc, envp, argv, argc)
|
pusha ; (cprLen, cprSrc, f_decpr, xx, f_unf, envp, argv, argc)
|
||||||
EXTERN upx_main
|
EXTERN upx_main
|
||||||
call upx_main ; Call the UPX main function
|
call upx_main ; Call the UPX main function
|
||||||
hlt ; Crash if somehow upx_main does return
|
hlt ; Crash if somehow upx_main does return
|
||||||
|
|
||||||
|
%define __NR_mmap 90
|
||||||
|
|
||||||
|
global mmap
|
||||||
|
mmap:
|
||||||
|
push ebx
|
||||||
|
lea ebx, [2*4 + esp]
|
||||||
|
push byte __NR_mmap
|
||||||
|
pop eax
|
||||||
|
int 0x80
|
||||||
|
pop ebx
|
||||||
|
ret
|
||||||
|
|
||||||
; vi:ts=8:et:nowrap
|
; vi:ts=8:et:nowrap
|
||||||
|
|||||||
+56
-59
@@ -1,4 +1,4 @@
|
|||||||
/* fold_exec86.h -- created from fold_exec86.bin, 947 (0x3b3) bytes
|
/* fold_exec86.h -- created from fold_exec86.bin, 899 (0x383) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,69 +27,66 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define LINUX_I386EXEC_FOLD_SIZE 947
|
#define LINUX_I386EXEC_FOLD_SIZE 899
|
||||||
#define LINUX_I386EXEC_FOLD_ADLER32 0xf7998d99
|
#define LINUX_I386EXEC_FOLD_ADLER32 0x1a1874e1
|
||||||
#define LINUX_I386EXEC_FOLD_CRC32 0x4ada49e8
|
#define LINUX_I386EXEC_FOLD_CRC32 0x6ce5306c
|
||||||
|
|
||||||
unsigned char linux_i386exec_fold[947] = {
|
unsigned char linux_i386exec_fold[899] = {
|
||||||
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
||||||
2, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, /* 0x 10 */
|
2, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, /* 0x 10 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 1, 0, 0, 0, /* 0x 20 */
|
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 1, 0, 0, 0, /* 0x 20 */
|
||||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16, 64, 0, /* 0x 30 */
|
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16, 64, 0, /* 0x 30 */
|
||||||
0, 16, 64, 0,179, 3, 0, 0,180, 3, 0, 0, 7, 0, 0, 0, /* 0x 40 */
|
0, 16, 64, 0,131, 3, 0, 0,132, 3, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||||
88, 88, 88,137,225,141, 84,132, 4,139,115, 24,131,195, 96, 41, /* 0x 60 */
|
88,137,225,141, 84,132, 4,139,123, 24,141,115, 96, 41,247,141, /* 0x 60 */
|
||||||
222,141,125, 2, 96,232,197, 0, 0, 0,244, 0, 83,137,195,139, /* 0x 70 */
|
93, 2, 96,232,199, 0, 0, 0,244, 83,141, 92, 36, 8,106, 90, /* 0x 70 */
|
||||||
76, 36, 8,136,208,131,224, 31, 60, 25,118, 3,131,232, 43,131, /* 0x 80 */
|
88,205,128, 91,195, 0, 0, 0, 83,137,195,139, 76, 36, 8,136, /* 0x 80 */
|
||||||
192, 65, 75,136, 3,137,208,193,232, 5,137,194,226,229, 91,195, /* 0x 90 */
|
208,131,224, 31, 60, 25,118, 3,131,232, 43,131,192, 65, 75,136, /* 0x 90 */
|
||||||
83,141, 92, 36, 8,106, 90, 88,205,128, 91,195, 85, 49,201,137, /* 0x a0 */
|
3,137,208,193,232, 5,137,194,226,229, 91,195, 85, 49,201,137, /* 0x a0 */
|
||||||
229, 87, 86,137,202, 83,131,236, 32,139, 93, 8,106, 5, 88,205, /* 0x b0 */
|
229, 87, 86,137,202, 83,131,236, 44,139, 93, 8,106, 5, 88,205, /* 0x b0 */
|
||||||
128,133,192,137,199,120,108,199, 69,212, 47,112,114,111,199, 69, /* 0x c0 */
|
128,133,192,137,198,120,108,199, 69,212, 47,112,114,111,199, 69, /* 0x c0 */
|
||||||
216, 99, 47, 0, 0,106, 20, 88,205,128,141, 85,218,141,117,212, /* 0x d0 */
|
216, 99, 47, 0, 0,106, 20, 88,205,128,141, 85,218,141,125,212, /* 0x d0 */
|
||||||
232,171, 2, 0, 0,141, 80, 4,137,243,199, 0, 47,102,100, 47, /* 0x e0 */
|
232,123, 2, 0, 0,141, 80, 4,137,251,199, 0, 47,102,100, 47, /* 0x e0 */
|
||||||
137,248,232,153, 2, 0, 0,186, 1, 0, 0, 0,106, 33, 88,106, /* 0x f0 */
|
137,240,232,105, 2, 0, 0,186, 1, 0, 0, 0,106, 33, 88,106, /* 0x f0 */
|
||||||
5, 89,205,128, 61, 85, 80, 88, 50,117, 33,139, 93, 8,106, 10, /* 0x 100 */
|
5, 89,205,128, 61, 85, 80, 88, 50,117, 33,139, 93, 8,106, 10, /* 0x 100 */
|
||||||
88,205,128,185, 2, 0, 0, 0,137,251,106, 55, 88,205,128,137, /* 0x 110 */
|
88,205,128,185, 2, 0, 0, 0,137,243,106, 55, 88,205,128,137, /* 0x 110 */
|
||||||
243,139, 77, 12,139, 85, 16,106, 11, 88,205,128,137,251,106, 6, /* 0x 120 */
|
251,139, 77, 12,139, 85, 16,106, 11, 88,205,128,137,243,106, 6, /* 0x 120 */
|
||||||
88,205,128,131,196, 32,137,248, 91, 94, 95,201,194, 12, 0, 85, /* 0x 130 */
|
88,205,128,131,196, 44,137,240, 91, 94, 95,201,194, 12, 0, 85, /* 0x 130 */
|
||||||
137,229, 87, 86, 83,131,236,112,141,125,228,139, 77, 24,139, 69, /* 0x 140 */
|
137,229, 87, 86, 83,131,236,124,141,125,228,139, 69, 16,139,117, /* 0x 140 */
|
||||||
16,139, 85, 12,137,203,129,227, 0,240,255,255,137, 69,156,137, /* 0x 150 */
|
12,137, 69,156,165,165,165,131,109, 8, 12,129,125,228, 85, 80, /* 0x 150 */
|
||||||
85,148,137,206,137, 77,152,137, 93,144,165,165,165,131,109,148, /* 0x 160 */
|
88, 51,137,117, 12, 15,133,111, 1, 0, 0,199, 69,196, 47,116, /* 0x 160 */
|
||||||
12,129,125,228, 85, 80, 88, 51,137,117,152, 15,133,100, 1, 0, /* 0x 170 */
|
109,112,199, 69,200, 47,117,112,120,141, 77,215,106, 20, 88,205, /* 0x 170 */
|
||||||
0,199, 69,196, 47,116,109,112,199, 69,200, 47,117,112,120,141, /* 0x 180 */
|
128,137,194,106, 4,137,200,141,125,211,232,249,254,255,255,139, /* 0x 180 */
|
||||||
77,215,106, 20, 88,205,128,137,194,106, 4,137,200,141,117,211, /* 0x 190 */
|
85,228,198, 69,215, 0, 49,201, 49,208,141, 93,172,137, 69,132, /* 0x 190 */
|
||||||
232,215,254,255,255,141, 93,172,137,199,198, 69,215, 0, 51,125, /* 0x 1a0 */
|
106, 78, 88,205,128,139, 85,172,137,248, 49, 85,132,139, 85,176, /* 0x 1a0 */
|
||||||
228, 49,201,106, 78, 88,205,128, 51,125,172,139, 85,176,137,240, /* 0x 1b0 */
|
199, 4, 36, 7, 0, 0, 0,141, 93,196,193,226, 12, 51, 85,132, /* 0x 1b0 */
|
||||||
199, 4, 36, 7, 0, 0, 0,193,226, 12,141, 93,196, 49,250,232, /* 0x 1c0 */
|
232,195,254,255,255, 88,106, 10, 88,205,128,131,248,254,116, 8, /* 0x 1c0 */
|
||||||
168,254,255,255, 88,106, 10, 88,205,128,131,248,254,116, 8,133, /* 0x 1d0 */
|
133,192, 15,133, 2, 1, 0, 0,185,194, 0, 0, 0,186,192, 1, /* 0x 1d0 */
|
||||||
192, 15,133,254, 0, 0, 0,185,194, 0, 0, 0,186,192, 1, 0, /* 0x 1e0 */
|
0, 0,141, 93,196,106, 5, 88,205,128,139, 85,232,137, 69,148, /* 0x 1e0 */
|
||||||
0,141, 93,196,106, 5, 88,205,128,137, 69,136,139, 77,232,137, /* 0x 1f0 */
|
137,195,137,209,106, 93, 88,205,128,133,192, 15,133,209, 0, 0, /* 0x 1f0 */
|
||||||
195,106, 93, 88,205,128,133,192, 15,133,207, 0, 0, 0,106, 0, /* 0x 200 */
|
0,106, 0,255,117,148,106, 1,106, 3, 82,106, 0,232,103,254, /* 0x 200 */
|
||||||
83,106, 1,106, 3, 81,106, 0,232,131,254,255,255,131,196, 24, /* 0x 210 */
|
255,255,131,196, 24, 61, 0,240,255,255,137, 69,136, 15,135,175, /* 0x 210 */
|
||||||
61, 0,240,255,255,137, 69,132, 15,135,175, 0, 0, 0,139, 69, /* 0x 220 */
|
0, 0, 0,139, 69,232,106, 0,106,255, 5,255, 15, 0, 0,106, /* 0x 220 */
|
||||||
232,106, 0,106, 0, 5,255, 15, 0, 0,106, 50, 37, 0,240,255, /* 0x 230 */
|
50, 37, 0,240,255,255,106, 3, 3, 69,136,104, 0, 16, 0, 0, /* 0x 230 */
|
||||||
255,106, 3, 3, 69,132,104, 0, 16, 0, 0, 80,232, 79,254,255, /* 0x 240 */
|
80,232, 51,254,255,255,131,196, 24,141,125,180,139,117, 12,165, /* 0x 240 */
|
||||||
255,131,196, 24,141,125,180,139,117,152,165,165,165,139, 77,180, /* 0x 250 */
|
165,165,139, 77,180,131,109, 8, 12,133,201,137,117, 12,139, 85, /* 0x 250 */
|
||||||
131,109,148, 12,133,201,137,117,152,139, 85,184,117, 20,129,250, /* 0x 260 */
|
184,117, 16,129,250, 85, 80, 88, 33,117,103,131,125,232, 0,116, /* 0x 260 */
|
||||||
85, 80, 88, 33,117,103,131,125,232, 0, 15,132,141, 0, 0, 0, /* 0x 270 */
|
115,235, 95, 57,202,119, 91, 59, 85,236,119, 86, 57,202,115, 36, /* 0x 270 */
|
||||||
235, 91, 57,202,119, 87, 59, 85,236,119, 82, 57,202,115, 36, 15, /* 0x 280 */
|
15,182, 69,188, 80,141, 69,168, 80,255,117,136, 82,255,117, 12, /* 0x 280 */
|
||||||
182, 69,188, 80,141, 69,168, 80,255,117,132, 82,255,117,152,255, /* 0x 290 */
|
255, 85,156,131,196, 20,133,192,117, 56,139, 69,180, 57, 69,168, /* 0x 290 */
|
||||||
85,156,131,196, 20,133,192,117, 52,139, 69,180, 57, 69,168,117, /* 0x 2a0 */
|
117, 48,235, 8,139,125,136,139,117, 12,243,164,139, 85,180,139, /* 0x 2a0 */
|
||||||
44,235, 8,139,125,132,139,117,152,243,164,139, 77,180,139, 93, /* 0x 2b0 */
|
93,136,137,209,106, 91, 88,205,128,139, 69,184, 41, 69, 8, 1, /* 0x 2b0 */
|
||||||
132,106, 91, 88,205,128,139, 69,184, 1,203, 41, 69,148, 41, 77, /* 0x 2c0 */
|
85,136, 41, 85,232, 1, 69, 12,131,125, 8, 0, 15,137,119,255, /* 0x 2c0 */
|
||||||
232, 1, 69,152,131,125,148, 0,137, 93,132,121, 18,141, 93,196, /* 0x 2d0 */
|
255,255,141, 93,196,106, 10, 88,205,128,106,127, 91,106, 1, 88, /* 0x 2d0 */
|
||||||
106, 10, 88,205,128,106,127, 91,106, 1, 88,205,128,235,246,139, /* 0x 2e0 */
|
205,128,235,254,139, 93,148,106, 6, 88,205,128,133,192,117,226, /* 0x 2e0 */
|
||||||
77,152,139, 93,144,129,225, 0,240,255,255, 43, 77,144,106, 91, /* 0x 2f0 */
|
255,117, 28,255,117, 32,141,117,196, 86,232,173,253,255,255,133, /* 0x 2f0 */
|
||||||
88,205,128, 1,203,137, 93,144,233, 71,255,255,255,139, 93,136, /* 0x 300 */
|
192,120,207,106, 2, 88,205,128,133,192,117, 51,106, 2, 88,205, /* 0x 300 */
|
||||||
106, 6, 88,205,128,133,192,117,196,255,117, 28,255,117, 32,141, /* 0x 310 */
|
128,133,192,137,193,117, 31,199, 69,160, 85, 80, 88, 52,184,162, /* 0x 310 */
|
||||||
117,196, 86,232,132,253,255,255,133,192,120,177,106, 2, 88,205, /* 0x 320 */
|
0, 0, 0,141, 93,160,199, 69,164, 0, 0, 0, 0,205,128,137, /* 0x 320 */
|
||||||
128,133,192,117, 49,106, 2, 88,205,128,133,192,137,193,117, 31, /* 0x 330 */
|
243,106, 10, 88,205,128, 49,219,106, 1, 88,205,128,235,254, 49, /* 0x 330 */
|
||||||
199, 69,160, 85, 80, 88, 52,184,162, 0, 0, 0,141, 93,160,199, /* 0x 340 */
|
201,131,203,255,137,202,106, 7, 88,205,128,141, 93,196,139, 77, /* 0x 340 */
|
||||||
69,164, 0, 0, 0, 0,205,128,137,243,106, 10, 88,205,128, 49, /* 0x 350 */
|
32,139, 85, 28,106, 11, 88,205,128,233,116,255,255,255, 0, 0, /* 0x 350 */
|
||||||
219,106, 1, 88,205,128, 49,201,131,203,255,137,202,106, 7, 88, /* 0x 360 */
|
87,137,215,106, 10,252, 89,232, 5, 0, 0, 0,136, 39,151, 95, /* 0x 360 */
|
||||||
205,128,141, 93,196,139, 77, 32,139, 85, 28,106, 11, 88,205,128, /* 0x 370 */
|
195,153,247,241, 82,133,192,116, 5,232,243,255,255,255, 88, 4, /* 0x 370 */
|
||||||
233, 88,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 380 */
|
48,170,195 /* 0x 380 */
|
||||||
87,137,215,106, 10,252, 89,232, 5, 0, 0, 0,136, 39,151, 95, /* 0x 390 */
|
|
||||||
195,153,247,241, 82,133,192,116, 5,232,243,255,255,255, 88, 4, /* 0x 3a0 */
|
|
||||||
48,170,195 /* 0x 3b0 */
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ reg_mq = 38*4
|
|||||||
reg_vrsave = 39*4
|
reg_vrsave = 39*4
|
||||||
|
|
||||||
|
|
||||||
|
_start: .globl _start # ignored, but silence "cannot find entry symbol _start" from ld
|
||||||
/* In:
|
/* In:
|
||||||
r31= &decompress; also 8+ (char *)&(offset to {l_info; p_info; b_info})
|
r31= &decompress; also 8+ (char *)&(offset to {l_info; p_info; b_info})
|
||||||
*/
|
*/
|
||||||
@@ -95,6 +96,7 @@ SYS_write =4
|
|||||||
SYS_open =5
|
SYS_open =5
|
||||||
SYS_close =6
|
SYS_close =6
|
||||||
|
|
||||||
|
SYS_pread =153
|
||||||
SYS_mmap =197
|
SYS_mmap =197
|
||||||
SYS_mprotect= 74
|
SYS_mprotect= 74
|
||||||
|
|
||||||
@@ -102,6 +104,9 @@ SYS_mprotect= 74
|
|||||||
in wrong registers. So change C interface to use size_t (32-bits) instead
|
in wrong registers. So change C interface to use size_t (32-bits) instead
|
||||||
of off_t (64 bits), and convert here.
|
of off_t (64 bits), and convert here.
|
||||||
*/
|
*/
|
||||||
|
pread: .globl pread
|
||||||
|
movr a4,a3; li a3,0 # zero extend 4th arg size_t to off_t
|
||||||
|
li 0,SYS_pread; b sysgo
|
||||||
mmap: .globl mmap
|
mmap: .globl mmap
|
||||||
movr a6,a5; li a5,0 # zero extend 6th arg size_t to off_t
|
movr a6,a5; li a5,0 # zero extend 6th arg size_t to off_t
|
||||||
li 0,SYS_mmap
|
li 0,SYS_mmap
|
||||||
|
|||||||
+95
-89
@@ -1,4 +1,4 @@
|
|||||||
/* fold_machppc32.h -- created from fold_machppc32.bin, 1544 (0x608) bytes
|
/* fold_machppc32.h -- created from fold_machppc32.bin, 1648 (0x670) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,11 +27,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define FOLD_MACHPPC32_SIZE 1544
|
#define FOLD_MACHPPC32_SIZE 1648
|
||||||
#define FOLD_MACHPPC32_ADLER32 0xa57805a9
|
#define FOLD_MACHPPC32_ADLER32 0x16162538
|
||||||
#define FOLD_MACHPPC32_CRC32 0x2fb8902f
|
#define FOLD_MACHPPC32_CRC32 0x67f187d4
|
||||||
|
|
||||||
unsigned char fold_machppc32[1544] = {
|
unsigned char fold_machppc32[1648] = {
|
||||||
72, 0, 0,105, 40, 6, 0,208, 76,130, 0, 32, 84,132,240,191, /* 0x 0 */
|
72, 0, 0,105, 40, 6, 0,208, 76,130, 0, 32, 84,132,240,191, /* 0x 0 */
|
||||||
77,130, 0, 32, 60, 0, 0, 16,124, 4, 0, 64, 65,128, 0, 8, /* 0x 10 */
|
77,130, 0, 32, 60, 0, 0, 16,124, 4, 0, 64, 65,128, 0, 8, /* 0x 10 */
|
||||||
124, 4, 3,120, 56,165, 1, 32,124,103, 27,120, 56, 99,255,252, /* 0x 20 */
|
124, 4, 3,120, 56,165, 1, 32,124,103, 27,120, 56, 99,255,252, /* 0x 20 */
|
||||||
@@ -42,91 +42,97 @@ unsigned char fold_machppc32[1544] = {
|
|||||||
124, 41, 11,120,125, 8, 2,166,128,159,255,248,124,100,248, 80, /* 0x 70 */
|
124, 41, 11,120,125, 8, 2,166,128,159,255,248,124,100,248, 80, /* 0x 70 */
|
||||||
128,195, 0, 24, 40, 6, 8, 0, 65,129, 0, 8, 56,192, 8, 0, /* 0x 80 */
|
128,195, 0, 24, 40, 6, 8, 0, 65,129, 0, 8, 56,192, 8, 0, /* 0x 80 */
|
||||||
124, 61, 11,120,124, 38, 8, 80,124, 37, 11,120, 56, 33,255,232, /* 0x 90 */
|
124, 61, 11,120,124, 38, 8, 80,124, 37, 11,120, 56, 33,255,232, /* 0x 90 */
|
||||||
127,231,251,120, 72, 0, 4, 37,127,161,235,120,128, 67, 0, 0, /* 0x a0 */
|
127,231,251,120, 72, 0, 4, 57,127,161,235,120,128, 67, 0, 0, /* 0x a0 */
|
||||||
124, 73, 3,166,128, 67, 0,136,124, 79,241, 32,128, 67, 0,140, /* 0x b0 */
|
124, 73, 3,166,128, 67, 0,136,124, 79,241, 32,128, 67, 0,140, /* 0x b0 */
|
||||||
124, 65, 3,166,128, 67, 0,144,124, 72, 3,166,184,131, 0, 24, /* 0x c0 */
|
124, 65, 3,166,128, 67, 0,144,124, 72, 3,166,184,131, 0, 24, /* 0x c0 */
|
||||||
128, 3, 0, 8,128, 67, 0, 16,128, 99, 0, 20, 78,128, 4, 32, /* 0x d0 */
|
128, 3, 0, 8,128, 67, 0, 16,128, 99, 0, 20, 78,128, 4, 32, /* 0x d0 */
|
||||||
125, 9, 67,120, 57, 0, 0, 0, 56, 0, 0,197, 68, 0, 0, 2, /* 0x e0 */
|
124,199, 51,120, 56,192, 0, 0, 56, 0, 0,153, 72, 0, 0, 16, /* 0x e0 */
|
||||||
56, 96,255,255, 78,128, 0, 32, 56, 0, 0, 1, 75,255,255,240, /* 0x f0 */
|
125, 9, 67,120, 57, 0, 0, 0, 56, 0, 0,197, 68, 0, 0, 2, /* 0x f0 */
|
||||||
56, 0, 0, 3, 75,255,255,232, 56, 0, 0, 5, 75,255,255,224, /* 0x 100 */
|
56, 96,255,255, 78,128, 0, 32, 56, 0, 0, 1, 75,255,255,240, /* 0x 100 */
|
||||||
56, 0, 0, 6, 75,255,255,216, 56, 0, 0, 74, 75,255,255,208, /* 0x 110 */
|
56, 0, 0, 3, 75,255,255,232, 56, 0, 0, 5, 75,255,255,224, /* 0x 110 */
|
||||||
124, 8, 2,166,148, 33,255,240,144, 1, 0, 20,128, 3, 0, 0, /* 0x 120 */
|
56, 0, 0, 6, 75,255,255,216, 56, 0, 0, 74, 75,255,255,208, /* 0x 120 */
|
||||||
129, 35, 0, 4,127,128, 40, 64, 64,188, 0, 12, 56, 96, 0,127, /* 0x 130 */
|
124, 8, 2,166,148, 33,255,240,144, 1, 0, 20,128, 3, 0, 0, /* 0x 130 */
|
||||||
75,255,255,185, 47,133, 0, 0, 65,158, 0, 28,124,169, 3,166, /* 0x 140 */
|
129, 35, 0, 4,127,128, 40, 64, 64,188, 0, 12, 56, 96, 0,127, /* 0x 140 */
|
||||||
136, 9, 0, 0, 57, 41, 0, 1,152, 4, 0, 0, 56,132, 0, 1, /* 0x 150 */
|
75,255,255,185, 47,133, 0, 0, 65,158, 0, 28,124,169, 3,166, /* 0x 150 */
|
||||||
66, 0,255,240,128, 3, 0, 0,129, 35, 0, 4,124, 5, 0, 80, /* 0x 160 */
|
136, 9, 0, 0, 57, 41, 0, 1,152, 4, 0, 0, 56,132, 0, 1, /* 0x 160 */
|
||||||
144, 3, 0, 0,125, 41, 42, 20,128, 1, 0, 20, 56, 33, 0, 16, /* 0x 170 */
|
66, 0,255,240,128, 3, 0, 0,129, 35, 0, 4,124, 5, 0, 80, /* 0x 170 */
|
||||||
145, 35, 0, 4,124, 8, 3,166, 78,128, 0, 32,124, 8, 2,166, /* 0x 180 */
|
144, 3, 0, 0,125, 41, 42, 20,128, 1, 0, 20, 56, 33, 0, 16, /* 0x 180 */
|
||||||
148, 33,255,192,191,129, 0, 48,124,159, 35,120,124,126, 27,120, /* 0x 190 */
|
145, 35, 0, 4,124, 8, 3,166, 78,128, 0, 32,124, 8, 2,166, /* 0x 190 */
|
||||||
124,188, 43,120,144, 1, 0, 68,124,221, 51,120,128, 4, 0, 0, /* 0x 1a0 */
|
148, 33,255,192,191,129, 0, 48,124,159, 35,120,124,126, 27,120, /* 0x 1a0 */
|
||||||
47,128, 0, 0, 65,158, 1, 32, 56,160, 0, 12,127,195,243,120, /* 0x 1b0 */
|
124,188, 43,120,144, 1, 0, 68,124,221, 51,120,128, 4, 0, 0, /* 0x 1b0 */
|
||||||
56,129, 0, 16, 75,255,255, 93,129, 33, 0, 16,128,161, 0, 20, /* 0x 1c0 */
|
47,128, 0, 0, 65,158, 1, 32, 56,160, 0, 12,127,195,243,120, /* 0x 1c0 */
|
||||||
47,137, 0, 0, 64,190, 0, 36, 60, 0, 33, 88, 96, 0, 80, 85, /* 0x 1d0 */
|
56,129, 0, 16, 75,255,255, 93,129, 33, 0, 16,128,161, 0, 20, /* 0x 1d0 */
|
||||||
127,133, 0, 0, 64,190, 0, 28,128, 30, 0, 0, 47,128, 0, 0, /* 0x 1e0 */
|
47,137, 0, 0, 64,190, 0, 36, 60, 0, 33, 88, 96, 0, 80, 85, /* 0x 1e0 */
|
||||||
65,190, 0,228, 72, 0, 0, 12, 47,133, 0, 0, 64,190, 0, 12, /* 0x 1f0 */
|
127,133, 0, 0, 64,190, 0, 28,128, 30, 0, 0, 47,128, 0, 0, /* 0x 1f0 */
|
||||||
56, 96, 0,127, 75,255,254,245,127, 5, 72, 64, 65,185,255,244, /* 0x 200 */
|
65,190, 0,228, 72, 0, 0, 12, 47,133, 0, 0, 64,190, 0, 12, /* 0x 200 */
|
||||||
128, 31, 0, 0,127,137, 0, 64, 65,189,255,232,128, 31, 0, 4, /* 0x 210 */
|
56, 96, 0,127, 75,255,254,245,127, 5, 72, 64, 65,185,255,244, /* 0x 210 */
|
||||||
64,152, 0,132,124,164, 43,120,128,126, 0, 4,124, 5, 3,120, /* 0x 220 */
|
128, 31, 0, 0,127,137, 0, 64, 65,189,255,232,128, 31, 0, 4, /* 0x 220 */
|
||||||
56,193, 0, 32,136,225, 0, 24,127,136, 3,166, 78,128, 0, 33, /* 0x 230 */
|
64,152, 0,132,124,164, 43,120,128,126, 0, 4,124, 5, 3,120, /* 0x 230 */
|
||||||
47,131, 0, 0, 64,190,255,188,128,129, 0, 32,128, 1, 0, 16, /* 0x 240 */
|
56,193, 0, 32,136,225, 0, 24,127,136, 3,166, 78,128, 0, 33, /* 0x 240 */
|
||||||
127,132, 0, 0, 64,190,255,172,136,193, 0, 25, 49, 61,255,255, /* 0x 250 */
|
47,131, 0, 0, 64,190,255,188,128,129, 0, 32,128, 1, 0, 16, /* 0x 250 */
|
||||||
124, 9,233, 16,125, 38, 0,208, 85, 41, 15,254,125, 43, 0, 57, /* 0x 260 */
|
127,132, 0, 0, 64,190,255,172,136,193, 0, 25, 49, 61,255,255, /* 0x 260 */
|
||||||
65,162, 0, 20,128,127, 0, 4,127,168, 3,166,136,161, 0, 26, /* 0x 270 */
|
124, 9,233, 16,125, 38, 0,208, 85, 41, 15,254,125, 43, 0, 57, /* 0x 270 */
|
||||||
78,128, 0, 33,129, 97, 0, 20,128, 30, 0, 4,129, 62, 0, 0, /* 0x 280 */
|
65,162, 0, 20,128,127, 0, 4,127,168, 3,166,136,161, 0, 26, /* 0x 280 */
|
||||||
124, 0, 90, 20,125, 43, 72, 80,144, 30, 0, 4,145, 62, 0, 0, /* 0x 290 */
|
78,128, 0, 33,128, 30, 0, 4,129, 97, 0, 20,129, 62, 0, 0, /* 0x 290 */
|
||||||
72, 0, 0, 16,124, 4, 3,120,127,195,243,120, 75,255,254,117, /* 0x 2a0 */
|
124, 0, 90, 20,125, 43, 72, 80,144, 30, 0, 4,145, 62, 0, 0, /* 0x 2a0 */
|
||||||
129, 97, 0, 16,129, 63, 0, 0,128, 31, 0, 4,125, 43, 72, 80, /* 0x 2b0 */
|
72, 0, 0, 16,124, 4, 3,120,127,195,243,120, 75,255,254,117, /* 0x 2b0 */
|
||||||
47,137, 0, 0,124, 0, 90, 20,144, 31, 0, 4,145, 63, 0, 0, /* 0x 2c0 */
|
129, 97, 0, 16,129, 63, 0, 0,128, 31, 0, 4,125, 43, 72, 80, /* 0x 2c0 */
|
||||||
75,255,254,228,128, 1, 0, 68,187,129, 0, 48, 56, 33, 0, 64, /* 0x 2d0 */
|
47,137, 0, 0,124, 0, 90, 20,144, 31, 0, 4,145, 63, 0, 0, /* 0x 2d0 */
|
||||||
124, 8, 3,166, 78,128, 0, 32,124, 8, 2,166,148, 33,255,176, /* 0x 2e0 */
|
75,255,254,228,128, 1, 0, 68,187,129, 0, 48, 56, 33, 0, 64, /* 0x 2e0 */
|
||||||
190, 97, 0, 28,125,128, 0, 38, 58,224, 0, 0,124,122, 27,120, /* 0x 2f0 */
|
124, 8, 3,166, 78,128, 0, 32,124, 8, 2,166,148, 33,255,176, /* 0x 2f0 */
|
||||||
144, 1, 0, 84,124,155, 35,120,128, 3, 0, 16,124,179, 43,120, /* 0x 300 */
|
190, 65, 0, 24,125,128, 0, 38, 58,224, 0, 0,124,122, 27,120, /* 0x 300 */
|
||||||
145,129, 0, 24,124,212, 51,120,127,151, 0, 64,124,245, 59,120, /* 0x 310 */
|
144, 1, 0, 84,124,146, 35,120,128, 3, 0, 16,124,187, 43,120, /* 0x 310 */
|
||||||
125, 22, 67,120, 59,195, 0, 28, 59, 0, 0, 0, 64,156, 1,124, /* 0x 320 */
|
145,129, 0, 20,124,211, 51,120,127,151, 0, 64,124,244, 59,120, /* 0x 320 */
|
||||||
129, 62, 0, 0, 47,137, 0, 1, 64,190, 1, 48,129, 62, 0, 24, /* 0x 330 */
|
125, 21, 67,120,125, 54, 75,120, 59,195, 0, 28, 59, 0, 0, 0, /* 0x 330 */
|
||||||
129,126, 0, 36, 85, 61, 5, 62,128, 30, 0, 28,127,139,234, 20, /* 0x 340 */
|
64,156, 1,124,129, 62, 0, 0, 47,137, 0, 1, 64,190, 1, 48, /* 0x 340 */
|
||||||
145, 97, 0, 8, 46, 28, 0, 0,127, 41, 2, 20,145, 33, 0, 12, /* 0x 350 */
|
129, 62, 0, 24,129,126, 0, 36, 85, 61, 5, 62,128, 30, 0, 28, /* 0x 350 */
|
||||||
127,253, 72, 80, 65,146, 0, 72, 47,155, 0, 0, 64,190, 0, 16, /* 0x 360 */
|
127,139,234, 20,145, 97, 0, 8, 46, 28, 0, 0,127, 41, 2, 20, /* 0x 360 */
|
||||||
47,139, 0, 0, 56,192, 0, 18, 64,158, 0, 8, 56,192, 16, 18, /* 0x 370 */
|
145, 33, 0, 12,127,253, 72, 80, 65,146, 0, 76, 47,155, 0, 0, /* 0x 370 */
|
||||||
47,139, 0, 0,126,103,155,120, 64,158, 0, 8, 56,224,255,255, /* 0x 380 */
|
64,190, 0, 16, 47,139, 0, 0, 56,192, 0, 18, 64,158, 0, 8, /* 0x 380 */
|
||||||
129, 30, 0, 32,127,227,251,120,127,132,227,120, 56,160, 0, 3, /* 0x 390 */
|
56,192, 16, 18, 47,139, 0, 0,126,103,155,120, 64,158, 0, 8, /* 0x 390 */
|
||||||
75,255,253, 65,127,159, 24, 0, 64,158, 0,128, 47,155, 0, 0, /* 0x 3a0 */
|
56,224,255,255,129, 30, 0, 32,127,227,251,120,127,132,227,120, /* 0x 3a0 */
|
||||||
65,158, 0, 52,128, 30, 0, 36, 47,128, 0, 0, 65,158, 0, 40, /* 0x 3b0 */
|
56,160, 0, 3,125, 8,146, 20, 75,255,253, 57,127,159, 24, 0, /* 0x 3b0 */
|
||||||
128, 30, 0, 32, 47,128, 0, 0, 64,158, 0, 8,147,244, 0, 0, /* 0x 3c0 */
|
64,158, 0,124, 47,155, 0, 0, 65,158, 0, 52,128, 30, 0, 36, /* 0x 3c0 */
|
||||||
127, 99,219,120, 56,129, 0, 8,126,165,171,120,126,198,179,120, /* 0x 3d0 */
|
47,128, 0, 0, 65,158, 0, 40,128, 30, 0, 32, 47,128, 0, 0, /* 0x 3d0 */
|
||||||
75,255,253,173,124, 28, 0,208,125, 63,226, 20,112, 29, 15,255, /* 0x 3e0 */
|
64,158, 0, 8,147,244, 0, 0,127, 99,219,120, 56,129, 0, 8, /* 0x 3e0 */
|
||||||
65,130, 0, 24,127,169, 3,166, 56, 0, 0, 0,152, 9, 0, 0, /* 0x 3f0 */
|
126,165,171,120,126,198,179,120, 75,255,253,165,124, 28, 0,208, /* 0x 3f0 */
|
||||||
57, 41, 0, 1, 66, 0,255,248, 65,178, 0, 40,128,190, 0, 44, /* 0x 400 */
|
125, 63,226, 20,112, 29, 15,255, 65,130, 0, 24,127,169, 3,166, /* 0x 400 */
|
||||||
127,227,251,120,127,132,227,120, 76,198, 49,130, 75,255,252,253, /* 0x 410 */
|
56, 0, 0, 0,152, 9, 0, 0, 57, 41, 0, 1, 66, 0,255,248, /* 0x 410 */
|
||||||
47,131, 0, 0, 65,190, 0, 12, 56, 96, 0,127, 75,255,252,205, /* 0x 420 */
|
65,178, 0, 36,128,190, 0, 44,127,227,251,120,127,132,227,120, /* 0x 420 */
|
||||||
124, 28,234, 20,127,255, 2, 20,127,159,200, 64, 64,188, 0, 84, /* 0x 430 */
|
75,255,252,249, 47,131, 0, 0, 65,190, 0, 12, 56, 96, 0,127, /* 0x 430 */
|
||||||
128,190, 0, 44,124,159,200, 80,127,227,251,120, 56,192, 16, 18, /* 0x 440 */
|
75,255,252,201,124, 28,234, 20,127,255, 2, 20,127,159,200, 64, /* 0x 440 */
|
||||||
56,224,255,255, 57, 0, 0, 0, 75,255,252,137,127,159, 24, 0, /* 0x 450 */
|
64,188, 0, 84,128,190, 0, 44,124,159,200, 80,127,227,251,120, /* 0x 450 */
|
||||||
65,190, 0, 48, 75,255,255,196, 56, 9,255,252, 43,128, 0, 1, /* 0x 460 */
|
56,192, 16, 18, 56,224,255,255, 57, 0, 0, 0, 75,255,252,133, /* 0x 460 */
|
||||||
65,157, 0, 32,128, 30, 0, 8, 47,128, 0, 1, 64,190, 0, 20, /* 0x 470 */
|
127,159, 24, 0, 65,190, 0, 48, 75,255,255,196, 56, 9,255,252, /* 0x 470 */
|
||||||
128, 30, 0, 12, 47,128, 0, 40, 64,190, 0, 8, 58,254, 0, 16, /* 0x 480 */
|
43,128, 0, 1, 65,157, 0, 32,128, 30, 0, 8, 47,128, 0, 1, /* 0x 480 */
|
||||||
128, 26, 0, 16, 59, 24, 0, 1,127,152, 0, 64,128, 30, 0, 4, /* 0x 490 */
|
64,190, 0, 20,128, 30, 0, 12, 47,128, 0, 40, 64,190, 0, 8, /* 0x 490 */
|
||||||
127,222, 2, 20, 75,255,254,136,128, 1, 0, 84,126,227,187,120, /* 0x 4a0 */
|
58,254, 0, 16,128, 26, 0, 16, 59, 24, 0, 1,127,152, 0, 64, /* 0x 4a0 */
|
||||||
129,129, 0, 24,186, 97, 0, 28,124, 8, 3,166, 56, 33, 0, 80, /* 0x 4b0 */
|
128, 30, 0, 4,127,222, 2, 20, 75,255,254,136,128, 1, 0, 84, /* 0x 4b0 */
|
||||||
125,128,129, 32, 78,128, 0, 32,148, 33,255,192,124, 8, 2,166, /* 0x 4c0 */
|
126,227,187,120,129,129, 0, 20,186, 65, 0, 24,124, 8, 3,166, /* 0x 4c0 */
|
||||||
144,129, 0, 8,191, 65, 0, 40,129, 97, 0, 8,124,191, 43,120, /* 0x 4d0 */
|
56, 33, 0, 80,125,128,129, 32, 78,128, 0, 32,148, 33,255,192, /* 0x 4d0 */
|
||||||
144, 1, 0, 68, 56, 3, 0, 24, 57,107,255,232,144, 1, 0, 20, /* 0x 4e0 */
|
124, 8, 2,166,144,129, 0, 8,191, 97, 0, 44,129, 97, 0, 8, /* 0x 4e0 */
|
||||||
145, 97, 0, 16,124,253, 59,120,128, 3, 0, 24,125, 60, 75,120, /* 0x 4f0 */
|
124,191, 43,120,144, 1, 0, 68, 56, 3, 0, 24, 57,107,255,232, /* 0x 4f0 */
|
||||||
200, 1, 0, 16,125, 27, 67,120,124,229, 59,120, 56, 97, 0, 16, /* 0x 500 */
|
144, 1, 0, 20,145, 97, 0, 16,125, 27, 67,120,128, 3, 0, 24, /* 0x 500 */
|
||||||
56,129, 0, 24,124,218, 51,120, 56,192, 0, 0,144, 1, 0, 24, /* 0x 510 */
|
125, 60, 75,120,200, 1, 0, 16,124,253, 59,120,124,229, 59,120, /* 0x 510 */
|
||||||
216, 1, 0, 32, 59,192, 0, 0,147,225, 0, 28, 75,255,252, 97, /* 0x 520 */
|
56, 97, 0, 16, 56,129, 0, 24,124,222, 51,120, 56,192, 0, 0, /* 0x 520 */
|
||||||
127,167,235,120,127,104,219,120,127,227,251,120,127,134,227,120, /* 0x 530 */
|
144, 1, 0, 24,216, 1, 0, 32,147,225, 0, 28, 75,255,252, 97, /* 0x 530 */
|
||||||
56,129, 0, 32, 56,160,255,255, 75,255,253,161,128, 31, 0, 16, /* 0x 540 */
|
127,105,219,120,127,135,227,120,127,227,251,120,127,168,235,120, /* 0x 540 */
|
||||||
124,123, 27,120, 59,191, 0, 28,127,158, 0, 64, 64,156, 0,148, /* 0x 550 */
|
56,128, 0, 0, 56,161, 0, 32, 56,192,255,255, 59, 96, 0, 0, /* 0x 550 */
|
||||||
128, 29, 0, 0, 59,222, 0, 1, 56,128, 0, 0, 56,160, 0, 0, /* 0x 560 */
|
75,255,253,153,129, 95, 0, 16, 57, 96, 0, 0,124,124, 27,120, /* 0x 560 */
|
||||||
47,128, 0, 14, 64,190, 0,104,128,125, 0, 8,124,125, 26, 20, /* 0x 570 */
|
127,139, 80, 64, 57, 63, 0, 28, 64,156, 0,224,128, 9, 0, 0, /* 0x 570 */
|
||||||
76,198, 49,130, 75,255,251,133,127,228,251,120,124,124, 27,121, /* 0x 580 */
|
57,107, 0, 1,127, 11, 80, 64, 47,128, 0, 14, 64,190, 0,192, /* 0x 580 */
|
||||||
127, 69,211,120, 65,128, 0, 44, 76,198, 49,130, 75,255,251,101, /* 0x 590 */
|
128,105, 0, 8, 56,128, 0, 0, 56,160, 0, 0,124,105, 26, 20, /* 0x 590 */
|
||||||
56,128, 0, 0,127,154, 24, 0,127,133,227,120,127,227,251,120, /* 0x 5a0 */
|
75,255,251,121,124,125, 27,121, 65,128, 0, 32,127,163,235,120, /* 0x 5a0 */
|
||||||
56,192, 0, 0, 56,224, 0, 0, 57, 0, 0, 0, 65,190, 0, 12, /* 0x 5b0 */
|
127,228,251,120,127,197,243,120,127,102,219,120, 75,255,251, 37, /* 0x 5b0 */
|
||||||
56, 96, 0,127, 75,255,251, 53, 75,255,253, 33,124,123, 27,120, /* 0x 5c0 */
|
127,158, 24, 0, 65,190, 0, 20, 56, 96, 0,127, 75,255,251, 61, /* 0x 5c0 */
|
||||||
127,131,227,120, 76,198, 49,130, 75,255,251, 57,128, 31, 0, 16, /* 0x 5d0 */
|
131,105, 0, 8, 75,255,255,216,128, 31, 0, 0, 61, 32,202,254, /* 0x 5d0 */
|
||||||
129, 61, 0, 4,127,158, 0, 64,127,189, 74, 20, 75,255,255,112, /* 0x 5e0 */
|
97, 41,186,190,127,128, 72, 0, 64,158, 0, 52,129, 95, 0, 4, /* 0x 5e0 */
|
||||||
128, 1, 0, 68,127, 99,219,120,187, 65, 0, 40, 56, 33, 0, 64, /* 0x 5f0 */
|
57, 96, 0, 0, 57, 63, 0, 8,127,139, 80, 64, 64,156, 0, 32, /* 0x 5f0 */
|
||||||
124, 8, 3,166, 78,128, 0, 32 /* 0x 600 */
|
128, 9, 0, 0, 57,107, 0, 1,127, 11, 80, 64, 47,128, 0, 18, /* 0x 600 */
|
||||||
|
65,190,255,192, 57, 41, 0, 20, 65,152,255,232,127,227,251,120, /* 0x 610 */
|
||||||
|
127,100,219,120, 56,160, 0, 0,127,166,235,120, 56,224, 0, 0, /* 0x 620 */
|
||||||
|
57, 0, 0, 0, 57, 32, 0, 0, 75,255,252,193,124,124, 27,120, /* 0x 630 */
|
||||||
|
127,163,235,120, 75,255,250,221, 72, 0, 0, 16,128, 9, 0, 4, /* 0x 640 */
|
||||||
|
125, 41, 2, 20, 65,152,255, 40,128, 1, 0, 68,127,131,227,120, /* 0x 650 */
|
||||||
|
187, 97, 0, 44, 56, 33, 0, 64,124, 8, 3,166, 78,128, 0, 32 /* 0x 660 */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -115,5 +115,17 @@ EXTERN pti_main
|
|||||||
sub edi,edi
|
sub edi,edi
|
||||||
ret ; goto entry point
|
ret ; goto entry point
|
||||||
|
|
||||||
|
%define __NR_mmap 90
|
||||||
|
|
||||||
|
global mmap
|
||||||
|
mmap:
|
||||||
|
push ebx
|
||||||
|
lea ebx, [2*4 + esp]
|
||||||
|
push byte __NR_mmap
|
||||||
|
pop eax
|
||||||
|
int 0x80
|
||||||
|
pop ebx
|
||||||
|
ret
|
||||||
|
|
||||||
; vi:ts=8:et:nowrap
|
; vi:ts=8:et:nowrap
|
||||||
|
|
||||||
|
|||||||
+91
-92
@@ -1,4 +1,4 @@
|
|||||||
/* fold_pti86.h -- created from fold_pti86.bin, 1552 (0x610) bytes
|
/* fold_pti86.h -- created from fold_pti86.bin, 1531 (0x5fb) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,106 +27,105 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define LINUX_I386PTI_FOLD_SIZE 1552
|
#define LINUX_I386PTI_FOLD_SIZE 1531
|
||||||
#define LINUX_I386PTI_FOLD_ADLER32 0x7ae39f1d
|
#define LINUX_I386PTI_FOLD_ADLER32 0x90e59978
|
||||||
#define LINUX_I386PTI_FOLD_CRC32 0x67ccdc9d
|
#define LINUX_I386PTI_FOLD_CRC32 0xdd8fa001
|
||||||
|
|
||||||
unsigned char linux_i386pti_fold[1552] = {
|
unsigned char linux_i386pti_fold[1531] = {
|
||||||
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
||||||
2, 0, 3, 0, 1, 0, 0, 0,128, 0, 1, 0, 52, 0, 0, 0, /* 0x 10 */
|
2, 0, 3, 0, 1, 0, 0, 0,128, 0, 1, 0, 52, 0, 0, 0, /* 0x 10 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
|
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
|
||||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, /* 0x 30 */
|
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, /* 0x 30 */
|
||||||
0, 0, 1, 0, 16, 6, 0, 0, 16, 6, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
0, 0, 1, 0,251, 5, 0, 0,252, 5, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||||
0, 16, 0, 0, 1, 0, 0, 0, 16, 6, 0, 0, 16, 6, 1, 0, /* 0x 50 */
|
0, 16, 0, 0, 1, 0, 0, 0,251, 5, 0, 0,252, 5, 1, 0, /* 0x 50 */
|
||||||
16, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
|
252, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
|
||||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||||
93, 89, 88,141,124,132, 4, 80, 41,192,175,117,253,175,137,254, /* 0x 80 */
|
93, 89, 88,141,124,132, 4, 80, 41,192,175,117,253,175,137,254, /* 0x 80 */
|
||||||
139, 6,131,248, 3,116, 8,131,198, 8,131,248, 0,117,241,139, /* 0x 90 */
|
139, 6,131,248, 3,116, 8,131,198, 8,131,248, 0,117,241,139, /* 0x 90 */
|
||||||
94, 4, 83,129,236, 0, 10, 0, 0,137,226, 81,141, 67, 88,139, /* 0x a0 */
|
94, 4, 83,129,236, 0, 10, 0, 0,137,226, 81,141, 67, 88,139, /* 0x a0 */
|
||||||
115, 24, 41,198,139, 24,139, 72, 4,131,193, 12, 96,232, 86, 4, /* 0x b0 */
|
115, 24, 41,198,139, 24,139, 72, 4,131,193, 12, 96,232, 62, 4, /* 0x b0 */
|
||||||
0, 0,129,196, 36, 10, 0, 0, 91, 80,139, 75, 20,139, 91, 8, /* 0x c0 */
|
0, 0,129,196, 36, 10, 0, 0, 91, 80,139, 75, 20,139, 91, 8, /* 0x c0 */
|
||||||
184, 91, 0, 0, 0,205,128, 41,192, 41,201, 41,210, 41,219, 41, /* 0x d0 */
|
184, 91, 0, 0, 0,205,128, 41,192, 41,201, 41,210, 41,219, 41, /* 0x d0 */
|
||||||
237, 41,246, 41,255,195, 0, 0, 85, 87,137,207, 86,137,198, 83, /* 0x e0 */
|
237, 41,246, 41,255,195, 83,141, 92, 36, 8,106, 90, 88,205,128, /* 0x e0 */
|
||||||
57, 8,139,104, 4,115, 8,106,127, 91,106, 1, 88,205,128,133, /* 0x f0 */
|
91,195, 0, 0, 87, 86,137,206, 83,137,195, 57, 8,139,120, 4, /* 0x f0 */
|
||||||
255,116, 11,137,249,138, 69, 0, 69,136, 2, 66,226,247, 91, 1, /* 0x 100 */
|
115, 10,106,127, 91,106, 1, 88,205,128,235,254,133,201,116, 8, /* 0x 100 */
|
||||||
126, 4, 41, 62, 94, 95, 93,195, 83,141, 92, 36, 8,106, 90, 88, /* 0x 110 */
|
138, 7, 71,136, 2, 66,226,248, 1,115, 4, 41, 51, 91, 94, 95, /* 0x 110 */
|
||||||
205,128, 91,195, 85,137,229, 87, 86,137,199, 83,137,214,131,236, /* 0x 120 */
|
195, 85,137,229, 87, 86,137,198, 83,137,211,131,236, 20,139,125, /* 0x 120 */
|
||||||
20,131, 58, 0, 15,132,188, 0, 0, 0,141, 85,228,137,248,185, /* 0x 130 */
|
12,131, 58, 0, 15,132,185, 0, 0, 0,141, 85,228,185, 12, 0, /* 0x 130 */
|
||||||
12, 0, 0, 0,232,159,255,255,255,131,125,228, 0,139, 69,232, /* 0x 140 */
|
0, 0,137,240,232,171,255,255,255,139, 69,228,139, 77,232,133, /* 0x 140 */
|
||||||
117, 18, 61, 85, 80, 88, 33,117, 15,131, 63, 0, 15,132,148, 0, /* 0x 150 */
|
192,117, 19,129,249, 85, 80, 88, 33,117, 15,131, 62, 0, 15,132, /* 0x 150 */
|
||||||
0, 0,235, 4,133,192,117, 8,106,127, 91,106, 1, 88,205,128, /* 0x 160 */
|
143, 0, 0, 0,235, 4,133,201,117, 10,106,127, 91,106, 1, 88, /* 0x 160 */
|
||||||
139, 77,232,139, 69,228, 57,193,119,238, 59, 6,119,234, 57,193, /* 0x 170 */
|
205,128,235,254, 57,193,119,242, 59, 3,119,238, 57,193,115, 86, /* 0x 170 */
|
||||||
115, 87, 15,182, 69,236, 80,255, 85, 8, 15,182, 85,236,137, 20, /* 0x 180 */
|
15,182, 69,236, 80,255, 85, 8, 15,182, 85,236,137, 20, 36,141, /* 0x 180 */
|
||||||
36,141, 85,224, 82,255,118, 4,255,117,232,255,119, 4,255, 16, /* 0x 190 */
|
85,224, 82,255,115, 4,255,117,232,255,118, 4,255, 16,131,196, /* 0x 190 */
|
||||||
131,196, 20,133,192,117,193,139, 69,228, 57, 69,224,117,185,138, /* 0x 1a0 */
|
20,133,192,117,197,139, 69,228, 57, 69,224,117,189,138, 69,237, /* 0x 1a0 */
|
||||||
69,237,132,192,116, 25, 15,182,192, 80,255, 85, 12, 15,182, 85, /* 0x 1b0 */
|
132,192,116, 24, 15,182,192, 80,255,215, 15,182, 85,238,137, 20, /* 0x 1b0 */
|
||||||
238,137, 20, 36,255,117,224,255,118, 4,255, 16,131,196, 12,139, /* 0x 1c0 */
|
36,255,117,224,255,115, 4,255, 16,131,196, 12,139, 69,232, 1, /* 0x 1c0 */
|
||||||
69,232, 1, 71, 4, 41, 7,235, 10,139, 86, 4,137,248,232, 5, /* 0x 1d0 */
|
70, 4, 41, 6,235, 10,139, 83, 4,137,240,232, 20,255,255,255, /* 0x 1d0 */
|
||||||
255,255,255,139, 85,228,139, 6, 1, 86, 4, 41,208,133,192,137, /* 0x 1e0 */
|
139, 85,228,139, 3, 1, 83, 4, 41,208,133,192,137, 3,233, 65, /* 0x 1e0 */
|
||||||
6,233, 62,255,255,255,141,101,244, 91, 94, 95,201,195,133,210, /* 0x 1f0 */
|
255,255,255,141,101,244, 91, 94, 95,201,195,133,210,137,209,116, /* 0x 1f0 */
|
||||||
137,209,116, 6,198, 0, 0, 64,226,250,195,133,192, 83,137,211, /* 0x 200 */
|
6,198, 0, 0, 64,226,250,195,133,192, 83,137,211,116, 29,168, /* 0x 200 */
|
||||||
116, 29,168, 1,117, 25,139, 16, 57,218,116, 7, 74,117, 11,133, /* 0x 210 */
|
1,117, 25,139, 16, 57,218,116, 7, 74,117, 11,133,219,116, 7, /* 0x 210 */
|
||||||
219,116, 7,137, 24,137, 72, 4,235, 5,131,192, 8,235,231, 91, /* 0x 220 */
|
137, 24,137, 72, 4,235, 5,131,192, 8,235,231, 91,195, 85,137, /* 0x 220 */
|
||||||
195, 85,137,229, 87, 86, 83,131,236, 76,137, 69,228,139, 69, 8, /* 0x 230 */
|
229, 87, 86, 83,131,236, 84,137, 69,228,139, 69, 8,137, 85,224, /* 0x 230 */
|
||||||
137, 85,224,139, 77, 16,199, 69,204, 0, 0, 0, 0,137, 69,220, /* 0x 240 */
|
139, 77, 16,137, 69,220, 3, 64, 28,139, 93,220,137, 77,212,139, /* 0x 240 */
|
||||||
3, 64, 28,139, 93,220,137, 77,212,139, 85, 12,137, 69,208, 49, /* 0x 250 */
|
85, 12,137, 69,208, 49,192,102,131,123, 16, 3,137, 85,216, 15, /* 0x 250 */
|
||||||
192,102,131,123, 16, 3,137, 85,216, 15,183, 75, 44,139, 85,208, /* 0x 260 */
|
183, 75, 44,139, 85,208, 15,149,192,131,206,255,193,224, 4,131, /* 0x 260 */
|
||||||
15,149,192,131,206,255,193,224, 4,137,207,131,192, 34, 49,219, /* 0x 270 */
|
192, 34, 49,219,137, 69,184,137,200, 49,255, 72,120, 31,131, 58, /* 0x 270 */
|
||||||
79,137, 69,184,120, 34,131, 58, 1,117, 24,139, 66, 8, 57,240, /* 0x 280 */
|
1,117, 21,139, 66, 8, 57,240,115, 5,137,198,139,122, 16, 3, /* 0x 280 */
|
||||||
115, 8,139,122, 16,137,198,137,125,204, 3, 66, 20, 57,195,115, /* 0x 290 */
|
66, 20, 57,195,115, 2,137,195,131,194, 32,226,225,137,240,129, /* 0x 290 */
|
||||||
2,137,195,131,194, 32,226,222,137,247,106, 0,129,231, 0,240, /* 0x 2a0 */
|
230, 0,240,255,255,106, 0, 41,243,106, 0, 37,255, 15, 0, 0, /* 0x 2a0 */
|
||||||
255,255,106, 0, 41,251,255,117,184,129,195,255, 15, 0, 0,106, /* 0x 2b0 */
|
137,117,188,141,179,255, 15, 0, 0,255,117,184,129,230, 0,240, /* 0x 2b0 */
|
||||||
7,129,227, 0,240,255,255,139, 85,204, 83,137,240, 37,255, 15, /* 0x 2c0 */
|
255,255,106, 7, 86,255,117,188,141,188, 7,255, 15, 0, 0,232, /* 0x 2c0 */
|
||||||
0, 0, 87,137, 93,168,141,180, 2,255, 15, 0, 0,232, 54,254, /* 0x 2d0 */
|
18,254,255,255,129,231, 0,240,255,255,137,194,137,195, 1,242, /* 0x 2d0 */
|
||||||
255,255,137,194,131,196, 24, 1,218,129,230, 0,240,255,255,137, /* 0x 2e0 */
|
41,254,131,196, 24,137, 69,172,137, 85,240, 1,251,137,241,106, /* 0x 2e0 */
|
||||||
85,240,137,194, 41,243, 1,242,137,217,137, 69,172,137,211,106, /* 0x 2f0 */
|
91, 88,205,128,139, 69,220,199, 69,196, 0, 0, 0, 0,139, 93, /* 0x 2f0 */
|
||||||
91, 88,205,128,139,117,172,139, 69,220, 41,254, 49,255,102,131, /* 0x 300 */
|
172, 43, 93,188,102,131,120, 44, 0,137, 93,204, 15,132,180, 1, /* 0x 300 */
|
||||||
120, 44, 0, 15,132,198, 1, 0, 0,139, 85,208,139, 2,131,248, /* 0x 310 */
|
0, 0,139, 85,208,139, 2,131,248, 6,117, 24,139, 77,204, 3, /* 0x 310 */
|
||||||
6,117, 23,139, 74, 8,186, 3, 0, 0, 0,139, 69,212, 1,241, /* 0x 320 */
|
74, 8,186, 3, 0, 0, 0,139, 69,212,232,217,254,255,255,233, /* 0x 320 */
|
||||||
232,214,254,255,255,233,145, 1, 0, 0, 72, 15,133,138, 1, 0, /* 0x 330 */
|
123, 1, 0, 0, 72, 15,133,116, 1, 0, 0,139, 93,208,199, 69, /* 0x 330 */
|
||||||
0,139, 93,208,199, 69,196, 64, 98, 81,115,139, 75, 24,139, 67, /* 0x 340 */
|
192, 64, 98, 81,115,139, 75, 24,139, 67, 8,131,225, 7,139, 83, /* 0x 340 */
|
||||||
8,131,225, 7,139, 83, 16,193,225, 2,137, 69,236,211,109,196, /* 0x 350 */
|
16,193,225, 2,137, 69,236,211,109,192,137,193, 3, 75, 20,137, /* 0x 350 */
|
||||||
137,193, 3, 75, 20,137,195,129,227,255, 15, 0, 0,137, 85,232, /* 0x 360 */
|
195,129,227,255, 15, 0, 0,137, 85,232,141, 60, 26,139, 85,204, /* 0x 360 */
|
||||||
1,218, 41,216,137, 85,192,139, 85,208, 1,240, 1,241,137, 69, /* 0x 370 */
|
41,216,131,101,192, 7, 1,209,141, 52, 16,137, 77,176,139, 77, /* 0x 370 */
|
||||||
180,139, 66, 4,131,101,196, 7, 41,216,131,125,216, 1, 80,255, /* 0x 380 */
|
208,139, 65, 4, 41,216,131,125,216, 1, 80,255,117,228, 25,192, /* 0x 380 */
|
||||||
117,228, 25,192,137, 93,188,131,224,224,137, 77,176,131,192, 50, /* 0x 390 */
|
131,224,224,131,192, 50,131,125,216, 0, 80,137,248,106, 3,116, /* 0x 390 */
|
||||||
131,125,216, 0, 80,139, 69,192,106, 3,116, 3,131,192, 3, 80, /* 0x 3a0 */
|
3,141, 71, 3, 80, 86,232, 59,253,255,255,131,196, 24, 57,198, /* 0x 3a0 */
|
||||||
255,117,180,232, 96,253,255,255,131,196, 24, 57, 69,180, 15,133, /* 0x 3b0 */
|
15,133,170, 0, 0, 0,131,125,216, 0,116, 19,255,117,224,255, /* 0x 3b0 */
|
||||||
173, 0, 0, 0,131,125,216, 0,116, 19,255,117,224,255,117,228, /* 0x 3c0 */
|
117,228,141, 85,232,139, 69,216,232, 84,253,255,255, 88, 90,137, /* 0x 3c0 */
|
||||||
141, 85,232,139, 69,216,232, 73,253,255,255, 88, 90,139, 85,188, /* 0x 3d0 */
|
218,137,251,137,240,247,219,232, 31,254,255,255,129,227,255, 15, /* 0x 3d0 */
|
||||||
139, 69,180,232, 22,254,255,255,139, 77,192,139, 69,180,247,217, /* 0x 3e0 */
|
0, 0,141, 4, 62,137,218,137, 93,180,232, 12,254,255,255,131, /* 0x 3e0 */
|
||||||
3, 69,192,129,225,255, 15, 0, 0,137,202,137, 77,188,232,251, /* 0x 3f0 */
|
125,216, 0,116, 91,139, 69,208,131, 56, 1,117, 83,246, 64, 24, /* 0x 3f0 */
|
||||||
253,255,255,131,125,216, 0,116, 86,139, 93,208,131, 59, 1,117, /* 0x 400 */
|
1,116, 77,139, 93,208,137,194,139, 64, 20, 59, 67, 16,139, 82, /* 0x 400 */
|
||||||
78,246, 67, 24, 1,116, 72,139, 67, 20, 59, 67, 16,139, 83, 8, /* 0x 410 */
|
8,141, 12, 16,117, 14,137,200,247,216, 37,255, 15, 0, 0,131, /* 0x 410 */
|
||||||
141, 12, 16,117, 14,137,200,247,216, 37,255, 15, 0, 0,131,248, /* 0x 420 */
|
248, 3,119, 12,139, 69,208,141, 74, 12,131,120, 4, 0,117, 15, /* 0x 420 */
|
||||||
3,119, 12,139, 69,208,141, 74, 12,131,120, 4, 0,117, 15,139, /* 0x 430 */
|
139, 1, 61,205,128, 97,195,116, 6,199, 1,205,128, 97,195,133, /* 0x 430 */
|
||||||
1, 61,205,128, 97,195,116, 6,199, 1,205,128, 97,195,133,201, /* 0x 440 */
|
201,116, 13,139, 69,212, 49,210,131,224,254,232,184,253,255,255, /* 0x 440 */
|
||||||
116, 13,139, 69,212, 49,210,131,224,254,232,172,253,255,255,139, /* 0x 450 */
|
137,243,137,249,139, 85,192,106,125, 88,205,128,133,192,116, 10, /* 0x 450 */
|
||||||
93,180,139, 77,192,139, 85,196,106,125, 88,205,128,133,192,116, /* 0x 460 */
|
106,127, 91,106, 1, 88,205,128,235,254,139, 85,180,141, 4, 23, /* 0x 460 */
|
||||||
8,106,127, 91,106, 1, 88,205,128,139, 69,192, 3, 69,188, 1, /* 0x 470 */
|
141, 28, 6, 59, 93,176,115, 30,106, 0,106, 0,106, 50,255,117, /* 0x 470 */
|
||||||
69,180,139, 69,176, 57, 69,180,115, 31,106, 0, 43, 69,180,106, /* 0x 480 */
|
192, 41, 93,176,255,117,176, 83,232, 89,252,255,255,131,196, 24, /* 0x 480 */
|
||||||
0,106, 50,255,117,196, 80,255,117,180,232,121,252,255,255,131, /* 0x 490 */
|
57,195,116, 27,235,202,131,125,216, 0,116, 19,141, 79, 3,129, /* 0x 490 */
|
||||||
196, 24, 57, 69,180,116, 36,235,200,131,125,216, 0,116, 28,131, /* 0x 4a0 */
|
225,255, 15, 0, 0,131,249, 3,119, 5,106, 91, 88,205,128,139, /* 0x 4a0 */
|
||||||
69,192, 3,129,101,192,255, 15, 0, 0,131,125,192, 3,119, 11, /* 0x 4b0 */
|
77,220,255, 69,196, 15,183, 65, 44,131, 69,208, 32, 57, 69,196, /* 0x 4b0 */
|
||||||
139, 93,180,139, 77,192,106, 91, 88,205,128,139, 85,220, 71,131, /* 0x 4c0 */
|
15,140, 76,254,255,255,131,125,216, 0,117, 14,139, 93,228,106, /* 0x 4c0 */
|
||||||
69,208, 32, 15,183, 66, 44, 57,199, 15,140, 58,254,255,255,131, /* 0x 4d0 */
|
6, 88,205,128,133,192,116, 20,235,134,139, 69,220,102,131,120, /* 0x 4d0 */
|
||||||
125,216, 0,117, 17,139, 93,228,106, 6, 88,205,128,133,192,116, /* 0x 4e0 */
|
16, 3,116, 8,139, 93,240,106, 45, 88,205,128,139, 85,220,139, /* 0x 4e0 */
|
||||||
23,233,123,255,255,255,139,125,220,102,131,127, 16, 3,116, 8, /* 0x 4f0 */
|
82, 24, 1, 85,204,139, 69,204,141,101,244, 91, 94, 95,201,195, /* 0x 4f0 */
|
||||||
139, 93,240,106, 45, 88,205,128,139, 69,220, 3,112, 24,141,101, /* 0x 500 */
|
85,137,229, 87, 86, 83,131,236, 16,141, 85, 24,139,125, 20,255, /* 0x 500 */
|
||||||
244, 91,137,240, 94, 95,201,195, 85,137,229, 87, 86, 83, 81,139, /* 0x 510 */
|
117, 40,141, 71, 52,139, 93, 8,255,117, 16,137, 69,240,139,117, /* 0x 510 */
|
||||||
125, 20,141, 85, 24,255,117, 40,141, 71, 52,139, 93, 8,255,117, /* 0x 520 */
|
32,141, 69, 32,232,248,251,255,255,139, 85,240,139, 69, 12,139, /* 0x 520 */
|
||||||
16,137, 69,240,139,117, 32,141, 69, 32,232,229,251,255,255,139, /* 0x 530 */
|
74, 8,186, 3, 0, 0, 0,137, 69, 32,137,216,131,193, 52, 41, /* 0x 530 */
|
||||||
85,240,139, 69, 12,139, 74, 8,186, 3, 0, 0, 0,137, 69, 32, /* 0x 540 */
|
117, 36,232,193,252,255,255, 15,183, 79, 42,137,216,186, 4, 0, /* 0x 540 */
|
||||||
137,216,131,193, 52, 41,117, 36,232,174,252,255,255, 15,183, 79, /* 0x 550 */
|
0, 0,232,177,252,255,255, 15,183, 79, 44,137,216,186, 5, 0, /* 0x 550 */
|
||||||
42,137,216,186, 4, 0, 0, 0,232,158,252,255,255, 15,183, 79, /* 0x 560 */
|
0, 0,232,161,252,255,255,139, 79, 24,137,216,186, 9, 0, 0, /* 0x 560 */
|
||||||
44,137,216,186, 5, 0, 0, 0,232,142,252,255,255,139, 79, 24, /* 0x 570 */
|
0,232,146,252,255,255,141, 69, 32, 83,139, 85, 40, 80,139, 69, /* 0x 570 */
|
||||||
137,216,186, 9, 0, 0, 0,232,127,252,255,255,141, 69, 32, 83, /* 0x 580 */
|
16, 87,232,167,252,255,255,102,139, 79, 44,131,196, 20, 49,210, /* 0x 580 */
|
||||||
139, 85, 40, 80,139, 69, 16, 87,232,148,252,255,255,102,139, 79, /* 0x 590 */
|
102,133,201,137,195,116, 90,139, 69,240,131, 56, 3,117, 70, 49, /* 0x 590 */
|
||||||
44,131,196, 20, 49,210,102,133,201,137,195,116, 89,139, 69,240, /* 0x 5a0 */
|
201,139, 88, 8,137,202,106, 5, 88,205,128,133,192,137,198,120, /* 0x 5a0 */
|
||||||
131, 56, 3,117, 69, 49,201,139, 88, 8,137,202,106, 5, 88,205, /* 0x 5b0 */
|
21,186, 0, 2, 0, 0,137,195,137,249,106, 3, 88,205,128, 61, /* 0x 5b0 */
|
||||||
128,133,192,137,198,120, 20,102,186, 0, 2,137,195,137,249,106, /* 0x 5c0 */
|
0, 2, 0, 0,116, 10,106,127, 91,106, 1, 88,205,128,235,254, /* 0x 5c0 */
|
||||||
3, 88,205,128, 61, 0, 2, 0, 0,116, 10,106,127, 91,106, 1, /* 0x 5d0 */
|
106, 0, 49,210,106, 0,137,240, 87,232, 80,252,255,255,131,196, /* 0x 5d0 */
|
||||||
88,205,128,235,246,106, 0, 49,210,106, 0,137,240, 87,232, 62, /* 0x 5e0 */
|
12,137,195,235, 12, 66, 15,183,193,131, 69,240, 32, 57,194,124, /* 0x 5e0 */
|
||||||
252,255,255,131,196, 12,137,195,235, 12, 66, 15,183,193,131, 69, /* 0x 5f0 */
|
166,141,101,244,137,216, 91, 94, 95,201,195 /* 0x 5f0 */
|
||||||
240, 32, 57,194,124,167,141,101,244,137,216, 91, 94, 95,201,195 /* 0x 600 */
|
|
||||||
};
|
};
|
||||||
|
|||||||
+17
-3
@@ -38,7 +38,6 @@
|
|||||||
%define szElf32_Ehdr 0x34
|
%define szElf32_Ehdr 0x34
|
||||||
%define szElf32_Phdr 8*4
|
%define szElf32_Phdr 8*4
|
||||||
%define e_entry (16 + 2*2 + 4)
|
%define e_entry (16 + 2*2 + 4)
|
||||||
%define p_memsz 5*4
|
|
||||||
%define szl_info 12
|
%define szl_info 12
|
||||||
%define szp_info 12
|
%define szp_info 12
|
||||||
%define a_type 0
|
%define a_type 0
|
||||||
@@ -60,8 +59,9 @@ fold_begin: ; enter: %ebx= uncDst
|
|||||||
%define AT_NULL 0
|
%define AT_NULL 0
|
||||||
%define AT_IGNORE 1
|
%define AT_IGNORE 1
|
||||||
%define AT_PHDR 3
|
%define AT_PHDR 3
|
||||||
%define AT_NUMBER (5+ 23)
|
%define AT_NUMBER (5+ 37)
|
||||||
; 2002-11-09 glibc-2.2.90 AT_IGNOREPPC==22 plus 5 for future growth
|
; 2002-11-09 glibc-2.2.90 AT_IGNOREPPC==22 plus 5 for future growth
|
||||||
|
; 2006-05-15 glibc-2.4-4 AT_L3_CACHESHAPE==37
|
||||||
|
|
||||||
mov esi, esp
|
mov esi, esp
|
||||||
sub esp, sz_auxv * AT_NUMBER ; more than 128 bytes
|
sub esp, sz_auxv * AT_NUMBER ; more than 128 bytes
|
||||||
@@ -98,6 +98,8 @@ L30: ; distribute existing Elf32_auxv into new table
|
|||||||
xchg eax,ecx ; edx is busy, do not use
|
xchg eax,ecx ; edx is busy, do not use
|
||||||
lodsd
|
lodsd
|
||||||
je L40
|
je L40
|
||||||
|
cmp ecx, byte AT_NUMBER
|
||||||
|
jae L30
|
||||||
mov [a_type + sz_auxv*(ecx -1) + edi], ecx
|
mov [a_type + sz_auxv*(ecx -1) + edi], ecx
|
||||||
mov [a_val + sz_auxv*(ecx -1) + edi], eax
|
mov [a_val + sz_auxv*(ecx -1) + edi], eax
|
||||||
jmp L30
|
jmp L30
|
||||||
@@ -159,10 +161,22 @@ EXTERN upx_main
|
|||||||
; ourselves the stub. We would need a place to put the escape hatch
|
; ourselves the stub. We would need a place to put the escape hatch
|
||||||
; "int $0x80; popa; ret", and some kernels do not allow execution
|
; "int $0x80; popa; ret", and some kernels do not allow execution
|
||||||
; on the stack. So, we would have to dirty a page of the shell
|
; on the stack. So, we would have to dirty a page of the shell
|
||||||
; or of /lib/ld-linux.so. It's simpler just to omit the unapping.
|
; or of /lib/ld-linux.so. It's simpler just to omit the unmapping.
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
%define __NR_mmap 90
|
||||||
|
|
||||||
|
global mmap
|
||||||
|
mmap:
|
||||||
|
push ebx
|
||||||
|
lea ebx, [2*4 + esp]
|
||||||
|
push byte __NR_mmap
|
||||||
|
pop eax
|
||||||
|
int 0x80
|
||||||
|
pop ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
; vi:ts=8:et:nowrap
|
; vi:ts=8:et:nowrap
|
||||||
|
|
||||||
|
|||||||
+74
-74
@@ -1,4 +1,4 @@
|
|||||||
/* fold_sh86.h -- created from fold_sh86.bin, 1212 (0x4bc) bytes
|
/* fold_sh86.h -- created from fold_sh86.bin, 1201 (0x4b1) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,85 +27,85 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define LINUX_I386SH_FOLD_SIZE 1212
|
#define LINUX_I386SH_FOLD_SIZE 1201
|
||||||
#define LINUX_I386SH_FOLD_ADLER32 0x3f61f91a
|
#define LINUX_I386SH_FOLD_ADLER32 0x5788f83f
|
||||||
#define LINUX_I386SH_FOLD_CRC32 0x17eab497
|
#define LINUX_I386SH_FOLD_CRC32 0xf1ddde7a
|
||||||
|
|
||||||
unsigned char linux_i386sh_fold[1212] = {
|
unsigned char linux_i386sh_fold[1201] = {
|
||||||
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
||||||
2, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, /* 0x 10 */
|
2, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, /* 0x 10 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 1, 0, 0, 0, /* 0x 20 */
|
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 1, 0, 0, 0, /* 0x 20 */
|
||||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 1, /* 0x 30 */
|
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 1, /* 0x 30 */
|
||||||
0, 0, 64, 1,188, 4, 0, 0,188, 4, 0, 0, 7, 0, 0, 0, /* 0x 40 */
|
0, 0, 64, 1,177, 4, 0, 0,180, 4, 0, 0, 7, 0, 0, 0, /* 0x 40 */
|
||||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 60 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 60 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||||
88, 88,137,230,129,236,224, 0, 0, 0,137,231,173,171,133,192, /* 0x 80 */
|
88, 88,137,230,129,236, 80, 1, 0, 0,137,231,173,171,133,192, /* 0x 80 */
|
||||||
117,250,173,171,133,192,117,250, 87, 64,106, 54, 89,243,171, 72, /* 0x 90 */
|
117,250,173,171,133,192,117,250, 87, 64,106, 82, 89,243,171, 72, /* 0x 90 */
|
||||||
171,171, 95,173,133,192,145,173,116, 10,137, 76,207,248,137, 68, /* 0x a0 */
|
171,171, 95,173,133,192,145,173,116, 15,131,249, 42,115,244,137, /* 0x a0 */
|
||||||
207,252,235,239,129,236, 0, 10, 0, 0,147,141, 82, 24,139, 10, /* 0x b0 */
|
76,207,248,137, 68,207,252,235,234,129,236, 0, 10, 0, 0,147, /* 0x b0 */
|
||||||
139, 90, 4,137,198, 96,232,120, 2, 0, 0, 89, 80, 97,129,196, /* 0x c0 */
|
141, 82, 24,139, 10,139, 90, 4,137,198, 96,232,126, 2, 0, 0, /* 0x c0 */
|
||||||
0, 10, 0, 0, 89, 90, 82, 65, 86,131,238, 3,102,199, 6, 45, /* 0x d0 */
|
89, 80, 97,129,196, 0, 10, 0, 0, 89, 90, 82, 65, 86,131,238, /* 0x d0 */
|
||||||
99, 65, 86, 65, 82, 81, 87,141,188, 36, 0,245,255,255, 96,137, /* 0x e0 */
|
3,102,199, 6, 45, 99, 65, 86, 65, 82, 81, 87,141,188, 36, 0, /* 0x e0 */
|
||||||
227,137,252,185,192, 2, 0, 0, 49,192,243,171,137,220, 97,195, /* 0x f0 */
|
245,255,255, 96,137,227,137,252,185,192, 2, 0, 0, 49,192,243, /* 0x f0 */
|
||||||
85, 87, 86,137,198, 83,139,108, 36, 20, 57, 40,139,120, 4,115, /* 0x 100 */
|
171,137,220, 97,195, 83,141, 92, 36, 8,106, 90, 88,205,128, 91, /* 0x 100 */
|
||||||
8,106,127, 91,106, 1, 88,205,128,133,237,116, 10,137,233,138, /* 0x 110 */
|
195, 0, 0, 0, 87, 86, 83,137,195,139,124, 36, 16, 57, 56,139, /* 0x 110 */
|
||||||
7, 71,136, 2, 66,226,248, 91, 1,110, 4, 41, 46, 94, 95, 93, /* 0x 120 */
|
112, 4,115, 10,106,127, 91,106, 1, 88,205,128,235,254,133,255, /* 0x 120 */
|
||||||
195, 83,141, 92, 36, 8,106, 90, 88,205,128, 91,195,133,210,137, /* 0x 130 */
|
116, 10,137,249,138, 6, 70,136, 2, 66,226,248, 1,123, 4, 41, /* 0x 130 */
|
||||||
209,116, 6,198, 0, 0, 64,226,250,195, 85, 49,201,137,229, 87, /* 0x 140 */
|
59, 91, 94, 95,195,133,210,137,209,116, 6,198, 0, 0, 64,226, /* 0x 140 */
|
||||||
86, 83,137,195,131,236, 44,137, 85,240,139, 69, 8,137,202,137, /* 0x 150 */
|
250,195, 85, 49,201,137,229, 87, 86, 83,137,195,131,236, 52,137, /* 0x 150 */
|
||||||
69,236,106, 5, 88,205,128,133,192,137, 69,232,121, 8,106,127, /* 0x 160 */
|
85,240,139, 69, 8,137,202,137, 69,236,106, 5, 88,205,128,133, /* 0x 160 */
|
||||||
91,106, 1, 88,205,128,186, 0, 2, 0, 0,139, 93,232,139, 77, /* 0x 170 */
|
192,137, 69,232,121, 10,106,127, 91,106, 1, 88,205,128,235,254, /* 0x 170 */
|
||||||
240,106, 3, 88,205,128, 61, 0, 2, 0, 0,117,225,139, 69,240, /* 0x 180 */
|
186, 0, 2, 0, 0,139, 93,232,139, 77,240,106, 3, 88,205,128, /* 0x 180 */
|
||||||
199, 69,224,255,255,255,255, 3, 73, 28,102,131,120, 16, 3,139, /* 0x 190 */
|
61, 0, 2, 0, 0,117,223,139, 69,240,139, 85,240, 3, 64, 28, /* 0x 190 */
|
||||||
93,240,137, 77,228,137,202, 15,149,192, 15,183, 75, 44, 15,182, /* 0x 1a0 */
|
15,183, 90, 44,137, 69,228, 49,192,102,131,122, 16, 3,139, 77, /* 0x 1a0 */
|
||||||
192, 49,246,193,224, 4,131,192, 34,137, 69,204,137,200, 72,120, /* 0x 1b0 */
|
228, 15,149,192,131,207,255,193,224, 4,131,192, 34, 49,210,137, /* 0x 1b0 */
|
||||||
32,131, 58, 1,117, 22,139, 66, 8, 59, 69,224,115, 3,137, 69, /* 0x 1c0 */
|
69,212,137,216, 72,120, 33,137,222,131, 57, 1,117, 20,139, 65, /* 0x 1c0 */
|
||||||
224,139, 90, 20, 1,195, 57,222,115, 2,137,222,131,194, 32,226, /* 0x 1d0 */
|
8, 57,248,115, 2,137,199,139, 89, 20, 1,195, 57,218,115, 2, /* 0x 1d0 */
|
||||||
224,246, 69,204, 16,116, 7,137,243,106, 45, 88,205,128,139, 93, /* 0x 1e0 */
|
137,218,131,193, 32, 78,117,225,246, 69,212, 16,116, 7,137,211, /* 0x 1e0 */
|
||||||
224,106, 0,106, 0,129,227, 0,240,255,255,255,117,204, 41,222, /* 0x 1f0 */
|
106, 45, 88,205,128,137,251,106, 0,129,227, 0,240,255,255,106, /* 0x 1f0 */
|
||||||
106, 7,141,134,255, 15, 0, 0, 37, 0,240,255,255, 80, 83,232, /* 0x 200 */
|
255, 41,218,255,117,212,141,130,255, 15, 0, 0,106, 7, 37, 0, /* 0x 200 */
|
||||||
29,255,255,255,131,196, 24,137,198,139, 69,240, 41,222,199, 69, /* 0x 210 */
|
240,255,255, 80, 83,232,235,254,255,255,131,196, 24, 41,216,199, /* 0x 210 */
|
||||||
220, 0, 0, 0, 0,102,131,120, 44, 0, 15,132,247, 0, 0, 0, /* 0x 220 */
|
69,220, 0, 0, 0, 0,137, 69,224,139, 69,240,102,131,120, 44, /* 0x 220 */
|
||||||
139, 85,228,139, 2,131,248, 6,117, 14,139, 66, 8,139, 77,236, /* 0x 230 */
|
0, 15,132,247, 0, 0, 0,139, 85,228,139, 2,131,248, 6,117, /* 0x 230 */
|
||||||
137, 65, 20,233,200, 0, 0, 0, 72, 15,133,193, 0, 0, 0,139, /* 0x 240 */
|
14,139, 66, 8,139, 77,236,137, 65, 20,233,200, 0, 0, 0, 72, /* 0x 240 */
|
||||||
93,228,199, 69,216, 64, 98, 81,115,139, 75, 24,139, 67, 8,131, /* 0x 250 */
|
15,133,193, 0, 0, 0,139, 93,228,199, 69,216, 64, 98, 81,115, /* 0x 250 */
|
||||||
225, 7,193,225, 2,137,194,211,109,216,137,193,129,225,255, 15, /* 0x 260 */
|
139, 75, 24,139, 67, 8,131,225, 7,193,225, 2,137,194,211,109, /* 0x 260 */
|
||||||
0, 0, 3, 83, 20,137, 77,208, 3, 75, 16, 43, 69,208, 1,242, /* 0x 270 */
|
216,139, 77,228, 3, 83, 20,137,195,139,121, 16,129,227,255, 15, /* 0x 270 */
|
||||||
131,101,216, 7,137, 77,212,141, 60, 48,139, 67, 4, 43, 69,208, /* 0x 280 */
|
0, 0,139, 77,224, 41,216, 1,223,131,101,216, 7, 1,202,141, /* 0x 280 */
|
||||||
137, 85,200, 80,255,117,232,106, 18,106, 3, 81, 87,232,143,254, /* 0x 290 */
|
52, 8,137, 85,204,139, 85,228,139, 66, 4, 41,216, 80,255,117, /* 0x 290 */
|
||||||
255,255,131,196, 24, 57,199,117, 54,139, 85,208,137,248,232,138, /* 0x 2a0 */
|
232,106, 18,106, 3, 87, 86,232, 89,254,255,255,131,196, 24, 57, /* 0x 2a0 */
|
||||||
254,255,255,139, 93,212,139, 85,212,247,219,129,227,255, 15, 0, /* 0x 2b0 */
|
198,117, 48,137,218,137,240,232,137,254,255,255,137,249,247,217, /* 0x 2b0 */
|
||||||
0,141, 4, 23,137,218,137, 93,208,232,111,254,255,255,137,251, /* 0x 2c0 */
|
141, 4, 62,129,225,255, 15, 0, 0,137,243,137,202,137, 77,208, /* 0x 2c0 */
|
||||||
139, 77,212,139, 85,216,106,125, 88,205,128,133,192,116, 8,106, /* 0x 2d0 */
|
232,112,254,255,255,137,249,139, 85,216,106,125, 88,205,128,133, /* 0x 2d0 */
|
||||||
127, 91,106, 1, 88,205,128,139, 69,212, 3, 69,208, 1,199, 59, /* 0x 2e0 */
|
192,116, 10,106,127, 91,106, 1, 88,205,128,235,254,139, 85,208, /* 0x 2e0 */
|
||||||
125,200,115, 28,106, 0,139, 69,200,106, 0,106, 50, 41,248,255, /* 0x 2f0 */
|
141, 4, 23,141, 28, 6, 59, 93,204,115, 28,106, 0,106,255,106, /* 0x 2f0 */
|
||||||
117,216, 80, 87,232, 40,254,255,255,131,196, 24, 57,199,117,207, /* 0x 300 */
|
50,255,117,216, 41, 93,204,255,117,204, 83,232,245,253,255,255, /* 0x 300 */
|
||||||
139, 85,240,255, 69,220, 15,183, 66, 44,131, 69,228, 32, 57, 69, /* 0x 310 */
|
131,196, 24, 57,195,117,204,139, 77,240,255, 69,220, 15,183, 65, /* 0x 310 */
|
||||||
220, 15,140, 9,255,255,255,139, 93,232,106, 6, 88,205,128,133, /* 0x 320 */
|
44,131, 69,228, 32, 57, 69,220, 15,140, 9,255,255,255,139, 93, /* 0x 320 */
|
||||||
192,117,172,139, 69,240, 3,112, 24,141,101,244, 91,137,240, 94, /* 0x 330 */
|
232,106, 6, 88,205,128,133,192,117,169,139, 69,240,139, 64, 24, /* 0x 330 */
|
||||||
95,201,195, 85,137,229, 87, 86, 83,131,236, 40,141,125, 32,139, /* 0x 340 */
|
1, 69,224,139, 69,224,141,101,244, 91, 94, 95,201,195, 85,137, /* 0x 340 */
|
||||||
69, 8,141,117, 24,139, 85, 16,137, 69,212,139, 69, 20,137, 85, /* 0x 350 */
|
229, 87, 86, 83,131,236, 36,141,117, 32,139, 69, 16,141, 93, 24, /* 0x 350 */
|
||||||
208,137, 69,204,139, 69, 36, 5, 85, 80, 88, 50,137, 69,240,139, /* 0x 360 */
|
139, 85, 20,137, 69,212,139, 69, 36,139,125, 8,137, 85,208, 5, /* 0x 360 */
|
||||||
69,240, 5, 85, 80, 88, 51,131,125, 32, 0,137, 69,236, 15,132, /* 0x 370 */
|
85, 80, 88, 50,137, 69,240,139, 69,240, 5, 85, 80, 88, 51,131, /* 0x 370 */
|
||||||
141, 0, 0, 0,141, 85,220,137,240,106, 12,232,112,253,255,255, /* 0x 380 */
|
125, 32, 0,137, 69,236, 15,132,139, 0, 0, 0,141, 85,220,137, /* 0x 380 */
|
||||||
131,125,220, 0, 88,139, 69,224,117, 14, 61, 85, 80, 88, 33,117, /* 0x 390 */
|
216,106, 12,232,124,253,255,255, 88,139, 69,220,139, 77,224,133, /* 0x 390 */
|
||||||
11,131, 62, 0,116,107,235, 4,133,192,117, 8,106,127, 91,106, /* 0x 3a0 */
|
192,117, 15,129,249, 85, 80, 88, 33,117, 11,131, 59, 0,116,103, /* 0x 3a0 */
|
||||||
1, 88,205,128,139, 77,224,139, 69,220, 57,193,119,238, 59, 7, /* 0x 3b0 */
|
235, 4,133,201,117, 10,106,127, 91,106, 1, 88,205,128,235,254, /* 0x 3b0 */
|
||||||
119,234, 57,193,115, 44, 15,182, 69,228, 80,141, 69,216, 80,255, /* 0x 3c0 */
|
57,193,119,242, 59, 6,119,238, 57,193,115, 44, 15,182, 69,228, /* 0x 3c0 */
|
||||||
119, 4, 81,255,118, 4,255, 85,208,131,196, 20,133,192,117,204, /* 0x 3d0 */
|
80,141, 69,216, 80,255,118, 4, 81,255,115, 4,255, 85,212,131, /* 0x 3d0 */
|
||||||
139, 69,220, 57, 69,216,117,196,139, 69,224, 1, 70, 4, 41, 6, /* 0x 3e0 */
|
196, 20,133,192,117,208,139, 69,220, 57, 69,216,117,200,139, 69, /* 0x 3e0 */
|
||||||
235, 12,139, 87, 4,137,240, 81,232, 3,253,255,255, 91,139, 85, /* 0x 3f0 */
|
224, 1, 67, 4, 41, 3,235, 12,139, 86, 4,137,216, 81,232, 17, /* 0x 3f0 */
|
||||||
220,139, 7, 1, 87, 4, 41,208,133,192,137, 7,233,109,255,255, /* 0x 400 */
|
253,255,255, 88,139, 85,220,139, 6, 1, 86, 4, 41,208,133,192, /* 0x 400 */
|
||||||
255,139, 69,236,139, 85,204,138, 24,139, 69,236,198, 0, 0,255, /* 0x 410 */
|
137, 6,233,111,255,255,255,139, 69,236,139, 85,208,138, 24,139, /* 0x 410 */
|
||||||
117,212,139, 69,240,232, 32,253,255,255,139, 85,212,137,198,139, /* 0x 420 */
|
69,236,198, 0, 0,139, 69,240, 87,232, 36,253,255,255,139, 85, /* 0x 420 */
|
||||||
69,236,136, 24,199, 66, 16, 3, 0, 0, 0,199, 66, 24, 4, 0, /* 0x 430 */
|
208,137,198,139, 69,236,136, 24, 15,183, 66, 42,199, 71, 16, 3, /* 0x 430 */
|
||||||
0, 0,139, 85,204, 15,183, 66, 42,139, 85,212,137, 66, 28,199, /* 0x 440 */
|
0, 0, 0,199, 71, 24, 4, 0, 0, 0,199, 71, 32, 5, 0, 0, /* 0x 440 */
|
||||||
66, 32, 5, 0, 0, 0,139, 85,204, 15,183, 66, 44,139, 85,212, /* 0x 450 */
|
0,137, 71, 28, 15,183, 66, 44,199, 71, 44, 0, 16, 0, 0,137, /* 0x 450 */
|
||||||
137, 66, 36,139, 69,204,199, 66, 44, 0, 16, 0, 0,137,114, 68, /* 0x 460 */
|
119, 68,131,194, 52,199, 71, 40, 6, 0, 0, 0,137, 71, 36,139, /* 0x 460 */
|
||||||
199, 66, 40, 6, 0, 0, 0,102,139, 88, 44,199, 66, 64, 9, 0, /* 0x 470 */
|
69,208,199, 71, 64, 9, 0, 0, 0,102,139, 88, 44, 89, 49,201, /* 0x 470 */
|
||||||
0, 0,139, 85,204, 89, 49,201,131,194, 52,102,133,219,116, 34, /* 0x 480 */
|
102,133,219,116, 34,131, 58, 3,117, 18,139, 66, 8,106, 0,139, /* 0x 480 */
|
||||||
131, 58, 3,117, 18,139, 66, 8,106, 0,139, 85,204,232,168,252, /* 0x 490 */
|
85,208,232,187,252,255,255,137,198, 88,235, 11, 65, 15,183,195, /* 0x 490 */
|
||||||
255,255,137,198, 88,235, 11, 65, 15,183,195,131,194, 32, 57,193, /* 0x 4a0 */
|
131,194, 32, 57,193,124,222,141,101,244,137,240, 91, 94, 95,201, /* 0x 4a0 */
|
||||||
124,222,141,101,244,137,240, 91, 94, 95,201,195 /* 0x 4b0 */
|
195 /* 0x 4b0 */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
; l_armwce.asm -- loader & decompressor for the arm/wince/pe format
|
|
||||||
;
|
|
||||||
; This file is part of the UPX executable compressor.
|
|
||||||
;
|
|
||||||
; Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
; Copyright (C) 1996-2004 Laszlo Molnar
|
|
||||||
; All Rights Reserved.
|
|
||||||
;
|
|
||||||
; UPX and the UCL library are free software; you can redistribute them
|
|
||||||
; and/or modify them under the terms of the GNU General Public License as
|
|
||||||
; published by the Free Software Foundation; either version 2 of
|
|
||||||
; the License, or (at your option) any later version.
|
|
||||||
;
|
|
||||||
; This program is distributed in the hope that it will be useful,
|
|
||||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
; GNU General Public License for more details.
|
|
||||||
;
|
|
||||||
; You should have received a copy of the GNU General Public License
|
|
||||||
; along with this program; see the file COPYING.
|
|
||||||
; If not, write to the Free Software Foundation, Inc.,
|
|
||||||
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
;
|
|
||||||
; Markus F.X.J. Oberhumer Laszlo Molnar
|
|
||||||
; <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
%define jmps jmp short
|
|
||||||
%define jmpn jmp near
|
|
||||||
%include "macros.ash"
|
|
||||||
|
|
||||||
BITS 32
|
|
||||||
SECTION .text
|
|
||||||
ORG 0
|
|
||||||
CPU 386
|
|
||||||
|
|
||||||
; =============
|
|
||||||
; ============= ENTRY POINT
|
|
||||||
; =============
|
|
||||||
|
|
||||||
; __ARMWPE00__
|
|
||||||
start:
|
|
||||||
%include "l_armpe_.ah"
|
|
||||||
%include "header.ash"
|
|
||||||
eof:
|
|
||||||
; __ARMWPE99__
|
|
||||||
section .data
|
|
||||||
dd -1
|
|
||||||
dw eof
|
|
||||||
|
|
||||||
|
|
||||||
; vi:ts=8:et:nowrap
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
/* l_armpe.h -- created from l_armpe.bin, 1069 (0x42d) bytes
|
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
|
||||||
|
|
||||||
Copyright (C) 1996-2005 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1996-2005 Laszlo Molnar
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
|
||||||
and/or modify them under the terms of the GNU General Public License as
|
|
||||||
published by the Free Software Foundation; either version 2 of
|
|
||||||
the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING.
|
|
||||||
If not, write to the Free Software Foundation, Inc.,
|
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
|
||||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define NRV_LOADER_ADLER32 0x793a99ed
|
|
||||||
#define NRV_LOADER_CRC32 0x90e7375f
|
|
||||||
|
|
||||||
unsigned char nrv_loader[1069] = {
|
|
||||||
15, 64, 45,233, 12, 0,160,227, 0, 0,143,224, 11, 0, 0,235, /* 0x 0 */
|
|
||||||
15, 64,189,232, 24,240,159,229, 88,120,120, 88, 83, 82, 67, 48, /* 0x 10 */
|
|
||||||
68, 83, 84, 48, 66, 73, 77, 80, 79, 78, 65, 77, 71, 69, 84, 80, /* 0x 20 */
|
|
||||||
76, 79, 65, 68, 69, 78, 84, 82, 83, 82, 67, 76, 68, 83, 84, 76, /* 0x 30 */
|
|
||||||
240, 71, 45,233, 4, 80,144,228, 0, 48,160,227, 4,112,144,228, /* 0x 40 */
|
|
||||||
136,208, 77,226, 4, 32,144,228, 4, 48,141,229, 4,144,144,228, /* 0x 50 */
|
|
||||||
3, 64,160,225, 4,128,144,228, 0, 32,141,229, 0, 96,144,229, /* 0x 60 */
|
|
||||||
3,192,160,225, 3, 0,160,225, 1,160,160,227, 4, 0, 0,234, /* 0x 70 */
|
|
||||||
5, 48,132,224, 0, 48,211,229, 1, 64,132,226, 7, 48,192,231, /* 0x 80 */
|
|
||||||
1, 0,128,226,127, 0, 28,227, 5, 48,212, 7,140, 48,160, 17, /* 0x 90 */
|
|
||||||
131, 48,160, 1, 1, 48,131, 2, 1, 64,132, 2, 1, 12, 19,227, /* 0x a0 */
|
|
||||||
3,192,160,225,241,255,255, 26, 1, 16,160,227,127, 0, 28,227, /* 0x b0 */
|
|
||||||
5, 48,212, 7,140, 48,160, 17,131, 48,160, 1, 1, 48,131, 2, /* 0x c0 */
|
|
||||||
1, 64,132, 2, 3,192,160,225,127, 0, 19,227,129, 32,160,225, /* 0x d0 */
|
|
||||||
131, 59,160,225,163, 31,130,225, 5, 48,212, 7,140, 48,160, 17, /* 0x e0 */
|
|
||||||
131, 48,160, 1, 1, 48,131, 2, 1, 64,132, 2, 1, 12, 19,227, /* 0x f0 */
|
|
||||||
3,192,160,225, 11, 0, 0, 26,127, 0, 19,227, 5, 48,212, 7, /* 0x 100 */
|
|
||||||
131, 48,160, 17,131, 48,160, 1, 1, 48,131, 2,129, 32,160,225, /* 0x 110 */
|
|
||||||
3,192,160,225,131, 59,160,225,163, 63,130,225, 1, 64,132, 2, /* 0x 120 */
|
|
||||||
2, 16, 67,226,224,255,255,234, 2, 0, 81,227, 10, 0, 0, 26, /* 0x 130 */
|
|
||||||
127, 0, 19,227, 5, 48,212, 7,131, 48,160, 17,131, 48,160, 1, /* 0x 140 */
|
|
||||||
1, 48,131, 2, 3,192,160,225, 35, 52,160,225, 10, 16,160,225, /* 0x 150 */
|
|
||||||
1, 64,132, 2, 1, 32, 3,226, 10, 0, 0,234, 5, 48,212,231, /* 0x 160 */
|
|
||||||
1, 64,132,226, 1, 52,131,224, 3, 28, 67,226, 1, 0,113,227, /* 0x 170 */
|
|
||||||
71, 0, 0, 10, 1, 48,224,225,161, 16,160,225, 1, 16,129,226, /* 0x 180 */
|
|
||||||
1, 32, 3,226, 1,160,160,225, 0, 0, 82,227,127, 48, 12,226, /* 0x 190 */
|
|
||||||
10, 0, 0, 10, 0, 0, 83,227, 5, 48,212, 7,140, 48,160, 17, /* 0x 1a0 */
|
|
||||||
131, 48,160, 1, 1, 48,131, 2, 3,192,160,225, 35, 52,160,225, /* 0x 1b0 */
|
|
||||||
1, 48, 3,226, 1, 64,132, 2, 1, 32,131,226, 39, 0, 0,234, /* 0x 1c0 */
|
|
||||||
0, 0, 83,227, 5, 48,212, 7,140, 48,160, 17,131, 48,160, 1, /* 0x 1d0 */
|
|
||||||
1, 48,131, 2, 1, 64,132, 2, 1, 12, 19,227, 3,192,160,225, /* 0x 1e0 */
|
|
||||||
1, 32,160, 3, 10, 0, 0, 10,127, 0, 19,227, 5, 48,212, 7, /* 0x 1f0 */
|
|
||||||
131, 48,160, 17,131, 48,160, 1, 1, 48,131, 2, 3,192,160,225, /* 0x 200 */
|
|
||||||
35, 52,160,225, 1, 48, 3,226, 1, 64,132, 2, 3, 32,131,226, /* 0x 210 */
|
|
||||||
18, 0, 0,234,127, 0, 28,227,140, 48,160,225, 5, 48,212, 7, /* 0x 220 */
|
|
||||||
130, 32,160,225,131, 48,160, 1, 1, 48,131, 2,131,224,160,225, /* 0x 230 */
|
|
||||||
1, 64,132, 2,127, 0, 19,227,131, 59,160,225,163, 47,130,225, /* 0x 240 */
|
|
||||||
5, 48,212, 7, 1, 64,132, 2,131, 48,160, 1, 1,224,131, 2, /* 0x 250 */
|
|
||||||
1, 12, 30,227, 14,192,160,225,237,255,255, 10, 3, 32,130,226, /* 0x 260 */
|
|
||||||
0, 48,135,224, 3,224, 97,224, 1, 48,222,228, 5, 12, 81,227, /* 0x 270 */
|
|
||||||
1, 32,130,130, 0, 48,199,231, 1, 0,128,226, 1, 48,222,228, /* 0x 280 */
|
|
||||||
1, 32, 82,226, 7, 48,192,231, 1, 0,128,226,250,255,255, 26, /* 0x 290 */
|
|
||||||
123,255,255,234, 0,160,150,229, 0,128,152,229, 0, 64,157,229, /* 0x 2a0 */
|
|
||||||
4, 0,141,229, 3, 16,212,229, 2, 48,212,229, 1, 32,212,229, /* 0x 2b0 */
|
|
||||||
1, 52,131,224, 0, 16,212,229, 3, 36,130,224, 2,228,129,224, /* 0x 2c0 */
|
|
||||||
0, 0, 94,227, 59, 0, 0, 10, 4, 48,132,226, 3, 16,211,229, /* 0x 2d0 */
|
|
||||||
2, 32,211,229, 1, 48,211,229, 1, 36,130,224, 4, 16,212,229, /* 0x 2e0 */
|
|
||||||
2, 52,131,224, 9,192,254,231, 3, 20,129,224, 8, 0,141,226, /* 0x 2f0 */
|
|
||||||
0, 0, 92,227, 7, 80,129,224, 0, 48,160,225, 3, 0, 0, 10, /* 0x 300 */
|
|
||||||
178,192,195,224, 1,192,254,229, 0, 0, 92,227,250,255,255,234, /* 0x 310 */
|
|
||||||
0, 32,160,227,176, 32,195,225, 15,224,160,225, 10,240,160,225, /* 0x 320 */
|
|
||||||
8, 48,244,229, 0, 96,160,225, 0, 0, 83,227, 31, 0, 0, 10, /* 0x 330 */
|
|
||||||
255, 48, 3,226, 1, 0, 83,227, 1, 64,132,226, 2, 0, 0, 10, /* 0x 340 */
|
|
||||||
255, 0, 83,227, 9, 0, 0, 10, 19, 0, 0,234, 6, 0,160,225, /* 0x 350 */
|
|
||||||
4, 16,160,225, 15,224,160,225, 8,240,160,225, 4, 0,133,228, /* 0x 360 */
|
|
||||||
1, 48,212,228, 0, 0, 83,227,252,255,255, 26, 13, 0, 0,234, /* 0x 370 */
|
|
||||||
0, 48,212,229, 1, 16,212,229, 6, 0,160,225, 1, 20,131,224, /* 0x 380 */
|
|
||||||
15,224,160,225, 8,240,160,225, 2, 64,132,226, 5, 48,160,225, /* 0x 390 */
|
|
||||||
4, 80,133,226, 0, 0,131,229, 2, 0, 0,234, 0, 32,160,227, /* 0x 3a0 */
|
|
||||||
1, 48,160,227, 0, 32,131,229, 0, 48,212,229,221,255,255,234, /* 0x 3b0 */
|
|
||||||
1, 64,132,226,186,255,255,234,136,208,141,226,240,135,189,232, /* 0x 3c0 */
|
|
||||||
255,255,255,255, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, /* 0x 3d0 */
|
|
||||||
85, 80, 88, 33,161,216,208,213, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 3e0 */
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, /* 0x 3f0 */
|
|
||||||
65, 82, 77, 87, 80, 69, 48, 48, 0, 0, 0, 0, 0, 85, 80, 88, /* 0x 400 */
|
|
||||||
49, 72, 69, 65, 68, 0,224, 3, 0, 0, 65, 82, 77, 87, 80, 69, /* 0x 410 */
|
|
||||||
57, 57, 0, 0, 4, 0, 0,255,255,255,255, 0, 4 /* 0x 420 */
|
|
||||||
};
|
|
||||||
@@ -1,357 +0,0 @@
|
|||||||
/* l_armpe_c.c -- ARM/PE decompressor for NRV2E
|
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
|
||||||
|
|
||||||
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1996-2006 Laszlo Molnar
|
|
||||||
Copyright (C) 2000-2006 John F. Reiser
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
|
||||||
and/or modify them under the terms of the GNU General Public License as
|
|
||||||
published by the Free Software Foundation; either version 2 of
|
|
||||||
the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING.
|
|
||||||
If not, write to the Free Software Foundation, Inc.,
|
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
|
||||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
|
||||||
|
|
||||||
John F. Reiser
|
|
||||||
<jreiser@users.sourceforge.net>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define WRITEFILE(name0, buf, len) \
|
|
||||||
do { short b[3]; b[0] = '\\'; b[1] = name0; b[2] = 0; \
|
|
||||||
typedef int (*CF)(short *, int, int, int, int, int, int); CF cf = (CF) 0x1f99c58; \
|
|
||||||
typedef void (*WF)(int, const void *, int, int *, int); WF wf = (WF) 0x1f99d60; \
|
|
||||||
typedef void (*CH)(int); CH ch = (CH) 0x1f9a2f0; \
|
|
||||||
int h = cf(b, 0x40000000L, 3, 0, 2, 0x80, 0);\
|
|
||||||
int l; wf(h, buf, len, &l, 0); \
|
|
||||||
ch(h); } while (0)
|
|
||||||
|
|
||||||
|
|
||||||
typedef unsigned int ucl_uint32;
|
|
||||||
typedef int ucl_int32;
|
|
||||||
typedef unsigned int ucl_uint;
|
|
||||||
typedef int ucl_int;
|
|
||||||
|
|
||||||
static int
|
|
||||||
ucl_nrv2e_decompress_8 ( const unsigned char * src, ucl_uint src_len,
|
|
||||||
unsigned char * dst, ucl_uint * dst_len)
|
|
||||||
{
|
|
||||||
|
|
||||||
{
|
|
||||||
ucl_uint32 bb = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ucl_uint ilen = 0, olen = 0, last_m_off = 1;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
ucl_uint m_off, m_len;
|
|
||||||
|
|
||||||
while ((((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1))
|
|
||||||
{
|
|
||||||
;
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dst[olen++] = src[ilen++];
|
|
||||||
|
|
||||||
}
|
|
||||||
m_off = 1;
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
m_off = m_off*2 + (((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1);
|
|
||||||
;
|
|
||||||
;
|
|
||||||
if ((((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1)) break;
|
|
||||||
m_off = (m_off-1)*2 + (((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1);
|
|
||||||
}
|
|
||||||
if (m_off == 2)
|
|
||||||
{
|
|
||||||
m_off = last_m_off;
|
|
||||||
m_len = (((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
;
|
|
||||||
m_off = (m_off-3)*256 + src[ilen++];
|
|
||||||
if (m_off == ((0xffffffff) + 0U))
|
|
||||||
break;
|
|
||||||
m_len = (m_off ^ ((0xffffffff) + 0U)) & 1;
|
|
||||||
m_off >>= 1;
|
|
||||||
last_m_off = ++m_off;
|
|
||||||
}
|
|
||||||
if (m_len)
|
|
||||||
m_len = 1 + (((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1);
|
|
||||||
else if ((((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1))
|
|
||||||
m_len = 3 + (((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_len++;
|
|
||||||
do {
|
|
||||||
m_len = m_len*2 + (((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1);
|
|
||||||
;
|
|
||||||
;
|
|
||||||
} while (!(((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1));
|
|
||||||
m_len += 3;
|
|
||||||
}
|
|
||||||
m_len += (m_off > 0x500);
|
|
||||||
;
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
const unsigned char * m_pos;
|
|
||||||
m_pos = dst + olen - m_off;
|
|
||||||
dst[olen++] = *m_pos++;
|
|
||||||
do dst[olen++] = *m_pos++; while (--m_len > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
*dst_len = olen;
|
|
||||||
return ilen == src_len ? 0 : (ilen < src_len ? (-205) : (-201));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void *(*loadlibraryw)(unsigned short *);
|
|
||||||
typedef void *(*getprocaddra)(void *, void *);
|
|
||||||
|
|
||||||
#define T(a,b,c,d) ((a) + ((b) * 0x100) + ((c) * 0x10000) + ((d) * 0x1000000))
|
|
||||||
|
|
||||||
static inline void *get_le32(unsigned char *p)
|
|
||||||
{
|
|
||||||
return (void*) T(p[0], p[1], p[2], p[3]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void handle_imports(unsigned char *imp,
|
|
||||||
unsigned name_offset,
|
|
||||||
unsigned iat_offset,
|
|
||||||
loadlibraryw ll,
|
|
||||||
getprocaddra gpa)
|
|
||||||
{
|
|
||||||
unsigned short buf[64];
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
unsigned short *b;
|
|
||||||
//printf("name=%p iat=%p\n", get_le32(imp), get_le32(imp + 4));
|
|
||||||
unsigned char *name = get_le32(imp);
|
|
||||||
if (name == 0)
|
|
||||||
break;
|
|
||||||
name += name_offset;
|
|
||||||
unsigned *iat = get_le32(imp + 4) + iat_offset;
|
|
||||||
//printf("name=%p iat=%p\n", name, iat);
|
|
||||||
for (b = buf; *name; name++, b++)
|
|
||||||
*b = *name;
|
|
||||||
*b = 0;
|
|
||||||
|
|
||||||
void *dll = ll(buf);
|
|
||||||
imp += 8;
|
|
||||||
unsigned ord;
|
|
||||||
|
|
||||||
while (*imp)
|
|
||||||
{
|
|
||||||
switch (*imp++)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
// by name
|
|
||||||
*iat++ = (unsigned) gpa(dll, imp);
|
|
||||||
while (*imp++)
|
|
||||||
;
|
|
||||||
break;
|
|
||||||
case 0xff:
|
|
||||||
// by ordinal
|
|
||||||
ord = ((unsigned) imp[0]) + imp[1] * 0x100;
|
|
||||||
imp += 2;
|
|
||||||
*iat++ = (unsigned) gpa(dll, (void *) ord);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
*(int*) 1 = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
imp++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void upx_main(unsigned *info)
|
|
||||||
{
|
|
||||||
int dlen = 0;
|
|
||||||
unsigned src0 = *info++;
|
|
||||||
unsigned dst0 = *info++;
|
|
||||||
unsigned bimp = *info++;
|
|
||||||
unsigned onam = *info++;
|
|
||||||
unsigned getp = *info++;
|
|
||||||
unsigned load = *info++;
|
|
||||||
unsigned entr = *info++;
|
|
||||||
unsigned srcl = *info++;
|
|
||||||
unsigned dstl = *info++;
|
|
||||||
|
|
||||||
//WRITEFILE('1', (void*) 0x11000, load + 256 - 0x11000);
|
|
||||||
ucl_nrv2e_decompress_8((void *) src0, srcl, (void *) dst0, &dlen);
|
|
||||||
handle_imports((void *) bimp, onam, dst0, *(void**) load, *(void**) getp);
|
|
||||||
//WRITEFILE('2', (void*) 0x11000, load + 256 - 0x11000);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef __pe__
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
static void *test_loadlibraryw(unsigned short *x)
|
|
||||||
{
|
|
||||||
printf("loadlibraryw called: ");
|
|
||||||
while (*x)
|
|
||||||
printf("%c", *x++);
|
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
static unsigned ret = 0x2a2a2a00;
|
|
||||||
return (void*) ret++;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *test_getprocaddra(void *a, void *x)
|
|
||||||
{
|
|
||||||
if ((unsigned) x < 0x10000)
|
|
||||||
printf("getprocaddra called: %p %x\n", a, (unsigned) x);
|
|
||||||
else
|
|
||||||
printf("getprocaddra called: %p %s\n", a, (char*) x);
|
|
||||||
|
|
||||||
static unsigned ret = 1;
|
|
||||||
return a + ret++;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
if (argc != 2)
|
|
||||||
return printf("usage: %s <compressed.exe>\n", argv[0]);
|
|
||||||
|
|
||||||
void *mem = malloc(32*1024*1024);
|
|
||||||
void *mem16m = (void*) ((((unsigned) mem) + 0xffffff) & 0xff000000);
|
|
||||||
printf("mem: %p %p\n", mem, mem16m);
|
|
||||||
|
|
||||||
char command[100 + strlen(argv[1])];
|
|
||||||
snprintf(command, sizeof(command),
|
|
||||||
"arm-wince-pe-objdump -h '%s'|grep '2[*][*]2'", argv[1]);
|
|
||||||
FILE *fp = popen(command, "r");
|
|
||||||
if (fgets(command, 100, fp) == NULL)
|
|
||||||
return printf("error while calling objdump\n");
|
|
||||||
|
|
||||||
unsigned start_uncompressed;
|
|
||||||
if (sscanf(command, "%*d %*s %*x %x", &start_uncompressed) != 1)
|
|
||||||
return printf("scanf failed on '%s'", command);
|
|
||||||
printf("start_uncompressed=%x ", start_uncompressed);
|
|
||||||
|
|
||||||
if (fgets(command, 100, fp) == NULL)
|
|
||||||
return printf("error while calling objdump\n");
|
|
||||||
unsigned size;
|
|
||||||
unsigned offset;
|
|
||||||
unsigned vma;
|
|
||||||
if (sscanf(command, "%*d %*s %x %x %*x %x", &size, &vma, &offset) != 3)
|
|
||||||
return printf("scanf failed on '%s'" , command);
|
|
||||||
printf("size=%x vma=%x offset=%x\n", size, vma, offset);
|
|
||||||
|
|
||||||
if (fgets(command, 100, fp) == NULL)
|
|
||||||
return printf("error while calling objdump\n");
|
|
||||||
|
|
||||||
unsigned size2;
|
|
||||||
unsigned offset2;
|
|
||||||
unsigned vma2;
|
|
||||||
if (sscanf(command, "%*d %*s %x %x %*x %x", &size2, &vma2, &offset2) != 3)
|
|
||||||
return printf("scanf failed on '%s'" , command);
|
|
||||||
printf("size2=%x vma2=%x offset2=%x\n", size2, vma2, offset2);
|
|
||||||
|
|
||||||
pclose(fp);
|
|
||||||
|
|
||||||
FILE *f1 = fopen(argv[1], "rb");
|
|
||||||
if (f1 == NULL)
|
|
||||||
return printf("can not open %s\n", argv[1]);
|
|
||||||
if (fseek(f1, offset, SEEK_SET))
|
|
||||||
return printf("fseek failed\n");
|
|
||||||
if (fread(mem16m + vma, size, 1, f1) != 1)
|
|
||||||
return printf("fread failed\n");
|
|
||||||
if (fseek(f1, offset2, SEEK_SET))
|
|
||||||
return printf("fseek failed\n");
|
|
||||||
if (fread(mem16m + vma2, size2, 1, f1) != 1)
|
|
||||||
return printf("fread failed\n");
|
|
||||||
fclose(f1);
|
|
||||||
|
|
||||||
unsigned *info = (unsigned *) memmem(mem16m + vma, size, "XxxX", 4);
|
|
||||||
if (info == NULL)
|
|
||||||
return printf("decompression info not found\n");
|
|
||||||
|
|
||||||
info++;
|
|
||||||
unsigned src0 = *info++;
|
|
||||||
unsigned dst0 = *info++;
|
|
||||||
unsigned bimp = *info++;
|
|
||||||
unsigned onam = *info++;
|
|
||||||
unsigned getp = *info++;
|
|
||||||
unsigned load = *info++;
|
|
||||||
unsigned entr = *info++;
|
|
||||||
unsigned srcl = *info++;
|
|
||||||
unsigned dstl = *info++;
|
|
||||||
|
|
||||||
printf("%x %x %x %x %x %x %x %x %x\n", src0, srcl, dst0, dstl, bimp, onam, load, getp, entr);
|
|
||||||
|
|
||||||
int dlen = 0;
|
|
||||||
int ret = ucl_nrv2e_decompress_8(mem16m + src0, srcl, mem16m + dst0, &dlen);
|
|
||||||
|
|
||||||
printf("dlen=%x, ret=%d\n", dlen, ret);
|
|
||||||
if (dlen != (int) dstl)
|
|
||||||
return printf("corrupt compressed data\n");
|
|
||||||
|
|
||||||
f1 = fopen("/tmp/image.out", "w");
|
|
||||||
fwrite(mem16m, vma + size + 0x10000, 1, f1);
|
|
||||||
fclose(f1);
|
|
||||||
|
|
||||||
handle_imports(bimp + mem16m, onam + mem16m, dst0 + mem16m,
|
|
||||||
test_loadlibraryw, test_getprocaddra);
|
|
||||||
|
|
||||||
f1 = fopen("/tmp/image.out", "w");
|
|
||||||
fwrite(mem16m, vma2 + size2, 1, f1);
|
|
||||||
fclose(f1);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
FILE *f1 = fopen("/r", "w");
|
|
||||||
int h = LoadLibraryW(L"coredll.dll");
|
|
||||||
fprintf(f1, "%p\n", GetProcAddressA(h, "DeleteFileW"));
|
|
||||||
fclose(f1);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
typedef void (*df)(ushort *);
|
|
||||||
df dfw = 0x1f99bc8;
|
|
||||||
dfw(L"\\r");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
/* l_armpe_s.S -- ARM/PE decompressor assembly startup
|
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
|
||||||
|
|
||||||
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1996-2006 Laszlo Molnar
|
|
||||||
Copyright (C) 2000-2006 John F. Reiser
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
|
||||||
and/or modify them under the terms of the GNU General Public License as
|
|
||||||
published by the Free Software Foundation; either version 2 of
|
|
||||||
the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING.
|
|
||||||
If not, write to the Free Software Foundation, Inc.,
|
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
|
||||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
|
||||||
|
|
||||||
John F. Reiser
|
|
||||||
<jreiser@users.sourceforge.net>
|
|
||||||
*/
|
|
||||||
|
|
||||||
.text
|
|
||||||
.align 0
|
|
||||||
.global _mainCRTStartup
|
|
||||||
|
|
||||||
_mainCRTStartup:
|
|
||||||
stmfd sp!, {r0 - r3, lr}
|
|
||||||
mov r0, #L2 - L0 - 8
|
|
||||||
L0:
|
|
||||||
add r0, pc, r0
|
|
||||||
bl _upx_main
|
|
||||||
ldmfd sp!, {r0 - r3, lr}
|
|
||||||
ldr pc, L21
|
|
||||||
.ascii "XxxX"
|
|
||||||
L2:
|
|
||||||
.ascii "SRC0DST0BIMPONAMGETPLOAD"
|
|
||||||
L21:
|
|
||||||
.ascii "ENTRSRCLDSTL"
|
|
||||||
@@ -0,0 +1,374 @@
|
|||||||
|
/* l_armpea.S -- ARM/PE decompressor assembly startup (arm mode)
|
||||||
|
|
||||||
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
|
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996-2006 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2006 John F. Reiser
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
and/or modify them under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of
|
||||||
|
the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
// DEBUG == 0 -> none
|
||||||
|
// DEBUG == 1 -> for armpe_tester
|
||||||
|
// DEBUG == 2 -> wince - dumps memory
|
||||||
|
// DEBUG == 3 -> wince - removes files
|
||||||
|
|
||||||
|
#define DEBUG 0
|
||||||
|
#if DEBUG == 0
|
||||||
|
# define DINIT
|
||||||
|
# define DDUMP(x)
|
||||||
|
# define DDONE
|
||||||
|
#else
|
||||||
|
#define DDUMP(x) stmfd sp!, {r0 - r3}; mov r0, x; mov lr, pc; mov pc, r8; ldmia sp!, {r0 - r3}
|
||||||
|
#if DEBUG == 1
|
||||||
|
#define DINIT mov r8, r0
|
||||||
|
#define DDONE mov pc, lr
|
||||||
|
#elif DEBUG == 2
|
||||||
|
#define DINIT adr r8, writefile
|
||||||
|
#define DDONE
|
||||||
|
#elif DEBUG == 3
|
||||||
|
#define DINIT adr r8, DelFile
|
||||||
|
#define DDONE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
// magic for the UPX linker
|
||||||
|
#define SECT(n) .text 1; .asciz #n; .long n - _start; .text 0; n
|
||||||
|
|
||||||
|
#define BL(t) \
|
||||||
|
.text 1; .long 0, bl##t - _start; .asciz #t; .long 0; \
|
||||||
|
.text 0; .byte 0, 0, 0; bl##t: .byte 0xeb
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
.text
|
||||||
|
.balign 0
|
||||||
|
.globl _start
|
||||||
|
.arm
|
||||||
|
_start:
|
||||||
|
|
||||||
|
dst0 .req r9 @ global register
|
||||||
|
|
||||||
|
SECT(DllStart):
|
||||||
|
cmp r1, #1
|
||||||
|
bne .Lstart_orig
|
||||||
|
|
||||||
|
SECT(ExeStart):
|
||||||
|
stmfd sp!, {r0 - r11, lr}
|
||||||
|
DINIT
|
||||||
|
adr r3, SRC0
|
||||||
|
ldmia r3!, {r0, r1, r2} @ r0=src0, r1=slen, r2=dst0, r3=addr dstl
|
||||||
|
ldmia r3, {r4, r10, r11} @ r10=LoadLibraryW, r11=GetProcAddressA
|
||||||
|
mov dst0, r2
|
||||||
|
|
||||||
|
bl ProcessAll
|
||||||
|
mov r0, #4
|
||||||
|
bl CacheSync
|
||||||
|
ldmia sp!, {r0 - r11, lr}
|
||||||
|
DDONE
|
||||||
|
.Lstart_orig:
|
||||||
|
ldr pc, ENTR
|
||||||
|
|
||||||
|
CacheSync:
|
||||||
|
ldr pc, IATT + 8
|
||||||
|
|
||||||
|
SRC0: .ascii "SRC0" @ start of compressed data
|
||||||
|
SRCL: .ascii "SRCL" @ compressed length
|
||||||
|
DST0: .ascii "DST0" @ start of uncompressed data
|
||||||
|
DSTL: .ascii "DSTL" @ uncompressed length
|
||||||
|
IATT: .ascii "IATT"; .long 0, 0, 0 @ import address table
|
||||||
|
ENTR: .ascii "ENTR" @ original entry point
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
#if DEBUG == 2
|
||||||
|
writefile:
|
||||||
|
stmfd sp!, {r4, r5, r6, r7, lr}
|
||||||
|
mov r1, dst0
|
||||||
|
sub r2, r8, r1
|
||||||
|
add r2, r2, #4096+2048
|
||||||
|
mov r3, #2
|
||||||
|
sub sp, sp, #24
|
||||||
|
mov r4, #0
|
||||||
|
strh r0, [sp, #18]
|
||||||
|
str r3, [sp, #0]
|
||||||
|
mov r0, #128
|
||||||
|
mov r3, #92
|
||||||
|
str r0, [sp, #4]
|
||||||
|
mov r6, r1
|
||||||
|
mov r7, r2
|
||||||
|
strh r3, [sp, #16]
|
||||||
|
strh r4, [sp, #20]
|
||||||
|
mov r3, r4
|
||||||
|
str r4, [sp, #8]
|
||||||
|
mov r1, #1073741824
|
||||||
|
mov r2, #3
|
||||||
|
add r0, sp, #16
|
||||||
|
ldr ip, .L3
|
||||||
|
mov lr, pc
|
||||||
|
mov pc, ip
|
||||||
|
add r3, sp, #12
|
||||||
|
mov r5, r0
|
||||||
|
str r4, [sp, #0]
|
||||||
|
mov r1, r6
|
||||||
|
mov r2, r7
|
||||||
|
ldr ip, .L3+4
|
||||||
|
mov lr, pc
|
||||||
|
mov pc, ip
|
||||||
|
mov r0, r5
|
||||||
|
ldr r3, .L3+8
|
||||||
|
mov lr, pc
|
||||||
|
mov pc, r3
|
||||||
|
add sp, sp, #24
|
||||||
|
ldmfd sp!, {r4, r5, r6, r7, pc}
|
||||||
|
.L3:
|
||||||
|
.word 33135704
|
||||||
|
.word 33135968
|
||||||
|
.word 33137392
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DEBUG == 3
|
||||||
|
DelFile:
|
||||||
|
adr r1, filename
|
||||||
|
strb r0, [r1, #2]
|
||||||
|
mov r0, r1
|
||||||
|
ldr pc, deleteffilew
|
||||||
|
|
||||||
|
deleteffilew:
|
||||||
|
.word 0x1f99bc8
|
||||||
|
filename:
|
||||||
|
.byte '\\', 0, 'r', 0, 0, 0
|
||||||
|
.align 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
ProcessAll:
|
||||||
|
stmfd sp!, {lr}
|
||||||
|
|
||||||
|
@@ uncompress/unfilter/imports/relocs are copied here by the upx linker
|
||||||
|
|
||||||
|
SECT(ProcessEnd):
|
||||||
|
ldmia sp!, {pc}
|
||||||
|
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(Unfilter_0x50):
|
||||||
|
buffer .req r0
|
||||||
|
addval .req r2
|
||||||
|
bufend .req ip
|
||||||
|
|
||||||
|
ldr buffer, FIBS
|
||||||
|
mov addval, #0
|
||||||
|
ldr bufend, FIBE
|
||||||
|
.Luf50_0:
|
||||||
|
cmp buffer, bufend
|
||||||
|
beq .Luf_end
|
||||||
|
|
||||||
|
ldr r3, [buffer]
|
||||||
|
and r1, r3, #0x0f000000
|
||||||
|
cmp r1, #0x0b000000
|
||||||
|
bne .Luf50_1
|
||||||
|
and r1, r3, #0xff000000
|
||||||
|
sub r3, r3, addval
|
||||||
|
and r3, r3, #0x00ffffff
|
||||||
|
orr r3, r3, r1
|
||||||
|
str r3, [buffer]
|
||||||
|
|
||||||
|
.Luf50_1:
|
||||||
|
add buffer, buffer, #4
|
||||||
|
add addval, addval, #1
|
||||||
|
b .Luf50_0
|
||||||
|
|
||||||
|
.unreq buffer
|
||||||
|
.unreq addval
|
||||||
|
.unreq bufend
|
||||||
|
|
||||||
|
FIBS: .ascii "FIBS" @ buffer start for filter
|
||||||
|
FIBE: .ascii "FIBE" @ buffer end for filter
|
||||||
|
|
||||||
|
.Luf_end:
|
||||||
|
DDUMP (#'F')
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(Relocs):
|
||||||
|
dest .req r0
|
||||||
|
buffer .req r1
|
||||||
|
addval .req dst0
|
||||||
|
|
||||||
|
ldr buffer, BREL
|
||||||
|
sub dest, addval, #4
|
||||||
|
|
||||||
|
.Lreloc_loop:
|
||||||
|
ldrb r3, [buffer], #1
|
||||||
|
cmp r3, #0
|
||||||
|
beq .Lreloc_end
|
||||||
|
cmp r3, #0xf0
|
||||||
|
|
||||||
|
bichs ip, r3, #0xf0
|
||||||
|
ldrhsb r3, [buffer, #1] @ get_le16
|
||||||
|
addhs ip, r3, ip, lsl #8
|
||||||
|
ldrhsb r3, [buffer], #2
|
||||||
|
addhs r3, r3, ip, lsl #8
|
||||||
|
|
||||||
|
add dest, dest, r3
|
||||||
|
ldrb r3, [dest] @ get_be32
|
||||||
|
add ip, r3, ip, lsl #8
|
||||||
|
ldrb r3, [dest, #1]
|
||||||
|
add ip, r3, ip, lsl #8
|
||||||
|
ldrb r3, [dest, #2]
|
||||||
|
add ip, r3, ip, lsl #8
|
||||||
|
ldrb r3, [dest, #3]
|
||||||
|
add ip, r3, ip, lsl #8
|
||||||
|
add ip, ip, addval
|
||||||
|
str ip, [dest]
|
||||||
|
b .Lreloc_loop
|
||||||
|
|
||||||
|
BREL: .ascii "BREL" @ start of reloc info
|
||||||
|
|
||||||
|
.unreq buffer
|
||||||
|
.unreq addval
|
||||||
|
.unreq dest
|
||||||
|
|
||||||
|
.Lreloc_end:
|
||||||
|
DDUMP (#'R')
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(Imports):
|
||||||
|
imp .req r4
|
||||||
|
iat .req r5
|
||||||
|
dll .req r6
|
||||||
|
.equ bufsize, 2048
|
||||||
|
|
||||||
|
sub sp, sp, #bufsize
|
||||||
|
ldr imp, BIMP
|
||||||
|
.Lhi_loop1:
|
||||||
|
mov r0, imp
|
||||||
|
bl get_le32
|
||||||
|
beq .Lhi_end
|
||||||
|
|
||||||
|
ldr r1, ONAM
|
||||||
|
add r0, r0, r1
|
||||||
|
mov r1, sp
|
||||||
|
.Lhi_copyname:
|
||||||
|
ldrb r2, [r0], #1
|
||||||
|
strh r2, [r1], #2
|
||||||
|
cmp r2, #0
|
||||||
|
bne .Lhi_copyname
|
||||||
|
|
||||||
|
mov r0, sp
|
||||||
|
bl LoadLibraryW
|
||||||
|
|
||||||
|
mov dll, r0
|
||||||
|
add r0, imp, #4
|
||||||
|
bl get_le32
|
||||||
|
add iat, dst0, r0
|
||||||
|
add imp, imp, #8
|
||||||
|
|
||||||
|
.Lhi_gpa_loop:
|
||||||
|
ldrb r0, [imp], #1
|
||||||
|
cmp r0, #1
|
||||||
|
bmi .Lhi_loop1
|
||||||
|
bne .Lhi_by_ord
|
||||||
|
|
||||||
|
mov r1, imp
|
||||||
|
.Lhi_by_name:
|
||||||
|
ldrb r0, [imp], #1
|
||||||
|
cmp r0, #0
|
||||||
|
bne .Lhi_by_name
|
||||||
|
b .Lhi_call_gpa
|
||||||
|
|
||||||
|
.Lhi_by_ord:
|
||||||
|
ldrb r0, [imp], #1
|
||||||
|
ldrb r1, [imp], #1
|
||||||
|
add r1, r0, r1, lsl #8
|
||||||
|
|
||||||
|
.Lhi_call_gpa:
|
||||||
|
mov r0, dll
|
||||||
|
bl GetProcAddressA
|
||||||
|
str r0, [iat], #4
|
||||||
|
b .Lhi_gpa_loop
|
||||||
|
|
||||||
|
.unreq iat
|
||||||
|
.unreq imp
|
||||||
|
.unreq dll
|
||||||
|
|
||||||
|
get_le32: @ optimized for size
|
||||||
|
mov r2, #3
|
||||||
|
.Lg0:
|
||||||
|
ldrb r3, [r0, r2]
|
||||||
|
subs r2, r2, #1
|
||||||
|
add r1, r3, r1, asl #8
|
||||||
|
bpl .Lg0
|
||||||
|
movs r0, r1 @ set the Z flag if zero
|
||||||
|
mov pc, lr
|
||||||
|
|
||||||
|
LoadLibraryW:
|
||||||
|
mov pc, r10
|
||||||
|
|
||||||
|
GetProcAddressA:
|
||||||
|
mov pc, r11
|
||||||
|
|
||||||
|
BIMP: .ascii "BIMP" @ start of import data
|
||||||
|
ONAM: .ascii "ONAM" @ start of dll names
|
||||||
|
|
||||||
|
.Lhi_end:
|
||||||
|
add sp, sp, #bufsize
|
||||||
|
DDUMP (#'I')
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(ucl_nrv2e_decompress_8):
|
||||||
|
|
||||||
|
#include "armv4_n2e_d8.S"
|
||||||
|
|
||||||
|
SECT(Call2E):
|
||||||
|
BL (ucl_nrv2e_decompress_8)
|
||||||
|
DDUMP (#'C')
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(UPX1HEAD):
|
||||||
|
.byte 85,80,88,33 @ 0 UPX_MAGIC_LE32
|
||||||
|
.byte 161,216,208,213 @ 4 UPX_MAGIC2_LE32
|
||||||
|
.long 0 @ 8 uncompressed adler32
|
||||||
|
.long 0 @ 12 compressed adler32
|
||||||
|
.long 0 @ 16 uncompressed len
|
||||||
|
.long 0 @ 20 compressed len
|
||||||
|
.long 0 @ 24 original file size
|
||||||
|
.byte 0 @ 28 filter id
|
||||||
|
.byte 0 @ 29 filter cto
|
||||||
|
.byte 0 @ unused
|
||||||
|
.byte 45 @ 31 header checksum
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(eof):
|
||||||
|
.text 1
|
||||||
|
.long -1; .short eof - _start
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
/* l_armpea.h -- created from l_armpea.bin, 952 (0x3b8) bytes
|
||||||
|
|
||||||
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
|
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996-2006 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2006 John F. Reiser
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
and/or modify them under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of
|
||||||
|
the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define NRV_LOADER_ARM_SIZE 952
|
||||||
|
#define NRV_LOADER_ARM_ADLER32 0xd6f275cf
|
||||||
|
#define NRV_LOADER_ARM_CRC32 0x3a603f09
|
||||||
|
|
||||||
|
unsigned char nrv_loader_arm[952] = {
|
||||||
|
1, 0, 81,227, 8, 0, 0, 26,255, 79, 45,233, 32, 48,143,226, /* 0x 0 */
|
||||||
|
7, 0,179,232, 16, 12,147,232, 2,144,160,225, 13, 0, 0,235, /* 0x 10 */
|
||||||
|
4, 0,160,227, 1, 0, 0,235,255, 79,189,232, 32,240,159,229, /* 0x 20 */
|
||||||
|
20,240,159,229, 83, 82, 67, 48, 83, 82, 67, 76, 68, 83, 84, 48, /* 0x 30 */
|
||||||
|
68, 83, 84, 76, 73, 65, 84, 84, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 40 */
|
||||||
|
0, 0, 0, 0, 69, 78, 84, 82, 0, 64, 45,233, 0,128,189,232, /* 0x 50 */
|
||||||
|
60, 0,159,229, 0, 32,160,227, 56,192,159,229, 12, 0, 80,225, /* 0x 60 */
|
||||||
|
13, 0, 0, 10, 0, 48,144,229, 15, 20, 3,226, 11, 4, 81,227, /* 0x 70 */
|
||||||
|
4, 0, 0, 26,255, 20, 3,226, 2, 48, 67,224,255, 52,195,227, /* 0x 80 */
|
||||||
|
1, 48,131,225, 0, 48,128,229, 4, 0,128,226, 1, 32,130,226, /* 0x 90 */
|
||||||
|
241,255,255,234, 70, 73, 66, 83, 70, 73, 66, 69, 84, 16,159,229, /* 0x a0 */
|
||||||
|
4, 0, 73,226, 1, 48,209,228, 0, 0, 83,227, 18, 0, 0, 10, /* 0x b0 */
|
||||||
|
240, 0, 83,227,240,192,195, 35, 1, 48,209, 37, 12,196,131, 32, /* 0x c0 */
|
||||||
|
2, 48,209, 36, 12, 52,131, 32, 3, 0,128,224, 0, 48,208,229, /* 0x d0 */
|
||||||
|
12,196,131,224, 1, 48,208,229, 12,196,131,224, 2, 48,208,229, /* 0x e0 */
|
||||||
|
12,196,131,224, 3, 48,208,229, 12,196,131,224, 9,192,140,224, /* 0x f0 */
|
||||||
|
0,192,128,229,234,255,255,234, 66, 82, 69, 76, 2,219, 77,226, /* 0x 100 */
|
||||||
|
164, 64,159,229, 4, 0,160,225, 30, 0, 0,235, 40, 0, 0, 10, /* 0x 110 */
|
||||||
|
152, 16,159,229, 1, 0,128,224, 13, 16,160,225, 1, 32,208,228, /* 0x 120 */
|
||||||
|
178, 32,193,224, 0, 0, 82,227,251,255,255, 26, 13, 0,160,225, /* 0x 130 */
|
||||||
|
27, 0, 0,235, 0, 96,160,225, 4, 0,132,226, 17, 0, 0,235, /* 0x 140 */
|
||||||
|
0, 80,137,224, 8, 64,132,226, 1, 0,212,228, 1, 0, 80,227, /* 0x 150 */
|
||||||
|
235,255,255, 74, 4, 0, 0, 26, 4, 16,160,225, 1, 0,212,228, /* 0x 160 */
|
||||||
|
0, 0, 80,227,252,255,255, 26, 2, 0, 0,234, 1, 0,212,228, /* 0x 170 */
|
||||||
|
1, 16,212,228, 1, 20,128,224, 6, 0,160,225, 9, 0, 0,235, /* 0x 180 */
|
||||||
|
4, 0,133,228,239,255,255,234, 3, 32,160,227, 2, 48,208,231, /* 0x 190 */
|
||||||
|
1, 32, 82,226, 1, 20,131,224,251,255,255, 90, 1, 0,176,225, /* 0x 1a0 */
|
||||||
|
14,240,160,225, 10,240,160,225, 11,240,160,225, 66, 73, 77, 80, /* 0x 1b0 */
|
||||||
|
79, 78, 65, 77, 2,219,141,226,252, 64, 45,233, 0,112,129,224, /* 0x 1c0 */
|
||||||
|
0, 80,224,227, 2, 65,160,227, 10, 0, 0,234, 24, 0,189,232, /* 0x 1d0 */
|
||||||
|
7, 0, 64,224, 3, 32, 66,224, 0, 32,132,229,240,128,189,232, /* 0x 1e0 */
|
||||||
|
1, 64,208,228, 4, 64,164,224, 4, 76,176,225, 14,240,160,225, /* 0x 1f0 */
|
||||||
|
1, 48,208,228, 1, 48,194,228, 4, 64,148,224,247,255,255, 11, /* 0x 200 */
|
||||||
|
250,255,255, 42, 1, 16,160,227, 3, 0, 0,234, 1, 16, 65,226, /* 0x 210 */
|
||||||
|
4, 64,148,224,241,255,255, 11, 1, 16,161,224, 4, 64,148,224, /* 0x 220 */
|
||||||
|
238,255,255, 11, 1, 16,161,224, 4, 64,148,224,235,255,255, 11, /* 0x 230 */
|
||||||
|
245,255,255, 58, 3, 48, 81,226, 0, 16,160,227, 6, 0, 0, 58, /* 0x 240 */
|
||||||
|
1, 80,208,228, 3, 84,133,225, 5, 80,240,225,222,255,255, 10, /* 0x 250 */
|
||||||
|
197, 80,176,225, 15, 0, 0, 42, 2, 0, 0,234, 4, 64,148,224, /* 0x 260 */
|
||||||
|
222,255,255, 11, 11, 0, 0, 42, 1, 16,160,227, 4, 64,148,224, /* 0x 270 */
|
||||||
|
218,255,255, 11, 7, 0, 0, 42, 4, 64,148,224,215,255,255, 11, /* 0x 280 */
|
||||||
|
1, 16,161,224, 4, 64,148,224,212,255,255, 11,249,255,255, 58, /* 0x 290 */
|
||||||
|
4, 16,129,226, 3, 0, 0,234, 4, 64,148,224,207,255,255, 11, /* 0x 2a0 */
|
||||||
|
1, 16,161,224, 2, 16,129,226, 5, 12,117,227, 0, 0, 0, 42, /* 0x 2b0 */
|
||||||
|
1, 16,129,226, 0, 48,210,229, 5, 48,210,231, 1, 48,194,228, /* 0x 2c0 */
|
||||||
|
1, 16, 81,226,251,255,255, 26,202,255,255,234, 0, 0, 0,235, /* 0x 2d0 */
|
||||||
|
85, 80, 88, 33,161,216,208,213, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 2e0 */
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, /* 0x 2f0 */
|
||||||
|
68,108,108, 83,116, 97,114,116, 0, 0, 0, 0, 0, 69,120,101, /* 0x 300 */
|
||||||
|
83,116, 97,114,116, 0, 8, 0, 0, 0, 80,114,111, 99,101,115, /* 0x 310 */
|
||||||
|
115, 69,110,100, 0, 92, 0, 0, 0, 85,110,102,105,108,116,101, /* 0x 320 */
|
||||||
|
114, 95, 48,120, 53, 48, 0, 96, 0, 0, 0, 82,101,108,111, 99, /* 0x 330 */
|
||||||
|
115, 0,172, 0, 0, 0, 73,109,112,111,114,116,115, 0, 12, 1, /* 0x 340 */
|
||||||
|
0, 0,117, 99,108, 95,110,114,118, 50,101, 95,100,101, 99,111, /* 0x 350 */
|
||||||
|
109,112,114,101,115,115, 95, 56, 0,200, 1, 0, 0, 67, 97,108, /* 0x 360 */
|
||||||
|
108, 50, 69, 0,220, 2, 0, 0, 0, 0, 0, 0,223, 2, 0, 0, /* 0x 370 */
|
||||||
|
117, 99,108, 95,110,114,118, 50,101, 95,100,101, 99,111,109,112, /* 0x 380 */
|
||||||
|
114,101,115,115, 95, 56, 0, 0, 0, 0, 0, 85, 80, 88, 49, 72, /* 0x 390 */
|
||||||
|
69, 65, 68, 0,224, 2, 0, 0,101,111,102, 0, 0, 3, 0, 0, /* 0x 3a0 */
|
||||||
|
255,255,255,255, 0, 3, 0, 0 /* 0x 3b0 */
|
||||||
|
};
|
||||||
@@ -0,0 +1,345 @@
|
|||||||
|
/* l_armpet.S -- ARM/PE decompressor assembly startup (thumb mode)
|
||||||
|
|
||||||
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
|
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996-2006 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2006 John F. Reiser
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
and/or modify them under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of
|
||||||
|
the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DEBUG 0
|
||||||
|
|
||||||
|
// magic for the UPX linker
|
||||||
|
#define SECT(n) .text 1; .asciz #n; .long n - _start; .text 0; n
|
||||||
|
|
||||||
|
#define BL(t) \
|
||||||
|
.text 1; .long 0, bl##t - _start; .asciz #t; .long 0; \
|
||||||
|
.text 0; .byte 0, 0, 0; bl##t: .byte 0xf8
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
.text
|
||||||
|
.balign 0
|
||||||
|
.globl _start
|
||||||
|
.arm
|
||||||
|
_start:
|
||||||
|
|
||||||
|
dst0 .req r9 @ global register
|
||||||
|
|
||||||
|
SECT(DllStart):
|
||||||
|
cmp r1, #1
|
||||||
|
bne .Lstart_orig
|
||||||
|
|
||||||
|
SECT(ExeStart):
|
||||||
|
stmfd sp!, {r0 - r11, lr}
|
||||||
|
|
||||||
|
@ access all pages in ARM mode - this seems to be required
|
||||||
|
@ otherwise the THUMB mode stuff fails
|
||||||
|
|
||||||
|
adr r3, SRC0
|
||||||
|
ldmia r3, {r5, r6, r7, r9, r10, r11, ip} @ r7=dst0
|
||||||
|
add r5, pc, #4096 @ r3=addr src0, r10=LoadLibraryW
|
||||||
|
.L01: @ r11=GetProcAddressA, ip=CacheSync
|
||||||
|
ldr r6, [r7]
|
||||||
|
add r7, r7, #4096
|
||||||
|
cmp r7, r5
|
||||||
|
bls .L01
|
||||||
|
|
||||||
|
adr r4, ProcessAll + 1
|
||||||
|
mov lr, pc
|
||||||
|
bx r4
|
||||||
|
|
||||||
|
ldmfd sp!, {r0 - r11, lr}
|
||||||
|
.Lstart_orig:
|
||||||
|
ldr ip, ENTR
|
||||||
|
bx ip
|
||||||
|
|
||||||
|
SRC0: .ascii "SRC0" @ start of compressed data
|
||||||
|
SRCL: .ascii "SRCL" @ compressed length
|
||||||
|
DST0: .ascii "DST0" @ start of uncompressed data
|
||||||
|
DSTL: .ascii "DSTL" @ uncompressed length
|
||||||
|
IATT: .ascii "IATT"; .long 0, 0, 0 @ import address table
|
||||||
|
ENTR: .ascii "ENTR" @ original entry point
|
||||||
|
|
||||||
|
.thumb
|
||||||
|
|
||||||
|
ProcessAll:
|
||||||
|
ldmia r3!, {r0, r1, r2} @ r0=src0, r1=slen, r2=dst0, r3=addr dstl
|
||||||
|
mov dst0, r2
|
||||||
|
mov r4, ip @ CacheSync
|
||||||
|
push {r4, lr}
|
||||||
|
.align 2
|
||||||
|
|
||||||
|
@@ uncompress/unfilter/imports/relocs are copied here by the upx linker
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(Unfilter_0x50):
|
||||||
|
.align 2
|
||||||
|
buffer .req r0
|
||||||
|
addval .req r2
|
||||||
|
bufend .req r4
|
||||||
|
|
||||||
|
ldr buffer, FIBS
|
||||||
|
mov addval, #0
|
||||||
|
ldr bufend, FIBE
|
||||||
|
mov r5, #0x0f
|
||||||
|
mov r6, #0xff
|
||||||
|
lsl r6, #24
|
||||||
|
mvn r7, r6
|
||||||
|
.Luf50_0:
|
||||||
|
cmp buffer, bufend
|
||||||
|
beq .Luf50_ret
|
||||||
|
|
||||||
|
ldr r3, [buffer]
|
||||||
|
lsr r1, r3, #24
|
||||||
|
and r1, r5
|
||||||
|
cmp r1, #0x0b
|
||||||
|
bne .Luf50_1
|
||||||
|
mov r1, r3
|
||||||
|
and r1, r6
|
||||||
|
sub r3, addval
|
||||||
|
and r3, r7
|
||||||
|
orr r3, r1
|
||||||
|
str r3, [buffer]
|
||||||
|
|
||||||
|
.Luf50_1:
|
||||||
|
add buffer, #4
|
||||||
|
add addval, #1
|
||||||
|
b .Luf50_0
|
||||||
|
|
||||||
|
.unreq buffer
|
||||||
|
.unreq addval
|
||||||
|
.unreq bufend
|
||||||
|
|
||||||
|
.align 2
|
||||||
|
FIBS: .ascii "FIBS" @ buffer start for filter
|
||||||
|
FIBE: .ascii "FIBE" @ buffer end for filter
|
||||||
|
|
||||||
|
.Luf50_ret:
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(Relocs):
|
||||||
|
.align 2
|
||||||
|
buffer .req r0
|
||||||
|
dest .req r1
|
||||||
|
addval .req r2
|
||||||
|
|
||||||
|
ldr buffer, BREL
|
||||||
|
mov addval, dst0
|
||||||
|
sub dest, addval, #4
|
||||||
|
|
||||||
|
.Lreloc_loop:
|
||||||
|
ldrb r3, [buffer]
|
||||||
|
add buffer, #1
|
||||||
|
cmp r3, #0
|
||||||
|
beq .Lreloc_end
|
||||||
|
cmp r3, #0xf0
|
||||||
|
blo .Lreloc_add
|
||||||
|
|
||||||
|
mov r4, #0x0f
|
||||||
|
and r4, r3
|
||||||
|
ldrb r3, [buffer, #1] @ get_le16
|
||||||
|
lsl r4, #8
|
||||||
|
add r4, r3
|
||||||
|
ldrb r3, [buffer]
|
||||||
|
add buffer, #2
|
||||||
|
lsl r4, #8
|
||||||
|
add r3, r4
|
||||||
|
|
||||||
|
.Lreloc_add:
|
||||||
|
add dest, r3
|
||||||
|
mov r5, #0
|
||||||
|
|
||||||
|
.Lread_be32:
|
||||||
|
ldrb r3, [dest, r5]
|
||||||
|
lsl r4, #8
|
||||||
|
add r4, r3
|
||||||
|
add r5, #1
|
||||||
|
cmp r5, #4
|
||||||
|
bne .Lread_be32
|
||||||
|
|
||||||
|
add r4, addval
|
||||||
|
str r4, [dest]
|
||||||
|
b .Lreloc_loop
|
||||||
|
|
||||||
|
.align 2
|
||||||
|
BREL: .ascii "BREL" @ start of reloc info
|
||||||
|
|
||||||
|
.Lreloc_end:
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(Imports):
|
||||||
|
.align 2
|
||||||
|
imp .req r4
|
||||||
|
iat .req r5
|
||||||
|
dll .req r6
|
||||||
|
|
||||||
|
mov r7, sp
|
||||||
|
sub sp, #508
|
||||||
|
sub sp, #508
|
||||||
|
sub sp, #508
|
||||||
|
sub sp, #508
|
||||||
|
ldr imp, BIMP
|
||||||
|
.Lhi_loop1:
|
||||||
|
mov r0, imp
|
||||||
|
bl get_le32
|
||||||
|
beq .Lhi_end
|
||||||
|
|
||||||
|
ldr r1, ONAM
|
||||||
|
add r0, r1
|
||||||
|
mov r1, sp
|
||||||
|
.Lhi_copyname:
|
||||||
|
ldrb r2, [r0]
|
||||||
|
add r0, #1
|
||||||
|
strh r2, [r1]
|
||||||
|
add r1, #2
|
||||||
|
cmp r2, #0
|
||||||
|
bne .Lhi_copyname
|
||||||
|
|
||||||
|
mov r0, sp
|
||||||
|
bl LoadLibraryW
|
||||||
|
mov dll, r0
|
||||||
|
add r0, imp, #4
|
||||||
|
bl get_le32
|
||||||
|
mov iat, dst0
|
||||||
|
add iat, r0
|
||||||
|
add imp, #8
|
||||||
|
|
||||||
|
.Lhi_gpa_loop:
|
||||||
|
ldrb r0, [imp]
|
||||||
|
add imp, #1
|
||||||
|
cmp r0, #1
|
||||||
|
bmi .Lhi_loop1
|
||||||
|
bne .Lhi_by_ord
|
||||||
|
|
||||||
|
mov r1, imp
|
||||||
|
.Lhi_by_name:
|
||||||
|
ldrb r0, [imp]
|
||||||
|
add imp, #1
|
||||||
|
cmp r0, #0
|
||||||
|
bne .Lhi_by_name
|
||||||
|
b .Lhi_call_gpa
|
||||||
|
|
||||||
|
.Lhi_by_ord:
|
||||||
|
ldrb r0, [imp]
|
||||||
|
ldrb r1, [imp, #1]
|
||||||
|
add imp, #2
|
||||||
|
lsl r1, #8
|
||||||
|
add r1, r0
|
||||||
|
|
||||||
|
.Lhi_call_gpa:
|
||||||
|
mov r0, dll
|
||||||
|
bl GetProcAddressA
|
||||||
|
stmia iat!, {r0}
|
||||||
|
b .Lhi_gpa_loop
|
||||||
|
|
||||||
|
.unreq iat
|
||||||
|
.unreq imp
|
||||||
|
.unreq dll
|
||||||
|
|
||||||
|
get_le32: @ optimized for size
|
||||||
|
mov r1, #3
|
||||||
|
.Lg0:
|
||||||
|
ldrb r3, [r0, r1]
|
||||||
|
lsl r2, r2, #8
|
||||||
|
add r2, r2, r3
|
||||||
|
sub r1, #1
|
||||||
|
bpl .Lg0
|
||||||
|
mov r0, r2 @ sets the Z flag if zero
|
||||||
|
bx lr
|
||||||
|
|
||||||
|
LoadLibraryW:
|
||||||
|
bx r10
|
||||||
|
|
||||||
|
GetProcAddressA:
|
||||||
|
bx r11
|
||||||
|
|
||||||
|
.align 2
|
||||||
|
BIMP: .ascii "BIMP" @ start of import data
|
||||||
|
ONAM: .ascii "ONAM" @ start of dll names
|
||||||
|
|
||||||
|
.Lhi_end:
|
||||||
|
mov sp, r7
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(ProcessEnd):
|
||||||
|
pop {r1, r2} @ r1=CacheSync, r2=lr
|
||||||
|
mov r0, #4 @ parameter of CacheSync
|
||||||
|
mov lr, r2
|
||||||
|
bx r1
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
#define XSECT(n) .text 1; .asciz #n; .long n - _start; .text 0
|
||||||
|
|
||||||
|
SECT(dummy0):
|
||||||
|
.align 2
|
||||||
|
.arm
|
||||||
|
#include "arm_nrv2b_d8.S"
|
||||||
|
|
||||||
|
XSECT (go_thumb_n2b)
|
||||||
|
|
||||||
|
SECT(Call2B):
|
||||||
|
BL (go_thumb_n2b)
|
||||||
|
|
||||||
|
#undef wrnk
|
||||||
|
#undef GETBIT
|
||||||
|
|
||||||
|
SECT(dummy1):
|
||||||
|
.align 2
|
||||||
|
.arm
|
||||||
|
#include "arm_nrv2e_d8.S"
|
||||||
|
|
||||||
|
XSECT (thumb_nrv2e_d8)
|
||||||
|
|
||||||
|
SECT(Call2E):
|
||||||
|
BL (thumb_nrv2e_d8)
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
SECT(UPX1HEAD):
|
||||||
|
.byte 85,80,88,33 @ 0 UPX_MAGIC_LE32
|
||||||
|
.byte 161,216,208,213 @ 4 UPX_MAGIC2_LE32
|
||||||
|
.long 0 @ 8 uncompressed adler32
|
||||||
|
.long 0 @ 12 compressed adler32
|
||||||
|
.long 0 @ 16 uncompressed len
|
||||||
|
.long 0 @ 20 compressed len
|
||||||
|
.long 0 @ 24 original file size
|
||||||
|
.byte 0 @ 28 filter id
|
||||||
|
.byte 0 @ 29 filter cto
|
||||||
|
.byte 0 @ unused
|
||||||
|
.byte 45 @ 31 header checksum
|
||||||
|
|
||||||
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
.arm
|
||||||
|
SECT(eof):
|
||||||
|
.text 1
|
||||||
|
.long -1; .short eof - _start
|
||||||
|
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
/* l_armpet.h -- created from l_armpet.bin, 1000 (0x3e8) bytes
|
||||||
|
|
||||||
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
|
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996-2006 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2006 John F. Reiser
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
and/or modify them under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of
|
||||||
|
the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
|
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define NRV_LOADER_THUMB_SIZE 1000
|
||||||
|
#define NRV_LOADER_THUMB_ADLER32 0x4f344c3e
|
||||||
|
#define NRV_LOADER_THUMB_CRC32 0xe1803a67
|
||||||
|
|
||||||
|
unsigned char nrv_loader_thumb[1000] = {
|
||||||
|
1, 0, 81,227, 11, 0, 0, 26,255, 79, 45,233, 44, 48,143,226, /* 0x 0 */
|
||||||
|
224, 30,147,232, 1, 90,143,226, 0, 96,151,229, 1,122,135,226, /* 0x 10 */
|
||||||
|
5, 0, 87,225,251,255,255,154, 53, 64,143,226, 15,224,160,225, /* 0x 20 */
|
||||||
|
20,255, 47,225,255, 79,189,232, 32,192,159,229, 28,255, 47,225, /* 0x 30 */
|
||||||
|
83, 82, 67, 48, 83, 82, 67, 76, 68, 83, 84, 48, 68, 83, 84, 76, /* 0x 40 */
|
||||||
|
73, 65, 84, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||||
|
69, 78, 84, 82, 7,203,145, 70,100, 70, 16,181, 11, 72, 0, 34, /* 0x 60 */
|
||||||
|
11, 76, 15, 37,255, 38, 54, 6,247, 67,160, 66, 18,208, 3,104, /* 0x 70 */
|
||||||
|
25, 14, 41, 64, 11, 41, 5,209, 25, 28, 49, 64,155, 26, 59, 64, /* 0x 80 */
|
||||||
|
11, 67, 3, 96, 4, 48, 1, 50,239,231, 0, 0, 70, 73, 66, 83, /* 0x 90 */
|
||||||
|
70, 73, 66, 69, 14, 72, 74, 70, 17, 31, 3,120, 1, 48, 0, 43, /* 0x a0 */
|
||||||
|
24,208,240, 43, 8,211, 15, 36, 28, 64, 67,120, 36, 2,228, 24, /* 0x b0 */
|
||||||
|
3,120, 2, 48, 36, 2, 27, 25,201, 24, 0, 37, 75, 93, 36, 2, /* 0x c0 */
|
||||||
|
228, 24, 1, 53, 4, 45,249,209,164, 24, 12, 96,229,231, 0, 0, /* 0x d0 */
|
||||||
|
66, 82, 69, 76,111, 70,255,176,255,176,255,176,255,176, 27, 76, /* 0x e0 */
|
||||||
|
32, 28, 0,240, 41,248, 53,208, 25, 73, 64, 24,105, 70, 2,120, /* 0x f0 */
|
||||||
|
1, 48, 10,128, 2, 49, 0, 42,249,209,104, 70, 0,240, 36,248, /* 0x 100 */
|
||||||
|
6, 28, 32, 29, 0,240, 24,248, 77, 70, 45, 24, 8, 52, 32,120, /* 0x 110 */
|
||||||
|
1, 52, 1, 40,228,212, 5,209, 33, 28, 32,120, 1, 52, 0, 40, /* 0x 120 */
|
||||||
|
251,209, 4,224, 32,120, 97,120, 2, 52, 9, 2, 9, 24, 48, 28, /* 0x 130 */
|
||||||
|
0,240, 11,248, 1,197,234,231, 3, 33, 67, 92, 18, 2,210, 24, /* 0x 140 */
|
||||||
|
1, 57,250,213, 16, 28,112, 71, 80, 71, 88, 71, 66, 73, 77, 80, /* 0x 150 */
|
||||||
|
79, 78, 65, 77,189, 70, 6,188, 4, 32,150, 70, 8, 71, 0, 0, /* 0x 160 */
|
||||||
|
1,192,143,226, 28,255, 47,225, 9, 24,254,181, 1, 36,101, 66, /* 0x 170 */
|
||||||
|
228, 7, 13, 39, 63, 2, 15,224, 26,188, 64, 26,210, 26, 34, 96, /* 0x 180 */
|
||||||
|
240,188, 2,188, 8, 71, 4,120,100, 65, 1, 48, 36, 6,247, 70, /* 0x 190 */
|
||||||
|
3,120, 1, 48, 19,112, 1, 50, 36, 25,254, 70,243,208,247,210, /* 0x 1a0 */
|
||||||
|
1, 33, 36, 25,254, 70,238,208, 73, 65, 36, 25,254, 70,234,208, /* 0x 1b0 */
|
||||||
|
247,211,203, 30, 0, 33, 5,211, 27, 2, 5,120, 1, 48, 29, 67, /* 0x 1c0 */
|
||||||
|
237, 67,217,208, 36, 25,254, 70,221,208, 73, 65, 36, 25,254, 70, /* 0x 1d0 */
|
||||||
|
217,208, 73, 65, 9,209, 1, 33, 36, 25,254, 70,211,208, 73, 65, /* 0x 1e0 */
|
||||||
|
36, 25,254, 70,207,208,247,211, 2, 49, 1, 49,253, 66, 0,210, /* 0x 1f0 */
|
||||||
|
1, 49, 19,120, 83, 93, 19,112, 1, 50, 1, 57,250,209,203,231, /* 0x 200 */
|
||||||
|
0, 0, 0,248, 1,192,143,226, 28,255, 47,225,252,181, 15, 24, /* 0x 210 */
|
||||||
|
1, 36,101, 66,228, 7, 5, 38, 54, 2, 15,224, 24,188,192, 27, /* 0x 220 */
|
||||||
|
210, 26, 34, 96,240,188, 2,188, 8, 71, 4,120,100, 65, 1, 48, /* 0x 230 */
|
||||||
|
36, 6,247, 70, 3,120, 1, 48, 19,112, 1, 50, 36, 25,254, 70, /* 0x 240 */
|
||||||
|
243,208,247,210, 1, 33, 4,224, 1, 57, 36, 25,254, 70,236,208, /* 0x 250 */
|
||||||
|
73, 65, 36, 25,254, 70,232,208, 73, 65, 36, 25,254, 70,228,208, /* 0x 260 */
|
||||||
|
242,211,203, 30, 0, 33, 8,211, 27, 2, 5,120, 1, 48, 29, 67, /* 0x 270 */
|
||||||
|
237, 67,211,208,109, 16, 19,210, 3,224, 36, 25,254, 70,212,208, /* 0x 280 */
|
||||||
|
14,210, 1, 33, 36, 25,254, 70,207,208, 9,210, 36, 25,254, 70, /* 0x 290 */
|
||||||
|
203,208, 73, 65, 36, 25,254, 70,199,208,247,211, 4, 49, 4,224, /* 0x 2a0 */
|
||||||
|
36, 25,254, 70,193,208, 73, 65, 2, 49,238, 66, 0,210, 1, 49, /* 0x 2b0 */
|
||||||
|
19,120, 83, 93, 19,112, 1, 50, 1, 57,250,209,190,231, 0, 0, /* 0x 2c0 */
|
||||||
|
0,248, 85, 80, 88, 33,161,216,208,213, 0, 0, 0, 0, 0, 0, /* 0x 2d0 */
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 2e0 */
|
||||||
|
0, 45, 0, 0, 68,108,108, 83,116, 97,114,116, 0, 0, 0, 0, /* 0x 2f0 */
|
||||||
|
0, 69,120,101, 83,116, 97,114,116, 0, 8, 0, 0, 0, 85,110, /* 0x 300 */
|
||||||
|
102,105,108,116,101,114, 95, 48,120, 53, 48, 0,108, 0, 0, 0, /* 0x 310 */
|
||||||
|
82,101,108,111, 99,115, 0,164, 0, 0, 0, 73,109,112,111,114, /* 0x 320 */
|
||||||
|
116,115, 0,228, 0, 0, 0, 80,114,111, 99,101,115,115, 69,110, /* 0x 330 */
|
||||||
|
100, 0,102, 1, 0, 0,100,117,109,109,121, 48, 0,110, 1, 0, /* 0x 340 */
|
||||||
|
0,103,111, 95,116,104,117,109, 98, 95,110, 50, 98, 0,120, 1, /* 0x 350 */
|
||||||
|
0, 0, 67, 97,108,108, 50, 66, 0, 16, 2, 0, 0, 0, 0, 0, /* 0x 360 */
|
||||||
|
0, 19, 2, 0, 0,103,111, 95,116,104,117,109, 98, 95,110, 50, /* 0x 370 */
|
||||||
|
98, 0, 0, 0, 0, 0,100,117,109,109,121, 49, 0, 20, 2, 0, /* 0x 380 */
|
||||||
|
0,116,104,117,109, 98, 95,110,114,118, 50,101, 95,100, 56, 0, /* 0x 390 */
|
||||||
|
28, 2, 0, 0, 67, 97,108,108, 50, 69, 0,206, 2, 0, 0, 0, /* 0x 3a0 */
|
||||||
|
0, 0, 0,209, 2, 0, 0,116,104,117,109, 98, 95,110,114,118, /* 0x 3b0 */
|
||||||
|
50,101, 95,100, 56, 0, 0, 0, 0, 0, 85, 80, 88, 49, 72, 69, /* 0x 3c0 */
|
||||||
|
65, 68, 0,210, 2, 0, 0,101,111,102, 0,244, 2, 0, 0,255, /* 0x 3d0 */
|
||||||
|
255,255,255,244, 2, 0, 0, 0 /* 0x 3e0 */
|
||||||
|
};
|
||||||
+62
-3
@@ -35,10 +35,45 @@
|
|||||||
SECTION .text
|
SECTION .text
|
||||||
CPU 8086
|
CPU 8086
|
||||||
|
|
||||||
|
; __DEVICEENTRY__
|
||||||
|
|
||||||
|
dd -1
|
||||||
|
dw 0
|
||||||
|
dw strategy ; .sys header
|
||||||
|
dw 0 ; opendos wants this field untouched
|
||||||
|
original_strategy:
|
||||||
|
dw 'ST'
|
||||||
|
strategy:
|
||||||
|
push cs
|
||||||
|
push word [cs:original_strategy]
|
||||||
|
push ax
|
||||||
|
push bx
|
||||||
|
push cx
|
||||||
|
push dx
|
||||||
|
mov ax, cs
|
||||||
|
add ax, 'OS' ; calculate normal EXE stack
|
||||||
|
mov bx, 'OP'
|
||||||
|
mov cx, ss
|
||||||
|
mov dx, sp
|
||||||
|
mov ss, ax ; switch to stack EXE normally has
|
||||||
|
mov sp, bx
|
||||||
|
push cx ; save device stack on EXE stack
|
||||||
|
push dx
|
||||||
|
push si
|
||||||
|
push di
|
||||||
|
push bp
|
||||||
|
push ds
|
||||||
|
push es
|
||||||
|
db 0x72 ; "jc 0xf9" but flag C is 0 => nop
|
||||||
|
exe_as_device_entry:
|
||||||
|
stc ; flag C is 1
|
||||||
|
pushf
|
||||||
|
|
||||||
; =============
|
; =============
|
||||||
; ============= ENTRY POINT
|
; ============= ENTRY POINT
|
||||||
; =============
|
; =============
|
||||||
; __EXEENTRY__
|
; __EXEENTRY__
|
||||||
|
exe_entry:
|
||||||
mov cx, 'CX' ; first_copy_len/2
|
mov cx, 'CX' ; first_copy_len/2
|
||||||
mov si, 'SI' ; cx*2-2
|
mov si, 'SI' ; cx*2-2
|
||||||
mov di, si
|
mov di, si
|
||||||
@@ -47,7 +82,8 @@
|
|||||||
do_copy:
|
do_copy:
|
||||||
mov ch, 0x80 ; 64 kbyte
|
mov ch, 0x80 ; 64 kbyte
|
||||||
mov ax, cs
|
mov ax, cs
|
||||||
add ax, 'DS'
|
addaxds:
|
||||||
|
add ax, 'DS' ; MSB is referenced by the "sub" below
|
||||||
mov ds, ax
|
mov ds, ax
|
||||||
add ax, 'ES'
|
add ax, 'ES'
|
||||||
mov es, ax
|
mov es, ax
|
||||||
@@ -56,8 +92,11 @@ do_copy:
|
|||||||
rep
|
rep
|
||||||
movsw
|
movsw
|
||||||
cld
|
cld
|
||||||
|
; __DEVICESUB__
|
||||||
sub [byte cs:si+do_copy+6+2], byte 0x10
|
sub [byte cs:si + addaxds + 4], byte 0x10
|
||||||
|
; __EXESUB__
|
||||||
|
sub [byte cs:si + addaxds - exe_entry + 4], byte 0x10
|
||||||
|
; __JNCDOCOPY__
|
||||||
jnc do_copy
|
jnc do_copy
|
||||||
xchg ax, dx
|
xchg ax, dx
|
||||||
scasw
|
scasw
|
||||||
@@ -152,6 +191,26 @@ reloc_5:
|
|||||||
pop es
|
pop es
|
||||||
push es
|
push es
|
||||||
pop ds
|
pop ds
|
||||||
|
|
||||||
|
; __DEVICEEND__
|
||||||
|
popf
|
||||||
|
jc loaded_as_exe
|
||||||
|
pop es
|
||||||
|
pop ds
|
||||||
|
pop bp
|
||||||
|
pop di
|
||||||
|
pop si
|
||||||
|
pop bx ; get original device SS:SP
|
||||||
|
pop ax
|
||||||
|
mov ss, ax ; switch to device driver stack
|
||||||
|
mov sp, bx
|
||||||
|
pop dx
|
||||||
|
pop cx
|
||||||
|
pop bx
|
||||||
|
pop ax
|
||||||
|
retf ; return to original strategy
|
||||||
|
|
||||||
|
loaded_as_exe:
|
||||||
%ifdef __EXESTACK__
|
%ifdef __EXESTACK__
|
||||||
lea ax, ['SS'+bp]
|
lea ax, ['SS'+bp]
|
||||||
mov ss, ax
|
mov ss, ax
|
||||||
|
|||||||
+154
-144
@@ -1,4 +1,4 @@
|
|||||||
/* l_exe.h -- created from l_exe.bin, 2215 (0x8a7) bytes
|
/* l_exe.h -- created from l_exe.bin, 2377 (0x949) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,148 +27,158 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define NRV_LOADER_SIZE 2215
|
#define NRV_LOADER_SIZE 2377
|
||||||
#define NRV_LOADER_ADLER32 0x4b5438fc
|
#define NRV_LOADER_ADLER32 0xe8176e1e
|
||||||
#define NRV_LOADER_CRC32 0x250186be
|
#define NRV_LOADER_CRC32 0x723ae5c1
|
||||||
|
|
||||||
unsigned char nrv_loader[2215] = {
|
unsigned char nrv_loader[2377] = {
|
||||||
185, 67, 88,190, 83, 73,137,247, 30,169,181,128,140,200, 5, 68, /* 0x 0 */
|
255,255,255,255, 0, 0, 12, 0, 0, 0, 83, 84, 14, 46,255, 54, /* 0x 0 */
|
||||||
83,142,216, 5, 69, 83,142,192,253,243,165,252, 46,128,108, 18, /* 0x 10 */
|
10, 0, 80, 83, 81, 82,140,200, 5, 79, 83,187, 79, 80,140,209, /* 0x 10 */
|
||||||
16,115,231,146,175,173, 14, 14, 14, 6, 31, 7, 22,189, 66, 80, /* 0x 20 */
|
137,226,142,208,137,220, 81, 82, 86, 87, 85, 30, 6,114,249,156, /* 0x 20 */
|
||||||
187, 66, 88, 85,203, 85, 80, 88, 33,161,216,208,213, 0, 0, 0, /* 0x 30 */
|
185, 67, 88,190, 83, 73,137,247, 30,169,181,128,140,200, 5, 68, /* 0x 30 */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, /* 0x 40 */
|
83,142,216, 5, 69, 83,142,192,253,243,165,252, 46,128,108, 66, /* 0x 40 */
|
||||||
164, 0,255,117, 3,232, 0, 0,114,246, 65,140,192, 1,255,115, /* 0x 50 */
|
16, 46,128,108, 18, 16,115, 0,146,175,173, 14, 14, 14, 6, 31, /* 0x 50 */
|
||||||
5,128,196, 8,142,192,209,239,232, 0, 0,227, 0,115,249, 73, /* 0x 60 */
|
7, 22,189, 66, 80,187, 66, 88, 85,203, 85, 80, 88, 33,161,216, /* 0x 60 */
|
||||||
73,116, 0, 1,201, 1,201, 1,201, 1,201,193,225, 4,137,205, /* 0x 70 */
|
208,213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||||
138, 28, 70,246,211, 49,201,232, 0, 0, 17,201,117, 8, 65,232, /* 0x 80 */
|
0, 0, 0, 0, 45,164, 0,255,117, 3,232, 0, 0,114,246, 65, /* 0x 80 */
|
||||||
0, 0,115,251, 65, 65,129,253,209, 0,131,217,254, 41,232,114, /* 0x 90 */
|
140,192, 1,255,115, 5,128,196, 8,142,192,209,239,232, 0, 0, /* 0x 90 */
|
||||||
14,142,216,141, 1, 40,252,150,243,164,150,142,218,235, 0,209, /* 0x a0 */
|
227, 0,115,249, 73, 73,116, 0, 1,201, 1,201, 1,201, 1,201, /* 0x a0 */
|
||||||
224,209,224,209,224,209,224, 80, 49,192,142,216, 88,193,224, 4, /* 0x b0 */
|
193,225, 4,137,205,138, 28, 70,246,211, 49,201,232, 0, 0, 17, /* 0x b0 */
|
||||||
106, 0, 31, 1,216, 1,248,235, 0, 0,255,117, 3,232, 6, 0, /* 0x c0 */
|
201,117, 8, 65,232, 0, 0,115,251, 65, 65,129,253,209, 0,131, /* 0x c0 */
|
||||||
17,201, 0,255,117, 0,138, 60, 17,246,115, 5,128,198, 8,142, /* 0x d0 */
|
217,254, 41,232,114, 14,142,216,141, 1, 40,252,150,243,164,150, /* 0x d0 */
|
||||||
218,209,238, 70, 16,255,195,164, 0,255,117, 3,232, 0, 0,114, /* 0x e0 */
|
142,218,235, 0,209,224,209,224,209,224,209,224, 80, 49,192,142, /* 0x e0 */
|
||||||
246, 65,140,192, 1,255,115, 5,128,196, 8,142,192,209,239,232, /* 0x f0 */
|
216, 88,193,224, 4,106, 0, 31, 1,216, 1,248,235, 0, 0,255, /* 0x f0 */
|
||||||
0, 0,114, 10, 73,232, 0, 0, 17,201,121,243,235, 0, 73, 73, /* 0x 100 */
|
117, 3,232, 6, 0, 17,201, 0,255,117, 0,138, 60, 17,246,115, /* 0x 100 */
|
||||||
116, 0, 1,201, 1,201, 1,201,193,225, 3,137,205,138, 28, 70, /* 0x 110 */
|
5,128,198, 8,142,218,209,238, 70, 16,255,195,164, 0,255,117, /* 0x 110 */
|
||||||
246,211, 49,201,208,235,235, 3,232, 0, 0, 17,201,232, 0, 0, /* 0x 120 */
|
3,232, 0, 0,114,246, 65,140,192, 1,255,115, 5,128,196, 8, /* 0x 120 */
|
||||||
17,201,117, 8, 65,232, 0, 0,115,251, 65, 65,131,253, 81,131, /* 0x 130 */
|
142,192,209,239,232, 0, 0,114, 10, 73,232, 0, 0, 17,201,121, /* 0x 130 */
|
||||||
217,254, 41,232,114, 14,142,216,141, 1, 40,252,150,243,164,150, /* 0x 140 */
|
243,235, 0, 73, 73,116, 0, 1,201, 1,201, 1,201,193,225, 3, /* 0x 140 */
|
||||||
142,218,235, 0,209,224,209,224,209,224,209,224, 80, 49,192,142, /* 0x 150 */
|
137,205,138, 28, 70,246,211, 49,201,208,235,235, 3,232, 0, 0, /* 0x 150 */
|
||||||
216, 88,193,224, 4,106, 0, 31, 1,216, 1,248,235, 0, 0,255, /* 0x 160 */
|
17,201,232, 0, 0, 17,201,117, 8, 65,232, 0, 0,115,251, 65, /* 0x 160 */
|
||||||
117, 3,232, 6, 0, 17,201, 0,255,117, 0,138, 60, 17,246,115, /* 0x 170 */
|
65,131,253, 81,131,217,254, 41,232,114, 14,142,216,141, 1, 40, /* 0x 170 */
|
||||||
5,128,198, 8,142,218,209,238, 70, 16,255,195,164, 0,255,117, /* 0x 180 */
|
252,150,243,164,150,142,218,235, 0,209,224,209,224,209,224,209, /* 0x 180 */
|
||||||
3,232, 0, 0,114,246, 65,140,192, 1,255,115, 5,128,196, 8, /* 0x 190 */
|
224, 80, 49,192,142,216, 88,193,224, 4,106, 0, 31, 1,216, 1, /* 0x 190 */
|
||||||
142,192,209,239,232, 0, 0,114, 10, 73,232, 0, 0, 17,201,121, /* 0x 1a0 */
|
248,235, 0, 0,255,117, 3,232, 6, 0, 17,201, 0,255,117, 0, /* 0x 1a0 */
|
||||||
243,235, 0, 73, 73,116, 0, 1,201, 1,201, 1,201,193,225, 3, /* 0x 1b0 */
|
138, 60, 17,246,115, 5,128,198, 8,142,218,209,238, 70, 16,255, /* 0x 1b0 */
|
||||||
137,205,138, 28, 70,246,211, 49,201,208,235,115, 12,232, 0, 0, /* 0x 1c0 */
|
195,164, 0,255,117, 3,232, 0, 0,114,246, 65,140,192, 1,255, /* 0x 1c0 */
|
||||||
17,201,235, 18,232, 0, 0,114,244, 65,232, 0, 0,114,238,232, /* 0x 1d0 */
|
115, 5,128,196, 8,142,192,209,239,232, 0, 0,114, 10, 73,232, /* 0x 1d0 */
|
||||||
0, 0,115,251, 65, 65,131,253, 81,131,217,253, 41,232,114, 14, /* 0x 1e0 */
|
0, 0, 17,201,121,243,235, 0, 73, 73,116, 0, 1,201, 1,201, /* 0x 1e0 */
|
||||||
142,216,141, 1, 40,252,150,243,164,150,142,218,235, 0,209,224, /* 0x 1f0 */
|
1,201,193,225, 3,137,205,138, 28, 70,246,211, 49,201,208,235, /* 0x 1f0 */
|
||||||
209,224,209,224,209,224, 80, 49,192,142,216, 88,193,224, 4,106, /* 0x 200 */
|
115, 12,232, 0, 0, 17,201,235, 18,232, 0, 0,114,244, 65,232, /* 0x 200 */
|
||||||
0, 31, 1,216, 1,248,235, 0, 0,255,117, 3,232, 6, 0, 17, /* 0x 210 */
|
0, 0,114,238,232, 0, 0,115,251, 65, 65,131,253, 81,131,217, /* 0x 210 */
|
||||||
201, 0,255,117, 0,138, 60, 17,246,115, 5,128,198, 8,142,218, /* 0x 220 */
|
253, 41,232,114, 14,142,216,141, 1, 40,252,150,243,164,150,142, /* 0x 220 */
|
||||||
209,238, 70, 16,255,195, 93,140,192,128,236, 6,142,216, 6, 31, /* 0x 230 */
|
218,235, 0,209,224,209,224,209,224,209,224, 80, 49,192,142,216, /* 0x 230 */
|
||||||
141,181, 82, 83,173, 91,145,173,146,173,151,173, 1,195,142,195, /* 0x 240 */
|
88,193,224, 4,106, 0, 31, 1,216, 1,248,235, 0, 0,255,117, /* 0x 240 */
|
||||||
49,192, 1,199, 38, 1, 45,172, 72,116, 0, 64,117,244, 71, 71, /* 0x 250 */
|
3,232, 6, 0, 17,201, 0,255,117, 0,138, 60, 17,246,115, 5, /* 0x 250 */
|
||||||
38,128, 61,154,117,249, 38, 57, 85, 3,119,243,176, 3,235, 0, /* 0x 260 */
|
128,198, 8,142,218,209,238, 70, 16,255,195, 93,140,192,128,236, /* 0x 260 */
|
||||||
129,199,254, 0,114, 0,226, 0, 7, 6, 31,141,134, 83, 83,142, /* 0x 270 */
|
6,142,216, 6, 31,141,181, 82, 83,173, 91,145,173,146,173,151, /* 0x 270 */
|
||||||
208,188, 83, 80,234, 73, 80, 67, 83,129,197, 67, 83, 85,184, 73, /* 0x 280 */
|
173, 1,195,142,195, 49,192, 1,199, 38, 1, 45,172, 72,116, 0, /* 0x 280 */
|
||||||
80, 80,203, 0, 69, 88, 69, 69, 78, 84, 82, 89, 0, 0, 0, 0, /* 0x 290 */
|
64,117,244, 71, 71, 38,128, 61,154,117,249, 38, 57, 85, 3,119, /* 0x 290 */
|
||||||
0, 69, 88, 69, 82, 69, 76, 80, 85, 0, 38, 0, 0, 0, 69, 88, /* 0x 2a0 */
|
243,176, 3,235, 0,129,199,254, 0,114, 0,226, 0, 7, 6, 31, /* 0x 2a0 */
|
||||||
69, 77, 65, 73, 78, 52, 0, 39, 0, 0, 0, 85, 80, 88, 49, 72, /* 0x 2b0 */
|
157,114, 16, 7, 31, 93, 95, 94, 91, 88,142,208,137,220, 90, 89, /* 0x 2b0 */
|
||||||
69, 65, 68, 0, 53, 0, 0, 0, 69, 88, 69, 67, 85, 84, 80, 79, /* 0x 2c0 */
|
91, 88,203,141,134, 83, 83,142,208,188, 83, 80,234, 73, 80, 67, /* 0x 2c0 */
|
||||||
0, 80, 0, 0, 0, 78, 82, 86, 50, 66, 49, 54, 83, 0, 80, 0, /* 0x 2d0 */
|
83,129,197, 67, 83, 85,184, 73, 80, 80,203, 0, 68, 69, 86, 73, /* 0x 2d0 */
|
||||||
0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 78, 82, 86, 50, 66, 69, /* 0x 2e0 */
|
67, 69, 69, 78, 84, 82, 89, 0, 0, 0, 0, 0, 69, 88, 69, 69, /* 0x 2e0 */
|
||||||
88, 51, 0, 19, 0, 0, 0, 78, 50, 66, 54, 52, 75, 48, 49, 0, /* 0x 2f0 */
|
78, 84, 82, 89, 0, 48, 0, 0, 0, 68, 69, 86, 73, 67, 69, 83, /* 0x 2f0 */
|
||||||
93, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 49, 0,104, 0, 0, /* 0x 300 */
|
85, 66, 0, 76, 0, 0, 0, 69, 88, 69, 83, 85, 66, 0, 81, 0, /* 0x 300 */
|
||||||
0, 0, 0, 0, 0,107, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, /* 0x 310 */
|
0, 0, 74, 78, 67, 68, 79, 67, 79, 80, 89, 0, 86, 0, 0, 0, /* 0x 310 */
|
||||||
51, 0, 6, 0, 0, 0, 0, 0, 0, 0,109, 0, 0, 0, 78, 82, /* 0x 320 */
|
0, 0, 0, 0, 88, 0, 0, 0, 69, 88, 69, 69, 78, 84, 82, 89, /* 0x 320 */
|
||||||
86, 50, 66, 69, 88, 57, 0, 4, 0, 0, 0, 0, 0, 0, 0,115, /* 0x 330 */
|
0, 10, 0, 0, 0, 69, 88, 69, 82, 69, 76, 80, 85, 0, 91, 0, /* 0x 330 */
|
||||||
0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 50, 0, 9, 0, 0, 0, /* 0x 340 */
|
0, 0, 69, 88, 69, 77, 65, 73, 78, 52, 0, 92, 0, 0, 0, 85, /* 0x 340 */
|
||||||
78, 50, 66, 88, 56, 54, 48, 49, 0,115, 0, 0, 0, 78, 50, 66, /* 0x 350 */
|
80, 88, 49, 72, 69, 65, 68, 0,106, 0, 0, 0, 69, 88, 69, 67, /* 0x 350 */
|
||||||
50, 56, 54, 48, 49, 0,123, 0, 0, 0, 78, 82, 86, 50, 66, 69, /* 0x 360 */
|
85, 84, 80, 79, 0,133, 0, 0, 0, 78, 82, 86, 50, 66, 49, 54, /* 0x 360 */
|
||||||
88, 50, 0,126, 0, 0, 0, 0, 0, 0, 0,138, 0, 0, 0, 78, /* 0x 370 */
|
83, 0,133, 0, 0, 0, 0, 0, 0, 0,141, 0, 0, 0, 78, 82, /* 0x 370 */
|
||||||
82, 86, 50, 66, 69, 88, 51, 0, 6, 0, 0, 0, 0, 0, 0, 0, /* 0x 380 */
|
86, 50, 66, 69, 88, 51, 0, 19, 0, 0, 0, 78, 50, 66, 54, 52, /* 0x 380 */
|
||||||
146, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 51, 0, 6, 0, 0, /* 0x 390 */
|
75, 48, 49, 0,146, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 49, /* 0x 390 */
|
||||||
0, 0, 0, 0, 0,175, 0, 0, 0, 78, 82, 86, 50, 66, 49, 54, /* 0x 3a0 */
|
0,157, 0, 0, 0, 0, 0, 0, 0,160, 0, 0, 0, 78, 82, 86, /* 0x 3a0 */
|
||||||
83, 0, 1, 0, 0, 0, 78, 50, 66, 88, 56, 54, 48, 50, 0,175, /* 0x 3b0 */
|
50, 66, 69, 88, 51, 0, 6, 0, 0, 0, 0, 0, 0, 0,162, 0, /* 0x 3b0 */
|
||||||
0, 0, 0, 78, 50, 66, 50, 56, 54, 48, 50, 0,189, 0, 0, 0, /* 0x 3c0 */
|
0, 0, 78, 82, 86, 50, 66, 69, 88, 57, 0, 4, 0, 0, 0, 0, /* 0x 3c0 */
|
||||||
78, 82, 86, 50, 66, 69, 88, 51, 0,195, 0, 0, 0, 0, 0, 0, /* 0x 3d0 */
|
0, 0, 0,168, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 50, 0, /* 0x 3d0 */
|
||||||
0,201, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 50, 0, 39, 0, /* 0x 3e0 */
|
9, 0, 0, 0, 78, 50, 66, 88, 56, 54, 48, 49, 0,168, 0, 0, /* 0x 3e0 */
|
||||||
0, 0, 0, 0, 0, 0,214, 0, 0, 0, 78, 82, 86, 50, 66, 69, /* 0x 3f0 */
|
0, 78, 50, 66, 50, 56, 54, 48, 49, 0,176, 0, 0, 0, 78, 82, /* 0x 3f0 */
|
||||||
88, 57, 0, 3, 0, 0, 0, 78, 50, 66, 54, 52, 75, 48, 50, 0, /* 0x 400 */
|
86, 50, 66, 69, 88, 50, 0,179, 0, 0, 0, 0, 0, 0, 0,191, /* 0x 400 */
|
||||||
216, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 57, 0,227, 0, 0, /* 0x 410 */
|
0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 51, 0, 6, 0, 0, 0, /* 0x 410 */
|
||||||
0, 78, 82, 86, 50, 66, 49, 54, 69, 0,231, 0, 0, 0, 78, 82, /* 0x 420 */
|
0, 0, 0, 0,199, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 51, /* 0x 420 */
|
||||||
86, 50, 68, 49, 54, 83, 0,231, 0, 0, 0, 0, 0, 0, 0,239, /* 0x 430 */
|
0, 6, 0, 0, 0, 0, 0, 0, 0,228, 0, 0, 0, 78, 82, 86, /* 0x 430 */
|
||||||
0, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, 19, 0, 0, 0, /* 0x 440 */
|
50, 66, 49, 54, 83, 0, 1, 0, 0, 0, 78, 50, 66, 88, 56, 54, /* 0x 440 */
|
||||||
78, 50, 68, 54, 52, 75, 48, 49, 0,244, 0, 0, 0, 78, 82, 86, /* 0x 450 */
|
48, 50, 0,228, 0, 0, 0, 78, 50, 66, 50, 56, 54, 48, 50, 0, /* 0x 450 */
|
||||||
50, 68, 69, 88, 49, 0,255, 0, 0, 0, 0, 0, 0, 0, 2, 1, /* 0x 460 */
|
242, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, 51, 0,248, 0, 0, /* 0x 460 */
|
||||||
0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, 6, 0, 0, 0, 0, /* 0x 470 */
|
0, 0, 0, 0, 0,254, 0, 0, 0, 78, 82, 86, 50, 66, 69, 88, /* 0x 470 */
|
||||||
0, 0, 0, 8, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, /* 0x 480 */
|
50, 0, 39, 0, 0, 0, 0, 0, 0, 0, 11, 1, 0, 0, 78, 82, /* 0x 480 */
|
||||||
15, 0, 0, 0, 0, 0, 0, 0, 14, 1, 0, 0, 78, 82, 86, 50, /* 0x 490 */
|
86, 50, 66, 69, 88, 57, 0, 3, 0, 0, 0, 78, 50, 66, 54, 52, /* 0x 490 */
|
||||||
68, 69, 88, 57, 0, 4, 0, 0, 0, 0, 0, 0, 0, 18, 1, 0, /* 0x 4a0 */
|
75, 48, 50, 0, 13, 1, 0, 0, 78, 82, 86, 50, 66, 69, 88, 57, /* 0x 4a0 */
|
||||||
0, 78, 82, 86, 50, 68, 69, 88, 50, 0, 13, 0, 0, 0, 78, 50, /* 0x 4b0 */
|
0, 24, 1, 0, 0, 78, 82, 86, 50, 66, 49, 54, 69, 0, 28, 1, /* 0x 4b0 */
|
||||||
68, 88, 56, 54, 48, 49, 0, 18, 1, 0, 0, 78, 50, 68, 50, 56, /* 0x 4c0 */
|
0, 0, 78, 82, 86, 50, 68, 49, 54, 83, 0, 28, 1, 0, 0, 0, /* 0x 4c0 */
|
||||||
54, 48, 49, 0, 24, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 50, /* 0x 4d0 */
|
0, 0, 0, 36, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, /* 0x 4d0 */
|
||||||
0, 27, 1, 0, 0, 0, 0, 0, 0, 43, 1, 0, 0, 78, 82, 86, /* 0x 4e0 */
|
19, 0, 0, 0, 78, 50, 68, 54, 52, 75, 48, 49, 0, 41, 1, 0, /* 0x 4e0 */
|
||||||
50, 68, 69, 88, 51, 0, 15, 0, 0, 0, 0, 0, 0, 0, 48, 1, /* 0x 4f0 */
|
0, 78, 82, 86, 50, 68, 69, 88, 49, 0, 52, 1, 0, 0, 0, 0, /* 0x 4f0 */
|
||||||
0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, 15, 0, 0, 0, 0, /* 0x 500 */
|
0, 0, 55, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, 6, /* 0x 500 */
|
||||||
0, 0, 0, 56, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, /* 0x 510 */
|
0, 0, 0, 0, 0, 0, 0, 61, 1, 0, 0, 78, 82, 86, 50, 68, /* 0x 510 */
|
||||||
6, 0, 0, 0, 0, 0, 0, 0, 84, 1, 0, 0, 78, 82, 86, 50, /* 0x 520 */
|
69, 88, 51, 0, 15, 0, 0, 0, 0, 0, 0, 0, 67, 1, 0, 0, /* 0x 520 */
|
||||||
68, 49, 54, 83, 0, 1, 0, 0, 0, 78, 50, 68, 88, 56, 54, 48, /* 0x 530 */
|
78, 82, 86, 50, 68, 69, 88, 57, 0, 4, 0, 0, 0, 0, 0, 0, /* 0x 530 */
|
||||||
50, 0, 84, 1, 0, 0, 78, 50, 68, 50, 56, 54, 48, 50, 0, 98, /* 0x 540 */
|
0, 71, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 50, 0, 13, 0, /* 0x 540 */
|
||||||
1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0,104, 1, 0, 0, /* 0x 550 */
|
0, 0, 78, 50, 68, 88, 56, 54, 48, 49, 0, 71, 1, 0, 0, 78, /* 0x 550 */
|
||||||
0, 0, 0, 0,110, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 50, /* 0x 560 */
|
50, 68, 50, 56, 54, 48, 49, 0, 77, 1, 0, 0, 78, 82, 86, 50, /* 0x 560 */
|
||||||
0, 47, 0, 0, 0, 0, 0, 0, 0,123, 1, 0, 0, 78, 82, 86, /* 0x 570 */
|
68, 69, 88, 50, 0, 80, 1, 0, 0, 0, 0, 0, 0, 96, 1, 0, /* 0x 570 */
|
||||||
50, 68, 69, 88, 57, 0, 3, 0, 0, 0, 78, 50, 68, 54, 52, 75, /* 0x 580 */
|
0, 78, 82, 86, 50, 68, 69, 88, 51, 0, 15, 0, 0, 0, 0, 0, /* 0x 580 */
|
||||||
48, 50, 0,125, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 57, 0, /* 0x 590 */
|
0, 0,101, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, 15, /* 0x 590 */
|
||||||
136, 1, 0, 0, 78, 82, 86, 50, 68, 49, 54, 69, 0,140, 1, 0, /* 0x 5a0 */
|
0, 0, 0, 0, 0, 0, 0,109, 1, 0, 0, 78, 82, 86, 50, 68, /* 0x 5a0 */
|
||||||
0, 78, 82, 86, 50, 69, 49, 54, 83, 0,140, 1, 0, 0, 0, 0, /* 0x 5b0 */
|
69, 88, 51, 0, 6, 0, 0, 0, 0, 0, 0, 0,137, 1, 0, 0, /* 0x 5b0 */
|
||||||
0, 0,148, 1, 0, 0, 78, 82, 86, 50, 69, 69, 88, 51, 0, 19, /* 0x 5c0 */
|
78, 82, 86, 50, 68, 49, 54, 83, 0, 1, 0, 0, 0, 78, 50, 68, /* 0x 5c0 */
|
||||||
0, 0, 0, 78, 50, 69, 54, 52, 75, 48, 49, 0,153, 1, 0, 0, /* 0x 5d0 */
|
88, 56, 54, 48, 50, 0,137, 1, 0, 0, 78, 50, 68, 50, 56, 54, /* 0x 5d0 */
|
||||||
78, 82, 86, 50, 69, 69, 88, 49, 0,164, 1, 0, 0, 0, 0, 0, /* 0x 5e0 */
|
48, 50, 0,151, 1, 0, 0, 78, 82, 86, 50, 68, 69, 88, 51, 0, /* 0x 5e0 */
|
||||||
0,167, 1, 0, 0, 78, 82, 86, 50, 69, 69, 88, 51, 0, 6, 0, /* 0x 5f0 */
|
157, 1, 0, 0, 0, 0, 0, 0,163, 1, 0, 0, 78, 82, 86, 50, /* 0x 5f0 */
|
||||||
0, 0, 0, 0, 0, 0,173, 1, 0, 0, 78, 82, 86, 50, 69, 69, /* 0x 600 */
|
68, 69, 88, 50, 0, 47, 0, 0, 0, 0, 0, 0, 0,176, 1, 0, /* 0x 600 */
|
||||||
88, 51, 0, 15, 0, 0, 0, 0, 0, 0, 0,179, 1, 0, 0, 78, /* 0x 610 */
|
0, 78, 82, 86, 50, 68, 69, 88, 57, 0, 3, 0, 0, 0, 78, 50, /* 0x 610 */
|
||||||
82, 86, 50, 69, 69, 88, 57, 0, 4, 0, 0, 0, 0, 0, 0, 0, /* 0x 620 */
|
68, 54, 52, 75, 48, 50, 0,178, 1, 0, 0, 78, 82, 86, 50, 68, /* 0x 620 */
|
||||||
183, 1, 0, 0, 78, 82, 86, 50, 69, 69, 88, 50, 0, 20, 0, 0, /* 0x 630 */
|
69, 88, 57, 0,189, 1, 0, 0, 78, 82, 86, 50, 68, 49, 54, 69, /* 0x 630 */
|
||||||
0, 78, 50, 69, 88, 56, 54, 48, 49, 0,183, 1, 0, 0, 78, 50, /* 0x 640 */
|
0,193, 1, 0, 0, 78, 82, 86, 50, 69, 49, 54, 83, 0,193, 1, /* 0x 640 */
|
||||||
69, 50, 56, 54, 48, 49, 0,189, 1, 0, 0, 78, 82, 86, 50, 69, /* 0x 650 */
|
0, 0, 0, 0, 0, 0,201, 1, 0, 0, 78, 82, 86, 50, 69, 69, /* 0x 650 */
|
||||||
69, 88, 50, 0,192, 1, 0, 0, 0, 0, 0, 0,208, 1, 0, 0, /* 0x 660 */
|
88, 51, 0, 19, 0, 0, 0, 78, 50, 69, 54, 52, 75, 48, 49, 0, /* 0x 660 */
|
||||||
78, 82, 86, 50, 69, 69, 88, 51, 0, 15, 0, 0, 0, 0, 0, 0, /* 0x 670 */
|
206, 1, 0, 0, 78, 82, 86, 50, 69, 69, 88, 49, 0,217, 1, 0, /* 0x 670 */
|
||||||
0,215, 1, 0, 0, 78, 82, 86, 50, 69, 69, 88, 51, 0, 15, 0, /* 0x 680 */
|
0, 0, 0, 0, 0,220, 1, 0, 0, 78, 82, 86, 50, 69, 69, 88, /* 0x 680 */
|
||||||
0, 0, 0, 0, 0, 0,221, 1, 0, 0, 78, 82, 86, 50, 69, 69, /* 0x 690 */
|
51, 0, 6, 0, 0, 0, 0, 0, 0, 0,226, 1, 0, 0, 78, 82, /* 0x 690 */
|
||||||
88, 51, 0, 15, 0, 0, 0, 0, 0, 0, 0,226, 1, 0, 0, 78, /* 0x 6a0 */
|
86, 50, 69, 69, 88, 51, 0, 15, 0, 0, 0, 0, 0, 0, 0,232, /* 0x 6a0 */
|
||||||
82, 86, 50, 69, 69, 88, 51, 0, 6, 0, 0, 0, 0, 0, 0, 0, /* 0x 6b0 */
|
1, 0, 0, 78, 82, 86, 50, 69, 69, 88, 57, 0, 4, 0, 0, 0, /* 0x 6b0 */
|
||||||
254, 1, 0, 0, 78, 82, 86, 50, 69, 49, 54, 83, 0, 1, 0, 0, /* 0x 6c0 */
|
0, 0, 0, 0,236, 1, 0, 0, 78, 82, 86, 50, 69, 69, 88, 50, /* 0x 6c0 */
|
||||||
0, 78, 50, 69, 88, 56, 54, 48, 50, 0,254, 1, 0, 0, 78, 50, /* 0x 6d0 */
|
0, 20, 0, 0, 0, 78, 50, 69, 88, 56, 54, 48, 49, 0,236, 1, /* 0x 6d0 */
|
||||||
69, 50, 56, 54, 48, 50, 0, 12, 2, 0, 0, 78, 82, 86, 50, 69, /* 0x 6e0 */
|
0, 0, 78, 50, 69, 50, 56, 54, 48, 49, 0,242, 1, 0, 0, 78, /* 0x 6e0 */
|
||||||
69, 88, 51, 0, 18, 2, 0, 0, 0, 0, 0, 0, 24, 2, 0, 0, /* 0x 6f0 */
|
82, 86, 50, 69, 69, 88, 50, 0,245, 1, 0, 0, 0, 0, 0, 0, /* 0x 6f0 */
|
||||||
78, 82, 86, 50, 69, 69, 88, 50, 0, 52, 0, 0, 0, 0, 0, 0, /* 0x 700 */
|
5, 2, 0, 0, 78, 82, 86, 50, 69, 69, 88, 51, 0, 15, 0, 0, /* 0x 700 */
|
||||||
0, 37, 2, 0, 0, 78, 82, 86, 50, 69, 69, 88, 57, 0, 3, 0, /* 0x 710 */
|
0, 0, 0, 0, 0, 12, 2, 0, 0, 78, 82, 86, 50, 69, 69, 88, /* 0x 710 */
|
||||||
0, 0, 78, 50, 69, 54, 52, 75, 48, 50, 0, 39, 2, 0, 0, 78, /* 0x 720 */
|
51, 0, 15, 0, 0, 0, 0, 0, 0, 0, 18, 2, 0, 0, 78, 82, /* 0x 720 */
|
||||||
82, 86, 50, 69, 69, 88, 57, 0, 50, 2, 0, 0, 78, 82, 86, 50, /* 0x 730 */
|
86, 50, 69, 69, 88, 51, 0, 15, 0, 0, 0, 0, 0, 0, 0, 23, /* 0x 730 */
|
||||||
69, 49, 54, 69, 0, 54, 2, 0, 0, 69, 88, 69, 77, 65, 73, 78, /* 0x 740 */
|
2, 0, 0, 78, 82, 86, 50, 69, 69, 88, 51, 0, 6, 0, 0, 0, /* 0x 740 */
|
||||||
53, 0, 54, 2, 0, 0, 69, 88, 69, 82, 69, 76, 79, 67, 0, 55, /* 0x 750 */
|
0, 0, 0, 0, 51, 2, 0, 0, 78, 82, 86, 50, 69, 49, 54, 83, /* 0x 750 */
|
||||||
2, 0, 0, 69, 88, 69, 65, 68, 74, 85, 83, 0, 55, 2, 0, 0, /* 0x 760 */
|
0, 1, 0, 0, 0, 78, 50, 69, 88, 56, 54, 48, 50, 0, 51, 2, /* 0x 760 */
|
||||||
69, 88, 69, 78, 79, 65, 68, 74, 0, 62, 2, 0, 0, 69, 88, 69, /* 0x 770 */
|
0, 0, 78, 50, 69, 50, 56, 54, 48, 50, 0, 65, 2, 0, 0, 78, /* 0x 770 */
|
||||||
82, 69, 76, 79, 49, 0, 64, 2, 0, 0, 0, 0, 0, 0, 91, 2, /* 0x 780 */
|
82, 86, 50, 69, 69, 88, 51, 0, 71, 2, 0, 0, 0, 0, 0, 0, /* 0x 780 */
|
||||||
0, 0, 69, 88, 69, 82, 69, 76, 79, 50, 0, 0, 0, 0, 0, 69, /* 0x 790 */
|
77, 2, 0, 0, 78, 82, 86, 50, 69, 69, 88, 50, 0, 52, 0, 0, /* 0x 790 */
|
||||||
88, 69, 82, 69, 76, 57, 65, 0, 94, 2, 0, 0, 0, 0, 0, 0, /* 0x 7a0 */
|
0, 0, 0, 0, 0, 90, 2, 0, 0, 78, 82, 86, 50, 69, 69, 88, /* 0x 7a0 */
|
||||||
112, 2, 0, 0, 69, 88, 69, 82, 69, 76, 79, 49, 0, 18, 0, 0, /* 0x 7b0 */
|
57, 0, 3, 0, 0, 0, 78, 50, 69, 54, 52, 75, 48, 50, 0, 92, /* 0x 7b0 */
|
||||||
0, 69, 88, 69, 82, 69, 76, 79, 50, 0,112, 2, 0, 0, 69, 88, /* 0x 7c0 */
|
2, 0, 0, 78, 82, 86, 50, 69, 69, 88, 57, 0,103, 2, 0, 0, /* 0x 7c0 */
|
||||||
69, 82, 69, 66, 73, 71, 0,116, 2, 0, 0, 0, 0, 0, 0,118, /* 0x 7d0 */
|
78, 82, 86, 50, 69, 49, 54, 69, 0,107, 2, 0, 0, 69, 88, 69, /* 0x 7d0 */
|
||||||
2, 0, 0, 69, 88, 69, 82, 69, 76, 79, 49, 0, 9, 0, 0, 0, /* 0x 7e0 */
|
77, 65, 73, 78, 53, 0,107, 2, 0, 0, 69, 88, 69, 82, 69, 76, /* 0x 7e0 */
|
||||||
69, 88, 69, 82, 69, 76, 79, 51, 0,118, 2, 0, 0, 0, 0, 0, /* 0x 7f0 */
|
79, 67, 0,108, 2, 0, 0, 69, 88, 69, 65, 68, 74, 85, 83, 0, /* 0x 7f0 */
|
||||||
0,120, 2, 0, 0, 69, 88, 69, 82, 69, 76, 79, 49, 0, 23, 0, /* 0x 800 */
|
108, 2, 0, 0, 69, 88, 69, 78, 79, 65, 68, 74, 0,115, 2, 0, /* 0x 800 */
|
||||||
0, 0, 69, 88, 69, 77, 65, 73, 78, 56, 0,120, 2, 0, 0, 69, /* 0x 810 */
|
0, 69, 88, 69, 82, 69, 76, 79, 49, 0,117, 2, 0, 0, 0, 0, /* 0x 810 */
|
||||||
88, 69, 83, 84, 65, 67, 75, 0,123, 2, 0, 0, 69, 88, 69, 68, /* 0x 820 */
|
0, 0,144, 2, 0, 0, 69, 88, 69, 82, 69, 76, 79, 50, 0, 0, /* 0x 820 */
|
||||||
85, 77, 77, 83, 0,129, 2, 0, 0, 69, 88, 69, 83, 84, 65, 83, /* 0x 830 */
|
0, 0, 0, 69, 88, 69, 82, 69, 76, 57, 65, 0,147, 2, 0, 0, /* 0x 830 */
|
||||||
80, 0,129, 2, 0, 0, 69, 88, 69, 68, 85, 77, 77, 80, 0,132, /* 0x 840 */
|
0, 0, 0, 0,165, 2, 0, 0, 69, 88, 69, 82, 69, 76, 79, 49, /* 0x 840 */
|
||||||
2, 0, 0, 69, 88, 69, 74, 85, 77, 80, 70, 0,132, 2, 0, 0, /* 0x 850 */
|
0, 18, 0, 0, 0, 69, 88, 69, 82, 69, 76, 79, 50, 0,165, 2, /* 0x 850 */
|
||||||
69, 88, 69, 82, 69, 84, 85, 82, 0,137, 2, 0, 0, 69, 88, 69, /* 0x 860 */
|
0, 0, 69, 88, 69, 82, 69, 66, 73, 71, 0,169, 2, 0, 0, 0, /* 0x 860 */
|
||||||
82, 67, 83, 80, 79, 0,137, 2, 0, 0, 69, 88, 69, 82, 69, 84, /* 0x 870 */
|
0, 0, 0,171, 2, 0, 0, 69, 88, 69, 82, 69, 76, 79, 49, 0, /* 0x 870 */
|
||||||
73, 80, 0,141, 2, 0, 0, 69, 88, 69, 68, 85, 77, 77, 90, 0, /* 0x 880 */
|
9, 0, 0, 0, 69, 88, 69, 82, 69, 76, 79, 51, 0,171, 2, 0, /* 0x 880 */
|
||||||
147, 2, 0, 0, 69, 88, 69, 84, 72, 69, 78, 68, 0,147, 2, 0, /* 0x 890 */
|
0, 0, 0, 0, 0,173, 2, 0, 0, 69, 88, 69, 82, 69, 76, 79, /* 0x 890 */
|
||||||
0,255,255,255,255,147, 2 /* 0x 8a0 */
|
49, 0, 23, 0, 0, 0, 69, 88, 69, 77, 65, 73, 78, 56, 0,173, /* 0x 8a0 */
|
||||||
|
2, 0, 0, 68, 69, 86, 73, 67, 69, 69, 78, 68, 0,176, 2, 0, /* 0x 8b0 */
|
||||||
|
0, 69, 88, 69, 83, 84, 65, 67, 75, 0,195, 2, 0, 0, 69, 88, /* 0x 8c0 */
|
||||||
|
69, 68, 85, 77, 77, 83, 0,201, 2, 0, 0, 69, 88, 69, 83, 84, /* 0x 8d0 */
|
||||||
|
65, 83, 80, 0,201, 2, 0, 0, 69, 88, 69, 68, 85, 77, 77, 80, /* 0x 8e0 */
|
||||||
|
0,204, 2, 0, 0, 69, 88, 69, 74, 85, 77, 80, 70, 0,204, 2, /* 0x 8f0 */
|
||||||
|
0, 0, 69, 88, 69, 82, 69, 84, 85, 82, 0,209, 2, 0, 0, 69, /* 0x 900 */
|
||||||
|
88, 69, 82, 67, 83, 80, 79, 0,209, 2, 0, 0, 69, 88, 69, 82, /* 0x 910 */
|
||||||
|
69, 84, 73, 80, 0,213, 2, 0, 0, 69, 88, 69, 68, 85, 77, 77, /* 0x 920 */
|
||||||
|
90, 0,219, 2, 0, 0, 69, 88, 69, 84, 72, 69, 78, 68, 0,219, /* 0x 930 */
|
||||||
|
2, 0, 0,255,255,255,255,219, 2 /* 0x 940 */
|
||||||
};
|
};
|
||||||
|
|||||||
+18
-20
@@ -96,14 +96,8 @@ do_brk(void *addr)
|
|||||||
return brk(addr);
|
return brk(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
extern char *mmap(void *addr, size_t len,
|
||||||
__attribute_cdecl
|
int prot, int flags, int fd, off_t offset);
|
||||||
do_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
|
|
||||||
{
|
|
||||||
(void)len; (void)prot; (void)flags; (void)fd; (void)offset;
|
|
||||||
return mmap((void *)&addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// UPX & NRV stuff
|
// UPX & NRV stuff
|
||||||
@@ -274,10 +268,9 @@ xfind_pages(unsigned mflags, Elf32_Phdr const *phdr, int phnum,
|
|||||||
lo -= ~PAGE_MASK & lo; // round down to page boundary
|
lo -= ~PAGE_MASK & lo; // round down to page boundary
|
||||||
hi = PAGE_MASK & (hi - lo - PAGE_MASK -1); // page length
|
hi = PAGE_MASK & (hi - lo - PAGE_MASK -1); // page length
|
||||||
szlo = PAGE_MASK & (szlo - PAGE_MASK -1); // page length
|
szlo = PAGE_MASK & (szlo - PAGE_MASK -1); // page length
|
||||||
addr = do_mmap((void *)lo, hi, PROT_READ|PROT_WRITE|PROT_EXEC,
|
addr = mmap((void *)lo, hi, PROT_NONE, mflags, -1, 0);
|
||||||
mflags, 0, 0 );
|
|
||||||
*p_brk = hi + addr; // the logical value of brk(0)
|
*p_brk = hi + addr; // the logical value of brk(0)
|
||||||
munmap(szlo + addr, hi - szlo); // desirable if PT_LOAD non-contiguous
|
//mprotect(szlo + addr, hi - szlo, PROT_NONE); // no access, but keep the frames!
|
||||||
return (unsigned long)addr - lo;
|
return (unsigned long)addr - lo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,33 +299,38 @@ do_xmap(int const fdi, Elf32_Ehdr const *const ehdr, struct Extent *const xi,
|
|||||||
addr -= frag;
|
addr -= frag;
|
||||||
|
|
||||||
// Decompressor can overrun the destination by 3 bytes.
|
// Decompressor can overrun the destination by 3 bytes.
|
||||||
if (addr != do_mmap(addr, mlen + (xi ? 3 : 0), PROT_READ | PROT_WRITE,
|
if (addr != mmap(addr, mlen + (xi ? 3 : 0), prot | (xi ? PROT_WRITE : 0),
|
||||||
MAP_FIXED | MAP_PRIVATE | (xi ? MAP_ANONYMOUS : 0),
|
MAP_FIXED | MAP_PRIVATE | (xi ? MAP_ANONYMOUS : 0),
|
||||||
fdi, phdr->p_offset - frag) ) {
|
(xi ? -1 : fdi), phdr->p_offset - frag) ) {
|
||||||
err_exit(8);
|
err_exit(8);
|
||||||
}
|
}
|
||||||
if (xi) {
|
if (xi) {
|
||||||
unpackExtent(xi, &xo, (f_expand *)fdi,
|
unpackExtent(xi, &xo, (f_expand *)fdi,
|
||||||
((phdr->p_flags & PF_X) ? (f_unfilter *)(2+ fdi) : 0));
|
((PROT_EXEC & prot) ? (f_unfilter *)(2+ fdi) : 0));
|
||||||
}
|
}
|
||||||
bzero(addr, frag); // fragment at lo end
|
// Linux does not fixup the low end, so neither do we.
|
||||||
|
//if (PROT_WRITE & prot) {
|
||||||
|
// bzero(addr, frag); // fragment at lo end
|
||||||
|
//}
|
||||||
frag = (-mlen) &~ PAGE_MASK; // distance to next page boundary
|
frag = (-mlen) &~ PAGE_MASK; // distance to next page boundary
|
||||||
|
if (PROT_WRITE & prot) { // note: read-only .bss not supported here
|
||||||
bzero(mlen+addr, frag); // fragment at hi end
|
bzero(mlen+addr, frag); // fragment at hi end
|
||||||
|
}
|
||||||
if (xi) {
|
if (xi) {
|
||||||
void *const hatch = make_hatch(phdr, reloc);
|
void *const hatch = make_hatch(phdr, reloc);
|
||||||
if (0!=hatch) {
|
if (0!=hatch) {
|
||||||
/* always update AT_NULL, especially for compressed PT_INTERP */
|
/* always update AT_NULL, especially for compressed PT_INTERP */
|
||||||
auxv_up((Elf32_auxv_t *)(~1 & (int)av), AT_NULL, (unsigned)hatch);
|
auxv_up((Elf32_auxv_t *)(~1 & (int)av), AT_NULL, (unsigned)hatch);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (0!=mprotect(addr, mlen, prot)) {
|
if (0!=mprotect(addr, mlen, prot)) {
|
||||||
err_exit(10);
|
err_exit(10);
|
||||||
ERR_LAB
|
ERR_LAB
|
||||||
}
|
}
|
||||||
|
}
|
||||||
addr += mlen + frag; /* page boundary on hi end */
|
addr += mlen + frag; /* page boundary on hi end */
|
||||||
if (addr < haddr) { // need pages for .bss
|
if (addr < haddr) { // need pages for .bss
|
||||||
if (addr != do_mmap(addr, haddr - addr, prot,
|
if (addr != mmap(addr, haddr - addr, prot,
|
||||||
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 ) ) {
|
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0 ) ) {
|
||||||
err_exit(9);
|
err_exit(9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -392,11 +390,11 @@ void *upx_main(
|
|||||||
Elf32_Addr reloc;
|
Elf32_Addr reloc;
|
||||||
Elf32_Addr entry;
|
Elf32_Addr entry;
|
||||||
|
|
||||||
(void)junk;
|
|
||||||
|
|
||||||
// sizeof(Ehdr+Phdrs), compressed; including b_info header
|
// sizeof(Ehdr+Phdrs), compressed; including b_info header
|
||||||
size_t const sz_pckhdrs = xi.size;
|
size_t const sz_pckhdrs = xi.size;
|
||||||
|
|
||||||
|
(void)junk;
|
||||||
|
|
||||||
// Uncompress Ehdr and Phdrs.
|
// Uncompress Ehdr and Phdrs.
|
||||||
unpackExtent(&xi, &xo, f_decompress, 0);
|
unpackExtent(&xi, &xo, f_decompress, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ PAGE_SIZE= -PAGE_MASK
|
|||||||
M_NRV2B_LE32=2 # ../conf.h
|
M_NRV2B_LE32=2 # ../conf.h
|
||||||
M_NRV2E_LE32=8
|
M_NRV2E_LE32=8
|
||||||
|
|
||||||
#define ALIGN(n) .align n
|
|
||||||
|
|
||||||
/*__LEXEC000__*/
|
/*__LEXEC000__*/
|
||||||
_start: .globl _start
|
_start: .globl _start
|
||||||
@@ -127,7 +126,7 @@ ra_setup:
|
|||||||
#define getnextbp(reg) call *%r11; adcl reg,reg
|
#define getnextbp(reg) call *%r11; adcl reg,reg
|
||||||
#define getnextb(reg) getnextbp(reg)
|
#define getnextb(reg) getnextbp(reg)
|
||||||
|
|
||||||
ALIGN(1<<3)
|
.p2align 3
|
||||||
getbit:
|
getbit:
|
||||||
addl bits,bits; jz refill # Carry= next bit
|
addl bits,bits; jz refill # Carry= next bit
|
||||||
rep; ret
|
rep; ret
|
||||||
@@ -169,6 +168,29 @@ eof:
|
|||||||
pop %rbx; pop %rbp
|
pop %rbx; pop %rbp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
/* Temporary until we get the buildLoader stuff working ... */
|
||||||
|
.ascii "\n$Id: UPX (C) 1996-2006 the UPX Team. "
|
||||||
|
.asciz "All Rights Reserved. http://upx.sf.net $\n"
|
||||||
|
|
||||||
|
/* These from /usr/include/asm-x86_64/unistd.h */
|
||||||
|
__NR_write = 1
|
||||||
|
__NR_exit = 60
|
||||||
|
|
||||||
|
msg_SELinux:
|
||||||
|
push $ L71 - L70; pop %arg3 # length
|
||||||
|
call L71
|
||||||
|
L70:
|
||||||
|
.asciz "PROT_EXEC|PROT_WRITE failed.\n"
|
||||||
|
L71:
|
||||||
|
pop %arg2 # message text
|
||||||
|
push $2; pop %arg1 # fd stderr
|
||||||
|
push $ __NR_write; pop %rax
|
||||||
|
syscall
|
||||||
|
die:
|
||||||
|
push $127; pop %arg1
|
||||||
|
push $ __NR_exit; pop %rax
|
||||||
|
syscall
|
||||||
|
|
||||||
/* Decompress the rest of this loader, and jump to it.
|
/* Decompress the rest of this loader, and jump to it.
|
||||||
Map a page to hold the decompressed bytes. Logically this could
|
Map a page to hold the decompressed bytes. Logically this could
|
||||||
be done by setting .p_memsz for our first PT_LOAD. But as of 2005-11-09,
|
be done by setting .p_memsz for our first PT_LOAD. But as of 2005-11-09,
|
||||||
@@ -195,7 +217,7 @@ unfold:
|
|||||||
subl %arg5l,%arg5l #; subl %arg6l,%arg6l # MAP_ANON ==> ignore offset
|
subl %arg5l,%arg5l #; subl %arg6l,%arg6l # MAP_ANON ==> ignore offset
|
||||||
push $ SYS_mmap; pop %rax
|
push $ SYS_mmap; pop %rax
|
||||||
syscall # %rax= result; trashes %rcx,%r11 only
|
syscall # %rax= result; trashes %rcx,%r11 only
|
||||||
cmpl %eax,%edi; je 0f; hlt; 0: # XXX: 4GB
|
cmpl %eax,%edi; jne msg_SELinux # XXX: 4GB
|
||||||
|
|
||||||
/* Load the addresses and lengths that ::pack3() patched in.
|
/* Load the addresses and lengths that ::pack3() patched in.
|
||||||
XXX: 2GB Note that PUSH $imm32 sign-extends to 64 bits.
|
XXX: 2GB Note that PUSH $imm32 sign-extends to 64 bits.
|
||||||
@@ -226,11 +248,14 @@ unfold:
|
|||||||
movl %ebx,%esi # %arg2l= &b_info (relocated)
|
movl %ebx,%esi # %arg2l= &b_info (relocated)
|
||||||
push %rax # ret_addr after decompression
|
push %rax # ret_addr after decompression
|
||||||
xchgl %eax,%arg3l # %arg3= dst for unfolding XXX: 4GB
|
xchgl %eax,%arg3l # %arg3= dst for unfolding XXX: 4GB
|
||||||
lodsl; movl %esi,%arg4l # &len_dst ==> &do_not_care XXX: 4GB
|
lodsl; push %rax # allocate slot on stack
|
||||||
|
movq %rsp,%arg4 # &len_dst ==> &do_not_care
|
||||||
lodsl; xchgl %eax,%arg1l # sz_cpr XXX: 4GB
|
lodsl; xchgl %eax,%arg1l # sz_cpr XXX: 4GB
|
||||||
lodsl; movzbl %al,%arg5l # b_method
|
lodsl; movzbl %al,%arg5l # b_method
|
||||||
xchg %arg1l,%arg2l # XXX: 4GB
|
xchg %arg1l,%arg2l # XXX: 4GB
|
||||||
jmp *%rbp # goto decompress; return to unfolded loader
|
call *%rbp # decompress
|
||||||
|
pop %rcx # discard len_dst
|
||||||
|
ret
|
||||||
|
|
||||||
main:
|
main:
|
||||||
# int3 # uncomment for debugging
|
# int3 # uncomment for debugging
|
||||||
|
|||||||
+22
-13
@@ -1,4 +1,4 @@
|
|||||||
/* l_lx_elf64amd.h -- created from l_lx_elf64amd.bin, 560 (0x230) bytes
|
/* l_lx_elf64amd.h -- created from l_lx_elf64amd.bin, 701 (0x2bd) bytes
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
@@ -27,12 +27,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define LINUX_ELF64AMD_LOADER_SIZE 560
|
#define LINUX_ELF64AMD_LOADER_SIZE 701
|
||||||
#define LINUX_ELF64AMD_LOADER_ADLER32 0xdfe11659
|
#define LINUX_ELF64AMD_LOADER_ADLER32 0xf7af3eba
|
||||||
#define LINUX_ELF64AMD_LOADER_CRC32 0x1c0a6afb
|
#define LINUX_ELF64AMD_LOADER_CRC32 0x8ec9e668
|
||||||
|
|
||||||
unsigned char linux_elf64amd_loader[560] = {
|
unsigned char linux_elf64amd_loader[701] = {
|
||||||
232, 37, 2, 0, 0, 85, 83, 81, 82, 72, 1,254, 86, 72,137,254, /* 0x 0 */
|
232,178, 2, 0, 0, 85, 83, 81, 82, 72, 1,254, 86, 72,137,254, /* 0x 0 */
|
||||||
72,137,215, 49,219, 49,201, 72,131,205,255,232,129, 1, 0, 0, /* 0x 10 */
|
72,137,215, 49,219, 49,201, 72,131,205,255,232,129, 1, 0, 0, /* 0x 10 */
|
||||||
1,219,116, 2,243,195,139, 30, 72,131,238,252, 17,219,138, 22, /* 0x 20 */
|
1,219,116, 2,243,195,139, 30, 72,131,238,252, 17,219,138, 22, /* 0x 20 */
|
||||||
243,195, 72,141, 4, 47,131,249, 5,138, 16,118, 33, 72,131,253, /* 0x 30 */
|
243,195, 72,141, 4, 47,131,249, 5,138, 16,118, 33, 72,131,253, /* 0x 30 */
|
||||||
@@ -60,11 +60,20 @@ unsigned char linux_elf64amd_loader[560] = {
|
|||||||
237, 72,129,253, 0,243,255,255, 17,193,232,147,254,255,255,235, /* 0x 190 */
|
237, 72,129,253, 0,243,255,255, 17,193,232,147,254,255,255,235, /* 0x 190 */
|
||||||
135,252, 65, 91, 65,131,248, 8, 15,132,202,254,255,255, 65,131, /* 0x 1a0 */
|
135,252, 65, 91, 65,131,248, 8, 15,132,202,254,255,255, 65,131, /* 0x 1a0 */
|
||||||
248, 2, 15,132,112,255,255,255, 89, 72,137,240, 72, 41,200, 90, /* 0x 1b0 */
|
248, 2, 15,132,112,255,255,255, 89, 72,137,240, 72, 41,200, 90, /* 0x 1b0 */
|
||||||
72, 41,215, 89,137, 57, 91, 93,195, 91,191, 65, 68, 82, 77,106, /* 0x 1c0 */
|
72, 41,215, 89,137, 57, 91, 93,195, 10, 36, 73,100, 58, 32, 85, /* 0x 1c0 */
|
||||||
7, 90,190, 76, 69, 78, 77,106, 50, 65, 90, 69, 41,192,106, 9, /* 0x 1d0 */
|
80, 88, 32, 40, 67, 41, 32, 49, 57, 57, 54, 45, 50, 48, 48, 54, /* 0x 1d0 */
|
||||||
88, 15, 5, 57,199,116, 1,244,104, 74, 77, 80, 85,104, 65, 68, /* 0x 1e0 */
|
32,116,104,101, 32, 85, 80, 88, 32, 84,101, 97,109, 46, 32, 65, /* 0x 1e0 */
|
||||||
82, 85,190, 65, 68, 82, 67,104, 76, 69, 78, 85,185, 67, 78, 84, /* 0x 1f0 */
|
108,108, 32, 82,105,103,104,116,115, 32, 82,101,115,101,114,118, /* 0x 1f0 */
|
||||||
67,104, 65, 68, 82, 88,104, 76, 69, 78, 88,137,250, 41,242, 1, /* 0x 200 */
|
101,100, 46, 32,104,116,116,112, 58, 47, 47,117,112,120, 46,115, /* 0x 200 */
|
||||||
213, 1,211,252,243, 72,165,151,137,222, 80,146,173,137,241,173, /* 0x 210 */
|
102, 46,110,101,116, 32, 36, 10, 0,104, 30, 0, 0, 0, 90,232, /* 0x 210 */
|
||||||
151,173, 68, 15,182,192,135,254,255,229, 93,232,153,255,255,255 /* 0x 220 */
|
30, 0, 0, 0, 80, 82, 79, 84, 95, 69, 88, 69, 67,124, 80, 82, /* 0x 220 */
|
||||||
|
79, 84, 95, 87, 82, 73, 84, 69, 32,102, 97,105,108,101,100, 46, /* 0x 230 */
|
||||||
|
10, 0, 94,106, 2, 95,106, 1, 88, 15, 5,106,127, 95,106, 60, /* 0x 240 */
|
||||||
|
88, 15, 5, 91,191, 65, 68, 82, 77,106, 7, 90,190, 76, 69, 78, /* 0x 250 */
|
||||||
|
77,106, 50, 65, 90, 69, 41,192,106, 9, 88, 15, 5, 57,199,117, /* 0x 260 */
|
||||||
|
168,104, 74, 77, 80, 85,104, 65, 68, 82, 85,190, 65, 68, 82, 67, /* 0x 270 */
|
||||||
|
104, 76, 69, 78, 85,185, 67, 78, 84, 67,104, 65, 68, 82, 88,104, /* 0x 280 */
|
||||||
|
76, 69, 78, 88,137,250, 41,242, 1,213, 1,211,252,243, 72,165, /* 0x 290 */
|
||||||
|
151,137,222, 80,146,173, 80, 72,137,225,173,151,173, 68, 15,182, /* 0x 2a0 */
|
||||||
|
192,135,254,255,213, 89,195, 93,232,150,255,255,255 /* 0x 2b0 */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ OUTPUT_ARCH(i386:x86-64)
|
|||||||
/*ENTRY(_start)*/
|
/*ENTRY(_start)*/
|
||||||
PHDRS
|
PHDRS
|
||||||
{
|
{
|
||||||
text PT_LOAD FILEHDR PHDRS ;
|
text PT_LOAD FILEHDR PHDRS FLAGS ( 5 ) ; /* r-x (no -w-) */
|
||||||
data PT_LOAD ; /* for setting brk(0) */
|
data PT_LOAD ; /* for setting brk(0) */
|
||||||
}
|
}
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user