This commit is contained in:
2025-05-29 15:56:11 +08:00
parent 58397127e7
commit 0383ef8f13
5 changed files with 92 additions and 76 deletions

View File

@@ -1,5 +1,6 @@
// @category _Reman3
// @menupath Reman3.Test
// @importpackage org.sqlite
import ghidra.app.script.GhidraScript;
import ghidra.program.model.address.Address;
@@ -26,15 +27,15 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Test extends GhidraScript {
// Will rebuild all functions
public boolean rebuildAllGlobals = true;
FunctionDatabase functionDB;
import org.sqlite.JDBC;
public class Test extends GhidraScript {
@Override
public void run() throws Exception {
RecompileConfig.INSTANCE = new RecompileConfig(this);
java.sql.DriverManager.registerDriver(new JDBC());
// Example SQLite usage
testSQLite();
}
@@ -80,14 +81,4 @@ public class Test extends GhidraScript {
throw e;
}
}
private void scanDirectory(File directory, FunctionDatabase.Type type) throws Exception {
File[] files = directory.listFiles((dir, name) -> name.endsWith(".cxx"));
if (files == null)
return;
for (File file : files) {
scanFile(file, type);
}
}
}

View File

@@ -16,7 +16,8 @@ public class FunctionDatabase {
public enum Type {
Auto,
Fix,
Stub
Stub,
Ref
}
public class Dependency implements java.io.Serializable {

View File

@@ -1,3 +1,13 @@
# Ghidra Scripts
Add this to your scripts folder and run to generate c code for all functions in the project
Add this to your ghidra scripts folder to add the reman decompile scripts to ghidra
NOTE: Make sure to also add the include `sqlite-jdbc-3.49.1.0.jar` to the ghidra scripts folders, as this is required for the ghidra scripts to read the decompile database.
## Decompile database
The decompile database is a sqlite database that contains a list of all files that implement decompiled functions and their source address. It is used to regenerate files, check for duplicates, and more.
To generate the database from the current set of files, run the scan_sources script in the /game_re folder.
Make sure you have set up the tooling by running the /tooling/setup script.