This commit is contained in:
2024-09-23 21:48:35 +08:00
parent a0f0588018
commit 80c072e757
11 changed files with 202 additions and 24 deletions

View File

@@ -209,7 +209,8 @@ public class FunctionDumper {
Function calledFunction = script.getFunctionAt(callAddr);
if (calledFunction != null) {
if (isValidFunction(calledFunction)) {
headers.add("extern " + calledFunction.getSignature().getPrototypeString(true)
String proto = calledFunction.getSignature().getPrototypeString(false);
headers.add("extern " + proto
+ "; // " + calledFunction.getEntryPoint() + " // "
+ calledFunction.getName());
}

View File

@@ -5,6 +5,7 @@ import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Dictionary;
import java.util.HashMap;
@@ -173,8 +174,10 @@ public class GlobalDumper {
public void saveGlobalManifest() throws Exception {
try (PrintWriter writer = new PrintWriter(manifestFile)) {
script.println("Saving global manifest to " + manifestFile);
for (Map.Entry<Address, GlobalRec> entry : globalAddrs.entrySet()) {
writer.println(entry.getKey().toString() + " || " + entry.getValue().name + " || " + entry.getValue().type.getDisplayName());
GlobalRec[] globals = globalAddrs.values().toArray(new GlobalRec[0]);
Arrays.sort(globals, (a, b) -> a.address.compareTo(b.address));
for (GlobalRec global : globals) {
writer.println(global.address.toString() + " || " + global.name + " || " + global.type.getDisplayName());
}
}
}