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

复制内容到剪贴板

代码:

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

可通过带 -h 命令参数,获取更详细的帮助:

复制内容到剪贴板

代码:

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]

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/
       http://wildsau.idv.uni-linz.ac.at/mfx/upx.html

UPX的使用的更多相关文章

  1. Reverse Core 第二部分 - 14&15章 - 运行时压缩&调试UPX压缩的notepad

    @date: 2016/11/29 @author: dlive 0x00 前言 周六周日两天在打HCTF2016线上赛,没时间看书,打完比赛接着看~~ 0x01 运行时压缩 对比upx压缩前后的no ...

  2. UPX和WinUpack压缩壳的使用和脱法 - 脱壳篇06

    UPX和WinUpack压缩壳的使用和脱法 - 脱壳篇06 让编程改变世界 Change the world by program 今天小甲鱼给大家介绍两款压缩壳:UPX和WinUpack. UPX是 ...

  3. UPX 加壳工具:The Ultimate Packer for eXecutables

    UPX (the Ultimate Packer for eXecutables)是一款先进的可运行程序文件压缩器.压缩过的可运行文件体积缩小50%-70% ,这样降低了磁盘占用空间.网络上传下载的时 ...

  4. 脱壳第三讲,UPX压缩壳,以及补充壳知识

    脱壳第三讲,UPX压缩壳,以及补充壳知识 一丶什么是压缩壳.以及壳的原理 在理解什么是压缩壳的时候,我们先了解一下什么是壳 1.什么是壳 壳可以简单理解为就是在自己的PE文件中包含了代码.而有不影响我 ...

  5. 脱upx壳--初试--单步追踪

    脱upx壳--初试--单步追踪 这里的练习题目是reversing.kr 的Easy Crack 我自己用upx加壳工具给它加了个壳,由于原文件逻辑简单,所以用它来练练手 之后用到的工具是IDA和Ol ...

  6. linux下编译upx ucl

    昨天,UPX发布了3.93版本. UPX(the Ultimate Packer for eXecutables)是一个非常全面的可执行文件压缩软件,支持dos/exe.dos/com.dos/sys ...

  7. UPX脱壳全程分析(转)

    [文章标题]: UPX脱壳全程分析 [保护方式]: 本地验证 [使用工具]: OllyDBG [作者声明]: 只是感兴趣,没有其他目的.失误之处敬请诸位大侠赐教! ------------------ ...

  8. 手动脱UPX压缩壳

    示例程序演示 样例程序选择win7自带的notepad.exe,该程序原本是没有加壳的: 拷贝notepad.exe文件一个副本,重命名为notepad - upx.exe,我们对notepad - ...

  9. Android SO UPX壳问题小记

    网上有篇 Android SO(动态链接库)UPX加固指南,详细介绍了如何使用UPX给Android SO加壳,尝试做了一下结果ok,这里只记录遇到的几个小问题. 1.40k以下so不能加壳 kiii ...

  10. 简单脱壳教程笔记(2)---手脱UPX壳(1)

    本笔记是针对ximo早期发的脱壳基础视频教程,整理的笔记. ximo早期发的脱壳基础视频教程 下载地址如下: http://down.52pojie.cn/%E5%90%BE%E7%88%B1%E7% ...

随机推荐

  1. qt creator源码全方面分析(4-3)

    内外命名空间 QtCreator源码中,每一个子项目都有内外两层命名空间,一个是外部的,一个是内部的. 示例如下 namespace ExtensionSystem { namespace Inter ...

  2. 王颖奇 201771010129 《面向对象程序设计(java)》第二周学习总结

    <面向对象程序设计(java)>第二周学习总结 王颖奇 201771010129 第一部分:实验目的与要求 ①理论部分目的与要求 (1)基本知识(2)数据类型(3)变量(4)运算符(5)类 ...

  3. C# 多线程猜想

    公司分配给我一个活,让我给Kong网关做一个获取设置的站点.Kong网关号称几万的QPS的神器,我有点慌,如果因为我的站点拖累了Kong我就是千古罪人. 配合Kong的站点必须要经过性能测试,在性能测 ...

  4. 【Hadoop离线基础总结】oozie调度shell脚本

    目录 1.解压官方提供的调度案例 2.创建工作目录 3.拷贝任务模板到工作目录当中去 4.随意准备一个shell脚本 5.修改模板下的配置文件 6.上传调度任务到hdfs上面去 7.执行调度任务 1. ...

  5. Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:1099 site:blog.csdn.net

    相信你看到这个之前,已经找了很多的方法了 那么最终的解决方案应该是什么呢? 为什么之前明明跑的好好的项目,它就不行了呢?好好跑下去,它不香吗? 好了,不皮了,在我长达3个小时的奋战下,终于,自己找到了 ...

  6. [Alink漫谈之三] AllReduce通信模型

    [Alink漫谈之三] AllReduce通信模型 目录 [Alink漫谈之三] AllReduce通信模型 0x00 摘要 0x01 MPI是什么 0x02 Alink 实现MPI的思想 0x03 ...

  7. HTML简单的伪装与造假

    利用浏览器制止台能简单的修改内容,致使其造成伪装. 打开网页控制台后,不要管那些眼花撩乱的代码,我们直接寻找控制台顶部的 Tab 栏 找到 Console 这个 Tab,点击它,把代码 documen ...

  8. iNeuOS工业互联平台,实现动态图元、计算平台、远程控制、数据转发等,和大厂相比如何

    目       录 1.      概述... 2 2.      平台演示... 2 3.      增加按钮组态元件... 2 4.      组态图元旋转及动画... 3 5.      后台容 ...

  9. 小程序externalClasses介绍

    小程序externalClasses 1.介绍:我们在封装组件的时候,有时候需要对外暴露出class,可以由调用者来决定组件中一部分的样式,此时就需要使用它了 // components/dong/i ...

  10. 【雕爷学编程】MicroPython动手做(05)——零基础学MaixPy之LCD液晶屏

    配套 2.4寸LCD屏 ST7789驱动器芯片(24P 320X240) ST7789驱动器芯片2.4寸LCD屏(24P 320X240)主要参数 1. 模块名称:液晶显示模块2. 型号:KD024C ...