| 70 | } |
| 71 | |
| 72 | void 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 | |
| 95 | std::optional<DataVariable> AnalyzerBase::get_defined_var(uint64_t addr) { |
nothing calls this directly
no test coverage detected