如何防止虚假的高分出现在全局高分列表中? [英] How can you prevent bogus high scores from appearing on a global high score list?

查看:97
本文介绍了如何防止虚假的高分出现在全局高分列表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您正在设计一款跟踪高分的PC游戏.除了保持本地得分外,还设置了一个全球高分服务器,游戏可以通过互联网访问该服务器.玩家应该在完成游戏后或之后从其本地高分列表中将其高分提交到全局高分列表.这一定是一个普遍的问题.现代游戏机上的街机游戏通常具有这样的全局高分列表.

Suppose you are designing a PC game that keeps track of high scores. In addition to keeping local scores, a global high score server is set up that is accessed by the game over the internet. Players should be able to submit their high scores to the global high score list right after they have completed a game, or later, from their local high score list. This must be a common problem; arcade games on modern game consoles often feature a global high score list that works like this.

我的问题可以归结为:如何阻止某人提交虚假的高分?或者,换句话说,全球高分服务器如何确保提交的分数确实是由在游戏中奔跑吗?

My question boils down to: how can you prevent someone from submitting bogus high scores? Or, stated another way, how can the global high score server be sure that a submitted score was really produced by a run through the game?

我对这个问题的思考越多,我认为这可能是一个无法解决的问题.

The more I thought about this, the more I think it may be an unsolvable problem.

您通常会执行以下操作来验证源自某个特定来源的邮件是否已对该来源进行了数字签名.在这种情况下,您当然可以这样做,但是真正的问题是,播放器通过拥有该软件也具有该软件的私钥.不管它多么混乱,都可以对其进行逆向工程,甚至可以从内存中拔出.

What you'd commonly do to verify that a message originated from a certain source is have the source digitally sign the message. You could certainly do that in this case, but the real problem is that the player, by having the software, also has the software's private key. No matter how obfuscated it might be, it can be reverse engineered, or even just plucked from memory.

另一种选择是将玩家游戏的重播发送到高分服务器,高分服务器将快速运行重播并验证提交的分数与重播结果匹配.这不能解决问题,但是如果您还必须制作一个非常复杂的重放来证明"这一点,那么肯定会更难伪造高分.

Another option would be to send along a replay of the player's game to the high score server, which would quickly run the replay and verify that the submitted score matches the outcome of the replay. This doesn't solve the problem, but it certainly makes it more difficult to forge a bogus high score if you also have to produce a very complex replay that "proves" it.

这是一个可以解决的问题,还是真的无法解决?家用游戏机开发人员是否使用技术来防止这种利用,还是只是依靠游戏机来防止未经授权的代码运行?

Is this a problem that has a solution, or is it really unsolvable? Are there techniques used by the home game console developers to prevent this sort of exploit, or do they simply rely on the console preventing unauthorized code from running?

推荐答案

对于由客户端生成得分的PC游戏,这不是一个可解决的问题,因为客户端本质上是不可信的.

For a PC game where the score is generated by the client, this is not a solvable problem since the client is inherently untrustworthy.

您唯一可以尝试做的就是使某人更难以提交假分数.

The only thing you can try to do is make it harder for someone to submit a fake score.

一些想法:

  • 保护内存得分. 您可以使用 CryptProtectMemory 之类的API将分数隐藏在内存中-简单的内存写入将不起作用.但是,使用附加的调试器或通过将代码注入到您的过程中,他们仍然可以修改分数.您可以研究各种尝试击败调试器的方案.

  • Protect the in-memory score. You can use API's like CryptProtectMemory to hide the score in memory - a simple memory write will not work. However, with an attached debugger or via injecting code into your process, they could still modify the score. You can look into various schemes for trying to defeat debuggers.

在路线途中保护分数到服务器. 您可以按照建议的方式对发送到服务的数据进行加密,但是由于不受信任的一方可以控制密钥,因此这仅仅是混淆,不能提供可靠的保护.

Protect the score en-route to the server. You can encrypt the data being sent to the service, as you suggest, but since the untrusted party has control over the key, this is merely obfuscation and offers no solid protection.

在服务中验证分数. 除了非常简单的检查之外,我不愿意这样做.这里的错误会导致您拒绝有效分数.不可能区别作弊者和强者.

Validate the score at the service. I'd be loathe to do this, beyond very simple checks. A bug here will result in you rejecting valid scores. It'll be impossible to distinguish between cheaters and strong players.

在这一点上,您真的必须问自己,工程工作是否真的值得.如果有人发布了无效分数怎么办?您实际上失去了什么?我会尽力做到最低限度,用简单的脚本保护孩子.也就是说,您提交的分数不只是:

At this point, you really have to ask your self if the engineering effort is really worth it. What if someone posts an invalid score? What do you actually lose? I would do the bare minimum to protect against a kid with a simple script. I.e., don't have your score submission be just:

http://myservice.com/submitscore.aspx?PlayerName=Michael&Score=999999999

我只是在内存中使用简单的保护措施来防止偶然的监听,在线上进行一些简单的混淆(将分数与服务器cookie哈希在一起)就可以了.

I would just use simple protection in memory against casual snoops, some simple obfuscation on the wire (hash the score with a server cookie) and be done.

这篇关于如何防止虚假的高分出现在全局高分列表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆