summaryrefslogtreecommitdiff
path: root/binaryninjacore.h
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-02-15 20:08:06 -0500
committerGlenn Smith <glenn@vector35.com>2022-02-16 15:32:39 -0500
commit925323f286e2ff2b866c2c65cdcc342cafa4afe7 (patch)
tree0540cb24a37fad76fa46d20af49c0a6ac402b916 /binaryninjacore.h
parentff9ee07f19597d90ac68d0bd04ab58947f2e604f (diff)
Escape type names and definitions
Closes #2427, #2585, #1658, #1632, probably others
Diffstat (limited to 'binaryninjacore.h')
-rw-r--r--binaryninjacore.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 25500d0b..e72830a1 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -28,14 +28,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 17
+#define BN_CURRENT_CORE_ABI_VERSION 18
// 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 13
+#define BN_MINIMUM_CORE_ABI_VERSION 18
#ifdef __GNUC__
#ifdef BINARYNINJACORE_LIBRARY
@@ -356,6 +356,12 @@ extern "C"
AnalysisWarningLineType
};
+ enum BNTokenEscapingType
+ {
+ NoTokenEscapingType = 0,
+ BackticksTokenEscapingType = 1,
+ };
+
enum BNAnalysisWarningActionType
{
NoAnalysisWarningAction = 0,
@@ -4028,6 +4034,8 @@ extern "C"
char** errors, BNQualifiedNameList* typesAllowRedefinition);
BINARYNINJACOREAPI void BNFreeQualifiedNameAndType(BNQualifiedNameAndType* obj);
BINARYNINJACOREAPI void BNFreeQualifiedNameAndTypeArray(BNQualifiedNameAndType* obj, size_t count);
+ BINARYNINJACOREAPI char* BNEscapeTypeName(const char* name, BNTokenEscapingType escaping);
+ BINARYNINJACOREAPI char* BNUnescapeTypeName(const char* name, BNTokenEscapingType escaping);
BINARYNINJACOREAPI BNQualifiedNameAndType* BNGetAnalysisTypeList(BNBinaryView* view, size_t* count);
BINARYNINJACOREAPI void BNFreeTypeList(BNQualifiedNameAndType* types, size_t count);
@@ -4952,7 +4960,7 @@ extern "C"
BNBoolWithConfidence* varArg, BNOffsetWithConfidence* stackAdjust);
BINARYNINJACOREAPI BNType* BNNewTypeReference(BNType* type);
BINARYNINJACOREAPI BNType* BNDuplicateType(BNType* type);
- BINARYNINJACOREAPI char* BNGetTypeAndName(BNType* type, BNQualifiedName* name);
+ BINARYNINJACOREAPI char* BNGetTypeAndName(BNType* type, BNQualifiedName* name, BNTokenEscapingType escaping);
BINARYNINJACOREAPI void BNFreeType(BNType* type);
BINARYNINJACOREAPI BNTypeBuilder* BNCreateTypeBuilderFromType(BNType* type);
@@ -5012,15 +5020,15 @@ extern "C"
BINARYNINJACOREAPI uint32_t BNTypeGetSystemCallNumber(BNType* type);
BINARYNINJACOREAPI bool BNTypeIsSystemCall(BNType* type);
- BINARYNINJACOREAPI char* BNGetTypeString(BNType* type, BNPlatform* platform);
- BINARYNINJACOREAPI char* BNGetTypeStringBeforeName(BNType* type, BNPlatform* platform);
- BINARYNINJACOREAPI char* BNGetTypeStringAfterName(BNType* type, BNPlatform* platform);
+ BINARYNINJACOREAPI char* BNGetTypeString(BNType* type, BNPlatform* platform, BNTokenEscapingType escaping);
+ BINARYNINJACOREAPI char* BNGetTypeStringBeforeName(BNType* type, BNPlatform* platform, BNTokenEscapingType escaping);
+ BINARYNINJACOREAPI char* BNGetTypeStringAfterName(BNType* type, BNPlatform* platform, BNTokenEscapingType escaping);
BINARYNINJACOREAPI BNInstructionTextToken* BNGetTypeTokens(
- BNType* type, BNPlatform* platform, uint8_t baseConfidence, size_t* count);
+ BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNTokenEscapingType escaping, size_t* count);
BINARYNINJACOREAPI BNInstructionTextToken* BNGetTypeTokensBeforeName(
- BNType* type, BNPlatform* platform, uint8_t baseConfidence, size_t* count);
+ BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNTokenEscapingType escaping, size_t* count);
BINARYNINJACOREAPI BNInstructionTextToken* BNGetTypeTokensAfterName(
- BNType* type, BNPlatform* platform, uint8_t baseConfidence, size_t* count);
+ BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNTokenEscapingType escaping, size_t* count);
BINARYNINJACOREAPI BNType* BNTypeWithReplacedStructure(BNType* type, BNStructure* from, BNStructure* to);
BINARYNINJACOREAPI BNType* BNTypeWithReplacedEnumeration(BNType* type, BNEnumeration* from, BNEnumeration* to);
@@ -5029,7 +5037,7 @@ extern "C"
BINARYNINJACOREAPI bool BNAddTypeMemberTokens(BNType* type, BNBinaryView* data, BNInstructionTextToken** tokens,
size_t* tokenCount, int64_t offset, char*** nameList, size_t* nameCount, size_t size, bool indirect);
- BINARYNINJACOREAPI BNTypeDefinitionLine* BNGetTypeLines(BNType* type, BNBinaryView* data, const char* name, int lineWidth, bool collapsed, size_t* count);
+ BINARYNINJACOREAPI BNTypeDefinitionLine* BNGetTypeLines(BNType* type, BNBinaryView* data, const char* name, int lineWidth, bool collapsed, BNTokenEscapingType escaping, size_t* count);
BINARYNINJACOREAPI void BNFreeTypeDefinitionLineList(BNTypeDefinitionLine* list, size_t count);
BINARYNINJACOREAPI BNQualifiedName BNTypeBuilderGetTypeName(BNTypeBuilder* nt);