挂钩 mscorlib (System.Security.Cryptography.CryptoStream) 以记录参数
我想记录赋予应用程序中 CryptoStream 对象的参数,以在加密之前记录明文。
我想动态地执行此操作,而不篡改原始文件。有没有办法在应用程序和框架之间创建一个“层”来拦截所需的函数调用,将所需的参数写入文本文件,然后将控制权传递回框架?
如果是的话,你能给我指出正确的方向,并提供一个样本吗?
对于那些对此有法律顾虑的人(这听起来像是 as/w 破解问题,我知道;)): 我已获得开发商的许可才能这样做。
I want to log the parameters which are given to a CryptoStream object in an application, to log the plaintext before it is encrypted.
I want to do this dynamically, without tampering with the original file. Is there a way to create a "layer" between the app and the framework to intercept the desired function calls, write the desired parameter to a text file, and then pass control back to the framework?
If yes, could you point me in the right direction, and give a sample?
And for those who have legal concerns about this (this sounds like a s/w cracking question, I know ;) ) :
I have the permission of the developer to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您可以编写特定的调试器或特定的分析器来做到这一点。以下是CLR 托管调试器 (mdbg) 示例 4.0 以及指向 适用于 .NET Framework 的 CLR 探查器的链接4(源代码和二进制文件)
I think you can do it either writing a specific debugger or a specific profiler. Here is a link to the CLR Managed Debugger (mdbg) Sample 4.0 and a link to the CLR Profiler for .NET Framework 4 (sources and binaries)
有几种方法可以在不破坏原始文件的情况下执行此操作:
1.使用 SSCLI,使用 clix.exe 启动应用程序并在 CLR 源代码中设置断点。
2.使用Windbg+SOS.dll从MS加载符号,在方法入口处设置断点。
3.第三种方式是黑帽会议中的新方式。修改MS的system.*.dll。使其成为 MSIL 并在 Crypto 方法中添加一些 IL。并将其构建回 dll 并让应用程序使用它。
There are several ways to do this without tampling the original file:
1.Using the SSCLI, use clix.exe to start your application and set break points in CLR source code.
2.Using Windbg+SOS.dll and load the symbols from MS, set breakpoints before the method entry.
3.the third way is new in blackhat converence. modify the system.*.dll of MS. make it to MSIL and add some IL in the Crypto method. and build it back to dll and make the application use it.