formatting changes

This commit is contained in:
Brian Carrier 2018-03-05 18:40:46 -05:00
parent fb9afff815
commit 82c72d2a3c

View File

@ -41,7 +41,6 @@ import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor;
import org.sleuthkit.autopsy.coreutils.ExecUtil;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
import org.sleuthkit.autopsy.ingest.IngestServices;
@ -209,13 +208,21 @@ class VolatilityProcessor implements Runnable{
}
private void lookupFiles(Set<String> fileSet, String pluginName) {
try {
if (isCancelled)
return;
Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
Blackboard blackboard;
try {
blackboard = Case.getCurrentCase().getServices().getBlackboard();
}
catch (Exception ex) {
// case is closed ??
return;
}
for (String file : fileSet) {
if (isCancelled) {
return;
}
File volfile = new File(file);
String fileName = volfile.getName().trim();
// if there is no extension, add a wildcard to the end
@ -238,8 +245,7 @@ class VolatilityProcessor implements Runnable{
List<AbstractFile> resolvedFiles;
if (filePath.isEmpty()) {
resolvedFiles = fileManager.findFiles(fileName); //NON-NLS
}
else {
} else {
resolvedFiles = fileManager.findFiles(fileName, filePath); //NON-NLS
}
resolvedFiles.forEach((resolvedFile) -> {
@ -268,16 +274,11 @@ class VolatilityProcessor implements Runnable{
logger.log(Level.SEVERE, "Failed to create BlackboardAttribute.", ex); // NON-NLS
}
});
);
} catch (TskCoreException ex) {
//String msg = NbBundle.getMessage(this.getClass(), "Chrome.getHistory.errMsg.errGettingFiles");
logger.log(Level.SEVERE, "Error in Finding FIles", ex);
return;
}
}
} catch (Exception ex) {
logger.log(Level.SEVERE, "Error in processing List of FIles", ex); //NON-NLS
}
}
@ -512,29 +513,30 @@ class VolatilityProcessor implements Runnable{
}
private Set<String> parse_Cmdline(File PluginFile) {
String line;
Set<String> fileSet = new HashSet<>();
int counter = 0;
try {
BufferedReader br = new BufferedReader(new FileReader(PluginFile));
// read the first line from the text file
try (BufferedReader br = new BufferedReader(new FileReader(PluginFile))) {
String line;
while ((line = br.readLine()) != null) {
if (line.length() > 16) {
String TAG = "Command line : ";
if (line.startsWith(TAG)) {
counter = counter + 1;
// Command line : "C:\Program Files\VMware\VMware Tools\vmacthlp.exe"
String file_path;
// Command line : "C:\Program Files\VMware\VMware Tools\vmacthlp.exe"
// grab whats inbetween the quotes
if (line.charAt(TAG.length()) == '\"') {
file_path = line.substring(TAG.length() + 1);
if (file_path.contains("\"")) {
file_path = file_path.substring(0, file_path.indexOf("\""));
}
else {
} else {
// ERROR
}
}
// Command line : C:\WINDOWS\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512
// grab everything before the next space - we don't want arguments
else {
file_path = line.substring(TAG.length());
if (file_path.contains(" ")) {
@ -545,9 +547,10 @@ class VolatilityProcessor implements Runnable{
}
}
}
br.close();
} catch (FileNotFoundException ex) {
logger.log(Level.SEVERE, "Error opening cmdline output", ex);
} catch (IOException ex) {
//Exceptions.printStackTrace(ex);
logger.log(Level.SEVERE, "Error parsing cmdline output", ex);
}
return fileSet;
}