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

Method IsValidFunctionStart

view/macho/machoview.cpp:945–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

943
944
945bool MachoView::IsValidFunctionStart(uint64_t addr)
946{
947 uint8_t opcode[BN_MAX_INSTRUCTION_LENGTH];
948 size_t opLen = Read(opcode, addr, m_arch->GetMaxInstructionLength());
949 if (!opLen)
950 return false;
951
952 Ref<LowLevelILFunction> ilFunc = new LowLevelILFunction(m_arch, nullptr);
953 ilFunc->SetCurrentAddress(m_arch, addr);
954 m_arch->GetInstructionLowLevelIL(opcode, addr, opLen, *ilFunc);
955 for (size_t i = 0; i < ilFunc->GetInstructionCount(); i++)
956 {
957 const auto& instr = ilFunc->GetInstruction(i);
958 if (instr.operation == LLIL_UNDEF)
959 return false;
960 }
961
962 return true;
963}
964
965
966void MachoView::ParseFunctionStarts(Platform* platform, uint64_t textBase, function_starts_command functionStarts)

Callers

nothing calls this directly

Calls 5

SetCurrentAddressMethod · 0.45
GetInstructionCountMethod · 0.45
GetInstructionMethod · 0.45

Tested by

no test coverage detected