Under the premise of do not destroy the original encryption store, decrypt the stored procedure! (Supplement J9988)

zhaozj2021-02-08  267

Reality is a repost j9988 original

Begin Transaction? --playyuer Original EXEC SP_DECRYPT 'Appsp_test' --J9988 Original Rollback Transaction --Playyuer Original

Or: Or directly use transaction to pack J9988! Begin TransactionJ9988Rollback Transaction

/ ************* Decryption store procedure ********* ----------------------- -SQL2000 is more than 40000 ----------------- Original: J9988: J Teacher * / alter? procedure sp_decrypt (@Objectname varchar (50)) asbegin

Begin Transaction --Add by Playyuer

Declare @ Objectname1 varchar (100) Declare @ sql1 nvarchar (4000), @ SQL2 NVARCHAR (4000), @ SQL3 nVarchar (4000), @ SQL5 nVarchar (4000), @ SQL5 NVARCHAR (4000), @ sql6 nvarchar (4000), @ sql7 nvarchar (4000), @ sql8 nvarchar (4000), @ sql9 nvarchar (4000), @ sql10 nvarchar (4000)? DECLARE? @ OrigSpText1 nvarchar (4000) ,? @ OrigSpText2 nvarchar (4000), @ OrigSpText3 nvarchar (4000 ), @Resultsp nvarchar (4000) Declare? @i int, @t bigintdeclare @m Int, @ n int, @ q @ M = (select max (color) from syscomments? where id = Object_id (@Objectname)) SET @ n = 1 -?? get encrypted datacreate table #temp (colid int, ctext varbinary (8000)) insert #temp SELECT colid, ctext FROM syscomments WHERE id = object_id (@objectName) set @ sql1 = 'ALTER PROCEDURE' @Objectname 'with encryption as' --set @ SQL1 = 'alter procedure' @objectname 'with encryption as' set @ q = LEN (@ SQL1) set @ SQL1 = @ SQL1 Replicate ('-', 4000 - @ q) SELECT @ SQL2 = Replicate ('-', 4000), @ SQL3 = Replicate ('-', 4000), @ SQL4 = Replicate ('-', 4000), @ SQL5 = Replicate ('-', 4000), @ SQL6 = Replicate ('-', 4000), @ SQL7 = Replicate ('-', 4000), @ SQL8 = Replicate ('-', 4000), @ SQL9 = Replicate ('-', 4000), @ SQL10 = Replicate ('-', 4000) EXEC (@ SQL1 @ sql2 @ sql3 @ sql4 @ sql5 @ sql6 @ sql7 @ sql8 @ sql9 @ sql10) while @n <= @ mbeginSET @ OrigSpText1 = (SELECT ctext FROM #temp? WHERE colid = @ n) set @ objectname1 = @

objectname '_ t'SET @ OrigSpText3 = (SELECT ctext FROM syscomments WHERE id = object_id (@objectName) and colid = @ n) if @ n = 1beginSET @ OrigSpText2 =' CREATE PROCEDURE ' @objectName ' WITH ENCRYPTION AS '- SET @ q = 4000-len (@ OrigsPText2) set @ igsptext2 = @ igigsptext2 replicate ('-', @ q) endelsebeginset @ ptext2 = replicate ('-', 4000) end - start counterset @ i = 1 - fill temporary variableSET @resultsp = replicate (n'A ', (datalength (@ OrigSpText1) / 2)) - loopWHILE @i <= datalength (@ OrigSpText1) / 2BEGIN - reverse encryption (XOR original bogus bogus encrypted) Set @Resultsp = stuff (@Resultsp, @i, 1, nchar (substring (@ ptext1, @i, 1)) ^ ??????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????????? (substring (@ ptext2, @i, 1)) ^ ?????????????????????????????????????????????????????????????????????????????????? ??????? unicode (@ igigsptext3, @i, 1))))))))))))))) ??? set @ i = @ i 1END - DROP Original SP - EXECUTE ('Drop Procedure' @ObjectName ) - Remove Encryption - Preserve Caseset @ resultsp = Replace (@RESULTSP), 'with encryption', '') set @ resultsp = replace ((@RESULTSP), 'with encryption', '') SET @ resultsp = replace ((@RESULTSP), 'with encryption', '') if Charindex ('with encryption', Upper (@Resultsp))> 0? set @ resultsp = replace (Upper (@Resultsp), 'with encryption ',' ') - Replace Stored Procedure WITHOUT Enryptionprint @ resultsp - Execute (@Resultsp) set @ n = @ n 1ENDDROP TABLE #Tempendrollback Transaction --Add by Playyuergo

/ * Suitable for 40000 characters. Every time 4000 Print comes out, it has been posted. Remember: I have seen the solution to destroy the original process. Be sure to back up before cracking !!!! More than 40000, self plus SQL (I use SQL.SQL2 - SQL10), long, can add SQL11 - SQL20 ........ * /?

转载请注明原文地址:https://www.9cbs.com/read-1086.html

New Post(0)