MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / GetSymbol

Method GetSymbol

view/sharedcache/core/ObjC.cpp:151–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151Ref<Symbol> SharedCacheObjCProcessor::GetSymbol(uint64_t address)
152{
153 if (const auto symbol = m_data->GetSymbolByAddress(address))
154 return symbol;
155
156 const auto controller = DSC::SharedCacheController::FromView(*m_data);
157 if (!controller)
158 return nullptr;
159
160 // No existing symbol located, try and search through the symbols of the cache.
161 auto cacheSymbol = controller->GetCache().GetSymbolAt(address);
162 if (!cacheSymbol.has_value())
163 return nullptr;
164
165 // Define the new symbol!
166 // While the method is "getting a symbol" and not applying it to the view, currently this is the more effective
167 // approach than monitoring every usage of this function to make sure they also define the symbol.
168 Ref<Symbol> symbol(new Symbol(cacheSymbol->type, cacheSymbol->name, address));
169 m_data->DefineAutoSymbol(symbol);
170 return symbol;
171}
172
173Ref<Section> SharedCacheObjCProcessor::GetSectionWithName(const char *sectionName)
174{

Callers

nothing calls this directly

Calls 3

GetSymbolByAddressMethod · 0.80
DefineAutoSymbolMethod · 0.80
GetSymbolAtMethod · 0.45

Tested by

no test coverage detected