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 / Is there any way to assign a c++ memory address to a memory block?

Author
Message
SkinK4ir3
9
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Posted: 4th Aug 2023 19:08
Hello everyone, I'm trying to protect my game files using own resources in the appgamekit c ++ ...
Is there any way to load a file into a c++ memory and assimilate that memory into a MemBlock Agk in c++ directly?
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 19th Aug 2023 16:14
Yes, of course. Just load the bytes of a file and use them as you want, char, uint, int ecc...
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Oct 2023 03:33
There are a few functions designed to support that generally they are CreateResourceFromMemblock()
For example CreateImageFromPNGMemblock( uint32_t imageID, uint32_t memID )
So this will create and image from a memblock. The idea being you;
1) load an encrypted file into a memblock (CreateMemBlockFromFile())
2) Decrypt it
3) Use CreateImageFromPNGMemblock() to turn it into an image

There are similar function for sounds
I'm not sure why they didn't do it for 3D models as well.

SkinK4ir3
9
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Aidan
User Banned
Posted: 20th Oct 2023 10:12
If using c++ as your main language Tier 2

I think you can call AppGameKit commands in c++ using AGk:: at the front

AGk::creatememblock........

Then use the command as you would in AppGameKit itself

I think but that's the idea and don't have any experience with doing this way
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 23rd Oct 2023 02:25 Edited at: 23rd Oct 2023 02:27
Quote: "Do these commands not convert the memblock to a 3D models ?"


That is true but it doesn't really give you an opportunity to encrypt a model like the other commands do.

I guess you could load your model, create a memblock, encrypt that and then save it to disk so yeah, that might work. I'm guessing the file might be a bit big

Login to post a reply

Server time is: 2024-11-21 12:20:17
Your offset time is: 2024-11-21 12:20:17