39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
|
|
import sys
|
||
|
|
|
||
|
|
sys.path.insert(0, r"k:\mcp\GhidraMCP")
|
||
|
|
import bridge_mcp_ghidra as bridge
|
||
|
|
|
||
|
|
|
||
|
|
updates = [
|
||
|
|
{
|
||
|
|
"address": "12d0:0513",
|
||
|
|
"name": "InitOnce",
|
||
|
|
"comment": (
|
||
|
|
"Live re-anchor for the 0x4588 presentation-callback broker install path. "
|
||
|
|
"Guards on 0x4594, snapshots current video/system state into 0x458c/0x4590, installs "
|
||
|
|
"the nullable broker pointer at 0x4588, and ensures the fallback buffer at 0x45a6 exists."
|
||
|
|
),
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"address": "12d0:0656",
|
||
|
|
"name": "TeardownOnce",
|
||
|
|
"comment": (
|
||
|
|
"Live re-anchor for the 0x4588 presentation-callback broker teardown path. "
|
||
|
|
"Guards on 0x4595, clears the installed broker pointer, conditionally emits broker slot +0x0c "
|
||
|
|
"when 0x4590 != 0x458c, then calls broker slot +0x04 before final video/system cleanup."
|
||
|
|
),
|
||
|
|
},
|
||
|
|
]
|
||
|
|
|
||
|
|
for update in updates:
|
||
|
|
print(f"=== {update['address']} -> {update['name']} ===")
|
||
|
|
print(
|
||
|
|
bridge.set_function_class(
|
||
|
|
function_address=update["address"],
|
||
|
|
class_path="Remorse::PresentationCallbackBroker",
|
||
|
|
method_name=update["name"],
|
||
|
|
)
|
||
|
|
)
|
||
|
|
print(bridge.set_decompiler_comment(update["address"], update["comment"]))
|
||
|
|
print(bridge.get_function_by_address(update["address"]))
|
||
|
|
print()
|