sql2000存储过程解密_第1页
sql2000存储过程解密_第2页
sql2000存储过程解密_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、create PROCEDURE sp_decrypt(pchkpasswordrule varchar(50 AS begin set nocount on -CSDN:j9988 copyright:2004.07.15 -V3.2 -破解字节不受限制,适用于SQLSERVER2000存储过程,函数,视图,触发器 -修正上一版"视图触发器"不能正确解密错误 -发现有错,请E_MAIL:CSDNj9988 begin tran declare pchkpasswordrule1 varchar(100,orgvarbin varbinary(8000 declare sq

2、l1 nvarchar(4000,sql2 varchar(8000,sql3 nvarchar(4000,sql4 nvarchar(4000 DECLARE OrigSpText1 nvarchar(4000, OrigSpText2 nvarchar(4000 , OrigSpText3 nvarchar(4000, resultsp nvarchar(4000 declare i int,status int,type varchar(10,parentid int declare colid int,n int,q int,j int,k int,encrypted int,numb

3、er int select type=xtype,parentid=parent_obj from sysobjects where id=object_id(pchkpasswordrule create table #temp(number int,colid int,ctext varbinary(8000,encrypted int,status int insert #temp Select number,colid,ctext,encrypted,status FROM syscomments Where id = object_id(pchkpasswordrule select

4、 number=max(number from #temp set k=0 while k<=number begin if exists(select 1 from syscomments where id=object_id(pchkpasswordrule and number=k begin if type='P' set sql1=(case when number>1 then 'Alter PROCEDURE '+ pchkpasswordrule +''+rtrim(k+' WITH ENCRYPTION AS

5、 ' else 'Alter PROCEDURE '+ pchkpasswordrule+' WITH ENCRYPTION AS ' end if type='TR' begin declare parent_obj varchar(255,tr_parent_xtype varchar(10 select parent_obj=parent_obj from sysobjects where id=object_id(pchkpasswordrule select tr_parent_xtype=xtype from sysobjec

6、ts where id=parent_obj if tr_parent_xtype='V' begin set sql1='Alter TRIGGER '+pchkpasswordrule+' ON '+OBJECT_NAME(parentid+' WITH ENCRYPTION INSTERD OF Insert AS PRINT 1 ' end else begin set sql1='Alter TRIGGER '+pchkpasswordrule+' ON '+OBJECT_NAME(par

7、entid+' WITH ENCRYPTION FOR Insert AS PRINT 1 ' end end if type='FN' or type='TF' or type='IF' set sql1=(case type when 'TF' then 'Alter FUNCTION '+ pchkpasswordrule+'(a char(1 returns b table(a varchar(10 with encryption as begin insert b select a

8、 return end ' when 'FN' then 'Alter FUNCTION '+ pchkpasswordrule+'(a char(1 returns char(1 with encryption as begin return a end' when 'IF' then 'Alter FUNCTION '+ pchkpasswordrule+'(a char(1 returns table with encryption as return select a as a' e

9、nd if type='V' set sql1='Alter VIEW '+pchkpasswordrule+' WITH ENCRYPTION AS Select 1 as f' set q=len(sql1 set sql1=sql1+REPLICATE('-',4000-q select sql2=REPLICATE('-',8000 set sql3='exec(sql1' select colid=max(colid from #temp where number=k set n=1 wh

10、ile n<=CEILING(1.0*(colid-1/2 and len(sql3<=3996 begin set sql3=sql3+'+' set n=n+1 end set sql3=sql3+'' exec sp_executesql sql3,N'sql1 nvarchar(4000, varchar(8000',sql1=sql1,=sql2 end set k=k+1 end set k=0 while k <=number begin if exists(select 1 from syscomments wh

11、ere id=object_id(pchkpasswordrule and number=k begin select colid=max(colid from #temp where number=k set n=1 while n<=colid begin select OrigSpText1=ctext,encrypted=encrypted,status=status FROM #temp Where colid=n and number=k SET OrigSpText3=(Select ctext FROM syscomments Where id=object_id(pch

12、kpasswordrule and colid=n and number=k if n=1 begin if type='P' SET OrigSpText2=(case when number>1 then 'Create PROCEDURE '+ pchkpasswordrule +''+rtrim(k+' WITH ENCRYPTION AS ' else 'Create PROCEDURE '+ pchkpasswordrule +' WITH ENCRYPTION AS ' end

13、if type='FN' or type='TF' or type='IF' SET OrigSpText2=(case type when 'TF' then 'Create FUNCTION '+ pchkpasswordrule+'(a char(1 returns b table(a varchar(10 with encryption as begin insert b select a return end ' when 'FN' then 'Create FUN

14、CTION '+ pchkpasswordrule+'(a char(1 returns char(1 with encryption as begin return a end' when 'IF' then 'Create FUNCTION '+ pchkpasswordrule+'(a char(1 returns table with encryption as return select a as a' end if type='TR' begin if tr_parent_xtype='

15、V' begin set OrigSpText2='Create TRIGGER '+pchkpasswordrule+' ON '+OBJECT_NAME(parentid+' WITH ENCRYPTION INSTEAD OF Insert AS PRINT 1 ' end else begin set OrigSpText2='Create TRIGGER '+pchkpasswordrule+' ON '+OBJECT_NAME(parentid+' WITH ENCRYPTION FOR

16、 Insert AS PRINT 1 ' end end if type='V' set OrigSpText2='Create VIEW '+pchkpasswordrule+' WITH ENCRYPTION AS Select 1 as f' set q=4000-len(OrigSpText2 set OrigSpText2=OrigSpText2+REPLICATE('-',q end else begin SET OrigSpText2=REPLICATE('-', 4000 end SET i=1 SET resultsp = replicate(N'A', (datalength(OrigSpText1 / 2 WHILE i<=datalength(OrigSpText1/2 BEGIN SET resultsp = stuff(resultsp, i, 1, NCHAR(UNICODE(substring(OrigSpText1, i, 1 (UNICODE(substring(OrigSpText2, i, 1 UNICODE(substring(OrigSpText3, i, 1 SET i=i+1 END set orgvarbin=ca

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论