diff --git a/bindings/gumjs/runtime/message-dispatcher.js b/bindings/gumjs/runtime/message-dispatcher.js index 035fe03db..6661d0414 100644 --- a/bindings/gumjs/runtime/message-dispatcher.js +++ b/bindings/gumjs/runtime/message-dispatcher.js @@ -71,7 +71,7 @@ function MessageDispatcher() { params = params || []; if (result instanceof ArrayBuffer) - send(['frida:rpc', id, type, {}].concat(params), result); + send(['frida:rpc', id, type, undefined].concat(params), result); else send(['frida:rpc', id, type, result].concat(params)); } diff --git a/tests/gumjs/script.c b/tests/gumjs/script.c index 4642a9333..0dbd57d4f 100644 --- a/tests/gumjs/script.c +++ b/tests/gumjs/script.c @@ -6066,7 +6066,7 @@ TESTCASE (method_can_return_binary_data) "return buf.readByteArray(2);" "};"); POST_MESSAGE ("[\"frida:rpc\",42,\"call\",\"read\",[]]"); - EXPECT_SEND_MESSAGE_WITH_PAYLOAD_AND_DATA ("[\"frida:rpc\",42,\"ok\",{}]", + EXPECT_SEND_MESSAGE_WITH_PAYLOAD_AND_DATA ("[\"frida:rpc\",42,\"ok\",null]", "59 6f"); }