从 SQL Server 检索 CLR DLL
是否可以重建或检索您之前导入到 SQL 中的 VB CLR dll 文件? 我已经能够通过执行以下操作找到此 DLL 的内容:
SELECT * FROM sys.assemble_files
但我不知道是否可以使用内容重建 dll在那里找到的。
任何帮助将不胜感激:)
Is it possible to rebuild or retrieve a VB CLR dll file which you've imported into SQL some time ago?
I've gotten to the point where I was able to find the contents of this DLL by doing:
SELECT * FROM sys.assembly_files
but I don't how if it's possible to rebuild the dll with the contents found there.
Any help would be very appreciated :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这里有一个很好的例子。以下代码来自提供的链接。
我应该想象 .NET Reflector 将成为您对提取的 DLL 进行逆向工程的朋友,但我不知道它是否以任何方式加密。
There is a very good example here. The following code comes from the link provided.
I should imagine .NET Reflector will be your friend in reverse-engineering the DLL once extracted, but I have no idea if it's encrypted in any way.
我终于想通了。
我添加了一个新的程序集来处理 DLL 的创建:
之后我添加了我的过程来使用它:
然后我运行我的过程并为其提供保存文件的路径和程序集的名称:
确保您对您保存文件的位置拥有写入权限,然后就可以了!
I finally figured it out.
I've added a new assembly which handles the creation of the DLL:
After that I add my procedure to consume it:
And then I run my procedure and give it the path to save my file and the name of the assembly:
Make sure you have writing rights to the location you're saving your file, and there you go!
我最终这样做了。
我获得了要为其生成 dll 的 CLR 程序集的创建脚本。
删除起始“0x”字符串后,我使用 C# 将十六进制值 (some_hex_value) 转换为字节。 SO 上也有用于将十六进制转换为字节的 LINQ 示例。
我将字节写入文件系统。
我使用ILSpy来查看dll源代码。
I ended up doing this.
I got the create script for the CLR assembly for which I want to generate the dll.
I converted the hex value (some_hex_value) to bytes using C# after removing the starting "0x" string. There are LINQ examples on SO too for converting hex to bytes.
I wrote the bytes to the file system.
I used ILSpy to look into the dll source.