• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Java SimpleObfuscator Java Console SSTU

Status
Not open for further replies.

itsMe

*KillmeMories*
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
Joined
Jan 8, 2019
Messages
56,623
Solutions
2
Reputation
32
Reaction score
100,456
Points
2,313
Credits
32,750
‎6 Years of Service‎
 
76%
253783704-7f7b6347-79b6-4517-9c55-5035e4936044.png


A simple console Java code obfuscator: adding random comments and unreachable code, clearing formatting, renaming variables.

Example of obfuscated code:

/*i2EuesSMS4riq55*/package obfuscator;import java.io.*;import /*Yoj`r`epCK*/ java.util.Scanner;public /*QUCopDP[Nx*/ //yMwB47ljgtwXK_I
class Main{String /*lSA]tTqpGj*/ zTdCL(){String
/*uZxIMGHOjJ*/ /*f[jsC8vK`5*/ fwLwDA="Daniil";String IhSjms="Rud";while(fwLwDA!=""){System.out.println(fwLwDA+IhSjms);}return IhSjms;}public static void main(String[]args){Scanner scanner=new Scanner(System.in);String HSFRZZ="";while(HSFRZZ.isEmpty()){System.out.println("Enter the path to the file to open:");HSFRZZ=scanner.nextLine();try(FileReader fr=new FileReader(HSFRZZ)){StringBuilder stringBuffer=new StringBuilder();int vCJqPj;while((vCJqPj=fr.read())!=-1){stringBuffer.append((char)vCJqPj);}String CDIaPb=AddUnreachableCode.addUnreachCode(stringBuffer.toString());CDIaPb=CodeCleaning.cleanCode(CDIaPb);CDIaPb=RenameVariables.IdentifierNameReplacing(CDIaPb);CDIaPb=AddRandomComments.createComments(CDIaPb);writeInFile(CDIaPb);}catch(IOException e){System.out.println("File not found");HSFRZZ="";}}scanner.close();}private static void writeInFile(String str)throws IOException{String TNPYSg=System.getProperty("user.home")+"/Desktop";String HSFRZZ=TNPYSg+"/output.txt";FileWriter writer=new FileWriter(HSFRZZ,false);writer.append(str);writer.flush();writer.close();System.out.println("The obfuscated code has been successfully saved to the desktop.");}}


To see this hidden content, you must like this content.
 
Status
Not open for further replies.
Back
Top