January 17th, 2010, 03:58 AM
How can I hook CreateFile Api?
I am creating a 3d-map for a game (namely: Counterstrike) and I have developed an app that encrypts it with AES. (I want to protect it from outsiders)
The problem is that this game cannot read encrypted maps so I wonder if I could hook the CreateFile function in the game and replace it with a function that would decrypt the encrypted map into memory and let the game load it from there.
It sounds complicated for me, do you think it would be difficult?
I created first a launcher that takes the encryted map file from disk, decrypts it and stores it in the harddisk (unencrypted!) so that the game can load it but it can still be easily obtained by somebody without advanced knowledge.
I know that by loading the encrypted file from disk into memory and decrypting it from there is not a memory-dumper-proof option but it will at least harden attempts to get the map.
Thanks in advance, this is my first post in here and I hope I can help many of you in this wonderful community.
More information: (not required for answer this post but in case you are interested...)
If a friend of mine wants this map, he would have to let me use his computer and execute a program that would retrieve his computer MAC, harddisk ID, etc and would create a sha256 hash of this.
I will give the AES function this HASH as the key to encrypt a unique encrpyed-Map for him in my house. Then I will give my friend the program I want to create + the unique encrypted map.
If my friend gives the map to a third party, this person will not be able to use the map at all because the Hash created by my application would be different than the one required to decrypt it properly.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!