QT load .dll but not calling resolve returns false
-
Hi, was curious and l looked at your .DLLs, 2 problems I saw:
After doing a library.resolve("?SetKey@CRockCrypto@RockBase@@QAEXPBD000@Z") you end up with a function pointer that works fine for calling that function directly. However you want to cast it into non-static pointer-to-member function and a reinterpret_cast<> of it I think will not suffice, it's still only a GetProcAddress() type of function pointer :-( A pointer-to-member function pointer is usually just an offset into a vtable or something similar, also compiler dependent.
Another problem: if you disassemble the loaded functions you'll see that the first thing that the "SetKey..." function does is trash its this pointer (move ecx,esi) and call another Crypto function. Not very C++ friendly, most likely this is some kind of assembly obfuscation going on. It's a game library after all...
-
I created a fake lib and header with my console app, and just called the functions normally and was able to get the application to do what i want.
The Dll calls a function called Cleanup which trash the this pointer. To bypass this if you setkey to the decKey2 and it doesn't call this function keeping it in tacked. After you call SetKey you call the RockBase::CRockCrypto::Decrypt(void*, int) function that runs through aes cryto that decrypted a encrypted buffer base on size of buffer.
This is just a old old game (2007) .dll that uses aes encryption decryption on packets.
-
Here are the 2 dll's maybe you can get them to work for me? Thanks for your help.
@Sunfluxgames said in QT load .dll but not calling resolve returns false:
Here are the 2 dll's maybe you can get them to work for me?
I can't, sorry. I don't have windows currently, nor do I use MSVC when building on windows, besides I have a lot of work of my own currently.
-
Qloadlib working properly as load library.
as i know dll without header can't use exported function directly,need to look the function & how to use exported function properly.