From c4f4bf5be39c224b619a5928d380d91122ecf1d8 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Sat, 2 Oct 2021 19:00:41 -0400 Subject: More HLIL API parity; Resolves #2363 --- binaryninjaapi.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 917341aa..6549c290 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3161,6 +3161,7 @@ __attribute__ ((format (printf, 1, 2))) Ref GetFunction(); Ref GetLowLevelILFunction(); Ref GetMediumLevelILFunction(); + Ref GetHighLevelILFunction(); void SetBasicBlockList(std::vector> basicBlocks); void SetLiftedILFunction(Ref liftedIL); @@ -3321,6 +3322,7 @@ __attribute__ ((format (printf, 1, 2))) bool IsMediumLevelILBlock() const; Ref GetLowLevelILFunction() const; Ref GetMediumLevelILFunction() const; + Ref GetHighLevelILFunction() const; bool GetInstructionContainingAddress(uint64_t addr, uint64_t* start); Ref GetSourceBlock() const; @@ -4944,6 +4946,7 @@ __attribute__ ((format (printf, 1, 2))) Ref function; Ref lowLevelILFunction; Ref mediumLevelILFunction; + Ref highLevelILFunction; PluginCommandContext(); }; @@ -5000,6 +5003,18 @@ __attribute__ ((format (printf, 1, 2))) std::function isValid; }; + struct RegisteredHighLevelILFunctionCommand + { + std::function action; + std::function isValid; + }; + + struct RegisteredHighLevelILInstructionCommand + { + std::function action; + std::function isValid; + }; + static void DefaultPluginCommandActionCallback(void* ctxt, BNBinaryView* view); static void AddressPluginCommandActionCallback(void* ctxt, BNBinaryView* view, uint64_t addr); static void RangePluginCommandActionCallback(void* ctxt, BNBinaryView* view, uint64_t addr, uint64_t len); @@ -5012,6 +5027,10 @@ __attribute__ ((format (printf, 1, 2))) BNMediumLevelILFunction* func); static void MediumLevelILInstructionPluginCommandActionCallback(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func, size_t instr); + static void HighLevelILFunctionPluginCommandActionCallback(void* ctxt, BNBinaryView* view, + BNHighLevelILFunction* func); + static void HighLevelILInstructionPluginCommandActionCallback(void* ctxt, BNBinaryView* view, + BNHighLevelILFunction* func, size_t instr); static bool DefaultPluginCommandIsValidCallback(void* ctxt, BNBinaryView* view); static bool AddressPluginCommandIsValidCallback(void* ctxt, BNBinaryView* view, uint64_t addr); @@ -5025,6 +5044,10 @@ __attribute__ ((format (printf, 1, 2))) BNMediumLevelILFunction* func); static bool MediumLevelILInstructionPluginCommandIsValidCallback(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func, size_t instr); + static bool HighLevelILFunctionPluginCommandIsValidCallback(void* ctxt, BNBinaryView* view, + BNHighLevelILFunction* func); + static bool HighLevelILInstructionPluginCommandIsValidCallback(void* ctxt, BNBinaryView* view, + BNHighLevelILFunction* func, size_t instr); public: PluginCommand(const BNPluginCommand& cmd); @@ -5073,6 +5096,16 @@ __attribute__ ((format (printf, 1, 2))) static void RegisterForMediumLevelILInstruction(const std::string& name, const std::string& description, const std::function& action, const std::function& isValid); + static void RegisterForHighLevelILFunction(const std::string& name, const std::string& description, + const std::function& action); + static void RegisterForHighLevelILFunction(const std::string& name, const std::string& description, + const std::function& action, + const std::function& isValid); + static void RegisterForHighLevelILInstruction(const std::string& name, const std::string& description, + const std::function& action); + static void RegisterForHighLevelILInstruction(const std::string& name, const std::string& description, + const std::function& action, + const std::function& isValid); static std::vector GetList(); static std::vector GetValidList(const PluginCommandContext& ctxt); -- cgit v1.3.1