使用修改过的arj源码编译和测试
前文
那个arj打补丁的代码说是针对exe文件的,里面有个模式去匹配EXE文件,怪不得老是出错,但是Linux二进制文件到底要不要打补丁?
* $Id: postproc.c,v 1.5 2003/06/22 11:12:28 andrew_belov Exp $* ---------------------------------------------------------------------------* This program stores the CRC and file size of ARJ.EXE in it, so an* integrity check may be performed with ARJ i.
而他打补丁的方法居然是把文件长度和CRC校验值写入可执行文件,也真是罕见。我一来不知道Linux二进制文件的模式,二不知道校验值的算法,一定是写不对的,只能放弃。
继续在网上搜 arj和postproc.c,终于被我搜到下面这个存储库,https://github.com/joncampbell123/arj ,好巧不巧,存储库的英文说明正好是:
Cleanup of the old ARJ source code to compile cleanly on modern systems and fixes to compile on 64-bit platforms
说明有个人去针对64位系统专门去修了,共享在这里,时间也很巧。2016年,正好也是前文apt install的版本的年号。
更好的是GNUmakefile也已经生成,连前面配置步骤都免了,直接make --makefile GNUmakefile,果然前文那些错误一个都没有,但有一个新错误
upx --best ./linux-gnu/en/rs/arjsfxv/arjsfxv
make[1]: upx: No such file or directory
这个工具我认识,专门压缩可执行文件,不影响执行的,在这可有可无,把GNUmakefile中多余的upx注释掉,就好了, 编译出的arj命令行如下,和apt install的一样。
linux-gnu/en/rs/arj/arj
ARJ32 v 3.10, Copyright (c) 1998-2004, ARJ Software Russia. [01 Sep 2025]Processing archive: linux-gnu/en/rs/arj/arj
Archive created: 2025-09-01 13:01:08, modified: 2025-09-01 13:01:08List of frequently used commands and switches. Type ARJ -? for more help.Usage: ARJ <command> [-<sw> [-<sw>...]] <archive_name> [<file_names>...]
Examples: ARJ a -e archive, ARJ e archive, ARJ l archive *.doc
<Commands>ac: Add Chapter to chapter archive l: List contents of archivea: Add files to archive m: Move files to archive
再看GNUmakefile文件,也没有对arj文件打补丁的步骤,所以,CRC校验其实是不必要的?