diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2024-08-22 12:55:49 -0600 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2024-10-21 13:56:55 -0400 |
| commit | d8e3001e535fad178c621ff07418f81f25123dc4 (patch) | |
| tree | 54c03cef2f0bdfd9a3b6df4334c81becb63e4993 /lang/rust/rusttypes.h | |
| parent | 0e281a30d73c0f31ef9442fef0346779164231ad (diff) | |
Allow multiple high level representations for display, add Pseudo Rust and a Pseudo Python example plugin
Diffstat (limited to 'lang/rust/rusttypes.h')
| -rw-r--r-- | lang/rust/rusttypes.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lang/rust/rusttypes.h b/lang/rust/rusttypes.h new file mode 100644 index 00000000..419e5253 --- /dev/null +++ b/lang/rust/rusttypes.h @@ -0,0 +1,32 @@ +#pragma once + +#include "binaryninjaapi.h" + +class RustTypePrinter: public BinaryNinja::TypePrinter +{ + void AppendCallingConventionTokens(BinaryNinja::Type* type, BinaryNinja::Platform* platform, uint8_t baseConfidence, + std::vector<BinaryNinja::InstructionTextToken>& tokens); + void GetStructureMemberTokens(BinaryNinja::Platform* platform, BinaryNinja::Type* type, uint8_t baseConfidence, + BNTokenEscapingType escaping, std::vector<BinaryNinja::InstructionTextToken>& out); + +public: + RustTypePrinter(); + + std::vector<BinaryNinja::InstructionTextToken> GetTypeTokensBeforeName( + BinaryNinja::Ref<BinaryNinja::Type> type, BinaryNinja::Ref<BinaryNinja::Platform> platform, + uint8_t baseConfidence = BN_FULL_CONFIDENCE, BinaryNinja::Ref<BinaryNinja::Type> parentType = nullptr, + BNTokenEscapingType escaping = NoTokenEscapingType) override; + std::vector<BinaryNinja::InstructionTextToken> GetTypeTokensAfterName( + BinaryNinja::Ref<BinaryNinja::Type> type, BinaryNinja::Ref<BinaryNinja::Platform> platform, + uint8_t baseConfidence = BN_FULL_CONFIDENCE, BinaryNinja::Ref<BinaryNinja::Type> parentType = nullptr, + BNTokenEscapingType escaping = NoTokenEscapingType) override; + std::vector<BinaryNinja::TypeDefinitionLine> GetTypeLines( + BinaryNinja::Ref<BinaryNinja::Type> type, const BinaryNinja::TypeContainer& types, + const BinaryNinja::QualifiedName& name, int paddingCols = 64, bool collapsed = false, + BNTokenEscapingType escaping = NoTokenEscapingType) override; + + std::vector<BinaryNinja::InstructionTextToken> GetTypeTokensAfterNameInternal( + BinaryNinja::Ref<BinaryNinja::Type> type, BinaryNinja::Ref<BinaryNinja::Platform> platform, + uint8_t baseConfidence = BN_FULL_CONFIDENCE, BinaryNinja::Ref<BinaryNinja::Type> parentType = nullptr, + BNTokenEscapingType escaping = NoTokenEscapingType, bool functionHeader = false); +}; |
