在linux下运行英雄,在 Linux 下玩《英雄无敌 3》游戏

本文详细介绍了如何解决Heroes of Might & Magic III 1.3.1补丁安装过程中的错误,包括修正tail命令参数、注释错误的校验和检查及移除无效的trap命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

下面就是我要讲的主要部分,怎么对补丁进行hack。

用vim打开heroes3-1.3.1-x86.run,搜索 +6 ,发现是作为tail的参数。 表示从文件第六行的内容。 但是这样使用参数是错误的,正确的使用方法是 tail --lines=+6 。 所以把 +6 的部分都改正为 --lines=+6 。 这样 tail: cannot open `+6' for reading: No such file or directory 的错误就消除了。

再次运行sudo sh heroes-1.3.1-x86.run,仍然有如下错误

Error in check sums 2268731580 1601210390

在heroes-1.3.1-x86.run中搜索,找到那个地方。

大概是102行,注释掉以下部分。

#[ $sum1 -ne $CRCsum ] && {

#  $echo Error in check sums $sum1 $CRCsum

#  eval $finish; exit 2;

#}

再次 sudo sh heroes3-1.3.1-x86.run ,结果如下:

Verifying archive integrity...OK

Uncompressing Heroes of Might & Magic III for Linux: patch 1.3.1

trap: 126: cd /tmp; /bin/rm -rf $tmpdir; exit $res: bad trap

搜索trap,只在一个地方出现,

[ "$keep" = y ] || trap 'cd /tmp; /bin/rm -rf $tmpdir; exit $res'

trap什么意思,我不太明白,因为下面还有一行

[ "$keep" = y ] || { cd /tmp; /bin/rm -rf $tmpdir; }

所以我认为trap这行没有实际作用,注释掉

#[ "$keep" = y ] || trap 'cd /tmp; /bin/rm -rf $tmpdir; exit $res'

保存,运行 sudo ./heroes3-1.3.1-x86.run --keep 。成了!

Verifying archive integrity...OK

Uncompressing Heroes of Might & Magic III for Linux: patch 1.3.1.....

***********************************************************************

This script will install the 1.3.1 patch for Heroes of Might & Magic III

You need an exiting installation of the game and sufficient

write access permissions to proceed.

This patch is for a x86 system

You are running a x86 system

OK !

Please enter the Heroes III installation directory [/usr/local/games/Heroes3] :

Patching heroes3 ...

Successfully upgraded Heroes III to version 1.3.1 !

Please read the file README.patch13 in /usr/local/games/Heroes3 for details about this patch.

Enjoy the game !

检验一下, heroes3 -v :

Heroes of Might and Magic III Linux 1.3.1

- Mar  7 2000

Built with flags:

-DUNIX

Built with glibc-2.1

OK,升级成功!运行 heroes3 ,不加参数,默认是全屏的。 如果要在窗口内运行,就 heroes3 -w 。

Enjoy the game!

更新: 想省事的朋友可以在这里下载我修改过的全屏补丁。0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值