summaryrefslogtreecommitdiff
path: root/binaryninjacore.h
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2021-05-19 20:40:24 -0400
committerKyleMiles <krm504@nyu.edu>2021-07-07 23:27:29 -0400
commitd19f5e85ee26c3d6604798d30ab821d15731cada (patch)
tree9851b7f6bf5589df69508d4489c11148515cb550 /binaryninjacore.h
parent0f58b0742e3010eee6bbd2e15f4dd4930ec0d822 (diff)
DebugInfo - plugable debug information importers - C++, Rust, and Python APIs
Diffstat (limited to 'binaryninjacore.h')
-rw-r--r--binaryninjacore.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h
index def57659..0f6ac60c 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -106,7 +106,9 @@
#define BN_FULL_CONFIDENCE 255
#define BN_MINIMUM_CONFIDENCE 1
+#define BN_DEFAULT_CONFIDENCE 96
#define BN_HEURISTIC_CONFIDENCE 192
+#define BN_DEBUGINFO_CONFIDENCE 200
#define DEFAULT_INTERNAL_NAMESPACE "BNINTERNALNAMESPACE"
#define DEFAULT_EXTERNAL_NAMESPACE "BNEXTERNALNAMESPACE"
@@ -208,6 +210,8 @@ extern "C"
struct BNDisassemblyTextRenderer;
struct BNLinearViewObject;
struct BNLinearViewCursor;
+ struct BNDebugInfo;
+ struct BNDebugInfoParser;
//! Console log levels
@@ -940,6 +944,15 @@ extern "C"
uint8_t typeConfidence;
};
+ struct BNDataVariableAndName
+ {
+ uint64_t address;
+ BNType* type;
+ char* name;
+ bool autoDiscovered;
+ uint8_t typeConfidence;
+ };
+
enum BNMediumLevelILOperation
{
MLIL_NOP,
@@ -2570,6 +2583,21 @@ extern "C"
AllowDeadStoreElimination
};
+ struct BNDebugFunctionInfo
+ {
+ char* shortName;
+ char* fullName;
+ char* rawName;
+ uint64_t address;
+ BNType* returnType;
+ char** parameterNames;
+ BNType** parameterTypes;
+ size_t parameterCount;
+ bool variableParameters;
+ BNCallingConvention* callingConvention;
+ BNPlatform* platform;
+ };
+
BINARYNINJACOREAPI char* BNAllocString(const char* contents);
BINARYNINJACOREAPI void BNFreeString(char* str);
BINARYNINJACOREAPI char** BNAllocStringList(const char** contents, size_t size);
@@ -3673,6 +3701,7 @@ __attribute__ ((format (printf, 1, 2)))
BINARYNINJACOREAPI void BNUndefineUserDataVariable(BNBinaryView* view, uint64_t addr);
BINARYNINJACOREAPI BNDataVariable* BNGetDataVariables(BNBinaryView* view, size_t* count);
BINARYNINJACOREAPI void BNFreeDataVariables(BNDataVariable* vars, size_t count);
+ BINARYNINJACOREAPI void BNFreeDataVariablesAndName(BNDataVariableAndName* vars, size_t count);
BINARYNINJACOREAPI bool BNGetDataVariableAtAddress(BNBinaryView* view, uint64_t addr, BNDataVariable* var);
BINARYNINJACOREAPI bool BNParseTypeString(BNBinaryView* view, const char* text,
@@ -3956,6 +3985,10 @@ __attribute__ ((format (printf, 1, 2)))
BINARYNINJACOREAPI void BNDefineImportedFunction(BNBinaryView* view, BNSymbol* importAddressSym, BNFunction* func, BNType* type);
BINARYNINJACOREAPI BNSymbol* BNDefineAutoSymbolAndVariableOrFunction(BNBinaryView* view, BNPlatform* platform, BNSymbol* sym, BNType* type);
+ BINARYNINJACOREAPI BNDebugInfo* BNGetDebugInfo(BNBinaryView* view);
+ BINARYNINJACOREAPI void BNApplyDebugInfo(BNBinaryView* view, BNDebugInfo* newDebugInfo);
+ BINARYNINJACOREAPI void BNSetDebugInfo(BNBinaryView* view, BNDebugInfo* newDebugInfo);
+
BINARYNINJACOREAPI BNSymbol* BNImportedFunctionFromImportAddressSymbol(BNSymbol* sym, uint64_t addr);
// Low-level IL
@@ -5189,6 +5222,29 @@ __attribute__ ((format (printf, 1, 2)))
BINARYNINJACOREAPI char** BNRustSimplifyStrToFQN(const char* const, bool);
BINARYNINJACOREAPI char* BNRustSimplifyStrToStr(const char* const);
+ BINARYNINJACOREAPI BNDebugInfoParser* BNRegisterDebugInfoParser(const char* name, bool (*isValid)(void*, BNBinaryView*), void (*parseInfo)(void*, BNDebugInfo*, BNBinaryView*), void* context);
+ BINARYNINJACOREAPI void BNUnregisterDebugInfoParser(const char* rawName);
+ BINARYNINJACOREAPI BNDebugInfoParser* BNGetDebugInfoParserByName(const char* name);
+ BINARYNINJACOREAPI BNDebugInfoParser** BNGetDebugInfoParsers(size_t* count);
+ BINARYNINJACOREAPI BNDebugInfoParser** BNGetDebugInfoParsersForView(BNBinaryView* view, size_t* count);
+ BINARYNINJACOREAPI char* BNGetDebugInfoParserName(BNDebugInfoParser* parser);
+ BINARYNINJACOREAPI bool BNIsDebugInfoParserValidForView(BNDebugInfoParser* parser, BNBinaryView* view);
+ BINARYNINJACOREAPI BNDebugInfo* BNParseDebugInfo(BNDebugInfoParser* parser, BNBinaryView* view, BNDebugInfo* existingDebugInfo);
+ BINARYNINJACOREAPI BNDebugInfoParser* BNNewDebugInfoParserReference(BNDebugInfoParser* parser);
+ BINARYNINJACOREAPI void BNFreeDebugInfoParserReference(BNDebugInfoParser* parser);
+ BINARYNINJACOREAPI void BNFreeDebugInfoParserList(BNDebugInfoParser** parsers, size_t count);
+
+ BINARYNINJACOREAPI BNDebugInfo* BNNewDebugInfoReference(BNDebugInfo* debugInfo);
+ BINARYNINJACOREAPI void BNFreeDebugInfoReference(BNDebugInfo* debugInfo);
+ BINARYNINJACOREAPI bool BNAddDebugType(BNDebugInfo* const debugInfo, const char* const name, const BNType* const type);
+ BINARYNINJACOREAPI BNNameAndType* BNGetDebugTypes(BNDebugInfo* const debugInfo, const char* const name, size_t* count);
+ BINARYNINJACOREAPI void BNFreeDebugTypes(BNNameAndType* types, size_t count);
+ BINARYNINJACOREAPI bool BNAddDebugFunction(BNDebugInfo* const debugInfo, BNDebugFunctionInfo* func);
+ BINARYNINJACOREAPI BNDebugFunctionInfo* BNGetDebugFunctions(BNDebugInfo* const debugInfo, const char* const name, size_t* count);
+ BINARYNINJACOREAPI void BNFreeDebugFunctions(BNDebugFunctionInfo* functions, size_t count);
+ BINARYNINJACOREAPI bool BNAddDebugDataVariable(BNDebugInfo* const debugInfo, uint64_t address, const BNType* const type, const char* name);
+ BINARYNINJACOREAPI BNDataVariableAndName* BNGetDebugDataVariables(BNDebugInfo* const debugInfo, const char* const name, size_t* count);
+
#ifdef __cplusplus
}
#endif