diff options
| author | Brian Potchik <brian@vector35.com> | 2025-10-31 12:50:58 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2025-10-31 12:50:58 -0400 |
| commit | 2763a555ab005ea88feba9418e09be1cb54f7d90 (patch) | |
| tree | efb5434a7bbcbfcdc767c0e8a15281f6c67d041e | |
| parent | 6fe6761631878e1a11d8c7980999f867feb5510e (diff) | |
Add optional display name field for memory regions.
| -rw-r--r-- | binaryninjaapi.h | 13 | ||||
| -rw-r--r-- | binaryninjacore.h | 4 | ||||
| -rw-r--r-- | python/binaryview.py | 6 |
3 files changed, 22 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index d6f4c711..85efc449 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -8254,6 +8254,19 @@ namespace BinaryNinja { return BNSetMemoryRegionFill(m_object, name.c_str(), fill); } + std::string GetMemoryRegionDisplayName(const std::string& name) + { + char* displayName = BNGetMemoryRegionDisplayName(m_object, name.c_str()); + std::string result = displayName; + BNFreeString(displayName); + return result; + } + + bool SetMemoryRegionDisplayName(const std::string& name, const std::string& displayName) + { + return BNSetMemoryRegionDisplayName(m_object, name.c_str(), displayName.c_str()); + } + bool IsMemoryRegionLocal(const std::string& name) { return BNIsMemoryRegionLocal(m_object, name.c_str()); diff --git a/binaryninjacore.h b/binaryninjacore.h index d62cf038..c3379be0 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -37,7 +37,7 @@ // Current ABI version for linking to the core. This is incremented any time // there are changes to the API that affect linking, including new functions, // new types, or modifications to existing functions or types. -#define BN_CURRENT_CORE_ABI_VERSION 144 +#define BN_CURRENT_CORE_ABI_VERSION 145 // Minimum ABI version that is supported for loading of plugins. Plugins that // are linked to an ABI version less than this will not be able to load and @@ -4399,6 +4399,8 @@ extern "C" BINARYNINJACOREAPI bool BNSetMemoryRegionRebaseable(BNBinaryView* view, const char* name, bool rebaseable); BINARYNINJACOREAPI uint8_t BNGetMemoryRegionFill(BNBinaryView* view, const char* name); BINARYNINJACOREAPI bool BNSetMemoryRegionFill(BNBinaryView* view, const char* name, uint8_t fill); + BINARYNINJACOREAPI char* BNGetMemoryRegionDisplayName(BNBinaryView* view, const char* name); + BINARYNINJACOREAPI bool BNSetMemoryRegionDisplayName(BNBinaryView* view, const char* name, const char* displayName); BINARYNINJACOREAPI bool BNIsMemoryRegionLocal(BNBinaryView* view, const char* name); BINARYNINJACOREAPI void BNResetMemoryMap(BNBinaryView* view); diff --git a/python/binaryview.py b/python/binaryview.py index 5c10eaf5..80723c6c 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -2685,6 +2685,12 @@ class MemoryMap: def set_memory_region_fill(self, name: str, fill: int) -> bool: return core.BNSetMemoryRegionFill(self.handle, name, fill) + def get_memory_region_display_name(self, name: str) -> str: + return core.BNGetMemoryRegionDisplayName(self.handle, name) + + def set_memory_region_display_name(self, name: str, display_name: str) -> bool: + return core.BNSetMemoryRegionDisplayName(self.handle, name, display_name) + def is_memory_region_local(self, name: str) -> bool: return core.BNIsMemoryRegionLocal(self.handle, name) |
