Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
2.67/5 (2 votes)
See more:
I need to protect my unmanaged (C++) DLLs from unauthorized usage, let me show what I have so far

1- C# application - this is the main application, where the GUI takes place and everything else
2- Injector C++ DLL - this dll is used to start a game and inject the third DLL into the game
3- Assistant C++ DLL - this is the dll that is injected to the game and communicate with the C# application

Everything is working as desired, the C# application successfully ask the Injector dll to inject the Assistant dll and the C# has full access to all Assistant dll exported functions even though they run at separated processes

I don't care about people peeking inside my C# assembly with reflector or anything else, but I need some way to protect those DLLs from being used with a recompiled version of the C# app or any other application
I need some way to check if the C# app is the original I've provided, I mean, once both Injector and Assistant dlls are loaded (maybe DllMain?) they MUST check if the C# app is the right one, if not then they will refuse to work

At first I used the WinVerifyTrust API to check if the C# is signed and certified, it worked but then I realized that I can not provide a valid certificate to sign the C# application and not even to compare the certificates on the C# app and the current DLL

So, if anyone know how to emit a valid certificate (for free, if possible of course) or how to check/compare strong name signatures - I can create those SNK or PFX files - or any other method to ensure that the C# application and/or the DLLs were not modified I'd be pleased if you share with me

Thanks
Posted
Updated 24-Jul-14 13:28pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900