【CE】Mac下的CE教程Tutorial:进阶篇(第9关:共享的代码)

🛫 导读

开发环境

版本号描述
文章日期2023-03-
操作系统MacOS Big Sur 11.5
Cheat Engine7.4.3

1️⃣ 第9关:共享的代码

在这里插入图片描述

翻译

Step 9: Shared code: (PW=31337157)
This step will explain how to deal with code that is used for other object of the same type

Often when you've found health of a unit or your own player, you will find that if you remove the code, it affects enemies as well.
In these cases you must find out how to distinguish between your and the enemies objects.
Sometimes this is as easy as checking the first 4 bytes (Function pointer table) which often point to a unique location for the player, and sometimes it's a team number, or a pointer to a pointer to a pointer to a pointer to a pointer to a playername. It all depends on the complexity of the game, and your luck

The easiest method is finding what addresses the code you found writes to and then use the dissect data feature to compare against two structures. (Your unit(s)/player and the enemies) And then see if you can find out a way to distinguish between them.
When you have found out how to distinguish between you and the computer you can inject an assembler script that checks for the condition and then either do not execute the code or do something else. (One hit kills for example)
Alternatively, you can also use this to build a so called "Array of byte" string which you can use to search which will result in a list of all your or the enemies players
In this tutorial I have implemented the most amazing game you will ever play.
It has 4 players. 2 Players belong to your team, and 2 Players belong to the computer. 
Your task is to find the code that writes the health and make it so you win the game WITHOUT freezing your health
To continue, press "Restart game and autoplay" to test that your code is correct

Tip: Health is a float
Tip2: There are multiple solutions

9关:共享的代码
这一步将解释如何处理使用相同类型对象的代码。

当你发现单位或你自己的玩家的健康时,如果你删除代码,它也影响敌人。
在这种情况下,您必须找出如何区分您和敌人对象的代码。

有时,这很容易检查前4个字节(函数指针表),这通常指向玩家的唯一位置,有时它是团队号码,或指向玩家名称的指针的指针。这一切都取决于游戏的复杂性以及您的运气。

最简单的方法是找到你找到的代码写入的地址,然后使用解剖数据功能比较两个结构。(你的单位/玩家和敌人),然后看看你是否可以找到一种方法来区分它们。

当你找到如何区分你和计算机时,你可以注入一个汇编脚本,检查条件,然后选择不执行代码或做其他事情。(一击杀死等例子)

另一种方法是使用这个来构建一个所谓的“字节数组”字符串,你可以使用它来搜索,这将导致您或敌人玩家的列表。

在这个教程中,我实现了你将曾经玩的最令人惊叹的游戏。
它有4个玩家。2个玩家属于您的团队,2个玩家属于计算机。

您的任务是找到代码写入健康,使您赢得游戏而不冻结您的健康。
要继续,按“重新启动游戏和自动播放”来测试您的代码是否正确。

提示1:健康是浮点数
提示2:有多种解决方案

操作

  1. 定位4个健康值的地址。
    单浮点、精确值,多次扫描,定位4个玩家的健康值地址。
    在这里插入图片描述
  1. 分析4个健康值访问代码。
    分别攻击4个玩家,查看什么地址访问了这4个健康值。
    在这里插入图片描述
  1. 分析4个对象的标识(用于区分我方和敌方)
    3.1 在《Memory Viewer》窗口中,选择《工具 -> Dissect data/structures》菜单
    在这里插入图片描述
    3.2 结构分析窗口中,新建玩家对象结构体
    在这里插入图片描述
    3.3 在《结构分析》对话框中,额外新增3个地址,并将4个玩家的地址放入4个编辑框中。
    在这里插入图片描述
    3.4 分析
    在下图中,找到对象不同的属性(红色的几组数值),其中有偏移0x14中可以分为两组(1和2),可以用于区分我方和敌方。
    在这里插入图片描述
  1. 编写代码注入,保证我方获胜(检测到是我方对象,不掉血)
    4.1 在地址"tutorial-x86_64"+2CDD9创建代码注入模板。
    在这里插入图片描述
    4.2 在newmem: 标签下增加下面代码:
cmp [rbx+0x14], 1
je exit

4.3 将脚本添加到地址表
在这里插入图片描述

5 按照如下步骤验证
在这里插入图片描述
通关,撒花。
在这里插入图片描述

🛬 文章小结

操作步骤中,代码注入有多种实现方案,除了我们实现的方案检测到是我方对象,不掉血,我们还可以

  • 检测到是敌方对象,血量清零。
  • 检测到是我方对象,增加血量。

📖 参考资料

ps: 文章中内容仅用于技术交流,请勿用于违规违法行为。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜猫逐梦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值