Compare commits
433 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a3637ff5a | |||
| 2923c0968e | |||
| 98cfe99d65 | |||
| bdd97fe0b2 | |||
| 6b500bc83b | |||
| 92a12a2ec1 | |||
| 04d79040f9 | |||
| 3201ddc680 | |||
| 2f06de54c5 | |||
| 6489ec9bba | |||
| 1a5ba22fe7 | |||
| 8f9713ed53 | |||
| 90eb68b3b9 | |||
| 95fcbcb4f2 | |||
| b97688d119 | |||
| 5ea3627cab | |||
| d9288213ec | |||
| 614c86fb7d | |||
| 9f651ee40f | |||
| 774c8c3fd4 | |||
| b711d2f750 | |||
| 8a793d5942 | |||
| 99f52c60ed | |||
| 2c2e108301 | |||
| 563165e6ae | |||
| f1a31b4793 | |||
| 5e9b6bd69d | |||
| 9b990c4eae | |||
| 7a625a449a | |||
| c2b62359d5 | |||
| 6722e8972e | |||
| fefe7a3452 | |||
| 90a1322929 | |||
| d698eb69e2 | |||
| 0ef00e9b82 | |||
| 95cedb6640 | |||
| d736da4208 | |||
| be83788666 | |||
| 5a28a51abc | |||
| 8a84df752c | |||
| 85f53b210d | |||
| 5d13c6cd01 | |||
| 98a0d381e9 | |||
| e1d20fd0b5 | |||
| d1035ecd8f | |||
| 0e651facdd | |||
| 9fdddfc332 | |||
| 7d2913709c | |||
| 3623199e8d | |||
| e4b23f7a47 | |||
| f056ecdcd5 | |||
| 857a03a074 | |||
| a34deee4f5 | |||
| fc9c8ae482 | |||
| 08c63f06eb | |||
| bbff510ef1 | |||
| f747435952 | |||
| e6edad8f46 | |||
| 05e44b9644 | |||
| 16bb7ab841 | |||
| 9248f02557 | |||
| 9485a56af1 | |||
| 021c8db58a | |||
| 8ab180edf8 | |||
| ab35b685d4 | |||
| 86745721ee | |||
| c34fe09a79 | |||
| 1fa9ff2c05 | |||
| e8ef0cf63f | |||
| 8c84efb8fb | |||
| f3a7620ae8 | |||
| c7969ed5a5 | |||
| 900926c0ed | |||
| df94f4288a | |||
| 969efe687d | |||
| ee3f1292d0 | |||
| cacb239040 | |||
| 28d1789783 | |||
| 633eb98e34 | |||
| 4854c03096 | |||
| e853119c77 | |||
| 161a58bafb | |||
| f5fd94e815 | |||
| edde6210f1 | |||
| 507e19945e | |||
| 4a35bf32ea | |||
| e04bf9e4bc | |||
| c384d224c0 | |||
| 35427f998e | |||
| 1174da2bc3 | |||
| 11e8a47030 | |||
| 8c4e9bcf0d | |||
| 9dfd624901 | |||
| 79e65503a9 | |||
| 59f18b9d9f | |||
| fb3699fb89 | |||
| 9d2d59b5d2 | |||
| aefb2fa3c3 | |||
| e8aa80f904 | |||
| 990988f920 | |||
| 576d9a4e7e | |||
| 1d462ee424 | |||
| c9b09555c4 | |||
| 860b5bf967 | |||
| 5063480a38 | |||
| 3400ae9dbe | |||
| 3385264eb2 | |||
| 34646f1c6a | |||
| 50aa63a5a0 | |||
| 64557bee43 | |||
| 7c21c4513e | |||
| c6d6378005 | |||
| 4f6979967d | |||
| e633c51b50 | |||
| 143f0accef | |||
| b413f3da26 | |||
| 6eafa552bb | |||
| 7a0514d9b4 | |||
| 7e7565299e | |||
| ed34a089c6 | |||
| d14a2c5282 | |||
| f014406b65 | |||
| 58771ecca6 | |||
| 5d9dcb634b | |||
| 19c2c1edcf | |||
| 0430e7931e | |||
| bb8e607442 | |||
| e61ada944d | |||
| 46730315e3 | |||
| 4869142034 | |||
| 8e42e17bbf | |||
| 38c8b84a26 | |||
| c652626a37 | |||
| 06f6e47ebf | |||
| 403b180b1d | |||
| ee008acfbd | |||
| d149092ac0 | |||
| eafa136c69 | |||
| 402c885987 | |||
| 5e7e0508b9 | |||
| ff1d5fb794 | |||
| ad3f63b5c4 | |||
| a3e51e6dee | |||
| c1b9c79f54 | |||
| e0bc040b0a | |||
| 85eb4c7537 | |||
| 1f929d47d0 | |||
| 608662d73b | |||
| 7841d23e77 | |||
| b72dda4ada | |||
| c59c8a1ea2 | |||
| 1522293be0 | |||
| b37bc99330 | |||
| 7f905724b1 | |||
| 2bf5bb1625 | |||
| 08d3376740 | |||
| 7bace76176 | |||
| ef336dbcc6 | |||
| ca7217e717 | |||
| 3931cb7871 | |||
| 9e8de4abe5 | |||
| 26be845563 | |||
| 2f11a629fa | |||
| a295437e11 | |||
| 04597fb804 | |||
| f2f002409b | |||
| 509de877ca | |||
| 63aea4a7dc | |||
| 6470c748db | |||
| 25a6429e6a | |||
| 4fa1c2a97e | |||
| 9ad39d77cc | |||
| 92527126a8 | |||
| 02b4a4c974 | |||
| ede570be21 | |||
| 08627e9df5 | |||
| 6d9f3adc86 | |||
| 96433b4e39 | |||
| f4947cc2ae | |||
| 7b554d4f72 | |||
| 5b54544438 | |||
| ef78d23494 | |||
| ef8a7f330d | |||
| b72e0f3060 | |||
| 2a0bab938b | |||
| cd637629c4 | |||
| b9adfd801d | |||
| 69355514c9 | |||
| 33dc947c21 | |||
| 6de021d8d8 | |||
| 9be86621bf | |||
| a7a0876298 | |||
| 31b42345c3 | |||
| 1b172e729e | |||
| 3bf387a2d4 | |||
| 9f20bbb046 | |||
| 82af555974 | |||
| 50638b5213 | |||
| 650df95b72 | |||
| b2115a4162 | |||
| d67bf16a08 | |||
| a4c9b64224 | |||
| 8f572e5fe6 | |||
| e58873044b | |||
| 8ada92a69f | |||
| 3c8ed5c000 | |||
| c127d5b64a | |||
| 2d3bd0809a | |||
| eef955a9dd | |||
| e59ce39dc6 | |||
| 62815f5c3c | |||
| f496010273 | |||
| 143c4e3322 | |||
| e7f1e99a5e | |||
| 140a031515 | |||
| b7c91941b8 | |||
| 33f0b6da67 | |||
| ee18fe9bba | |||
| a51330cf07 | |||
| a67aed2744 | |||
| d979e19315 | |||
| 4c74d16795 | |||
| 6e541a432f | |||
| d8f47e248a | |||
| d1a869496b | |||
| f42a37555d | |||
| d9e019bd87 | |||
| ce194fa5d8 | |||
| b5bdf57636 | |||
| a3a81ce7c6 | |||
| 61f347401c | |||
| d985a4c250 | |||
| d31947e1f0 | |||
| e4659b7d7c | |||
| 8827a534db | |||
| ddf48b45a5 | |||
| 8eabb9b02f | |||
| 8a195a0b35 | |||
| 955206aaf0 | |||
| 082dd7d5ee | |||
| 90714cf624 | |||
| 61798d33f0 | |||
| 6e2a41cb26 | |||
| 515897e180 | |||
| fe4a8f33b1 | |||
| 304d848f53 | |||
| b5f738abf3 | |||
| 7ebed06393 | |||
| 2e56fe82bb | |||
| 32019c61aa | |||
| f7ffae565c | |||
| cd11bb1606 | |||
| 24c924d668 | |||
| 9be94e4b58 | |||
| 15e9d8c99d | |||
| 391f511094 | |||
| 5b53c11a6b | |||
| 9df4b6ea24 | |||
| a440564ba4 | |||
| 9583cfcc93 | |||
| c4a921283a | |||
| 4e05f087f9 | |||
| 40b506d2e0 | |||
| 263f384810 | |||
| d80c145a18 | |||
| 8848fe35f6 | |||
| 7a681bd20d | |||
| ed31fb184b | |||
| 360b94dd6c | |||
| 8524e73f59 | |||
| 940514e5ca | |||
| a4e47625ac | |||
| 7c16872a6e | |||
| 994c3c3552 | |||
| c34f496600 | |||
| 8bca8629be | |||
| 85fdd579d6 | |||
| e88d2ff88c | |||
| bdf08baebd | |||
| 3dcdd25177 | |||
| 491e8640b2 | |||
| b23b7ef85e | |||
| b167374f13 | |||
| cd1f6e733f | |||
| d3fc7687b8 | |||
| 17a83d58da | |||
| 18a8e1b6d6 | |||
| 2c23cbb359 | |||
| cdd58cf757 | |||
| a0df325659 | |||
| a59005e836 | |||
| 5da6a27e6b | |||
| ef97af71e3 | |||
| 6ed67f4532 | |||
| 1278d663b4 | |||
| 0395c7b407 | |||
| df3d15ffb3 | |||
| 6f673310d2 | |||
| 978c3eca23 | |||
| 20bc848bd6 | |||
| ce7f1292dc | |||
| d97ff8bb40 | |||
| 8a9b46d82f | |||
| 12e5703541 | |||
| 1b87fc2ee6 | |||
| ebd0c780a1 | |||
| bd976cd562 | |||
| 0e511c3e07 | |||
| 300d489408 | |||
| 024d081167 | |||
| 348173d3f1 | |||
| 23e3814f8a | |||
| b818e2c4b8 | |||
| 6adb3dc142 | |||
| 0e154cc759 | |||
| 9dce8d9bce | |||
| 0aa3b9c487 | |||
| dc7ab3ed30 | |||
| 254259b354 | |||
| 9651c70efd | |||
| 5840190ed5 | |||
| a807b88694 | |||
| 0db82e09e9 | |||
| e5865f171a | |||
| 166d198dcb | |||
| 445795f2ec | |||
| 6be4a87dac | |||
| 17c47053d6 | |||
| b4e18f7521 | |||
| fbe4d287c7 | |||
| 543fa3ae79 | |||
| 7cf855413c | |||
| f5d65dc0bc | |||
| 2f6211a1d9 | |||
| 513a57330a | |||
| 715ddf0620 | |||
| 6bb31e276e | |||
| b10f1df49f | |||
| f999519b13 | |||
| aedbf02830 | |||
| bd5479b250 | |||
| 9d14715652 | |||
| 72156fcf1b | |||
| 1c6eab00d1 | |||
| f9738c5b55 | |||
| 3b63083619 | |||
| d5d7d8bc84 | |||
| f26118cf5a | |||
| 5d6c4b475c | |||
| 2c4ef392f6 | |||
| 2a128fe772 | |||
| bb7d3ca3a1 | |||
| a2bdba7eda | |||
| e8aabc9980 | |||
| 9f554a14fd | |||
| 68a2b91ccb | |||
| 4089cc6e6f | |||
| 4e8848eeca | |||
| 8c6133c115 | |||
| 483db31acd | |||
| 35dae3dab7 | |||
| 8232aedf78 | |||
| d30a0a2e67 | |||
| d913fe508f | |||
| 4029903301 | |||
| 5db7e826d3 | |||
| 7f3e7da7c7 | |||
| 93cefde8fc | |||
| 02e7981e10 | |||
| 0ecec10af0 | |||
| 00b8cba987 | |||
| 8486bff918 | |||
| 5305eb5b8a | |||
| 377a3bb7de | |||
| 5a47e8d2c6 | |||
| 71f4cd7c85 | |||
| f7751684af | |||
| 59df1d39b2 | |||
| 7e5933e6a0 | |||
| 2cefd34bb7 | |||
| eac891dc3a | |||
| abd3599408 | |||
| 1bcd259c00 | |||
| c4e835266c | |||
| 685953f6a5 | |||
| 03fffbc724 | |||
| e1a8c932ee | |||
| 1aa2a6b054 | |||
| 1ad96c9c81 | |||
| f69199909f | |||
| d063e77040 | |||
| bf3ddeb1eb | |||
| fc261ad8cd | |||
| 90fc018295 | |||
| cdc01d9a69 | |||
| da7e76c07d | |||
| ba9118aa58 | |||
| fdce705e55 | |||
| 81268e7064 | |||
| f502f41359 | |||
| 34c9cfb6b0 | |||
| 6da1790c46 | |||
| d333c940da | |||
| c940d2906f | |||
| ac4b51ba85 | |||
| ea7a1ad2c7 | |||
| 45ddd6a68d | |||
| acd99364e0 | |||
| 14710dea55 | |||
| 5d3be8da1d | |||
| 3026821f9f | |||
| fba51dabd0 | |||
| c4da5e81fa | |||
| bc80d81432 | |||
| 67797efead | |||
| c7cb036536 | |||
| 0ccbc5f139 | |||
| 2a6bbcaf8f | |||
| d46a8438ba | |||
| cc9d19da19 | |||
| 6e6aa6fd6d | |||
| 61652a2989 | |||
| edd7503607 | |||
| c9d6dab401 | |||
| d303038bcb | |||
| 0a0e7c3b7c | |||
| 0b4ac35bc9 | |||
| c51864ca39 | |||
| a1cabd5a68 | |||
| 9c1bc99d7a | |||
| c05fedcb76 | |||
| e11beeae4b | |||
| 4749e0d71e |
+11
-10
@@ -14,12 +14,16 @@ environment:
|
|||||||
- { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 }
|
- { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 }
|
||||||
- { C: msvc-14.0-x86, CL_VERSION: 19.00, VS_VERSION: 2015 }
|
- { C: msvc-14.0-x86, CL_VERSION: 19.00, VS_VERSION: 2015 }
|
||||||
- { C: msvc-14.0-x64, CL_VERSION: 19.00, VS_VERSION: 2015 }
|
- { C: msvc-14.0-x64, CL_VERSION: 19.00, VS_VERSION: 2015 }
|
||||||
# - { C: gcc-4.9-m32, T: SKIP }
|
- { C: msvc-14.1-x86, CL_VERSION: 19.12, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 }
|
||||||
# - { C: gcc-4.9-m64, T: SKIP }
|
- { C: msvc-14.1-x64, CL_VERSION: 19.12, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 }
|
||||||
|
UPX_AUTOMATIC_BUILDS_SSL_KEY:
|
||||||
|
secure: PZMpVeqnEYe39kK+Zu2/fnmZ6/HG6Lvls0hh9GMVU9vCWsr8xaU7kIbHBS01puUkb4bEWPILKYvSEDuhOhguDjd/P4QdXWipvV/F2GaVax0=
|
||||||
|
UPX_AUTOMATIC_BUILDS_SSL_IV:
|
||||||
|
secure: ZshjJ/78dbY60mVJjZJv9Si7rHY9VQb1tfQvFd4lqvY=
|
||||||
|
|
||||||
init:
|
init:
|
||||||
- git config --global core.autocrlf input
|
- git config --global core.autocrlf input
|
||||||
- where bash & where cat & where curl & where file & where git & where gzip & where readlink & where sed & where sha256sum & where tar
|
- where bash & where cat & where chmod & where cmp & where cp & where curl & where date & where file & where git & where gzip & where mkdir & where mv & where openssl & where readlink & where rm & where rmdir & where sed & where sha256sum & where sort & where ssh & where ssh-add & where ssh-agent & where ssh-keyscan & where tar & where touch
|
||||||
# - bash --version & git --version & sed --version & tar --version
|
# - bash --version & git --version & sed --version & tar --version
|
||||||
- git --version & bash --version
|
- git --version & bash --version
|
||||||
# - dir "c:\Program Files\Git\usr\bin"
|
# - dir "c:\Program Files\Git\usr\bin"
|
||||||
@@ -52,15 +56,11 @@ install:
|
|||||||
- if "%C%"=="msvc-12.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 )
|
- if "%C%"=="msvc-12.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 )
|
||||||
- if "%C%"=="msvc-14.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 )
|
- if "%C%"=="msvc-14.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 )
|
||||||
- if "%C%"=="msvc-14.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 )
|
- if "%C%"=="msvc-14.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 )
|
||||||
|
- if "%C%"=="msvc-14.1-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 )
|
||||||
|
- if "%C%"=="msvc-14.1-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 )
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cd c:\projects\upx
|
- cd c:\projects\upx
|
||||||
- if "%C%"=="gcc-4.9-m32" set PATH=c:\cygwin\bin;%PATH%
|
|
||||||
- if "%C%"=="gcc-4.9-m32" bash -x ./.github/travis_build.sh
|
|
||||||
- if "%C%"=="gcc-4.9-m32" exit
|
|
||||||
- if "%C%"=="gcc-4.9-m64" set PATH=c:\cygwin\bin;%PATH%
|
|
||||||
- if "%C%"=="gcc-4.9-m64" bash -x ./.github/travis_build.sh
|
|
||||||
- if "%C%"=="gcc-4.9-m64" exit
|
|
||||||
# setup directories following the VPATH build in travis_build.sh
|
# setup directories following the VPATH build in travis_build.sh
|
||||||
- where cl & where link
|
- where cl & where link
|
||||||
- set BDIR=c:\projects\build\%C%\%B%
|
- set BDIR=c:\projects\build\%C%\%B%
|
||||||
@@ -81,7 +81,7 @@ build_script:
|
|||||||
- set s=c:\projects\upx\src
|
- set s=c:\projects\upx\src
|
||||||
- cat .GITREV.txt
|
- cat .GITREV.txt
|
||||||
- set /p GITREV=<.GITREV.txt
|
- set /p GITREV=<.GITREV.txt
|
||||||
- cl -MT -EHsc -J -O2 -W4 -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -DWITH_LZMA=0x443 -DUCL_NO_ASM -I%s%\lzma-sdk -Ic:\projects\deps\ucl-1.03\include -Ic:\projects\deps\zlib-1.2.8 -Feupx.exe %s%\*.cpp %BDIR%\ucl-1.03\ucl.lib %BDIR%\zlib-1.2.8\zlib.lib
|
- cl -MT -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -DUCL_NO_ASM -I%s%\lzma-sdk -Ic:\projects\deps\ucl-1.03\include -Ic:\projects\deps\zlib-1.2.8 -Feupx.exe %s%\*.cpp %BDIR%\ucl-1.03\ucl.lib %BDIR%\zlib-1.2.8\zlib.lib
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- set UPX=--no-color --no-progress
|
- set UPX=--no-color --no-progress
|
||||||
@@ -96,5 +96,6 @@ test_script:
|
|||||||
# now run the UPX testsuite using bash
|
# now run the UPX testsuite using bash
|
||||||
- cd c:\projects\upx
|
- cd c:\projects\upx
|
||||||
- bash ./.github/travis_testsuite_1.sh
|
- bash ./.github/travis_testsuite_1.sh
|
||||||
|
- bash ./.github/travis_deploy.sh
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
# vim:set ts=2 sw=2 et:
|
||||||
|
|||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
# Support for Circle CI -- https://circleci.com/gh/upx/upx
|
|
||||||
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
|
||||||
|
|
||||||
machine:
|
|
||||||
environment:
|
|
||||||
TRAVIS_OS_NAME: linux
|
|
||||||
CROSS:
|
|
||||||
C: gcc-4.8-m64
|
|
||||||
B: release
|
|
||||||
T:
|
|
||||||
X:
|
|
||||||
|
|
||||||
checkout:
|
|
||||||
post:
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
pre:
|
|
||||||
- mkdir -p ../deps
|
|
||||||
- cd ../deps && wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -xJ
|
|
||||||
- cd ../deps && wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ
|
|
||||||
- cd ../deps && git clone https://github.com/upx/upx-testsuite
|
|
||||||
override:
|
|
||||||
- mkdir -p ../build/travis
|
|
||||||
- bash ./.github/travis_build.sh
|
|
||||||
|
|
||||||
test:
|
|
||||||
override:
|
|
||||||
- bash ./.github/travis_testsuite_1.sh
|
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
|
||||||
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
#
|
#
|
||||||
# see http://editorconfig.org/
|
# see https://editorconfig.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
|
|||||||
@@ -27,5 +27,7 @@ Just read it and fill in the details we're asking, it saves so much of our time.
|
|||||||
## Please tell us details about your environment.
|
## Please tell us details about your environment.
|
||||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||||
* UPX version used (`upx --version`):
|
* UPX version used (`upx --version`):
|
||||||
* Operating System and version:
|
* Host Operating System and version:
|
||||||
* CPU architecture:
|
* Host CPU architecture:
|
||||||
|
* Target Operating System and version:
|
||||||
|
* Target CPU architecture:
|
||||||
|
|||||||
+35
-3
@@ -39,10 +39,37 @@ set -x
|
|||||||
#
|
#
|
||||||
|
|
||||||
if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
|
if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
|
||||||
bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20160918")
|
if [[ -f "$HOME/local/bin/bin-upx/upx-stubtools-check-version" ]]; then
|
||||||
|
bin_upx=$(readlink -en -- "$HOME/local/bin/bin-upx")
|
||||||
|
elif [[ -f "$HOME/.local/bin/bin-upx/upx-stubtools-check-version" ]]; then
|
||||||
|
bin_upx=$(readlink -en -- "$HOME/.local/bin/bin-upx")
|
||||||
|
else
|
||||||
|
bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20160918")
|
||||||
|
fi
|
||||||
cd / && cd $upx_SRCDIR || exit 1
|
cd / && cd $upx_SRCDIR || exit 1
|
||||||
|
extra_subdirs=()
|
||||||
|
extra_subdirs+=( src/stub/src/arch/amd64 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/arm/v4a )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/arm/v4t )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/arm64/v8 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/i386 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/m68k/m68000 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/m68k/m68020 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/mips/r3000 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/powerpc/32 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/powerpc/64 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/powerpc/64le )
|
||||||
make -C src/stub maintainer-clean
|
make -C src/stub maintainer-clean
|
||||||
|
for d in ${extra_subdirs[@]}; do
|
||||||
|
make -C $d -f Makefile.extra maintainer-clean
|
||||||
|
git status $d || true
|
||||||
|
done
|
||||||
|
git status src/stub/src || true
|
||||||
|
git status || true
|
||||||
failed=0
|
failed=0
|
||||||
|
for d in ${extra_subdirs[@]}; do
|
||||||
|
PATH="$bin_upx:$PATH" make -C $d -f Makefile.extra || failed=1
|
||||||
|
done
|
||||||
PATH="$bin_upx:$PATH" make -C src/stub all || failed=1
|
PATH="$bin_upx:$PATH" make -C src/stub all || failed=1
|
||||||
if [[ $failed != 0 ]]; then
|
if [[ $failed != 0 ]]; then
|
||||||
echo "UPX-ERROR: FATAL: rebuild-stubs failed"
|
echo "UPX-ERROR: FATAL: rebuild-stubs failed"
|
||||||
@@ -54,11 +81,12 @@ if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
|
|||||||
echo "UPX-ERROR: FATAL: rebuild-stubs git status mismatch. See log file."
|
echo "UPX-ERROR: FATAL: rebuild-stubs git status mismatch. See log file."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
git status
|
||||||
if [[ $BM_X == rebuild-stubs ]]; then
|
if [[ $BM_X == rebuild-stubs ]]; then
|
||||||
echo "X=rebuild-stubs done. Exiting."
|
echo "X=rebuild-stubs done. Exiting."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
unset bin_upx failed
|
unset bin_upx extra_subdirs d failed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -66,7 +94,10 @@ fi
|
|||||||
#
|
#
|
||||||
|
|
||||||
cd / && cd $ucl_BUILDDIR || exit 1
|
cd / && cd $ucl_BUILDDIR || exit 1
|
||||||
if [[ -n $BM_CROSS || $TRAVIS_OS_NAME == windows ]]; then
|
# patch UCL
|
||||||
|
sed 's/^#elif (ACC_ARCH_AMD64 || ACC_ARCH_IA64)$/& \&\& !defined(__ILP32__)/' $ucl_SRCDIR/acc/acc_chk.ch > a.tmp
|
||||||
|
if cmp -s a.tmp $ucl_SRCDIR/acc/acc_chk.ch; then rm a.tmp; else mv a.tmp $ucl_SRCDIR/acc/acc_chk.ch; fi
|
||||||
|
if [[ $BUILD_LOCAL_UCL == 1 ]]; then
|
||||||
# ucl-1.03/configure is too old - build manually
|
# ucl-1.03/configure is too old - build manually
|
||||||
rm -f ./*.o libucl.a
|
rm -f ./*.o libucl.a
|
||||||
$CC -O2 -I$ucl_SRCDIR/include -I$ucl_SRCDIR -c $ucl_SRCDIR/src/*.c
|
$CC -O2 -I$ucl_SRCDIR/include -I$ucl_SRCDIR -c $ucl_SRCDIR/src/*.c
|
||||||
@@ -131,6 +162,7 @@ export EXTRA_CPPFLAGS EXTRA_CXXFLAGS EXTRA_LDFLAGS
|
|||||||
[[ -z $upx_exeext ]] && upx_exeext=.out
|
[[ -z $upx_exeext ]] && upx_exeext=.out
|
||||||
$make exeext=$upx_exeext
|
$make exeext=$upx_exeext
|
||||||
|
|
||||||
|
pwd
|
||||||
ls -l upx${upx_exeext}
|
ls -l upx${upx_exeext}
|
||||||
$SIZE upx${upx_exeext} || true
|
$SIZE upx${upx_exeext} || true
|
||||||
file upx${upx_exeext}
|
file upx${upx_exeext}
|
||||||
|
|||||||
@@ -0,0 +1,196 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
|
||||||
|
# Support for Travis CI -- https://travis-ci.org/upx/upx/builds
|
||||||
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
|
argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
|
else
|
||||||
|
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
|
fi
|
||||||
|
source "$argv0dir/travis_init.sh" || exit 1
|
||||||
|
|
||||||
|
set -x # debug
|
||||||
|
|
||||||
|
if [[ $BM_X == rebuild-stubs ]]; then exit 0; fi
|
||||||
|
# save space and do not deploy debug builds
|
||||||
|
if [[ $BM_B =~ (^|\+)coverage($|\+) ]]; then exit 0; fi
|
||||||
|
if [[ $BM_B =~ (^|\+)debug($|\+) ]]; then exit 0; fi
|
||||||
|
if [[ $BM_B =~ (^|\+)sanitize($|\+) ]]; then exit 0; fi
|
||||||
|
if [[ $BM_B =~ (^|\+)scan-build($|\+) ]]; then exit 0; fi
|
||||||
|
if [[ $BM_B =~ (^|\+)valgrind($|\+) ]]; then exit 0; fi
|
||||||
|
|
||||||
|
# prepare $subdir and $branch
|
||||||
|
subdir=
|
||||||
|
branch=
|
||||||
|
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||||
|
branch=$APPVEYOR_REPO_BRANCH
|
||||||
|
if [[ -n $APPVEYOR_PULL_REQUEST_NUMBER ]]; then exit 0; fi
|
||||||
|
elif [[ -n $GITLAB_CI ]]; then
|
||||||
|
subdir=$CI_BUILD_NAME
|
||||||
|
branch=$CI_BUILD_REF_NAME
|
||||||
|
else
|
||||||
|
branch=$TRAVIS_BRANCH
|
||||||
|
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi
|
||||||
|
fi
|
||||||
|
subdir=${subdir%%:*}; subdir=${subdir%%/*}; subdir=${subdir%%--*}
|
||||||
|
case $branch in
|
||||||
|
devel*) ;;
|
||||||
|
gitlab*) ;;
|
||||||
|
master*) ;;
|
||||||
|
travis*) ;;
|
||||||
|
*) exit 0;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# get $rev, $branch and $git_user
|
||||||
|
cd / && cd $upx_SRCDIR || exit 1
|
||||||
|
rev=$(git rev-parse --verify HEAD)
|
||||||
|
if [[ "$branch" == gitlab* ]]; then
|
||||||
|
if git fetch -v origin devel; then
|
||||||
|
git branch -a -v
|
||||||
|
rev=$(git merge-base origin/devel $rev || echo $rev)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
timestamp=$(git log -n1 --format='%at' $rev)
|
||||||
|
date=$(TZ=UTC0 date -d "@$timestamp" '+%Y%m%d-%H%M%S')
|
||||||
|
#branch="$branch-$date-${rev:0:6}"
|
||||||
|
# make the branch name a little bit shorter so that it looks nice on GitHub
|
||||||
|
branch="$branch-${date:0:8}-${rev:0:7}"
|
||||||
|
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||||
|
branch="$branch-appveyor"
|
||||||
|
git_user="AppVeyor CI"
|
||||||
|
elif [[ -n $GITLAB_CI ]]; then
|
||||||
|
branch="$branch-gitlab"
|
||||||
|
git_user="GitLab CI"
|
||||||
|
else
|
||||||
|
branch="$branch-travis"
|
||||||
|
git_user="Travis CI"
|
||||||
|
fi
|
||||||
|
unset timestamp date
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // prepare directory $d
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
cd / && cd $upx_BUILDDIR || exit 1
|
||||||
|
|
||||||
|
mkdir deploy || exit 1
|
||||||
|
chmod 700 deploy
|
||||||
|
cd deploy || exit 1
|
||||||
|
|
||||||
|
if [[ -n $BM_CROSS ]]; then
|
||||||
|
d=$BM_CROSS
|
||||||
|
else
|
||||||
|
cpu=unknown
|
||||||
|
case $BM_C in
|
||||||
|
clang*-m32 | gcc*-m32) cpu=i386;;
|
||||||
|
clang*-m64 | gcc*-m64) cpu=amd64;;
|
||||||
|
clang*-mx32 | gcc*-mx32) cpu=amd64;;
|
||||||
|
msvc*-x86) cpu=i386;;
|
||||||
|
msvc*-x64) cpu=amd64;;
|
||||||
|
esac
|
||||||
|
os=$TRAVIS_OS_NAME
|
||||||
|
if [[ $os == osx ]]; then
|
||||||
|
os=darwin
|
||||||
|
elif [[ $os == windows ]]; then
|
||||||
|
[[ $cpu == i386 ]] && os=win32
|
||||||
|
[[ $cpu == amd64 ]] && os=win64
|
||||||
|
fi
|
||||||
|
d=$cpu-$os
|
||||||
|
unset cpu os
|
||||||
|
fi
|
||||||
|
d=$d-$BM_C-$BM_B
|
||||||
|
|
||||||
|
if [[ -n $subdir ]]; then
|
||||||
|
print_header "DEPLOY $subdir/$d"
|
||||||
|
else
|
||||||
|
print_header "DEPLOY $d"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir $d || exit 1
|
||||||
|
for exeext in .exe .out; do
|
||||||
|
f=$upx_BUILDDIR/upx$exeext
|
||||||
|
if [[ -f $f ]]; then
|
||||||
|
cp -p -i $f $d/upx-git-${rev:0:12}$exeext
|
||||||
|
sha256sum -b $d/upx-git-${rev:0:12}$exeext
|
||||||
|
fi
|
||||||
|
unset f
|
||||||
|
done
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // clone, add files & push
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
new_branch=0
|
||||||
|
if ! git clone -b "$branch" --single-branch https://github.com/upx/upx-automatic-builds.git; then
|
||||||
|
git clone -b master --single-branch https://github.com/upx/upx-automatic-builds.git
|
||||||
|
new_branch=1
|
||||||
|
fi
|
||||||
|
cd upx-automatic-builds || exit 1
|
||||||
|
chmod 700 .git
|
||||||
|
git config user.name "$git_user"
|
||||||
|
git config user.email "none@none"
|
||||||
|
if [[ $new_branch == 1 ]]; then
|
||||||
|
git checkout --orphan "$branch"
|
||||||
|
git reset --hard || true
|
||||||
|
fi
|
||||||
|
git ls-files -v
|
||||||
|
|
||||||
|
if [[ -n $subdir ]]; then
|
||||||
|
[[ -d $subdir ]] || mkdir $subdir
|
||||||
|
mv ../$d $subdir/
|
||||||
|
git add $subdir/$d
|
||||||
|
else
|
||||||
|
mv ../$d .
|
||||||
|
git add $d
|
||||||
|
fi
|
||||||
|
|
||||||
|
if git diff --cached --exit-code --quiet >/dev/null; then
|
||||||
|
# nothing to do ???
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
now=$(date '+%s')
|
||||||
|
##date=$(TZ=UTC0 date -d "@$now" '+%Y-%m-%d %H:%M:%S')
|
||||||
|
git commit --date="$now" -m "Automatic build $d"
|
||||||
|
git ls-files -v
|
||||||
|
#git log --pretty=fuller
|
||||||
|
|
||||||
|
umask 077
|
||||||
|
[[ -d ~/.ssh ]] || mkdir ~/.ssh
|
||||||
|
fix_home_ssh_perms
|
||||||
|
repo=$(git config remote.origin.url)
|
||||||
|
ssh_repo=${repo/https:\/\/github.com\//git@github.com:}
|
||||||
|
eval $(ssh-agent -s)
|
||||||
|
set +x # IMPORTANT
|
||||||
|
openssl aes-256-cbc -d -a -K "$UPX_AUTOMATIC_BUILDS_SSL_KEY" -iv "$UPX_AUTOMATIC_BUILDS_SSL_IV" -in "$upx_SRCDIR/.github/upx-automatic-builds@github.com.enc" -out .git/deploy.key
|
||||||
|
set -x
|
||||||
|
chmod 600 .git/deploy.key
|
||||||
|
ssh-add .git/deploy.key
|
||||||
|
fix_home_ssh_perms
|
||||||
|
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
|
||||||
|
fix_home_ssh_perms
|
||||||
|
|
||||||
|
let i=0 || true
|
||||||
|
while true; do
|
||||||
|
if [[ $i -ge 10 ]]; then
|
||||||
|
echo "ERROR: git push failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ $new_branch == 1 ]]; then
|
||||||
|
if git push -u $ssh_repo "$branch"; then break; fi
|
||||||
|
else
|
||||||
|
if git push $ssh_repo "$branch"; then break; fi
|
||||||
|
fi
|
||||||
|
git branch -a -v
|
||||||
|
git fetch -v origin "$branch"
|
||||||
|
git branch -a -v
|
||||||
|
git rebase FETCH_HEAD
|
||||||
|
git branch -a -v
|
||||||
|
sleep $((RANDOM % 5 + 1))
|
||||||
|
let i+=1
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0
|
||||||
+102
-34
@@ -19,10 +19,18 @@ unset CROSS C B T X
|
|||||||
|
|
||||||
# just in case, unset variable for passing extra UPX options
|
# just in case, unset variable for passing extra UPX options
|
||||||
export UPX=
|
export UPX=
|
||||||
|
# un-export some vars
|
||||||
|
declare +x UPX_AUTOMATIC_BUILDS_SSL_KEY UPX_AUTOMATIC_BUILDS_SSL_IV
|
||||||
|
|
||||||
# compatibility wrappers
|
# compatibility wrappers
|
||||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
# use GNU coreutils ("brew install coreutils")
|
# use GNU coreutils ("brew install coreutils")
|
||||||
|
chmod() {
|
||||||
|
gchmod "$@"
|
||||||
|
}
|
||||||
|
date() {
|
||||||
|
gdate "$@"
|
||||||
|
}
|
||||||
readlink() {
|
readlink() {
|
||||||
greadlink "$@"
|
greadlink "$@"
|
||||||
}
|
}
|
||||||
@@ -31,7 +39,9 @@ sha256sum() {
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||||
# for some reason this is needed for bash on AppVeyor
|
openssl() {
|
||||||
|
/usr/bin/openssl "$@"
|
||||||
|
}
|
||||||
sort() {
|
sort() {
|
||||||
/usr/bin/sort "$@"
|
/usr/bin/sort "$@"
|
||||||
}
|
}
|
||||||
@@ -42,64 +52,108 @@ if [[ -z $CC_OVERRIDE ]]; then
|
|||||||
CC=false CXX=false SCAN_BUILD=false
|
CC=false CXX=false SCAN_BUILD=false
|
||||||
AR=ar SIZE=size
|
AR=ar SIZE=size
|
||||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||||
|
BUILD_LOCAL_UCL=1
|
||||||
BUILD_LOCAL_ZLIB=1
|
BUILD_LOCAL_ZLIB=1
|
||||||
|
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
||||||
|
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
||||||
|
fi
|
||||||
upx_exeext=.exe
|
upx_exeext=.exe
|
||||||
# dir c:\cygwin
|
# dir c:\cygwin
|
||||||
case $BM_C in
|
case $BM_C in
|
||||||
gcc-m32 | gcc-4.9-m32)
|
gcc-m32 | gcc-4.9-m32)
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
|
||||||
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
||||||
gcc-m64 | gcc-4.9-m64)
|
gcc-m64 | gcc-4.9-m64)
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
|
||||||
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
||||||
msvc | msvc-*)
|
msvc | msvc-*)
|
||||||
AR="link -lib"; CC="cl"; CXX="cl" ;; # standard system compiler
|
AR="link -lib"; CC="cl"; CXX="cl" ;; # standard system compiler
|
||||||
esac
|
esac
|
||||||
fi # APPVEYOR_JOB_ID
|
fi # APPVEYOR_JOB_ID
|
||||||
if [[ -n $TRAVIS_JOB_ID ]]; then # TODO: should check for Ubuntu and not for Travis
|
|
||||||
if [[ -n $BM_CROSS ]]; then
|
if [[ -n $BM_CROSS ]]; then
|
||||||
|
BUILD_LOCAL_UCL=1
|
||||||
BUILD_LOCAL_ZLIB=1
|
BUILD_LOCAL_ZLIB=1
|
||||||
case $BM_CROSS-$BM_C in
|
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
||||||
arm-linux-gnueabi-gcc | arm-linux-gnueabi-gcc-4.6)
|
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
fi
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L/usr/arm-linux-gnueabi"
|
cat /etc/os-release || true
|
||||||
x=arm-linux-gnueabi; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
if egrep -q '^PRETTY_NAME="?Ubuntu .*12\.04' /etc/os-release; then
|
||||||
arm-linux-gnueabihf-gcc | arm-linux-gnueabihf-gcc-4.6)
|
case $BM_CROSS-$BM_C in
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
arm-linux-gnueabi-gcc | arm-linux-gnueabi-gcc-4.6)
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L/usr/arm-linux-gnueabihf"
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabi"
|
||||||
x=arm-linux-gnueabihf; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
x=arm-linux-gnueabi; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
||||||
i[36]86-w64-mingw32-gcc | i[36]86-w64-mingw32-gcc-4.6)
|
arm-linux-gnueabihf-gcc | arm-linux-gnueabihf-gcc-4.6)
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabihf"
|
||||||
[[ -z $upx_wine ]] && upx_wine="wine"
|
x=arm-linux-gnueabihf; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
||||||
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
i[36]86-w64-mingw32-gcc | i[36]86-w64-mingw32-gcc-4.6)
|
||||||
x86_64-w64-mingw32-gcc | x86_64-w64-mingw32-gcc-4.6)
|
upx_exeext=.exe
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
[[ -z $upx_wine ]] && upx_wine="wine"
|
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
||||||
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
x86_64-w64-mingw32-gcc | x86_64-w64-mingw32-gcc-4.6)
|
||||||
esac
|
upx_exeext=.exe
|
||||||
fi
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
fi # TRAVIS_JOB_ID
|
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
||||||
|
esac
|
||||||
|
elif egrep -q '^PRETTY_NAME="?Ubuntu 16\.04' /etc/os-release; then
|
||||||
|
case $BM_CROSS-$BM_C in
|
||||||
|
aarch64-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-aarch64 -L /usr/aarch64-linux-gnu"
|
||||||
|
x=aarch64-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
arm-linux-gnueabi-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabi"
|
||||||
|
x=arm-linux-gnueabi; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
arm-linux-gnueabihf-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabihf"
|
||||||
|
x=arm-linux-gnueabihf; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
i[36]86-w64-mingw32-gcc-5)
|
||||||
|
upx_exeext=.exe
|
||||||
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
|
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
||||||
|
mips-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-mips -L /usr/mips-linux-gnu"
|
||||||
|
x=mips-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
mipsel-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-mipsel -L /usr/mipsel-linux-gnu"
|
||||||
|
x=mipsel-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
powerpc-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc -L /usr/powerpc-linux-gnu"
|
||||||
|
x=powerpc-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
powerpc64-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc64 -L /usr/powerpc64-linux-gnu"
|
||||||
|
x=powerpc64-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
powerpc64le-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc64le -L /usr/powerpc64le-linux-gnu"
|
||||||
|
x=powerpc64le-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
s390x-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-s390x -L /usr/s390x-linux-gnu"
|
||||||
|
x=s390x-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
x86_64-w64-mingw32-gcc-5)
|
||||||
|
upx_exeext=.exe
|
||||||
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
|
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi # BM_CROSS
|
||||||
if [[ "$CC" == "false" ]]; then # generic
|
if [[ "$CC" == "false" ]]; then # generic
|
||||||
if [[ -z $BM_CROSS ]]; then
|
if [[ -z $BM_CROSS ]]; then
|
||||||
case $BM_C in
|
case $BM_C in
|
||||||
clang | clang-m?? | clang-3.4-m?? | clang-[678][0-9][0-9]-m??)
|
clang | clang-m?? | clang-3.4-m?? | clang-[6789][0-9][0-9]-m??)
|
||||||
CC="clang"; CXX="clang++" ;; # standard system compiler
|
CC="clang"; CXX="clang++" ;; # standard system compiler
|
||||||
clang-[34].[0-9]-m??)
|
clang-[345].[0-9]-m??)
|
||||||
v=${BM_C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
v=${BM_C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
||||||
gcc | gcc-m??)
|
gcc | gcc-m?? | gcc-mx32)
|
||||||
CC="gcc"; CXX="g++" ;; # standard system compiler
|
CC="gcc"; CXX="g++" ;; # standard system compiler
|
||||||
gcc-[34].[0-9]-m??)
|
gcc-[34].[0-9]-m?? | gcc-[34].[0-9]-mx32)
|
||||||
v=${BM_C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;;
|
v=${BM_C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;;
|
||||||
gcc-[56]-m?? | gcc-[56].[0-9]-m??)
|
gcc-[567]-m?? | gcc-[567]-mx32)
|
||||||
v=${BM_C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;;
|
v=${BM_C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
fi # generic
|
fi # generic
|
||||||
case $BM_C in
|
case $BM_C in
|
||||||
clang*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
|
clang*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
|
||||||
clang*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
|
clang*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
|
||||||
gcc*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
|
gcc*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
|
||||||
gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
|
gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
|
||||||
|
gcc*-mx32) CC="$CC -mx32"; CXX="$CXX -mx32"; BUILD_LOCAL_UCL=1; BUILD_LOCAL_ZLIB=1 ;;
|
||||||
esac
|
esac
|
||||||
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
||||||
CC="$CC -std=gnu89"
|
CC="$CC -std=gnu89"
|
||||||
@@ -136,7 +190,7 @@ if [[ -z $toptop_builddir ]]; then
|
|||||||
unset d subdir dd
|
unset d subdir dd
|
||||||
fi
|
fi
|
||||||
[[ -z $toptop_builddir ]] && toptop_builddir=$(readlink -mn -- ./build)
|
[[ -z $toptop_builddir ]] && toptop_builddir=$(readlink -mn -- ./build)
|
||||||
[[ -z $toptop_bdir ]] && toptop_bdir=$(readlink -mn -- "$toptop_builddir/$BM_C/$BM_B")
|
[[ -z $toptop_bdir ]] && toptop_bdir=$(readlink -mn -- "$toptop_builddir/${BM_CROSS:+$BM_CROSS-}$BM_C/$BM_B")
|
||||||
[[ -z $upx_BUILDDIR ]] && upx_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx")
|
[[ -z $upx_BUILDDIR ]] && upx_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx")
|
||||||
[[ -z $ucl_BUILDDIR ]] && ucl_BUILDDIR=$(readlink -mn -- "$toptop_bdir/ucl-1.03")
|
[[ -z $ucl_BUILDDIR ]] && ucl_BUILDDIR=$(readlink -mn -- "$toptop_bdir/ucl-1.03")
|
||||||
[[ -z $upx_testsuite_BUILDDIR ]] && upx_testsuite_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx-testsuite")
|
[[ -z $upx_testsuite_BUILDDIR ]] && upx_testsuite_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx-testsuite")
|
||||||
@@ -163,6 +217,11 @@ done
|
|||||||
make_absolute lcov_OUTPUTDIR
|
make_absolute lcov_OUTPUTDIR
|
||||||
unset var_prefix var_suffix
|
unset var_prefix var_suffix
|
||||||
|
|
||||||
|
print_header() {
|
||||||
|
local x="==========="; x="$x$x$x$x$x$x$x"
|
||||||
|
echo -e "\n${x}\n${1}\n${x}\n"
|
||||||
|
}
|
||||||
|
|
||||||
print_settings() {
|
print_settings() {
|
||||||
local v var_prefix var_suffix
|
local v var_prefix var_suffix
|
||||||
# Build Matrix
|
# Build Matrix
|
||||||
@@ -188,4 +247,13 @@ print_settings() {
|
|||||||
##env | LC_ALL=C sort
|
##env | LC_ALL=C sort
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fix_home_ssh_perms() {
|
||||||
|
if [[ -d ~/.ssh ]]; then
|
||||||
|
if [[ -x /usr/sbin/restorecon ]]; then
|
||||||
|
/usr/sbin/restorecon -v -R ~/.ssh || true
|
||||||
|
fi
|
||||||
|
chmod -c -R go-rwx ~/.ssh || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -31,14 +31,12 @@ mkbuilddirs $upx_testsuite_BUILDDIR
|
|||||||
cd / && cd $upx_testsuite_BUILDDIR || exit 1
|
cd / && cd $upx_testsuite_BUILDDIR || exit 1
|
||||||
if [[ ! -d $upx_testsuite_SRCDIR/files/packed ]]; then exit 1; fi
|
if [[ ! -d $upx_testsuite_SRCDIR/files/packed ]]; then exit 1; fi
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // support functions
|
# // support functions
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
testsuite_header() {
|
testsuite_header() {
|
||||||
local x="==========="; x="$x$x$x$x$x$x$x"
|
print_header "$1"
|
||||||
echo -e "\n${x}\n${1}\n${x}\n"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testsuite_split_f() {
|
testsuite_split_f() {
|
||||||
@@ -46,7 +44,7 @@ testsuite_split_f() {
|
|||||||
fb=$(basename "$1")
|
fb=$(basename "$1")
|
||||||
fsubdir=$(basename "$fd")
|
fsubdir=$(basename "$fd")
|
||||||
# sanity checks
|
# sanity checks
|
||||||
if [[ ! -f $f || -z $fsubdir || -z $fb ]]; then
|
if [[ ! -f "$1" || -z "$fsubdir" || -z "$fb" ]]; then
|
||||||
fd= fb= fsubdir=
|
fd= fb= fsubdir=
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -105,7 +103,6 @@ testsuite_run_compress() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // expected checksums
|
# // expected checksums
|
||||||
# //
|
# //
|
||||||
@@ -152,86 +149,84 @@ c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.e
|
|||||||
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
|
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
|
||||||
a1f0fd57e4323eb25abf1d000569d3c7b62ceb12fb59e645d4807742baf0cd1f *amd64-linux.elf/upx-3.91
|
7301bb93535f91bb789b44da75c2f365cc2d0fa99a4d597f49de8716d96dbcf6 *amd64-linux.elf/upx-3.91
|
||||||
6be5bd999387712f90fde45556c9487d02306593146c8d3cd4ced89568732729 *arm-wince.pe/upx-3.91.exe
|
17a9aef8087ca2b3f5fc4e3a41d7c4d721bf3ad222030ac2068ed00eb85a9deb *arm-wince.pe/upx-3.91.exe
|
||||||
9d0ccc7e39ef23845b858869bf9718c43de5fd0eee7c61edbd63565a55110032 *armeb-linux.elf/upx-3.91
|
3ddbde0d00ff6ea9ce163d889e6f418146b35238d05005b98b76adb555bcf644 *armeb-linux.elf/upx-3.91
|
||||||
03988f039a5372125bf90b6658516656a8582dd1c46423cb12faeb82870348bb *i386-dos32.djgpp2.coff/upx-3.91.exe
|
f680566e3daae0526c5f6965c23219d7946c4d4117eeaa277bd9e68e907418c6 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
91a9d980788c2974448c83a84af245cf22dbbe01d33850849c8b0ebcec79aab4 *i386-linux.elf/upx-3.91
|
14394ce9806dc7a3622addfb625d1731e021600e0489dc7c8ea7f30c54d1fd37 *i386-linux.elf/upx-3.91
|
||||||
b9145c02bac9ce7f10bd65587ce35001d3e15a7a102d8f7cc51930b92f477ebf *i386-win32.pe/upx-3.91.exe
|
d3cfb5347758ee54e54cfc92ae502a3e19702cd4fec115d74f84f8a5ab7a9bc2 *i386-win32.pe/upx-3.91.exe
|
||||||
08baacfa5d7e9339cd67263f41983e7c6f773fe9fce862f5daad58a2ac57ce28 *m68k-atari.tos/upx-3.91.ttp
|
d0e68eed8f001f3074351acbc7133bd41f67f8e3b7e5f82d5df1911481123378 *m68k-atari.tos/upx-3.91.ttp
|
||||||
6b33a055b2c85dddd5fa6d846939d114ee24a342205f5a23aad31b8873041592 *mipsel-linux.elf/upx-3.91
|
58db1b12b5462dbb05c08d7952cacd7c7090a6b3cbfbf9b431e6390f246cbb95 *mipsel-linux.elf/upx-3.91
|
||||||
3e97639d9b13132edd3cf5e17f18a5d3f158124b920cabe8c415b8df3e4a8d1d *powerpc-linux.elf/upx-3.91
|
4fd2e2fc33563e95453f9b4a52c153f248937a548cbfe746bb0d71f19ae5ad03 *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
|
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
|
||||||
1e870e9e12336eaa18289efa86275822025e15feeb9168b21f8c438f2560b84e *amd64-linux.elf/upx-3.91
|
e537c1a28bea559cbe43cd23723443e2617316a40a6632927f6d94589f800efe *amd64-linux.elf/upx-3.91
|
||||||
23ef6083a6e678975305ceb96f78ce186973b4400d357ca643573b6dd6487512 *arm-wince.pe/upx-3.91.exe
|
33a13fa63379b9eae6878cd2bfb0b41963795a27bc5a026de0b50b4a43131b12 *arm-wince.pe/upx-3.91.exe
|
||||||
5f1584a75584ef3421ba4aec8167422e78d33e2451ef9a925560d1112eacf88e *armeb-linux.elf/upx-3.91
|
3c6f9ab67e21c72073f66c558765d8f07f192ba63d3ffb2ce40ebc9178ccd5ef *armeb-linux.elf/upx-3.91
|
||||||
8d2938aa4c2b6ee3c50a2fce1041592a766d48c26605b50129b8a14697cc9694 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
28bc9ee28b73b11a32fb2e4d3ad99ff06d61cf5b9f104052db89f6f6f0557ca9 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
40ecb345f3094446b5035e058b3d2351c42cc9f108333e3e4d51a64142d8950c *i386-linux.elf/upx-3.91
|
8201f15f7ef5e54cddb18474a5ed2d48e2fc7726d6014c457ad3cd82c01e1072 *i386-linux.elf/upx-3.91
|
||||||
7f4931501baa222ce54b241417f143162865de790be48ecc75846115baa2ce2f *i386-win32.pe/upx-3.91.exe
|
5bebadb8455b052580b1f22a949c3eb5a441c8b6ba9c6b50506cb703fc3f65ce *i386-win32.pe/upx-3.91.exe
|
||||||
5abbe27c76c6f12fb560e68dbf56dd0f39bb089428374c42be7585d09f7df1fd *m68k-atari.tos/upx-3.91.ttp
|
e4d3a430f93b41a3aa67492e6c06d74a1fcd4e06b272de2c681252d91b7a953a *m68k-atari.tos/upx-3.91.ttp
|
||||||
ac552f23195dfebd82558e0523eaa6ece695c711f298ed9a3cdbb571f1df4f1d *mipsel-linux.elf/upx-3.91
|
1bd8be4eb09dc39b4b0d447ef4eebac29c51d56380be79b46461962dea81b8fb *mipsel-linux.elf/upx-3.91
|
||||||
d30f7e75bcfab63aa620e0c677f738395ab7c8b26ba0871e94e052849660dccb *powerpc-linux.elf/upx-3.91
|
c1928cd500450f1f09f2c0265980c329cd0e083095abb3a48f1999a7dd551309 *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
|
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
|
||||||
bc67396d280c28532b2687fe694fb5dfaef60b1d1b05881027a2a97322545f7e *amd64-linux.elf/upx-3.91
|
3fadda0299775195558de2ac25a673ab65467bd147ab8aaf57b7af1542f1d5de *amd64-linux.elf/upx-3.91
|
||||||
8844ace5189f90a9bf696e5fa2323be9e715d90df4ba60805a2079cb94c218f1 *arm-wince.pe/upx-3.91.exe
|
99f7d8d7faf57c78053158c6a6915dab8c5cfdcc73112cee9607bcec55837ae8 *arm-wince.pe/upx-3.91.exe
|
||||||
ea42d52676d2698f29587e98a9e1536b96ebf523a7d8bc926f6c241a159b4116 *armeb-linux.elf/upx-3.91
|
8f06e11a0c60fd83db607089b7ad985a48a26ee09bd533e55072f9fe2ba39f2f *armeb-linux.elf/upx-3.91
|
||||||
27f1afd1e1fec37d4dcd43163b9ec60a6af3abeab21a4adf539b7faea848eb20 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
542c368392f2d584145cc51d51b9dbc5dc61754597bb1cb7673821a2a4650816 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
5edf3dcfd0458b0f23c19e6c44b4c54a5457bc34c3bf045b37678d4f96301e00 *i386-linux.elf/upx-3.91
|
edf61800e09e0ef963b27fded0e032839f4b0cb907a84e43d19ed31bd536440f *i386-linux.elf/upx-3.91
|
||||||
e440de3826a193a81700dd6238eab5f903826e08af120a25bc963ffb6d365087 *i386-win32.pe/upx-3.91.exe
|
ef5e25c79d356e9ed0736f34dc5ee7a8f4c66d0c330b8d16672fac7d829b5a7c *i386-win32.pe/upx-3.91.exe
|
||||||
510e2cd126bb8129b9076eb61e1ad3308d9af109cd42dff7252bf43e1e3552ea *m68k-atari.tos/upx-3.91.ttp
|
2c85e506d670aef707789e5d8a97901ddbb42f50a205a207f575f79b901c2cd7 *m68k-atari.tos/upx-3.91.ttp
|
||||||
b61aa58e493b3961646e5c0bcb7f19f74b439fe8f5c934db25b00f97f51a05d0 *mipsel-linux.elf/upx-3.91
|
93014cd6edd07fafcae133b449837f550f92eeab86ceebd8e7ed5337ab65bdc2 *mipsel-linux.elf/upx-3.91
|
||||||
18c6b0ec20590dfbe4851ad837e2bb9bc99c6e4e1ac97b49dff2fb632e0e9d4c *powerpc-linux.elf/upx-3.91
|
761f0d45b61e020fd8931cd5192677d06b34fec64a534d99be9fe0346eb56d2b *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
expected_sha256sums__t140_compress_lzma_2_no_filter="\
|
expected_sha256sums__t140_compress_lzma_2_no_filter="\
|
||||||
07e31b504273082dc475f217d8418f76ca409f018d42073a387f8a886dbaa83e *amd64-linux.elf/upx-3.91
|
4abe4fff006e53ee147573d74a0f7feba9ebc62b8233e19ac331c5350391bd66 *amd64-linux.elf/upx-3.91
|
||||||
0eceefcc32ed25b2f1296cfa853935124aa1b7785b8a177d6e8c5804c24ca319 *arm-wince.pe/upx-3.91.exe
|
df8ad2d951368ddfb64b8c405f4b4727a2cf5f1c823ecd6e1d298eb21cad0afc *arm-wince.pe/upx-3.91.exe
|
||||||
3e7446d8ac6d9b442d6c8e6a3c45aec97f54aa8e90bdc554dd39976495bfa36a *armeb-linux.elf/upx-3.91
|
cd109f76ff00030f564a883da5a57784d9626e85c2c54e6de1f0f2cfda709325 *armeb-linux.elf/upx-3.91
|
||||||
1ecd559c89d3995fa0e7ecfa8e60b7746f804fc74ddce87d2c6cbeac8e372a39 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
deeae51e0a4c25e6f5afd741361eea445c198fba247b583663b010778699419a *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
8a9bde7a9b4a8f6c4efc4a28afe2b3cabe6c0b820dbc38c74c6abae73093b784 *i386-linux.elf/upx-3.91
|
591d02bbb604aab55ed653411ea5888d3e93c5e078f3fc79f73d54b12bc83b22 *i386-linux.elf/upx-3.91
|
||||||
02d3b09168728cace52f29c5ee5a455c71d2777ccf12f6767cf92a709ceb6640 *i386-win32.pe/upx-3.91.exe
|
171bde9f27a5571b524e9d7cdba6cefa142bb8a0b114c4d5294944ee5781e0bb *i386-win32.pe/upx-3.91.exe
|
||||||
35333e53bc2f8a4a8e346f4fba0d366f024bd63d0b8bb083967193ae6466b6ff *m68k-atari.tos/upx-3.91.ttp
|
54ca62d5f15ce87708867f7b349584799779711bca015a3ebac69f5cf077b905 *m68k-atari.tos/upx-3.91.ttp
|
||||||
20526efe085aee06bfde1952f90e9d0e1524e0cb56d582caa720934f55562b78 *mipsel-linux.elf/upx-3.91
|
bc9c9ce0ce7ce32e3f77fca39ffdd7809731e93f978fb201ea49b53a980c5d4e *mipsel-linux.elf/upx-3.91
|
||||||
65990ec2ab6bceb2d5444918af797be0bdb0931abce8e7db0d2e774614faa64b *powerpc-linux.elf/upx-3.91
|
4357697b615fb40d041ad5a2217a4722aa9066d2100ba2c73212262f581f820f *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
expected_sha256sums__t150_compress_ucl_2_all_filters="\
|
expected_sha256sums__t150_compress_ucl_2_all_filters="\
|
||||||
e773ed4ac55d5b967e4c1654f2b540899a63f7722a44d7056d424a6292274aa4 *amd64-linux.elf/upx-3.91
|
15dd4ad982953a1f7b7c74e7cb34e777fc7db11201280cd5af19ac547c8b9a0f *amd64-linux.elf/upx-3.91
|
||||||
0bf874c45ebb90b062cd986fe10cfbd01cdc6a50e3e0b5dda035eb55ded492ff *arm-wince.pe/upx-3.91.exe
|
a8cd8c9abb50ab45f30bd2f01bcb4d2e934806440ef206d7da44097aced7085b *arm-wince.pe/upx-3.91.exe
|
||||||
db894f24777334abb9bf8e34661d057e25c2889b46290cf83db7310c4cdd86fa *armeb-linux.elf/upx-3.91
|
c7af209eb44204a6e4ccbed18e1b3f6eaac5df01c1106426d375d1cd65cd01fd *armeb-linux.elf/upx-3.91
|
||||||
33bde57c3f7ed8809bec0658fe6c48d047bdec97476643f2e8e2970ab0c4eb5f *i386-dos32.djgpp2.coff/upx-3.91.exe
|
ea265e1f78c23beb632187bfebcb4ae15ce688f10e87db69952ab54724666042 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
7f4ad752cab7db426356eb5068e37d06bade2422b6012069814dcfadae7e2cca *i386-linux.elf/upx-3.91
|
530a267e8fdae0f4b746df62d3f2d406c6bcb08a58058448b867e372dd4a6cc6 *i386-linux.elf/upx-3.91
|
||||||
b00756ba6b73b937ac3b2c1222267dc44953ac69337a7ac582ba2e7a471e83a6 *i386-win32.pe/upx-3.91.exe
|
7c3d7398f63eb9e235992d2d8fd6de9e355f6f21621c45032a6ae6c9009067e6 *i386-win32.pe/upx-3.91.exe
|
||||||
7b09fa5b2f8d85673f3a52c3b478a8dd129ed23681de4028625b33f5f6890942 *m68k-atari.tos/upx-3.91.ttp
|
bf11d38e3a2cd2c585fdb2173368287e3d82edd5727ea3508c21752b2e7c5a53 *m68k-atari.tos/upx-3.91.ttp
|
||||||
707b7f32b8b0c1a4e5c26e370b93ae6eb60ab78f7d6163b4e853eb94e69f5d14 *mipsel-linux.elf/upx-3.91
|
271adf2c52ed777c00a17a19283478e226d76181b1dfb72d6c3aead3923fbad4 *mipsel-linux.elf/upx-3.91
|
||||||
4403a20c1951c9d42b51a175b55a4a9ee6901d626b8e3ed1e7e55a51ae098272 *powerpc-linux.elf/upx-3.91
|
a0152edb1476dc0f713bcd55a7462de200e92e7d057ff4a9af92c7af6abbc3bc *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
|
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
|
||||||
db82bffefd5ec10cea93b7cc47860db0dc122fac441980b3ae320e3b9c48c7e2 *amd64-linux.elf/upx-3.91
|
16d2a30dd00dfd38d3aba417a087a7341314fa8f5769f8c87565728f2f2bf06a *amd64-linux.elf/upx-3.91
|
||||||
df81b2376af28989faa0e48f9cb5d5f339d94166b7e11232c8d1ff952113a669 *arm-wince.pe/upx-3.91.exe
|
560335ec9f89f2cb8b2a2cff51b4d3dee215c68ecfc0a182fab4a838fafee166 *arm-wince.pe/upx-3.91.exe
|
||||||
07ca9736f1cd478bde2c8da95a6ecb95bd865dcf8ea48a396b13050ac40d196e *armeb-linux.elf/upx-3.91
|
b3b0a0c277e947cfc19048e142e71c902cfe6d77931b2a1caeba63b9449aa8c7 *armeb-linux.elf/upx-3.91
|
||||||
9e852e95b38ca57319d1e911bf97226a82b60dd336e201496c30bf62943aecce *i386-dos32.djgpp2.coff/upx-3.91.exe
|
d5f89d57c0d74923e557410e1b5ec135e3853985965bfe9fd38283851896b4c9 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
e408fbcbbe422c06fce0cfed5d28ea0f0ef7c1b9225bf1f5a7d789cc84fb93b8 *i386-linux.elf/upx-3.91
|
e6586de002ae8ccda77d9088e37412c1069626e807d81722c1cd810a8a7367e6 *i386-linux.elf/upx-3.91
|
||||||
30dbd980e85c88df62f4c13d6d0e44708f4ebfac63a4c12fa6a91b75563aead6 *i386-win32.pe/upx-3.91.exe
|
4c73a38e81fe12f36dc37e514f8580c12bdf5d8cb92e9a07b7070db291a2f7eb *i386-win32.pe/upx-3.91.exe
|
||||||
dd561ff9c530711be0934db352cf40f606066c280e27b26e7f8fd6dd1a087e6a *m68k-atari.tos/upx-3.91.ttp
|
53d9857238472bf4e2822134e8d63c11d6ed32f83615bb7491ba4441ff55c6c2 *m68k-atari.tos/upx-3.91.ttp
|
||||||
813536a8f1b8b8852ed52c560afce8b51612876ac5a3a9e51434d8677932ef7b *mipsel-linux.elf/upx-3.91
|
6b11b762f1dbf07e3135a2ccfbf558d44f4743e23e73ce7c143396b26ae49c4d *mipsel-linux.elf/upx-3.91
|
||||||
c6d010b0cdee8adc381efc424a44c14a1d110c52d7b12925265fddc4ba781a6c *powerpc-linux.elf/upx-3.91
|
96bcf3f5f0f5168d5cdfc01dee5d35e77e0eb8401ae6623ab559254cc99ffbdc *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
|
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
|
||||||
689160a438a5650a40db1193b115566b55b3caa1fbbce88b5c608dda0ebc7c43 *amd64-linux.elf/upx-3.91
|
3ded78e90066b688f820a35fe10270c2d3c00bc4c09d02f811b14a959003cd6b *amd64-linux.elf/upx-3.91
|
||||||
debd7f6b30bfcb1fef0fac558d8ae721c6a9d193c9b41126b3491c66870435ab *arm-wince.pe/upx-3.91.exe
|
6f70c268d4686a50db2843efc58ef547048d8ed0d758bad0c95a50b3ce155a1f *arm-wince.pe/upx-3.91.exe
|
||||||
7ee87918e7473d44c3a5af014cad48298f0a99c4028880d0a87a5a1776b977c7 *armeb-linux.elf/upx-3.91
|
20acc14939776fcd2e643cea83075d84a764fb12942ce52fa0e72dc313df026b *armeb-linux.elf/upx-3.91
|
||||||
dcdcad70f1b79290022041938957dccd4daa2f2fad166864cfb55f3400d5b03b *i386-dos32.djgpp2.coff/upx-3.91.exe
|
45ae9d42b5c6f1eec0ebc75e656c767efe796719b00922ba9e8095ffa5373450 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
fece6171853a531cffdf264ae0ca9a47ee3b9b9a1416adc1ba2632e5da8a5d93 *i386-linux.elf/upx-3.91
|
a6f13ec927d6a44fddd1af92190a530ff59282134080cd9881fef47b34e262f2 *i386-linux.elf/upx-3.91
|
||||||
0a32f50fe00e6f24ab5ab0bbfdfd037819f01071e849fb486a07ccc0794105f9 *i386-win32.pe/upx-3.91.exe
|
14b192b5419ca0ec2b3f238dc6ed9c17596e82ff2674a299d4b0a76d118a73de *i386-win32.pe/upx-3.91.exe
|
||||||
73dc44603f0fbf3a2a9e470c1291671b2670fa7f2f0cb54a8a7cdb883d1783c9 *m68k-atari.tos/upx-3.91.ttp
|
0c341752253e2c530f3dfefc1b4b3619f931f7e23f032a7feffeb192a6a3c373 *m68k-atari.tos/upx-3.91.ttp
|
||||||
48877f2e614d4697e0ebc6d3f69e59328e0942e48bb5e54b4d9b9fe3cb917d9f *mipsel-linux.elf/upx-3.91
|
24887c6e98651b663cf04720bf7467501fa260a86ae8f83507669cce05d4b8bf *mipsel-linux.elf/upx-3.91
|
||||||
9df3e5bb2a641d03da582f6e5dc01e2497e616d585c8e2c07c78910ca7ac6db3 *powerpc-linux.elf/upx-3.91
|
22947eb320540740b012aa53e85b99b038d5c4bf0ebcd28ea76c1c4f9018878f *powerpc-linux.elf/upx-3.91
|
||||||
"
|
"
|
||||||
########## end .sha256sums.recreate
|
########## end .sha256sums.recreate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // init
|
# // init
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
@@ -261,8 +256,8 @@ if [[ $BM_T =~ (^|\+)valgrind($|\+) ]]; then
|
|||||||
upx_valgrind="valgrind"
|
upx_valgrind="valgrind"
|
||||||
fi
|
fi
|
||||||
if [[ -z $upx_valgrind_flags ]]; then
|
if [[ -z $upx_valgrind_flags ]]; then
|
||||||
upx_valgrind_flags="--leak-check=full --show-reachable=yes"
|
#upx_valgrind_flags="--leak-check=full --show-reachable=yes"
|
||||||
upx_valgrind_flags="-q --leak-check=no --error-exitcode=1"
|
#upx_valgrind_flags="-q --leak-check=no --error-exitcode=1"
|
||||||
upx_valgrind_flags="--leak-check=no --error-exitcode=1"
|
upx_valgrind_flags="--leak-check=no --error-exitcode=1"
|
||||||
fi
|
fi
|
||||||
upx_run="$upx_valgrind $upx_valgrind_flags $upx_exe"
|
upx_run="$upx_valgrind $upx_valgrind_flags $upx_exe"
|
||||||
@@ -282,7 +277,6 @@ rm -rf ./testsuite_1
|
|||||||
mkbuilddirs testsuite_1
|
mkbuilddirs testsuite_1
|
||||||
cd testsuite_1 || exit 1
|
cd testsuite_1 || exit 1
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // decompression tests
|
# // decompression tests
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
@@ -316,7 +310,6 @@ for f in t010_decompressed/*/*; do
|
|||||||
done
|
done
|
||||||
testsuite_check_sha $testdir
|
testsuite_check_sha $testdir
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // compression tests
|
# // compression tests
|
||||||
# // info: we use fast compression levels because we want to
|
# // info: we use fast compression levels because we want to
|
||||||
@@ -351,7 +344,6 @@ testdir=t170_compress_all_methods_no_lzma_5_no_filter
|
|||||||
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
|
time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // summary
|
# // summary
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
@@ -360,13 +352,16 @@ time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
|
|||||||
recreate_expected_sha256sums .sha256sums.recreate
|
recreate_expected_sha256sums .sha256sums.recreate
|
||||||
|
|
||||||
testsuite_header "UPX testsuite summary"
|
testsuite_header "UPX testsuite summary"
|
||||||
$upx_run --version || echo "UPX-ERROR: upx --version FAILED"
|
if ! $upx_run --version; then
|
||||||
|
echo "UPX-ERROR: upx --version FAILED"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
echo "upx_exe='$upx_exe'"
|
echo "upx_exe='$upx_exe'"
|
||||||
if [[ $upx_run != $upx_exe ]]; then
|
if [[ "$upx_run" != "$upx_exe" ]]; then
|
||||||
echo "upx_run='$upx_run'"
|
echo "upx_run='$upx_run'"
|
||||||
fi
|
fi
|
||||||
if [[ -f $upx_exe ]]; then
|
if [[ -f "$upx_exe" ]]; then
|
||||||
ls -l "$upx_exe"
|
ls -l "$upx_exe"
|
||||||
file "$upx_exe" || true
|
file "$upx_exe" || true
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
uqz4mAtKkF5Ex7Zt2tRP9mhQsAYn5+Xbupfuhee/s+2yVdBBdlXXRN2Q2AhMxF01
|
||||||
|
myhEuAtRNoQ4m7eyNgNU01pKb+dlyw2xiS+izm9+5fxuuEZfiuv76tQToQLltSdq
|
||||||
|
jP3Gt08MloJGcWraFiAXXji0S45MasJO3VOdygz09PbzIvGVp/NskGCMCU9lJlRt
|
||||||
|
2CsItWR+iHs6HNurWEKtEZz4qR8+HZ6RU5IquOnnHnI357lVUiC1w2qRcxmNVWuI
|
||||||
|
qS7GPvgisv0m4XMxe+l4L3b6a7laZr/hqHjFQqu/aO9Kmy5WmYRe3Bx4hTv5vqRi
|
||||||
|
OBDOUzwUcrdlUu2wqcvZhVxPaxxqA5u8G63Z3O30VCtWPZVU4yx9TRzcy/0lwxol
|
||||||
|
dw1b5t7Bl8uIzNyLsFMVS1MpnBspUrxBko6TqLAhv/DvUQmWGJRkP4Ar9naB4myS
|
||||||
|
vX6sim+Jn57Fr8aZMlvJbqlNindjxnX6+13u51C80GaYJBjHLkAIPaTTNLviOWpj
|
||||||
|
rbACDifaFloAsgJqz0KK/T7eohJBH2jVe2d9YxU6wZq6THDKJaeQ+nG5MWYvlkWa
|
||||||
|
K3N+jN8KI1GWqNpUtD8rbLPY1UZo05wQFZBCfdvEZoYdzJFVIS3t6kr0/gOIZu0D
|
||||||
|
AAIfIcopnpWpUk52MOEekzRRjJuF8fUMkiPX1oVs9HMKW+TU+yx/sFia+ke76w3i
|
||||||
|
1oiHKJJJNaoCjQXlAcT40rGLmSTLgL0ACCWIMGjK1QJYkpER8GCBCh9/whrJ3k1Q
|
||||||
|
0hm5hYiGty2ysRJFLIFPkYjangz7hIVzgOUSTYhVjJmIA62W2LmNKcixGX+sssCJ
|
||||||
|
/DK/Zs0uPiEX4gjkiomDksn7Dy8vAtHe7PzWpZA83mgPK+6zxoM6dgpM7FSe5q1/
|
||||||
|
tyf394l4nB7eayRUnx3NfK2/PTwrJcms5yAD9Hm2h72cp26TXh+RDVYWOgVX5/N0
|
||||||
|
dIsDRYo+/077pRTKwiCPrMxTxys53HHV7r5APd+FPmxikXvuszZvYTZ9K2MZB/1L
|
||||||
|
S2MCJ/u4GTTCwcbvfEjKVs3Fbqu7c2D/tVzakVEmMXloEAGPN/NrzOJsMMEDhWiw
|
||||||
|
g1wneAg5qF5nG+7R5WqstAeaRCYdXl46xay7iePZQ7viwHA8Zjuke18eHmh7J5jz
|
||||||
|
uzdh81rxCL3beoXb+BEr1/yKWfrJVTl33+m6c+zxdrV0B7O/ijlYxjke7Wo+ESac
|
||||||
|
WM2a4xU/WgXMi2+83XqcSZcRPdusZKA6bcTvAcYc/r8t7O1wjfPsTVj0WaM2DwL0
|
||||||
|
P1QTU4INmVn94zIV0+fGfyN0qI3YiS5iuOoPwLOVB13YECIyXnZz2/VJF7ZASOpS
|
||||||
|
701or4uF7GVEZxw19ow0AQttk6J/bEzbr7rZ5Um1yCMeQQ1TMHepJfuUbxle4W4S
|
||||||
|
8w8yC/Ytcy/e4rbiLG2/cY5b35LxtH1TCuaEtuiqa7vkmzr36qqD6fRWnXWC9QdR
|
||||||
|
0nWyJNj0xIIyMyilnBY2clAjDdT9qd2tMfpoz9hyBkTZPltzDw6Xd/IhhyL1URav
|
||||||
|
h0NCABGqXbpg8q7KCrIzIE6dJIh+7glfQuWkynmInntN4+fqk9Ked0haHkq5oGH5
|
||||||
|
vN5ZQNWPyQ67LaXQ4kW8iksgkgl7JEQsuie8oMuQZe13D4S3PWGFKchrBFGwN2xY
|
||||||
|
ut2+PCs5Al2BHU0qaCKdV7nCqv2tPC8G4uXNw081R2KwyoRlbKhowgFBYBTQIobJ
|
||||||
|
pc1GLU7HKm9tC61xIZ4u9oij/Bz1+gxx9vLxfx++EC/8UI23oMGygaYdda4gdEtm
|
||||||
|
v1wt8ldpzO4owI+9peFSolGLwKztwSPxln+5bvOsdsaZ6z5uW37N5ch/EwSwdmfo
|
||||||
|
Sm1i7fv/zQuZjmZkJXRJGvTd+sKdu7+IZUrTpu5W+jUfMAgmPc+AuYmSOn00K9dv
|
||||||
|
IJKY973ggNDaJKEw1uKzckl9uk/HRrgk+wgZPaWVRhOulj1npyFf+WmrZ2r3nTq0
|
||||||
|
koEI8UEselRuKJmojl4O0bz8fXZNgPtpLB/A0cdrj0Ist5TR+qRW9h3eSsybDYRS
|
||||||
|
GWP4UzFLAIwHflwNX0Q+9/u0uOxaXX6dKXzoddWksInBzh1pmQfrtUM3y7bHQYG5
|
||||||
|
zqnAMNMwm4WmtmF/mpjg0fKpiwFUU1geygkOwUsaK5Qcp5F0FPocdPRWVxUG0t3Y
|
||||||
|
QsmSpU5STb99YCs4TvhfUnQmdB2r+d0pZhlMte3v5lcpekSb2FxbUwdX3t9S2uGy
|
||||||
|
ho9CYmUj1+8ivUizjTLirOu/B8ohQT6kwvNqRSiQwU+YPa5DpxA1DYamIg6ehuX5
|
||||||
|
6u/dF4Eht+Cn6hasyzFviIUnV1y4ixLfSb0EGw+YoLbHgr8X4Uv4guaNQduKJyEu
|
||||||
|
g6p1v40fDhZ8AuQly+BOLL0yBlQoDrkY9+3HcIZAC5NmJFU5hle4Hz4gLzS6DwXo
|
||||||
|
2u8tqIELdtP9Zo4SKM7/yNy+rjl2RNRUEUNjidZsWuIC4bEeL3sUImP0Wt+zpdV0
|
||||||
|
y0RK1/wPW4dES5xFTCUp9xdP08dsSMtIrYJeBXbHrTZswnuOvk4MYGpmn/qy+qwc
|
||||||
|
GnkJtzJVm+uNspYuD0cW+JbJz5T+w1eNbejjZ+QVhqmE7ctSHndQUSueIyOcm79E
|
||||||
|
23jLzIoHMSHsiBJ8KeHN5bTfe66Gl8y3LIOpfchYd5XzkqxS7M01PxkWGZDWGYdl
|
||||||
|
6Gx64mg7ojPrSNaOzAu3da8oLvGi/YIf3wdJenZqiTzBnSzRsBnTpohQddHbB1Hj
|
||||||
|
uogDJSoad0ZSY0lLcvxncPB29hKpljFZ4IHO2UKOyO9+LFKsfK8/RbdSx/sHcUaH
|
||||||
|
hblVkVTSRReHmShxSw6abYZHivGNV0tXNXkY6uEzOMe+Vck9j9dTBSK0bFS/2Xdd
|
||||||
|
ZII/KFQH10+WEYyw+FurMUeVwU/FER4qpy+13r1PjxMSHfnJviEb8EjgvrcwAUDX
|
||||||
|
G9JNVtL4Vui6NMFV1u2qkbEMZK763YAIKYZC9UZYjbbhhgYTTMEfRcNvwVCix8nH
|
||||||
|
2TlWGhivuw5abE9QFduT1fHXJL+1uCn2GMhS8v3fxUrnGDQFit0YLlGEMm5/wVaM
|
||||||
|
PIZH5JDHlINUC0vbUrMXCz8Ztg3qhpOLiExlBHTD4vqYt9kniHLXOQfexegSC85C
|
||||||
|
AKiugEOdoHHYJGjNyXj6c0jTuMAe0CBwAKddUqPQztoKclNb02G2a9l5ColE29Uz
|
||||||
|
jXAb8PFANNqn4Nnm6oPPF1KxB45vLdT6+F1SRzXZunJ6p9N4E9KBtEOR+ixlcphL
|
||||||
|
InLJSg5iKTfWhXlSK6eldvVsP2GeoyjliERsKLgq1YGMiCW076dmoxR2Z5iPlD2V
|
||||||
|
G7Hz5nWjPBIoFhABEnONDxbrYB6ryeunILYcHpAaXSYq4OueRo6QGO8NRqFcNutG
|
||||||
|
WpwBfIlnu6rl9MDO053SJ1ah6D97n/D5aQa2JMMha0faZz84+MH3cnudAgpPjsG9
|
||||||
|
9G/2fEP08lQNAFiyY91wW3Mtj2No9+OJVYmwFORJm7IOu5nfuQZbzz9OFPcZLU5Y
|
||||||
|
DVo86icZgXayytW2XZtCKzVBDse+yi0xblGSNtwHlQIN8gKDVpa0I34DxUkIn1Cl
|
||||||
|
bk9S6+m6APF9ynN/kVCwMu9Nq3lwzmY6JCb/KX0d66uyVwYG3BN1UEWqJhDJjGep
|
||||||
|
a2JmHnG1aVhYaE/2EsOc+YP89Oub+KeuCj2dHJj2dH3QDCjr2xZUbLO7mw1tsATH
|
||||||
|
dPjNEBvxet9UU/RXqhhkfkv1XGr/umWrkjKbFqDNl5Tav/00+I59rboW7C/cWRxN
|
||||||
|
CVbadLPJlPNRR8+54G+VkDZgqaQprPwYih5a7d2MEzrMtZbU0uCJc839dqMgsf++
|
||||||
|
k4maampkcDLhxt8bBg43WoDgWxiQ+KVWyEBGmTOT2q4WYeLI9PZLseA9eNJbpt9J
|
||||||
|
oxtNNdqkU48YZWsq/3L1L0eXdGvv5TIMto4bH3SWuvQ2sepwMRxxwTg8qFrutk9K
|
||||||
|
OLOUbO1Z2ivh1g6+DAgs3RFmy9hPzzqPmJk8cL6F5tcd/VwGcow3UBJ1+Xn3SE5Y
|
||||||
|
UCHNrSfSrvDaA3N8jyvS/uPq0qRgp7LQRqrhh5cVPi67goDx/ku/fVbMbcrarO/e
|
||||||
|
Czv6CX7Id2QliOSMGGVId+ECXBvuIGAb2d4til+zTnfhBE2+uS5WQ7MjzH9PKZ7n
|
||||||
|
TDuV36mA1FDCX+WShPau7R0SGXSqKyeHJ8XSuFHbGwr1Zxwoq4GBYIcAxWjp9HA4
|
||||||
|
dhBE2x5WSTbnqh1sClxfOeE8MHxi+EUonCcvfvm30NOcC4zw1dCDc6SKLoMJYrFz
|
||||||
|
EdR3Kt1SJ9M0Jl3dD/gCTKG5kObJzqmo9BladIpQt6c=
|
||||||
+1
-1
@@ -1,5 +1,6 @@
|
|||||||
/.bzr*
|
/.bzr*
|
||||||
/.hg*
|
/.hg*
|
||||||
|
/.vscode*
|
||||||
/Makevars.global*
|
/Makevars.global*
|
||||||
/build*
|
/build*
|
||||||
/maint*
|
/maint*
|
||||||
@@ -43,7 +44,6 @@ src/stub/tmp*/*.bin
|
|||||||
src/stub/tmp*/*.bin.bindump
|
src/stub/tmp*/*.bin.bindump
|
||||||
src/stub/tmp*/*.bin.disasm
|
src/stub/tmp*/*.bin.disasm
|
||||||
src/stub/tmp*/*.d
|
src/stub/tmp*/*.d
|
||||||
src/stub/tmp*/*.map
|
|
||||||
src/stub/tmp*/*.o
|
src/stub/tmp*/*.o
|
||||||
src/stub/tmp*/*.o.disasm
|
src/stub/tmp*/*.o.disasm
|
||||||
src/stub/tmp*/mips.r3000-*.[is]
|
src/stub/tmp*/mips.r3000-*.[is]
|
||||||
|
|||||||
-102
@@ -1,102 +0,0 @@
|
|||||||
# Support for GibLab CI -- https://gitlab.com/
|
|
||||||
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- export TRAVIS_OS_NAME=linux
|
|
||||||
- unset CROSS C B T X
|
|
||||||
- uname -a; pwd; id; umask; env
|
|
||||||
- cat /etc/os-release || true
|
|
||||||
-
|
|
||||||
if egrep -q '^PRETTY_NAME="?Fedora' /etc/os-release; then
|
|
||||||
time rpm -qa | LC_ALL=C sort;
|
|
||||||
time dnf install -y --best --allowerasing
|
|
||||||
coreutils curl diffutils grep gzip sed
|
|
||||||
bzip2 file findutils git perl tar wget which xz
|
|
||||||
clang gcc gcc-c++ lcov make valgrind
|
|
||||||
glibc-devel libasan libstdc++-devel libubsan zlib-devel
|
|
||||||
glibc-devel.i686 libasan.i686 libstdc++-devel.i686 libubsan.i686 zlib-devel.i686;
|
|
||||||
fi
|
|
||||||
-
|
|
||||||
if egrep -q '^PRETTY_NAME="?Ubuntu' /etc/os-release; then
|
|
||||||
export DEBIAN_FRONTEND=noninteractive;
|
|
||||||
time dpkg -l;
|
|
||||||
time apt-get -yq update;
|
|
||||||
time apt-get -yq --no-install-suggests --no-install-recommends --force-yes upgrade;
|
|
||||||
time apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
|
|
||||||
build-essential ca-certificates curl file git wget xz-utils zlib1g-dev;
|
|
||||||
fi
|
|
||||||
-
|
|
||||||
if egrep -q '^PRETTY_NAME="?Ubuntu 16\.04' /etc/os-release; then
|
|
||||||
dpkg --add-architecture i386;
|
|
||||||
time apt-get -yq update;
|
|
||||||
time apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
|
|
||||||
crossbuild-essential-arm64 crossbuild-essential-armel crossbuild-essential-armhf
|
|
||||||
crossbuild-essential-powerpc crossbuild-essential-ppc64el crossbuild-essential-s390x
|
|
||||||
qemu wine;
|
|
||||||
fi
|
|
||||||
- umask 022; mkdir -p ../deps ../build/gitlab
|
|
||||||
- time git submodule update --init --recursive
|
|
||||||
- cd ../deps && time wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -xJ
|
|
||||||
- cd ../deps && time wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ
|
|
||||||
- cd ../deps && time git clone https://github.com/upx/upx-testsuite
|
|
||||||
- cd $CI_PROJECT_DIR; pwd
|
|
||||||
|
|
||||||
Fedora23-clang+gcc-m32+m64:
|
|
||||||
image: fedora:23
|
|
||||||
script:
|
|
||||||
- time C=clang-m32 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m32 bash ./.github/travis_build.sh
|
|
||||||
- time C=clang-m64 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m64 B=sanitize bash ./.github/travis_build.sh
|
|
||||||
- time C=clang-m32 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=clang-m64 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m64 B=sanitize bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m64 T=valgrind bash ./.github/travis_testsuite_1.sh
|
|
||||||
tags: [ shared ]
|
|
||||||
except: [ tags ]
|
|
||||||
|
|
||||||
Fedora24-clang+gcc-m32+m64:
|
|
||||||
image: fedora:24
|
|
||||||
script:
|
|
||||||
- time C=clang-m32 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m32 bash ./.github/travis_build.sh
|
|
||||||
- time C=clang-m64 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m64 B=sanitize bash ./.github/travis_build.sh
|
|
||||||
- time C=clang-m32 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=clang-m64 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m64 B=sanitize bash ./.github/travis_testsuite_1.sh
|
|
||||||
- time C=gcc-m64 T=valgrind bash ./.github/travis_testsuite_1.sh
|
|
||||||
tags: [ shared ]
|
|
||||||
except: [ tags ]
|
|
||||||
|
|
||||||
Ubuntu1204-gcc-m64:
|
|
||||||
image: ubuntu:12.04
|
|
||||||
script:
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
|
|
||||||
tags: [ shared ]
|
|
||||||
except: [ tags ]
|
|
||||||
|
|
||||||
Ubuntu1404-gcc-m64:
|
|
||||||
image: ubuntu:14.04
|
|
||||||
script:
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
|
|
||||||
tags: [ shared ]
|
|
||||||
except: [ tags ]
|
|
||||||
|
|
||||||
Ubuntu1604-gcc-m64:
|
|
||||||
image: ubuntu:16.04
|
|
||||||
script:
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_build.sh
|
|
||||||
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
|
|
||||||
tags: [ shared ]
|
|
||||||
except: [ tags ]
|
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
[submodule "src/lzma-sdk"]
|
[submodule "src/lzma-sdk"]
|
||||||
path = src/lzma-sdk
|
path = src/lzma-sdk
|
||||||
url = https://github.com/upx/upx-lzma-sdk.git
|
url = https://github.com/upx/upx-lzma-sdk.git
|
||||||
branch = master
|
branch = master
|
||||||
|
|||||||
+135
-51
@@ -2,33 +2,35 @@
|
|||||||
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
dist: precise
|
||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
notifications:
|
notifications: { email: { on_success: never, on_failure: change } }
|
||||||
email:
|
|
||||||
on_success: never
|
|
||||||
on_failure: change
|
|
||||||
|
|
||||||
.ubuntu_toolchain_sources: &S
|
# Ubuntu 12.04 LTS "Precise"
|
||||||
|
.ubuntu_precise_toolchain_sources: &PS
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-precise-3.5
|
- llvm-toolchain-precise-3.5
|
||||||
- llvm-toolchain-precise-3.6
|
- llvm-toolchain-precise-3.6
|
||||||
- llvm-toolchain-precise-3.7
|
- llvm-toolchain-precise-3.7
|
||||||
- llvm-toolchain-precise-3.8
|
- llvm-toolchain-precise-3.8
|
||||||
|
- llvm-toolchain-precise-3.9
|
||||||
|
|
||||||
|
# Ubuntu 14.04 LTS "Trusty"
|
||||||
|
.ubuntu_trusty_toolchain_sources: &TS
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-5.0
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- CROSS= C= B= T= X=
|
- CROSS= C= B= T= X=
|
||||||
matrix:
|
- secure: "YXHLXK+CM5d8yELIUSSs+P0/CoefClO7/AUX1oBj5W75g+YzR5uS2doVsB8UH8S8/GdNxk4P9Jgn4EiEVnjfGgn2eAD9MVpDPIxyJs5vI+5G77asq3QNdSl6QFv3O9I/6yBoVCewgPFPqsMd7Yvs/Ea3LcQkqalVhrC8ybYtmfs6VL2w33gn2J3b3TCn/s21L0ijklM0xvP1GNMDtuUpTSish5wvGOHE/91rwtdUDbJR8u31QY7fTASDiNnL/7ihgEIZ5XxpDYXviX1GC+nemhX1fWpmVmuT8m30Ruodi0yJVGASw9i2SaKv/VX/fJ/w2vlCfspL5LMZKkVLlfpIo3mQGqmMHFxv7mNy+hRu50ptoWNSkWArcqifwveh2liHUpl4jTvWaVll5Tw5VUGJhAUdzCTnqLIbWFnKIgCedL3iRFi4+EbyWNxel8lFESMOTDZFfJG5yEiDJbgbLsUaT2GmrsOphwAG7zDcZzvYTdjg/lF4Wh0MUnQJ+0MhDpii8Ahjp49lAPdw8uRQyyY7d7ksYKXVIkbgl6dRCC5vZSPucJiFjq2BClqIoEmzZPvHveDbovzFkNhJX9tFLrHLcXbPPcegww1FGoQ3wBM6JwJ+TvSD6N4OdCmou05aDuuQeznHi3GxOScjGwxdMIU28fdJDCTDg2rOihm22kHVajo="
|
||||||
- TRAVIS_EMPTY_JOB_WORKAROUND=true
|
- secure: "JpSv3+QRmHcfN/bmT3mVkqET44NCPhM/qpcUssCVXnd2GW0qWURoyPHzVMn/gbeAkUjR6djtN3OzJ+M181QmlmTmE26pZC9Q6r1buNDWdkIH1FcpMCa67BBAjmq+yDwulDtvCMv0lbz60v57lzHBOLczF3yMxBVTjXxt1RsrzDLHzzVaDR5lEe+sQUNeRL7Vaq8crimPNTr4ZhMe59eweTO/3AWovuSPf250k1flfv7I8audZgrVZdbVKvj5C3Sziy1AGXcu8mDfET9/Ya2XBCQHWODjiKlnhSxqthhP3gQuacaLjpS2FjvQlamd+I9x6BBoLSeNbiXD9vgCydDUKvmUrU+zQs64U1hHk9WZWVC19kG7lTtTdanGDIUlIUtFZgqE4AQpJaIUWkUmHGyHi61JMvduzX21eL5c5j9DoJteX42FPb1n3xK/JSnUkLMpbFdQuy5inhzefhDfeNzaYxt8nPwHnJqrF73SW4PLDKeRyzvg/P+zqcou8nXrHfA1z9/FlnYzf7Qc9meai9Q/JARX3Q1ZKu5uyG+RuBLe2POq0192w6pflTr1ZlLJsKNSc1147PviKfmpla1lg3/6uVzMp5tgwbve/hx9SDXiRueGttKw/ymsY662+8G24NRKo4fxNklWFHaB4owM84edDzXDckPXbPgue8/HQT8BFio="
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
exclude:
|
|
||||||
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
|
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
dist: trusty
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: X=rebuild-stubs
|
env: X=rebuild-stubs
|
||||||
@@ -36,11 +38,19 @@ matrix:
|
|||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-4.4-m32
|
env: C=gcc-4.4-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-4.4-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-4.4-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-4.4-m64
|
env: C=gcc-4.4-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-4.4" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-4.4" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.5-m32
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.5-multilib", "zlib1g-dev:i386" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.5-m64
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.5" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-4.6-m32
|
env: C=gcc-4.6-m32
|
||||||
@@ -48,42 +58,81 @@ matrix:
|
|||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-4.6-m64
|
env: C=gcc-4.6-m64
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.7-m32
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.7-multilib", "zlib1g-dev:i386" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.7-m64
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.7" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.8-m32
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.8-multilib", "zlib1g-dev:i386" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.8-m64
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.8" ] } }
|
||||||
|
- os: linux
|
||||||
|
dist: trusty
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.8-mx32
|
||||||
|
addons: { apt: { packages: [ "g++-multilib", "libx32stdc++-4.8-dev" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.9-m32
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.9-multilib", "zlib1g-dev:i386" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-4.9-m64
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "g++-4.9" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-5-m32
|
env: C=gcc-5-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-5-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-5-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-5-m64
|
env: C=gcc-5-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-5" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-5" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-6-m32
|
env: C=gcc-6-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-6-m64
|
env: C=gcc-6-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-6-m32 B=debug
|
env: C=gcc-6-m32 B=debug
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-6-m64 B=debug
|
env: C=gcc-6-m64 B=debug
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-6-m64 B=debug+sanitize
|
env: C=gcc-6-m64 B=debug+sanitize
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-6-m64 B=sanitize
|
env: C=gcc-6-m64 B=sanitize
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: C=gcc-6-m64 B=valgrind T=valgrind
|
env: C=gcc-6-m64 B=valgrind T=valgrind
|
||||||
addons: { apt: { sources: *S, packages: [ "g++-6", valgrind ] } }
|
addons: { apt: { sources: *PS, packages: [ "g++-6", valgrind ] } }
|
||||||
|
- os: linux
|
||||||
|
dist: trusty
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-7-m32
|
||||||
|
addons: { apt: { sources: *TS, packages: [ "g++-7-multilib", "zlib1g-dev:i386" ] } }
|
||||||
|
- os: linux
|
||||||
|
dist: trusty
|
||||||
|
compiler: gcc
|
||||||
|
env: C=gcc-7-m64
|
||||||
|
addons: { apt: { sources: *TS, packages: [ "g++-7" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.4-m32
|
env: C=clang-3.4-m32
|
||||||
@@ -94,58 +143,76 @@ matrix:
|
|||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.5-m32
|
env: C=clang-3.5-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.5", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.5", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.5-m64
|
env: C=clang-3.5-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.5" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.5" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.6-m32
|
env: C=clang-3.6-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.6", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.6", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.6-m64
|
env: C=clang-3.6-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.6" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.6" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.7-m32
|
env: C=clang-3.7-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.7", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.7", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.7-m64
|
env: C=clang-3.7-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.7" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.7" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.8-m32
|
env: C=clang-3.8-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.8", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.8", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.8-m64
|
env: C=clang-3.8-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.8" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.8-m64 B=debug+sanitize
|
env: C=clang-3.9-m32
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.9", "g++-6-multilib", "zlib1g-dev:i386" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.8-m64 B=sanitize
|
env: C=clang-3.9-m64
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.8-m64 B=debug+scan-build
|
env: C=clang-3.9-m64 B=debug+sanitize
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-3.8-m64 B=scan-build
|
env: C=clang-3.9-m64 B=sanitize
|
||||||
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } }
|
addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: clang
|
||||||
|
env: C=clang-3.9-m64 B=debug+scan-build
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
|
||||||
|
- os: linux
|
||||||
|
compiler: clang
|
||||||
|
env: C=clang-3.9-m64 B=scan-build
|
||||||
|
addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
|
||||||
|
- os: linux
|
||||||
|
dist: trusty
|
||||||
|
compiler: clang
|
||||||
|
env: C=clang-5.0-m32
|
||||||
|
addons: { apt: { sources: *TS, packages: [ "clang-5.0", "g++-7-multilib", "zlib1g-dev:i386" ] } }
|
||||||
|
- os: linux
|
||||||
|
dist: trusty
|
||||||
|
compiler: clang
|
||||||
|
env: C=clang-5.0-m64
|
||||||
|
addons: { apt: { sources: *TS, packages: [ "clang-5.0" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: CROSS=arm-linux-gnueabi C=gcc-4.6 T=SKIP
|
env: CROSS=arm-linux-gnueabi C=gcc-4.6 T=qemu
|
||||||
addons: { apt: { packages: [ "g++-arm-linux-gnueabi", "qemu-user" ] } }
|
addons: { apt: { packages: [ "g++-arm-linux-gnueabi", "qemu-user" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env: CROSS=arm-linux-gnueabihf C=gcc-4.6 T=SKIP
|
env: CROSS=arm-linux-gnueabihf C=gcc-4.6 T=qemu
|
||||||
addons: { apt: { packages: [ "g++-arm-linux-gnueabihf", "qemu-user" ] } }
|
addons: { apt: { packages: [ "g++-arm-linux-gnueabihf", "qemu-user" ] } }
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
@@ -174,20 +241,25 @@ matrix:
|
|||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-703-m64
|
env: C=clang-703-m64
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode8.1
|
osx_image: xcode8.3
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-800-m32
|
env: C=clang-802-m32
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode8.1
|
osx_image: xcode8.3
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: C=clang-800-m64
|
env: C=clang-802-m64
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9.2
|
||||||
|
compiler: clang
|
||||||
|
env: C=clang-900-m32
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9.2
|
||||||
|
compiler: clang
|
||||||
|
env: C=clang-900-m64
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- umask 022; cd $TRAVIS_BUILD_DIR && mkdir -p ../deps
|
- uname -a; pwd; id; umask
|
||||||
- cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -xJ
|
- cat /etc/os-release || true
|
||||||
- cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ
|
|
||||||
- cd ../deps && travis_retry git clone https://github.com/upx/upx-testsuite
|
|
||||||
- if [[ $X =~ (^|\+)rebuild-stubs($|\+) ]]; then cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20160918/bin-upx-20160918.tar.xz | tar -xJ; fi
|
|
||||||
- |
|
- |
|
||||||
cd /
|
cd /
|
||||||
if [[ $TRAVIS_OS_NAME == linux ]]; then
|
if [[ $TRAVIS_OS_NAME == linux ]]; then
|
||||||
@@ -202,10 +274,22 @@ install:
|
|||||||
travis_retry pip install --user cpp-coveralls
|
travis_retry pip install --user cpp-coveralls
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
- git --version && bash --version
|
||||||
|
- umask 022; cd $TRAVIS_BUILD_DIR && mkdir -p ../deps ../build/travis
|
||||||
|
- cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -xJ
|
||||||
|
- cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ
|
||||||
|
- cd ../deps && travis_retry git clone https://github.com/upx/upx-testsuite
|
||||||
|
- |
|
||||||
|
if [[ $X =~ (^|\+)rebuild-stubs($|\+) ]]; then
|
||||||
|
cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20160918/bin-upx-20160918.tar.xz | tar -xJ
|
||||||
|
fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cd $TRAVIS_BUILD_DIR && mkdir -p ../build/travis
|
- success=1
|
||||||
- cd $TRAVIS_BUILD_DIR && bash ./.github/travis_build.sh
|
- cd $TRAVIS_BUILD_DIR || success=0
|
||||||
- cd $TRAVIS_BUILD_DIR && bash ./.github/travis_testsuite_1.sh
|
- test $success = 0 || bash ./.github/travis_build.sh || success=0
|
||||||
|
- test $success = 0 || bash ./.github/travis_testsuite_1.sh || success=0
|
||||||
|
- test $success = 0 || bash ./.github/travis_deploy.sh || success=0
|
||||||
|
- test $success = 1
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
# vim:set ts=2 sw=2 et:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2016 Markus Oberhumer, Laszlo Molnar & John Reiser
|
Copyright (c) 1996-2018 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
https://upx.github.io
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# UPX toplevel Makefile - needs GNU make 3.81 or better
|
# UPX toplevel Makefile - needs GNU make 3.81 or better
|
||||||
#
|
#
|
||||||
# Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
# Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
#
|
#
|
||||||
|
|
||||||
MAKEFLAGS += -rR
|
MAKEFLAGS += -rR
|
||||||
|
|||||||
@@ -2,8 +2,27 @@
|
|||||||
User visible changes for UPX
|
User visible changes for UPX
|
||||||
==================================================================
|
==================================================================
|
||||||
|
|
||||||
|
Changes in 3.95 (26 Aug 2018):
|
||||||
|
* Flag --android-shlib to work around bad design in Android
|
||||||
|
* Flag --force-pie when ET_DYN main program is not marked as DF_1_PIE
|
||||||
|
* Better compatibility with varying layout of address space on Linux
|
||||||
|
* Support for 4 PT_LOAD layout in ELF generated by binutils-2.31
|
||||||
|
* bug fixes, particularly better diagnosis of malformed input
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/4
|
||||||
|
|
||||||
|
Changes in 3.94 (12 May 2017):
|
||||||
|
* Add support for arm64-linux (aka "aarch64").
|
||||||
|
* Add support for --lzma compression on 64-bit PowerPC (Thierry Fauck).
|
||||||
|
* For Mach, "upx -d" will unpack a prefix of the file (and warn).
|
||||||
|
* Various improvements to the ELF formats.
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/3
|
||||||
|
|
||||||
|
Changes in 3.93 (29 Jan 2017):
|
||||||
|
* Fixed some win32/pe and win64/pe regressions introduced in 3.92
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/2
|
||||||
|
|
||||||
Changes in 3.92 (11 Dec 2016):
|
Changes in 3.92 (11 Dec 2016):
|
||||||
* UPX has moved to GitHub - the new home page is https://upx.github.io
|
* INFO: UPX has moved to GitHub - the new home page is https://upx.github.io
|
||||||
* IMPORTANT: all PE formats: internal changes: reunited the diverged source
|
* IMPORTANT: all PE formats: internal changes: reunited the diverged source
|
||||||
files - please report all regressions into the bug tracker and try UPX 3.91
|
files - please report all regressions into the bug tracker and try UPX 3.91
|
||||||
in case of problems.
|
in case of problems.
|
||||||
@@ -15,7 +34,7 @@ Changes in 3.92 (11 Dec 2016):
|
|||||||
by Codenomicon to NCSC-FI on 2015-01-08.
|
by Codenomicon to NCSC-FI on 2015-01-08.
|
||||||
The vulnerabilities were discovered by Joonas Kuorilehto and
|
The vulnerabilities were discovered by Joonas Kuorilehto and
|
||||||
Antti Häyrynen from Codenomicon.
|
Antti Häyrynen from Codenomicon.
|
||||||
* bug fixes
|
* bug fixes - see https://github.com/upx/upx/milestone/1
|
||||||
|
|
||||||
Changes in 3.91 (30 Sep 2013):
|
Changes in 3.91 (30 Sep 2013):
|
||||||
* Added experimental support for Windows 64-bit PE files, based on
|
* Added experimental support for Windows 64-bit PE files, based on
|
||||||
@@ -99,7 +118,7 @@ Changes in 2.93 beta (08 Mar 2007):
|
|||||||
you have to explicitly use '--lzma' even for '--ultra-brute' here
|
you have to explicitly use '--lzma' even for '--ultra-brute' here
|
||||||
because runtime decompression is about 30 times slower than NRV -
|
because runtime decompression is about 30 times slower than NRV -
|
||||||
which is really noticeable on old machines.
|
which is really noticeable on old machines.
|
||||||
* dos/exe: fixed a rarely occuring bug in relocation handling
|
* dos/exe: fixed a rarely occurring bug in relocation handling
|
||||||
* win32/pe & arm/pe: better icon compression handling
|
* win32/pe & arm/pe: better icon compression handling
|
||||||
|
|
||||||
Changes in 2.92 beta (23 Jan 2007):
|
Changes in 2.92 beta (23 Jan 2007):
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2016 Markus Oberhumer, Laszlo Molnar & John Reiser
|
Copyright (c) 1996-2018 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
https://upx.github.io
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2016 Markus Oberhumer, Laszlo Molnar & John Reiser
|
Copyright (c) 1996-2018 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
https://upx.github.io
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
@@ -103,9 +103,9 @@ THE FUTURE
|
|||||||
COPYRIGHT
|
COPYRIGHT
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 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.
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2016 Markus Oberhumer, Laszlo Molnar & John Reiser
|
Copyright (c) 1996-2018 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
https://upx.github.io
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ Prerequisites
|
|||||||
|
|
||||||
- first of all you need to build the UCL compression library
|
- first of all you need to build the UCL compression library
|
||||||
http://www.oberhumer.com/opensource/ucl/
|
http://www.oberhumer.com/opensource/ucl/
|
||||||
|
Use "CC=gcc -std=gnu89" especially with gcc-6.3 and gcc-7.1.
|
||||||
|
To build for native aarch64 (64-bit ARM) the files config.guess
|
||||||
|
and config.sub must be updated according to the recipe at
|
||||||
|
https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html
|
||||||
|
|
||||||
|
|
||||||
Tools needed to build/modify the UPX sources
|
Tools needed to build/modify the UPX sources
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2016 Markus Oberhumer, Laszlo Molnar & John Reiser
|
Copyright (c) 1996-2018 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
https://upx.github.io
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+7
-9
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# UPX doc Makefile - needs GNU make 3.80 or better
|
# UPX doc Makefile - needs GNU make 3.81 or better
|
||||||
#
|
#
|
||||||
|
|
||||||
MAKEFLAGS += -rR
|
MAKEFLAGS += -rR
|
||||||
@@ -12,14 +12,6 @@ empty :=
|
|||||||
space := $(empty) $(empty)
|
space := $(empty) $(empty)
|
||||||
tab := $(empty) $(empty)
|
tab := $(empty) $(empty)
|
||||||
|
|
||||||
# update $PATH for our special stub build tools
|
|
||||||
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
|
|
||||||
export PATH := $(HOME)/local/bin/bin-upx:$(PATH)
|
|
||||||
endif
|
|
||||||
ifneq ($(wildcard $(HOME)/bin/bin-upx/.),)
|
|
||||||
export PATH := $(HOME)/bin/bin-upx:$(PATH)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
@@ -58,22 +50,28 @@ mostlyclean clean distclean maintainer-clean:
|
|||||||
|
|
||||||
%.1 : %.pod
|
%.1 : %.pod
|
||||||
pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(RTRIM) > $@
|
pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(RTRIM) > $@
|
||||||
|
test -s $@
|
||||||
|
|
||||||
%.doc : %.pod
|
%.doc : %.pod
|
||||||
pod2text < $< | $(RTRIM) > $@
|
pod2text < $< | $(RTRIM) > $@
|
||||||
|
test -s $@
|
||||||
|
|
||||||
%.html : %.pod
|
%.html : %.pod
|
||||||
pod2html --noindex $< | $(RTRIM) | $(DETAB2) > $@
|
pod2html --noindex $< | $(RTRIM) | $(DETAB2) > $@
|
||||||
@rm -f pod2htm*
|
@rm -f pod2htm*
|
||||||
|
test -s $@
|
||||||
|
|
||||||
%.man : %.1
|
%.man : %.1
|
||||||
nroff -man $< | $(RTRIM) > $@
|
nroff -man $< | $(RTRIM) > $@
|
||||||
|
test -s $@
|
||||||
|
|
||||||
%.ps : %.1
|
%.ps : %.1
|
||||||
groff -man $< | $(RTRIM) > $@
|
groff -man $< | $(RTRIM) > $@
|
||||||
|
test -s $@
|
||||||
|
|
||||||
%.tex : %.pod
|
%.tex : %.pod
|
||||||
pod2latex $<
|
pod2latex $<
|
||||||
|
test -s $@
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
Decompressing ELF Directly to Memory on Linux/x86
|
Decompressing ELF Directly to Memory on Linux/x86
|
||||||
Copyright (C) 2000-2016 John F. Reiser jreiser@BitWagon.com
|
Copyright (C) 2000-2018 John F. Reiser jreiser@BitWagon.com
|
||||||
|
|
||||||
References:
|
References:
|
||||||
<elf.h> definitions for the ELF file format
|
<elf.h> definitions for the ELF file format
|
||||||
|
|||||||
+7
-6
@@ -13,8 +13,8 @@ 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-2016 Markus Oberhumer, Laszlo Molnar & John Reiser
|
Copyright (c) 1996-2018 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
B<UPX> is a portable, extendable, high-performance executable packer for
|
B<UPX> is a portable, extendable, high-performance executable packer for
|
||||||
@@ -78,6 +78,7 @@ B<UPX> is a versatile executable packer with the following features:
|
|||||||
* vmlinux/386
|
* vmlinux/386
|
||||||
* watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
|
* watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
|
||||||
* win32/pe (exe and dll)
|
* win32/pe (exe and dll)
|
||||||
|
* win64/pe (exe and dll)
|
||||||
* arm/pe (exe and dll)
|
* arm/pe (exe and dll)
|
||||||
* linux/elfamd64
|
* linux/elfamd64
|
||||||
* linux/elfppc32
|
* linux/elfppc32
|
||||||
@@ -933,13 +934,13 @@ Please report all bugs immediately to the authors.
|
|||||||
|
|
||||||
=head1 COPYRIGHT
|
=head1 COPYRIGHT
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
|
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
|
|
||||||
Copyright (C) 2002-2016 Jens Medoch
|
Copyright (C) 2002-2018 Jens Medoch
|
||||||
|
|
||||||
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.
|
||||||
|
|||||||
+5
-4
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# UPX Makefile - needs GNU make 3.81 or better
|
# UPX Makefile - needs GNU make 3.81 or better
|
||||||
#
|
#
|
||||||
# Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
# Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
#
|
#
|
||||||
|
|
||||||
# build configuration options for this Makefile
|
# build configuration options for this Makefile
|
||||||
@@ -53,7 +53,6 @@ endif
|
|||||||
LIBS += -lucl -lz
|
LIBS += -lucl -lz
|
||||||
# LZMA from https://github.com/upx/upx-lzma-sdk
|
# LZMA from https://github.com/upx/upx-lzma-sdk
|
||||||
include $(top_srcdir)/src/stub/src/c/Makevars.lzma
|
include $(top_srcdir)/src/stub/src/c/Makevars.lzma
|
||||||
DEFS += -DWITH_LZMA=$(UPX_LZMA_VERSION)
|
|
||||||
|
|
||||||
CPPFLAGS += $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
|
CPPFLAGS += $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
|
||||||
ifeq ($(BUILD_TYPE_DEBUG),1)
|
ifeq ($(BUILD_TYPE_DEBUG),1)
|
||||||
@@ -149,6 +148,8 @@ upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuite
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
# run the UPX testsuite
|
# run the UPX testsuite
|
||||||
|
# The expected (old) checksums are in $(top_srcdir)/.github/travis_testsuite_1.sh
|
||||||
|
# The actual (new) checksums are in tmp-testsuite/testsuite_1/.sha256sums.recreate
|
||||||
ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),)
|
ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),)
|
||||||
ifneq ($(wildcard $(top_srcdir)/.github/travis_testsuite_1.sh),)
|
ifneq ($(wildcard $(top_srcdir)/.github/travis_testsuite_1.sh),)
|
||||||
run-testsuite: export upx_exe := ./upx$(exeext)
|
run-testsuite: export upx_exe := ./upx$(exeext)
|
||||||
@@ -162,11 +163,11 @@ endif
|
|||||||
|
|
||||||
# automatically format some C++ source code files
|
# automatically format some C++ source code files
|
||||||
ifeq ($(shell uname),Linux)
|
ifeq ($(shell uname),Linux)
|
||||||
CLANG_FORMAT_FILES += linker.cpp linker.h packhead.cpp
|
CLANG_FORMAT_FILES += linker.cpp linker.h packhead.cpp packmast.cpp packmast.h
|
||||||
CLANG_FORMAT_FILES += s_djgpp2.cpp s_object.cpp s_vcsa.cpp s_win32.cpp screen.h
|
CLANG_FORMAT_FILES += s_djgpp2.cpp s_object.cpp s_vcsa.cpp s_win32.cpp screen.h
|
||||||
CLANG_FORMAT_FILES += snprintf.cpp
|
CLANG_FORMAT_FILES += snprintf.cpp
|
||||||
CLANG_FORMAT_FILES += stdcxx.cpp stdcxx.h
|
CLANG_FORMAT_FILES += stdcxx.cpp stdcxx.h
|
||||||
CLANG_FORMAT_FILES += ui.cpp ui.h util.h
|
CLANG_FORMAT_FILES += ui.cpp ui.h util.cpp util.h work.cpp
|
||||||
clang-format:
|
clang-format:
|
||||||
$(top_srcdir)/src/stub/scripts/upx-clang-format -i $(addprefix $(top_srcdir)/src/,$(CLANG_FORMAT_FILES))
|
$(top_srcdir)/src/stub/scripts/upx-clang-format -i $(addprefix $(top_srcdir)/src/,$(CLANG_FORMAT_FILES))
|
||||||
.PHONY: clang-format
|
.PHONY: clang-format
|
||||||
|
|||||||
+18
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -142,6 +142,22 @@ inline void set_le24(void *p, unsigned v)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline unsigned get_le26(const void *p)
|
||||||
|
{
|
||||||
|
const acc_hbyte_p b = ACC_CCAST(const acc_hbyte_p, p);
|
||||||
|
return ACC_ICONV(acc_uint32l_t, b[0] ) | ( ACC_ICONV(acc_uint32l_t, b[1]) << 8) |
|
||||||
|
(ACC_ICONV(acc_uint32l_t, b[2]) << 16) | (((ACC_ICONV(acc_uint32l_t, b[3]) & 3)<< 24));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void set_le26(void *p, unsigned v)
|
||||||
|
{
|
||||||
|
acc_hbyte_p b = ACC_PCAST(acc_hbyte_p, p);
|
||||||
|
b[0] = ACC_ICONV(unsigned char, (v >> 0) & 0xff);
|
||||||
|
b[1] = ACC_ICONV(unsigned char, (v >> 8) & 0xff);
|
||||||
|
b[2] = ACC_ICONV(unsigned char, (v >> 16) & 0xff);
|
||||||
|
b[3] = ACC_ICONV(unsigned char, (v >> 24) & 0x03) | (0xFC & b[3]);
|
||||||
|
}
|
||||||
|
|
||||||
inline unsigned get_le32(const void *p)
|
inline unsigned get_le32(const void *p)
|
||||||
{
|
{
|
||||||
#if defined(ACC_UA_GET_LE32)
|
#if defined(ACC_UA_GET_LE32)
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+3
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -126,7 +126,7 @@ static int init(FILE *f, int o, int now)
|
|||||||
else
|
else
|
||||||
return CON_INIT;
|
return CON_INIT;
|
||||||
|
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
if (!screen)
|
if (!screen)
|
||||||
screen = do_construct(screen_djgpp2_construct(),fd);
|
screen = do_construct(screen_djgpp2_construct(),fd);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+15
-11
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -43,8 +43,6 @@
|
|||||||
|
|
||||||
void lzma_compress_config_t::reset()
|
void lzma_compress_config_t::reset()
|
||||||
{
|
{
|
||||||
memset(this, 0, sizeof(*this));
|
|
||||||
|
|
||||||
pos_bits.reset();
|
pos_bits.reset();
|
||||||
lit_pos_bits.reset();
|
lit_pos_bits.reset();
|
||||||
lit_context_bits.reset();
|
lit_context_bits.reset();
|
||||||
@@ -111,11 +109,11 @@ static int prepare(lzma_compress_result_t *res,
|
|||||||
res->num_fast_bytes = 64; // 5 .. 273
|
res->num_fast_bytes = 64; // 5 .. 273
|
||||||
res->match_finder_cycles = 0;
|
res->match_finder_cycles = 0;
|
||||||
// UPX overrides
|
// UPX overrides
|
||||||
res->pos_bits = lzma_compress_config_t::pos_bits_t::default_value_c;
|
res->pos_bits = lzma_compress_config_t::pos_bits_t::default_value;
|
||||||
res->lit_pos_bits = lzma_compress_config_t::lit_pos_bits_t::default_value_c;
|
res->lit_pos_bits = lzma_compress_config_t::lit_pos_bits_t::default_value;
|
||||||
res->lit_context_bits = lzma_compress_config_t::lit_context_bits_t::default_value_c;
|
res->lit_context_bits = lzma_compress_config_t::lit_context_bits_t::default_value;
|
||||||
res->dict_size = lzma_compress_config_t::dict_size_t::default_value_c;
|
res->dict_size = lzma_compress_config_t::dict_size_t::default_value;
|
||||||
res->num_fast_bytes = lzma_compress_config_t::num_fast_bytes_t::default_value_c;
|
res->num_fast_bytes = lzma_compress_config_t::num_fast_bytes_t::default_value;
|
||||||
// method overrides
|
// method overrides
|
||||||
if (method >= 0x100) {
|
if (method >= 0x100) {
|
||||||
res->pos_bits = (method >> 16) & 15;
|
res->pos_bits = (method >> 16) & 15;
|
||||||
@@ -201,6 +199,12 @@ static int prepare(lzma_compress_result_t *res,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lzma_compress_config_t::pos_bits_t::assertValue(res->pos_bits);
|
||||||
|
lzma_compress_config_t::lit_pos_bits_t::assertValue(res->lit_pos_bits);
|
||||||
|
lzma_compress_config_t::lit_context_bits_t::assertValue(res->lit_context_bits);
|
||||||
|
lzma_compress_config_t::dict_size_t::assertValue(res->dict_size);
|
||||||
|
lzma_compress_config_t::num_fast_bytes_t::assertValue(res->num_fast_bytes);
|
||||||
|
|
||||||
res->num_probs = 1846 + (768 << (res->lit_context_bits + res->lit_pos_bits));
|
res->num_probs = 1846 + (768 << (res->lit_context_bits + res->lit_pos_bits));
|
||||||
//printf("\nlzma_compress config: %u %u %u %u %u\n", res->pos_bits, res->lit_pos_bits, res->lit_context_bits, res->dict_size, res->num_probs);
|
//printf("\nlzma_compress config: %u %u %u %u %u\n", res->pos_bits, res->lit_pos_bits, res->lit_context_bits, res->dict_size, res->num_probs);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -339,9 +343,9 @@ int upx_lzma_compress ( const upx_bytep src, unsigned src_len,
|
|||||||
};
|
};
|
||||||
PROPVARIANT pr[8];
|
PROPVARIANT pr[8];
|
||||||
const unsigned nprops = 8;
|
const unsigned nprops = 8;
|
||||||
static wchar_t matchfinder[] = L"BT4";
|
static const wchar_t matchfinder[] = L"BT4";
|
||||||
assert(NCompress::NLZMA::FindMatchFinder(matchfinder) >= 0);
|
assert(NCompress::NLZMA::FindMatchFinder(matchfinder) >= 0);
|
||||||
pr[7].vt = VT_BSTR; pr[7].bstrVal = matchfinder;
|
pr[7].vt = VT_BSTR; pr[7].bstrVal = ACC_PCAST(BSTR, ACC_UNCONST_CAST(wchar_t *, matchfinder));
|
||||||
pr[0].vt = pr[1].vt = pr[2].vt = pr[3].vt = VT_UI4;
|
pr[0].vt = pr[1].vt = pr[2].vt = pr[3].vt = VT_UI4;
|
||||||
pr[4].vt = pr[5].vt = pr[6].vt = VT_UI4;
|
pr[4].vt = pr[5].vt = pr[6].vt = VT_UI4;
|
||||||
if (prepare(res, src_len, method, level, lcconf) != 0)
|
if (prepare(res, src_len, method, level, lcconf) != 0)
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
void zlib_compress_config_t::reset()
|
void zlib_compress_config_t::reset()
|
||||||
{
|
{
|
||||||
memset(this, 0, sizeof(*this));
|
mem_clear(this, sizeof(*this));
|
||||||
|
|
||||||
mem_level.reset();
|
mem_level.reset();
|
||||||
window_bits.reset();
|
window_bits.reset();
|
||||||
|
|||||||
+40
-43
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
#if !defined(_FILE_OFFSET_BITS)
|
#if !defined(_FILE_OFFSET_BITS)
|
||||||
# define _FILE_OFFSET_BITS 64
|
# define _FILE_OFFSET_BITS 64
|
||||||
#endif
|
#endif
|
||||||
|
#undef NDEBUG
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -43,6 +44,8 @@
|
|||||||
#ifndef ACC_CFG_USE_NEW_STYLE_CASTS
|
#ifndef ACC_CFG_USE_NEW_STYLE_CASTS
|
||||||
#define ACC_CFG_USE_NEW_STYLE_CASTS 1
|
#define ACC_CFG_USE_NEW_STYLE_CASTS 1
|
||||||
#endif
|
#endif
|
||||||
|
#define ACC_CFG_PREFER_TYPEOF_ACC_INT32E_T ACC_TYPEOF_INT
|
||||||
|
#define ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG_LONG
|
||||||
#include "miniacc.h"
|
#include "miniacc.h"
|
||||||
#if !(ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_MSC)
|
#if !(ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_MSC)
|
||||||
// other compilers may work, but we're NOT interested into supporting them
|
// other compilers may work, but we're NOT interested into supporting them
|
||||||
@@ -59,7 +62,13 @@ ACC_COMPILE_TIME_ASSERT_HEADER(CHAR_MAX == 255) // -funsigned-char
|
|||||||
ACC_COMPILE_TIME_ASSERT_HEADER((char)(-1) > 0) // -funsigned-char
|
ACC_COMPILE_TIME_ASSERT_HEADER((char)(-1) > 0) // -funsigned-char
|
||||||
|
|
||||||
#if (ACC_CC_MSC)
|
#if (ACC_CC_MSC)
|
||||||
|
# pragma warning(error: 4127)
|
||||||
|
# pragma warning(error: 4146)
|
||||||
# pragma warning(error: 4319)
|
# pragma warning(error: 4319)
|
||||||
|
# pragma warning(error: 4805)
|
||||||
|
# pragma warning(disable: 4244) // -Wconversion
|
||||||
|
# pragma warning(disable: 4267) // -Wconversion
|
||||||
|
# pragma warning(disable: 4820) // padding added after data member
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// FIXME - quick hack for arm-wince-gcc-3.4 (Debian pocketpc-*.deb packages)
|
// FIXME - quick hack for arm-wince-gcc-3.4 (Debian pocketpc-*.deb packages)
|
||||||
@@ -70,7 +79,6 @@ ACC_COMPILE_TIME_ASSERT_HEADER((char)(-1) > 0) // -funsigned-char
|
|||||||
# undef HAVE_UTIME
|
# undef HAVE_UTIME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ACC_WANT_ACC_INCD_H 1
|
#define ACC_WANT_ACC_INCD_H 1
|
||||||
#define ACC_WANT_ACC_INCE_H 1
|
#define ACC_WANT_ACC_INCE_H 1
|
||||||
#define ACC_WANT_ACC_LIB_H 1
|
#define ACC_WANT_ACC_LIB_H 1
|
||||||
@@ -110,29 +118,20 @@ typedef unsigned char upx_byte;
|
|||||||
#undef _
|
#undef _
|
||||||
#undef __
|
#undef __
|
||||||
#undef ___
|
#undef ___
|
||||||
#undef NDEBUG
|
|
||||||
#undef dos
|
#undef dos
|
||||||
#undef linux
|
#undef linux
|
||||||
#undef small
|
#undef small
|
||||||
#undef tos
|
#undef tos
|
||||||
#if defined(__DJGPP__)
|
#undef unix
|
||||||
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
# undef sopen
|
# undef sopen
|
||||||
# undef __unix__
|
# undef __unix__
|
||||||
# undef __unix
|
# undef __unix
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define WITH_LZMA 0x443
|
||||||
#define WITH_UCL 1
|
#define WITH_UCL 1
|
||||||
#define WITH_ZLIB 1
|
#define WITH_ZLIB 1
|
||||||
#if !defined(WITH_LZMA) || (WITH_LZMA+0 == 0)
|
|
||||||
# error "WITH_LZMA is missing"
|
|
||||||
#elif (WITH_LZMA != 0x443)
|
|
||||||
# error "invalid WITH_LZMA version"
|
|
||||||
#endif
|
|
||||||
#if defined(UPX_OFFICIAL_BUILD)
|
|
||||||
# if !(WITH_LZMA && WITH_NRV && WITH_UCL && WITH_ZLIB)
|
|
||||||
# error
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if (WITH_UCL)
|
#if (WITH_UCL)
|
||||||
# define ucl_compress_config_t REAL_ucl_compress_config_t
|
# define ucl_compress_config_t REAL_ucl_compress_config_t
|
||||||
# include <ucl/uclconf.h>
|
# include <ucl/uclconf.h>
|
||||||
@@ -144,11 +143,6 @@ typedef unsigned char upx_byte;
|
|||||||
# undef ucl_compress_config_p
|
# undef ucl_compress_config_p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// system includes
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
// malloc debuggers
|
// malloc debuggers
|
||||||
#if (WITH_VALGRIND)
|
#if (WITH_VALGRIND)
|
||||||
# include <valgrind/memcheck.h>
|
# include <valgrind/memcheck.h>
|
||||||
@@ -163,7 +157,6 @@ typedef unsigned char upx_byte;
|
|||||||
# define VALGRIND_MAKE_MEM_UNDEFINED(addr,len) 0
|
# define VALGRIND_MAKE_MEM_UNDEFINED(addr,len) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// IMPORTANT: unconditionally enable assertions
|
// IMPORTANT: unconditionally enable assertions
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -190,7 +183,6 @@ typedef size_t upx_rsize_t;
|
|||||||
# define STDERR_FILENO (fileno(stderr))
|
# define STDERR_FILENO (fileno(stderr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !(HAVE_STRCASECMP) && (HAVE_STRICMP)
|
#if !(HAVE_STRCASECMP) && (HAVE_STRICMP)
|
||||||
# define strcasecmp stricmp
|
# define strcasecmp stricmp
|
||||||
#endif
|
#endif
|
||||||
@@ -198,7 +190,6 @@ typedef size_t upx_rsize_t;
|
|||||||
# define strncasecmp strnicmp
|
# define strncasecmp strnicmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(S_IWUSR) && defined(_S_IWUSR)
|
#if !defined(S_IWUSR) && defined(_S_IWUSR)
|
||||||
# define S_IWUSR _S_IWUSR
|
# define S_IWUSR _S_IWUSR
|
||||||
#elif !defined(S_IWUSR) && defined(_S_IWRITE)
|
#elif !defined(S_IWUSR) && defined(_S_IWRITE)
|
||||||
@@ -238,7 +229,6 @@ typedef size_t upx_rsize_t;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// avoid warnings about shadowing global functions
|
// avoid warnings about shadowing global functions
|
||||||
#undef index
|
#undef index
|
||||||
#define basename upx_basename
|
#define basename upx_basename
|
||||||
@@ -371,18 +361,18 @@ private:
|
|||||||
#define UPX_F_DOS_EXE 3
|
#define UPX_F_DOS_EXE 3
|
||||||
#define UPX_F_DJGPP2_COFF 4
|
#define UPX_F_DJGPP2_COFF 4
|
||||||
#define UPX_F_WATCOM_LE 5
|
#define UPX_F_WATCOM_LE 5
|
||||||
#define UPX_F_VXD_LE 6
|
#define UPX_F_VXD_LE 6 // NOT IMPLEMENTED
|
||||||
#define UPX_F_DOS_EXEH 7 /* OBSOLETE */
|
#define UPX_F_DOS_EXEH 7 // OBSOLETE
|
||||||
#define UPX_F_TMT_ADAM 8
|
#define UPX_F_TMT_ADAM 8
|
||||||
#define UPX_F_WIN32_PE 9
|
#define UPX_F_WIN32_PE 9
|
||||||
#define UPX_F_LINUX_i386 10
|
#define UPX_F_LINUX_i386 10
|
||||||
#define UPX_F_WIN16_NE 11
|
#define UPX_F_WIN16_NE 11 // NOT IMPLEMENTED
|
||||||
#define UPX_F_LINUX_ELF_i386 12
|
#define UPX_F_LINUX_ELF_i386 12
|
||||||
#define UPX_F_LINUX_SEP_i386 13
|
#define UPX_F_LINUX_SEP_i386 13 // NOT IMPLEMENTED
|
||||||
#define UPX_F_LINUX_SH_i386 14
|
#define UPX_F_LINUX_SH_i386 14
|
||||||
#define UPX_F_VMLINUZ_i386 15
|
#define UPX_F_VMLINUZ_i386 15
|
||||||
#define UPX_F_BVMLINUZ_i386 16
|
#define UPX_F_BVMLINUZ_i386 16
|
||||||
#define UPX_F_ELKS_8086 17
|
#define UPX_F_ELKS_8086 17 // NOT IMPLEMENTED
|
||||||
#define UPX_F_PS1_EXE 18
|
#define UPX_F_PS1_EXE 18
|
||||||
#define UPX_F_VMLINUX_i386 19
|
#define UPX_F_VMLINUX_i386 19
|
||||||
#define UPX_F_LINUX_ELFI_i386 20
|
#define UPX_F_LINUX_ELFI_i386 20
|
||||||
@@ -413,10 +403,10 @@ private:
|
|||||||
#define UPX_F_VMLINUX_PPC64LE 40
|
#define UPX_F_VMLINUX_PPC64LE 40
|
||||||
#define UPX_F_DYLIB_PPC64LE 41
|
#define UPX_F_DYLIB_PPC64LE 41
|
||||||
|
|
||||||
#define UPX_F_PLAIN_TEXT 127 // FIXME: what is this ??
|
#define UPX_F_LINUX_ELF64_ARM 42
|
||||||
|
|
||||||
#define UPX_F_ATARI_TOS 129
|
#define UPX_F_ATARI_TOS 129
|
||||||
#define UPX_F_SOLARIS_SPARC 130
|
#define UPX_F_SOLARIS_SPARC 130 // NOT IMPLEMENTED
|
||||||
#define UPX_F_MACH_PPC32 131
|
#define UPX_F_MACH_PPC32 131
|
||||||
#define UPX_F_LINUX_ELFPPC32 132
|
#define UPX_F_LINUX_ELFPPC32 132
|
||||||
#define UPX_F_LINUX_ELF32_ARMEB 133
|
#define UPX_F_LINUX_ELF32_ARMEB 133
|
||||||
@@ -426,6 +416,10 @@ private:
|
|||||||
#define UPX_F_LINUX_ELF32_MIPSEB 137
|
#define UPX_F_LINUX_ELF32_MIPSEB 137
|
||||||
#define UPX_F_DYLIB_PPC32 138
|
#define UPX_F_DYLIB_PPC32 138
|
||||||
|
|
||||||
|
#define UPX_F_MACH_PPC64 139
|
||||||
|
#define UPX_F_LINUX_ELFPPC64 140
|
||||||
|
#define UPX_F_VMLINUX_PPC64 141
|
||||||
|
#define UPX_F_DYLIB_PPC64 142
|
||||||
|
|
||||||
// compression methods
|
// compression methods
|
||||||
#define M_ALL (-1)
|
#define M_ALL (-1)
|
||||||
@@ -486,24 +480,27 @@ struct upx_callback_t
|
|||||||
// compression - config_t
|
// compression - config_t
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
template <class T, T default_value, T min_value, T max_value>
|
template <class T, T default_value_, T min_value_, T max_value_>
|
||||||
struct OptVar
|
struct OptVar
|
||||||
{
|
{
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
static const T default_value_c = default_value;
|
static const T default_value = default_value_;
|
||||||
static const T min_value_c = min_value;
|
static const T min_value = min_value_;
|
||||||
static const T max_value_c = max_value;
|
static const T max_value = max_value_;
|
||||||
|
|
||||||
void assertValue() const {
|
static void assertValue(const T &v) {
|
||||||
// info: this generates annoying warnings "unsigned >= 0 is always true"
|
// info: this generates annoying warnings "unsigned >= 0 is always true"
|
||||||
//assert(v >= min_value_c);
|
//assert(v >= min_value);
|
||||||
assert(v == min_value_c || v >= min_value_c + 1);
|
assert(v == min_value || v >= min_value + 1);
|
||||||
assert(v <= max_value_c);
|
assert(v <= max_value);
|
||||||
|
}
|
||||||
|
void assertValue() const {
|
||||||
|
assertValue(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
OptVar() : v(default_value), is_set(0) { }
|
OptVar() : v(default_value), is_set(0) { }
|
||||||
OptVar& operator= (const T other) {
|
OptVar& operator= (const T &other) {
|
||||||
v = other; is_set += 1;
|
v = other; is_set = 1;
|
||||||
assertValue();
|
assertValue();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -519,10 +516,10 @@ struct OptVar
|
|||||||
// optional assignments
|
// optional assignments
|
||||||
template <class T, T a, T b, T c>
|
template <class T, T a, T b, T c>
|
||||||
inline void oassign(OptVar<T,a,b,c> &self, const OptVar<T,a,b,c> &other) {
|
inline void oassign(OptVar<T,a,b,c> &self, const OptVar<T,a,b,c> &other) {
|
||||||
if (other.is_set) { self.v = other.v; self.is_set += 1; }
|
if (other.is_set) { self.v = other.v; self.is_set = 1; }
|
||||||
}
|
}
|
||||||
template <class T, T a, T b, T c>
|
template <class T, T a, T b, T c>
|
||||||
inline void oassign(unsigned &v, const OptVar<T,a,b,c> &other) {
|
inline void oassign(T &v, const OptVar<T,a,b,c> &other) {
|
||||||
if (other.is_set) { v = other.v; }
|
if (other.is_set) { v = other.v; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 && defined(__DJGPP__)
|
#if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
# define USE_SCREEN 1
|
# define USE_SCREEN 1
|
||||||
#elif 1 && (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64)
|
#elif 1 && (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64)
|
||||||
# define USE_SCREEN 1
|
# define USE_SCREEN 1
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+3
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -129,7 +129,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// application execptions
|
// application exceptions
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
class OverlayException : public Exception
|
class OverlayException : public Exception
|
||||||
|
|||||||
+6
-4
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -48,7 +48,7 @@ void File::chmod(const char *name, int mode)
|
|||||||
|
|
||||||
void File::rename(const char *old_, const char *new_)
|
void File::rename(const char *old_, const char *new_)
|
||||||
{
|
{
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
if (::_rename(old_,new_) != 0)
|
if (::_rename(old_,new_) != 0)
|
||||||
#else
|
#else
|
||||||
if (::rename(old_,new_) != 0)
|
if (::rename(old_,new_) != 0)
|
||||||
@@ -94,7 +94,7 @@ bool FileBase::do_sopen()
|
|||||||
_fd = ::open(_name, _flags, _mode);
|
_fd = ::open(_name, _flags, _mode);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
_fd = ::open(_name,_flags | _shflags, _mode);
|
_fd = ::open(_name,_flags | _shflags, _mode);
|
||||||
#elif defined(__MINT__)
|
#elif defined(__MINT__)
|
||||||
_fd = ::open(_name,_flags | (_shflags & O_SHMODE), _mode);
|
_fd = ::open(_name,_flags | (_shflags & O_SHMODE), _mode);
|
||||||
@@ -140,6 +140,7 @@ int FileBase::read(void *buf, int len)
|
|||||||
{
|
{
|
||||||
if (!isOpen() || len < 0)
|
if (!isOpen() || len < 0)
|
||||||
throwIOException("bad read");
|
throwIOException("bad read");
|
||||||
|
mem_size_assert(1, len); // sanity check
|
||||||
errno = 0;
|
errno = 0;
|
||||||
long l = acc_safe_hread(_fd, buf, len);
|
long l = acc_safe_hread(_fd, buf, len);
|
||||||
if (errno)
|
if (errno)
|
||||||
@@ -161,6 +162,7 @@ void FileBase::write(const void *buf, int len)
|
|||||||
{
|
{
|
||||||
if (!isOpen() || len < 0)
|
if (!isOpen() || len < 0)
|
||||||
throwIOException("bad write");
|
throwIOException("bad write");
|
||||||
|
mem_size_assert(1, len); // sanity check
|
||||||
errno = 0;
|
errno = 0;
|
||||||
long l = acc_safe_hwrite(_fd, buf, len);
|
long l = acc_safe_hwrite(_fd, buf, len);
|
||||||
if (l != len)
|
if (l != len)
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+43
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -459,4 +459,45 @@ static int s_ct24arm_be(Filter *f)
|
|||||||
#undef CT24ARM_BE
|
#undef CT24ARM_BE
|
||||||
#undef ARMCT_COND
|
#undef ARMCT_COND
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
// 26-bit ARM calltrick ("naive")
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define CT26ARM_LE(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] & 0x7C) == 0x14))
|
||||||
|
|
||||||
|
static int f_ct26arm_le(Filter *f)
|
||||||
|
{
|
||||||
|
CT26ARM_LE(f, ARMCT_COND, a / 4 + f->addvalue, get_le26, set_le26)
|
||||||
|
}
|
||||||
|
|
||||||
|
static int u_ct26arm_le(Filter *f)
|
||||||
|
{
|
||||||
|
CT26ARM_LE(f, ARMCT_COND, 0 - a / 4 - f->addvalue, get_le26, set_le26)
|
||||||
|
}
|
||||||
|
|
||||||
|
static int s_ct26arm_le(Filter *f)
|
||||||
|
{
|
||||||
|
CT26ARM_LE(f, ARMCT_COND, a + f->addvalue, get_le26, set_dummy)
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef CT26ARM_LE
|
||||||
|
#undef ARMCT_COND
|
||||||
|
|
||||||
/* vim:set ts=4 sw=4 et: */
|
/* vim:set ts=4 sw=4 et: */
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2004-2016 John F. Reiser
|
Copyright (C) 2004-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+5
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -228,6 +228,9 @@ const FilterImp::FilterEntry FilterImp::filters[] = {
|
|||||||
{ 0x50, 8, 0x01ffffff, f_ct24arm_le, u_ct24arm_le, s_ct24arm_le },
|
{ 0x50, 8, 0x01ffffff, f_ct24arm_le, u_ct24arm_le, s_ct24arm_le },
|
||||||
{ 0x51, 8, 0x01ffffff, f_ct24arm_be, u_ct24arm_be, s_ct24arm_be },
|
{ 0x51, 8, 0x01ffffff, f_ct24arm_be, u_ct24arm_be, s_ct24arm_be },
|
||||||
|
|
||||||
|
// 26-bit calltrick for arm64
|
||||||
|
{ 0x52, 8, 0x03ffffff, f_ct26arm_le, u_ct26arm_le, s_ct26arm_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 },
|
||||||
|
|||||||
+11
-20
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -91,7 +91,7 @@ void show_usage(void)
|
|||||||
FILE *f = con_term;
|
FILE *f = con_term;
|
||||||
|
|
||||||
con_fprintf(f,"Usage: %s [-123456789dlthVL] [-qvfk] [-o file] %sfile..\n", progname,
|
con_fprintf(f,"Usage: %s [-123456789dlthVL] [-qvfk] [-o file] %sfile..\n", progname,
|
||||||
#if defined(__DJGPP__) || defined(__EMX__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
"[@]");
|
"[@]");
|
||||||
#else
|
#else
|
||||||
"");
|
"");
|
||||||
@@ -140,8 +140,8 @@ static void show_all_packers(FILE *f, int verbose)
|
|||||||
{
|
{
|
||||||
options_t o; o.reset();
|
options_t o; o.reset();
|
||||||
PackerNames pn; pn.o = &o;
|
PackerNames pn; pn.o = &o;
|
||||||
PackMaster::visitAllPackers(pn.visit, NULL, &o, &pn);
|
PackMaster::visitAllPackers(PackerNames::visit, NULL, &o, &pn);
|
||||||
qsort(pn.names, pn.names_count, sizeof(PackerNames::Entry), pn.cmp_fname);
|
qsort(pn.names, pn.names_count, sizeof(PackerNames::Entry), PackerNames::cmp_fname);
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
for (size_t i = 0; i < pn.names_count; ++i)
|
for (size_t i = 0; i < pn.names_count; ++i)
|
||||||
{
|
{
|
||||||
@@ -262,15 +262,6 @@ void show_help(int verbose)
|
|||||||
con_fprintf(f,
|
con_fprintf(f,
|
||||||
" --8086 make compressed sys work on any 8086\n"
|
" --8086 make compressed sys work on any 8086\n"
|
||||||
"\n");
|
"\n");
|
||||||
#if 0
|
|
||||||
fg = con_fg(f,FG_YELLOW);
|
|
||||||
con_fprintf(f,"Options for linux/386\n");
|
|
||||||
fg = con_fg(f,fg);
|
|
||||||
con_fprintf(f,
|
|
||||||
" --script use /usr/local/lib/upx/upx[bd] as decompressor\n"
|
|
||||||
" --script=/path/upxX use path/upxX as decompressor\n"
|
|
||||||
"\n");
|
|
||||||
#endif
|
|
||||||
fg = con_fg(f,FG_YELLOW);
|
fg = con_fg(f,FG_YELLOW);
|
||||||
con_fprintf(f,"Options for ps1/exe:\n");
|
con_fprintf(f,"Options for ps1/exe:\n");
|
||||||
fg = con_fg(f,fg);
|
fg = con_fg(f,fg);
|
||||||
@@ -287,7 +278,7 @@ void show_help(int verbose)
|
|||||||
" --le produce LE output [default: EXE]\n"
|
" --le produce LE output [default: EXE]\n"
|
||||||
"\n");
|
"\n");
|
||||||
fg = con_fg(f,FG_YELLOW);
|
fg = con_fg(f,FG_YELLOW);
|
||||||
con_fprintf(f,"Options for win32/pe, rtm32/pe & arm/pe:\n");
|
con_fprintf(f,"Options for win32/pe, win64/pe, rtm32/pe & arm/pe:\n");
|
||||||
fg = con_fg(f,fg);
|
fg = con_fg(f,fg);
|
||||||
con_fprintf(f,
|
con_fprintf(f,
|
||||||
" --compress-exports=0 do not compress the export section\n"
|
" --compress-exports=0 do not compress the export section\n"
|
||||||
@@ -370,7 +361,7 @@ void show_license(void)
|
|||||||
);
|
);
|
||||||
int fg = con_fg(f,FG_CYAN);
|
int fg = con_fg(f,FG_CYAN);
|
||||||
con_fprintf(f,
|
con_fprintf(f,
|
||||||
" http://upx.sourceforge.net\n"
|
" https://upx.github.io\n"
|
||||||
" http://www.oberhumer.com/opensource/upx/\n"
|
" http://www.oberhumer.com/opensource/upx/\n"
|
||||||
);
|
);
|
||||||
(void)con_fg(f,FG_ORANGE);
|
(void)con_fg(f,FG_ORANGE);
|
||||||
@@ -421,10 +412,10 @@ void show_version(int x)
|
|||||||
if (v != NULL && v[0])
|
if (v != NULL && v[0])
|
||||||
fprintf(fp, "LZMA SDK version %s\n", v);
|
fprintf(fp, "LZMA SDK version %s\n", v);
|
||||||
#endif
|
#endif
|
||||||
fprintf(fp, "Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer\n");
|
fprintf(fp, "Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer\n");
|
||||||
fprintf(fp, "Copyright (C) 1996-2016 Laszlo Molnar\n");
|
fprintf(fp, "Copyright (C) 1996-2018 Laszlo Molnar\n");
|
||||||
fprintf(fp, "Copyright (C) 2000-2016 John F. Reiser\n");
|
fprintf(fp, "Copyright (C) 2000-2018 John F. Reiser\n");
|
||||||
fprintf(fp, "Copyright (C) 2002-2016 Jens Medoch\n");
|
fprintf(fp, "Copyright (C) 2002-2018 Jens Medoch\n");
|
||||||
#if (WITH_ZLIB)
|
#if (WITH_ZLIB)
|
||||||
fprintf(fp, "Copyright (C) 1995" "-2005 Jean-loup Gailly and Mark Adler\n");
|
fprintf(fp, "Copyright (C) 1995" "-2005 Jean-loup Gailly and Mark Adler\n");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+3
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -338,6 +338,7 @@ void LeFile::countFixups(unsigned *counts) const
|
|||||||
break;
|
break;
|
||||||
case 6: // 16:32 pointer
|
case 6: // 16:32 pointer
|
||||||
counts[o] += 9;
|
counts[o] += 9;
|
||||||
|
// fall through
|
||||||
case 7: // 32-bit offset
|
case 7: // 32-bit offset
|
||||||
counts[fix[4]-1] += 4;
|
counts[fix[4]-1] += 4;
|
||||||
fix += (fix[1] & 0x10) ? 9 : 7;
|
fix += (fix[1] & 0x10) ? 9 : 7;
|
||||||
|
|||||||
+3
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -112,7 +112,7 @@ protected:
|
|||||||
LE32 extra_heap_alloc;
|
LE32 extra_heap_alloc;
|
||||||
char reserved[12];
|
char reserved[12];
|
||||||
LE32 versioninfo;
|
LE32 versioninfo;
|
||||||
LE32 unkown;
|
LE32 unknown;
|
||||||
// 0xC0
|
// 0xC0
|
||||||
LE16 device_id;
|
LE16 device_id;
|
||||||
LE16 ddk_version;
|
LE16 ddk_version;
|
||||||
|
|||||||
+82
-12
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -472,9 +472,10 @@ void ElfLinker::relocate() {
|
|||||||
value = rel->value->section->offset + rel->value->offset + rel->add;
|
value = rel->value->section->offset + rel->value->offset + rel->add;
|
||||||
}
|
}
|
||||||
upx_byte *location = rel->section->output + rel->offset;
|
upx_byte *location = rel->section->output + rel->offset;
|
||||||
// printf("%-28s %-28s %-10s 0x%16llx 0x%16llx\n", rel->section->name, rel->value->name,
|
// printf("%-28s %-28s %-10s %#16llx %#16llx\n", rel->section->name, rel->value->name,
|
||||||
// rel->type, (long long) value, (long long) value - rel->section->offset - rel->offset);
|
// rel->type, (long long) value, (long long) value - rel->section->offset - rel->offset);
|
||||||
// printf(" %llx %d %llx %d %llx : %d\n", (long long) value, rel->value->section->offset,
|
// printf(" %llx %d %llx %d %llx : %d\n", (long long) value,
|
||||||
|
// (int)rel->value->section->offset,
|
||||||
// rel->value->offset, rel->offset, (long long) rel->add, *location);
|
// rel->value->offset, rel->offset, (long long) rel->add, *location);
|
||||||
relocate1(rel, location, value, rel->type);
|
relocate1(rel, location, value, rel->type);
|
||||||
}
|
}
|
||||||
@@ -541,7 +542,7 @@ void ElfLinker::alignWithByte(unsigned len, unsigned char b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ElfLinker::relocate1(const Relocation *rel, upx_byte *, upx_uint64_t, const char *) {
|
void ElfLinker::relocate1(const Relocation *rel, upx_byte *, upx_uint64_t, const char *) {
|
||||||
internal_error("unknown relocation type '%s\n", rel->type);
|
internal_error("unknown relocation type '%s\n'", rel->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -593,7 +594,8 @@ void ElfLinkerAMD64::relocate1(const Relocation *rel, upx_byte *location, upx_ui
|
|||||||
|
|
||||||
void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||||
const char *type) {
|
const char *type) {
|
||||||
if (strcmp(type, "R_ARM_PC24") == 0) {
|
if (!strcmp(type, "R_ARM_PC24") || !strcmp(type, "R_ARM_CALL") ||
|
||||||
|
!strcmp(type, "R_ARM_JUMP24")) {
|
||||||
value -= rel->section->offset + rel->offset;
|
value -= rel->section->offset + rel->offset;
|
||||||
set_be24(1 + location, get_be24(1 + location) + value / 4);
|
set_be24(1 + location, get_be24(1 + location) + value / 4);
|
||||||
} else if (strcmp(type, "R_ARM_ABS32") == 0) {
|
} else if (strcmp(type, "R_ARM_ABS32") == 0) {
|
||||||
@@ -617,7 +619,8 @@ void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_ui
|
|||||||
|
|
||||||
void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||||
const char *type) {
|
const char *type) {
|
||||||
if (strcmp(type, "R_ARM_PC24") == 0) {
|
if (!strcmp(type, "R_ARM_PC24") || !strcmp(type, "R_ARM_CALL") ||
|
||||||
|
!strcmp(type, "R_ARM_JUMP24")) {
|
||||||
value -= rel->section->offset + rel->offset;
|
value -= rel->section->offset + rel->offset;
|
||||||
set_le24(location, get_le24(location) + value / 4);
|
set_le24(location, get_le24(location) + value / 4);
|
||||||
} else if (strcmp(type, "R_ARM_ABS32") == 0) {
|
} else if (strcmp(type, "R_ARM_ABS32") == 0) {
|
||||||
@@ -641,11 +644,40 @@ void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, upx_ui
|
|||||||
|
|
||||||
void ElfLinkerArm64LE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
void ElfLinkerArm64LE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||||
const char *type) {
|
const char *type) {
|
||||||
if (strcmp(type, "R_AARCH64_CALL26") == 0) {
|
if (strncmp(type, "R_AARCH64_", 10))
|
||||||
|
return super::relocate1(rel, location, value, type);
|
||||||
|
type += 10;
|
||||||
|
|
||||||
|
if (!strncmp(type, "PREL", 4)) {
|
||||||
value -= rel->section->offset + rel->offset;
|
value -= rel->section->offset + rel->offset;
|
||||||
set_le24(location, get_le24(location) + value / 4); // FIXME set_le26
|
type += 4;
|
||||||
} else if (strcmp(type, "R_AARCH64_ABS32") == 0) {
|
|
||||||
|
if (!strcmp(type, "16"))
|
||||||
|
set_le16(location, get_le16(location) + value);
|
||||||
|
else if (!strncmp(type, "32", 2)) // for "32" and "32S"
|
||||||
|
set_le32(location, get_le32(location) + value);
|
||||||
|
else if (!strcmp(type, "64"))
|
||||||
|
set_le64(location, get_le64(location) + value);
|
||||||
|
} else if (!strcmp(type, "ADR_PREL_LO21")) {
|
||||||
|
value -= rel->section->offset + rel->offset;
|
||||||
|
upx_uint32_t const m19 = ~(~0u << 19);
|
||||||
|
upx_uint32_t w = get_le32(location);
|
||||||
|
set_le32(location, (w & ~((3u << 29) | (m19 << 5))) | ((3u & value) << 29) |
|
||||||
|
((m19 & (value >> 2)) << 5));
|
||||||
|
} else if (!strcmp(type, "ABS32")) {
|
||||||
set_le32(location, get_le32(location) + value);
|
set_le32(location, get_le32(location) + value);
|
||||||
|
} else if (!strcmp(type, "ABS64")) {
|
||||||
|
set_le64(location, get_le64(location) + value);
|
||||||
|
} else if (!strcmp(type, "CONDBR19")) {
|
||||||
|
value -= rel->section->offset + rel->offset;
|
||||||
|
upx_uint32_t const m19 = ~(~0u << 19);
|
||||||
|
upx_uint32_t w = get_le32(location);
|
||||||
|
set_le32(location, (w & ~(m19 << 5)) | ((((w >> 5) + (value >> 2)) & m19) << 5));
|
||||||
|
} else if (!strcmp(type, "CALL26")) {
|
||||||
|
value -= rel->section->offset + rel->offset;
|
||||||
|
upx_uint32_t const m26 = ~(~0u << 26);
|
||||||
|
upx_uint32_t w = get_le32(location);
|
||||||
|
set_le32(location, (w & ~m26) | (m26 & (value >> 2)));
|
||||||
} else
|
} else
|
||||||
super::relocate1(rel, location, value, type);
|
super::relocate1(rel, location, value, type);
|
||||||
}
|
}
|
||||||
@@ -767,6 +799,14 @@ void ElfLinkerPpc32::relocate1(const Relocation *rel, upx_byte *location, upx_ui
|
|||||||
|
|
||||||
void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||||
const char *type) {
|
const char *type) {
|
||||||
|
if (!strcmp(type, "R_PPC64_ADDR64")) {
|
||||||
|
set_le64(location, get_le64(location) + value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!strcmp(type, "R_PPC64_ADDR32")) {
|
||||||
|
set_le32(location, get_le32(location) + value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (strncmp(type, "R_PPC64_REL", 11))
|
if (strncmp(type, "R_PPC64_REL", 11))
|
||||||
return super::relocate1(rel, location, value, type);
|
return super::relocate1(rel, location, value, type);
|
||||||
type += 11;
|
type += 11;
|
||||||
@@ -786,11 +826,11 @@ void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_
|
|||||||
internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name,
|
internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name,
|
||||||
rel->offset);
|
rel->offset);
|
||||||
*location += value;
|
*location += value;
|
||||||
} else if (strncmp(type, "14", 2) == 0) // for "32" and "32S"
|
} else if (strncmp(type, "14", 2) == 0) // for "14" and "14S"
|
||||||
set_le16(location, get_le16(location) + value);
|
set_le16(location, get_le16(location) + value);
|
||||||
else if (strcmp(type, "16") == 0)
|
else if (strcmp(type, "16") == 0)
|
||||||
set_le16(location, get_le16(location) + value);
|
set_le16(location, get_le16(location) + value);
|
||||||
else if (strncmp(type, "24", 2) == 0) // for "32" and "32S"
|
else if (strncmp(type, "24", 2) == 0) // for "24" and "24S"
|
||||||
set_le24(location, get_le24(location) + value);
|
set_le24(location, get_le24(location) + value);
|
||||||
else if (strncmp(type, "32", 2) == 0) // for "32" and "32S"
|
else if (strncmp(type, "32", 2) == 0) // for "32" and "32S"
|
||||||
set_le32(location, get_le32(location) + value);
|
set_le32(location, get_le32(location) + value);
|
||||||
@@ -800,6 +840,36 @@ void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_
|
|||||||
super::relocate1(rel, location, value, type);
|
super::relocate1(rel, location, value, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ElfLinkerPpc64::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||||
|
const char *type) {
|
||||||
|
if (!strcmp(type, "R_PPC64_ADDR32")) {
|
||||||
|
set_be32(location, get_be32(location) + value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!strcmp(type, "R_PPC64_ADDR64")) {
|
||||||
|
set_be64(location, get_be64(location) + value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (strncmp(type, "R_PPC64_REL", 11))
|
||||||
|
return super::relocate1(rel, location, value, type);
|
||||||
|
type += 11;
|
||||||
|
|
||||||
|
if (strncmp(type, "PC", 2) == 0) {
|
||||||
|
type += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We have "R_PPC64_REL" or "R_PPC64_RELPC" as a prefix.
|
||||||
|
/* value will hold relative displacement */
|
||||||
|
value -= rel->section->offset + rel->offset;
|
||||||
|
|
||||||
|
if (strncmp(type, "14", 2) == 0) // for "14" and "14S"
|
||||||
|
set_be16(2 + location, get_be16(2 + location) + value);
|
||||||
|
else if (strncmp(type, "24", 2) == 0) // for "24" and "24S"
|
||||||
|
set_be24(1 + location, get_be24(1 + location) + value);
|
||||||
|
else
|
||||||
|
super::relocate1(rel, location, value, type);
|
||||||
|
}
|
||||||
|
|
||||||
void ElfLinkerX86::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
void ElfLinkerX86::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||||
const char *type) {
|
const char *type) {
|
||||||
if (strncmp(type, "R_386_", 6))
|
if (strncmp(type, "R_386_", 6))
|
||||||
|
|||||||
+22
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -160,6 +160,15 @@ protected:
|
|||||||
const char *type);
|
const char *type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ElfLinkerARM64 : public ElfLinker {
|
||||||
|
typedef ElfLinker super;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void alignCode(unsigned len) { alignWithByte(len, 0x90); }
|
||||||
|
virtual void relocate1(const Relocation *, upx_byte *location, upx_uint64_t value,
|
||||||
|
const char *type);
|
||||||
|
};
|
||||||
|
|
||||||
class ElfLinkerArmBE : public ElfLinker {
|
class ElfLinkerArmBE : public ElfLinker {
|
||||||
typedef ElfLinker super;
|
typedef ElfLinker super;
|
||||||
|
|
||||||
@@ -237,6 +246,17 @@ protected:
|
|||||||
const char *type);
|
const char *type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ElfLinkerPpc64 : public ElfLinker {
|
||||||
|
typedef ElfLinker super;
|
||||||
|
|
||||||
|
public:
|
||||||
|
ElfLinkerPpc64() { bele = &N_BELE_RTP::be_policy; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void relocate1(const Relocation *, upx_byte *location, upx_uint64_t value,
|
||||||
|
const char *type);
|
||||||
|
};
|
||||||
|
|
||||||
class ElfLinkerX86 : public ElfLinker {
|
class ElfLinkerX86 : public ElfLinker {
|
||||||
typedef ElfLinker super;
|
typedef ElfLinker super;
|
||||||
|
|
||||||
|
|||||||
+17
-38
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#include "p_elf.h"
|
#include "p_elf.h"
|
||||||
|
|
||||||
|
|
||||||
#if 1 && defined(__DJGPP__)
|
#if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
#include <crt0.h>
|
#include <crt0.h>
|
||||||
int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
|
int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
|
||||||
#endif
|
#endif
|
||||||
@@ -46,7 +46,7 @@ int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
|
|||||||
void options_t::reset()
|
void options_t::reset()
|
||||||
{
|
{
|
||||||
options_t *o = this;
|
options_t *o = this;
|
||||||
memset(o, 0, sizeof(*o));
|
mem_clear(o, sizeof(*o));
|
||||||
o->crp.reset();
|
o->crp.reset();
|
||||||
|
|
||||||
o->cmd = CMD_NONE;
|
o->cmd = CMD_NONE;
|
||||||
@@ -61,7 +61,7 @@ void options_t::reset()
|
|||||||
o->preserve_timestamp = true;
|
o->preserve_timestamp = true;
|
||||||
|
|
||||||
o->console = CON_FILE;
|
o->console = CON_FILE;
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
o->console = CON_INIT;
|
o->console = CON_INIT;
|
||||||
#elif (USE_SCREEN_WIN32)
|
#elif (USE_SCREEN_WIN32)
|
||||||
o->console = CON_INIT;
|
o->console = CON_INIT;
|
||||||
@@ -84,7 +84,6 @@ static options_t global_options;
|
|||||||
options_t *opt = &global_options;
|
options_t *opt = &global_options;
|
||||||
|
|
||||||
static int done_output_name = 0;
|
static int done_output_name = 0;
|
||||||
static int done_script_name = 0;
|
|
||||||
|
|
||||||
|
|
||||||
const char *argv0 = "";
|
const char *argv0 = "";
|
||||||
@@ -366,29 +365,6 @@ static void set_output_name(const char *n, bool allow_m)
|
|||||||
done_output_name++;
|
done_output_name++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_script_name(const char *n, bool allow_m)
|
|
||||||
{
|
|
||||||
#if 1
|
|
||||||
if (done_script_name > 0)
|
|
||||||
{
|
|
||||||
fprintf(stderr,"%s: option '--script' more than once given\n",argv0);
|
|
||||||
e_usage();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!n || !n[0] || (!allow_m && n[0] == '-'))
|
|
||||||
{
|
|
||||||
fprintf(stderr,"%s: missing script name\n",argv0);
|
|
||||||
e_usage();
|
|
||||||
}
|
|
||||||
if (strlen(n) >= (size_t)opt->o_unix.SCRIPT_MAX - 3)
|
|
||||||
{
|
|
||||||
fprintf(stderr,"%s: script name too long\n",argv0);
|
|
||||||
e_usage();
|
|
||||||
}
|
|
||||||
opt->o_unix.script_name = n;
|
|
||||||
done_script_name++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// get options
|
// get options
|
||||||
@@ -850,11 +826,6 @@ static int do_option(int optc, const char *arg)
|
|||||||
case 661:
|
case 661:
|
||||||
opt->o_unix.force_execve = true;
|
opt->o_unix.force_execve = true;
|
||||||
break;
|
break;
|
||||||
case 662:
|
|
||||||
opt->o_unix.script_name = "/usr/local/lib/upx/upxX";
|
|
||||||
if (mfx_optarg && mfx_optarg[0])
|
|
||||||
set_script_name(mfx_optarg, 1);
|
|
||||||
break;
|
|
||||||
case 663:
|
case 663:
|
||||||
opt->o_unix.is_ptinterp = true;
|
opt->o_unix.is_ptinterp = true;
|
||||||
break;
|
break;
|
||||||
@@ -895,6 +866,12 @@ static int do_option(int optc, const char *arg)
|
|||||||
case 675:
|
case 675:
|
||||||
opt->o_unix.preserve_build_id = true;
|
opt->o_unix.preserve_build_id = true;
|
||||||
break;
|
break;
|
||||||
|
case 676:
|
||||||
|
opt->o_unix.android_shlib = true;
|
||||||
|
break;
|
||||||
|
case 677:
|
||||||
|
opt->o_unix.force_pie = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case '\0':
|
case '\0':
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1032,9 +1009,6 @@ static const struct mfx_option longopts[] =
|
|||||||
// unix
|
// unix
|
||||||
{"blocksize", 0x31, 0, 660}, // --blocksize=
|
{"blocksize", 0x31, 0, 660}, // --blocksize=
|
||||||
{"force-execve", 0x10, 0, 661}, // force linux/386 execve format
|
{"force-execve", 0x10, 0, 661}, // force linux/386 execve format
|
||||||
#if 0
|
|
||||||
{"script", 0x31, 0, 662}, // --script=
|
|
||||||
#endif
|
|
||||||
{"is_ptinterp", 0x10, 0, 663}, // linux/elf386 PT_INTERP program
|
{"is_ptinterp", 0x10, 0, 663}, // linux/elf386 PT_INTERP program
|
||||||
{"use_ptinterp", 0x10, 0, 664}, // linux/elf386 PT_INTERP program
|
{"use_ptinterp", 0x10, 0, 664}, // linux/elf386 PT_INTERP program
|
||||||
{"make_ptinterp", 0x10, 0, 665}, // linux/elf386 PT_INTERP program
|
{"make_ptinterp", 0x10, 0, 665}, // linux/elf386 PT_INTERP program
|
||||||
@@ -1048,6 +1022,8 @@ static const struct mfx_option longopts[] =
|
|||||||
{"openbsd", 0x10, 0, 669},
|
{"openbsd", 0x10, 0, 669},
|
||||||
{"unmap-all-pages", 0x10, 0, 674}, // linux /proc/self/exe vanishes
|
{"unmap-all-pages", 0x10, 0, 674}, // linux /proc/self/exe vanishes
|
||||||
{"preserve-build-id", 0, 0, 675},
|
{"preserve-build-id", 0, 0, 675},
|
||||||
|
{"android-shlib", 0, 0, 676},
|
||||||
|
{"force-pie", 0, 0, 677},
|
||||||
// watcom/le
|
// watcom/le
|
||||||
{"le", 0x10, 0, 620}, // produce LE output
|
{"le", 0x10, 0, 620}, // produce LE output
|
||||||
// win32/pe
|
// win32/pe
|
||||||
@@ -1431,6 +1407,9 @@ __acc_static_noinline void upx_sanity_check(void)
|
|||||||
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
|
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
|
||||||
extern "C" { extern long _stksize; long _stksize = 256 * 1024L; }
|
extern "C" { extern long _stksize; long _stksize = 256 * 1024L; }
|
||||||
#endif
|
#endif
|
||||||
|
#if (ACC_OS_WIN32 || ACC_OS_WIN64) && (defined(__MINGW32__) || defined(__MINGW64__))
|
||||||
|
extern "C" { extern int _dowildcard; int _dowildcard = -1; }
|
||||||
|
#endif
|
||||||
|
|
||||||
int __acc_cdecl_main main(int argc, char *argv[])
|
int __acc_cdecl_main main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -1438,7 +1417,7 @@ int __acc_cdecl_main main(int argc, char *argv[])
|
|||||||
static char default_argv0[] = "upx";
|
static char default_argv0[] = "upx";
|
||||||
// int cmdline_cmd = CMD_NONE;
|
// int cmdline_cmd = CMD_NONE;
|
||||||
|
|
||||||
#if 0 && defined(__DJGPP__)
|
#if 0 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME
|
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME
|
||||||
putenv("LFN=y");
|
putenv("LFN=y");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+14
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -73,6 +73,18 @@ MemBuffer::~MemBuffer()
|
|||||||
this->dealloc();
|
this->dealloc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// similar to BoundedPtr, except checks only at creation
|
||||||
|
unsigned char *MemBuffer::subref(char const *errfmt, unsigned skip, unsigned take)
|
||||||
|
{
|
||||||
|
if ((take + skip) < take // wrap-around
|
||||||
|
|| (take + skip) > b_size // overrun
|
||||||
|
) {
|
||||||
|
char buf[100]; snprintf(buf, sizeof(buf), errfmt, skip, take);
|
||||||
|
throwCantPack(buf);
|
||||||
|
}
|
||||||
|
return &b[skip];
|
||||||
|
}
|
||||||
|
|
||||||
void MemBuffer::dealloc()
|
void MemBuffer::dealloc()
|
||||||
{
|
{
|
||||||
if (b != NULL)
|
if (b != NULL)
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -64,6 +64,11 @@ public:
|
|||||||
void clear(unsigned off, unsigned len) { fill(off, len, 0); }
|
void clear(unsigned off, unsigned len) { fill(off, len, 0); }
|
||||||
void clear() { fill(0, b_size, 0); }
|
void clear() { fill(0, b_size, 0); }
|
||||||
|
|
||||||
|
// If the entire range [skip, take+skip) is inside the buffer,
|
||||||
|
// then return &b[skip]; else throwCantPack(sprintf(errfmt, skip, take)).
|
||||||
|
// This is similar to BoundedPtr, except only checks once.
|
||||||
|
unsigned char *subref(char const *errfmt, unsigned skip, unsigned take);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned char *b;
|
unsigned char *b;
|
||||||
unsigned b_size;
|
unsigned b_size;
|
||||||
|
|||||||
+108
-44
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#ifndef __ACC_H_INCLUDED
|
#ifndef __ACC_H_INCLUDED
|
||||||
#define __ACC_H_INCLUDED 1
|
#define __ACC_H_INCLUDED 1
|
||||||
#define ACC_VERSION 20160919L
|
#define ACC_VERSION 20170301L
|
||||||
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
|
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
|
||||||
# define __CYGWIN__ __CYGWIN32__
|
# define __CYGWIN__ __CYGWIN32__
|
||||||
#endif
|
#endif
|
||||||
@@ -234,10 +234,12 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == ACC_0xffffL)
|
#if (UINT_MAX == ACC_0xffffL)
|
||||||
|
#if defined(_MSC_VER) && defined(M_I86HM)
|
||||||
# define ptrdiff_t long
|
# define ptrdiff_t long
|
||||||
# define _PTRDIFF_T_DEFINED 1
|
# define _PTRDIFF_T_DEFINED 1
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#if (UINT_MAX == ACC_0xffffL)
|
#if (UINT_MAX == ACC_0xffffL)
|
||||||
# undef __ACC_RENAME_A
|
# undef __ACC_RENAME_A
|
||||||
# undef __ACC_RENAME_B
|
# undef __ACC_RENAME_B
|
||||||
@@ -386,7 +388,7 @@
|
|||||||
#define ACC_CPP_ECONCAT6(a,b,c,d,e,f) ACC_CPP_CONCAT6(a,b,c,d,e,f)
|
#define ACC_CPP_ECONCAT6(a,b,c,d,e,f) ACC_CPP_CONCAT6(a,b,c,d,e,f)
|
||||||
#define ACC_CPP_ECONCAT7(a,b,c,d,e,f,g) ACC_CPP_CONCAT7(a,b,c,d,e,f,g)
|
#define ACC_CPP_ECONCAT7(a,b,c,d,e,f,g) ACC_CPP_CONCAT7(a,b,c,d,e,f,g)
|
||||||
#endif
|
#endif
|
||||||
#define __ACC_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b))
|
#define __ACC_MASK_GEN(o,b) (((((o) << ((b)-((b)!=0))) - (o)) << 1) + (o)*((b)!=0))
|
||||||
#if 1 && defined(__cplusplus)
|
#if 1 && defined(__cplusplus)
|
||||||
# if !defined(__STDC_CONSTANT_MACROS)
|
# if !defined(__STDC_CONSTANT_MACROS)
|
||||||
# define __STDC_CONSTANT_MACROS 1
|
# define __STDC_CONSTANT_MACROS 1
|
||||||
@@ -637,6 +639,12 @@
|
|||||||
# define ACC_CC_ARMCC __ARMCC_VERSION
|
# define ACC_CC_ARMCC __ARMCC_VERSION
|
||||||
# define ACC_INFO_CC "ARM C Compiler"
|
# define ACC_INFO_CC "ARM C Compiler"
|
||||||
# define ACC_INFO_CCVER __VERSION__
|
# define ACC_INFO_CCVER __VERSION__
|
||||||
|
#elif defined(__clang__) && defined(__c2__) && defined(__c2_version__) && defined(_MSC_VER)
|
||||||
|
# define ACC_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
|
||||||
|
# define ACC_CC_CLANG_C2 _MSC_VER
|
||||||
|
# define ACC_CC_CLANG_VENDOR_MICROSOFT 1
|
||||||
|
# define ACC_INFO_CC "clang/c2"
|
||||||
|
# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__c2_version__)
|
||||||
#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
|
#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
|
||||||
# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
|
# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
|
||||||
# define ACC_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
|
# define ACC_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
|
||||||
@@ -648,7 +656,13 @@
|
|||||||
# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
|
# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
|
||||||
# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
|
# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
|
||||||
# endif
|
# endif
|
||||||
# define ACC_INFO_CC "clang"
|
# if defined(__APPLE_CC__)
|
||||||
|
# define ACC_CC_CLANG_VENDOR_APPLE 1
|
||||||
|
# define ACC_INFO_CC "clang/apple"
|
||||||
|
# else
|
||||||
|
# define ACC_CC_CLANG_VENDOR_LLVM 1
|
||||||
|
# define ACC_INFO_CC "clang"
|
||||||
|
# endif
|
||||||
# if defined(__clang_version__)
|
# if defined(__clang_version__)
|
||||||
# define ACC_INFO_CCVER __clang_version__
|
# define ACC_INFO_CCVER __clang_version__
|
||||||
# else
|
# else
|
||||||
@@ -969,6 +983,9 @@
|
|||||||
#elif defined(__powerpc64le__) || defined(__powerpc64le) || defined(__ppc64le__) || defined(__PPC64LE__)
|
#elif defined(__powerpc64le__) || defined(__powerpc64le) || defined(__ppc64le__) || defined(__PPC64LE__)
|
||||||
# define ACC_ARCH_POWERPC 1
|
# define ACC_ARCH_POWERPC 1
|
||||||
# define ACC_INFO_ARCH "powerpc"
|
# define ACC_INFO_ARCH "powerpc"
|
||||||
|
#elif defined(__riscv)
|
||||||
|
# define ACC_ARCH_RISCV 1
|
||||||
|
# define ACC_INFO_ARCH "riscv"
|
||||||
#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
|
#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
|
||||||
# define ACC_ARCH_S390 1
|
# define ACC_ARCH_S390 1
|
||||||
# define ACC_INFO_ARCH "s390"
|
# define ACC_INFO_ARCH "s390"
|
||||||
@@ -1010,6 +1027,8 @@
|
|||||||
# define ACC_ARCH_ARM_THUMB2 1
|
# define ACC_ARCH_ARM_THUMB2 1
|
||||||
# elif 1 && defined(__TARGET_ARCH_THUMB) && ((__TARGET_ARCH_THUMB)+0 >= 4)
|
# elif 1 && defined(__TARGET_ARCH_THUMB) && ((__TARGET_ARCH_THUMB)+0 >= 4)
|
||||||
# define ACC_ARCH_ARM_THUMB2 1
|
# define ACC_ARCH_ARM_THUMB2 1
|
||||||
|
# elif 1 && defined(_MSC_VER) && defined(_M_THUMB) && ((_M_THUMB)+0 >= 7)
|
||||||
|
# define ACC_ARCH_ARM_THUMB2 1
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@@ -1221,7 +1240,7 @@
|
|||||||
# error "unexpected configuration - check your compiler defines"
|
# error "unexpected configuration - check your compiler defines"
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef __cplusplus
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
|
#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
|
||||||
@@ -1244,7 +1263,7 @@ extern "C" {
|
|||||||
#else
|
#else
|
||||||
# error "FIXME - implement ACC_MM_AHSHIFT"
|
# error "FIXME - implement ACC_MM_AHSHIFT"
|
||||||
#endif
|
#endif
|
||||||
#ifdef __cplusplus
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -1943,6 +1962,7 @@ extern "C" {
|
|||||||
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800))
|
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800))
|
||||||
# define __acc_likely(e) (__builtin_expect(!!(e),1))
|
# define __acc_likely(e) (__builtin_expect(!!(e),1))
|
||||||
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
|
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
|
||||||
|
#elif (ACC_CC_CLANG && ACC_CC_CLANG_C2)
|
||||||
#elif (ACC_CC_ARMCC_GNUC || ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
|
#elif (ACC_CC_ARMCC_GNUC || ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
|
||||||
# define __acc_likely(e) (__builtin_expect(!!(e),1))
|
# define __acc_likely(e) (__builtin_expect(!!(e),1))
|
||||||
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
|
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
|
||||||
@@ -2139,6 +2159,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(3 == 3)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#define ACC_SIZEOF_CHAR 1
|
||||||
#ifndef ACC_SIZEOF_SHORT
|
#ifndef ACC_SIZEOF_SHORT
|
||||||
#if defined(SIZEOF_SHORT)
|
#if defined(SIZEOF_SHORT)
|
||||||
# define ACC_SIZEOF_SHORT (SIZEOF_SHORT)
|
# define ACC_SIZEOF_SHORT (SIZEOF_SHORT)
|
||||||
@@ -2483,7 +2504,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
# define ACC_ABI_BIG_ENDIAN 1
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
#elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64)
|
#elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64)
|
||||||
# define ACC_ABI_LITTLE_ENDIAN 1
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
#elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430)
|
#elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430 || ACC_ARCH_RISCV)
|
||||||
# define ACC_ABI_LITTLE_ENDIAN 1
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
#elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390 || ACC_ARCH_SPU)
|
#elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390 || ACC_ARCH_SPU)
|
||||||
# define ACC_ABI_BIG_ENDIAN 1
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
@@ -2503,6 +2524,8 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
# define ACC_ABI_BIG_ENDIAN 1
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
#elif 1 && (ACC_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
|
#elif 1 && (ACC_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
|
||||||
# define ACC_ABI_LITTLE_ENDIAN 1
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
|
#elif 1 && (ACC_ARCH_ARM) && defined(_MSC_VER) && defined(_WIN32)
|
||||||
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
#elif 1 && (ACC_ARCH_ARM && ACC_CC_ARMCC_ARMCC)
|
#elif 1 && (ACC_ARCH_ARM && ACC_CC_ARMCC_ARMCC)
|
||||||
# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
|
# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
|
||||||
# error "unexpected configuration - check your compiler defines"
|
# error "unexpected configuration - check your compiler defines"
|
||||||
@@ -2518,6 +2541,8 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
# define ACC_ABI_BIG_ENDIAN 1
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
#elif 1 && (ACC_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__)
|
#elif 1 && (ACC_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__)
|
||||||
# define ACC_ABI_LITTLE_ENDIAN 1
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
|
#elif 1 && (ACC_ARCH_ARM64) && defined(_MSC_VER) && defined(_WIN32)
|
||||||
|
# define ACC_ABI_LITTLE_ENDIAN 1
|
||||||
#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
|
#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
|
||||||
# define ACC_ABI_BIG_ENDIAN 1
|
# define ACC_ABI_BIG_ENDIAN 1
|
||||||
#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
|
#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
|
||||||
@@ -2688,6 +2713,13 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
# ifndef ACC_OPT_UNALIGNED32
|
# ifndef ACC_OPT_UNALIGNED32
|
||||||
# define ACC_OPT_UNALIGNED32 1
|
# define ACC_OPT_UNALIGNED32 1
|
||||||
# endif
|
# endif
|
||||||
|
# elif 1 && defined(_MSC_VER) && defined(_M_ARM) && ((_M_ARM)+0 >= 7)
|
||||||
|
# ifndef ACC_OPT_UNALIGNED16
|
||||||
|
# define ACC_OPT_UNALIGNED16 1
|
||||||
|
# endif
|
||||||
|
# ifndef ACC_OPT_UNALIGNED32
|
||||||
|
# define ACC_OPT_UNALIGNED32 1
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#elif (ACC_ARCH_ARM64)
|
#elif (ACC_ARCH_ARM64)
|
||||||
# ifndef ACC_OPT_UNALIGNED16
|
# ifndef ACC_OPT_UNALIGNED16
|
||||||
@@ -2733,7 +2765,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
#elif (ACC_ARCH_POWERPC)
|
#elif (ACC_ARCH_POWERPC)
|
||||||
# define ACC_OPT_PREFER_PREINC 1
|
# define ACC_OPT_PREFER_PREINC 1
|
||||||
# define ACC_OPT_PREFER_PREDEC 1
|
# define ACC_OPT_PREFER_PREDEC 1
|
||||||
# if (ACC_ABI_BIG_ENDIAN)
|
# if (ACC_ABI_BIG_ENDIAN) || (ACC_WORDSIZE == 8)
|
||||||
# ifndef ACC_OPT_UNALIGNED16
|
# ifndef ACC_OPT_UNALIGNED16
|
||||||
# define ACC_OPT_UNALIGNED16 1
|
# define ACC_OPT_UNALIGNED16 1
|
||||||
# endif
|
# endif
|
||||||
@@ -2746,6 +2778,19 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
#elif (ACC_ARCH_RISCV)
|
||||||
|
# define ACC_OPT_AVOID_UINT_INDEX 1
|
||||||
|
# ifndef ACC_OPT_UNALIGNED16
|
||||||
|
# define ACC_OPT_UNALIGNED16 1
|
||||||
|
# endif
|
||||||
|
# ifndef ACC_OPT_UNALIGNED32
|
||||||
|
# define ACC_OPT_UNALIGNED32 1
|
||||||
|
# endif
|
||||||
|
# if (ACC_WORDSIZE == 8)
|
||||||
|
# ifndef ACC_OPT_UNALIGNED64
|
||||||
|
# define ACC_OPT_UNALIGNED64 1
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
#elif (ACC_ARCH_S390)
|
#elif (ACC_ARCH_S390)
|
||||||
# ifndef ACC_OPT_UNALIGNED16
|
# ifndef ACC_OPT_UNALIGNED16
|
||||||
# define ACC_OPT_UNALIGNED16 1
|
# define ACC_OPT_UNALIGNED16 1
|
||||||
@@ -2865,11 +2910,14 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if !defined(acc_int16e_t)
|
#if !defined(acc_int16e_t)
|
||||||
#if (ACC_SIZEOF_LONG == 2)
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T == ACC_TYPEOF_SHORT) && (ACC_SIZEOF_SHORT != 2)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T
|
||||||
|
#endif
|
||||||
|
#if (ACC_SIZEOF_LONG == 2) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T == ACC_TYPEOF_SHORT)
|
||||||
# define acc_int16e_t long
|
# define acc_int16e_t long
|
||||||
# define acc_uint16e_t unsigned long
|
# define acc_uint16e_t unsigned long
|
||||||
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_LONG
|
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_LONG
|
||||||
#elif (ACC_SIZEOF_INT == 2)
|
#elif (ACC_SIZEOF_INT == 2) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T == ACC_TYPEOF_SHORT)
|
||||||
# define acc_int16e_t int
|
# define acc_int16e_t int
|
||||||
# define acc_uint16e_t unsigned int
|
# define acc_uint16e_t unsigned int
|
||||||
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_INT
|
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_INT
|
||||||
@@ -2898,7 +2946,10 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int16e_t) == ACC_SIZEOF_ACC_INT16E_T)
|
ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int16e_t) == ACC_SIZEOF_ACC_INT16E_T)
|
||||||
#endif
|
#endif
|
||||||
#if !defined(acc_int32e_t)
|
#if !defined(acc_int32e_t)
|
||||||
#if (ACC_SIZEOF_LONG == 4)
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT32E_T == ACC_TYPEOF_INT) && (ACC_SIZEOF_INT != 4)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT32E_T
|
||||||
|
#endif
|
||||||
|
#if (ACC_SIZEOF_LONG == 4) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT32E_T == ACC_TYPEOF_INT)
|
||||||
# define acc_int32e_t long int
|
# define acc_int32e_t long int
|
||||||
# define acc_uint32e_t unsigned long int
|
# define acc_uint32e_t unsigned long int
|
||||||
# define ACC_TYPEOF_ACC_INT32E_T ACC_TYPEOF_LONG
|
# define ACC_TYPEOF_ACC_INT32E_T ACC_TYPEOF_LONG
|
||||||
@@ -2946,19 +2997,25 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
#endif
|
#endif
|
||||||
#if !defined(acc_int64e_t)
|
#if !defined(acc_int64e_t)
|
||||||
#if (ACC_SIZEOF___INT64 == 8)
|
#if (ACC_SIZEOF___INT64 == 8)
|
||||||
# if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
|
# if (ACC_CC_BORLANDC) && !defined(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T)
|
||||||
# define ACC_CFG_TYPE_PREFER___INT64 1
|
# define ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T ACC_TYPEOF___INT64
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF_LONG_LONG) && (ACC_SIZEOF_LONG_LONG != 8)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T
|
||||||
|
#endif
|
||||||
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF___INT64) && (ACC_SIZEOF___INT64 != 8)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T
|
||||||
|
#endif
|
||||||
#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
|
#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
|
||||||
# define acc_int64e_t int
|
# define acc_int64e_t int
|
||||||
# define acc_uint64e_t unsigned int
|
# define acc_uint64e_t unsigned int
|
||||||
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_INT
|
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_INT
|
||||||
#elif (ACC_SIZEOF_LONG == 8)
|
#elif (ACC_SIZEOF_LONG == 8) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF_LONG_LONG) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF___INT64)
|
||||||
# define acc_int64e_t long int
|
# define acc_int64e_t long int
|
||||||
# define acc_uint64e_t unsigned long int
|
# define acc_uint64e_t unsigned long int
|
||||||
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG
|
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG
|
||||||
#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
|
#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF___INT64)
|
||||||
# define acc_int64e_t acc_llong_t
|
# define acc_int64e_t acc_llong_t
|
||||||
# define acc_uint64e_t acc_ullong_t
|
# define acc_uint64e_t acc_ullong_t
|
||||||
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG_LONG
|
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG_LONG
|
||||||
@@ -3320,12 +3377,12 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int_fast64_t) == sizeof(acc_uint_fast6
|
|||||||
#if (ACC_OS_POSIX)
|
#if (ACC_OS_POSIX)
|
||||||
# if (ACC_OS_POSIX_AIX)
|
# if (ACC_OS_POSIX_AIX)
|
||||||
# define HAVE_SYS_RESOURCE_H 1
|
# define HAVE_SYS_RESOURCE_H 1
|
||||||
# elif (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_NETBSD || ACC_OS_POSIX_OPENBSD)
|
# elif (ACC_OS_POSIX_DARWIN || ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_NETBSD || ACC_OS_POSIX_OPENBSD)
|
||||||
# define HAVE_STRINGS_H 1
|
# define HAVE_STRINGS_H 1
|
||||||
# undef HAVE_MALLOC_H
|
# undef HAVE_MALLOC_H
|
||||||
# elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX)
|
# elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX)
|
||||||
# define HAVE_ALLOCA_H 1
|
# define HAVE_ALLOCA_H 1
|
||||||
# elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL)
|
# elif (ACC_OS_POSIX_DARWIN && ACC_LIBC_MSL)
|
||||||
# undef HAVE_SYS_TIME_H
|
# undef HAVE_SYS_TIME_H
|
||||||
# undef HAVE_SYS_TYPES_H
|
# undef HAVE_SYS_TYPES_H
|
||||||
# elif (ACC_OS_POSIX_SOLARIS || ACC_OS_POSIX_SUNOS)
|
# elif (ACC_OS_POSIX_SOLARIS || ACC_OS_POSIX_SUNOS)
|
||||||
@@ -3403,7 +3460,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int_fast64_t) == sizeof(acc_uint_fast6
|
|||||||
# undef HAVE_UTIME_H
|
# undef HAVE_UTIME_H
|
||||||
# undef HAVE_SYS_TIME_H
|
# undef HAVE_SYS_TIME_H
|
||||||
# define HAVE_SYS_UTIME_H 1
|
# define HAVE_SYS_UTIME_H 1
|
||||||
#elif (ACC_CC_CLANG_MSC || ACC_CC_GHS || ACC_CC_INTELC_MSC || ACC_CC_MSC)
|
#elif (ACC_CC_CLANG_C2 || ACC_CC_CLANG_MSC || ACC_CC_GHS || ACC_CC_INTELC_MSC || ACC_CC_MSC)
|
||||||
# undef HAVE_DIRENT_H
|
# undef HAVE_DIRENT_H
|
||||||
# undef HAVE_UNISTD_H
|
# undef HAVE_UNISTD_H
|
||||||
# undef HAVE_UTIME_H
|
# undef HAVE_UTIME_H
|
||||||
@@ -3601,7 +3658,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int_fast64_t) == sizeof(acc_uint_fast6
|
|||||||
#if (ACC_OS_POSIX)
|
#if (ACC_OS_POSIX)
|
||||||
# if (ACC_OS_POSIX_AIX)
|
# if (ACC_OS_POSIX_AIX)
|
||||||
# define HAVE_GETRUSAGE 1
|
# define HAVE_GETRUSAGE 1
|
||||||
# elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL)
|
# elif (ACC_OS_POSIX_DARWIN && ACC_LIBC_MSL)
|
||||||
# undef HAVE_CHOWN
|
# undef HAVE_CHOWN
|
||||||
# undef HAVE_LSTAT
|
# undef HAVE_LSTAT
|
||||||
# elif (ACC_OS_POSIX_UNICOS)
|
# elif (ACC_OS_POSIX_UNICOS)
|
||||||
@@ -3706,7 +3763,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int_fast64_t) == sizeof(acc_uint_fast6
|
|||||||
# endif
|
# endif
|
||||||
#elif (ACC_CC_LCCWIN32)
|
#elif (ACC_CC_LCCWIN32)
|
||||||
# define utime _utime
|
# define utime _utime
|
||||||
#elif (ACC_CC_MSC)
|
#elif (ACC_CC_CLANG_C2 || ACC_CC_MSC)
|
||||||
# if (_MSC_VER < 600)
|
# if (_MSC_VER < 600)
|
||||||
# undef HAVE_STRFTIME
|
# undef HAVE_STRFTIME
|
||||||
# endif
|
# endif
|
||||||
@@ -3906,8 +3963,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
|
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
|
||||||
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
|
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
|
||||||
#elif defined(RETSIGTYPE)
|
|
||||||
typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
|
|
||||||
#else
|
#else
|
||||||
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
|
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
|
||||||
#endif
|
#endif
|
||||||
@@ -4093,11 +4148,14 @@ void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if !defined(acc_int16e_t)
|
#if !defined(acc_int16e_t)
|
||||||
#if (ACC_SIZEOF_LONG == 2)
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T == ACC_TYPEOF_SHORT) && (ACC_SIZEOF_SHORT != 2)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T
|
||||||
|
#endif
|
||||||
|
#if (ACC_SIZEOF_LONG == 2) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T == ACC_TYPEOF_SHORT)
|
||||||
# define acc_int16e_t long
|
# define acc_int16e_t long
|
||||||
# define acc_uint16e_t unsigned long
|
# define acc_uint16e_t unsigned long
|
||||||
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_LONG
|
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_LONG
|
||||||
#elif (ACC_SIZEOF_INT == 2)
|
#elif (ACC_SIZEOF_INT == 2) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT16E_T == ACC_TYPEOF_SHORT)
|
||||||
# define acc_int16e_t int
|
# define acc_int16e_t int
|
||||||
# define acc_uint16e_t unsigned int
|
# define acc_uint16e_t unsigned int
|
||||||
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_INT
|
# define ACC_TYPEOF_ACC_INT16E_T ACC_TYPEOF_INT
|
||||||
@@ -4126,7 +4184,10 @@ void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
|
|||||||
ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int16e_t) == ACC_SIZEOF_ACC_INT16E_T)
|
ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int16e_t) == ACC_SIZEOF_ACC_INT16E_T)
|
||||||
#endif
|
#endif
|
||||||
#if !defined(acc_int32e_t)
|
#if !defined(acc_int32e_t)
|
||||||
#if (ACC_SIZEOF_LONG == 4)
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT32E_T == ACC_TYPEOF_INT) && (ACC_SIZEOF_INT != 4)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT32E_T
|
||||||
|
#endif
|
||||||
|
#if (ACC_SIZEOF_LONG == 4) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT32E_T == ACC_TYPEOF_INT)
|
||||||
# define acc_int32e_t long int
|
# define acc_int32e_t long int
|
||||||
# define acc_uint32e_t unsigned long int
|
# define acc_uint32e_t unsigned long int
|
||||||
# define ACC_TYPEOF_ACC_INT32E_T ACC_TYPEOF_LONG
|
# define ACC_TYPEOF_ACC_INT32E_T ACC_TYPEOF_LONG
|
||||||
@@ -4174,19 +4235,25 @@ void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
|
|||||||
#endif
|
#endif
|
||||||
#if !defined(acc_int64e_t)
|
#if !defined(acc_int64e_t)
|
||||||
#if (ACC_SIZEOF___INT64 == 8)
|
#if (ACC_SIZEOF___INT64 == 8)
|
||||||
# if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
|
# if (ACC_CC_BORLANDC) && !defined(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T)
|
||||||
# define ACC_CFG_TYPE_PREFER___INT64 1
|
# define ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T ACC_TYPEOF___INT64
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF_LONG_LONG) && (ACC_SIZEOF_LONG_LONG != 8)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T
|
||||||
|
#endif
|
||||||
|
#if (ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF___INT64) && (ACC_SIZEOF___INT64 != 8)
|
||||||
|
# undef ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T
|
||||||
|
#endif
|
||||||
#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
|
#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
|
||||||
# define acc_int64e_t int
|
# define acc_int64e_t int
|
||||||
# define acc_uint64e_t unsigned int
|
# define acc_uint64e_t unsigned int
|
||||||
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_INT
|
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_INT
|
||||||
#elif (ACC_SIZEOF_LONG == 8)
|
#elif (ACC_SIZEOF_LONG == 8) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF_LONG_LONG) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF___INT64)
|
||||||
# define acc_int64e_t long int
|
# define acc_int64e_t long int
|
||||||
# define acc_uint64e_t unsigned long int
|
# define acc_uint64e_t unsigned long int
|
||||||
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG
|
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG
|
||||||
#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
|
#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_PREFER_TYPEOF_ACC_INT64E_T == ACC_TYPEOF___INT64)
|
||||||
# define acc_int64e_t acc_llong_t
|
# define acc_int64e_t acc_llong_t
|
||||||
# define acc_uint64e_t acc_ullong_t
|
# define acc_uint64e_t acc_ullong_t
|
||||||
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG_LONG
|
# define ACC_TYPEOF_ACC_INT64E_T ACC_TYPEOF_LONG_LONG
|
||||||
@@ -4515,8 +4582,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
|
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
|
||||||
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
|
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
|
||||||
#elif defined(RETSIGTYPE)
|
|
||||||
typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
|
|
||||||
#else
|
#else
|
||||||
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
|
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
|
||||||
#endif
|
#endif
|
||||||
@@ -4807,7 +4872,7 @@ typedef unsigned short wchar_t;
|
|||||||
#if (HAVE_SIGNAL_H)
|
#if (HAVE_SIGNAL_H)
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
#if (TIME_WITH_SYS_TIME)
|
#if (HAVE_SYS_TIME_H && HAVE_TIME_H)
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
#elif (HAVE_TIME_H)
|
#elif (HAVE_TIME_H)
|
||||||
@@ -5508,18 +5573,17 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
ACCCHK_ASSERT(1 == 1)
|
ACCCHK_ASSERT(1 == 1)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,1) == 1)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,1) == 1u)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,2) == 3)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,2) == 3u)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,3) == 7)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,3) == 7u)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,8) == 255)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,8) == 255u)
|
||||||
#if (ACC_SIZEOF_INT >= 2)
|
#if (ACC_SIZEOF_INT >= 2)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1,15) == 32767)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1,15) == 32767)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,16) == 0xffffU)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,16) == 0xffffU)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(0u,16) == 0u)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(0u,16) == 0u)
|
||||||
#else
|
#endif
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,16) == 0xffffUL)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,16) == 0xffffUL)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(0ul,16) == 0ul)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(0ul,16) == 0ul)
|
||||||
#endif
|
|
||||||
#if (ACC_SIZEOF_INT >= 4)
|
#if (ACC_SIZEOF_INT >= 4)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1,31) == 2147483647)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1,31) == 2147483647)
|
||||||
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,32) == 0xffffffffU)
|
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,32) == 0xffffffffU)
|
||||||
@@ -6080,7 +6144,7 @@ ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_be64) (const acc_hvoid_p p)
|
|||||||
v1 = ACC_UA_GET_BE32(b + 0);
|
v1 = ACC_UA_GET_BE32(b + 0);
|
||||||
v0 = ACC_UA_GET_BE32(b + 4);
|
v0 = ACC_UA_GET_BE32(b + 4);
|
||||||
return ACC_ICONV(acc_uint64l_t, v0) | (ACC_ICONV(acc_uint64l_t, v1) << 32);
|
return ACC_ICONV(acc_uint64l_t, v0) | (ACC_ICONV(acc_uint64l_t, v1) << 32);
|
||||||
#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
|
#elif (ACC_WORDSIZE >= 8)
|
||||||
const acc_hbyte_p b = ACC_CCAST(const acc_hbyte_p, p);
|
const acc_hbyte_p b = ACC_CCAST(const acc_hbyte_p, p);
|
||||||
return (ACC_ICONV(acc_uint64l_t, b[7])) | (ACC_ICONV(acc_uint64l_t, b[6]) << 8) | (ACC_ICONV(acc_uint64l_t, b[5]) << 16) | (ACC_ICONV(acc_uint64l_t, b[4]) << 24) | (ACC_ICONV(acc_uint64l_t, b[3]) << 32) | (ACC_ICONV(acc_uint64l_t, b[2]) << 40) | (ACC_ICONV(acc_uint64l_t, b[1]) << 48) | (ACC_ICONV(acc_uint64l_t, b[0]) << 56);
|
return (ACC_ICONV(acc_uint64l_t, b[7])) | (ACC_ICONV(acc_uint64l_t, b[6]) << 8) | (ACC_ICONV(acc_uint64l_t, b[5]) << 16) | (ACC_ICONV(acc_uint64l_t, b[4]) << 24) | (ACC_ICONV(acc_uint64l_t, b[3]) << 32) | (ACC_ICONV(acc_uint64l_t, b[2]) << 40) | (ACC_ICONV(acc_uint64l_t, b[1]) << 48) | (ACC_ICONV(acc_uint64l_t, b[0]) << 56);
|
||||||
#else
|
#else
|
||||||
@@ -6101,7 +6165,7 @@ ACCLIB_PUBLIC(void, acc_ua_set_be64) (acc_hvoid_p p, acc_uint64l_t v)
|
|||||||
ACC_UA_SET_BE32(b + 4, v);
|
ACC_UA_SET_BE32(b + 4, v);
|
||||||
v >>= 32;
|
v >>= 32;
|
||||||
ACC_UA_SET_BE32(b + 0, v);
|
ACC_UA_SET_BE32(b + 0, v);
|
||||||
#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
|
#elif (ACC_WORDSIZE >= 8)
|
||||||
acc_hbyte_p b = ACC_PCAST(acc_hbyte_p, p);
|
acc_hbyte_p b = ACC_PCAST(acc_hbyte_p, p);
|
||||||
b[7] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
b[7] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
||||||
b[6] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
b[6] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
||||||
@@ -6139,7 +6203,7 @@ ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_le64) (const acc_hvoid_p p)
|
|||||||
v0 = ACC_UA_GET_LE32(b + 0);
|
v0 = ACC_UA_GET_LE32(b + 0);
|
||||||
v1 = ACC_UA_GET_LE32(b + 4);
|
v1 = ACC_UA_GET_LE32(b + 4);
|
||||||
return ACC_ICONV(acc_uint64l_t, v0) | (ACC_ICONV(acc_uint64l_t, v1) << 32);
|
return ACC_ICONV(acc_uint64l_t, v0) | (ACC_ICONV(acc_uint64l_t, v1) << 32);
|
||||||
#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
|
#elif (ACC_WORDSIZE >= 8)
|
||||||
const acc_hbyte_p b = ACC_CCAST(const acc_hbyte_p, p);
|
const acc_hbyte_p b = ACC_CCAST(const acc_hbyte_p, p);
|
||||||
return ACC_ICONV(acc_uint64l_t, b[0]) | (ACC_ICONV(acc_uint64l_t, b[1]) << 8) | (ACC_ICONV(acc_uint64l_t, b[2]) << 16) | (ACC_ICONV(acc_uint64l_t, b[3]) << 24) | (ACC_ICONV(acc_uint64l_t, b[4]) << 32) | (ACC_ICONV(acc_uint64l_t, b[5]) << 40) | (ACC_ICONV(acc_uint64l_t, b[6]) << 48) | (ACC_ICONV(acc_uint64l_t, b[7]) << 56);
|
return ACC_ICONV(acc_uint64l_t, b[0]) | (ACC_ICONV(acc_uint64l_t, b[1]) << 8) | (ACC_ICONV(acc_uint64l_t, b[2]) << 16) | (ACC_ICONV(acc_uint64l_t, b[3]) << 24) | (ACC_ICONV(acc_uint64l_t, b[4]) << 32) | (ACC_ICONV(acc_uint64l_t, b[5]) << 40) | (ACC_ICONV(acc_uint64l_t, b[6]) << 48) | (ACC_ICONV(acc_uint64l_t, b[7]) << 56);
|
||||||
#else
|
#else
|
||||||
@@ -6160,7 +6224,7 @@ ACCLIB_PUBLIC(void, acc_ua_set_le64) (acc_hvoid_p p, acc_uint64l_t v)
|
|||||||
ACC_UA_SET_LE32(b + 0, v);
|
ACC_UA_SET_LE32(b + 0, v);
|
||||||
v >>= 32;
|
v >>= 32;
|
||||||
ACC_UA_SET_LE32(b + 4, v);
|
ACC_UA_SET_LE32(b + 4, v);
|
||||||
#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
|
#elif (ACC_WORDSIZE >= 8)
|
||||||
acc_hbyte_p b = ACC_PCAST(acc_hbyte_p, p);
|
acc_hbyte_p b = ACC_PCAST(acc_hbyte_p, p);
|
||||||
b[0] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
b[0] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
||||||
b[1] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
b[1] = ACC_ITRUNC(unsigned char, v); v >>= 8;
|
||||||
@@ -6888,7 +6952,7 @@ ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
|
|||||||
p = lmalloc(size);
|
p = lmalloc(size);
|
||||||
#else
|
#else
|
||||||
if (size < ACC_STATIC_CAST(size_t, -1))
|
if (size < ACC_STATIC_CAST(size_t, -1))
|
||||||
p = malloc((size_t) size);
|
p = malloc(ACC_STATIC_CAST(size_t, size));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+4
-4
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -145,9 +145,9 @@ struct options_t {
|
|||||||
bool make_ptinterp; // make PT_INTERP [ignore current file!]
|
bool make_ptinterp; // make PT_INTERP [ignore current file!]
|
||||||
bool unmap_all_pages; // thus /proc/self/exe vanishes
|
bool unmap_all_pages; // thus /proc/self/exe vanishes
|
||||||
unsigned char osabi0; // replacement if 0==.e_ident[EI_OSABI]
|
unsigned char osabi0; // replacement if 0==.e_ident[EI_OSABI]
|
||||||
enum { SCRIPT_MAX = 32 };
|
|
||||||
const char *script_name;
|
|
||||||
bool preserve_build_id; // copy the build-id to the compressed binary
|
bool preserve_build_id; // copy the build-id to the compressed binary
|
||||||
|
bool android_shlib; // keep some ElfXX_Shdr for dlopen()
|
||||||
|
bool force_pie; // choose DF_1_PIE instead of is_shlib
|
||||||
} o_unix;
|
} o_unix;
|
||||||
struct {
|
struct {
|
||||||
bool le;
|
bool le;
|
||||||
|
|||||||
+3
-12
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -92,15 +92,6 @@ void PackArmPe::processImports2(unsigned myimport, unsigned iat_off) // pass 2
|
|||||||
{
|
{
|
||||||
PeFile::processImports2(myimport, iat_off);
|
PeFile::processImports2(myimport, iat_off);
|
||||||
|
|
||||||
__packed_struct(import_desc)
|
|
||||||
LE32 oft; // orig first thunk
|
|
||||||
char _[8];
|
|
||||||
LE32 dllname;
|
|
||||||
LE32 iat; // import address table
|
|
||||||
__packed_struct_end()
|
|
||||||
|
|
||||||
COMPILE_TIME_ASSERT(sizeof(import_desc) == 20);
|
|
||||||
|
|
||||||
// adjust import data
|
// adjust import data
|
||||||
for (import_desc *im = (import_desc*) oimpdlls; im->dllname; im++)
|
for (import_desc *im = (import_desc*) oimpdlls; im->dllname; im++)
|
||||||
{
|
{
|
||||||
@@ -228,7 +219,7 @@ unsigned PackArmPe::getProcessImportParam(unsigned upxsection)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PackArmPe::defineSymbols(unsigned ncsection, unsigned, unsigned,
|
void PackArmPe::defineSymbols(unsigned ncsection, unsigned, unsigned,
|
||||||
unsigned ic, Reloc &, unsigned s1addr)
|
unsigned ic, unsigned s1addr)
|
||||||
{
|
{
|
||||||
const unsigned onam = ncsection + soxrelocs + ih.imagebase;
|
const unsigned onam = ncsection + soxrelocs + ih.imagebase;
|
||||||
linker->defineSymbol("start_of_dll_names", onam);
|
linker->defineSymbol("start_of_dll_names", onam);
|
||||||
|
|||||||
+3
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
unsigned ih_codebase);
|
unsigned ih_codebase);
|
||||||
virtual void defineSymbols(unsigned ncsection, unsigned upxsection,
|
virtual void defineSymbols(unsigned ncsection, unsigned upxsection,
|
||||||
unsigned sizeof_oh, unsigned isize_isplit,
|
unsigned sizeof_oh, unsigned isize_isplit,
|
||||||
Reloc &rel, unsigned s1addr);
|
unsigned s1addr);
|
||||||
virtual void addNewRelocations(Reloc &, unsigned upxsection);
|
virtual void addNewRelocations(Reloc &, unsigned upxsection);
|
||||||
virtual unsigned getProcessImportParam(unsigned upxsection);
|
virtual unsigned getProcessImportParam(unsigned upxsection);
|
||||||
virtual void setOhDataBase(const pe_section_t *osection);
|
virtual void setOhDataBase(const pe_section_t *osection);
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+49
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -73,7 +73,8 @@
|
|||||||
EM_PPC = 20,
|
EM_PPC = 20,
|
||||||
EM_PPC64 = 21,
|
EM_PPC64 = 21,
|
||||||
EM_ARM = 40,
|
EM_ARM = 40,
|
||||||
EM_X86_64 = 62
|
EM_X86_64 = 62,
|
||||||
|
EM_AARCH64 = 183
|
||||||
|
|
||||||
};
|
};
|
||||||
enum { // e_version
|
enum { // e_version
|
||||||
@@ -90,6 +91,7 @@
|
|||||||
PT_INTERP = 3, /* Name of program interpreter */
|
PT_INTERP = 3, /* Name of program interpreter */
|
||||||
PT_NOTE = 4, /* Auxiliary information (esp. OpenBSD) */
|
PT_NOTE = 4, /* Auxiliary information (esp. OpenBSD) */
|
||||||
PT_PHDR = 6 /* Entry for header table itself */
|
PT_PHDR = 6 /* Entry for header table itself */
|
||||||
|
, PT_GNU_STACK = 0x6474e551 /* Indicates stack executability */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { // p_flags
|
enum { // p_flags
|
||||||
@@ -122,6 +124,10 @@
|
|||||||
SHT_GROUP = 17, /* Section group */
|
SHT_GROUP = 17, /* Section group */
|
||||||
SHT_SYMTAB_SHNDX = 18, /* Extended section indeces */
|
SHT_SYMTAB_SHNDX = 18, /* Extended section indeces */
|
||||||
SHT_GNU_LIBLIST = 0x6ffffff7 /* Prelink library list */
|
SHT_GNU_LIBLIST = 0x6ffffff7 /* Prelink library list */
|
||||||
|
|
||||||
|
, SHT_LOOS = 0x60000000 /* LOcal OS; SHT_ANDROID_REL{,A} is +1, +2 */
|
||||||
|
, SHT_LOPROC = 0x70000000/* Start of processor-specific */
|
||||||
|
, SHT_ARM_ATTRIBUTES = (SHT_LOPROC + 3) /* ARM attributes section. */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { // sh_flags
|
enum { // sh_flags
|
||||||
@@ -142,6 +148,7 @@
|
|||||||
DT_NULL = 0, /* End flag */
|
DT_NULL = 0, /* End flag */
|
||||||
DT_NEEDED = 1, /* Name of needed library */
|
DT_NEEDED = 1, /* Name of needed library */
|
||||||
DT_PLTRELSZ = 2, /* Size in bytes of PLT relocs */
|
DT_PLTRELSZ = 2, /* Size in bytes of PLT relocs */
|
||||||
|
DT_PLTGOT = 3, /* Processor defined value */
|
||||||
DT_HASH = 4, /* Hash table of symbol names */
|
DT_HASH = 4, /* Hash table of symbol names */
|
||||||
DT_STRTAB = 5, /* String table */
|
DT_STRTAB = 5, /* String table */
|
||||||
DT_SYMTAB = 6, /* Symbol table */
|
DT_SYMTAB = 6, /* Symbol table */
|
||||||
@@ -149,18 +156,31 @@
|
|||||||
DT_RELASZ = 8, /* Total size of Rela relocs */
|
DT_RELASZ = 8, /* Total size of Rela relocs */
|
||||||
DT_RELAENT = 9, /* Size of one RELA relocation */
|
DT_RELAENT = 9, /* Size of one RELA relocation */
|
||||||
DT_INIT = 12, /* Address of init function */
|
DT_INIT = 12, /* Address of init function */
|
||||||
|
DT_FINI = 13, /* Address of termination function */
|
||||||
DT_REL = 17, /* Relocations which contain no addend */
|
DT_REL = 17, /* Relocations which contain no addend */
|
||||||
|
DT_RELSZ = 18, /* Total size of Rel relocs */
|
||||||
DT_RELENT = 19, /* Size of one Rel relocation */
|
DT_RELENT = 19, /* Size of one Rel relocation */
|
||||||
DT_STRSZ = 10, /* Sizeof string table */
|
DT_STRSZ = 10, /* Sizeof string table */
|
||||||
DT_PLTREL = 20, /* Type of reloc in PLT */
|
DT_PLTREL = 20, /* Type of reloc in PLT */
|
||||||
DT_TEXTREL = 22, /* Reloc might modify .text */
|
DT_TEXTREL = 22, /* Reloc might modify .text */
|
||||||
DT_JMPREL = 23, /* Address of PLT relocs */
|
DT_JMPREL = 23, /* Address of PLT relocs */
|
||||||
|
DT_INIT_ARRAY = 25, /* Array with addresses of init fct */
|
||||||
|
DT_FINI_ARRAY = 26, /* Array with addresses of fini fct */
|
||||||
|
DT_INIT_ARRAYSZ= 27, /* size in bytes */
|
||||||
|
DT_FINI_ARRAYSZ= 28, /* size in bytes */
|
||||||
|
DT_PREINIT_ARRAY = 32, /* Array with addresses of preinit fct*/
|
||||||
|
DT_PREINIT_ARRAYSZ= 33, /* size in bytes */
|
||||||
DT_CHECKSUM = 0x6ffffdf8, /* Only for prelink? */
|
DT_CHECKSUM = 0x6ffffdf8, /* Only for prelink? */
|
||||||
DT_GNU_HASH = 0x6ffffef5, /* GNU-style hash table */
|
DT_GNU_HASH = 0x6ffffef5, /* GNU-style hash table */
|
||||||
DT_VERSYM = 0x6ffffff0, /* version[] for each symbol */
|
DT_VERSYM = 0x6ffffff0, /* version[] for each symbol */
|
||||||
|
DT_FLAGS_1 = 0x6ffffffb, /* DF_1_* */
|
||||||
DT_VERDEF = 0x6ffffffc, /* version definitions[] */
|
DT_VERDEF = 0x6ffffffc, /* version definitions[] */
|
||||||
DT_VERNEEDED= 0x6ffffffe /* version[] needed */
|
DT_VERNEEDED= 0x6ffffffe /* version[] needed */
|
||||||
};
|
};
|
||||||
|
enum { // DT_FLAGS_1
|
||||||
|
DF_1_NOW = 0x00000001, /* Set RTLD_NOW for this object. */
|
||||||
|
DF_1_PIE = 0x08000000 // Position-Independent Executable (main program)
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -197,6 +217,32 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WANT_REL_ENUM //{
|
||||||
|
#undef WANT_REL_ENUM
|
||||||
|
static inline unsigned ELF32_R_TYPE(unsigned x) { return 0xff & x; }
|
||||||
|
static inline unsigned ELF64_R_TYPE(upx_uint64_t x) { return 0xffffffff & (unsigned)x; }
|
||||||
|
|
||||||
|
# undef R_PPC_RELATIVE
|
||||||
|
# undef R_PPC64_RELATIVE
|
||||||
|
# undef R_PPC_JMP_SLOT
|
||||||
|
# undef R_PPC64_JMP_SLOT
|
||||||
|
enum { // relocation types
|
||||||
|
R_386_RELATIVE = 8,
|
||||||
|
R_AARCH64_RELATIVE = 1027,
|
||||||
|
R_ARM_RELATIVE = 23,
|
||||||
|
R_PPC_RELATIVE = 22,
|
||||||
|
R_PPC64_RELATIVE = R_PPC_RELATIVE,
|
||||||
|
R_X86_64_RELATIVE = 8,
|
||||||
|
|
||||||
|
R_386_JMP_SLOT = 7,
|
||||||
|
R_AARCH64_JUMP_SLOT = 1026,
|
||||||
|
R_ARM_JUMP_SLOT = 22,
|
||||||
|
R_PPC_JMP_SLOT = 21,
|
||||||
|
R_PPC64_JMP_SLOT = R_PPC_JMP_SLOT,
|
||||||
|
R_X86_64_JUMP_SLOT = 7
|
||||||
|
};
|
||||||
|
#endif //}
|
||||||
|
|
||||||
#ifdef WANT_NHDR_ENUM
|
#ifdef WANT_NHDR_ENUM
|
||||||
#undef WANT_NHDR_ENUM
|
#undef WANT_NHDR_ENUM
|
||||||
enum { // ELF PT_NOTE types
|
enum { // ELF PT_NOTE types
|
||||||
|
|||||||
-174
@@ -1,174 +0,0 @@
|
|||||||
/* p_elks.cpp --
|
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1996-2016 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
|
|
||||||
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "conf.h"
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
#include "file.h"
|
|
||||||
#include "filter.h"
|
|
||||||
#include "packer.h"
|
|
||||||
#include "p_vmlinz.h"
|
|
||||||
|
|
||||||
// FIXME
|
|
||||||
static const
|
|
||||||
#include "stub/l_vmlinz.h"
|
|
||||||
|
|
||||||
// from elks-0.0.83/Documentation/boot.txt
|
|
||||||
static const unsigned kernel_entry = 0x100000;
|
|
||||||
static const unsigned stack_during_uncompression = 0x90000;
|
|
||||||
static const unsigned zimage_offset = 0x1000;
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
const int *PackElks8086::getCompressionMethods(int method, int level) const
|
|
||||||
{
|
|
||||||
return Packer::getDefaultCompressionMethods_8(method, level);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const int *PackElks8086::getFilters() const
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// common util routines
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
int PackElks8086::decompressKernel()
|
|
||||||
{
|
|
||||||
// not used
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PackElks8086::readKernel()
|
|
||||||
{
|
|
||||||
int klen = file_size - setup_size;
|
|
||||||
fi->seek(0, SEEK_SET);
|
|
||||||
|
|
||||||
setup_buf.alloc(setup_size);
|
|
||||||
fi->readx(setup_buf, setup_size);
|
|
||||||
|
|
||||||
ibuf.alloc(klen);
|
|
||||||
fi->readx(ibuf, klen);
|
|
||||||
|
|
||||||
obuf.allocForCompression(klen);
|
|
||||||
|
|
||||||
ph.u_len = klen;
|
|
||||||
ph.filter = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
void PackElks8086::buildLoader(const Filter *ft)
|
|
||||||
{
|
|
||||||
// prepare loader
|
|
||||||
initLoader(nrv_loader, sizeof(nrv_loader));
|
|
||||||
// FIXME
|
|
||||||
UNUSED(ft);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PackElks8086::pack(OutputFile *fo)
|
|
||||||
{
|
|
||||||
readKernel();
|
|
||||||
|
|
||||||
// prepare filter
|
|
||||||
Filter ft(ph.level);
|
|
||||||
ft.buf_len = ph.u_len;
|
|
||||||
ft.addvalue = kernel_entry;
|
|
||||||
// compress
|
|
||||||
compressWithFilters(&ft, overlap_range, NULL_cconf);
|
|
||||||
|
|
||||||
const unsigned lsize = getLoaderSize();
|
|
||||||
MemBuffer loader(lsize);
|
|
||||||
memcpy(loader, getLoader(), lsize);
|
|
||||||
|
|
||||||
patchPackHeader(loader, lsize);
|
|
||||||
#if 0
|
|
||||||
// FIXME
|
|
||||||
defineFilterSymbols(&ft);
|
|
||||||
defineDecompressorSymbols();
|
|
||||||
//patch_le32(loader, lsize, "ESI1", zimage_offset + lsize);
|
|
||||||
//patch_le32(loader, lsize, "KEIP", kernel_entry);
|
|
||||||
//patch_le32(loader, lsize, "STAK", stack_during_uncompression);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
boot_sect_t * const bs = (boot_sect_t *) ((unsigned char *) setup_buf);
|
|
||||||
bs->sys_size = ALIGN_UP(lsize + ph.c_len, 16) / 16;
|
|
||||||
|
|
||||||
fo->write(setup_buf, setup_buf.getSize());
|
|
||||||
fo->write(loader, lsize);
|
|
||||||
fo->write(obuf, ph.c_len);
|
|
||||||
#if 0
|
|
||||||
printf("%-13s: setup : %8ld bytes\n", getName(), (long) setup_buf.getSize());
|
|
||||||
printf("%-13s: loader : %8ld bytes\n", getName(), (long) lsize);
|
|
||||||
printf("%-13s: compressed : %8ld bytes\n", getName(), (long) ph.c_len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// finally check the compression ratio
|
|
||||||
if (!checkFinalCompressionRatio(fo))
|
|
||||||
throwNotCompressible();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// unpack
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
int PackElks8086::canUnpack()
|
|
||||||
{
|
|
||||||
if (readFileHeader() != getFormat())
|
|
||||||
return false;
|
|
||||||
fi->seek(setup_size, SEEK_SET);
|
|
||||||
return readPackHeader(1024) ? 1 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PackElks8086::unpack(OutputFile *)
|
|
||||||
{
|
|
||||||
// no uncompression support for this format yet
|
|
||||||
|
|
||||||
// FIXME: but we could write the uncompressed "Image" image
|
|
||||||
|
|
||||||
throwCantUnpack("build a new kernel instead :-)");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* if 0 */
|
|
||||||
|
|
||||||
/* vim:set ts=4 sw=4 et: */
|
|
||||||
+7
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -281,9 +281,13 @@ int PackExe::readFileHeader()
|
|||||||
if (ih.ident != 'M' + 'Z'*256 && ih.ident != 'Z' + 'M'*256)
|
if (ih.ident != 'M' + 'Z'*256 && ih.ident != 'Z' + 'M'*256)
|
||||||
return 0;
|
return 0;
|
||||||
ih_exesize = ih.m512 + ih.p512*512 - (ih.m512 ? 512 : 0);
|
ih_exesize = ih.m512 + ih.p512*512 - (ih.m512 ? 512 : 0);
|
||||||
|
if (!ih_exesize) {
|
||||||
|
ih_exesize = file_size;
|
||||||
|
}
|
||||||
ih_imagesize = ih_exesize - ih.headsize16*16;
|
ih_imagesize = ih_exesize - ih.headsize16*16;
|
||||||
ih_overlay = file_size - ih_exesize;
|
ih_overlay = file_size - ih_exesize;
|
||||||
if (ih.m512+ih.p512*512u < sizeof (ih))
|
if (file_size < (int)sizeof(ih)
|
||||||
|
|| ((ih.m512 | ih.p512) && ih.m512+ih.p512*512u < sizeof (ih)))
|
||||||
throwCantPack("illegal exe header");
|
throwCantPack("illegal exe header");
|
||||||
if (file_size < (off_t)ih_exesize || ih_imagesize <= 0 || ih_imagesize > ih_exesize)
|
if (file_size < (off_t)ih_exesize || ih_imagesize <= 0 || ih_imagesize > ih_exesize)
|
||||||
throwCantPack("exe header corrupted");
|
throwCantPack("exe header corrupted");
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+1997
-1040
File diff suppressed because it is too large
Load Diff
+95
-17
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -51,7 +51,7 @@ protected:
|
|||||||
|
|
||||||
virtual void pack1(OutputFile *, Filter &) = 0; // generate executable header
|
virtual void pack1(OutputFile *, Filter &) = 0; // generate executable header
|
||||||
virtual int pack2(OutputFile *, Filter &) = 0; // append compressed data
|
virtual int pack2(OutputFile *, Filter &) = 0; // append compressed data
|
||||||
virtual void pack3(OutputFile *, Filter &) = 0; // append loader
|
virtual off_t pack3(OutputFile *, Filter &) = 0; // append loader
|
||||||
//virtual void pack4(OutputFile *, Filter &) = 0; // append pack header
|
//virtual void pack4(OutputFile *, Filter &) = 0; // append pack header
|
||||||
|
|
||||||
virtual void generateElfHdr(
|
virtual void generateElfHdr(
|
||||||
@@ -63,12 +63,12 @@ protected:
|
|||||||
virtual void addStubEntrySections(Filter const *);
|
virtual void addStubEntrySections(Filter const *);
|
||||||
virtual void unpack(OutputFile *fo);
|
virtual void unpack(OutputFile *fo);
|
||||||
|
|
||||||
//virtual void const *elf_find_dynamic(unsigned) const = 0;
|
|
||||||
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const = 0;
|
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const = 0;
|
||||||
static unsigned elf_hash(char const *) /*const*/;
|
static unsigned elf_hash(char const *) /*const*/;
|
||||||
static unsigned gnu_hash(char const *) /*const*/;
|
static unsigned gnu_hash(char const *) /*const*/;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
static unsigned int const asl_delta = (1u<<12); // --android-shlib extra page
|
||||||
unsigned e_type;
|
unsigned e_type;
|
||||||
unsigned e_phnum; /* Program header table entry count */
|
unsigned e_phnum; /* Program header table entry count */
|
||||||
unsigned e_shnum;
|
unsigned e_shnum;
|
||||||
@@ -81,18 +81,24 @@ protected:
|
|||||||
unsigned sz_pack2a; // after pack2() of all PT_LOAD
|
unsigned sz_pack2a; // after pack2() of all PT_LOAD
|
||||||
unsigned lg2_page; // log2(PAGE_SIZE)
|
unsigned lg2_page; // log2(PAGE_SIZE)
|
||||||
unsigned page_size; // 1u<<lg2_page
|
unsigned page_size; // 1u<<lg2_page
|
||||||
unsigned is_big; // stub style: must use area above the brk
|
bool is_pie; // is Position-Independent-Executable (ET_DYN main program)
|
||||||
unsigned xct_off; // shared library: file offset of SHT_EXECINSTR
|
unsigned xct_off; // shared library: file offset of SHT_EXECINSTR
|
||||||
unsigned hatch_off; // file offset of escape hatch
|
unsigned hatch_off; // file offset of escape hatch
|
||||||
|
unsigned o_binfo; // offset to first b_info
|
||||||
upx_uint64_t load_va; // PT_LOAD[0].p_vaddr
|
upx_uint64_t load_va; // PT_LOAD[0].p_vaddr
|
||||||
upx_uint64_t xct_va; // minimum SHT_EXECINSTR virtual address
|
upx_uint64_t xct_va; // minimum SHT_EXECINSTR virtual address
|
||||||
upx_uint64_t jni_onload_va; // runtime &JNI_OnLoad
|
upx_uint64_t jni_onload_va; // runtime &JNI_OnLoad
|
||||||
|
upx_uint64_t user_init_va;
|
||||||
|
unsigned user_init_off; // within file_image
|
||||||
|
|
||||||
upx_uint16_t e_machine;
|
upx_uint16_t e_machine;
|
||||||
unsigned char ei_class;
|
unsigned char ei_class;
|
||||||
unsigned char ei_data;
|
unsigned char ei_data;
|
||||||
unsigned char ei_osabi;
|
unsigned char ei_osabi;
|
||||||
char const *osabi_note;
|
char const *osabi_note;
|
||||||
|
unsigned upx_dt_init; // DT_INIT, DT_PREINIT_ARRAY, DT_INIT_ARRAY
|
||||||
|
static unsigned const DT_NUM = 34; // elf.h
|
||||||
|
unsigned dt_table[DT_NUM]; // 1+ index in PT_DYNAMIC
|
||||||
|
|
||||||
unsigned char const *buildid_data;
|
unsigned char const *buildid_data;
|
||||||
int o_elf_shnum; // num output Shdrs
|
int o_elf_shnum; // num output Shdrs
|
||||||
@@ -118,15 +124,18 @@ protected:
|
|||||||
|
|
||||||
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual off_t pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual void pack4(OutputFile *, Filter &); // append pack header
|
virtual void pack4(OutputFile *, Filter &); // append pack header
|
||||||
virtual void unpack(OutputFile *fo);
|
virtual void unpack(OutputFile *fo);
|
||||||
|
virtual void unRel32(unsigned dt_rel, Elf32_Rel *rel0, unsigned relsz,
|
||||||
|
MemBuffer &membuf, unsigned const load_off, OutputFile *fo);
|
||||||
|
|
||||||
virtual void generateElfHdr(
|
virtual void generateElfHdr(
|
||||||
OutputFile *,
|
OutputFile *,
|
||||||
void const *proto,
|
void const *proto,
|
||||||
unsigned const brka
|
unsigned const brka
|
||||||
);
|
);
|
||||||
|
virtual void defineSymbols(Filter const *);
|
||||||
virtual void buildLinuxLoader(
|
virtual void buildLinuxLoader(
|
||||||
upx_byte const *const proto, // assembly-only sections
|
upx_byte const *const proto, // assembly-only sections
|
||||||
unsigned const szproto,
|
unsigned const szproto,
|
||||||
@@ -140,23 +149,33 @@ protected:
|
|||||||
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;
|
virtual off_t getbase(const Elf32_Phdr *phdr, int e_phnum) const;
|
||||||
|
bool calls_crt1(Elf32_Rel const *rel, int sz);
|
||||||
|
|
||||||
virtual Elf32_Sym const *elf_lookup(char const *) const;
|
virtual Elf32_Sym const *elf_lookup(char const *) const;
|
||||||
virtual unsigned elf_get_offset_from_address(unsigned) const;
|
virtual unsigned elf_get_offset_from_address(unsigned) const;
|
||||||
|
Elf32_Phdr const *elf_find_ptype(unsigned type, Elf32_Phdr const *phdr0, unsigned phnum);
|
||||||
Elf32_Shdr const *elf_find_section_name(char const *) const;
|
Elf32_Shdr const *elf_find_section_name(char const *) const;
|
||||||
Elf32_Shdr const *elf_find_section_type(unsigned) const;
|
Elf32_Shdr const *elf_find_section_type(unsigned) const;
|
||||||
|
unsigned check_pt_dynamic(Elf32_Phdr const *);
|
||||||
|
void invert_pt_dynamic(Elf32_Dyn const *);
|
||||||
void const *elf_find_dynamic(unsigned) const;
|
void const *elf_find_dynamic(unsigned) const;
|
||||||
Elf32_Dyn const *elf_has_dynamic(unsigned) const;
|
Elf32_Dyn const *elf_has_dynamic(unsigned) const;
|
||||||
upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Elf32_Ehdr ehdri; // from input file
|
Elf32_Ehdr ehdri; // from input file
|
||||||
|
MemBuffer lowmem; // especially for shlib
|
||||||
Elf32_Phdr *phdri; // for input file
|
Elf32_Phdr *phdri; // for input file
|
||||||
|
Elf32_Shdr *shdri; // from input file
|
||||||
|
Elf32_Phdr const *gnu_stack; // propagate NX
|
||||||
unsigned e_phoff;
|
unsigned e_phoff;
|
||||||
unsigned e_shoff;
|
unsigned e_shoff;
|
||||||
|
unsigned sz_dynseg; // PT_DYNAMIC.p_memsz
|
||||||
|
unsigned so_slide;
|
||||||
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
|
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
|
||||||
unsigned note_size; // total size of PT_NOTEs
|
unsigned note_size; // total size of PT_NOTEs
|
||||||
Elf32_Shdr const *shdri; // from input file
|
unsigned n_jmp_slot;
|
||||||
|
unsigned plt_off;
|
||||||
unsigned page_mask; // AND clears the offset-within-page
|
unsigned page_mask; // AND clears the offset-within-page
|
||||||
|
|
||||||
Elf32_Dyn const *dynseg; // from PT_DYNAMIC
|
Elf32_Dyn const *dynseg; // from PT_DYNAMIC
|
||||||
@@ -166,7 +185,7 @@ protected:
|
|||||||
Elf32_Sym const *jni_onload_sym;
|
Elf32_Sym const *jni_onload_sym;
|
||||||
char const *shstrtab; // via Elf32_Shdr
|
char const *shstrtab; // via Elf32_Shdr
|
||||||
|
|
||||||
Elf32_Shdr const *sec_strndx;
|
Elf32_Shdr *sec_strndx;
|
||||||
Elf32_Shdr const *sec_dynsym;
|
Elf32_Shdr const *sec_dynsym;
|
||||||
Elf32_Shdr const *sec_dynstr;
|
Elf32_Shdr const *sec_dynstr;
|
||||||
|
|
||||||
@@ -233,18 +252,22 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void PackLinuxElf64help1(InputFile *f);
|
virtual void PackLinuxElf64help1(InputFile *f);
|
||||||
virtual int checkEhdr(Elf64_Ehdr const *ehdr) const;
|
virtual int checkEhdr(Elf64_Ehdr const *ehdr) const;
|
||||||
|
virtual bool canPack();
|
||||||
|
|
||||||
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual off_t pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual void pack4(OutputFile *, Filter &); // append pack header
|
virtual void pack4(OutputFile *, Filter &); // append pack header
|
||||||
virtual void unpack(OutputFile *fo);
|
virtual void unpack(OutputFile *fo);
|
||||||
|
virtual void unRela64(upx_uint64_t dt_rela, Elf64_Rela *rela0, unsigned relasz,
|
||||||
|
MemBuffer &membuf, upx_uint64_t const load_off, OutputFile *fo);
|
||||||
|
|
||||||
virtual void generateElfHdr(
|
virtual void generateElfHdr(
|
||||||
OutputFile *,
|
OutputFile *,
|
||||||
void const *proto,
|
void const *proto,
|
||||||
unsigned const brka
|
unsigned const brka
|
||||||
);
|
);
|
||||||
|
virtual void defineSymbols(Filter const *);
|
||||||
virtual void buildLinuxLoader(
|
virtual void buildLinuxLoader(
|
||||||
upx_byte const *const proto, // assembly-only sections
|
upx_byte const *const proto, // assembly-only sections
|
||||||
unsigned const szproto,
|
unsigned const szproto,
|
||||||
@@ -257,23 +280,33 @@ protected:
|
|||||||
virtual void updateLoader(OutputFile *fo);
|
virtual void updateLoader(OutputFile *fo);
|
||||||
virtual unsigned find_LOAD_gap(Elf64_Phdr const *const phdri, unsigned const k,
|
virtual unsigned find_LOAD_gap(Elf64_Phdr const *const phdri, unsigned const k,
|
||||||
unsigned const e_phnum);
|
unsigned const e_phnum);
|
||||||
|
bool calls_crt1(Elf64_Rela const *rela, int sz);
|
||||||
|
|
||||||
virtual Elf64_Sym const *elf_lookup(char const *) const;
|
virtual Elf64_Sym const *elf_lookup(char const *) const;
|
||||||
virtual upx_uint64_t elf_get_offset_from_address(upx_uint64_t) const;
|
virtual upx_uint64_t elf_get_offset_from_address(upx_uint64_t) const;
|
||||||
|
Elf64_Phdr const *elf_find_ptype(unsigned type, Elf64_Phdr const *phdr0, unsigned phnum);
|
||||||
Elf64_Shdr const *elf_find_section_name(char const *) const;
|
Elf64_Shdr const *elf_find_section_name(char const *) const;
|
||||||
Elf64_Shdr const *elf_find_section_type(unsigned) const;
|
Elf64_Shdr const *elf_find_section_type(unsigned) const;
|
||||||
|
upx_uint64_t check_pt_dynamic(Elf64_Phdr const *);
|
||||||
|
void invert_pt_dynamic(Elf64_Dyn const *);
|
||||||
void const *elf_find_dynamic(unsigned) const;
|
void const *elf_find_dynamic(unsigned) const;
|
||||||
Elf64_Dyn const *elf_has_dynamic(unsigned) const;
|
Elf64_Dyn const *elf_has_dynamic(unsigned) const;
|
||||||
upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Elf64_Ehdr ehdri; // from input file
|
Elf64_Ehdr ehdri; // from input file
|
||||||
|
MemBuffer lowmem; // especially for shlib
|
||||||
Elf64_Phdr *phdri; // for input file
|
Elf64_Phdr *phdri; // for input file
|
||||||
|
Elf64_Shdr *shdri; // from input file
|
||||||
|
Elf64_Phdr const *gnu_stack; // propagate NX
|
||||||
upx_uint64_t e_phoff;
|
upx_uint64_t e_phoff;
|
||||||
upx_uint64_t e_shoff;
|
upx_uint64_t e_shoff;
|
||||||
|
upx_uint64_t sz_dynseg; // PT_DYNAMIC.p_memsz
|
||||||
|
upx_uint64_t so_slide;
|
||||||
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
|
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
|
||||||
unsigned note_size; // total size of PT_NOTEs
|
unsigned note_size; // total size of PT_NOTEs
|
||||||
Elf64_Shdr const *shdri; // from input file
|
unsigned n_jmp_slot;
|
||||||
|
upx_uint64_t plt_off;
|
||||||
upx_uint64_t page_mask; // AND clears the offset-within-page
|
upx_uint64_t page_mask; // AND clears the offset-within-page
|
||||||
|
|
||||||
Elf64_Dyn const *dynseg; // from PT_DYNAMIC
|
Elf64_Dyn const *dynseg; // from PT_DYNAMIC
|
||||||
@@ -283,7 +316,7 @@ protected:
|
|||||||
Elf64_Sym const *jni_onload_sym;
|
Elf64_Sym const *jni_onload_sym;
|
||||||
char const *shstrtab; // via Elf64_Shdr
|
char const *shstrtab; // via Elf64_Shdr
|
||||||
|
|
||||||
Elf64_Shdr const *sec_strndx;
|
Elf64_Shdr *sec_strndx;
|
||||||
Elf64_Shdr const *sec_dynsym;
|
Elf64_Shdr const *sec_dynsym;
|
||||||
Elf64_Shdr const *sec_dynstr;
|
Elf64_Shdr const *sec_dynstr;
|
||||||
|
|
||||||
@@ -363,6 +396,18 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PackLinuxElf64Be : public PackLinuxElf64
|
||||||
|
{
|
||||||
|
typedef PackLinuxElf64 super;
|
||||||
|
protected:
|
||||||
|
PackLinuxElf64Be(InputFile *f) : super(f) {
|
||||||
|
lg2_page=16;
|
||||||
|
page_size=1u<<lg2_page;
|
||||||
|
bele = &N_BELE_RTP::be_policy;
|
||||||
|
PackLinuxElf64help1(f);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// linux/elf64amd
|
// linux/elf64amd
|
||||||
@@ -378,10 +423,25 @@ public:
|
|||||||
virtual const char *getName() const { return "linux/amd64"; }
|
virtual const char *getName() const { return "linux/amd64"; }
|
||||||
virtual const char *getFullName(const options_t *) const { return "amd64-linux.elf"; }
|
virtual const char *getFullName(const options_t *) const { return "amd64-linux.elf"; }
|
||||||
virtual const int *getFilters() const;
|
virtual const int *getFilters() const;
|
||||||
virtual bool canPack();
|
|
||||||
protected:
|
protected:
|
||||||
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
//virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual void buildLoader(const Filter *);
|
||||||
|
virtual Linker* newLinker() const;
|
||||||
|
virtual void defineSymbols(Filter const *);
|
||||||
|
};
|
||||||
|
|
||||||
|
class PackLinuxElf64arm : public PackLinuxElf64Le
|
||||||
|
{
|
||||||
|
typedef PackLinuxElf64Le super;
|
||||||
|
public:
|
||||||
|
PackLinuxElf64arm(InputFile *f);
|
||||||
|
virtual ~PackLinuxElf64arm();
|
||||||
|
virtual int getFormat() const { return UPX_F_LINUX_ELF64_ARM; }
|
||||||
|
virtual const char *getName() const { return "linux/arm64"; }
|
||||||
|
virtual const char *getFullName(const options_t *) const { return "arm64-linux.elf"; }
|
||||||
|
virtual const int *getFilters() const;
|
||||||
|
protected:
|
||||||
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
virtual void buildLoader(const Filter *);
|
virtual void buildLoader(const Filter *);
|
||||||
virtual Linker* newLinker() const;
|
virtual Linker* newLinker() const;
|
||||||
virtual void defineSymbols(Filter const *);
|
virtual void defineSymbols(Filter const *);
|
||||||
@@ -425,7 +485,25 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
unsigned lg2_page; // log2(PAGE_SIZE)
|
unsigned lg2_page; // log2(PAGE_SIZE)
|
||||||
unsigned page_size; // 1u<<lg2_page
|
unsigned page_size; // 1u<<lg2_page
|
||||||
virtual bool canPack();
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
|
virtual void buildLoader(const Filter *);
|
||||||
|
virtual Linker* newLinker() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class PackLinuxElf64ppc : public PackLinuxElf64Be
|
||||||
|
{
|
||||||
|
typedef PackLinuxElf64Be super;
|
||||||
|
public:
|
||||||
|
PackLinuxElf64ppc(InputFile *f);
|
||||||
|
virtual ~PackLinuxElf64ppc();
|
||||||
|
virtual int getFormat() const { return UPX_F_LINUX_ELFPPC64; }
|
||||||
|
virtual const char *getName() const { return "linux/ppc64"; }
|
||||||
|
virtual const char *getFullName(const options_t *) const { return "powerpc64-linux.elf"; }
|
||||||
|
virtual const int *getFilters() const;
|
||||||
|
protected:
|
||||||
|
unsigned lg2_page; // log2(PAGE_SIZE)
|
||||||
|
unsigned page_size; // 1u<<lg2_page
|
||||||
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
virtual void buildLoader(const Filter *);
|
virtual void buildLoader(const Filter *);
|
||||||
virtual Linker* newLinker() const;
|
virtual Linker* newLinker() const;
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2001-2016 John F. Reiser
|
Copyright (C) 2001-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+6
-5
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -82,7 +82,7 @@ void PackLinuxElf32x86interp::pack1(OutputFile *fo, Filter &)
|
|||||||
assert(ehdri.e_phoff == sizeof(Elf32_Ehdr)); // checked by canPack()
|
assert(ehdri.e_phoff == sizeof(Elf32_Ehdr)); // checked by canPack()
|
||||||
sz_phdrs = ehdri.e_phnum * ehdri.e_phentsize;
|
sz_phdrs = ehdri.e_phnum * ehdri.e_phentsize;
|
||||||
|
|
||||||
phdri = new Elf32_Phdr[(unsigned)ehdri.e_phnum];
|
phdri = New(Elf32_Phdr, ehdri.e_phnum);
|
||||||
fi->seek(ehdri.e_phoff, SEEK_SET);
|
fi->seek(ehdri.e_phoff, SEEK_SET);
|
||||||
fi->readx(phdri, sz_phdrs);
|
fi->readx(phdri, sz_phdrs);
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ int PackLinuxElf32x86interp::pack2(OutputFile *fo, Filter &ft)
|
|||||||
#undef PAGE_MASK
|
#undef PAGE_MASK
|
||||||
#define PAGE_MASK (~0u<<12)
|
#define PAGE_MASK (~0u<<12)
|
||||||
|
|
||||||
void PackLinuxElf32x86interp::pack3(OutputFile *fo, Filter &/*ft*/)
|
off_t 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,6 +191,7 @@ void PackLinuxElf32x86interp::pack3(OutputFile *fo, Filter &/*ft*/)
|
|||||||
else {
|
else {
|
||||||
updateLoader(fo);
|
updateLoader(fo);
|
||||||
}
|
}
|
||||||
|
return fo->getBytesWritten();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
||||||
virtual void pack3(OutputFile *, Filter &); // build loader
|
virtual off_t pack3(OutputFile *, Filter &); // build loader
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -161,11 +161,10 @@ PackLinuxI386sh::pack1(OutputFile *fo, Filter &)
|
|||||||
generateElfHdr(fo, stub_i386_linux_elf_shell_fold, 0x08048000);
|
generateElfHdr(fo, stub_i386_linux_elf_shell_fold, 0x08048000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
off_t
|
||||||
PackLinuxI386sh::pack3(OutputFile *fo, Filter &ft)
|
PackLinuxI386sh::pack3(OutputFile *fo, Filter &ft)
|
||||||
{
|
{
|
||||||
super::pack3(fo,ft);
|
return elfout.phdr[0].p_filesz = super::pack3(fo,ft);
|
||||||
elfout.phdr[0].p_filesz = fo->getBytesWritten();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim:set ts=4 sw=4 et: */
|
/* vim:set ts=4 sw=4 et: */
|
||||||
|
|||||||
+4
-4
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2000-2016 John F. Reiser
|
Copyright (C) 2000-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
virtual void buildLoader(const Filter *);
|
virtual void buildLoader(const Filter *);
|
||||||
|
|
||||||
virtual void pack1(OutputFile *fo, Filter &ft);
|
virtual void pack1(OutputFile *fo, Filter &ft);
|
||||||
virtual void pack3(OutputFile *fo, Filter &ft);
|
virtual off_t pack3(OutputFile *fo, Filter &ft);
|
||||||
|
|
||||||
virtual bool canPack();
|
virtual bool canPack();
|
||||||
// virtual void unpack(OutputFile *fo) { super::unpack(fo); }
|
// virtual void unpack(OutputFile *fo) { super::unpack(fo); }
|
||||||
|
|||||||
+437
-379
File diff suppressed because it is too large
Load Diff
+20
-49
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -29,13 +29,19 @@
|
|||||||
#ifndef __UPX_P_MACHO_H
|
#ifndef __UPX_P_MACHO_H
|
||||||
#define __UPX_P_MACHO_H 1
|
#define __UPX_P_MACHO_H 1
|
||||||
|
|
||||||
|
#include "conf.h"
|
||||||
|
|
||||||
__packed_struct(Mach_fat_header)
|
__packed_struct(Mach_fat_header)
|
||||||
BE32 magic;
|
BE32 magic;
|
||||||
|
# if 0
|
||||||
enum { // note conflict with java bytecode PackLinuxI386
|
enum { // note conflict with java bytecode PackLinuxI386
|
||||||
FAT_MAGIC = 0xcafebabe,
|
FAT_MAGIC = 0xcafebabe,
|
||||||
FAT_MAGIC_SWAB = 0xbebafeca
|
FAT_MAGIC_SWAB = 0xbebafeca
|
||||||
};
|
};
|
||||||
|
# else
|
||||||
|
static const unsigned FAT_MAGIC = 0xcafebabe;
|
||||||
|
static const unsigned FAT_MAGIC_SWAB = 0xbebafeca;
|
||||||
|
# endif
|
||||||
BE32 nfat_arch; // Number of Mach_fat_arch which follow.
|
BE32 nfat_arch; // Number of Mach_fat_arch which follow.
|
||||||
__packed_struct_end()
|
__packed_struct_end()
|
||||||
|
|
||||||
@@ -282,7 +288,9 @@ template <class TMachITypes>
|
|||||||
__packed_struct(Mach_linkedit_data_command)
|
__packed_struct(Mach_linkedit_data_command)
|
||||||
typedef typename TMachITypes::Word Word;
|
typedef typename TMachITypes::Word Word;
|
||||||
|
|
||||||
Word cmd;
|
Word cmd; // LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO,
|
||||||
|
// LC_FUNCTION_STARTS, LC_DATA_IN_CODE,
|
||||||
|
// LC_DYLIB_CODE_SIGN_DRS, LC_LINKER_OPTIMIZATION_HINT
|
||||||
Word cmdsize;
|
Word cmdsize;
|
||||||
Word dataoff; // file offset of data in __LINKEDIT segment
|
Word dataoff; // file offset of data in __LINKEDIT segment
|
||||||
Word datasize; // file size of data in __LINKEDIT segment
|
Word datasize; // file size of data in __LINKEDIT segment
|
||||||
@@ -328,6 +336,7 @@ __packed_struct(Mach_source_version_command)
|
|||||||
Word cmd; // LC_SOURCE_VERSION
|
Word cmd; // LC_SOURCE_VERSION
|
||||||
Word cmdsize; // 16
|
Word cmdsize; // 16
|
||||||
Word version;
|
Word version;
|
||||||
|
Word __pad; // to 0 mod 8
|
||||||
__packed_struct_end()
|
__packed_struct_end()
|
||||||
|
|
||||||
template <class TMachITypes>
|
template <class TMachITypes>
|
||||||
@@ -386,26 +395,6 @@ __packed_struct(Mach_load_dylib_command)
|
|||||||
Mach_dylib<TMachITypes> dylib;
|
Mach_dylib<TMachITypes> dylib;
|
||||||
__packed_struct_end()
|
__packed_struct_end()
|
||||||
|
|
||||||
template <class TMachITypes>
|
|
||||||
__packed_struct(Mach_function_starts_command)
|
|
||||||
typedef typename TMachITypes::Word Word;
|
|
||||||
|
|
||||||
Word cmd;
|
|
||||||
Word cmdsize;
|
|
||||||
Word dataoff;
|
|
||||||
Word datasize;
|
|
||||||
__packed_struct_end()
|
|
||||||
|
|
||||||
template <class TMachITypes>
|
|
||||||
__packed_struct(Mach_data_in_code_command)
|
|
||||||
typedef typename TMachITypes::Word Word;
|
|
||||||
|
|
||||||
Word cmd;
|
|
||||||
Word cmdsize;
|
|
||||||
Word dataoff;
|
|
||||||
Word datasize;
|
|
||||||
__packed_struct_end()
|
|
||||||
|
|
||||||
} // namespace N_Mach
|
} // namespace N_Mach
|
||||||
|
|
||||||
namespace N_Mach32 {
|
namespace N_Mach32 {
|
||||||
@@ -553,8 +542,6 @@ struct MachClass_32
|
|||||||
typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command;
|
typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command;
|
||||||
typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command;
|
typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command;
|
||||||
typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command;
|
typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command;
|
||||||
typedef N_Mach::Mach_data_in_code_command<MachITypes> Mach_data_in_code_command;
|
|
||||||
typedef N_Mach::Mach_function_starts_command<MachITypes> Mach_function_starts_command;
|
|
||||||
typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command;
|
typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command;
|
||||||
typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib;
|
typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib;
|
||||||
typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command;
|
typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command;
|
||||||
@@ -597,8 +584,6 @@ struct MachClass_64
|
|||||||
typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command;
|
typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command;
|
||||||
typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command;
|
typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command;
|
||||||
typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command;
|
typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command;
|
||||||
typedef N_Mach::Mach_data_in_code_command<MachITypes> Mach_data_in_code_command;
|
|
||||||
typedef N_Mach::Mach_function_starts_command<MachITypes> Mach_function_starts_command;
|
|
||||||
typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command;
|
typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command;
|
||||||
typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib;
|
typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib;
|
||||||
typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command;
|
typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command;
|
||||||
@@ -637,8 +622,6 @@ typedef MachClass_Host32::Mach_twolevel_hints_command Mach32_twolevel_hints_comm
|
|||||||
typedef MachClass_Host32::Mach_linkedit_data_command Mach32_linkedit_data_command;
|
typedef MachClass_Host32::Mach_linkedit_data_command Mach32_linkedit_data_command;
|
||||||
typedef MachClass_Host32::Mach_uuid_command Mach32_uuid_command;
|
typedef MachClass_Host32::Mach_uuid_command Mach32_uuid_command;
|
||||||
typedef MachClass_Host32::Mach_main_command Mach32_main_command;
|
typedef MachClass_Host32::Mach_main_command Mach32_main_command;
|
||||||
typedef MachClass_Host32::Mach_data_in_code_command Mach32_data_in_code_command;
|
|
||||||
typedef MachClass_Host32::Mach_function_starts_command Mach32_function_starts_command;
|
|
||||||
typedef MachClass_Host32::Mach_load_dylib_command Mach32_load_dylib_command;
|
typedef MachClass_Host32::Mach_load_dylib_command Mach32_load_dylib_command;
|
||||||
typedef MachClass_Host32::Mach_dylib Mach32_dylib;
|
typedef MachClass_Host32::Mach_dylib Mach32_dylib;
|
||||||
typedef MachClass_Host32::Mach_load_dylinker_command Mach32_load_dylinker_command;
|
typedef MachClass_Host32::Mach_load_dylinker_command Mach32_load_dylinker_command;
|
||||||
@@ -656,8 +639,6 @@ typedef MachClass_Host64::Mach_twolevel_hints_command Mach64_twolevel_hints_comm
|
|||||||
typedef MachClass_Host64::Mach_linkedit_data_command Mach64_linkedit_data_command;
|
typedef MachClass_Host64::Mach_linkedit_data_command Mach64_linkedit_data_command;
|
||||||
typedef MachClass_Host64::Mach_uuid_command Mach64_uuid_command;
|
typedef MachClass_Host64::Mach_uuid_command Mach64_uuid_command;
|
||||||
typedef MachClass_Host64::Mach_main_command Mach64_main_command;
|
typedef MachClass_Host64::Mach_main_command Mach64_main_command;
|
||||||
typedef MachClass_Host64::Mach_data_in_code_command Mach64_data_in_code_command;
|
|
||||||
typedef MachClass_Host64::Mach_function_starts_command Mach64_function_starts_command;
|
|
||||||
typedef MachClass_Host64::Mach_load_dylib_command Mach64_load_dylib_command;
|
typedef MachClass_Host64::Mach_load_dylib_command Mach64_load_dylib_command;
|
||||||
typedef MachClass_Host64::Mach_dylib Mach64_dylib;
|
typedef MachClass_Host64::Mach_dylib Mach64_dylib;
|
||||||
typedef MachClass_Host64::Mach_load_dylinker_command Mach64_load_dylinker_command;
|
typedef MachClass_Host64::Mach_load_dylinker_command Mach64_load_dylinker_command;
|
||||||
@@ -675,8 +656,6 @@ typedef MachClass_BE32::Mach_twolevel_hints_command MachBE32_twolevel_hints_co
|
|||||||
typedef MachClass_BE32::Mach_linkedit_data_command MachBE32_linkedit_data_command;
|
typedef MachClass_BE32::Mach_linkedit_data_command MachBE32_linkedit_data_command;
|
||||||
typedef MachClass_BE32::Mach_uuid_command MachBE32_uuid_command;
|
typedef MachClass_BE32::Mach_uuid_command MachBE32_uuid_command;
|
||||||
typedef MachClass_BE32::Mach_main_command MachBE32_main_command;
|
typedef MachClass_BE32::Mach_main_command MachBE32_main_command;
|
||||||
typedef MachClass_BE32::Mach_data_in_code_command MachBE32_data_in_code_command;
|
|
||||||
typedef MachClass_BE32::Mach_function_starts_command MachBE32_function_starts_command;
|
|
||||||
typedef MachClass_BE32::Mach_load_dylib_command MachBE32_load_dylib_command;
|
typedef MachClass_BE32::Mach_load_dylib_command MachBE32_load_dylib_command;
|
||||||
typedef MachClass_BE32::Mach_dylib MachBE32_dylib;
|
typedef MachClass_BE32::Mach_dylib MachBE32_dylib;
|
||||||
typedef MachClass_BE32::Mach_load_dylinker_command MachBE32_load_dylinker_command;
|
typedef MachClass_BE32::Mach_load_dylinker_command MachBE32_load_dylinker_command;
|
||||||
@@ -694,8 +673,6 @@ typedef MachClass_BE64::Mach_twolevel_hints_command MachBE64_twolevel_hints_co
|
|||||||
typedef MachClass_BE64::Mach_linkedit_data_command MachBE64_linkedit_data_command;
|
typedef MachClass_BE64::Mach_linkedit_data_command MachBE64_linkedit_data_command;
|
||||||
typedef MachClass_BE64::Mach_uuid_command MachBE64_uuid_command;
|
typedef MachClass_BE64::Mach_uuid_command MachBE64_uuid_command;
|
||||||
typedef MachClass_BE64::Mach_main_command MachBE64_main_command;
|
typedef MachClass_BE64::Mach_main_command MachBE64_main_command;
|
||||||
typedef MachClass_BE64::Mach_data_in_code_command MachBE64_data_in_code_command;
|
|
||||||
typedef MachClass_BE64::Mach_function_starts_command MachBE64_function_starts_command;
|
|
||||||
typedef MachClass_BE64::Mach_load_dylib_command MachBE64_load_dylib_command;
|
typedef MachClass_BE64::Mach_load_dylib_command MachBE64_load_dylib_command;
|
||||||
typedef MachClass_BE64::Mach_dylib MachBE64_dylib;
|
typedef MachClass_BE64::Mach_dylib MachBE64_dylib;
|
||||||
typedef MachClass_BE64::Mach_load_dylinker_command MachBE64_load_dylinker_command;
|
typedef MachClass_BE64::Mach_load_dylinker_command MachBE64_load_dylinker_command;
|
||||||
@@ -713,8 +690,6 @@ typedef MachClass_LE32::Mach_twolevel_hints_command MachLE32_twolevel_hints_co
|
|||||||
typedef MachClass_LE32::Mach_linkedit_data_command MachLE32_linkedit_data_command;
|
typedef MachClass_LE32::Mach_linkedit_data_command MachLE32_linkedit_data_command;
|
||||||
typedef MachClass_LE32::Mach_uuid_command MachLE32_uuid_command;
|
typedef MachClass_LE32::Mach_uuid_command MachLE32_uuid_command;
|
||||||
typedef MachClass_LE32::Mach_main_command MachLE32_main_command;
|
typedef MachClass_LE32::Mach_main_command MachLE32_main_command;
|
||||||
typedef MachClass_LE32::Mach_data_in_code_command MachLE32_data_in_code_command;
|
|
||||||
typedef MachClass_LE32::Mach_function_starts_command MachLE32_function_starts_command;
|
|
||||||
typedef MachClass_LE32::Mach_load_dylib_command MachLE32_load_dylib_command;
|
typedef MachClass_LE32::Mach_load_dylib_command MachLE32_load_dylib_command;
|
||||||
typedef MachClass_LE32::Mach_dylib MachLE32_dylib;
|
typedef MachClass_LE32::Mach_dylib MachLE32_dylib;
|
||||||
typedef MachClass_LE32::Mach_load_dylinker_command MachLE32_load_dylinker_command;
|
typedef MachClass_LE32::Mach_load_dylinker_command MachLE32_load_dylinker_command;
|
||||||
@@ -732,8 +707,6 @@ typedef MachClass_LE64::Mach_twolevel_hints_command MachLE64_twolevel_hints_co
|
|||||||
typedef MachClass_LE64::Mach_linkedit_data_command MachLE64_linkedit_data_command;
|
typedef MachClass_LE64::Mach_linkedit_data_command MachLE64_linkedit_data_command;
|
||||||
typedef MachClass_LE64::Mach_uuid_command MachLE64_uuid_command;
|
typedef MachClass_LE64::Mach_uuid_command MachLE64_uuid_command;
|
||||||
typedef MachClass_LE64::Mach_main_command MachLE64_main_command;
|
typedef MachClass_LE64::Mach_main_command MachLE64_main_command;
|
||||||
typedef MachClass_LE64::Mach_data_in_code_command MachLE64_data_in_code_command;
|
|
||||||
typedef MachClass_LE64::Mach_function_starts_command MachLE64_function_starts_command;
|
|
||||||
typedef MachClass_LE64::Mach_load_dylib_command MachLE64_load_dylib_command;
|
typedef MachClass_LE64::Mach_load_dylib_command MachLE64_load_dylib_command;
|
||||||
typedef MachClass_LE64::Mach_dylib MachLE64_dylib;
|
typedef MachClass_LE64::Mach_dylib MachLE64_dylib;
|
||||||
typedef MachClass_LE64::Mach_load_dylinker_command MachLE64_load_dylinker_command;
|
typedef MachClass_LE64::Mach_load_dylinker_command MachLE64_load_dylinker_command;
|
||||||
@@ -776,8 +749,6 @@ protected:
|
|||||||
typedef typename MachClass::Mach_linkedit_data_command Mach_linkedit_data_command;
|
typedef typename MachClass::Mach_linkedit_data_command Mach_linkedit_data_command;
|
||||||
typedef typename MachClass::Mach_uuid_command Mach_uuid_command;
|
typedef typename MachClass::Mach_uuid_command Mach_uuid_command;
|
||||||
typedef typename MachClass::Mach_main_command Mach_main_command;
|
typedef typename MachClass::Mach_main_command Mach_main_command;
|
||||||
typedef typename MachClass::Mach_data_in_code_command Mach_data_in_code_command;
|
|
||||||
typedef typename MachClass::Mach_function_starts_command Mach_function_starts_command;
|
|
||||||
typedef typename MachClass::Mach_load_dylib_command Mach_load_dylib_command;
|
typedef typename MachClass::Mach_load_dylib_command Mach_load_dylib_command;
|
||||||
typedef typename MachClass::Mach_dylib Mach_dylib;
|
typedef typename MachClass::Mach_dylib Mach_dylib;
|
||||||
typedef typename MachClass::Mach_load_dylinker_command Mach_load_dylinker_command;
|
typedef typename MachClass::Mach_load_dylinker_command Mach_load_dylinker_command;
|
||||||
@@ -795,7 +766,7 @@ public:
|
|||||||
// called by the generic pack()
|
// called by the generic pack()
|
||||||
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
virtual void pack1(OutputFile *, Filter &); // generate executable header
|
||||||
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
virtual int pack2(OutputFile *, Filter &); // append compressed data
|
||||||
virtual void pack3(OutputFile *, Filter &) /*= 0*/; // append loader
|
virtual off_t pack3(OutputFile *, Filter &) /*= 0*/; // append loader
|
||||||
virtual void pack4(OutputFile *, Filter &) /*= 0*/; // append PackHeader
|
virtual void pack4(OutputFile *, Filter &) /*= 0*/; // append PackHeader
|
||||||
|
|
||||||
virtual void pack4dylib(OutputFile *, Filter &, Addr init_address);
|
virtual void pack4dylib(OutputFile *, Filter &, Addr init_address);
|
||||||
@@ -848,8 +819,9 @@ protected:
|
|||||||
upx_byte const *stub_main;
|
upx_byte const *stub_main;
|
||||||
Mach_segment_command *rawmseg; // as input, with sections
|
Mach_segment_command *rawmseg; // as input, with sections
|
||||||
Mach_segment_command *msegcmd; // LC_SEGMENT first, without sections
|
Mach_segment_command *msegcmd; // LC_SEGMENT first, without sections
|
||||||
unsigned o_routines_cmd; // file offset to LC_ROUINTES
|
unsigned o__mod_init_func; // file offset to __DATA.__mod_init_func Mach_section_command
|
||||||
upx_uint64_t prev_init_address;
|
upx_uint64_t prev_mod_init_func;
|
||||||
|
upx_uint64_t pagezero_vmsize;
|
||||||
Mach_header mhdri;
|
Mach_header mhdri;
|
||||||
|
|
||||||
Mach_header mhdro;
|
Mach_header mhdro;
|
||||||
@@ -1017,7 +989,7 @@ public:
|
|||||||
virtual const char *getName() const { return "dylib/ppc32"; }
|
virtual const char *getName() const { return "dylib/ppc32"; }
|
||||||
virtual const char *getFullName(const options_t *) const { return "powerpc-darwin.dylib"; }
|
virtual const char *getFullName(const options_t *) const { return "powerpc-darwin.dylib"; }
|
||||||
protected:
|
protected:
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual off_t pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1032,7 +1004,7 @@ public:
|
|||||||
virtual const char *getName() const { return "dylib/ppc64le"; }
|
virtual const char *getName() const { return "dylib/ppc64le"; }
|
||||||
virtual const char *getFullName(const options_t *) const { return "powerpc64le-darwin.dylib"; }
|
virtual const char *getFullName(const options_t *) const { return "powerpc64le-darwin.dylib"; }
|
||||||
protected:
|
protected:
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual off_t pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1099,7 +1071,7 @@ public:
|
|||||||
virtual const char *getName() const { return "dylib/i386"; }
|
virtual const char *getName() const { return "dylib/i386"; }
|
||||||
virtual const char *getFullName(const options_t *) const { return "i386-darwin.dylib"; }
|
virtual const char *getFullName(const options_t *) const { return "i386-darwin.dylib"; }
|
||||||
protected:
|
protected:
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual off_t pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1167,7 +1139,7 @@ public:
|
|||||||
virtual const char *getName() const { return "dylib/amd64"; }
|
virtual const char *getName() const { return "dylib/amd64"; }
|
||||||
virtual const char *getFullName(const options_t *) const { return "amd64-darwin.dylib"; }
|
virtual const char *getFullName(const options_t *) const { return "amd64-darwin.dylib"; }
|
||||||
protected:
|
protected:
|
||||||
virtual void pack3(OutputFile *, Filter &); // append loader
|
virtual off_t pack3(OutputFile *, Filter &); // append loader
|
||||||
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
virtual void pack4(OutputFile *, Filter &); // append PackHeader
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1235,7 +1207,6 @@ public:
|
|||||||
virtual const char *getName() const { return "macho/arm64"; }
|
virtual const char *getName() const { return "macho/arm64"; }
|
||||||
virtual const char *getFullName(const options_t *) const { return "arm64-darwin.macho"; }
|
virtual const char *getFullName(const options_t *) const { return "arm64-darwin.macho"; }
|
||||||
protected:
|
protected:
|
||||||
virtual const int *getCompressionMethods(int method, int level) const;
|
|
||||||
virtual const int *getFilters() const;
|
virtual const int *getFilters() const;
|
||||||
|
|
||||||
virtual void pack1_setup_threado(OutputFile *const fo);
|
virtual void pack1_setup_threado(OutputFile *const fo);
|
||||||
|
|||||||
+21
-5
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 2007-2016 John F. Reiser
|
Copyright (C) 2007-2018 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -35,13 +35,18 @@
|
|||||||
|
|
||||||
#ifdef WANT_MACH_HEADER_ENUM /*{*/
|
#ifdef WANT_MACH_HEADER_ENUM /*{*/
|
||||||
#undef WANT_MACH_HEADER_ENUM
|
#undef WANT_MACH_HEADER_ENUM
|
||||||
|
# if 0
|
||||||
enum { // magic
|
enum { // magic
|
||||||
MH_MAGIC = 0xfeedface
|
MH_MAGIC = 0xfeedface
|
||||||
};
|
};
|
||||||
|
# else
|
||||||
|
static const unsigned MH_MAGIC = 0xfeedface;
|
||||||
|
# endif
|
||||||
enum { // cputype
|
enum { // cputype
|
||||||
CPU_TYPE_I386 = 7,
|
CPU_TYPE_I386 = 7,
|
||||||
CPU_TYPE_X86_64 = 0x01000007,
|
CPU_TYPE_X86_64 = 0x01000007,
|
||||||
CPU_TYPE_ARM = 12,
|
CPU_TYPE_ARM = 0x0000000c,
|
||||||
|
CPU_TYPE_ARM64 = 0x0100000c,
|
||||||
CPU_TYPE_POWERPC = 0x00000012,
|
CPU_TYPE_POWERPC = 0x00000012,
|
||||||
CPU_TYPE_POWERPC64 = 0x01000012,
|
CPU_TYPE_POWERPC64 = 0x01000012,
|
||||||
CPU_TYPE_POWERPC64LE = 0x01000021
|
CPU_TYPE_POWERPC64LE = 0x01000021
|
||||||
@@ -53,7 +58,9 @@
|
|||||||
};
|
};
|
||||||
enum { // filetype
|
enum { // filetype
|
||||||
MH_EXECUTE = 2,
|
MH_EXECUTE = 2,
|
||||||
MH_DYLIB = 6,
|
MH_PRELOAD = 5, /* preloaded executable */
|
||||||
|
MH_DYLIB = 6, /* dynamically bound shared library */
|
||||||
|
MH_DYLINKER= 7, /* /usr/bin/dyld */
|
||||||
MH_BUNDLE = 8 /* dynamically bound bundle file */
|
MH_BUNDLE = 8 /* dynamically bound bundle file */
|
||||||
};
|
};
|
||||||
enum { // flags
|
enum { // flags
|
||||||
@@ -79,23 +86,31 @@
|
|||||||
LC_LOAD_DYLINKER = 0xe,
|
LC_LOAD_DYLINKER = 0xe,
|
||||||
LC_ROUTINES = 0x11,
|
LC_ROUTINES = 0x11,
|
||||||
LC_TWOLEVEL_HINTS= 0x16,
|
LC_TWOLEVEL_HINTS= 0x16,
|
||||||
|
LC_LOAD_WEAK_DYLIB= (0x18 | LC_REQ_DYLD),
|
||||||
LC_SEGMENT_64 = 0x19,
|
LC_SEGMENT_64 = 0x19,
|
||||||
LC_ROUTINES_64 = 0x1a,
|
LC_ROUTINES_64 = 0x1a,
|
||||||
LC_UUID = 0x1b,
|
LC_UUID = 0x1b,
|
||||||
LC_RPATH = 0x1c,
|
LC_RPATH = 0x1c,
|
||||||
LC_CODE_SIGNATURE = 0x1d,
|
LC_CODE_SIGNATURE = 0x1d,
|
||||||
LC_SEGMENT_SPLIT_INFO = 0x1e,
|
LC_SEGMENT_SPLIT_INFO = 0x1e,
|
||||||
LC_REEXPORT_DYLIB = 0x1f,
|
LC_REEXPORT_DYLIB = (0x1f | LC_REQ_DYLD),
|
||||||
LC_LAZY_LOAD_DYLIB= 0x20,
|
LC_LAZY_LOAD_DYLIB= 0x20,
|
||||||
LC_ENCRYPTION_INFO= 0x21,
|
LC_ENCRYPTION_INFO= 0x21,
|
||||||
LC_DYLD_INFO = 0x22, // compressed dyld information (10.6.x)
|
LC_DYLD_INFO = 0x22, // compressed dyld information (10.6.x)
|
||||||
LC_DYLD_INFO_ONLY = (0x22|LC_REQ_DYLD),
|
LC_DYLD_INFO_ONLY = (0x22|LC_REQ_DYLD),
|
||||||
LC_VERSION_MIN_MACOSX= 0x24,
|
LC_VERSION_MIN_MACOSX= 0x24,
|
||||||
|
LC_VERSION_MIN_IPHONEOS= 0x25,
|
||||||
LC_FUNCTION_STARTS= 0x26,
|
LC_FUNCTION_STARTS= 0x26,
|
||||||
|
LC_DYLD_ENVIRONMENT= 0x27, // string as environment variable
|
||||||
LC_MAIN = (0x28|LC_REQ_DYLD),
|
LC_MAIN = (0x28|LC_REQ_DYLD),
|
||||||
LC_DATA_IN_CODE = 0x29,
|
LC_DATA_IN_CODE = 0x29,
|
||||||
LC_SOURCE_VERSION = 0x2a,
|
LC_SOURCE_VERSION = 0x2a,
|
||||||
|
LC_DYLIB_CODE_SIGN_DRS= 0x2B,
|
||||||
|
LC_ENCRYPTION_INFO_64= 0x2C,
|
||||||
|
LC_VERSION_MIN_TVOS= 0x2F,
|
||||||
|
LC_VERSION_MIN_WATCHOS= 0x30,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { // maxprot
|
enum { // maxprot
|
||||||
VM_PROT_READ = 1,
|
VM_PROT_READ = 1,
|
||||||
VM_PROT_WRITE = 2,
|
VM_PROT_WRITE = 2,
|
||||||
@@ -123,8 +138,9 @@
|
|||||||
S_16BYTE_LITERALS,
|
S_16BYTE_LITERALS,
|
||||||
S_DTRACE_DOF
|
S_DTRACE_DOF
|
||||||
};
|
};
|
||||||
|
static const unsigned S_ATTR_PURE_INSTRUCTIONS = 0x80000000;
|
||||||
enum { // section flags (high 24 bits)
|
enum { // section flags (high 24 bits)
|
||||||
S_ATTR_PURE_INSTRUCTIONS = 0x80000000,
|
//S_ATTR_PURE_INSTRUCTIONS = 0x80000000,
|
||||||
S_ATTR_NO_TOC = 0x40000000,
|
S_ATTR_NO_TOC = 0x40000000,
|
||||||
S_ATTR_STRIP_STATIC_SYMS = 0x20000000,
|
S_ATTR_STRIP_STATIC_SYMS = 0x20000000,
|
||||||
S_ATTR_NO_DEAD_STRIP = 0x10000000,
|
S_ATTR_NO_DEAD_STRIP = 0x10000000,
|
||||||
|
|||||||
+7
-7
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2002-2016 Jens Medoch
|
Copyright (C) 2002-2018 Jens Medoch
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -160,7 +160,7 @@ void PackPs1::putBkupHeader(const unsigned char *src, unsigned char *dst, unsign
|
|||||||
|
|
||||||
if (src && dst)
|
if (src && dst)
|
||||||
{
|
{
|
||||||
unsigned char *cpr_bh = new unsigned char[sz_cbh];
|
unsigned char *cpr_bh = New(unsigned char, sz_cbh);
|
||||||
|
|
||||||
memset(cpr_bh, 0, sizeof(bh));
|
memset(cpr_bh, 0, sizeof(bh));
|
||||||
ps1_exe_chb_t * p = (ps1_exe_chb_t * )cpr_bh;
|
ps1_exe_chb_t * p = (ps1_exe_chb_t * )cpr_bh;
|
||||||
@@ -189,7 +189,7 @@ bool PackPs1::getBkupHeader(unsigned char *p, unsigned char *dst)
|
|||||||
|
|
||||||
if (src && (src->id == '1' && src->len < SZ_IH_BKUP) && dst)
|
if (src && (src->id == '1' && src->len < SZ_IH_BKUP) && dst)
|
||||||
{
|
{
|
||||||
unsigned char *unc_bh = new unsigned char[MemBuffer::getSizeForUncompression(SZ_IH_BKUP)];
|
unsigned char *unc_bh = New(unsigned char, MemBuffer::getSizeForUncompression(SZ_IH_BKUP));
|
||||||
|
|
||||||
unsigned sz_bh = SZ_IH_BKUP;
|
unsigned sz_bh = SZ_IH_BKUP;
|
||||||
int r = upx_decompress((const unsigned char *)&src->ih_bkup, src->len,
|
int r = upx_decompress((const unsigned char *)&src->ih_bkup, src->len,
|
||||||
@@ -338,7 +338,7 @@ void PackPs1::buildLoader(const Filter *)
|
|||||||
if (M_IS_LZMA(ph.method) && buildPart2)
|
if (M_IS_LZMA(ph.method) && buildPart2)
|
||||||
{
|
{
|
||||||
sz_lcpr = MemBuffer::getSizeForCompression(sz_lunc);
|
sz_lcpr = MemBuffer::getSizeForCompression(sz_lunc);
|
||||||
unsigned char *cprLoader = new unsigned char[sz_lcpr];
|
unsigned char *cprLoader = New(unsigned char, sz_lcpr);
|
||||||
int r = upx_compress(getLoader(), sz_lunc, cprLoader, &sz_lcpr,
|
int r = upx_compress(getLoader(), sz_lunc, cprLoader, &sz_lcpr,
|
||||||
NULL, M_NRV2B_8, 10, NULL, NULL );
|
NULL, M_NRV2B_8, 10, NULL, NULL );
|
||||||
if (r != UPX_E_OK || sz_lcpr >= sz_lunc)
|
if (r != UPX_E_OK || sz_lcpr >= sz_lunc)
|
||||||
@@ -709,7 +709,7 @@ void PackPs1::unpack(OutputFile *fo)
|
|||||||
{
|
{
|
||||||
// restore orig exec hdr
|
// restore orig exec hdr
|
||||||
memcpy(&oh, &ih, sizeof(ih));
|
memcpy(&oh, &ih, sizeof(ih));
|
||||||
memcpy(&oh.epc, &bh, SZ_IH_BKUP);
|
memcpy((void *) &oh.epc, &bh, SZ_IH_BKUP);
|
||||||
|
|
||||||
// check for removed sector alignment
|
// check for removed sector alignment
|
||||||
assert(oh.tx_len >= ph.u_len);
|
assert(oh.tx_len >= ph.u_len);
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
Copyright (C) 2002-2016 Jens Medoch
|
Copyright (C) 2002-2018 Jens Medoch
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2016 Laszlo Molnar
|
Copyright (C) 1996-2018 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user