Posted: Thu May 16, 2024 2:43 pm Post subject: Protecting unreleased content behind a const boolean?
So I have a game developer friend who was telling me about his game yesterday. He has a free demo you can play, but the rest of the content remains locked until you buy the full version. But what he was telling me was that the only difference between the free demo and the full version is that the demo has a const binary value (DemoMode) that he switches from true to false at compile time. This value is checked by code before loading levels to determine whether it will permit you to enter. I was like "That can't be secure" and I've been thinking about it ever since.
Here are some thoughts I had:
-Brute force change every value of one to zero and try clicking the button for locked content. (Dangerous)
-Reverse engineer Gamemakers level format and just force it to load the unreleased levels without checking the const.
-Find the code that checks the const value and inject something there to bypass it. (Need to find the value first, which is tricky when a value doesn't change)
He told me to go ahead and try to hack it because it's harder than it sounds, and I haven't been able to immediately for like the two hours I've been trying so hey maybe he's right. Does anyone have any thoughts or strategies to tackle this kind of problem?
Good statically compiled languages can omit code depending on whether or not it's used. This can take into account expressions evaluated at compile time.
e.g. C++:
Code:
void bar();
int main(int, char**) {
if (false) {
bar();
}
return 0;
}
No code is generated in `foo` that relates to `bar`. The compiler doesn't even complain `bar` isn't defined.
Your "brute force" method is ridiculous. You have no idea how many "1" values there are, there's no guarantee a boolean is even expressed as 0 for false and 1 for true (typically any non-zero value is true), and you don't know the semantics the developer gave the bool ("isDemo" vs "isFullVersion"- maybe you need to change false to true instead)
"Just reverse engineer the game" is far more complicated than you think. It's sort of like saying you'll "just build a rocket to the moon." You need years of knowledge and experience to even understand what that entails.
Changing code would be the easiest thing you could do... assuming that code exists in the first place and wasn't optimized away.
Do you know what programming language / game engine is being used? _________________
I don't know where I'm going, but I'll figure it out when I get there.
There are tools designed for reverse engineering game maker games. Maybe there's something for the version he's using.
In any case, no, this isn't a good way of enforcing a demo version of your game. Hell, the average crackme has better security than that. If you're really interested, start looking up tutorials for those. Maybe consider doing that in a VM if you start downloading random binaries from strange sites. _________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum