diff --git a/bindings/gumjs/runtime/message-dispatcher.js b/bindings/gumjs/runtime/message-dispatcher.js index c1d1ba2fc..e6dcabad4 100644 --- a/bindings/gumjs/runtime/message-dispatcher.js +++ b/bindings/gumjs/runtime/message-dispatcher.js @@ -70,7 +70,7 @@ function MessageDispatcher() { function reply(id, type, result, params = []) { if (Array.isArray(result) && result.length === 2 && result[1] instanceof ArrayBuffer) { const [value, data] = result; - send(['frida:rpc', id, type, value, ...params], data); + send(['frida:rpc', id, type, undefined, value, ...params], data); } else if (result instanceof ArrayBuffer) { send(['frida:rpc', id, type, undefined, ...params], result); } else { diff --git a/tests/gumjs/script.c b/tests/gumjs/script.c index b442a428b..ded50975f 100644 --- a/tests/gumjs/script.c +++ b/tests/gumjs/script.c @@ -6082,7 +6082,7 @@ TESTCASE (method_can_return_value_and_binary_data) "};"); POST_MESSAGE ("[\"frida:rpc\",42,\"call\",\"read\",[]]"); EXPECT_SEND_MESSAGE_WITH_PAYLOAD_AND_DATA ( - "[\"frida:rpc\",42,\"ok\",{\"meta\":\"data\"}]", + "[\"frida:rpc\",42,\"ok\",null,{\"meta\":\"data\"}]", "59 6f"); }