| 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 | { |
no test coverage detected