Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


GameGuard's string encryption

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
azfk
Cheater
Reputation: 0

Joined: 26 May 2009
Posts: 37

PostPosted: Sun Jul 26, 2009 3:11 pm    Post subject: GameGuard's string encryption Reply with quote

I've recently unpacked gameguard (I think at any rate) and now i'm wondering how can i decrypt their strings

Code:

if ( CryptAcquireContextA(&hProv, 0, "Microsoft Base Cryptographic Provider v1.0", 1u, 0xF0000000u) )
        {
          if ( CryptImportKey(hProv, &pbData, 0x54u, 0, 0, &hKey) )
          {
            NumberOfBytesWritten = 0;
            CryptEncrypt(hKey, 0, 1, 0, 0, &NumberOfBytesWritten, 0);
            v25 = NumberOfBytesWritten;

That was a chunk shown by IDA Hex-rays, well, I have no clue what to do now, I'm just looking into the cryptography provider for more info atm.

If anyone has suggestions, it would be appreciated
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sun Jul 26, 2009 9:19 pm    Post subject: Reply with quote

There is one function that is called a ton of times..

it takes one parameter.

Look for calls to 3 functions, whose parameter is a pointer to char buffer, whose first byte is 01.

then load up the file in a program you write, and scan for all the calls, then find the pushes in front, and grab the return from it.

there are your decrypted strings.
Back to top
View user's profile Send private message
azfk
Cheater
Reputation: 0

Joined: 26 May 2009
Posts: 37

PostPosted: Mon Jul 27, 2009 9:16 pm    Post subject: Reply with quote

lol ok, lemme try to straighten the methodology here,

one function is called a lot of times, (simple, will see this function called again and again)

this function takes one parameter, presumably something simple like

Code:

push blah
call blahblah


3. Look for calls to 3 functions, whose parameter is a pointer to char buffer, whose first byte is 01.

Does this relate to the first 2 steps? Or are there 3 functions called in sequence one after the other, and the parameters are a pointer to a char buffer whose byte is 01?

4. then load up the file in a program you write, and scan for all the calls, then find the pushes in front, and grab the return from it.

wouldn't just running this in olly and watching the char buffer be simpler?

P.S. is this called like 150x times? since there are loads of detected strings?
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Jul 27, 2009 10:57 pm    Post subject: Reply with quote

There are 3 functions which are all called a bunch of times.

Decrypted strings (which are pushed before the calls) all start with the byte 01.

Scan for the calls to these 3 functions, then look for the addresses of the char buffs, and call it yourself. The return pointer will be in eax.

(The way i did it used a function pointer, but the first version used asm)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites