Important alert: (current site time 7/15/2013 7:36:00 PM EDT)
 

winzip icon

Decrypt MS SQL 2000 stored procedures of ANY SIZE!

Email
Submitted on: 11/5/2002 3:03:54 AM
By: Alexander Polozov 
Level: Advanced
User Rating: By 10 Users
Compatibility: SQL Server 2000
Views: 17550
 
     This MS Access application will decrypt Stored Procedures encrypted using "with encryption" option. If automatic removing of "with encryption" option fails user will asked to manually modify the source of SP. The source of SP must start with “ALTER PROCEDURE” instead of “CREATE”. In case of any problems all uncommitted changes will be rolled back. But remember: 7 backups is much more better as 6 !!!.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
11/5/2002 11:04:45 AMJoseph Gama

Excellent work! 5*
(If this comment was disrespectful, please report it.)

 
3/5/2003 3:32:26 PM

This looks like a great a tool but I'm getting an error. Error: Syntx Error!!! stored procedure (procedurename) failed!
(If this comment was disrespectful, please report it.)

 
3/6/2003 3:34:14 AMAlexander Polozov

You can get an error message if source of Your SP begins with comments section and it contains word "CREATE".
My program tries to automatically replace first entry of this word by "ALTER".
I didn't make syntax parsing for SQL therefore this replacement can be performed in comments.
You must just edit source of SP in appeared window to replace
"CREATE STORED PROCEDURE" with "ALTER STORED PROCEDURE" and to check if "WITH ENCRYPTION" option exists.


(If this comment was disrespectful, please report it.)

 
3/20/2003 5:15:54 PM

Great job!!
(If this comment was disrespectful, please report it.)

 
7/26/2003 6:11:59 AM

It work very good on my PC!
Great!
(If this comment was disrespectful, please report it.)

 
10/6/2003 4:35:56 AM

It worked find.
By the way, is there any way to keep the procedure encrypted?
(If this comment was disrespectful, please report it.)

 
10/6/2003 9:30:45 AMAlexander Polozov

Text of SP is stored in table "syscomments" column "ctext" (varbinary (8000)) in unicode format.
If You like to hide this text You can:

1) You can remove text of SP from system table "syscomments" using:

delete c from syscomments c, sysobjects o where o.id=c.id and name='Name of SP'

2) Or You can put in this table wrong text instead of real text of SP.

update c set ctext=convert(varbinary (8000),'Hello!') from syscomments c, sysobjects o where o.id=c.id and name='Name of SP'

But don't forget to save scripts of SP in some external storage and make full backup of database before any intrusion in system catalog!!!

(If this comment was disrespectful, please report it.)

 
4/18/2005 2:29:36 AM

I tested your application. And I found that sometimes it works fine, but it doesn't in some cases.
The result was like below.
Could I get the text based result before I decide to decrypt my stored procedure.

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

ALTER PROCEDURE NP_Q_DIVPJTTot_d AS -------------------
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO


(If this comment was disrespectful, please report it.)

 
4/18/2005 12:55:08 PM

The result was like below.
What's wrong....

CREATE PROCEDURE procName AS ---------------------------------------------------------------------------------------- --


(If this comment was disrespectful, please report it.)

 
4/20/2005 4:53:23 AMAlexander Polozov

In Form_MainForm.Command2_Click exists this code:
-----------------
If Err = 3146 Then
ws.Rollback
-----------------
In my version (XP) of MSAccess
error(3146)=
(If this comment was disrespectful, please report it.)

 
4/20/2005 4:59:18 AMAlexander Polozov

error(3146)="Application-defined or object-defined error". This error occurs in case of any SQL-error. I think You have a different MSA version and another Err code.
(If this comment was disrespectful, please report it.)

 
4/20/2005 5:02:32 AMAlexander Polozov

But You can solve this problem very easy: replace all occurrences of "Err = 3146" by "Err <> 0".
(If this comment was disrespectful, please report it.)

 
2/2/2009 7:32:50 AMSUJAY

I am very Very VEry thankful.... this is really worked for me.. because the Previous IT MANAGER of our company created some post dated Procedures to Delete Imp Tables in our software.. i thank u very much... i use this Decryption and i am able to delete that F****g procedure.. now evrythng is ok.. THanks Again
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.