1、Cheat Engine 6.2 Tutorial Step 9 教程作者:NGKillerGmail.Com 原创。 转载请注明作者!第 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 typeOften when youve found health of a unit or your own player, you will find that if you remove
2、 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 its a team number, or a
3、 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 luckThe 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)/pl
4、ayer 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
5、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 playersIn this tutorial I have implemented the most amazing game you will ever pla
6、y.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 healthTo continue, press “Restart game and autoplay“ to test that your code is correctTip: Health is a f
7、loat(生命值是一个浮点数据)Tip2: There are multiple solutions下面先用 CE 加载进程,并查询浮点数 1002点击教程中的 Attach 减少数值,然后加入变化的搜索结果。同理查找 500(浮点)并点击 Attach,加入敌人的 HP 数值段,如下(不同电脑地址可能不同!):右击 P1,选择:什么改写了这个地址。点击教程中 Player1 处的 Attach,调试窗口出现如下变化点详细信息,打开图中红色就是改写的代码,意思是将 eax 中的数值写入ebx+04 这个地址指向的地址,注意用“ ”括起来的地址是一个指针,指向另一个地址。这里我们记住偏移量是+0
8、4,后面解析数据时要用到回到 CE 主窗口,点击任一一个地址,选择:浏览相关内存区域,会发现都指向 250C6 这个地址(不同电脑地址可能不同!) 。说明当攻击敌人或者队友时,都是通过同一个程序调用输出数值(为什么可以用同一个程序调用指向不同的地方?因为 ebx 可以存储不同的位置指针,所以可以指向不同的地方,这个学过编程就明白了)到这里,我们就要开始分析数据了,这是最重要的一个环节。在内存查看器窗口中点击工具-解析资料、结构这里要把先前查询到的 4 个地址都填写进去(不同电脑地址可能不同!) ,用来分析这 4 组数据有什么共同、不同点,然后为自动注入代码做准备。回到 CE 主窗口,看到这 4
9、 个地址在结构分析窗口,点击文件-加入额外的地址,再加 3 个,一同是 4 个,分别将先前的 4 个地址填写进去,记得前面我让你记住的偏移量吗?是+04(不同电脑偏移地址可能不同!) ,这里要注意把这个偏移量减掉结构分析窗口还可以进行分组,这个自己尝试,我们将敌我分 2 个组,最终效果见图:点击结构-定义新的结构,一路点确定(3 个对话框) ,开始结构分析。当看到这个窗口,相信大家已经有了大概的修改框架,如图,玩家的名字、以及队伍分组(现在只能是猜测) ,都一目了然,这里要注意,我们要记下玩家分组的偏移量是10,即+10(不同电脑偏移地址可能不同!) ,这个是区别队友与敌人的标识,当然目前来说
10、是我们的猜测,但实际上确实如此。这里大家也许有个疑问,为什么要在地址后面-04 呢?那么用 player1 举例说明。我们回头来看:什么改写了这个地址窗口-详细。如图,打开 Windows 自带的计算机,选择程序员类型,改为十六进制,计算机一下 018B7FE8+04=018B7FEC,你能看出什么?这里你要懂一些编程方面的知识了。如果把一个人物的信息用编程语言来表示,那么就应该有如下结构:struct peoplestring name;float life;这里,当一个结构开始,偏移量为 0,name 的偏移量+2,life 的偏移量 +4,依次类推,往后就是偏移量+数字了。这里我们看:0
11、18B7FE8 +00 开始018B7FE8 +04 =018B7FEC 血量018B7FE8 +10 组018B7FE8 +15 名字这下明白了吗?我们要从这个结构的最开始进行分析,那么就要从 018B7FE8 开始,而这个怎么得来呢?从018B7FEC-04 就可以了。其他玩家也是一样的。但在游戏中可能要比这个复杂得多,因为这个教程本来就是面向初学者,再不多说。下面我们就开始代码注入,进行修改并完成这个教程。这里有 2 种方法。先说一种比较简单的。现在我们已经确定,250C6 这个地址(不同电脑地址可能不同!)是把计算的结果显示出来的,那么我就可以在这里下手进行判断,如果是队友,那么就不执
12、行这个操作,直接用 nop 代替不做任何事,如果是敌人就按原来的代码执行,减去血量。在内容查看窗口,选中 250C6 这一行,然后选择工具-自动汇编,然后选择模板-代码注入,弹出的对话框点确定。自动生成的代码如下,我的说明是蓝色字体:alloc(newmem,2048) /2kb should be enoughlabel(returnhere)label(originalcode)label(exit)newmem: /this is allocated memory, you have read,write,execute access/place your code here 这里开始写
13、我们的代码originalcode: 原始代码是这个,要注意下面有个 fldz,如果自己写代码,最后一句要把这个加上,至于为什么下面说明mov ebx+04,eaxfldz exit:jmp returnhere“Tutorial-i386.exe“+250C6:jmp newmemreturnhere: 最后从这儿退出下面是我写的代码,说明继续为蓝色(如果复制的话请把蓝色字全删除掉) 。alloc(newmem,2048) /2kb should be enoughlabel(returnhere)label(originalcode)label(exit)newmem: /this is
14、allocated memory, you have read,write,execute access/place your code herecmp ebx+10,1 对比组,记得分析窗口里的偏移量吧,+10 是组,队友是 1,敌人是 2je exit 如果是队友,则跳转到 exit 处originalcode: 如果不是队友而是敌人,上面的 je 不会跳转,会继续执行这儿mov ebx+04,eax 原始的语句,让他减血fldzjmp returnhere 跳转退出exit: 队友的话会跳转到这儿nop 什么也不做(即不减血)fldz 这个要加上,为什么加上,可以在注入后查看内存查看器窗
15、口中,250C6 下面的那一行在注入后消失了!而这一行的代码就是 fldz 为了不使程序出错,这一句一定要手动加上jmp returnhere 跳转退出,返回原程序继续执行“Tutorial-i386.exe“+250C6:jmp newmemreturnhere: 注入代码结束位置点击运行,然后返回教程点击 Restart game and Autoplay,会看到自己的队友不减血而敌人一会儿就挂了。下面说第 2 种注入方法。先来考虑一种情况,如果要队友、敌人减血,那么至少应该有一个“减”运算操作吧,那么我们在内存查看器窗口中,从 250C6 处往上翻,如果没有程序调用(call *这样的代
16、码) ,那么往上第一个减运算一定是减血操作了。我们往上看,到 2509D(不同电脑地址可能不同!)这儿果然看到了 fsubr(这代表什么意思请自觉汇编语言):好了,现在开始另一种注入方法,直接改写这儿的代码,如果是敌人就减血,如果是自己的队友就加血,而且可以实现一击必死(直接减敌人 100W 的血,他不死才怪) 。选中 2509D 这一行,点工具- 自动汇编,然后点模板-代码注入。这里直接上我自己写的代码并附解释:alloc(newmem,2048) /2kb should be enoughlabel(returnhere)label(originalcode)label(exit)newm
17、em: /this is allocated memory, you have read,write,execute access/place your code herecmp ebx+10,1 判断是否是队友je exit 如果是队友则跳转到 exit 处,否则继续往下执行originalcode: 原始语句fsubr dword ptr ebx+04 如果是敌人,直接减血fstp dword ptr ebp-30jmp returnhere 减血完毕,返回原程序exit: 如果是队友来到这儿fadd dword ptr ebx+04 改 fsubr 为 fadd,执行加血命令fstp d
18、word ptr ebp-30jmp returnhere 加血完毕,返回原程序“Tutorial-i386.exe“+2509D:jmp newmemnopreturnhere: 返回原程序好了,点击 Restart game and autoplay,看到如下结果,队友不仅没减血,而且还加血了。搞定!如何实现一击必死呢?可以参考如下代码,是 CE 论坛上找到的,不做说明,自己看吧。/Made by svchost with Cheat Engine 6.2 RC 1/4th May, 2012ENABLEalloc(StoreHealthAddress,2048)label(StoreHe
19、althAddressReturn)alloc(WriteHealthAddress,2048)label(WriteHealthAddressReturn)globalalloc(Player1_Dave,4)globalalloc(Player2_Eric,4)globalalloc(Enemy1_Hal,4)globalalloc(Enemy2_Kitt,4)label(WriteOrignal)label(IsPlayer1_Dave)label(IsPlayer2_Eric)label(IsEnemy1_Hal)label(IsEnemy2_Kitt)/-/ Read And Sto
20、re Address For Later Comparison/-/At “tutorial-i386.exe“+2504C address, ebx is constant for Health Address Calculation“tutorial-i386.exe“+2504C:jmp StoreHealthAddressnopnopnopnopnopnopStoreHealthAddressReturn:StoreHealthAddress:/From below I calculated Manually Health Address/And stored at the Custo
21、m Address/Note:-For Health address, add 4 to it. eg.add Player1_Dave,4/means value at the Player1_Dave is the Health Address.push ecxmov ecx,ebx+49C / Offset-49C Player1mov Player1_Dave,ecxpop ecxpush ecxmov ecx,ebx+4A0 / Offset-4A0 Player2mov Player2_Eric,ecxpop ecxpush ecxmov ecx,ebx+4A4 / Offset-
22、4A4 Enemy1mov Enemy1_Hal,ecxpop ecxpush ecxmov ecx,ebx+4A8 / Offset-4A8 Enemy2mov Enemy2_Kitt,ecxpop ecx/From below it is orignal code at the “tutorial-i386.exe“+2504Cmov ebx,eaxmov esi,edxmov ebp-3C,00000000jmp StoreHealthAddressReturn/-/ Write Address/-/At this Address Friendly as well as Enemy He
23、alth is Decreasing“Tutorial-i386.exe“+250C6:jmp WriteHealthAddressWriteHealthAddressReturn:/Now Im checking the Health address For each player seperately.WriteHealthAddress:cmp ebx,Player1_Daveje IsPlayer1_Davecmp ebx,Player2_Ericje IsPlayer2_Ericcmp ebx,Enemy1_Halje IsEnemy1_Halcmp ebx,Enemy2_Kittj
24、e IsEnemy2_Kittjmp WriteOrignaljmp WriteHealthAddressReturn/-IsPlayer1_Dave:mov ebx+04,(float)99999fldzjmp WriteHealthAddressReturnIsPlayer2_Eric:mov ebx+04,(float)99999fldzjmp WriteHealthAddressReturnIsEnemy1_Hal:mov ebx+04,(float)0fldzjmp WriteHealthAddressReturnIsEnemy2_Kitt:mov ebx+04,(float)0fl
25、dzjmp WriteHealthAddressReturn/-WriteOrignal:mov ebx+04,eaxfldzjmp WriteHealthAddressReturnDISABLEdealloc(StoreHealthAddress)“tutorial-i386.exe“+2504C:mov ebx,eaxmov esi,edxmov ebp-3C,00000000dealloc(WriteHealthAddress)“Tutorial-i386.exe“+250C6:mov ebx+04,eaxfldz注意上面的偏移地址有所不同,要记得按自己的实际情况来修改。第 8 关、 9 关视频教程下载地址 (下载后设置下载地址为其他颜色即可查看):下载地址http:/ Gmail.Com 原创。 转载请注明作者!