Files
daniel-lynch--ovrplugin-ope…/ghidra_scripts/DumpReal.java
T
Daniel LynchandClaude Opus 4.8 a72a79ad29 Initial public release: OVRPlugin→OpenXR interoperability shim
An independent reimplementation of Meta's libOVRPlugin ABI on top of OpenXR, so
VrApi-era Meta Quest VR titles can run on non-Meta OpenXR runtimes (Monado,
Steam Frame) instead of being locked to Meta hardware. Original code only — no
Meta/Epic/Capcom binaries, headers, or assets. Includes a desktop harness that
drives the shim against Monado headless.

Scope/legal: interoperability; entitlement handling is out of scope. See README
for the legal/scope section and docs/ for the research trail and design notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6sFYGXZPsq3v7xtcDES6g
2026-06-29 00:48:48 -04:00

37 lines
1.7 KiB
Java

// Resolve export thunks to their real implementations and decompile them.
// -> ~/dev/re4vr-port/analysis/real_impls.txt
// @category RE4VR
import ghidra.app.script.GhidraScript;
import ghidra.app.decompiler.*;
import ghidra.program.model.listing.*;
import java.io.PrintWriter;
import java.util.*;
public class DumpReal extends GhidraScript {
public void run() throws Exception {
String out = System.getProperty("user.home") + "/dev/re4vr-port/analysis/real_impls.txt";
Set<String> targets = new HashSet<>(Arrays.asList(
"ovrp_Initialize5", "ovrp_PreInitialize3", "ovrp_SetupDistortionWindow3",
"ovrp_GetInstanceExtensionsVk", "ovrp_GetDeviceExtensionsVk"));
PrintWriter w = new PrintWriter(out);
DecompInterface dec = new DecompInterface();
dec.openProgram(currentProgram);
FunctionManager fm = currentProgram.getFunctionManager();
for (Function f : fm.getFunctions(true)) {
if (!targets.contains(f.getName())) continue;
Function real = f.isThunk() ? f.getThunkedFunction(true) : f;
w.println("\n/* ===== " + f.getName() + " thunk@" + f.getEntryPoint()
+ " -> real@" + (real != null ? real.getEntryPoint() : "?")
+ " ===== */");
if (real == null) { w.println(" (could not resolve thunk)"); continue; }
try {
DecompileResults r = dec.decompileFunction(real, 120, monitor);
DecompiledFunction df = r.getDecompiledFunction();
w.println(df != null ? df.getC() : " (decompile failed)");
} catch (Exception e) { w.println(" (exception)"); }
}
w.close();
println("DumpReal: wrote " + out);
}
}