Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / DRM and bytecod.byc, TIER 1

Author
Message
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 24th Aug 2017 09:38
I have a question about DRM. If I use some DRM on on the EXE file (which is the AGK2 player), can't users just grab an un-protected version of the AGK2 player and then run the game with the un-protected player and bytecode.byc from the original installation?
13/0
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 24th Aug 2017 23:16
yes. You could prove this yourself easily enough.

Why would you want to mess with the player? It's probably not allowed anyway.

Instead, apply whatever it is to the byc file. I'm not sure what method you are using tho..

easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 25th Aug 2017 04:07 Edited at: 25th Aug 2017 04:08
Quote: "Why would you want to mess with the player? It's probably not allowed anyway"


I think it might be... After all we have the Visual Studio project for the player to compile ourselves.

In fact just thinking about that... It's a possible solution to Cybermind's problem. Just modify your bytecode (add a single character to the start or something) to make it corrupted, and modify your own version of the player to load your corrupted bytecode file properly

No idea if it'll work but it's worth a shot

You should find the interpreter code here: C:\Program Files (x86)\Steam\steamapps\common\App Game Kit 2\Tier 2\apps\interpreter

In interpreter.cpp you have the following code:


ProgramData.cpp contains the LoadBytecode function which you could modfy to load your custom code.

Obviously this won't stop any dedicated crackers from getting to your software, but it will mean they can't just replace your AGK.exe with their own version

My Games - Latest WIP - My Website: Immortal.Digital - FB - Twitter
130,000 installs with AppGameKit and counting
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 25th Aug 2017 08:45 Edited at: 25th Aug 2017 08:46
Quote: "Instead, apply whatever it is to the byc file."

I have to apply the DRM to the EXE file.

@easter bunny, thank you! I will look into this
13/0
Supertino
7
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 25th Aug 2017 10:27 Edited at: 25th Aug 2017 10:28
You could maybe use a wrapper to package everything into a single .exe such as http://www.boxedapp.com/exe_bundle.html (not used it my self)
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 25th Aug 2017 12:21
@Supertino: It costs $399, that is too much for my budget :-P
13/0
Supertino
7
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 25th Aug 2017 12:35
ha never looked at cost, probably some others out their though.
easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 25th Aug 2017 13:37
Just a thought, AppGameKit includes the functionality to unzip password protected zips right? You could store your .byc in a password protected zip and unzip it on launch (by modifying the code the way I suggested before)

My Games - Latest WIP - My Website: Immortal.Digital - FB - Twitter
130,000 installs with AppGameKit and counting
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 25th Aug 2017 13:59
Unless it was added in the last update, AppGameKit can not read from password protected zip files, it has been requested though.
easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 25th Aug 2017 14:47
Quote: "Unless it was added in the last update, AppGameKit can not read from password protected zip files, it has been requested though"


Ah okay, my bad. Just thought I remembered seeing a password parameter for the unzip function.


My Games - Latest WIP - My Website: Immortal.Digital - FB - Twitter
130,000 installs with AppGameKit and counting
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 25th Aug 2017 15:35
@easter bunny, couldn't I just include the bytecode.byc in the player code instead of loading it at that line that looks for the bytecode.byc? Then re-compile that player with an updated bytecode.byc every time I alter the code?
13/0
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 26th Aug 2017 00:04 Edited at: 26th Aug 2017 00:04
@Cybermind : i have posted something and that should help you

https://forum.thegamecreators.com/thread/220361
--------------------------------
Join us on dedicated AppGameKit WeeKChat :
https://week.chat/room/AppGameKit
easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 26th Aug 2017 06:54
Quote: "@easter bunny, couldn't I just include the bytecode.byc in the player code instead of loading it at that line that looks for the bytecode.byc? Then re-compile that player with an updated bytecode.byc every time I alter the code?"


Darnit why didn't I think of that? Much simpler than all the ideas I had lol

My Games - Latest WIP - My Website: Immortal.Digital - FB - Twitter
130,000 installs with AppGameKit and counting
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 26th Aug 2017 15:42
@MikeMax, I will try to include the bytecode in the player, well, first I will try that :-P If I can't work that out, it is great to have a back up plan, thanks!

@easter bunny, do you know how to include the bytecode? Have the compiler read it and embed it in the player code at compile time, somehow?
13/0
easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 26th Aug 2017 17:23 Edited at: 26th Aug 2017 17:26
Quote: "do you know how to include the bytecode? Have the compiler read it and embed it in the player code at compile time, somehow"

The only way I can think of doing it would be to include the bytecode file as a resource.

Here's some links on using resources in C++, a simple google search can find you heaps more:
http://msdn.microsoft.com/en-us/library/aa381054(VS.85).aspx
http://stackoverflow.com/questions/2933295/embed-text-file-in-a-resource-in-a-native-windows-application
http://msdn.microsoft.com/en-us/library/y3sk7e6b.aspx
http://stackoverflow.com/questions/4344486/how-to-load-text-file-from-resources-in-vc

Now the problem is how to actually read the resource as the bytecode file. The easy way would be to write the resource to an actual file named bytecode.byc on runtime and load it the normal way. The problem with that is people can then access the file while the program is running.
Looking over C:\Program Files (x86)\Steam\steamapps\common\App Game Kit 2\Tier 2\apps\interpreter\ProgramData.cpp (in the method int ProgramData::LoadBytecode( const char* filename ) at line 164), it looks like the bytecode file is actually read using the standard AppGameKit file commands (ReadInteger(), ReadFloat() etc).
So what I suggest is you write your own class that can mimic the behaviour of the AppGameKit file commands, but read from a resource instead of a file.

Basically just this:
1. Embed .byc in your exe as a resource
2. Write your own class that has four methods (OpenToRead, ReadInteger, ReadData, Close, since those are the only four methods used by LoadBytecode as far as I can see) which behave exactly the same as AGK:cFile, but load from a stream instead of a file
3. Replace the line AGK::cFile oBytecode; (line 126) with your own class (eg LoadFromResource Bytecode;)
4. ???
5. PROFIT!

My Games - Latest WIP - My Website: Immortal.Digital - FB - Twitter
130,000 installs with AppGameKit and counting
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 26th Aug 2017 20:47 Edited at: 26th Aug 2017 20:48
@easter bunny, thank you very much! I will look into this on monday. I don't know a whole lot on C++ but I will learn what I need, and what you just gave seems like what I need to get started. Again, thank you!
13/0
easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 28th Aug 2017 07:57
Don't thank me yet haha, still don't even know if it'll work

My Games - Latest WIP - My Website: Immortal.Digital - FB - Twitter
130,000 installs with AppGameKit and counting

Login to post a reply

Server time is: 2024-11-24 09:52:36
Your offset time is: 2024-11-24 09:52:36