From 57dd13b3d5ffddf5c7dbecb412b05d1232519ceb Mon Sep 17 00:00:00 2001 From: Stefano Moioli Date: Sun, 7 Apr 2024 21:58:23 +0200 Subject: [PATCH] add is_range_mapped --- xzre.h | 10 ++++++++++ xzre.lds | 3 +++ 2 files changed, 13 insertions(+) diff --git a/xzre.h b/xzre.h index 69df387..59471dd 100644 --- a/xzre.h +++ b/xzre.h @@ -1233,6 +1233,16 @@ extern BOOL chacha_decrypt( */ extern BOOL secret_data_get_decrypted(u8 *output, global_context_t *ctx); +/** + * @brief verify if a memory range is mapped + * + * @param addr the start address + * @param length the length of the range to check + * @param ctx a structure with a libc_import_t field at offset 0x10 + * @return BOOL TRUE if the whole range is mapped, FALSE otherwise + */ +extern BOOL is_range_mapped(u8* addr, u8 length, global_context_t* ctx); + extern global_context_t *global_ctx; #include "util.h" diff --git a/xzre.lds b/xzre.lds index 0d5a17e..ab27536 100644 --- a/xzre.lds +++ b/xzre.lds @@ -110,6 +110,9 @@ SECTIONS { "secret_data_get_decrypted" = "."; *(.text.parse_lzma10); + + "is_range_mapped" = "."; + *(.text.hc_find_funa); } } INSERT AFTER .text;