zoukankan      html  css  js  c++  java
  • 道与魔:SqlServer存储过程/函数加/解密

     
      【IT168 服务器学院】存储过程、存储函数的加密:WITH ENCRYPTION  

      <!--[if !supportLineBreakNewLine]-->
      <!--[endif]-->
      
      CREATE procedure dbo.sp_XML_main
      
      @table_name nvarchar(260)='',
      
      @dirname nvarchar(20)=''
      
      WITH ENCRYPTION
      
      as
      
      begin
      
      ....................
      
      end
      
      go
      
      存储过程、存储函数的解密(以下是一位绝世高人编写的代码)
      

      if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_decrypt]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
      
      drop procedure [dbo].[sp_decrypt]
      
      GO
      
      /*--破解函数,过程,触发器,视图.仅限于SQLSERVER2000
      
      --作者:J9988-- All rights reserved*/
      
      /*--调用示例
      
      --解密指定存储过程
      
      exec sp_decrypt 'AppSP_test'
      
      --对所有的存储过程解密
      
      declare tb cursor for
      
      select name from sysobjects where xtype='P' and status>0 and name<>'sp_decrypt'
      
      
      declare @name sysname
      
      open tb
      
      fetch next from tb into @name
      
      while @@fetch_status=0
      
      begin
      
      print '/*-------存储过程 ['+@name+'] -----------*/'
      
      exec sp_decrypt @name
      
      fetch next from tb into @name
      
      end
      
      close tb
      
      deallocate tb
      
      --*/
      
      
      if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SP_DECRYPT]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
      
      drop procedure [dbo].[SP_DECRYPT]
      
      GO
      
      CREATE PROCEDURE sp_decrypt(@objectName varchar(50))
      
      AS
      
      begin
      
      set nocount on
      
      --破解字节不受限制,适用于SQLSERVER2000存储过程,函数,视图,触发器
      
      --修正上一版视图触发器不能正确解密错误
      
      --发现有错,请E_MAIL:CSDNj9988@tom.com

  • 相关阅读:
    基本技能训练之线程
    关于UEditor的使用配置(图片上传配置)
    PAT 乙级练习题1002. 写出这个数 (20)
    codeforces 682C Alyona and the Tree DFS
    codeforces 681D Gifts by the List dfs+构造
    codeforces 678E Another Sith Tournament 概率dp
    codeforces 680E Bear and Square Grid 巧妙暴力
    codeforces 678D Iterated Linear Function 矩阵快速幂
    codeforces 679A Bear and Prime 100 交互
    XTUOJ 1248 TC or CF 搜索
  • 原文地址:https://www.cnblogs.com/runfeng/p/271825.html
Copyright © 2011-2022 走看看