|
37 | 37 | // Current ABI version for linking to the core. This is incremented any time
|
38 | 38 | // there are changes to the API that affect linking, including new functions,
|
39 | 39 | // new types, or modifications to existing functions or types.
|
40 |
| -#define BN_CURRENT_CORE_ABI_VERSION 88 |
| 40 | +#define BN_CURRENT_CORE_ABI_VERSION 89 |
41 | 41 |
|
42 | 42 | // Minimum ABI version that is supported for loading of plugins. Plugins that
|
43 | 43 | // are linked to an ABI version less than this will not be able to load and
|
44 | 44 | // will require rebuilding. The minimum version is increased when there are
|
45 | 45 | // incompatible changes that break binary compatibility, such as changes to
|
46 | 46 | // existing types or functions.
|
47 |
| -#define BN_MINIMUM_CORE_ABI_VERSION 86 |
| 47 | +#define BN_MINIMUM_CORE_ABI_VERSION 89 |
48 | 48 |
|
49 | 49 | #ifdef __GNUC__
|
50 | 50 | #ifdef BINARYNINJACORE_LIBRARY
|
@@ -302,6 +302,7 @@ extern "C"
|
302 | 302 | typedef struct BNDemangler BNDemangler;
|
303 | 303 | typedef struct BNFirmwareNinja BNFirmwareNinja;
|
304 | 304 | typedef struct BNFirmwareNinjaReferenceNode BNFirmwareNinjaReferenceNode;
|
| 305 | + typedef struct BNLineFormatter BNLineFormatter; |
305 | 306 |
|
306 | 307 | //! Console log levels
|
307 | 308 | typedef enum BNLogLevel
|
@@ -727,6 +728,7 @@ extern "C"
|
727 | 728 | HighLevelILLinearDisassembly = 65,
|
728 | 729 | WaitForIL = 66,
|
729 | 730 | IndentHLILBody = 67,
|
| 731 | + DisableLineFormatting = 68, |
730 | 732 |
|
731 | 733 | // Debugging options
|
732 | 734 | ShowFlagUsage = 128,
|
@@ -3439,6 +3441,7 @@ extern "C"
|
3439 | 3441 | bool (*isValid)(void* ctxt, BNBinaryView* view);
|
3440 | 3442 | BNTypePrinter* (*getTypePrinter)(void* ctxt);
|
3441 | 3443 | BNTypeParser* (*getTypeParser)(void* ctxt);
|
| 3444 | + BNLineFormatter* (*getLineFormatter)(void* ctxt); |
3442 | 3445 | BNDisassemblyTextLine* (*getFunctionTypeTokens)(
|
3443 | 3446 | void* ctxt, BNFunction* func, BNDisassemblySettings* settings, size_t* count);
|
3444 | 3447 | void (*freeLines)(void* ctxt, BNDisassemblyTextLine* lines, size_t count);
|
@@ -3538,6 +3541,28 @@ extern "C"
|
3538 | 3541 | size_t unique;
|
3539 | 3542 | } BNFirmwareNinjaDeviceAccesses;
|
3540 | 3543 |
|
| 3544 | + typedef struct BNLineFormatterSettings |
| 3545 | + { |
| 3546 | + BNHighLevelILFunction* highLevelIL; |
| 3547 | + size_t desiredLineLength; |
| 3548 | + size_t minimumContentLength; |
| 3549 | + size_t tabWidth; |
| 3550 | + char* languageName; |
| 3551 | + char* commentStartString; |
| 3552 | + char* commentEndString; |
| 3553 | + char* annotationStartString; |
| 3554 | + char* annotationEndString; |
| 3555 | + } BNLineFormatterSettings; |
| 3556 | + |
| 3557 | + typedef struct BNCustomLineFormatter |
| 3558 | + { |
| 3559 | + void* context; |
| 3560 | + BNDisassemblyTextLine* (*formatLines)(void* ctxt, BNDisassemblyTextLine* inLines, size_t inCount, |
| 3561 | + const BNLineFormatterSettings* settings, size_t* outCount); |
| 3562 | + void (*freeLines)(void* ctxt, BNDisassemblyTextLine* lines, size_t count); |
| 3563 | + } BNCustomLineFormatter; |
| 3564 | + |
| 3565 | + |
3541 | 3566 | BINARYNINJACOREAPI char* BNAllocString(const char* contents);
|
3542 | 3567 | BINARYNINJACOREAPI char* BNAllocStringWithLength(const char* contents, size_t len);
|
3543 | 3568 | BINARYNINJACOREAPI void BNFreeString(char* str);
|
@@ -5453,6 +5478,9 @@ extern "C"
|
5453 | 5478 |
|
5454 | 5479 | // Disassembly settings
|
5455 | 5480 | BINARYNINJACOREAPI BNDisassemblySettings* BNCreateDisassemblySettings(void);
|
| 5481 | + BINARYNINJACOREAPI BNDisassemblySettings* BNDefaultDisassemblySettings(void); |
| 5482 | + BINARYNINJACOREAPI BNDisassemblySettings* BNDefaultGraphDisassemblySettings(void); |
| 5483 | + BINARYNINJACOREAPI BNDisassemblySettings* BNDefaultLinearDisassemblySettings(void); |
5456 | 5484 | BINARYNINJACOREAPI BNDisassemblySettings* BNNewDisassemblySettingsReference(BNDisassemblySettings* settings);
|
5457 | 5485 | BINARYNINJACOREAPI BNDisassemblySettings* BNDuplicateDisassemblySettings(BNDisassemblySettings* settings);
|
5458 | 5486 | BINARYNINJACOREAPI void BNFreeDisassemblySettings(BNDisassemblySettings* settings);
|
@@ -6143,15 +6171,19 @@ extern "C"
|
6143 | 6171 | BNLanguageRepresentationFunctionType* type, BNBinaryView* view);
|
6144 | 6172 | BINARYNINJACOREAPI BNTypePrinter* BNGetLanguageRepresentationFunctionTypePrinter(BNLanguageRepresentationFunctionType* type);
|
6145 | 6173 | BINARYNINJACOREAPI BNTypeParser* BNGetLanguageRepresentationFunctionTypeParser(BNLanguageRepresentationFunctionType* type);
|
| 6174 | + BINARYNINJACOREAPI BNLineFormatter* BNGetLanguageRepresentationFunctionTypeLineFormatter( |
| 6175 | + BNLanguageRepresentationFunctionType* type); |
6146 | 6176 | BINARYNINJACOREAPI BNDisassemblyTextLine* BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens(
|
6147 | 6177 | BNLanguageRepresentationFunctionType* type, BNFunction* func, BNDisassemblySettings* settings, size_t* count);
|
6148 | 6178 |
|
6149 | 6179 | BINARYNINJACOREAPI BNLanguageRepresentationFunction* BNCreateCustomLanguageRepresentationFunction(
|
6150 |
| - BNArchitecture* arch, BNFunction* func, BNHighLevelILFunction* highLevelIL, |
6151 |
| - BNCustomLanguageRepresentationFunction* callbacks); |
| 6180 | + BNLanguageRepresentationFunctionType* type, BNArchitecture* arch, BNFunction* func, |
| 6181 | + BNHighLevelILFunction* highLevelIL, BNCustomLanguageRepresentationFunction* callbacks); |
6152 | 6182 | BINARYNINJACOREAPI BNLanguageRepresentationFunction* BNNewLanguageRepresentationFunctionReference(
|
6153 | 6183 | BNLanguageRepresentationFunction* func);
|
6154 | 6184 | BINARYNINJACOREAPI void BNFreeLanguageRepresentationFunction(BNLanguageRepresentationFunction* func);
|
| 6185 | + BINARYNINJACOREAPI BNLanguageRepresentationFunctionType* BNGetLanguageRepresentationType( |
| 6186 | + BNLanguageRepresentationFunction* func); |
6155 | 6187 | BINARYNINJACOREAPI BNArchitecture* BNGetLanguageRepresentationArchitecture(BNLanguageRepresentationFunction* func);
|
6156 | 6188 | BINARYNINJACOREAPI BNFunction* BNGetLanguageRepresentationOwnerFunction(BNLanguageRepresentationFunction* func);
|
6157 | 6189 | BINARYNINJACOREAPI BNHighLevelILFunction* BNGetLanguageRepresentationILFunction(BNLanguageRepresentationFunction* func);
|
@@ -8056,6 +8088,25 @@ extern "C"
|
8056 | 8088 | BINARYNINJACOREAPI void BNFreeFirmwareNinjaReferenceNode(BNFirmwareNinjaReferenceNode* node);
|
8057 | 8089 | BINARYNINJACOREAPI BNFirmwareNinjaReferenceNode* BNNewFirmwareNinjaReferenceNodeReference(BNFirmwareNinjaReferenceNode* node);
|
8058 | 8090 | BINARYNINJACOREAPI void BNFreeFirmwareNinjaReferenceNodes(BNFirmwareNinjaReferenceNode** nodes, size_t count);
|
| 8091 | + |
| 8092 | + // Line formatters |
| 8093 | + BINARYNINJACOREAPI BNLineFormatter* BNRegisterLineFormatter(const char* name, BNCustomLineFormatter* callbacks); |
| 8094 | + BINARYNINJACOREAPI BNLineFormatter** BNGetLineFormatterList(size_t* count); |
| 8095 | + BINARYNINJACOREAPI void BNFreeLineFormatterList(BNLineFormatter** formatters); |
| 8096 | + BINARYNINJACOREAPI BNLineFormatter* BNGetLineFormatterByName(const char* name); |
| 8097 | + BINARYNINJACOREAPI BNLineFormatter* BNGetDefaultLineFormatter(); |
| 8098 | + |
| 8099 | + BINARYNINJACOREAPI char* BNGetLineFormatterName(BNLineFormatter* formatter); |
| 8100 | + |
| 8101 | + BINARYNINJACOREAPI BNDisassemblyTextLine* BNFormatLines(BNLineFormatter* formatter, BNDisassemblyTextLine* inLines, |
| 8102 | + size_t inCount, const BNLineFormatterSettings* settings, size_t* outCount); |
| 8103 | + |
| 8104 | + BINARYNINJACOREAPI BNLineFormatterSettings* BNGetDefaultLineFormatterSettings( |
| 8105 | + BNDisassemblySettings* settings, BNHighLevelILFunction* func); |
| 8106 | + BINARYNINJACOREAPI BNLineFormatterSettings* BNGetLanguageRepresentationLineFormatterSettings( |
| 8107 | + BNDisassemblySettings* settings, BNLanguageRepresentationFunction* func); |
| 8108 | + BINARYNINJACOREAPI void BNFreeLineFormatterSettings(BNLineFormatterSettings* settings); |
| 8109 | + |
8059 | 8110 | #ifdef __cplusplus
|
8060 | 8111 | }
|
8061 | 8112 | #endif
|
|
0 commit comments