Skip to content

Instantly share code, notes, and snippets.

@B05Fvsvl04 B05Fvsvl04/Level_4.java Secret
Created Mar 27, 2017

Embed
What would you like to do?
Mod-X Level 4
/* Level 4 from Mod-X
* This is the VB executable translated into Java
* for making easier to understand
*/
import java.util.Scanner;
public class Level_4 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int nameLen;
char letter;
String nName = "";
String tmp = "";
//From 4030F1 to 4032C3
String hardcodedName = "trautS";
System.out.print("Name: ");
String name = input.nextLine();
System.out.print("Password: ");
String password = input.nextLine();
input.close();
if (password.length()==0)
return;
nameLen = name.length();
if (nameLen != 6)
return;
for (int i=1; i<=nameLen; i++){
letter = name.charAt(nameLen-i);
nName += letter;
}
//From 4032F2 then on
if (!nName.equals(hardcodedName))
return;
nName = "";
for (int i=0; i<name.length(); i++){
letter = name.charAt(i);
nName += Integer.toHexString(letter);
}
for (int i=nName.length(); i!=0; i--){
letter = nName.charAt(i-1);
tmp += letter;
}
if (password.equals(tmp)){
System.out.println("Welcome");
System.out.println("Remote access link to Mod-X terminal created");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.