压缩加壳工具UPX编译及使用实例

  • 压缩加壳工具UPX编译及使用实例
    • UPX介绍
    • UPX在debian下编译
    • UPX使用

压缩加壳工具UPX编译及使用实例

UPX介绍

UPX是一个著名的压缩壳,主要功能是压缩PE文件(比如exe,dll等文件),有时候也可能被病毒用于免杀.壳upx是一种保护程序。一般是EXE文件的一种外保护措施,主要用途 :
1、让正规文件被保护起来,不容易被修改和破解。
2、使文件压缩变小。
3、保护杀毒软件安装程序,使之不受病毒侵害。
4、木马,病毒的保护外壳,使之难以为攻破。 仅仅看一个壳upx路径 是不能确定什么的。要仔细看看他相对应的文件,如果是杀毒或者是自己已知的文件那就无伤大雅,要是其他疑似,就要认真对待了。.

UPX主页:UPX: the Ultimate Packer for eXecutables – Homepage.
UPX github主页:GitHub - upx/upx: UPX - the Ultimate Packer for eXecutables.

UPX在debian下编译

Upx的编译需要依赖lzma及ucl,提前准备好这三个的源码。

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev$ ls
ucl-1.03.tar.gz  upx-devel.zip  upx-lzma-sdk-master.zip

将lzma及ucl分别解压到upx的src路径中

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03$ ls
acc       aclocal.m4  AUTHORS  config.hin  configure.ac  examples  INSTALL      Makefile.in  README  THANKS  upx
acconfig  asm         B        configure   COPYING       include   Makefile.am  NEWS         src     TODO
wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/lzma-sdk$ ls
7zC.txt  7zFormat.txt  C  CPL.html  history.txt  LGPL.txt  lzma.txt  Methods.txt  upx-lzma-sdk-master  upx-lzma-sdk-master.zip

首先配置ucl的编译选项,在ucl路径执行 ./configure --prefix=/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/ ,注意–prefix=后面的路径为你刚刚释放的ucl源码的路径

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03$ ./configure --prefix=/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/
configure: Configuring UCL 1.03
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
...
太多了,省略一部分
...
checking for umask... yes
checking for utime... yes
checking for vsnprintf... yes
checking whether your compiler passes the ACC conformance test... FAILED
configure:
configure: Your compiler failed the ACC conformance test - for details see
configure: `config.log'. Please check that log file and consider sending
configure: a patch or bug-report to <markus@oberhumer.com>.
configure: Thanks for your support.
configure:
configure: error: ACC conformance test failed. Stop.
wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03$

按照网上检索到的信息修改configure文件

修改configure文件:

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03$ vim configure

修改红框处:

修改完成后重新执行 ./configure --prefix=/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/ ,注意–prefix=后面的路径为你刚刚释放的ucl源码的路径

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03$ ./configure --prefix=/mnt/driver_D/test/upx                                                                                       -dev/upx-devel/src/ucl-1.03/
configure: Configuring UCL 1.03
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
...
太多了,省略一部分
...
checking for umask... yes
checking for utime... yes
checking for vsnprintf... yes
checking whether your compiler passes the ACC conformance test... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating examples/Makefile
config.status: creating include/Makefile
config.status: creating include/ucl/Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commandsUCL configuration summary-------------------------UCL version               : 1.03host operating system     : x86_64-unknown-linux-gnusource code location      : .compiler                  : gccpreprocessor flags        :  -DUCL_HAVE_CONFIG_Hcompiler flags            : -g -O2 -std=gnu90 -fPICbuild static library      : yesbuild shared library      : noenable i386 assembly code : noUCL 1.03 configured.Copyright (C) 1996-2004 Markus Franz Xaver Johannes OberhumerAll Rights Reserved.The UCL library is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public License aspublished by the Free Software Foundation; either version 2 ofthe License, or (at your option) any later version.The UCL library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.Markus F.X.J. Oberhumer<markus@oberhumer.com>http://www.oberhumer.com/opensource/ucl/Type `make' to build UCL. Type `make install' to install UCL.
After installing UCL, please read the accompanied documentation.

配置完成,准备编译,执行:make

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03$ make
make  all-recursive
make[1]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03'
Making all in include
make[2]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/include'
Making all in ucl
make[3]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/include/ucl'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/include/ucl'
make[3]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/include'
make[2]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/include'
Making all in src
make[2]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/src'
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT alloc.lo -MD -MP -MF ".deps/alloc.Tpo" -c -o alloc.lo alloc.c; \
then mv -f ".deps/alloc.Tpo" ".deps/alloc.Plo"; else rm -f ".deps/alloc.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT alloc.lo -MD -MP -M                                                                                       F .deps/alloc.Tpo -c alloc.c -o alloc.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2b_99.lo -MD -MP -MF ".deps/n2b_99.Tpo" -c -o n2b_99.lo n2b_99.c; \
then mv -f ".deps/n2b_99.Tpo" ".deps/n2b_99.Plo"; else rm -f ".deps/n2b_99.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2b_99.lo -MD -MP -                                                                                       MF .deps/n2b_99.Tpo -c n2b_99.c -o n2b_99.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2b_d.lo -MD -MP -MF ".deps/n2b_d.Tpo" -c -o n2b_d.lo n2b_d.c; \
then mv -f ".deps/n2b_d.Tpo" ".deps/n2b_d.Plo"; else rm -f ".deps/n2b_d.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2b_d.lo -MD -MP -M                                                                                       F .deps/n2b_d.Tpo -c n2b_d.c -o n2b_d.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2b_ds.lo -MD -MP -MF ".deps/n2b_ds.Tpo" -c -o n2b_ds.lo n2b_ds.c; \
then mv -f ".deps/n2b_ds.Tpo" ".deps/n2b_ds.Plo"; else rm -f ".deps/n2b_ds.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2b_ds.lo -MD -MP -                                                                                       MF .deps/n2b_ds.Tpo -c n2b_ds.c -o n2b_ds.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2b_to.lo -MD -MP -MF ".deps/n2b_to.Tpo" -c -o n2b_to.lo n2b_to.c; \
then mv -f ".deps/n2b_to.Tpo" ".deps/n2b_to.Plo"; else rm -f ".deps/n2b_to.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2b_to.lo -MD -MP -                                                                                       MF .deps/n2b_to.Tpo -c n2b_to.c -o n2b_to.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2d_99.lo -MD -MP -MF ".deps/n2d_99.Tpo" -c -o n2d_99.lo n2d_99.c; \
then mv -f ".deps/n2d_99.Tpo" ".deps/n2d_99.Plo"; else rm -f ".deps/n2d_99.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2d_99.lo -MD -MP -                                                                                       MF .deps/n2d_99.Tpo -c n2d_99.c -o n2d_99.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2d_d.lo -MD -MP -MF ".deps/n2d_d.Tpo" -c -o n2d_d.lo n2d_d.c; \
then mv -f ".deps/n2d_d.Tpo" ".deps/n2d_d.Plo"; else rm -f ".deps/n2d_d.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2d_d.lo -MD -MP -M                                                                                       F .deps/n2d_d.Tpo -c n2d_d.c -o n2d_d.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2d_ds.lo -MD -MP -MF ".deps/n2d_ds.Tpo" -c -o n2d_ds.lo n2d_ds.c; \
then mv -f ".deps/n2d_ds.Tpo" ".deps/n2d_ds.Plo"; else rm -f ".deps/n2d_ds.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2d_ds.lo -MD -MP -                                                                                       MF .deps/n2d_ds.Tpo -c n2d_ds.c -o n2d_ds.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2d_to.lo -MD -MP -MF ".deps/n2d_to.Tpo" -c -o n2d_to.lo n2d_to.c; \
then mv -f ".deps/n2d_to.Tpo" ".deps/n2d_to.Plo"; else rm -f ".deps/n2d_to.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2d_to.lo -MD -MP -                                                                                       MF .deps/n2d_to.Tpo -c n2d_to.c -o n2d_to.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2e_99.lo -MD -MP -MF ".deps/n2e_99.Tpo" -c -o n2e_99.lo n2e_99.c; \
then mv -f ".deps/n2e_99.Tpo" ".deps/n2e_99.Plo"; else rm -f ".deps/n2e_99.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2e_99.lo -MD -MP -                                                                                       MF .deps/n2e_99.Tpo -c n2e_99.c -o n2e_99.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2e_d.lo -MD -MP -MF ".deps/n2e_d.Tpo" -c -o n2e_d.lo n2e_d.c; \
then mv -f ".deps/n2e_d.Tpo" ".deps/n2e_d.Plo"; else rm -f ".deps/n2e_d.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2e_d.lo -MD -MP -M                                                                                       F .deps/n2e_d.Tpo -c n2e_d.c -o n2e_d.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2e_ds.lo -MD -MP -MF ".deps/n2e_ds.Tpo" -c -o n2e_ds.lo n2e_ds.c; \
then mv -f ".deps/n2e_ds.Tpo" ".deps/n2e_ds.Plo"; else rm -f ".deps/n2e_ds.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2e_ds.lo -MD -MP -                                                                                       MF .deps/n2e_ds.Tpo -c n2e_ds.c -o n2e_ds.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT n2e_to.lo -MD -MP -MF ".deps/n2e_to.Tpo" -c -o n2e_to.lo n2e_to.c; \
then mv -f ".deps/n2e_to.Tpo" ".deps/n2e_to.Plo"; else rm -f ".deps/n2e_to.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT n2e_to.lo -MD -MP -                                                                                       MF .deps/n2e_to.Tpo -c n2e_to.c -o n2e_to.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT ucl_crc.lo -MD -MP -MF ".deps/ucl_crc.Tpo" -c -o ucl_crc.lo ucl_crc.c; \
then mv -f ".deps/ucl_crc.Tpo" ".deps/ucl_crc.Plo"; else rm -f ".deps/ucl_crc.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT ucl_crc.lo -MD -MP                                                                                        -MF .deps/ucl_crc.Tpo -c ucl_crc.c -o ucl_crc.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT ucl_init.lo -MD -MP -MF ".deps/ucl_init.Tpo" -c -o ucl_init.lo ucl_init.c; \
then mv -f ".deps/ucl_init.Tpo" ".deps/ucl_init.Plo"; else rm -f ".deps/ucl_init.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT ucl_init.lo -MD -MP                                                                                        -MF .deps/ucl_init.Tpo -c ucl_init.c -o ucl_init.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT ucl_ptr.lo -MD -MP -MF ".deps/ucl_ptr.Tpo" -c -o ucl_ptr.lo ucl_ptr.c; \
then mv -f ".deps/ucl_ptr.Tpo" ".deps/ucl_ptr.Plo"; else rm -f ".deps/ucl_ptr.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT ucl_ptr.lo -MD -MP                                                                                        -MF .deps/ucl_ptr.Tpo -c ucl_ptr.c -o ucl_ptr.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT ucl_str.lo -MD -MP -MF ".deps/ucl_str.Tpo" -c -o ucl_str.lo ucl_str.c; \
then mv -f ".deps/ucl_str.Tpo" ".deps/ucl_str.Plo"; else rm -f ".deps/ucl_str.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT ucl_str.lo -MD -MP                                                                                        -MF .deps/ucl_str.Tpo -c ucl_str.c -o ucl_str.o
if /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..   -DUCL_HAVE_CONFIG_H    -g -                                                                                       O2 -std=gnu90 -fPIC  -MT ucl_util.lo -MD -MP -MF ".deps/ucl_util.Tpo" -c -o ucl_util.lo ucl_util.c; \
then mv -f ".deps/ucl_util.Tpo" ".deps/ucl_util.Plo"; else rm -f ".deps/ucl_util.Tpo"; exit 1; figcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.. -DUCL_HAVE_CONFIG_H -g -O2 -std=gnu90 -fPIC -MT ucl_util.lo -MD -MP                                                                                        -MF .deps/ucl_util.Tpo -c ucl_util.c -o ucl_util.o
/bin/bash ../libtool --mode=link gcc   -g -O2 -std=gnu90 -fPIC    -o libucl.la -rpath /mnt/driver_D/test/upx-dev/upx-de                                                                                       vel/src/ucl-1.03//lib -version-info 1:0:0 alloc.lo n2b_99.lo n2b_d.lo n2b_ds.lo n2b_to.lo n2d_99.lo n2d_d.lo n2d_ds.lo                                                                                        n2d_to.lo n2e_99.lo n2e_d.lo n2e_ds.lo n2e_to.lo ucl_crc.lo ucl_init.lo ucl_ptr.lo ucl_str.lo ucl_util.lo
mkdir .libs
ar cru .libs/libucl.a  alloc.o n2b_99.o n2b_d.o n2b_ds.o n2b_to.o n2d_99.o n2d_d.o n2d_ds.o n2d_to.o n2e_99.o n2e_d.o n                                                                                       2e_ds.o n2e_to.o ucl_crc.o ucl_init.o ucl_ptr.o ucl_str.o ucl_util.o
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib .libs/libucl.a
creating libucl.la
(cd .libs && rm -f libucl.la && ln -s ../libucl.la libucl.la)
make[2]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/src'
Making all in examples
make[2]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/examples'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..  -DUCL_HAVE_CONFIG_H  -g -O2 -std=gnu90 -fPIC -MT simple.o -MD -M                                                                                       P -MF ".deps/simple.Tpo" -c -o simple.o simple.c; \
then mv -f ".deps/simple.Tpo" ".deps/simple.Po"; else rm -f ".deps/simple.Tpo"; exit 1; fi
/bin/bash ../libtool --mode=link gcc  -g -O2 -std=gnu90 -fPIC   -o simple  simple.o ../src/libucl.la
mkdir .libs
gcc -g -O2 -std=gnu90 -fPIC -o simple simple.o  ../src/.libs/libucl.a
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I..  -DUCL_HAVE_CONFIG_H  -g -O2 -std=gnu90 -fPIC -MT uclpack.o -MD -                                                                                       MP -MF ".deps/uclpack.Tpo" -c -o uclpack.o uclpack.c; \
then mv -f ".deps/uclpack.Tpo" ".deps/uclpack.Po"; else rm -f ".deps/uclpack.Tpo"; exit 1; fi
/bin/bash ../libtool --mode=link gcc  -g -O2 -std=gnu90 -fPIC   -o uclpack  uclpack.o ../src/libucl.la
gcc -g -O2 -std=gnu90 -fPIC -o uclpack uclpack.o  ../src/.libs/libucl.a
make[2]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/examples'
make[2]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03'
make[2]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03'
make[1]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03'
wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03$

至此,UCL编译完成。
接下来就可以开始编译UPX了,回到UPX的Makefile目录,执行:make all UPX_UCLDIR=/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/ UPX_LZMADIR=./src/lzma-sdk LDFLAGS=-no-pie,注意把UPX_UCLDIR=后面换成刚刚编译好的UCL路径,UPX_LZMADIR=后面换成lzma接压路径,开始编译。

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel$ make all UPX_UCLDIR=/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/ UPX_LZMADIR=./src/lzma-sdk LDFLAGS=-no-pie
make -C src all
make[1]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src'
Updating .depend
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o c_file.o -c c_file.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o c_init.o -c c_init.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o c_none.o -c c_none.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o c_screen.o -c c_screen.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o compress.o -c compress.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -I./../src/lzma-sdk -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -Wno-shadow -o compress_lzma.o -c compress_lzma.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o compress_ucl.o -c compress_ucl.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o compress_zlib.o -c compress_zlib.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o except.o -c except.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o file.o -c file.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o filter.o -c filter.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o filteri.o -c filteri.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o help.o -c help.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o lefile.o -c lefile.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o linker.o -c linker.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o main.o -c main.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o mem.o -c mem.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o msg.o -c msg.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_armpe.o -c p_armpe.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_com.o -c p_com.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_djgpp2.o -c p_djgpp2.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_exe.o -c p_exe.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_lx_elf.o -c p_lx_elf.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_lx_exc.o -c p_lx_exc.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_lx_interp.o -c p_lx_interp.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_lx_sh.o -c p_lx_sh.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -Wno-cast-align -o p_mach.o -c p_mach.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_ps1.o -c p_ps1.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_sys.o -c p_sys.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_tmt.o -c p_tmt.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_tos.o -c p_tos.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_unix.o -c p_unix.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_vmlinx.o -c p_vmlinx.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_vmlinz.o -c p_vmlinz.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_w32pe.o -c p_w32pe.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_w64pep.o -c p_w64pep.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o p_wcle.o -c p_wcle.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o packer.o -c packer.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o packer_c.o -c packer_c.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o packer_f.o -c packer_f.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o packhead.o -c packhead.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o packmast.o -c packmast.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o pefile.o -c pefile.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o s_djgpp2.o -c s_djgpp2.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o s_object.o -c s_object.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o s_vcsa.o -c s_vcsa.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o s_win32.o -c s_win32.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o snprintf.o -c snprintf.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o ui.o -c ui.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o util.o -c util.cpp
g++ -I/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//include -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -o work.o -c work.cpp
g++ -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings -Werror -no-pie -o upx.out c_file.o c_init.o c_none.o c_screen.o compress.o compress_lzma.o compress_ucl.o compress_zlib.o except.o file.o filter.o filteri.o help.o lefile.o linker.o main.o mem.o msg.o p_armpe.o p_com.o p_djgpp2.o p_exe.o p_lx_elf.o p_lx_exc.o p_lx_interp.o p_lx_sh.o p_mach.o p_ps1.o p_sys.o p_tmt.o p_tos.o p_unix.o p_vmlinx.o p_vmlinz.o p_w32pe.o p_w64pep.o p_wcle.o packer.o packer_c.o packer_f.o packhead.o packmast.o pefile.o s_djgpp2.o s_object.o s_vcsa.o s_win32.o snprintf.o ui.o util.o work.o -L/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//src/.libs/ -lucl -lz
./../src/stub/scripts/check_whitespace.sh ./..
ERROR: DOS EOL detected ./src/ucl-1.03/B/00README.TXT: Simple make drivers for DOS, Windows, OS/2 and other systems
Makefile:110: recipe for target 'upx.out' failed
make[1]: *** [upx.out] Error 1
make[1]: *** Deleting file 'upx.out'
make[1]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src'
Makefile:31: recipe for target 'all' failed
make: *** [all] Error 2

发生报错,读一下报错日志,发现是src/stub/scripts/check_whitespace.sh脚本识别到windows的换行导致报错,将脚本此次注释掉:

重新编译:

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel$ make all UPX_UCLDIR=/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03/ UPX_LZMADIR=./src/lzma-sdk LDFLAGS=-no-pie
make -C src all
make[1]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/src'
g++ -std=c++14 -O2 -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -funsigned-char -fstack-pr                                                                                       otector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-str                                                                                       ings -Werror -no-pie -o upx.out c_file.o c_init.o c_none.o c_screen.o compress.o compress_lzma.o compress_ucl.o compres                                                                                       s_zlib.o except.o file.o filter.o filteri.o help.o lefile.o linker.o main.o mem.o msg.o p_armpe.o p_com.o p_djgpp2.o p_                                                                                       exe.o p_lx_elf.o p_lx_exc.o p_lx_interp.o p_lx_sh.o p_mach.o p_ps1.o p_sys.o p_tmt.o p_tos.o p_unix.o p_vmlinx.o p_vmli                                                                                       nz.o p_w32pe.o p_w64pep.o p_wcle.o packer.o packer_c.o packer_f.o packhead.o packmast.o pefile.o s_djgpp2.o s_object.o                                                                                        s_vcsa.o s_win32.o snprintf.o ui.o util.o work.o -L/mnt/driver_D/test/upx-dev/upx-devel/src/ucl-1.03//src/.libs/ -lucl                                                                                        -lz
./../src/stub/scripts/check_whitespace.sh ./..
make[1]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/src'
make -C doc all
make[1]: Entering directory '/mnt/driver_D/test/upx-dev/upx-devel/doc'
pod2man --center=" " --release="upx 4.0.0" --date="2021-01-01" upx.pod | sed -e 's/[    ]*$//' > upx.1
test -s upx.1
pod2text < upx.pod | sed -e 's/[        ]*$//' > upx.doc
test -s upx.doc
pod2html --noindex upx.pod | sed -e 's/[        ]*$//' | sed -e 's/     /  /g' > upx.html
test -s upx.html
make[1]: Leaving directory '/mnt/driver_D/test/upx-dev/upx-devel/doc'
wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel$

编译完成,编译出来的文件在src/upx.out,执行一下看一下:

wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel$ ls src/upx.out
src/upx.out
wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel$ src/upx.out -hUltimate Packer for eXecutablesCopyright (C) 1996 - 2021
UPX 4.0.0       Markus Oberhumer, Laszlo Molnar & John Reiser    Jan 1st 2021Usage: upx.out [-123456789dlthVL] [-qvfk] [-o file] file..Commands:-1     compress faster                   -9    compress better--best compress best (can be slow for big files)-d     decompress                        -l    list compressed file-t     test compressed file              -V    display version number-h     give this help                    -L    display software licenseOptions:-q     be quiet                          -v    be verbose-oFILE write output to 'FILE'-f     force compression of suspicious files--no-color, --mono, --color, --no-progress   change lookCompression tuning options:--lzma              try LZMA [slower but tighter than NRV]--brute             try all available compression methods & filters [slow]--ultra-brute       try even more compression variants [very slow]Backup options:-k, --backup        keep backup files--no-backup         no backup files [default]Overlay options:--overlay=copy      copy any extra data attached to the file [default]--overlay=strip     strip any extra data attached to the file [DANGEROUS]--overlay=skip      don't compress a file with an overlayOptions for djgpp2/coff:--coff              produce COFF output [default: EXE]Options for dos/com:--8086              make compressed com work on any 8086Options for dos/exe:--8086              make compressed exe work on any 8086--no-reloc          put no relocations in to the exe headerOptions for dos/sys:--8086              make compressed sys work on any 8086Options for ps1/exe:--8-bit             uses 8 bit size compression [default: 32 bit]--8mib-ram          8 megabyte memory limit [default: 2 MiB]--boot-only         disables client/host transfer compatibility--no-align          don't align to 2048 bytes [enables: --console-run]Options for watcom/le:--le                produce LE output [default: EXE]Options for win32/pe, win64/pe, rtm32/pe & arm/pe:--compress-exports=0    do not compress the export section--compress-exports=1    compress the export section [default]--compress-icons=0      do not compress any icons--compress-icons=1      compress all but the first icon--compress-icons=2      compress all but the first icon directory [default]--compress-icons=3      compress all icons--compress-resources=0  do not compress any resources at all--keep-resource=list    do not compress resources specified by list--strip-relocs=0        do not strip relocations--strip-relocs=1        strip relocations [default]Options for linux/elf:--preserve-build-id     copy .gnu.note.build-id to compressed outputfile..   executables to (de)compressThis version supports:amd64-darwin.dylib                   dylib/amd64amd64-darwin.macho                   macho/amd64amd64-linux.elf                      linux/amd64amd64-linux.kernel.vmlinux           vmlinux/amd64amd64-win64.pe                       win64/pearm-darwin.macho                     macho/armarm-linux.elf                        linux/armarm-linux.kernel.vmlinux             vmlinux/armarm-linux.kernel.vmlinuz             vmlinuz/armarm-wince.pe                         arm/pearm64-darwin.macho                   macho/arm64arm64-linux.elf                      linux/arm64armeb-linux.elf                      linux/armebarmeb-linux.kernel.vmlinux           vmlinux/armebfat-darwin.macho                     macho/fati086-dos16.com                       dos/comi086-dos16.exe                       dos/exei086-dos16.sys                       dos/sysi386-bsd.elf.execve                  bsd.exec/i386i386-darwin.macho                    macho/i386i386-dos32.djgpp2.coff               djgpp2/coffi386-dos32.tmt.adam                  tmt/adami386-dos32.watcom.le                 watcom/lei386-freebsd.elf                     freebsd/i386i386-linux.elf                       linux/i386i386-linux.elf.execve                linux.exec/i386i386-linux.elf.shell                 linux.sh/i386i386-linux.kernel.bvmlinuz           bvmlinuz/i386i386-linux.kernel.vmlinux            vmlinux/i386i386-linux.kernel.vmlinuz            vmlinuz/i386i386-netbsd.elf                      netbsd/i386i386-openbsd.elf                     openbsd/i386i386-win32.pe                        win32/pem68k-atari.tos                       atari/tosmips-linux.elf                       linux/mipsmipsel-linux.elf                     linux/mipselmipsel.r3000-ps1                     ps1/exepowerpc-darwin.macho                 macho/ppc32powerpc-linux.elf                    linux/ppc32powerpc-linux.kernel.vmlinux         vmlinux/ppc32powerpc64-linux.elf                  linux/ppc64powerpc64le-darwin.macho             macho/ppc64lepowerpc64le-linux.elf                linux/ppc64lepowerpc64le-linux.kernel.vmlinux     vmlinux/ppc64leUPX comes with ABSOLUTELY NO WARRANTY; for details visit https://upx.github.io
wanghan@wanghan-W3335HA1:/mnt/driver_D/test/upx-dev/upx-devel$

至此UPX编译已经完成。

UPX使用

UPX可以加壳压缩exe、dll、linux可执行文件、so动态库等,接下来分别尝试。

  1. 对exe加壳
    准备一个exe程序(我是自己写了一个简单windows窗口程序),能够正常运行,文件大小102K。

    使用UPX对这个程序加壳,加壳后,文件大小60K,能正常启动。
  2. 对DLL加密
    准备一个exe和一个dll(我是自己写的,MyMessageBoxDll.dll为自己编写的动态库,调用动态库中的函数,会弹出一个MessageBox弹窗,MessageBoxTest.exe为调用动态库的主程序)。加壳前,dll文件8704字节,能正常运行。

    使用UPX对dll进行加壳,加壳后,dll文件6656字节,能正常运行。
  3. 对linux可执行文件加壳
    准备一个linux可执行文件(我是自己写的一个打印HelloWorld的程序),加壳前,文件大小410120字节(upx要求二进制文件加壳前不少于40K),加壳后5564字节,加壳前后均可正常运行
  4. 对Linux动态库加壳
    准备一个Linux可执行程序和一个动态库(我是自己写的),加壳前,文件大小409432字节(upx要求so文件加壳前不少于40K)可正常运行。

    加壳后,文件大小8260字节,可正常运行。

    至此,演示结束,欢迎各位大神指出问题~~~

压缩加壳工具UPX编译及使用实例相关推荐

  1. java加壳工具_加壳工具 - virbox加密空间站 - OSCHINA - 中文开源技术交流社区

    Virbox Protector Standalone 加壳工具可直接对dll文件进行加壳,防止代码反编译,更安全,更方便. 产品简介 Virbox Protector Standalone提供了强大 ...

  2. 2020最新版Net加壳工具

    Virbox Protector 发布最新版本 Net加壳工具:Virbox Protector 2 . Virbox Protector 为.NET Framework编写的软件做代码保护,防止代码 ...

  3. C#加壳工具做代码加密保护

    当前C# .net语言的应用范围越来越广泛,IIS 的服务器架构后台代码.桌面应用程序的 winform .Unity3d 的逻辑脚本都在使用.C# .net 具备强大的便捷特性,使得开发成本极低.而 ...

  4. Python pyc文件 bytecode的压缩, 加壳和脱壳解析

    我们常常看到, 自己用PyInstaller等库打包的exe被别人反编译.而源代码在exe文件中是以字节码形式存储的.掌握了字节码的加密技巧, 就可以防止源代码的反编译. 目录 1.字节码是什么 2. ...

  5. c# 加壳工具推荐-Virbox Protector .NET 版

    当前C# .net语言的应用范围越来越广泛,IIS 的服务器架构后台代码.桌面应用程序的 winform .Unity3d 的逻辑脚本都在使用.C# .net 具备强大的便捷特性,使得开发成本极低.而 ...

  6. 2018新的加壳工具-Virbox Protector Standalone

    Virbox Protector Standalone 加壳工具 防止代码反编译,更安全,更方便 产品简介 Virbox Protector Standalone提供了强大的代码虚拟化.高级混淆与智能 ...

  7. android的apk加壳工具对比

    **市面上现在有许多的apk加壳或者叫加固工具,这些工具的作用和产生的目的都是为了能够防止apk被反编译,起到一定的保护作用.** 虽然现在有许多的加壳工具但是加密之后的效果有一点差异,对于十分变态的 ...

  8. 标记下 'net 查壳/脱壳/加壳' 工具

    net查壳工具 DotNet Id v1.0.0.3 该net程序集被"MaxToCode"加壳了(也不能完全相信). 加壳工具就是列表中列出的了. de4Net.exe脱壳工具版 ...

  9. 加壳工具推荐-无需编程自动化加壳

    自动保护工具Virbox Protector,是一款高强度自动保护(加密)工具,无需编程就能达到极高的保护强度. Virbox Protector与深思云锁或精锐5或深思软锁配套使用,集自动代码移植. ...

最新文章

  1. 2021 Facebook 博士奖研金名单出炉:13位华人学者获选
  2. ssh linux免密登录。。。。生产共钥到另一台主机
  3. linux+sar+服务,sar服务监控Linux
  4. stm32超声波扫频_基于STM32的脉冲式及扫频式超声波除垢信号源设计
  5. 读写锁(ReadwriteLock)
  6. Atitit.得到网络邻居列表java php c#.net python
  7. SpringCloud 进阶之Eureka(服务注册和发现)
  8. 奇迹s12源码_muserver 奇迹MU服务端VC++源码 适合研究 的朋友 Game Simulator 模拟 器 269万源代码下载- www.pudn.com...
  9. mastercam西门子840d后处理_西门子802D数控铣后处理程序
  10. Git设置代理服务器
  11. 2021小迪网络安全渗透培训—学习笔记打卡
  12. 每日一佳——Hilbert Space Embeddings of Hidden Markov Models(Le Song,ICML,2010)
  13. commit在c语言中的作用,【单选题】SQL语 言 中 COMMIT语句的主要作用是( ) A. 结束程序 B. 返回系统 C. 存储数据 D. 提交事务...
  14. FTTB FTTC FTTH FTTO FSA
  15. C语言中利用Swap函数交换变量a,b
  16. 怎么选房能让房子升值20倍?这些因素很重要
  17. 全球及中国数据中心服务器行业研究及十四五规划分析报告
  18. 最近某网站泄露密码数据分析
  19. Error: listen EADDRINUSE: address already in use 127.0.0.1:8888
  20. 计算机二级及格和优秀,计算机二级成绩优秀有用吗 优秀与合格的区别

热门文章

  1. verilog中状态机的三种编码方式的比较(二进制码、独热码、格雷码)
  2. python+word+excel+ppt自动化办公教程_python自动化办公——excel操作
  3. 解决git每次提交拉取代码都要输入帐号密码
  4. 分享十条Java后端开发实战经验,干货满满!
  5. wx小程序,前端公众号推送消息
  6. YGG 和 BlockchainSpace 举办全国最大的 Web3 活动:Philippine Web3 Festival
  7. Python高级培训——Num2之类的方法重写、property、运算符重载
  8. python队列实现
  9. 使用USBASP给Arduino烧写bootloader教程
  10. 基于USBASP给AVR单片机烧写Arduino bootloader和application固件