Files
soothe2-re/DumpCandidates.java
Matiq 25cf786c54 Initial commit: soothe2 RE workspace + roadmap
- Инфраструктура: RTTI-дампы (rtti_dsp/full.json), декомпиляции DSP-классов (decomp_*.txt),
  Ghidra-скрипты (Dump*.java, ImportRtti*.java, Diag.java), depthcurve/curve_fits LUT.
- Поведенческая модель sim_v5.py + sim.py (RMSE ~0.3dB), утилиты (measure, tt_sweep, patchparam,
  sweep, harness_*, verify_sim).
- summary.md + roadmap.md (контракт из manual M1-M12, топология пайплайна из OCR, фазы A-C).
- pipeline_ocr.txt: OCR диаграммы Appendix A (mid/side ручка, trim/mix/bypass порядок).
2026-08-16 18:54:40 +03:00

38 lines
1.9 KiB
Java

import ghidra.app.script.GhidraScript;
import ghidra.app.decompiler.DecompInterface;
import ghidra.app.decompiler.DecompileResults;
import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.FunctionManager;
import ghidra.program.model.address.Address;
import java.io.PrintWriter;
import java.io.FileWriter;
public class DumpCandidates extends GhidraScript {
@Override
public void run() throws Exception {
long[] addrs = {
0x180536f70L, 0x180537160L, 0x180536f60L, 0x180536670L,
0x180536660L, 0x180536cc0L, 0x180537720L, 0x180536cb0L,
0x180536b90L, 0x180537930L, 0x180536b80L, 0x180536c60L,
0x1813658a0L, 0x18052c7e0L, 0x18053846cL, 0x1852000000L,
0x18052c7e0L, 0x180538484L, 0x180536b60L, 0x1805379a0L,
0x180536b50L, 0x180536850L
};
DecompInterface di = new DecompInterface();
di.openProgram(currentProgram);
FunctionManager fm = currentProgram.getFunctionManager();
PrintWriter pw = new PrintWriter(new java.io.BufferedWriter(new FileWriter("/home/m/re-tools/decomp_candidates.txt", false)));
for (long a : addrs) {
Address addr = currentProgram.getAddressFactory().getDefaultAddressSpace().getAddress(a);
Function f = fm.getFunctionAt(addr);
if (f == null) { pw.println("=== 0x" + Long.toHexString(a) + " : NOT A FUNCTION ===\n"); continue; }
DecompileResults res = di.decompileFunction(f, 60, monitor);
pw.println("==================== 0x" + Long.toHexString(a) + " " + f.getName() + " size=" + f.getBody().getNumAddresses() + " refs=" + f.getSymbol().getReferenceCount() + " ====");
if (res != null) pw.println(res.getDecompiledFunction().getC());
pw.println();
}
pw.close();
di.dispose();
println("DUMP_DONE");
}
}