From c7ccd714ceeaabbe5ee682e361250c3cfd54f78f Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Fri, 9 Oct 2020 20:57:42 +0000 Subject: Expose Template Simplifier to the API, Adds Tests, and Adds Rust String FFI support to Python (see note) This introduces the ability to receive and free string from Rust in Python. For it to work, your exposed function name needs to begin with "BNRust", and the generator will create the appropriate code for freeing string return values and arguments. --- binaryninjacore.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'binaryninjacore.h') diff --git a/binaryninjacore.h b/binaryninjacore.h index b13f9fb3..a34d1f7e 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -4464,6 +4464,8 @@ __attribute__ ((format (printf, 1, 2))) //Demangler BINARYNINJACOREAPI bool BNDemangleMS(BNArchitecture* arch, const char* mangledName, BNType** outType, char*** outVarName, + size_t* outVarNameElements, const bool simplify); + BINARYNINJACOREAPI bool BNDemangleMSWithOptions(BNArchitecture* arch, const char* mangledName, BNType** outType, char*** outVarName, size_t* outVarNameElements, const BNBinaryView* const view); // Download providers @@ -4607,6 +4609,8 @@ __attribute__ ((format (printf, 1, 2))) BINARYNINJACOREAPI bool BNIsGNU3MangledString(const char* mangledName); BINARYNINJACOREAPI bool BNDemangleGNU3(BNArchitecture* arch, const char* mangledName, BNType** outType, + char*** outVarName, size_t* outVarNameElements, const bool simplify); + BINARYNINJACOREAPI bool BNDemangleGNU3WithOptions(BNArchitecture* arch, const char* mangledName, BNType** outType, char*** outVarName, size_t* outVarNameElements, const BNBinaryView* const view); BINARYNINJACOREAPI void BNFreeDemangledName(char*** name, size_t nameElements); @@ -4872,6 +4876,11 @@ __attribute__ ((format (printf, 1, 2))) BINARYNINJACOREAPI uint32_t BNGetAddressRenderedWidth(uint64_t addr); + BINARYNINJACOREAPI void BNRustFreeString(const char* const); + BINARYNINJACOREAPI void BNRustFreeStringArray(const char** const, uint64_t); + BINARYNINJACOREAPI const char** const BNRustSimplifyStrToFQN(const char* const, bool); + BINARYNINJACOREAPI const char* const BNRustSimplifyStrToStr(const char* const); + #ifdef __cplusplus } #endif -- cgit v1.3.1