From 6520026964065327558472841838510176646568 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 28 May 2024 18:53:17 -0400 Subject: Add AdjustTypeParserArguments callback to platform Implementing the solution to #4868 --- binaryninjacore.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'binaryninjacore.h') diff --git a/binaryninjacore.h b/binaryninjacore.h index a7b968e6..77471530 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -1882,6 +1882,29 @@ extern "C" void (*freeRegisterList)(void* ctxt, uint32_t* regs, size_t len); BNType* (*getGlobalRegisterType)(void* ctxt, uint32_t reg); + + void (*adjustTypeParserInput)( + void* ctxt, + BNTypeParser* parser, + const char* const* argumentsIn, + size_t argumentsLenIn, + const char* const* sourceFileNamesIn, + const char* const* sourceFileValuesIn, + size_t sourceFilesLenIn, + char*** argumentsOut, + size_t* argumentsLenOut, + char*** sourceFileNamesOut, + char*** sourceFileValuesOut, + size_t* sourceFilesLenOut + ); + void (*freeTypeParserInput)( + void* ctxt, + char** arguments, + size_t argumentsLen, + char** sourceFileNames, + char** sourceFileValues, + size_t sourceFilesLen + ); } BNCustomPlatform; typedef struct BNBasicBlockEdge @@ -6408,6 +6431,20 @@ extern "C" BINARYNINJACOREAPI uint32_t* BNGetPlatformGlobalRegisters(BNPlatform* platform, size_t* count); BINARYNINJACOREAPI BNType* BNGetPlatformGlobalRegisterType(BNPlatform* platform, uint32_t reg); + BINARYNINJACOREAPI void BNPlatformAdjustTypeParserInput( + BNPlatform* platform, + BNTypeParser* parser, + const char* const* argumentsIn, + size_t argumentsLenIn, + const char* const* sourceFileNamesIn, + const char* const* sourceFileValuesIn, + size_t sourceFilesLenIn, + char*** argumentsOut, + size_t* argumentsLenOut, + char*** sourceFileNamesOut, + char*** sourceFileValuesOut, + size_t* sourceFilesLenOut + ); BINARYNINJACOREAPI BNPlatform* BNGetArchitectureStandalonePlatform(BNArchitecture* arch); -- cgit v1.3.1