轻聆月下
轻聆月下
发布于 2024-03-24 / 6 阅读
0
0

使用UPX压缩可执行程序

一、UPX简介

UPX is a free, secure, portable, extendable, high-performance executable packer for several executable formats.

UPX 是免费、安全、可移植、可扩展、高性能的可执行打包器,适用于多种可执行格式。

二、用途

最重要的用途是可以大幅减少可执行程序的尺寸,另一方面也为软件破解增加了一点点(几乎没有)难度。

三、用法

# 压缩 executablefile 文件,将覆盖原文件
upx executablefile

# 压缩 executablefile 文件,压缩后的文件输出到 executablefile.compressed
upx executablefile -o executablefile.compressed

# 压缩 executablefile 文件,压缩等级 9 (数字1-9.数字越大压缩越狠)
upx -9 executablefile

# 压缩 executablefile 文件,使用最强压缩
upx --best executablefile

四、压缩性能

测试版本 UPX 3.95

压缩等级原文件大小压缩后大小压缩率测试命令
默认189426056 (181M)67595628 (65M)35.68%upx exefile -o exefile_comp
1189426056 (181M)80921512 (78M)42.72%upx -1 exefile -o exefile_comp
9189426056 (181M)66614928 (65M)35.17%upx -9 exefile -o exefile_comp
best189426056 (181M)65324480 (63M)34.49%upx --beat exefile -o exefile_comp

就缩减可执行程序的尺寸来说,还是很优秀的。


评论