Redo some autos
This commit is contained in:
@@ -13,6 +13,12 @@ import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.Function;
|
||||
|
||||
public class FunctionDatabase {
|
||||
public enum Type {
|
||||
Auto,
|
||||
Fix,
|
||||
Stub
|
||||
}
|
||||
|
||||
public class Dependency implements java.io.Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Address address;
|
||||
@@ -42,12 +48,14 @@ public class FunctionDatabase {
|
||||
public Address address;
|
||||
public String name;
|
||||
public File file;
|
||||
public Type type;
|
||||
public List<Dependency> dependencies = new ArrayList<>();
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
out.writeObject(address != null ? address.toString() : null);
|
||||
out.writeObject(name);
|
||||
out.writeObject(file != null ? file.toString() : null);
|
||||
out.writeObject(type);
|
||||
out.writeObject(dependencies);
|
||||
}
|
||||
|
||||
@@ -61,6 +69,7 @@ public class FunctionDatabase {
|
||||
if (fileString != null) {
|
||||
file = new File(fileString);
|
||||
}
|
||||
type = (Type) in.readObject();
|
||||
dependencies = (List<Dependency>) in.readObject();
|
||||
}
|
||||
}
|
||||
@@ -117,8 +126,8 @@ public class FunctionDatabase {
|
||||
Function function = script.getFunctionAt(entry.address);
|
||||
if (function != null) {
|
||||
String dirComponent = entry.file.getParent().toString();
|
||||
boolean isAuto = dirComponent.startsWith(RecompileConfig.INSTANCE.dirDecompAuto.toString());
|
||||
boolean isFix = dirComponent.startsWith(RecompileConfig.INSTANCE.dirDecompFix.toString());
|
||||
boolean isAuto = entry.type == Type.Auto;
|
||||
boolean isFix = entry.type == Type.Fix;
|
||||
// Get the actual symbol name and store it in the hash map
|
||||
String symbolName = function.getName();
|
||||
symbolNames.put(entry.address, symbolName);
|
||||
@@ -212,7 +221,7 @@ public class FunctionDatabase {
|
||||
entry.file.delete();
|
||||
madeAnyChanges = true;
|
||||
}
|
||||
} else if (pendingRegenerate) {
|
||||
} else if (pendingRegenerate && entry.type != Type.Stub) {
|
||||
if (!dryMode) {
|
||||
functionsToRegenerate.add(function);
|
||||
madeAnyChanges = true;
|
||||
|
@@ -107,7 +107,12 @@ public class GlobalDumper {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void addGlobal(Address addr, HighSymbol sym) {
|
||||
public void addGlobal(Address addr, HighSymbol sym) throws Exception {
|
||||
if (addr.compareTo(RecompileConfig.INSTANCE.staticMemoryBlockStart) < 0
|
||||
|| addr.compareTo(RecompileConfig.INSTANCE.staticMemoryBlockEnd) > 0) {
|
||||
throw new Exception("Global address out of range: " + addr);
|
||||
}
|
||||
|
||||
DataType dt = sym.getDataType();
|
||||
// if(symb.get
|
||||
if (sym.getDataType().getName() == "undefined") {
|
||||
|
Reference in New Issue
Block a user