summaryrefslogtreecommitdiff
path: root/binaryninjacore.h
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2025-09-08 20:04:36 -0400
committerRusty Wagner <rusty.wagner@gmail.com>2025-10-21 13:52:39 -0400
commitcae26921cf2b2e564f66e58b77a3963fe36f6d2d (patch)
treebfa7ec8de23c1de758463a894583086c8d0b050e /binaryninjacore.h
parent11ad1fc28470b863326f7136cf9b5723a06e89d3 (diff)
Add constant renderer API
Diffstat (limited to 'binaryninjacore.h')
-rw-r--r--binaryninjacore.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 60850f38..89037998 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -311,6 +311,7 @@ extern "C"
typedef struct BNStringRef BNStringRef;
typedef struct BNIndirectBranchInfo BNIndirectBranchInfo;
typedef struct BNArchitectureAndAddress BNArchitectureAndAddress;
+ typedef struct BNConstantRenderer BNConstantRenderer;
typedef struct BNRemoteFileSearchMatch
{
@@ -3814,6 +3815,17 @@ extern "C"
char* value;
} BNTypeAttribute;
+ typedef struct BNCustomConstantRenderer
+ {
+ void* context;
+ bool (*isValidForType)(void* ctxt, BNHighLevelILFunction* hlil, BNType* type);
+ bool (*renderConstant)(void* ctxt, BNHighLevelILFunction* hlil, size_t expr, BNType* type, int64_t val,
+ BNHighLevelILTokenEmitter* tokens, BNDisassemblySettings* settings, BNOperatorPrecedence precedence);
+ bool (*renderConstantPointer)(void* ctxt, BNHighLevelILFunction* hlil, size_t expr, BNType* type, int64_t val,
+ BNHighLevelILTokenEmitter* tokens, BNDisassemblySettings* settings, BNSymbolDisplayType symbolDisplay,
+ BNOperatorPrecedence precedence);
+ } BNCustomConstantRenderer;
+
BINARYNINJACOREAPI char* BNAllocString(const char* contents);
BINARYNINJACOREAPI char* BNAllocStringWithLength(const char* contents, size_t len);
BINARYNINJACOREAPI void BNFreeString(char* str);
@@ -8690,6 +8702,22 @@ extern "C"
BINARYNINJACOREAPI const char* BNGetStringRefContents(BNStringRef* ref);
BINARYNINJACOREAPI size_t BNGetStringRefSize(BNStringRef* ref);
+ // Constant Renderers
+ BINARYNINJACOREAPI BNConstantRenderer* BNRegisterConstantRenderer(
+ const char* name, BNCustomConstantRenderer* renderer);
+ BINARYNINJACOREAPI BNConstantRenderer* BNGetConstantRendererByName(const char* name);
+ BINARYNINJACOREAPI BNConstantRenderer** BNGetConstantRendererList(size_t* count);
+ BINARYNINJACOREAPI void BNFreeConstantRendererList(BNLanguageRepresentationFunctionType** renderers);
+ BINARYNINJACOREAPI char* BNGetConstantRendererName(BNConstantRenderer* renderer);
+ BINARYNINJACOREAPI bool BNIsConstantRendererValidForType(
+ BNConstantRenderer* renderer, BNHighLevelILFunction* il, BNType* type);
+ BINARYNINJACOREAPI bool BNConstantRendererRenderConstant(BNConstantRenderer* renderer, BNHighLevelILFunction* il,
+ size_t exprIndex, BNType* type, int64_t val, BNHighLevelILTokenEmitter* tokens, BNDisassemblySettings* settings,
+ BNOperatorPrecedence precedence);
+ BINARYNINJACOREAPI bool BNConstantRendererRenderConstantPointer(BNConstantRenderer* renderer,
+ BNHighLevelILFunction* il, size_t exprIndex, BNType* type, int64_t val, BNHighLevelILTokenEmitter* tokens,
+ BNDisassemblySettings* settings, BNSymbolDisplayType symbolDisplay, BNOperatorPrecedence precedence);
+
#ifdef __cplusplus
}
#endif