|
[原创]对韩国原装X游戏的服务器端及客户端加固
知道。也做过。 我做过增Section,和Loader Start-Debug-Process/Attach-Debug-Running-Process/Remote-Inject-Process/Replace-Dll 等方案,也做过从驱动下手的方案。 在做这个方案的时候,经过慎重考虑,选择了精简目标程序的指令并移动汇编、HardCoding Patch的这个方案。这种方案跨平台(Windows/Linux)能力比较强,而且干脆利落,不拖泥带水。但是难点在于前期开发,后期维护相对容易,使得我可以将注意力放在程序的逻辑上,并且能作到反反复复地调试,不用放在具体的细节或框架上。 坛子里有些同学可能以为我走了条弯路,把简单问题复杂化了,其实我走的不是弯路,是一条相对不太好走的直路。 大段地修改汇编,并不一定会让bin文件执行错乱,像VMP/TMD,对被保护的函数,也是将函数Body移动得到处都是,一块一块地散乱放着,并且用一大堆的跳来连接,有真跳,有变形跳。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
inline hook, deep hook。用detour做,或者自己jmp copy前N指令,再jump回去,这些应该算是基本功吧,坛子里应该很多兄弟都懂,我也不例外。 我之所以选择大段汇编代码优化移动,有我的道理。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
假如你需要搬到别处的部分代码,也是个相对jmp/call/内存引用呢?你还是需要修正。 |
|
|
|
[原创]对韩国原装X游戏的服务器端及客户端加固
是的,相对优化移动代码及修正jmp/call/内存引用来说,创建新Section容易多了。 我在1楼的末尾增了1个例子,能说明在这种情况下优化代码插入patch的必要性,在我的例子中,只增Section不移动代码,是不行的。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
在第1楼后面部分,我举了个例子,说明优化函数,省出空间,添加我们patch的必要性。请大家去看看。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
[QUOTE=nbw;756555]给PE文件增加大小,网上很多工具,我5年前用汇编写过一个,你需要的话我给你翻翻老文件。 大体思路就是首先用 SetEndOfFile 函数在文件最后面添加需要的空字节数,然后根据添加的字节内容,修改相应的PE节区。修改节区的时候,可以新增一个节区信息,也可以修改以前节区属性。 不过这都是传统思路,对你这种讲究效率的高手来说,用你的UE打开文件,进入16进制编辑模式,转到文件最后,手工输入00,想输多少输多少,然后保存,关闭,搞定! linux下的文件没研究过,不过原理应该差不多。虽然说server有np保护,但考虑到你都任意在文件里进行优化了,我也就不说np下修改文件的问题了。 [/QUOTE] 不得不承认,nbw就是幽默。先是在14楼说“你说你用工具改改几下就行了,是不是有点夸大其辞了?”,把我说得那么轻巧,接着在45楼说“用你的UE打开文件,进入16进制编辑模式,转到文件最后,手工输入00,想输多少输多少”,又把我说成了苦力。您真幽默。 呵呵,和你开个玩笑,别介意。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
是的。所以,我对bin文件的patch,不但在调试的时候,需要1天几十次地、反反复复地修改,运行。而且即使在发布后,针对恶意外挂(不鄙视外挂,只是需要和恶意外挂做斗争)也要反复地改进,所以,写个工具来自动优化函数、调整函数空间、省出多余空间、patch多个点,是很有必要的。 如果是添加Section,反倒没必要。因为目标bin的函数优化后,空间已经足够。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
OK,那请你说说,假如你增个Section,添加该添加的代码,修改该修改的代码的具体步骤,用什么现成软件,假如是自己写的,说出大概流程(不用程序代码)。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
假如你仔细看我的文章及回复的话,你会发现“我已经说了这么做的必要性” |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
这位老兄, 1:我已经说了“空间足够,没必要加Section”了 2:这近300处改动,是分布在20多个函数里的,和我直接HardCoding在里面比起来,你用dll,对整个事情有什么提高,对工作效率提高多少?没有。 3:即使用了dll或so,不还是照样需要WriteProcessMemory吗?和我直接HardCoding在bin里,有什么区别吗?有什么提高吗?没有。 不可否认,在改动很小的情况下,例如只改动个3,5处(爆破),UltraEdit很好用。 在改动的函数很少,而改动的代码很多的情况下,例如改1个函数,为其增加100K内容,那么写个dll或so,很好用。 但本案例说的是改动很多,而且改动点分布在很多个函数,并且有足够空间的情况,所以,请大家注意这个大环境前提。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
那你吹一篇给大家看看吧。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
[QUOTE=foxabu;756323]mov eax,eax lea esi,[esi+0] 很早就讲过了,这是编译器优化的边际对齐代码,优化处理器缓存用的。 楼主自作聪明了吧。 当然了,仅仅是为了minimize binary size就当我没说。[/QUOTE] 呵呵,我知道,align |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
虚函数,及jmp table也可处理,但目前空间已够,所以没有进一步的调整。 举个例子来说,假设funcA省出的空间为freeA,100个字节,funcB省出的空间为freeB,200个字节,我们可以在freeA放95个汇编指令,接着1个长jmp跳到freeB,还可以再放入195个汇编指令,经过这么操作,完全没有必要将原程序所有定位都打乱。 (当然,以上操作不是手工完成的,是程序完成的,如果手工完成的话,我非疯了不可) |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
X是个韩国游戏,得过很多奖项,据公开资料,其几年前的代理费为500万美元。韩国开发团队的软件工程效率很高,政 府也出面组织引擎共享,代码复用,所以,如果你逆向了多个韩国游戏,你会发现他们的代码复用率很高,当然,正如我们调侃某人考试作弊一样:“你抄就抄了,怎么把别人名字也写在自己考卷上了?”是的,多数韩国游戏连bug都很相似。 从他们代码复用的角度来说,有些bug,是他们这些软件工程中的蓝领工人解决不了的,已经超出了他们知识范畴了。所以我们经常发现,韩国合作伙伴改bug的能力非常低,1个bug几年都改不了也是正常的。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
你可能觉得“改改二进制”,改不出什么名堂,不能加太多功能进去,所以觉得要么是我夸大了bug,要么就是在吹牛,没能力改那么多地方。 根据我程序的统计,每个函数精简后,可以cut掉4%到16%不等的大小。假设文件为2M呢,3M呢?你想想看,能不能实现复杂功能,够不够实现? 希望本案例能改变你的思路。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
20年前,我听说牛人把游戏改了,从最后1关开始打,倒着打到第一关,也以为是不可能实现的事情。 你可能觉得我的文章没贴出大段的汇编不过瘾,但你不觉得我文章的思路比大段汇编更有意义吗? 有些Idea,不是我1个人的,况且我要保护我客户的利益,所以我不可能贴出具体汇编或具体解决方法。不用激将,我有原则。 而且我也没说这个项目做了多长时间完成。我更没有说“用工具改改几下就行了”。不知道是不是你搞错了?我通篇都没说这个任务很轻松,恰恰相反,我说了需要改动的地方太多,如果用UltraEdit手工改,很累,所以我自己写了工具,提高效率。提供1个思维与大家共享。 有时候,换个思维思考问题,我们不能仅仅满足于现有的现成的一些工具,像IDA,OD,SoftICE,ExeScope,ImportREC。 其实,用工具的人,和写工具的人视野是完全不一样的。 当我们自己会写这些工具的时候,你会发现有很多“不可能完成的任务”也有可能完成了。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
韩国开发团队的软件工程效率很高,政 府也出面组织引擎共享,代码复用,所以,如果你逆向了多个韩国游戏,你会发现他们的代码复用率很高,当然,正如我们调侃某人考试作弊一样:“你抄就抄了,怎么把别人名字也写在自己考卷上了?”是的,多数韩国游戏连bug都很相似。 看完我之前说的这句话,你应该有思路了吧?不好意思,不能说太细了。 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
谢谢你的关心,不过我发现你还是没仔细看我的文章,可能是我的文章写得还不够好。 1:谢谢你对那6个问题所提出的自己的观点。可见你在这些方面也有相当深的研究。 2:window上可执行程序是exe/com/dll/sys,PE结构,linux上文件扩展名没有强制要求,文件结构也不是PE,是ELF结构。 3:我解决了6个问题,不是只解决了第6个问题。有些问题不是孤立的,是有联系的。 另外,我对这些程序的改动,不是像你想象的那样,用UltraEdit逐个字节写入,那样太累,所以你建议我用高级语言写程序,直接hook在关键点。 谢谢你的建议,但是我有更好的方法: 我对bin的改进,是自己写了个程序,能自动将我写的汇编代码,直接嵌入到合适的位置(该增的增,该改的改,该删的删,该跳的跳),这也相当于用高级语言写程序一样的方便,而我又能将目标程序的汇编优化整理出足够的空间,所以完全没有必要另外写个拖泥带水的程序。 如果用UltraEdit逐个字节加入,当修改规模大到一定程度的时候,会出现以下问题: 1:在我们尝试修正的时候,我们很难控制各个测试版本是否会混乱。 2:假设A bug的修正集合是改动了5处,B bug的修正集合是改动了6处,显然,在不断的尝试中,我们会因为这些修正的组合错误或改动点的不小心错误,带来更大的问题。 3:可能因为修正A bug引入A+ bug, 而我采用自己写个程序,能自动修改PE/ELF文件,自动嵌入汇编代码的方式,能从高级语言的视角去看整体的改进,所以即使改动很大,从思维上也能控制整个程序的改进,不会版本错乱,而且降低修正某bug带来新bug的可能性 |
|
[原创]对韩国原装X游戏的服务器端及客户端加固
拿不到Server的bin程序,也能让Server崩溃,这点不用怀疑。 我说的(轻则。。。重则。。。),是从逻辑上表示问题的严重性,并不表示一定能发生或容易发生。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值