MCPcopy Create free account
hub / github.com/evi0s/WMPFDebugger / patchOnLoadStart

Function patchOnLoadStart

frida/hook.js:82–101  ·  view source on GitHub ↗
(base, config)

Source from the content-addressed store, hash-verified

80 send("[hook] hook scene condition -> 1101");
81 miniappScenePtr.writeInt(1101);
82
83 // TODO: customize debugging endpoint
84 // const websocketServerStringPtr = passArgs.add(8).readPointer().add(520);
85 // VERBOSE && console.log("[hook] hook websocket server, original: ", websocketServerStringPtr.readUtf8String());
86 // websocketServerStringPtr.writeUtf8String("ws://127.0.0.1:8189/");
87};
88
89const patchOnLoadStart = (base, config) => {
90 // xref: AppletIndexContainer::OnLoadStart
91 Interceptor.attach(base.add(config.LoadStartHookOffset), {
92 onEnter(args) {
93 send(
94 `[inteceptor] AppletIndexContainer::OnLoadStart onEnter, ` +
95 `indexContainer.this: ${args[0]}`,
96 );
97 // write debug_flag to 0x1
98 if (args[1].and(0xff).toInt32() !== 1) {
99 args[1] = args[1].and(ptr("0xffffffffffffff00")).or(1);
100 }
101 // handle onLoad scene
102 hookOnLoadScene(args[0], config.SceneOffsets);
103 },
104 onLeave(retval) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected