Decrypting MS SQL 2000 Stored Procedures

Posted by shawn on June 19th, 2008

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

Previous Articles

Fading

Posted by shawn on April 10th, 2008

Bundling

Posted by shawn on March 24th, 2008

Reader Options

Posted by shawn on March 2nd, 2008

Article Look and Feel

Posted by shawn on March 2nd, 2008

Added Techmeme

Posted by shawn on March 2nd, 2008

Added Digg stats to unread articles

Posted by shawn on January 23rd, 2008

Posted a video

Posted by shawn on January 21st, 2008

Exiting the Twilight Zone

Posted by shawn on January 15th, 2008

Fav.or.it

Posted by shawn on December 10th, 2007

Welcome to Tubejumper

This a project blog highlighting the development of the RSS Reader I'm building for myself.