upxmake --- upx source compilation
upxmake --- upx source compilation
1. 下载upx所依赖的组件源码
- zlib-1.2 http://www.zlib.net/zlib-1.2.11.tar.gz
- ucl-1.03 http://www.oberhumer.com/opensource/ucl/download/ucl-1.03.tar.gz
- lzma443 https://sourceforge.net/projects/sevenzip/files/LZMA SDK/4.43/lzma443.tar.bz2
- upx-3.95-src https://github.com/upx/upx/releases/download/v3.95/upx-3.95-src.tar.xz
2. 解压源码到指定工作目录
- upxmake 工作目录结构
# cd /root/develop/upxmake/
# tree .
.
├── README.md
├── dist
├── document
├── package
│ ├── lzma443.tar.bz2
│ ├── upx-3.95-src.tar.gz
│ └── upx-3.95.tar.gz
├── source
└── vendor
├── install
└── source
├── ucl-1.03.tar.gz
└── zlib-1.2.11.tar.gz
7 directories, 6 files
#
- zlib-1.2 编译命令
# cd /root/develop/upxmake/
# cd vendor/source/
# tar -zxvpf zlib-1.2.11.tar.gz
# cd zlib-1.2.11/
# ./configure --prefix=/root/develop/upxmake/vendor/install/zlib
# gmake all
# gmake install
# tree ../../install/zlib
../../install/zlib
├── include
│ ├── zconf.h
│ └── zlib.h
├── lib
│ ├── libz.a
│ ├── libz.so -> libz.so.1.2.11
│ ├── libz.so.1 -> libz.so.1.2.11
│ ├── libz.so.1.2.11
│ └── pkgconfig
│ └── zlib.pc
└── share
└── man
└── man3
└── zlib.3
6 directories, 8 files
#
- ucl-1.03 编译命令
# cd /root/develop/upxmake/
# cd vendor/source/
# tar -zxvpf ucl-1.03.tar.gz
# cd ucl-1.03/
# ./configure --prefix=/root/develop/upxmake/vendor/install/ucl
# gmake all
# gmake install
# tree ../../install/ucl/
../../install/ucl/
├── include
│ └── ucl
│ ├── ucl.h
│ ├── ucl_asm.h
│ └── uclconf.h
└── lib
├── libucl.a
└── libucl.la
3 directories, 5 files
#
- upx-3.95-src 编译命令
- 解压源码包
修改编译的
src/Makefile文件, 删除CXXFLAGS的-Wmissing-declarations和-Wvla选项.
# cd /root/develop/upxmake/
# tar -zxvpf package/upx-3.95-src.tar.gz -C source/
# cd source/upx-3.95-src/
# vi src/Makefile
- 当前终端环境变量设置
# export UPX_ZLIBDIR="/root/develop/upxmake/vendor/install/zlib"
# export UPX_UCLDIR="/root/develop/upxmake/vendor/install/ucl"
# export UPX_DIR="/root/develop/upxmake/source/upx-3.95-src"
#
# export CPPFLAGS="-I${UPX_ZLIBDIR}/include -I${UPX_UCLDIR}/include ${CPPFLAGS}"
# export LIBRARY_PATH="${UPX_ZLIBDIR}/lib:${UPX_UCLDIR}/lib:${LIBRARY_PATH}"
# export LD_LIBRARY_PATH=".:${UPX_ZLIBDIR}/lib:${UPX_UCLDIR}/lib:${LD_LIBRARY_PATH}"
#
# ldconfig -m ${UPX_ZLIBDIR}/lib
# ldconfig -m ${UPX_UCLDIR}/lib
#
- 编译源码
# cd /root/develop/upxmake/
# cd source/upx-3.95-src/
# gmake all
# ldd src/upx.out
src/upx.out:
libucl.so.1 => /usr/local/lib/libucl.so.1 (0x80080c000)
libz.so.5 => /lib/libz.so.5 (0x800919000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x800a2e000)
libm.so.5 => /lib/libm.so.5 (0x800c3e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x800d5e000)
libc.so.7 => /lib/libc.so.7 (0x800e6c000)
#
# cp src/upx.out ../../dist/upx_amd64.elf
# cd ../../dist/
# ./upx_amd64.elf --help
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2018
UPX 3.95 Markus Oberhumer, Laszlo Molnar & John Reiser Aug 26th 2018
Usage: upx_amd64.elf [-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 license
Options:
-q be quiet -v be verbose
-oFILE write output to 'FILE'
-f force compression of suspicious files
--no-color, --mono, --color, --no-progress change look
Compression tuning options:
--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 overlay
Options for djgpp2/coff:
--coff produce COFF output [default: EXE]
Options for dos/com:
--8086 make compressed com work on any 8086
Options for dos/exe:
--8086 make compressed exe work on any 8086
--no-reloc put no relocations in to the exe header
Options for dos/sys:
--8086 make compressed sys work on any 8086
Options 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 output
file.. executables to (de)compress
This version supports:
amd64-darwin.dylib dylib/amd64
amd64-darwin.macho macho/amd64
amd64-linux.elf linux/amd64
amd64-linux.kernel.vmlinux vmlinux/amd64
amd64-win64.pe win64/pe
arm-darwin.macho macho/arm
arm-linux.elf linux/arm
arm-linux.kernel.vmlinux vmlinux/arm
arm-linux.kernel.vmlinuz vmlinuz/arm
arm-wince.pe arm/pe
arm64-darwin.macho macho/arm64
arm64-linux.elf linux/arm64
armeb-linux.elf linux/armeb
armeb-linux.kernel.vmlinux vmlinux/armeb
fat-darwin.macho macho/fat
i086-dos16.com dos/com
i086-dos16.exe dos/exe
i086-dos16.sys dos/sys
i386-bsd.elf.execve bsd.exec/i386
i386-darwin.macho macho/i386
i386-dos32.djgpp2.coff djgpp2/coff
i386-dos32.tmt.adam tmt/adam
i386-dos32.watcom.le watcom/le
i386-freebsd.elf freebsd/i386
i386-linux.elf linux/i386
i386-linux.elf.execve linux.exec/i386
i386-linux.elf.shell linux.sh/i386
i386-linux.kernel.bvmlinuz bvmlinuz/i386
i386-linux.kernel.vmlinux vmlinux/i386
i386-linux.kernel.vmlinuz vmlinuz/i386
i386-netbsd.elf netbsd/i386
i386-openbsd.elf openbsd/i386
i386-win32.pe win32/pe
m68k-atari.tos atari/tos
mips-linux.elf linux/mips
mipsel-linux.elf linux/mipsel
mipsel.r3000-ps1 ps1/exe
powerpc-darwin.macho macho/ppc32
powerpc-linux.elf linux/ppc32
powerpc-linux.kernel.vmlinux vmlinux/ppc32
powerpc64-linux.elf linux/ppc64
powerpc64le-darwin.macho macho/ppc64le
powerpc64le-linux.elf linux/ppc64le
powerpc64le-linux.kernel.vmlinux vmlinux/ppc64le
UPX comes with ABSOLUTELY NO WARRANTY; for details visit https://upx.github.io
#
End ...
upxmake --- upx source compilation的更多相关文章
- UPX 加壳工具:The Ultimate Packer for eXecutables
UPX (the Ultimate Packer for eXecutables)是一款先进的可运行程序文件压缩器.压缩过的可运行文件体积缩小50%-70% ,这样降低了磁盘占用空间.网络上传下载的时 ...
- Webpack插件开发简要
背景 如今'大前端'这个概念在前端界大热,说'大前端',我们就要提到'前后端分离','前后端分离'又离不开'本地开发构建','本地开发构建'自然离不开webpack,webpack想要工作,那它就需要 ...
- 如何开发webpack plugin
继上回介绍了如何开发webpack loader 之后.趁热打铁,来继续看下webpack另一个核心组成:plugin. 下面也和loader一样,让我们一起从基本的官方文档着手看起. loader和 ...
- Webpack学习-Plugin
原文地址:http://wushaobin.top/2019/03/15/webpackPlugin/ 什么是Plugin? 在Webpack学习-工作原理(上)一文中我们就已经介绍了Plugin的基 ...
- Virtualization solutions on Linux systems - KVM and VirtualBox
Introduction Virtualization packages are means for users to run various operating systems without &q ...
- 如何编写一个WebPack的插件原理及实践
_ 阅读目录 一:webpack插件的基本原理 二:理解 Compiler对象 和 Compilation 对象 三:插件中常用的API 四:编写插件实战 回到顶部 一:webpack插件的基本原理 ...
- 从0开始编写webpack插件
1. 前言 插件(plugins)是webpack中的一等功臣.正是由于有了诸多插件的存在,才使得webpack无所不能.在webpack源码中也是使用了大量的内部插件,插件要是用的好,可以让你的工作 ...
- webpack4 + ejs 构建多页应用
目录结构 ├─build webpack配置目录 │ ├─plugins.js │ ├─rules.js │ ├─transfromAssets.js //简单的一个插件,处理路径问题 │ └─web ...
- webpack源码-打包资源输出到本地
webpack收集完依赖是怎么打包资源的呢? 入口compiler.js: this.applyPluginsParallel("make", compilation, err = ...
随机推荐
- ArcGIS超级工具SPTOOLS-影像的批量裁剪和批量合并
1.1 影像批量裁剪 操作视频: https://weibo.com/tv/v/Hw25XqOL4?fid=1034:4376345233306897 影像批量裁剪:一个影像(可以多波段,也可以单波 ...
- Flume-自定义 Interceptor(拦截器)
使用 Flume 采集服务器本地日志,需要按照日志类型的不同,将不同种类的日志发往不同的分析系统. 在实际的开发中,一台服务器产生的日志类型可能有很多种,不同类型的日志可能需要发送到不同的分析系统. ...
- Mysql表的横向拆分与纵向拆分
表的拆分分为横向拆分(记录的拆分)和纵向拆分(字段的拆分).拆分表的目的:提高查询速度. 1.横向拆分 我们从一个案例去解释,情景是这样的:某某博客,有50W的博客量,有2w的用户,发现随着用户和博客 ...
- Visual Studio Team Systems
https://www.cnblogs.com/33568639/archive/2008/12/29/1364222.html https://baike.sogou.com/v7818386.ht ...
- Jetson TX2介绍
Jetson TX2是NIVDIA瞄准人工智能在Jetson TK1和TX1推出后的升级 TX2的GPU和CPU都进行了升级,内存增加到了8GB.存储增加到了32GB,支持Wifi和蓝牙,编解码支持H ...
- C之自定义类型
声明自定义数据类型,配合各种原有数据类型来达到简化编程的目的的类型定义关键字. #include<stdio.h> #include<stdlib.h> typedef int ...
- centos7 搭建FTP
通过yum安装vsftpd yum install -y vsftpd 修改vsftpd的配置文件 vim /etc/vsftpd/vsftpd.conf 修改配置文件如下: 1.不允许匿名访问 an ...
- for-update与for-update nowait
1.for update 和 for update nowait 的区别: 首先一点,如果只是select 的话,Oracle是不会加任何锁的,也就是Oracle对 select 读到的数据不会有任何 ...
- 详解Pytorch中的网络构造,模型save和load,.pth权重文件解析
转载:https://zhuanlan.zhihu.com/p/53927068 https://blog.csdn.net/wangdongwei0/article/details/88956527 ...
- Django setting 常用配置
setting.py 这个文件包含了所有有关这个Django项目的配置信息,均大写: TEMPLATE_DIRS , DATABASE_NAME , 等. 最重要的设置是 RO ...