保护非托管DLL免受未经授权的使用 [英] Protecting unmanaged DLL from unauthorized use

查看:138
本文介绍了保护非托管DLL免受未经授权的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要保护我的非托管(C ++)DLL免受未经授权的使用,让我展示我到目前为止所拥有的内容



1- C#application - 这是主要的应用程序,GUI发生的地方和其他一切

2- Injector C ++ DLL - 这个dll用于启动游戏并将第三个DLL注入游戏

3-助手C ++ DLL - 这是注入游戏并与C#应用程序通信的dll



一切正常,C#应用程序成功询问Injector dll注入Assistant dll和C#可以完全访问所有Assistant dll导出的函数,即使它们在不同的进程中运行



我不在乎偷看我内部的人C#程序集与反射器或其他任何东西,但我需要一些方法来保护这些DLL不被重新编译版本的C#应用​​程序或任何其他应用程序使用

我需要一些方法来检查是否C#app原来我'提供,我的意思是,一旦注入器和助手dll都加载(也许DllMain?)他们必须检查C#应用程序是否是正确的,如果没有那么他们将拒绝工作



起初我使用WinVerifyTrust API来检查C#是否已经过签名和认证,但是我知道我无法提供有效的证书来签署C#应用程序,甚至不能比较证书上的证书。 C#app和当前的DLL



所以,如果有人知道如何发布有效证书(如果可能的话,免费)或如何检查/比较强名称签名 - 我可以创建那些SNK或PFX文件 - 或任何其他方法来确保C#应用程序和/或DLL没有被修改我很高兴如果你与我分享



谢谢

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

推荐答案

这篇关于保护非托管DLL免受未经授权的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆