MCPcopy Create free account
hub / github.com/lief-project/LIEF / define_struct_at

Method define_struct_at

plugins/binaryninja/analysis/src/AnalyzerBase.cpp:72–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void AnalyzerBase::define_struct_at(uint64_t address, Ref<Type> type,
73 std::optional<std::string> name, bool force)
74{
75 if (force) {
76 bv_.UndefineDataVariable(address, /*blacklist=*/false);
77 }
78
79 if (auto var = get_defined_var(address)) {
80 BN_DEBUG("Type '{}' already defined at 0x{:016x}",
81 binaryninja::to_string(var->type->GetTypeName()), address);
82 return;
83 }
84
85 if (name) {
86 auto bn_sym = new Symbol(DataSymbol, *name, address, NoBinding);
87 bv_.DefineAutoSymbolAndVariableOrFunction(
88 bv_.GetDefaultPlatform(), bn_sym, type);
89 } else {
90 bv_.DefineDataVariable(address, type);
91 }
92}
93
94
95std::optional<DataVariable> AnalyzerBase::get_defined_var(uint64_t addr) {

Callers

nothing calls this directly

Calls 2

QualifiedNameClass · 0.85
to_stringFunction · 0.50

Tested by

no test coverage detected