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 :)
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!
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.
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.