WEB开发网
开发学院数据库MSSQL Server 怎样对SQL Server 2005存储过程解密 阅读

怎样对SQL Server 2005存储过程解密

 2008-05-09 09:55:40 来源:WEB开发网   
核心提示: GROUP BY imageval--select @maxColID as 'Rows in sys.sysobjvalues'select @procNameLength = datalength(@procedure) + 29DECLARE @real_01 nva

GROUP BY imageval

--select @maxColID as 'Rows in sys.sysobjvalues'

select @procNameLength = datalength(@procedure) + 29

DECLARE @real_01 nvarchar(max)

DECLARE @fake_01 nvarchar(max)

DECLARE @fake_encrypt_01 nvarchar(max)

DECLARE @real_decrypt_01 nvarchar(max),@real_decrypt_01a nvarchar(max)

select @real_decrypt_01a = ''

-- 从sys.sysobjvalues里提出加密的imageval记录

SET @real_01=(SELECT imageval FROM sys.sysobjvalues WHERE objid =

object_id(@procedure) and valclass = 1 and subobjid = 1 )

--创建一个临时表

create table #output ( [ident] [int] IDENTITY (1, 1) NOT NULL ,

[real_decrypt] NVARCHAR(MAX) )

--开始一个事务,稍后回滚

BEGIN TRAN

--更改原始的存储过程,用短横线替换

SET @fake_01='ALTER PROCEDURE '+ @procedure +' WITH ENCRYPTION AS

'+REPLICATE('-', 40003 - @procNameLength)

EXECUTE (@fake_01)

--从sys.sysobjvalues里提出加密的假的

SET @fake_encrypt_01=(SELECT imageval FROM sys.sysobjvalues WHERE objid =

object_id(@procedure) and valclass = 1 and subobjid = 1)

SET @fake_01='CREATE PROCEDURE '+ @procedure +' WITH ENCRYPTION AS

'+REPLICATE('-', 40003 - @procNameLength)

--开始计数

SET @intProcSpace=1

--使用字符填充临时变量

SET @real_decrypt_01 = replicate(N'A', (datalength(@real_01) /2 ))

上一页  1 2 3 4 5 6 7  下一页

Tags:怎样 SQL Server

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接