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 并回车。

找到其路径,在cmd命令行下打开

代码:

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 sample.exe

  
  
  
  
  
   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



  
   
File size   
   Ratio
   Format
   Name

-------------------- ------ ----------- -----------

Compressing sample.exe [win32/pe]

[*****************************...................................]
45.8%   |





  
  
  
  
  
   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



  
   
File size   
   Ratio
   Format
   Name

-------------------- ------ ----------- -----------

341504 -> 142336 41.67% win32/pe
   
sample.exe



Packed 1 file.

压缩文件可使用命令参数-1~-9来控制压缩速度及压缩率,数字越小压缩速度越快,数字越大压缩率越大。使用--best命令参数将获得最大的压缩率,但其压缩速度也是最慢的。压缩过程将以动态方式显示,压缩完毕将给出压缩前后的文件大小,压缩率,文件格式及名称。

三、解压缩可执行文件:

复制内容到剪贴板

代码:

C:\>UPX -d
sample.exe

  
  
  
  
  
   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



  
   
File size   
   Ratio
   Format
   Name

-------------------- ------ ----------- -----------

341504 <- 142336 41.67% win32/pe
   
sample.exe



Unpacked 1 file.

四、列表

复制内容到剪贴板

代码:

C:\>UPX -l
sample.exe



  
  
  
  
  
   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



  
   
File size   
   Ratio
   Format
   Name

-------------------- ------ ----------- -----------

341504 -> 142336 41.67% win32/pe
   
sample.exe

五、 测试压缩过的可执行文件

复制内容到剪贴板

代码:

C:\>UPX -t
sample.exe



  
  
  
  
  
   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



testing sample.exe [OK]



Tested 1 file.

其它操作

六、显示版本号:

复制内容到剪贴板

代码:

C:\>UPX -V



upx 1.07

NRV data compression library 0.81

Copyright (C) 1996-2001 Markus Franz Xaver Johannes Oberhumer

Copyright (C) 1996-2001 Laszlo Molnar

UPX comes with ABSOLUTELY NO WARRANTY; for details type `upx
-L'.

七、显示软件许可声明:
复制内容到剪贴板

代码:

C:\>UPX -L



  
  
  
  
  
   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



This program may be used freely, and you are welcome to

redistribute it under certain conditions.



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

UPX License Agreement for more details.



You should have received a copy of the UPX License Agreement

along with this program; see the file LICENSE.

If not, visit one of the following pages:



  
   
http://upx.tsx.org

  
   
http://www.oberhumer.com/upx/

 

最新文章

  1. java project中 xml文件路径问题
  2. 我是如何在我的unbuntu 虚拟机上安装 配置QT的
  3. PHPCMS v9 超级安全防范教程!
  4. jQuery Mobile 导航栏
  5. WPF,Silverlight与XAML读书笔记第四十五 - 外观效果之模板
  6. Java 类装载器
  7. 2.1:你的第一个AngularJS App
  8. 初见IOS的UI之:UI控件的属性frame bounds center 和transform
  9. bzoj 1056 [HAOI2008]排名系统(1862 [Zjoi2006]GameZ游戏排名系统)
  10. 使用python监听、模拟鼠标键盘事件
  11. 鸟哥的linux私房菜学习-(二)VMware虚拟机及linux系统安装过程
  12. 一键安装 redmine on windows 和发邮件设置
  13. nsq源码阅读笔记之nsqd(二)——Topic
  14. sqlserver的坑
  15. pythonz之__new__与__init__
  16. BZOJ4802 欧拉函数 数论
  17. BZOJ5361[Lydsy1805月赛]对称数——主席树+随机化
  18. HTTPS原理简述
  19. PHP内置函数实现简单洗牌
  20. 2013-2014 ACM-ICPC, NEERC, Southern Subregional Contest Problem C. Equivalent Cards 计算几何

热门文章

  1. ASP.NET Core Authentication系列(三)Cookie选项
  2. uniapp分享功能-系统分享
  3. AJAX接口-拉购网职位搜索爬虫
  4. 巧用IDM工具 快捷下载ASTER GDEM v3高程数据
  5. 5Flask数据库
  6. python_socket登陆验证_明文
  7. 正则表达式-获取Json属性值
  8. linux 进程间通信 共享内存 shmat
  9. 有名管道FIFO进程间数据传输实例
  10. 开发IDE的一些设置