upx从零开始的使用说明-解决exe文件过大问题

upx从零开始的使用说明-解决exe文件过大问题

先看效果:

压缩效果非常可观。

从零开始的使用步骤:

在upx的github上的release里下载对应版本,并解压到任意位置。

cmd窗口中先引用到解压后的文件路径,我的是E:\upx,故cmd中代码如下:

C:\Users\Xheng1934>e:

E:\>cd upx

E:\upx>

步骤直接全部给出:

upx D:\yourfile.exe

如果要压缩的文件路径中包含空格或特殊字符,需要将路径用引号括起来:

upx "D:\your folder\yourfile.exe"

举例:

C:\Users\Xheng1934>e:

E:\>cd upx

E:\upx>upx "C:\Users\Xheng1934\Desktop\FirstGame-flappy-Xheng1934.exe"

Ultimate Packer for eXecutables

Copyright (C) 1996 - 2024

UPX 4.2.3 Markus Oberhumer, Laszlo Molnar & John Reiser Mar 27th 2024

File size Ratio Format Name

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

1428992 -> 560128 39.20% win64/pe FirstGame-flappy-Xheng1934.exe Packed 1 file.

E:\upx>upx "C:\Users\Xheng1934\Desktop\FirstGame-flappy-Xheng1934.exe"

Ultimate Packer for eXecutables

Copyright (C) 1996 - 2024

UPX 4.2.3 Markus Oberhumer, Laszlo Molnar & John Reiser Mar 27th 2024

File size Ratio Format Name

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

upx: C:\Users\Xheng1934\Desktop\FirstGame-flappy-Xheng1934.exe: AlreadyPackedException: already packed by UPX

Packed 1 file: 0 ok, 1 error.

E:\upx>

E:\upx>upx -d "C:\Users\Xheng1934\Desktop\FirstGame-flappy-Xheng1934.exe"

Ultimate Packer for eXecutables

Copyright (C) 1996 - 2024

UPX 4.2.3 Markus Oberhumer, Laszlo Molnar & John Reiser Mar 27th 2024

File size Ratio Format Name

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

1428992 <- 560128 39.20% win64/pe FirstGame-flappy-Xheng1934.exe

Unpacked 1 file.

E:\upx>

我先是压缩,再是二次压缩发现不行,因为UPX不支持对已经被UPX打包过的文件再次进行压缩。然后是解压缩。

解压缩代码:

upx -d "C:\Users\Xheng1934\Desktop\FirstGame-flappy-Xheng1934.exe"

注意:压缩后的exe文件运行时不需要解压缩就可直接运行。

相关推荐

20000mAh等于多少度电?
28365-365

20000mAh等于多少度电?

📅 08-09 👁️ 2605
执业药师考试周期为多长时间考完
365bet客服

执业药师考试周期为多长时间考完

📅 08-18 👁️ 1533
QQ会员怎么取消专属铭牌
365体育官方app

QQ会员怎么取消专属铭牌

📅 08-10 👁️ 5200
打印机如何重置更改网络连接,或者重新恢复出厂设置