summaryrefslogtreecommitdiff
path: root/binaryninjacore.h
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2024-07-18 23:06:19 -0400
committerBrian Potchik <brian@vector35.com>2024-07-18 23:06:19 -0400
commit5fc08034ea071119c5407898c81d0aa012512430 (patch)
tree8aa1b5e8351cb5df68f794a82f0205f213d25869 /binaryninjacore.h
parent4360736956684054546340387193161131118796 (diff)
MemoryMap update with new segment model.
Diffstat (limited to 'binaryninjacore.h')
-rw-r--r--binaryninjacore.h59
1 files changed, 29 insertions, 30 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 6c83924a..cc9f2019 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -37,14 +37,14 @@
// 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 66
+#define BN_CURRENT_CORE_ABI_VERSION 67
// 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
// will require rebuilding. The minimum version is increased when there are
// incompatible changes that break binary compatibility, such as changes to
// existing types or functions.
-#define BN_MINIMUM_CORE_ABI_VERSION 65
+#define BN_MINIMUM_CORE_ABI_VERSION 67
#ifdef __GNUC__
#ifdef BINARYNINJACORE_LIBRARY
@@ -3771,13 +3771,16 @@ extern "C"
// Memory Map
BINARYNINJACOREAPI char* BNGetMemoryMapDescription(BNBinaryView* view);
- BINARYNINJACOREAPI bool BNAddBinaryMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNBinaryView* data);
- BINARYNINJACOREAPI bool BNAddDataMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNDataBuffer* data);
- BINARYNINJACOREAPI bool BNAddRemoteMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNFileAccessor* accessor);
+ BINARYNINJACOREAPI bool BNAddBinaryMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNBinaryView* data, uint32_t flags);
+ BINARYNINJACOREAPI bool BNAddDataMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNDataBuffer* data, uint32_t flags);
+ BINARYNINJACOREAPI bool BNAddRemoteMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNFileAccessor* accessor, uint32_t flags);
BINARYNINJACOREAPI bool BNRemoveMemoryRegion(BNBinaryView* view, const char* name);
- BINARYNINJACOREAPI bool BNIsMemoryRegionEnabled(BNBinaryView* view, const char* name, uint64_t start);
- BINARYNINJACOREAPI bool BNSetMemoryRegionEnabled(BNBinaryView* view, const char* name, uint64_t start, bool enable);
- BINARYNINJACOREAPI bool BNSetMemoryRegionFill(BNBinaryView* view, const char* name, uint64_t start, uint8_t fill);
+ BINARYNINJACOREAPI char* BNGetActiveMemoryRegionAt(BNBinaryView* view, uint64_t addr);
+ BINARYNINJACOREAPI bool BNIsMemoryRegionEnabled(BNBinaryView* view, const char* name);
+ BINARYNINJACOREAPI bool BNSetMemoryRegionEnabled(BNBinaryView* view, const char* name, bool enable);
+ BINARYNINJACOREAPI bool BNIsMemoryRegionRebaseable(BNBinaryView* view, const char* name);
+ BINARYNINJACOREAPI bool BNSetMemoryRegionRebaseable(BNBinaryView* view, const char* name, bool rebaseable);
+ BINARYNINJACOREAPI bool BNSetMemoryRegionFill(BNBinaryView* view, const char* name, uint8_t fill);
BINARYNINJACOREAPI void BNResetMemoryMap(BNBinaryView* view);
// Binary view access
@@ -3817,8 +3820,10 @@ extern "C"
BINARYNINJACOREAPI bool BNIsOffsetExternSemantics(BNBinaryView* view, uint64_t offset);
BINARYNINJACOREAPI bool BNIsOffsetWritableSemantics(BNBinaryView* view, uint64_t offset);
BINARYNINJACOREAPI uint64_t BNGetNextValidOffset(BNBinaryView* view, uint64_t offset);
- BINARYNINJACOREAPI uint64_t BNGetOriginalBase(BNBinaryView* view);
- BINARYNINJACOREAPI void BNSetOriginalBase(BNBinaryView* view, uint64_t base);
+
+ BINARYNINJACOREAPI uint64_t BNGetImageBase(BNBinaryView* view);
+ BINARYNINJACOREAPI uint64_t BNGetOriginalImageBase(BNBinaryView* view);
+ BINARYNINJACOREAPI void BNSetOriginalImageBase(BNBinaryView* view, uint64_t imageBase);
BINARYNINJACOREAPI uint64_t BNGetStartOffset(BNBinaryView* view);
BINARYNINJACOREAPI uint64_t BNGetEndOffset(BNBinaryView* view);
BINARYNINJACOREAPI uint64_t BNGetViewLength(BNBinaryView* view);
@@ -3837,15 +3842,16 @@ extern "C"
BINARYNINJACOREAPI bool BNSaveToFile(BNBinaryView* view, BNFileAccessor* file);
BINARYNINJACOREAPI bool BNSaveToFilename(BNBinaryView* view, const char* filename);
- BINARYNINJACOREAPI void BNDefineRelocation(
- BNBinaryView* view, BNArchitecture* arch, BNRelocationInfo* info, uint64_t target, uint64_t reloc);
- BINARYNINJACOREAPI void BNDefineSymbolRelocation(
- BNBinaryView* view, BNArchitecture* arch, BNRelocationInfo* info, BNSymbol* target, uint64_t reloc);
+
+ BINARYNINJACOREAPI void BNDefineRelocation(BNBinaryView* view, BNArchitecture* arch, BNRelocationInfo* info, uint64_t target, uint64_t reloc);
+ BINARYNINJACOREAPI void BNDefineSymbolRelocation(BNBinaryView* view, BNArchitecture* arch, BNRelocationInfo* info, BNSymbol* target, uint64_t reloc);
BINARYNINJACOREAPI BNRange* BNGetRelocationRanges(BNBinaryView* view, size_t* count);
BINARYNINJACOREAPI BNRange* BNGetRelocationRangesAtAddress(BNBinaryView* view, uint64_t addr, size_t* count);
+ BINARYNINJACOREAPI BNRange* BNGetRelocationRangesInRange(BNBinaryView* view, uint64_t addr, uint64_t size, size_t* count);
BINARYNINJACOREAPI bool BNRangeContainsRelocation(BNBinaryView* view, uint64_t addr, size_t size);
BINARYNINJACOREAPI BNRelocation** BNGetRelocationsAt(BNBinaryView* view, uint64_t addr, size_t* count);
BINARYNINJACOREAPI void BNFreeRelocationList(BNRelocation** relocations, size_t count);
+ BINARYNINJACOREAPI void BNFreeRelocationRanges(BNRange* ranges);
BINARYNINJACOREAPI void BNRegisterDataNotification(BNBinaryView* view, BNBinaryDataNotification* notify);
BINARYNINJACOREAPI void BNUnregisterDataNotification(BNBinaryView* view, BNBinaryDataNotification* notify);
@@ -3903,11 +3909,9 @@ extern "C"
BINARYNINJACOREAPI bool BNSearch(BNBinaryView* view, const char* query, void* context, bool (*callback)(void*, uint64_t, BNDataBuffer*));
BINARYNINJACOREAPI bool BNPerformSearch(const char* query, const uint8_t* buffer, size_t size, bool(*callback)(void*, size_t, size_t), void* context);
- BINARYNINJACOREAPI void BNAddAutoSegment(
- BNBinaryView* view, uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags);
+ BINARYNINJACOREAPI void BNAddAutoSegment(BNBinaryView* view, uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags);
BINARYNINJACOREAPI void BNRemoveAutoSegment(BNBinaryView* view, uint64_t start, uint64_t length);
- BINARYNINJACOREAPI void BNAddUserSegment(
- BNBinaryView* view, uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags);
+ BINARYNINJACOREAPI void BNAddUserSegment(BNBinaryView* view, uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags);
BINARYNINJACOREAPI void BNRemoveUserSegment(BNBinaryView* view, uint64_t start, uint64_t length);
BINARYNINJACOREAPI BNSegment** BNGetSegments(BNBinaryView* view, size_t* count);
BINARYNINJACOREAPI void BNFreeSegmentList(BNSegment** segments, size_t count);
@@ -3936,18 +3940,19 @@ extern "C"
BINARYNINJACOREAPI BNSection** BNGetSectionsAt(BNBinaryView* view, uint64_t addr, size_t* count);
BINARYNINJACOREAPI void BNFreeSectionList(BNSection** sections, size_t count);
BINARYNINJACOREAPI BNSection* BNGetSectionByName(BNBinaryView* view, const char* name);
-
BINARYNINJACOREAPI char** BNGetUniqueSectionNames(BNBinaryView* view, const char** names, size_t count);
+ BINARYNINJACOREAPI BNAddressRange* BNGetAllocatedRanges(BNBinaryView* view, size_t* count);
+ BINARYNINJACOREAPI BNAddressRange* BNGetMappedAddressRanges(BNBinaryView* view, size_t* count);
+ BINARYNINJACOREAPI BNAddressRange* BNGetBackedAddressRanges(BNBinaryView* view, size_t* count);
+ BINARYNINJACOREAPI void BNFreeAddressRanges(BNAddressRange* ranges);
+
BINARYNINJACOREAPI BNNameSpace* BNGetNameSpaces(BNBinaryView* view, size_t* count);
BINARYNINJACOREAPI void BNFreeNameSpaceList(BNNameSpace* nameSpace, size_t count);
BINARYNINJACOREAPI BNNameSpace BNGetExternalNameSpace(void);
BINARYNINJACOREAPI BNNameSpace BNGetInternalNameSpace(void);
BINARYNINJACOREAPI void BNFreeNameSpace(BNNameSpace* name);
- BINARYNINJACOREAPI BNAddressRange* BNGetAllocatedRanges(BNBinaryView* view, size_t* count);
- BINARYNINJACOREAPI void BNFreeAddressRanges(BNAddressRange* ranges);
-
BINARYNINJACOREAPI BNRegisterValueWithConfidence BNGetGlobalPointerValue(BNBinaryView* view);
// Raw binary data view
@@ -6985,17 +6990,11 @@ extern "C"
BINARYNINJACOREAPI uint64_t BNRelocationGetTarget(BNRelocation* reloc);
BINARYNINJACOREAPI uint64_t BNRelocationGetReloc(BNRelocation* reloc);
BINARYNINJACOREAPI BNSymbol* BNRelocationGetSymbol(BNRelocation* reloc);
+
// Segment object methods
- BINARYNINJACOREAPI BNSegment* BNCreateSegment(
- uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags, bool autoDefined);
+ BINARYNINJACOREAPI BNSegment* BNCreateSegment(uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags, bool autoDefined);
BINARYNINJACOREAPI BNSegment* BNNewSegmentReference(BNSegment* seg);
BINARYNINJACOREAPI void BNFreeSegment(BNSegment* seg);
-
- BINARYNINJACOREAPI BNRange* BNSegmentGetRelocationRanges(BNSegment* segment, size_t* count);
- BINARYNINJACOREAPI uint64_t BNSegmentGetRelocationsCount(BNSegment* segment);
- BINARYNINJACOREAPI BNRange* BNSegmentGetRelocationRangesAtAddress(BNSegment* segment, uint64_t addr, size_t* count);
- BINARYNINJACOREAPI bool BNSegmentRangeContainsRelocation(BNSegment* segment, uint64_t addr, size_t size);
- BINARYNINJACOREAPI void BNFreeRelocationRanges(BNRange* ranges);
BINARYNINJACOREAPI uint64_t BNSegmentGetStart(BNSegment* segment);
BINARYNINJACOREAPI uint64_t BNSegmentGetLength(BNSegment* segment);
BINARYNINJACOREAPI uint64_t BNSegmentGetEnd(BNSegment* segment);