增加有效字节黑客攻击难度的可能策略

发布于 2024-09-24 14:06:08 字数 711 浏览 0 评论 0原文

我被要求修复虚幻系列游戏中的一些小缺陷。它使用 unrealscript 语言,以与 Java 类似的方式生成字节码。

问题之一是可以编辑下载到客户端的任何包并插入 goto 指令来跳过重要的代码位。

这是不可能阻止的,所以我想知道可以应用什么样的策略来使任务变得更加困难。我想到了两种方法:

  1. 针对客户端的任何内容的自动内部状态检查机制。这 完成的方法是对每个进行前后检查 函数调用。该语言的一个特点是函数中的 out 关键字。

    <块引用>

    指定的“out”可以让你告诉 它实际上应该具有的功能 修改传递给的变量 它,而不是制作本地副本。 这很有用,例如,如果您 有一个需要返回的函数 给调用者几个值。你可以 只需让调用者传递几个 函数的变量是 “输出”值。

  2. 服务器端检查机制,如果发生不连贯的情况或 有一个超时。显然,代码不能每次都在客户端和服务器之间反弹 勾选是因为它会产生开销,但可能会有一些 例如,每 x 秒交换一次信息。

    也许这两种方法可以结合起来。您对此有何看法?

I've been asked to patch a few minor flaws in a game of the unreal series. It uses the unrealscript language which produces bytecode in a similar way to Java.

One of the issues is that it's possible to edit any packages downloaded to a client and insert a goto instruction to jump over important bits of code.

It isn't possible to prevent this so I'm wondering what sort of strategies could be applied to make the task more difficult. There's two approaches that come to mind:

  1. An automatic internal state checking mecanism for anything that is clientside. The
    way it be done would be to have a before and after check for each
    function call. One peculiarity of the language is the out keyword in functions.

    The "out" specified lets you tell a
    function that it should actually
    modify the variable that is passed to
    it, rather than making a local copy.
    This is useful, for example, if you
    have a function that needs to return
    several values to the caller. You can
    just have the caller pass several
    variables to the function which are
    "out" values.

  2. A serverside checking mecanism that takes action if something incoherent happens or
    there is a timeout. Obviously, code can't be bounced between the client and server every
    tick because of the overhead it would generate but it would be possible to have some
    information exchanged, say, every x seconds.

    Perhaps the two approaches could be combined. What is your opinion on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱的十字路口 2024-10-01 14:06:08

如果目的是确定任何代码是否已更改,那么直接的解决方案是对代码进行校验和(例如在初始化时,甚至更早,例如在下载之前),并定期验证代码的校验和是否未更改。

那么问题就变成了检测校验和检查代码是否未被黑客攻击。

作为一名黑客,我唯一一次被击败的是一个昂贵的软件包,其目标代码使用了从代码中看似随机的不同点调用的五个以上校验和例程。弄清楚如何解决这个问题比解决问题更麻烦。只需确保使用不同的函数初始化每个校验和,但使初始化的调用难以追踪。在初始化过程中连续执行所有这些操作非常容易被击败。

If the purpose is to determine if any of the code has changed, then the straightforward solution is to checksum the code (like at initialization—or even earlier, like before being downloaded) and periodically verify that the code's checksum hasn't changed.

Then the problem becomes detecting whether the checksum checking code hasn't been hacked.

The only time I was defeated as a hacker was an expensive package with the target code using more than five checksum routines called from seemingly random different points in the code. It was more trouble than it was worth to figure out how to work around it. Just be sure to initialize each of the checksums using a different function but make the call of the initialization hard to track down. Doing all of them in a row during initialization makes it really easy to defeat.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文