OutputToMongoDB output = new OutputToMongoDB(scrutinizer, cmd.getOptionValue("mongo"));
scrutinizer.setOutput(output);
if (cmd.hasOption("libemuPath")) {
LibemuShellcodeTester libemuTester = null;
try {
libemuTester = new LibemuShellcodeTester(scrutinizer, cmd.getOptionValue("libemuPath"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
if (libemuTester != null) {
scrutinizer.getDynamicHeuristics().setShellcodeTester(libemuTester);
}
}
scrutinizer.analyze();
} else if (cmd.hasOption("pdf")) {
Scrutinizer scrutinizer = new Scrutinizer();
try {
scrutinizer.setRootDocument(new File(cmd.getOptionValue("pdf")));
} catch (FileNotFoundException e) {
System.err.println(e.getMessage());
return;
}
OutputToFiles output = new OutputToFiles(scrutinizer, scrutinizer.getHash(), "result");
output.setSaveDynamicICode(false);
output.setShowHexdump(false);
scrutinizer.setOutput(output);
if (cmd.hasOption("libemuPath")) {
LibemuShellcodeTester libemuTester = null;
try {
libemuTester = new LibemuShellcodeTester(scrutinizer, cmd.getOptionValue("libemuPath"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
if (libemuTester != null) {
scrutinizer.getDynamicHeuristics().setShellcodeTester(libemuTester);