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

Method GetMachOHeaderForImage

view/kernelcache/api/kernelcache.cpp:164–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 }
163
164 std::optional<KernelCacheMachOHeader> KernelCache::GetMachOHeaderForImage(std::string name)
165 {
166 char* str = BNAllocString(name.c_str());
167 char* outputStr = BNKCViewGetImageHeaderForName(m_object, str);
168 if (outputStr == nullptr)
169 return {};
170 std::string output = outputStr;
171 BNFreeString(outputStr);
172 if (output.empty())
173 return {};
174 KernelCacheMachOHeader header = KernelCacheMachOHeader::LoadFromString(output);
175 return header;
176 }
177
178 std::optional<KernelCacheMachOHeader> KernelCache::GetMachOHeaderForAddress(uint64_t address)
179 {

Callers 1

initImageTableMethod · 0.80

Calls 3

c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected