Archived

This topic is now archived and is closed to further replies.

Yohomyth

Secure DLLs

Recommended Posts

Yohomyth    108
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

Share this post


Link to post
Share on other sites
evolutional    1393
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;
};

Share this post


Link to post
Share on other sites
Jan Wassenberg    999
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?

Share this post


Link to post
Share on other sites