Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,24 @@ public static boolean isWindowsOS() {
return PlatformUtil.getOSName().toLowerCase().contains("windows"); //NON-NLS
}

/**
* Check if running on Linux OS
*
* @return true if running on Linux OS
*/
public static boolean isLinuxOS() {
return PlatformUtil.getOSName().toLowerCase().contains("linux"); //NON-NLS
}

/**
* Check if running on Macos OS
*
* @return true if running on Macos OS
*/
public static boolean isMacOS() {
return PlatformUtil.getOSName().toLowerCase().contains("mac"); //NON-NLS
}

/**
* Convert file path (quote) for OS specific
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ final class ExtractSru extends Extract {
private static final String APPLICATION_USAGE_SOURCE_NAME = "System Resource Usage - Application Usage"; //NON-NLS
private static final String NETWORK_USAGE_SOURCE_NAME = "System Resource Usage - Network Usage";
private static final String SRU_TOOL_FOLDER = "markmckinnon"; //NON-NLS
private static final String SRU_TOOL_NAME_WINDOWS = "Export_Srudb.exe"; //NON-NLS
private static final String SRU_TOOL_NAME_LINUX = "export_srudb_linux"; //NON-NLS
private static final String SRU_TOOL_NAME_X64_WINDOWS = "mm_artifact_parser_x64_win.exe"; //NON-NLS
private static final String SRU_TOOL_NAME_X64_LINUX = "mm_artifact_parser_x64_linux"; //NON-NLS
private static final String SRU_TOOL_NAME_X64_MACOS = "mm_artifact_parser_x64_macos"; //NON-NLS
private static final String SRU_TOOL_NAME_AARCH64_LINUX = "mm_artifact_parser_aarch64_linux"; //NON-NLS
private static final String SRU_TOOL_NAME_AARCH64_MACOS = "mm_artifact_parser_aarch64_macos"; //NON-NLS
private static final String SRU_OUTPUT_FILE_NAME = "Output.txt"; //NON-NLS
private static final String SRU_ERROR_FILE_NAME = "Error.txt"; //NON-NLS

Expand Down Expand Up @@ -237,9 +240,11 @@ void extractSruFiles(String sruExePath, String sruFile, String tempOutFile, Stri

List<String> commandLine = new ArrayList<>();
commandLine.add(sruExePath);
commandLine.add("-a");
commandLine.add("sru");
commandLine.add("-sr");
commandLine.add(sruFile); //NON-NLS
commandLine.add("-s");
commandLine.add("-sh");
commandLine.add(softwareHiveFile);
commandLine.add("-db");
commandLine.add(tempOutFile);
Expand All @@ -254,10 +259,18 @@ void extractSruFiles(String sruExePath, String sruFile, String tempOutFile, Stri
private String getPathForSruDumper() {
Path path = null;
if (PlatformUtil.isWindowsOS()) {
path = Paths.get(SRU_TOOL_FOLDER, SRU_TOOL_NAME_WINDOWS);
} else {
if ("Linux".equals(PlatformUtil.getOSName())) {
path = Paths.get(SRU_TOOL_FOLDER, SRU_TOOL_NAME_LINUX);
path = Paths.get(SRU_TOOL_FOLDER, SRU_TOOL_NAME_X64_WINDOWS);
} else if (PlatformUtil.isLinuxOS()) {
if ("aarch64".equals(PlatformUtil.getOSArch())) {
path = Paths.get(SRU_TOOL_FOLDER, SRU_TOOL_NAME_AARCH64_LINUX);
} else {
path = Paths.get(SRU_TOOL_FOLDER, SRU_TOOL_NAME_X64_LINUX);
}
} else if (PlatformUtil.isMacOS()) {
if ("aarch64".equals(PlatformUtil.getOSArch())) {
path = Paths.get(SRU_TOOL_FOLDER, SRU_TOOL_NAME_AARCH64_MACOS);
} else {
path = Paths.get(SRU_TOOL_FOLDER, SRU_TOOL_NAME_X64_MACOS);
}
}
File sruToolFile = InstalledFileLocator.getDefault().locate(path.toString(),
Expand Down
Binary file removed thirdparty/markmckinnon/export_srudb.exe
Binary file not shown.
Binary file removed thirdparty/markmckinnon/export_srudb_linux
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.