SoFunction
Updated on 2025-04-13

js code decryption code


5: Useless content confusion and line break space TAB method

In the JAVASCRIPT code, we can add a large number of useless strings or numbers, as well as useless code and comment content, etc., so that the real useful code is buried in it, and add a large number of newlines, spaces, and TABs to the useful code, and use normal strings to wrap lines with "\", which will make the code difficult to understand! If I encrypt the form is as follows:
<SCRIPT LANGUAGE="JavaScript"> 
"xajgxsadffgds";1234567890 
625623216;var $=0;alert//@$%%&*()(&(^%^ 
//cctv function// 
(//hhsaasajx xc 
/* 
asjgdsgu*/ 
"black\

guest\
Line of defense"//ashjgfgf
/* 
@#%$^&%667r45fggbhytjty 
*/ 
//window 

;"#@$#%@#432hu";212351436 
</SCRIPT> 



At least if I see such a code, I won’t have the heart to analyze it. Where are you?

Six: Self-written decryption function method

This method is similar to one or two, it is just writing a function to decrypt the code. Many VBS viruses use this method to encrypt themselves to prevent feature code scanning! Below is a simple encryption and decryption function I wrote,

The encryption code is as follows (refer to the file "Encryption.htm" for details):
<SCRIPT LANGUAGE="JavaScript"> 
function compile(code) 

var c=((0)+); 
for(var i=1;i<;i++){ 
c+=((i)+(i-1)); 

alert(escape(c)); 

compile('alert("Hacker Line");')
</SCRIPT> 



Run the encryption result as:
o%CD%D1%D7%E6%9CJ%u9EF3%uFA73%uF1D4%u14F1%u7EE1Kd 



The corresponding code for decryption after encryption is as follows:
<SCRIPT LANGUAGE="JavaScript"> 
function uncompile(code) 

code=unescape(code); 
var c=((0)-); 
for(var i=1;i<;i++){ 
c+=((i)-(i-1)); 

return c; 

eval(uncompile("o%CD%D1%D7%E6%9CJ%u9EF3%uFA73%uF1D4%u14F1%u7EE1Kd")); 
</SCRIPT> 



7: Misuse of use

Use the try{}catch(e){} structure to test and decrypt the code. Although this idea is very good (hehe, praise yourself), because it is not very practical, I will only give an example.
<SCRIPT LANGUAGE="JavaScript"> 

var a='alert("Hacker Line"");';
var c=""; 
for(var i=0;i<;i++){ 
c+=((i)^61);} 

alert(c); 

//The above is the encryption code. Of course, if you really use this method, you will not write the encryption on it.
//Now variable c is the encrypted code

//The following function t() assumes that the initial password is 0, decryption and execution,
//After an error, add 1 to the password, and then decrypt and execute until it runs correctly.

var d=c; //Save the encrypted code
var b=0; //Assuming the initial password is 0
t(); 

function t(){ 
try{eval(c);}catch(e){ 
c=""; 
for(var i=0;i<;i++){ 
c+=((i)^b);} 
b+=1; 
t(); 
//setTimeout("t()",0); 


</SCRIPT>