aboutsummaryrefslogtreecommitdiff
path: root/tools/ghidra
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ghidra')
-rw-r--r--tools/ghidra/ExportAiCreateSuperAi.java23
-rw-r--r--tools/ghidra/ExportAiExpressionDispatcher.java25
-rw-r--r--tools/ghidra/ExportAiFtol.java23
-rw-r--r--tools/ghidra/ExportAiGetSuperAi.java23
-rw-r--r--tools/ghidra/ExportAiScriptLoader.java23
-rw-r--r--tools/ghidra/ExportAiScriptLoaderStrings.java27
-rw-r--r--tools/ghidra/ExportAiScriptPackageReader.java23
-rw-r--r--tools/ghidra/ExportAiSuperAiConstructor.java23
-rw-r--r--tools/ghidra/ExportAiVarSetLoader.java23
-rw-r--r--tools/ghidra/ExportAiVarSetParser.java23
-rw-r--r--tools/ghidra/ExportAiVarSetU32Resolver.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler0.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler1.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler15.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler19.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler19Setter.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler19SetterCallee.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler1Callees.java25
-rw-r--r--tools/ghidra/ExportAiVmHandler2.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler2Callee.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler2Dispatch.java27
-rw-r--r--tools/ghidra/ExportAiVmHandler2SchedulerHelpers.java28
-rw-r--r--tools/ghidra/ExportAiVmHandler30.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler8.java23
-rw-r--r--tools/ghidra/ExportAiVmHandler8Callees.java25
-rw-r--r--tools/ghidra/ExportAiVmHandler8Transitions.java25
-rw-r--r--tools/ghidra/ExportAiVmTableInstall.java23
-rw-r--r--tools/ghidra/ExportAniMeshControlCaller.java21
-rw-r--r--tools/ghidra/ExportControlFunctions.java35
-rw-r--r--tools/ghidra/ExportIron3dAiCallback.java23
-rw-r--r--tools/ghidra/ExportIron3dAiCallbackCommand1.java23
-rw-r--r--tools/ghidra/ExportIron3dAiCallbackCommand1Dispatch.java23
-rw-r--r--tools/ghidra/FindAiScriptLoaderReferences.java29
-rw-r--r--tools/ghidra/FindAiVmHandler30Callback.java27
34 files changed, 0 insertions, 823 deletions
diff --git a/tools/ghidra/ExportAiCreateSuperAi.java b/tools/ghidra/ExportAiCreateSuperAi.java
deleted file mode 100644
index 80117cf..0000000
--- a/tools/ghidra/ExportAiCreateSuperAi.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the GOG CreateSuperAI export to recover the mission-to-SuperAI
-// initialization boundary. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiCreateSuperAi extends GhidraScript {
- private static final long ADDRESS = 0x1000f710L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI CreateSuperAI =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 120, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiExpressionDispatcher.java b/tools/ghidra/ExportAiExpressionDispatcher.java
deleted file mode 100644
index 1f3e8fa..0000000
--- a/tools/ghidra/ExportAiExpressionDispatcher.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// Emits the decompiled AI expression evaluator containing the recovered
-// tag 1..5 dispatch. Run through Ghidra headless analysis only; it never
-// mutates the original PE image.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiExpressionDispatcher extends GhidraScript {
- private static final long ADDRESS = 0x10005180L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionContaining(address);
- println("===== AI expression dispatcher =====");
- if (function == null) { println("missing"); return; }
- println("entry=" + function.getEntryPoint());
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiFtol.java b/tools/ghidra/ExportAiFtol.java
deleted file mode 100644
index 215dc01..0000000
--- a/tools/ghidra/ExportAiFtol.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the x87-to-integer helper called by Handler(19). Run headless; the
-// original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiFtol extends GhidraScript {
- private static final long ADDRESS = 0x1001df70L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI x87 __ftol helper =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiGetSuperAi.java b/tools/ghidra/ExportAiGetSuperAi.java
deleted file mode 100644
index 27ea107..0000000
--- a/tools/ghidra/ExportAiGetSuperAi.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the GOG ai.dll GetSuperAI export to recover the live singleton
-// boundary for read-only handler-input capture.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiGetSuperAi extends GhidraScript {
- private static final long ADDRESS = 0x1000f780L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI GetSuperAI =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiScriptLoader.java b/tools/ghidra/ExportAiScriptLoader.java
deleted file mode 100644
index 1b457d4..0000000
--- a/tools/ghidra/ExportAiScriptLoader.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the GOG AI script-bundle loader, discovered from references to
-// "MISSIONS\\SCRIPTS\\" and ".scr". Run headless; original input stays read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiScriptLoader extends GhidraScript {
- private static final long ADDRESS = 0x10001000L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI script loader =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiScriptLoaderStrings.java b/tools/ghidra/ExportAiScriptLoaderStrings.java
deleted file mode 100644
index e1443c7..0000000
--- a/tools/ghidra/ExportAiScriptLoaderStrings.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Emits path literals used by the GOG AI script loader at 0x10001000.
-// Run headless; the original PE remains read only.
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-
-public class ExportAiScriptLoaderStrings extends GhidraScript {
- private static final long[] ADDRESSES = {
- 0x10038a88L, 0x10038a9cL, 0x10038aa4L, 0x10038aacL,
- 0x10038ab4L, 0x10038abcL, 0x10038ad0L, 0x10038ad8L,
- 0x10038ae0L
- };
-
- @Override
- public void run() throws Exception {
- for (long value : ADDRESSES) {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(value);
- byte[] bytes = new byte[256];
- int count = currentProgram.getMemory().getBytes(address, bytes);
- StringBuilder text = new StringBuilder();
- for (int index = 0; index < count && bytes[index] != 0; index++) {
- text.append((char) (bytes[index] & 0xff));
- }
- println(address + " = \"" + text + "\"");
- }
- }
-}
diff --git a/tools/ghidra/ExportAiScriptPackageReader.java b/tools/ghidra/ExportAiScriptPackageReader.java
deleted file mode 100644
index 9365165..0000000
--- a/tools/ghidra/ExportAiScriptPackageReader.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the immediate .scr package reader called by the AI script loader.
-// Run through Ghidra headless analysis; the original PE is never modified.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiScriptPackageReader extends GhidraScript {
- private static final long ADDRESS = 0x10011B20L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI .scr package reader =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiSuperAiConstructor.java b/tools/ghidra/ExportAiSuperAiConstructor.java
deleted file mode 100644
index 85799e9..0000000
--- a/tools/ghidra/ExportAiSuperAiConstructor.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the SuperAI constructor called by CreateSuperAI. Run headless; the
-// original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiSuperAiConstructor extends GhidraScript {
- private static final long ADDRESS = 0x10001000L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI SuperAI constructor =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 120, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVarSetLoader.java b/tools/ghidra/ExportAiVarSetLoader.java
deleted file mode 100644
index 70c6fa4..0000000
--- a/tools/ghidra/ExportAiVarSetLoader.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the text `.var` loader called after the AI script loader selects a
-// bundle-local or shared varset. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVarSetLoader extends GhidraScript {
- private static final long ADDRESS = 0x10011ea0L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI varset loader =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVarSetParser.java b/tools/ghidra/ExportAiVarSetParser.java
deleted file mode 100644
index f425f30..0000000
--- a/tools/ghidra/ExportAiVarSetParser.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the actual text-to-varset parser called by the AI varset loader.
-// Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVarSetParser extends GhidraScript {
- private static final long ADDRESS = 0x100174a0L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI varset parser =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVarSetU32Resolver.java b/tools/ghidra/ExportAiVarSetU32Resolver.java
deleted file mode 100644
index 247220d..0000000
--- a/tools/ghidra/ExportAiVarSetU32Resolver.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the u32 resolver used by corpus-reachable Handler(30) for indexed
-// varset records. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVarSetU32Resolver extends GhidraScript {
- private static final long ADDRESS = 0x10013570L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI varset u32 resolver =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler0.java b/tools/ghidra/ExportAiVmHandler0.java
deleted file mode 100644
index 43e8046..0000000
--- a/tools/ghidra/ExportAiVmHandler0.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the first function in the AI DLL's verified 73-entry VM handler table.
-// Run through Ghidra headless analysis; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler0 extends GhidraScript {
- private static final long ADDRESS = 0x10008034L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM handler 0 =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler1.java b/tools/ghidra/ExportAiVmHandler1.java
deleted file mode 100644
index e58c1e9..0000000
--- a/tools/ghidra/ExportAiVmHandler1.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits Handler(1), the second function in the AI DLL's verified 73-entry VM table.
-// Run through Ghidra headless analysis; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler1 extends GhidraScript {
- private static final long ADDRESS = 0x10007fd0L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(1) =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler15.java b/tools/ghidra/ExportAiVmHandler15.java
deleted file mode 100644
index d1756aa..0000000
--- a/tools/ghidra/ExportAiVmHandler15.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits Handler(15), a frequent non-sentinel selector in the GOG compiled
-// script corpus. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler15 extends GhidraScript {
- private static final long ADDRESS = 0x10008054L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(15) =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler19.java b/tools/ghidra/ExportAiVmHandler19.java
deleted file mode 100644
index 8729999..0000000
--- a/tools/ghidra/ExportAiVmHandler19.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits Handler(19), the first instruction in both AutoDemo default-script
-// Init events. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler19 extends GhidraScript {
- private static final long ADDRESS = 0x1000aa38L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(19) =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler19Setter.java b/tools/ghidra/ExportAiVmHandler19Setter.java
deleted file mode 100644
index 2aa1ce0..0000000
--- a/tools/ghidra/ExportAiVmHandler19Setter.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits Handler(19)'s common x87 varset setter. Run headless; the original PE
-// remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler19Setter extends GhidraScript {
- private static final long ADDRESS = 0x10013770L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(19) setter =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler19SetterCallee.java b/tools/ghidra/ExportAiVmHandler19SetterCallee.java
deleted file mode 100644
index 92cf7d5..0000000
--- a/tools/ghidra/ExportAiVmHandler19SetterCallee.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the common varset storage helper reached by Handler(19)'s setter.
-// Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler19SetterCallee extends GhidraScript {
- private static final long ADDRESS = 0x10012fe0L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(19) setter storage helper =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler1Callees.java b/tools/ghidra/ExportAiVmHandler1Callees.java
deleted file mode 100644
index f59e619..0000000
--- a/tools/ghidra/ExportAiVmHandler1Callees.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// Emits the two direct callees recovered from AI VM Handler(1).
-// Run through Ghidra headless analysis; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler1Callees extends GhidraScript {
- private static final long[] ADDRESSES = { 0x10002d30L, 0x10013190L };
-
- @Override
- public void run() throws Exception {
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- for (long value : ADDRESSES) {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(value);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(1) callee " + address + " =====");
- if (function == null) { println("missing"); continue; }
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- }
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler2.java b/tools/ghidra/ExportAiVmHandler2.java
deleted file mode 100644
index d4f3469..0000000
--- a/tools/ghidra/ExportAiVmHandler2.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits Handler(2), the third function in the AI DLL's verified 73-entry VM table.
-// Run through Ghidra headless analysis; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler2 extends GhidraScript {
- private static final long ADDRESS = 0x10009610L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(2) =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler2Callee.java b/tools/ghidra/ExportAiVmHandler2Callee.java
deleted file mode 100644
index c4246e8..0000000
--- a/tools/ghidra/ExportAiVmHandler2Callee.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the opaque direct callee reached by corpus-reachable AI VM Handler(2).
-// Run through Ghidra headless analysis; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler2Callee extends GhidraScript {
- private static final long ADDRESS = 0x100059f0L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(2) direct callee =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler2Dispatch.java b/tools/ghidra/ExportAiVmHandler2Dispatch.java
deleted file mode 100644
index 5762519..0000000
--- a/tools/ghidra/ExportAiVmHandler2Dispatch.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Emits the direct post-insertion dispatcher reached by the corpus-reachable
-// AI VM Handler(2) scheduler boundary. Run headless; the original PE is read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler2Dispatch extends GhidraScript {
- private static final long[] ADDRESSES = {
- 0x1000f920L, 0x10004be0L, 0x10004d00L, 0x10004db0L
- };
-
- @Override
- public void run() throws Exception {
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- for (long value : ADDRESSES) {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(value);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI Handler(2) post-insertion helper " + address + " =====");
- if (function == null) { println("missing"); continue; }
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- }
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler2SchedulerHelpers.java b/tools/ghidra/ExportAiVmHandler2SchedulerHelpers.java
deleted file mode 100644
index 76b335d..0000000
--- a/tools/ghidra/ExportAiVmHandler2SchedulerHelpers.java
+++ /dev/null
@@ -1,28 +0,0 @@
-// Emits record construction, equality, refresh and insertion helpers called by
-// the corpus-reachable AI VM Handler(2) scheduler boundary.
-// Run through Ghidra headless analysis; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler2SchedulerHelpers extends GhidraScript {
- private static final long[] ADDRESSES = {
- 0x10004e50L, 0x10004c50L, 0x10005070L, 0x100073e0L
- };
-
- @Override
- public void run() throws Exception {
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- for (long value : ADDRESSES) {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(value);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI Handler(2) scheduler helper " + address + " =====");
- if (function == null) { println("missing"); continue; }
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- }
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler30.java b/tools/ghidra/ExportAiVmHandler30.java
deleted file mode 100644
index 81918ff..0000000
--- a/tools/ghidra/ExportAiVmHandler30.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits Handler(30), the most frequent non-sentinel selector in the GOG
-// compiled-script corpus. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler30 extends GhidraScript {
- private static final long ADDRESS = 0x1000c266L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(30) =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler8.java b/tools/ghidra/ExportAiVmHandler8.java
deleted file mode 100644
index 4539629..0000000
--- a/tools/ghidra/ExportAiVmHandler8.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits Handler(8), a frequent non-sentinel selector in the GOG compiled
-// script corpus. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler8 extends GhidraScript {
- private static final long ADDRESS = 0x10009b0dL;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM Handler(8) =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler8Callees.java b/tools/ghidra/ExportAiVmHandler8Callees.java
deleted file mode 100644
index 6ddf317..0000000
--- a/tools/ghidra/ExportAiVmHandler8Callees.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// Emits the two non-trivial local callees reached by Handler(8). Run headless;
-// the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler8Callees extends GhidraScript {
- private static final long[] ADDRESSES = {0x10002e90L, 0x10005710L};
-
- @Override
- public void run() throws Exception {
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- for (long value : ADDRESSES) {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(value);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI Handler(8) callee " + address + " =====");
- if (function == null) { println("missing"); continue; }
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- }
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmHandler8Transitions.java b/tools/ghidra/ExportAiVmHandler8Transitions.java
deleted file mode 100644
index 2eee9a8..0000000
--- a/tools/ghidra/ExportAiVmHandler8Transitions.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// Emits the state-transition helpers selected by Handler(8). Run headless;
-// the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmHandler8Transitions extends GhidraScript {
- private static final long[] ADDRESSES = {0x10005010L, 0x10005040L};
-
- @Override
- public void run() throws Exception {
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- for (long value : ADDRESSES) {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(value);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI Handler(8) transition " + address + " =====");
- if (function == null) { println("missing"); continue; }
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- }
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAiVmTableInstall.java b/tools/ghidra/ExportAiVmTableInstall.java
deleted file mode 100644
index 842e7dc..0000000
--- a/tools/ghidra/ExportAiVmTableInstall.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the routine that receives the AI VM's verified 73-entry handler table.
-// Run through Ghidra headless analysis; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAiVmTableInstall extends GhidraScript {
- private static final long ADDRESS = 0x10011E70L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== AI VM handler table install =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportAniMeshControlCaller.java b/tools/ghidra/ExportAniMeshControlCaller.java
deleted file mode 100644
index 083d27f..0000000
--- a/tools/ghidra/ExportAniMeshControlCaller.java
+++ /dev/null
@@ -1,21 +0,0 @@
-// Emits the function containing the observed AniMesh Control-loader sequence.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportAniMeshControlCaller extends GhidraScript {
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(0x100032e7L);
- Function function = currentProgram.getFunctionManager().getFunctionContaining(address);
- println("===== AniMesh Control caller =====");
- if (function == null) { println("missing"); return; }
- println("entry=" + function.getEntryPoint());
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportControlFunctions.java b/tools/ghidra/ExportControlFunctions.java
deleted file mode 100644
index 0a31023..0000000
--- a/tools/ghidra/ExportControlFunctions.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Emits decompiled C for the stable public Control.dll exports.
-// Run only through Ghidra headless analysis; it does not modify the input PE.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportControlFunctions extends GhidraScript {
- private static final String[] NAMES = {
- "InitializeSettings", "LoadControlSystem", "LoadPhysicalModel",
- "CreateCollManager", "CreateCollObject"
- };
- private static final long[] ADDRESSES = {
- 0x10032260L, 0x10032280L, 0x10032580L, 0x100325d0L, 0x10032600L
- };
-
- @Override
- public void run() throws Exception {
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- for (int index = 0; index < NAMES.length; index++) {
- Address address = currentProgram.getAddressFactory()
- .getDefaultAddressSpace().getAddress(ADDRESSES[index]);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("\n===== " + NAMES[index] + " =====");
- if (function == null) {
- println("missing");
- continue;
- }
- println(decompiler.decompileFunction(function, 60, monitor)
- .getDecompiledFunction().getC());
- }
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportIron3dAiCallback.java b/tools/ghidra/ExportIron3dAiCallback.java
deleted file mode 100644
index 23e9888..0000000
--- a/tools/ghidra/ExportIron3dAiCallback.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the live CreateSuperAI host callback selected by the GOG AutoDemo.
-// Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportIron3dAiCallback extends GhidraScript {
- private static final long ADDRESS = 0x100611d0L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== Iron3D CreateSuperAI callback =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 120, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportIron3dAiCallbackCommand1.java b/tools/ghidra/ExportIron3dAiCallbackCommand1.java
deleted file mode 100644
index 08e8d73..0000000
--- a/tools/ghidra/ExportIron3dAiCallbackCommand1.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits the command-one consumer reached from the recovered CreateSuperAI
-// host callback. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportIron3dAiCallbackCommand1 extends GhidraScript {
- private static final long ADDRESS = 0x10095160L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== Iron3D CreateSuperAI callback command 1 =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 120, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/ExportIron3dAiCallbackCommand1Dispatch.java b/tools/ghidra/ExportIron3dAiCallbackCommand1Dispatch.java
deleted file mode 100644
index a5712a1..0000000
--- a/tools/ghidra/ExportIron3dAiCallbackCommand1Dispatch.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Emits command one's selected-node dispatch callee. Run headless; the
-// original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-
-public class ExportIron3dAiCallbackCommand1Dispatch extends GhidraScript {
- private static final long ADDRESS = 0x10095600L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- Function function = currentProgram.getFunctionManager().getFunctionAt(address);
- println("===== Iron3D callback command 1 node dispatch =====");
- if (function == null) { println("missing"); return; }
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- println(decompiler.decompileFunction(function, 120, monitor).getDecompiledFunction().getC());
- decompiler.dispose();
- }
-}
diff --git a/tools/ghidra/FindAiScriptLoaderReferences.java b/tools/ghidra/FindAiScriptLoaderReferences.java
deleted file mode 100644
index 5aae152..0000000
--- a/tools/ghidra/FindAiScriptLoaderReferences.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Locates callers that reference the stable AI script-loader literals.
-// Run through Ghidra headless analysis; the original PE is read only.
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-import ghidra.program.model.mem.Memory;
-import ghidra.program.model.symbol.Reference;
-import ghidra.program.model.symbol.ReferenceManager;
-
-public class FindAiScriptLoaderReferences extends GhidraScript {
- private static final String[] NEEDLES = {".scr", "MISSIONS\\SCRIPTS\\"};
-
- @Override
- public void run() throws Exception {
- Memory memory = currentProgram.getMemory();
- ReferenceManager references = currentProgram.getReferenceManager();
- for (String needle : NEEDLES) {
- byte[] bytes = (needle + "\0").getBytes("US-ASCII");
- Address address = memory.findBytes(memory.getMinAddress(), memory.getMaxAddress(), bytes, null, true, monitor);
- println("===== " + needle + " =====");
- if (address == null) { println("missing"); continue; }
- println("literal=" + address);
- for (Reference reference : references.getReferencesTo(address)) {
- Function caller = currentProgram.getFunctionManager().getFunctionContaining(reference.getFromAddress());
- println("reference=" + reference.getFromAddress() + " caller=" + (caller == null ? "missing" : caller.getEntryPoint()));
- }
- }
- }
-}
diff --git a/tools/ghidra/FindAiVmHandler30Callback.java b/tools/ghidra/FindAiVmHandler30Callback.java
deleted file mode 100644
index a6da0ad..0000000
--- a/tools/ghidra/FindAiVmHandler30Callback.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Finds writers and readers of Handler(30)'s callback pointer, then decompiles
-// their containing functions. Run headless; the original PE remains read only.
-import ghidra.app.decompiler.DecompInterface;
-import ghidra.app.script.GhidraScript;
-import ghidra.program.model.address.Address;
-import ghidra.program.model.listing.Function;
-import ghidra.program.model.symbol.Reference;
-
-public class FindAiVmHandler30Callback extends GhidraScript {
- private static final long ADDRESS = 0x100555e4L;
-
- @Override
- public void run() throws Exception {
- Address address = currentProgram.getAddressFactory().getDefaultAddressSpace()
- .getAddress(ADDRESS);
- DecompInterface decompiler = new DecompInterface();
- decompiler.openProgram(currentProgram);
- for (Reference reference : currentProgram.getReferenceManager().getReferencesTo(address)) {
- Function function = currentProgram.getFunctionManager()
- .getFunctionContaining(reference.getFromAddress());
- println("===== callback reference " + reference.getFromAddress() + " =====");
- if (function == null) { println("no containing function"); continue; }
- println(decompiler.decompileFunction(function, 60, monitor).getDecompiledFunction().getC());
- }
- decompiler.dispose();
- }
-}