Skip to content

Ghidra is a software reverse engineering (SRE) framework

Add FreeBSD PowerPC 64-bit platforms (freebsd_ppc_64, freebsd_ppc_64le)

Piotr Kubaj0f49f4aaa125
diff --git a/GPL/DemanglerGnu/build.gradle b/GPL/DemanglerGnu/build.gradle
index 1fa482295e..fbb2287c6a 100644
--- a/GPL/DemanglerGnu/build.gradle
+++ b/GPL/DemanglerGnu/build.gradle
@@ -84,6 +84,8 @@ model {
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
targetPlatform "freebsd_arm_64"
+ targetPlatform "freebsd_ppc_64"
+ targetPlatform "freebsd_ppc_64le"
targetPlatform "openbsd_x86_64"
targetPlatform "openbsd_arm_64"
sources {
@@ -110,6 +112,8 @@ model {
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
targetPlatform "freebsd_arm_64"
+ targetPlatform "freebsd_ppc_64"
+ targetPlatform "freebsd_ppc_64le"
targetPlatform "openbsd_x86_64"
targetPlatform "openbsd_arm_64"
sources {
diff --git a/GPL/nativePlatforms.gradle b/GPL/nativePlatforms.gradle
index 5d832b2b14..c41f6304b5 100644
--- a/GPL/nativePlatforms.gradle
+++ b/GPL/nativePlatforms.gradle
@@ -28,6 +28,8 @@ project.ext.PLATFORMS = [
[name: "mac_arm_64", os: "osx", arch: "arm64"],
[name: "freebsd_x86_64", os: "freebsd", arch: "x86_64"],
[name: "freebsd_arm_64", os: "freebsd", arch: "arm64"],
+ [name: "freebsd_ppc_64", os: "freebsd", arch: "ppc64"],
+ [name: "freebsd_ppc_64le", os: "freebsd", arch: "ppc64le"],
[name: "openbsd_x86_64", os: "openbsd", arch: "x86_64"],
[name: "openbsd_arm_64", os: "openbsd", arch: "arm64"]
]
@@ -82,6 +84,12 @@ ext.getCurrentPlatformName = {
case "arm64":
arch = "arm_64"
break
+ case "ppc64":
+ arch = "ppc_64"
+ break
+ case "ppc64le":
+ arch = "ppc_64le"
+ break
default:
throw new GradleException("Unrecognized platform architecture: $arch" )
}
diff --git a/Ghidra/Features/Decompiler/buildNatives.gradle b/Ghidra/Features/Decompiler/buildNatives.gradle
index ebffd55672..09725407b5 100644
--- a/Ghidra/Features/Decompiler/buildNatives.gradle
+++ b/Ghidra/Features/Decompiler/buildNatives.gradle
@@ -45,6 +45,8 @@ model {
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
targetPlatform "freebsd_arm_64"
+ targetPlatform "freebsd_ppc_64"
+ targetPlatform "freebsd_ppc_64le"
targetPlatform "openbsd_x86_64"
targetPlatform "openbsd_arm_64"
sources {
@@ -160,6 +162,8 @@ model {
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
targetPlatform "freebsd_arm_64"
+ targetPlatform "freebsd_ppc_64"
+ targetPlatform "freebsd_ppc_64le"
targetPlatform "openbsd_x86_64"
targetPlatform "openbsd_arm_64"
sources {
diff --git a/Ghidra/Features/FileFormats/buildNatives.gradle b/Ghidra/Features/FileFormats/buildNatives.gradle
index 010f09bd60..c3f2103956 100644
--- a/Ghidra/Features/FileFormats/buildNatives.gradle
+++ b/Ghidra/Features/FileFormats/buildNatives.gradle
@@ -36,6 +36,8 @@ model {
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
targetPlatform "freebsd_arm_64"
+ targetPlatform "freebsd_ppc_64"
+ targetPlatform "freebsd_ppc_64le"
targetPlatform "openbsd_x86_64"
targetPlatform "openbsd_arm_64"
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Architecture.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Architecture.java
index 1b0c7c37cd..374d63da6a 100644
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Architecture.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Architecture.java
@@ -20,6 +20,7 @@ public enum Architecture {
X86_64("x86_64", "amd64"),
POWERPC("ppc"),
POWERPC_64("ppc64"),
+ POWERPC_64LE("ppc64le"),
ARM_64("aarch64", "arm64"),
UNKNOWN("Unknown Architecture");
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java
index a970a5cc6d..f69b666678 100644
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java
@@ -58,6 +58,12 @@ public enum Platform {
/// Identifies a FreeBSD ARM 64-bit OS
FREEBSD_ARM_64(OperatingSystem.FREE_BSD, Architecture.ARM_64, "freebsd_arm_64", ".so", ""),
+ /// Identifies a FreeBSD PowerPC 64-bit big-endian OS
+ FREEBSD_PPC_64(OperatingSystem.FREE_BSD, Architecture.POWERPC_64, "freebsd_ppc_64", ".so", ""),
+
+ /// Identifies a FreeBSD PowerPC 64-bit little-endian OS
+ FREEBSD_PPC_64LE(OperatingSystem.FREE_BSD, Architecture.POWERPC_64LE, "freebsd_ppc_64le", ".so", ""),
+
/// Identifies a OpenBSD x86 64-bit OS
OPENBSD_X86_64(OperatingSystem.OPEN_BSD, Architecture.X86_64, "openbsd_x86_64", ".so", ""),
diff --git a/GhidraDocs/GettingStarted.md b/GhidraDocs/GettingStarted.md
index 2dd828b7f1..16b3c8adf8 100644
--- a/GhidraDocs/GettingStarted.md
+++ b/GhidraDocs/GettingStarted.md
@@ -203,6 +203,8 @@ Ghidra supports running on the following additional platforms with user-built na
* Linux ARM 64-bit
* FreeBSD x86 64-bit (no debugger support)
* FreeBSD ARM 64-bit (no debugger support)
+* FreeBSD PowerPC 64-bit big-endian (no debugger support)
+* FreeBSD PowerPC 64-bit little-endian (no debugger support)
* OpenBSD x86 64-bit
* OpenBSD ARM 64-bit