UPX 教程
来源:互联网 发布:淘宝找客户要好评 编辑:程序博客网 时间:2024/05/29 19:14
原文:http://blog.csdn.net/mengyafei43/article/details/22887649
UPX是一个通用可执行文件压缩器,由于其具有:
- 压缩率高:压缩效果优于zip/gzip;
- 解压速度快:在奔腾133上即可达到大约10MB/秒;
- 压缩的可执行文件没有额外的内存开销;
- 安全:可以列表,检测和解压可执行文件,压缩和解压缩文件内部都维持有一个校验和;
- 广域:可以压缩多种可执行文件格式:
- dos/exe
- dos/sys
- dos/com
- djgpp2/coff
- watcom/le ( 支持DOS4G, PMODE/W, DOS32a 和 CauseWay )
- win32/pe
- rtm32/pe
- tmt/adam
- linux/386
- atari/tos
- 免费
UPX是一个控制台应用程序,以命令行方式进行操作,其使用是极其简单的:
upx [-命令] [-选项] [-o 目标文件] 源文件..下面我们以UPX 1.07W为例,具体讲解其使用方法。默认情况下,UPX将直接对源文件进行操作,但也可指定目标文件,而不覆盖源文件,文件名支持通配符,即一次可对多个文件进行同一操作。
一、显示 UPX 通用信息(版权信息,使用说明等),在命令行直接输入 UPX 并回车。
复制内容到剪贴板
可通过带 -h 命令参数,获取更详细的帮助:代码:
C:\>UPX
Ultimate Packer for eXecutables
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
UPX 1.07w Markus F.X.J. Oberhumer & Laszlo Molnar Feb 20th 2001
Usage: upx [-123456789dlthVL] [-qvfk] [-o file] file..
Commands:
-1 compress faster -9 compress better
-d decompress -l list compressed file
-t test compressed file -V display version number
-h give more help -L display software license
Options:
-q be quiet -v be verbose
-oFILE write output to `FILE'
-f force compression of suspicious files
-k keep backup files
file.. executables to (de)compress
This version supports: dos/exe, dos/com, dos/sys, djgpp2/coff, watcom/le,
win32/pe, rtm32/pe, tmt/adam, atari/tos, linux/386
UPX comes with ABSOLUTELY NO WARRANTY; for details visit <A href=http://upx.tsx.org>http://upx.tsx.org
复制内容到剪贴板
代码:
C:\>UPX -h
Ultimate Packer for eXecutables
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
UPX 1.07w Markus F.X.J. Oberhumer & Laszlo Molnar Feb 20th 2001
Usage: upx [-123456789dlthVL] [-qvfk] [-o file] file..
Commands:
-1 compress faster -9 compress better
--best compress best (can be very 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
Backup options:
-k, --backup keep backup files
--no-backup no backup files [default]
Overlay options:
--overlay=skip don't compress a file with an overlay
--overlay=copy copy any extra data attached to the file [default]
--overlay=strip strip any extra data attached to the file [dangerous]
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/com:
--8086 make compressed com work on any 8086
Options for dos/sys:
--8086 make compressed sys work on any 8086
Options for djgpp2/coff:
--coff produce COFF output [default: EXE]
Options for watcom/le:
--le produce LE output [default: EXE]
Options for win32/pe & rtm32/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-resources=0 do not compress any resources at all
--strip-relocs=0 do not strip relocations
--strip-relocs=1 strip relocations [default]