forked from Vector35/binaryninja-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.h
67 lines (54 loc) · 3.61 KB
/
commands.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <QtWidgets/QWidget>
#include "binaryninjaapi.h"
#include "render.h"
#include "uicontext.h"
/*!
@addtogroup commands
\ingroup uiapi
@{
*/
bool BINARYNINJAUIAPI undefineNameForAddress(BinaryViewRef data, uint64_t addr);
bool BINARYNINJAUIAPI undefineNameForLocalVariable(
BinaryViewRef data, FunctionRef func, const BinaryNinja::Variable& var);
bool BINARYNINJAUIAPI inputNameForAddress(QWidget* parent, BinaryViewRef data, uint64_t addr);
bool BINARYNINJAUIAPI inputNameForLocalVariable(
QWidget* parent, BinaryViewRef data, FunctionRef function, const BinaryNinja::Variable& var);
bool BINARYNINJAUIAPI inputNameForType(
QWidget* parent, std::string& name, const QString& title = "Set Name", const QString& msg = "Enter name:");
bool BINARYNINJAUIAPI InferArraySize(TypeRef& type, size_t selectionSize);
bool BINARYNINJAUIAPI askForNewType(QWidget* parent, std::optional<BinaryNinja::TypeContainer> container, const std::string& title,
bool allowZeroSize, TypeRef& type, BinaryNinja::QualifiedName& name);
bool BINARYNINJAUIAPI inputNewType(QWidget* parent, BinaryViewRef data, FunctionRef currentFunction,
uint64_t currentAddr, size_t selectionSize, HighlightTokenState& highlight);
bool BINARYNINJAUIAPI createInferredMember(QWidget* parent, BinaryViewRef data, HighlightTokenState& highlight,
FunctionRef func, BNFunctionGraphType ilType, size_t instrIndex);
bool BINARYNINJAUIAPI createStructMembers(
QWidget* parent, BinaryViewRef data, HighlightTokenState& highlight, FunctionRef func);
bool BINARYNINJAUIAPI inputPossibleValueSet(QWidget* parent, BinaryViewRef data, FunctionRef currentFunction, BNFunctionGraphType funcType,
const BinaryNinja::Variable& var, size_t ilInstructionIndex = BN_INVALID_EXPR);
bool BINARYNINJAUIAPI getEnumSelection(QWidget* parent, BinaryViewRef data, FunctionRef func, uint64_t constValue,
TypeRef& selectedEnum, bool checkValue, bool canTruncate);
bool BINARYNINJAUIAPI overwriteCode(
BinaryViewRef data, ArchitectureRef arch, uint64_t addr, size_t len, const BinaryNinja::DataBuffer& buffer);
bool BINARYNINJAUIAPI overwriteCode(
BinaryViewRef data, ArchitectureRef arch, uint64_t addr, const BinaryNinja::DataBuffer& buffer);
StructureRef BINARYNINJAUIAPI getInnerMostStructureContaining(BinaryViewRef data, StructureRef structure,
size_t& memberIndex, const std::vector<std::string>& nameList, size_t nameIndex, TypeRef& type,
std::string& typeName);
StructureRef BINARYNINJAUIAPI getInnerMostStructureContainingOffset(BinaryViewRef data, StructureRef structure,
const std::vector<std::string>& nameList, size_t nameIndex, size_t offset, TypeRef& type, std::string& typeName);
// Get the offset of the inner most structure, ralative to the supplied outer most structure
uint64_t BINARYNINJAUIAPI getInnerMostStructureOffset(
BinaryViewRef data, StructureRef structure, const std::vector<std::string>& nameList, size_t nameIndex);
// Auto generate a usable type name with the given prefix
std::string BINARYNINJAUIAPI createStructureName(BinaryNinja::TypeContainer types, const std::string& prefix = "struct_");
std::optional<BinaryNinja::Variable> BINARYNINJAUIAPI getSplitVariableForAssignment(
FunctionRef func, BNFunctionGraphType ilType, uint64_t location, const BinaryNinja::Variable& var);
std::optional<size_t> getVariableDefinitionInstructionIndex(
FunctionRef func, BNFunctionGraphType funcType, const BinaryNinja::Variable& var, size_t ilInstructionIndex);
std::optional<size_t> getVariableDefinitionAddress(
FunctionRef func, BNFunctionGraphType funcType, const BinaryNinja::Variable& var, size_t ilInstructionIndex);
/*!
@}
*/