From fb0049af86f8528a988ade2c5de2199f3d0a28ab Mon Sep 17 00:00:00 2001 From: WorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:07:47 +0200 Subject: [PATCH] barebone: Support binary data in Script.post() --- src/barebone/script.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/barebone/script.vala b/src/barebone/script.vala index ed00b03e3..fb769cc90 100644 --- a/src/barebone/script.vala +++ b/src/barebone/script.vala @@ -420,7 +420,9 @@ namespace Frida { public void post (string json, Bytes? data) { var json_val = ctx.make_string (json); - invoke_void (dispatch_message_func, { json_val }, runtime_obj); + var data_val = (data != null) ? ctx.make_array_buffer (data.get_data ()) : QuickJS.Null; + invoke_void (dispatch_message_func, { json_val, data_val }, runtime_obj); + ctx.free_value (data_val); ctx.free_value (json_val); perform_pending_io ();