frida / frida-gum

Cross-platform instrumentation and introspection library written in C
https://frida.re
Other
733 stars 242 forks source link

result = gum_memory_read result is null #729

Open forgottor opened 1 year ago

forgottor commented 1 year ago

in frida-gum/tests/core/memory.c

MEMORY_TESTCASE (read_from_valid_address_should_succeed) { guint8 magic[2] = { 0x13, 0x37 }; gsize n_bytes_read; guint8 * result;

result = gum_memory_read (GUM_ADDRESS (magic), sizeof (magic), &n_bytes_read); g_assert (result != NULL);

g_assert_cmpuint (n_bytes_read, ==, sizeof (magic));

g_assert_cmphex (result[0], ==, magic[0]); g_assert_cmphex (result[1], ==, magic[1]);

g_free (result); }