Decrypt ASP source code.

zhaozj2021-02-16  69

Download the ASP source code from the Internet, ready to learn research. One opens the file, the book is very book. It is very depressed: (I found a way to understand the secret method online, I have a file to open a file , Copy, paste, decrypt, replicate, then paste, save ... If an ASP program has hundreds of files???

The solution is coming ..

Decode.asp

<% @ Language = "javascript"%> <%

/ * * --------------- Decode.asp ----------------- * Function: Traverse all files in a directory, Decrypt the encrypted .asp file * and write in the source file. * Instance: Single file Decryption * Response.write (Server.MAppath ("Conn.asp")))); * Instance: Directory All Document decryption. * DNCodeFolderfiles (Server.MAppath ("XML")) * Author: Wanghr100 (Gray Beans Baby .NET) * Update: 2004-5-17 11:31 * ------------ --- Decode.asp ----------------- * /

Function DNCODEFILE (SFILEPATH) {/ * * --------------- DNCodefile (sfilepath) ----------------- * DNCodefile (sfilepath) * Function: Open the file sfilepath, encode decryption, rewritten the file. * Parameters: sfilepath, string, path path. * Return: SfilePath, file path. * Instance: response.write (server.mappath " Conn.asp ")))))); * Author: Wanghr100 (Gray Beans Baby .NET) * Update: 2004-5-17 0:58 * -------------- DNCODEFILE (SFILEPATH) ----------------- * / var forreading = 1, forwriting = 2, forting = 8; var fso = server.createObject ("scripting.filesystemObject"); var f = fso .OpenTextFile (sFilePath, ForReading, true); sFileText = f.ReadAll (); f.Close (); sDncodeText = strdec (sFileText) var f = fso.OpenTextFile (sFilePath, ForWriting, true); f.Write (sDncodeText) F.close (); // Return SDNCODETEXT; RETURN SFILEPATH;

Function getfilespath (sfolderpath) {/ * * --------------- GetFileSpath ----------------- * getFileSpath (SfolderPath) * Function: Traverse all files in the SfolderPath directory. Return to array. Storage file path. * Parameters: sfolderpath, string, directory absolute path. * Instance: response.write (GetFilesPath ("XML"))) Update: 2004-5-12 8:33 * Author: Wanghr100 (Gray Beans Baby .NET) * --------------- GetFileSpath (SfolderPath) --------- -------- * / var sFilePath = new Array (); var fso = Server.CreateObject ( "Scripting.FileSystemObject"); var oFolder = fso.GetFolder (sFolderPath); var oSubFolders = oFolder.SubFolders; var Ofiles = ofolder.files; iCount = Ofiles.count; var enmfiles = new enumerator (;); for (;! enmfiles.atext (); enmfiles.movenext ()) {sfilepath [sfilepath.length] = enmfiles.Item () .Path}

Var enmfolders = new enumerator; for (;! enmfolders.atend (); enmfolders.movenext ()) {/ * OLD number sets a multi-dimensional. * / //sfilepath[sfilepath.length]=getfilespath (ENMFolders.Item () .Path); / * Add 2004-5-17 11:09 is only for one-dimensional array * / sfilepath = sfilepath.concat (enmfolders.Item (). PATH);}

Return sfilepath;

}

Function getFileType (sfilename) {/ * * --------------- GetFileType (sfilename) ----------------- * getFileType (sfilename) * Function: By suffix, obtain SFileName file type. * Parameters: sfilename, string, file name. * Instance: response.write (GetFileType ("decode.asp")) * Update: 2004-5-13 8:33 * Author: wanghr100 (Gray Beans Baby .NET) * --------------- GetFileType (SFileName) ----------------- * / SfileName = String (sfilename); returnamename.split (".") [sfilename.split ("."). Length-1];}

/ * START Decryption Implementation: Li Huihuang Start * / Function Screncode (S, L) {ENC = New ActiveXObject ("scripting.encoder"); return enc.Encodescriptfile ("." L, S, 0, L "cript" ); var state_copy_input = 100 var state_readlen = 101 var state_decode = 102 var state_unescape = 103 var pick_encoding = new Array (1, 2, 0, 1, 2, 0, 2, 0, 0, 2, 0, 2, 1) , 0, 2, 0, 1, 0, 2, 0, 2, 1, 0, 2, 0, 0, 2, 1, 1, 0, 2, 0, 2) , 0, 1, 0, 2, 1, 0, 2, 0, 1, 1, 2, 0, 0, 1, 1, 2, 0, 1, 0 , 2) Var Rawdata =

New Array (0x64, 0x37, 0x69, 0x50, 0x7e, 0x2c, 0x22, 0x5a, 0x72, 0x4a, 0x3a, 0x5b, 0x5e, 0x79, 0x66, 0x5d, 0x59, 0x75, 0x5b, 0x27,0x4c 0x42, 0x76, 0x76, 0x23, 0x62, 0x2a, 0x65, 0x4d, 0x43, 0x5f, 0x51, 0x33, 0x7e, 0x52, 0x42, 0x4f, 0x52, 0x20, 0x52, 0x20, 0x63, 0x7a 0x26, 0x4a, 0x21, 0x54, 0x5a, 0x46, 0x71, 0x38, 0x20, 0x2b, 0x32, 0x26, 0x2a, 0x57, 0x2a, 0x7f, 0x6c, 0x76,0x7f, 0x2b, 0x47,0x7b 0x46, 0x25, 0x30, 0x52, 0x2c, 0x31, 0x4f, 0x29, 0x6c, 0x3d, 0x69, 0x49, 0x70, 0x3f, 0x3f, 0x7b, 0x3f, 0x3f, 0x3f, 0x67, 0x5f, 0x51 0x3f, 0x3f, 0x7a, 0x41, 0x24, 0x7e, 0x5a, 0x2f, 0x3b, 0x66,0 x39, 0x47, 0x32, 0x33, 0x41, 0x73, 0x6f, 0x77, 0x4d, 0x21, 0x56, 0x43 0x75, 0x5f, 0x71, 0x28, 0x26, 0x39, 0x42, 0x78, 0x7c, 0x46, 0x64, 0x48, 0x4a, 0x74, 0x31, 0x48, 0x67, 0x72, 0x36, 0x7d, 0x6e, 0x4b , 0x68, 0x70, 0x7d, 0x35, 0x3f, 0x6a, 0x55, 0x4b, 0x50, 0x3a, 0x6a, 0x69, 0x60, 0x2e, 0x23, 0 X6a, 0x7f, 0x09, 0x71, 0x28, 0x70, 0x6f, 0x35, 0x65, 0x49, 0x7d, 0x74, 0x5c, 0x24, 0x2c, 0x59, 0x2d, 0x77, 0x27, 0x54, 0x3f, 0x59, 0x37, 0x3f, 0x25, 0x7b, 0x6d, 0x7c, 0x3d, 0x7c, 0x23, 0x6c, 0x38, 0x28, 0x6d, 0x5e, 0x31, 0x4e, 0x5b, 0x39, 0x2b, 0x6e, 0x7f, 0x30, 0x57, 0x36, 0x6f, 0x4c, 0x54, 0x74, 0x34, 0x34, 0x6b, 0x72, 0x62, 0x4c, 0x25,0x4e, 0x33, 0x56,0x30, 0x56, 0x73, 0x5e, 0x3a, 0x68, 0x73, 0x78, 0x55, 0x09, 0x57, 0x47, 0x4b, 0x77, 0x32, 0x61, 0x3b, 0x35, 0x24, 0x44, 0x2e, 0x4d, 0x2f, 0x64, 0x6b, 0x59, 0x4f, 0x44, 0x45, 0x3b, 0x21, 0x5c, 0x2d, 0x37, 0x68, 0x41, 0x53, 0x36, 0x61, 0x58, 0x58, 0x7a, 0x48, 0x79, 0x22, 0x2e, 0x09, 0x60, 0x50, 0x75, 0x6b, 0x29, 0x38, 0x4e, 0x29, 0x55, 0x3d, 0x3f) var transformed =

New array () for (var i = 0; i <3; i ) transformed [i] = new array () for (var i = 31; i <= 126; i ) for (VAR J = 0; J <3 ; J ) Transformed [J] [Rawdata [(I-31) * 3 J] = (i == 31)? 9: i var digits = new array () for (VAR i = 0; i <26; i ) {DIGITS ["a" .Charcodeat (0) i] = i digits ["a" .Charcode (0) i] = i 26} for (var i = 0; i <10; i ) DIGITS ["0" .CHARCODEAT (0) i] = i 52 Digits [0x2b] = 62 digits [0x2f] = 63 function unescape (char) {var escapes = "# &! * $" Var escaped = "/ r / n <> @ "IF (Char.Charcodeat (0)> 126) Return Char if (escapes.indexof (char)! = -1) Return Escaped.Substr (escapes.indexof (char), 1) RETURN"? " } Function decodebase64 (string) {var val = 0 val = (DIGITS [String.Substr (0, 1) .Charcodeat (0)] << 2) VAL = (DIGITS [String.Substr (1, 1). Charcodeat (0)] >> 4) VAL = (DIGITS [String.Substr (1, 1) .Charcodeat (0)] & 0xF) << 12 val = ((DIGITS [String.Substr (2, 1) .ch Arcodeat (0)] >> 2) << 8) VAL = ((DIGITS [String.Substr (2, 1) .Charcodeat (0)] & 0x3) << 22) Val = (DIGITS [String.Substr (3, 1) .Charcodeat (0)] << 16) Return Val} Function strdec (Encodingstring) {var marker = "# @ ~ ^" Var stringIndex = 0 var scriptindex = -1 var unencodingIndex = 0 var char =

null var encodingLength = unEncodinglength = 0 var state = STATE_COPY_INPUT var unEncodingString = "" var re, arr while (state) {switch (state) {case (STATE_COPY_INPUT):! scriptIndex = encodingString.indexOf (marker, stringIndex) if (scriptIndex = -1) {unEncodingString = encodingString.substring (stringIndex, scriptIndex) scriptIndex = marker.length state = STATE_READLEN} else {stringIndex = stringIndex == 0 0:? stringIndex unEncodingString = encodingString.substr (stringIndex, encodingString.length) State = 0} Break Case (state_readlen): EncodingLength = E ncodingString.substr (scriptIndex, 6) unEncodinglength = decodeBase64 (encodingLength) scriptIndex = (6 "==" length.) state = STATE_DECODE break case (STATE_DECODE): if (! unEncodinglength) {stringIndex = scriptIndex "DQgAAA == ^ # ~ @ ". Length UnencodingIndex = 0 State = State_copy_input break} char =

encodingString.substr (scriptIndex, 1) if (char == "@") state = STATE_UNESCAPE else {if (char.charCodeAt (0) <0xFF) {unEncodingString = String.fromCharCode (transformed [pick_encoding [unEncodingIndex% 64]] [char.charCodeAt (0)]) unEncodingIndex } else {unEncodingString = char} scriptIndex unEncodinglength-- break} case STATE_UNESCAPE: unEncodingString = unescape (encodingString.substr ( scriptIndex, 1)) scriptIndex ; unEncodinglength - = 2 unEncodingIndex State = state_decode break}} re = new RegExp. ( "(JScript | VBscript) .encode", "gmi") while (arr = re.exec (unEncodingString)) unEncodingString = RegExp.leftContext RegExp $ 1 RegExp.rightContext return unEncodingString} / * END Decryption Implementation: Li Huihuang End * / Function DNCodeFolderfiles (SfolderPath) {/ * * --------------- DNCodeFolderFiles (SfolderPath) ------------------------ ----- * DNCodeFolderFiles (SfolderPath) * Function: Decrypts the encrypted .asp file * to the encrypted .asp file * in the SfolderPath directory, and write in the source file. * Instance: DncodeFolderFiles (Server.MAppath " "));

* Author: Wanghr100 (Gray Beans Baby .NET) * Update: 2004-5-17 8:07 * --------------- DNCodefolderfiles (SfolderPath) -------------------------------------------------------------- --------- * / var arrfiles = getfilespath (sfolderpath) for (var i = 0; i

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

New Post(0)