From 5575f75698d02f82a7fe02912b0b11a8d996c908 Mon Sep 17 00:00:00 2001 From: Francesco Tamagni Date: Wed, 17 Jan 2024 17:12:42 +0100 Subject: [PATCH] Try to make pointer stringification portable --- tests/gumjs/script.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/gumjs/script.c b/tests/gumjs/script.c index d46447dec..30b1d880e 100644 --- a/tests/gumjs/script.c +++ b/tests/gumjs/script.c @@ -10918,13 +10918,11 @@ TESTCASE (java_api_is_embedded) TESTCASE (cloaked_items_can_be_queried_added_and_removed) { - char * buffer = (char *) malloc (64); + void * buffer = malloc (64); COMPILE_AND_LOAD_SCRIPT ( - "const bufferAt = '%p';" - "send(bufferAt);" - "const x = ptr(bufferAt);" - //"send(Cloak.hasRangeContaining(x) === false);" + "const x = ptr('0x%" G_GINT64_MODIFIER "x');" + "send(Cloak.hasRangeContaining(x) === false);" "send(Process.findRangeByAddress(x) !== null);" "send(Cloak.clipRange(x, 64) === null);" "Cloak.addRange(x, 64);" @@ -10947,7 +10945,7 @@ TESTCASE (cloaked_items_can_be_queried_added_and_removed) "send(Cloak.hasFileDescriptor(fd));" "Cloak.removeFileDescriptor(fd);" "send(!Cloak.hasFileDescriptor(fd));", - buffer + GPOINTER_TO_SIZE (buffer) ); EXPECT_SEND_MESSAGE_WITH ("true"); EXPECT_SEND_MESSAGE_WITH ("true");