Skip to main content
gamedev.net
🔒 Locked

Secure DLLs

Started by Yohomyth Jan 25, 2004 at 12:02 AM 2 replies 300+ views
Original Post
Yohomyth
Yohomyth
Is there a way to make so in a dll the executable needs to execute a specific function with specific param values before it exports anything else? Kind of like entering a password to access a web page "Solutions are not the answer." - Richard Nixon
------------------------------------------------------------"Many combilations elizagerth. I hope you see my particles." - Senor Cardgage
evolutional
evolutional
Try having all your functionality in an interface and exporting one function, a ''CreateInterface'' function which takes your key as a parameter.

If all is well, this should return a pointer to an instance of your DLL interface. If not, return null.

eg: Pseudocode follows for example


class IDllBase
{
public:
VOID AClassFunc();
VOID AndAnotherFunc();
... etc

};

(dll code)
DLL_EXPORT IDllBase *CreateInterface(.... your l33t key params etc...)
{
// do your check here

if (checks == TRUE)
{
IDllBase *pDLL = new IDllBase();
return pDLL;
}
//

return NULL;
};

Jan Wassenberg
Jan Wassenberg
If the cracker has a debugger and your code can call the DLL function, there''s basically no way you can stop him from doing what your code does. This particular scheme affords about 1 minute of protection I thought of a few schemes involving hidden function pointers set by the app differently if a debugger is present, but all of that unravels with a breakpoint in the DLL''s address space (the cracker only has to determine what is protected, and bpx that).
In short, forget it. What are you writing, anyway?
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.