我说的是一款没有得分上限的动作游戏,也没有办法通过重玩动作等方式来验证服务器上的分数。

我真正需要的是在Flash/PHP中最强的加密,以及一种防止人们调用PHP页面而不是通过我的Flash文件的方法。我在过去尝试了一些简单的方法,对一个分数进行多次调用,完成一个校验和/斐波那契序列等,也用Amayeta SWF加密混淆SWF,但他们最终都被黑客入侵了。

感谢StackOverflow的响应,我现在从Adobe找到了更多的信息- http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps_12.html和https://github.com/mikechambers/as3corelib -我认为我可以使用加密。但我不确定这是否能让我绕过CheatEngine。

我需要知道AS2和AS3的最佳解决方案,如果它们是不同的。

主要的问题似乎是TamperData和LiveHTTP报头,但我知道还有更高级的黑客工具,比如CheatEngine(感谢Mark Webster)


当前回答

Whenever your highscore system is based on the fact that the Flash application sends unencrpyted/unsigned highscore data via the network, that can be intercepted and manipulated/replayed. The answer follows from that: encrypt (decently!) or cryptographically sign highscore data. This, at least, makes it harder for people to crack your highscore system because they'll need to extract the secret key from your SWF file. Many people will probably give up right there. On the other hand, all it takes is a singly person to extract the key and post it somewhere.

真正的解决方案包括在Flash应用程序和高分数据库之间进行更多的通信,以便后者能够验证给定的分数是否真实。这可能很复杂,这取决于你的游戏类型。

其他回答

根据我的经验,这最好是一个社会工程问题,而不是一个编程问题。与其专注于让作弊变得不可能,不如专注于通过消除作弊动机来让它变得无聊。例如,如果主要动机是公开可见的高分,那么简单地延迟高分的显示时间就可以通过消除作弊者的正反馈循环来显著减少作弊。

你说的是所谓的“客户信任”问题。因为客户端(在这种现金中,运行在浏览器中的SWF)正在做它设计要做的事情。保存高分。

问题是,你想要确保“保存分数”请求来自你的flash电影,而不是任意的HTTP请求。一种可能的解决方案是在请求时(使用flasm)将服务器生成的令牌编码到SWF中,该令牌必须随请求一起保存高分。一旦服务器保存了该分数,令牌就过期了,不能再用于请求。

这样做的缺点是,用户每次加载flash电影只能提交一个高分——你不得不强迫他们刷新/重新加载SWF,然后他们才能再次播放新的分数。

It is only possible by keeping the all game logic at server-side which also stores the score internally without knowledge of the user. For economical and scientific reasons, mankind can not apply this theory to all game types excluding turn-based. For e.g. keeping physics at server-side is computationally expensive and hard to get responsive as speed of hand. Even possible, while playing chess anyone can match AI chess gameplay to opponent. Therefore, better multiplayer games should also contain on-demand creativity.

想要得到你想要的是不可能的。Flash应用程序的内部总是部分可访问的,特别是当你知道如何使用像CheatEngine这样的东西时,这意味着无论你的网站和浏览器<->服务器通信有多安全,它仍然会相对简单地克服。

在接受的答案中,tqbf提到你可以对分数变量进行内存搜索(“我的分数是666,所以我在内存中寻找666这个数字”)。

这是有办法的。我在这里有一门课:http://divillysausages.com/blog/safenumber_and_safeint

基本上,你有一个对象来存储你的分数。在setter中,它将您传递给它的值与一个随机数(+和-)相乘,而在getter中,您将保存的值除以随机乘数以获得原始值。这很简单,但有助于停止记忆搜索。

另外,看看PushButton引擎背后的一些人的视频,他们谈论了一些对抗黑客的不同方法:http://zaa.tv/2010/12/the-art-of-hacking-flash-games/。他们是这门课背后的灵感。