Skip to content

Commit

Permalink
fixed wrong unzip path when runnig as jar
Browse files Browse the repository at this point in the history
  • Loading branch information
ozzi- committed Aug 31, 2018
1 parent 7b1bd90 commit 34b7184
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BruteForceDemo/src/BruteForceZIP.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public void bruteForceZIP(String zipPath, String passwordListPath) throws IOExce

String path = BFD.class.getProtectionDomain().getCodeSource().getLocation().getPath();
String runPath = URLDecoder.decode(path, "UTF-8");
if(runPath.toLowerCase().endsWith(".jar")) {
runPath = runPath.substring(0, runPath.lastIndexOf('.'));
}
long start = System.currentTimeMillis();

jf.revalidate();
Expand Down Expand Up @@ -165,6 +168,7 @@ private boolean runCombinations(ArrayList<String> possibleValues, String zipPath
for (int index : indices) {
pw+=possibleValues.get(index);
}

lastPW = pw;
c++;
boolean res=false;
Expand Down
Binary file modified BruteForceDemo/target/classes/secret.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 34b7184

Please sign in to comment.