Decrypting MS SQL 2000 Stored Procedures
I ran across the need to decrypt some stored procedures. I’m writing an interface to a large enterprise application that the company I work for makes. I just want to see the stored procedure code so I could understand what it was doing. Everytime I asked for access to the source code it was like I was asking for emails from the white house. Finally I figured I would just have to go it alone.
So after about 5 minutes of surfing and passing by shareware products, I came across this url, Decrypt encrypted stored procedures.
I took the stored procedure and turned it into a script that would automatically decrypt the stored procedures in a database. One thing this can’t handle is decrypting stored procedures that are > 4000 characters, since they take up more the 1 row in syscomments. So for me I was able to decrypt about half of the 1300 stored procedures this application uses. Also about half the decrypted stored procedures were recreated under the id I was running the script with rather then dbo.
The logic is pretty simple to follow so I think I might spend some time and build a .net app to decrypt the stored procedures that are > 4000 characters. Don’t hold your breath though, with the stored procedures I decrypted and profiler I was figure out what I needed to figure out.
Download: decrypt.vbs