Lines Matching full:verifier
18 #include "verifier.h"
22 namespace panda::verifier { namespace
24 Verifier::Verifier(const std::string &filename) in Verifier() function in panda::verifier::Verifier
30 bool Verifier::Verify() in Verify()
49 void Verifier::CollectIdInfos() in CollectIdInfos()
56 CheckConstantPool(verifier::ActionType::COLLECTINFOS); in CollectIdInfos()
59 bool Verifier::VerifyChecksum() in VerifyChecksum()
70 bool Verifier::VerifyConstantPool() in VerifyConstantPool()
80 if (!CheckConstantPool(verifier::ActionType::CHECKCONSTPOOLCONTENT)) { in VerifyConstantPool()
91 bool Verifier::VerifyRegisterIndex() in VerifyRegisterIndex()
125 bool Verifier::VerifyConstantPoolIndex() in VerifyConstantPoolIndex()
138 bool Verifier::VerifyConstantPoolContent() in VerifyConstantPoolContent()
144 if (!CheckConstantPool(verifier::ActionType::CHECKCONSTPOOLCONTENT)) { in VerifyConstantPoolContent()
155 void Verifier::GetConstantPoolIds() in GetConstantPoolIds()
169 void Verifier::GetLiteralIds() in GetLiteralIds()
180 bool Verifier::CheckConstantPoolActions(const verifier::ActionType type, panda_file::File::EntityId… in CheckConstantPoolActions()
183 case verifier::ActionType::CHECKCONSTPOOLCONTENT: { in CheckConstantPoolActions()
186 case verifier::ActionType::COLLECTINFOS: { in CheckConstantPoolActions()
196 bool Verifier::CollectIdInInstructions(const panda_file::File::EntityId &method_id) in CollectIdInInstructions()
209 LOG(ERROR, VERIFIER) << "Fail to verify primary opcode!"; in CollectIdInInstructions()
238 void Verifier::CollectModuleLiteralId(const panda_file::File::EntityId &field_id) in CollectModuleLiteralId()
247 bool Verifier::CheckConstantPool(const verifier::ActionType type) in CheckConstantPool()
253 LOG(ERROR, VERIFIER) << "Binary file corrupted. out of bounds (0x" << std::hex in CheckConstantPool()
267 if (type == verifier::ActionType::COLLECTINFOS) { in CheckConstantPool()
278 size_t Verifier::GetVRegCount(const BytecodeInstruction &bc_ins) in GetVRegCount()
288 bool Verifier::CheckVRegIdx(const BytecodeInstruction &bc_ins, const size_t count, const uint32_t m… in CheckVRegIdx()
293 … LOG(ERROR, VERIFIER) << "register index out of bounds. register index is (0x" << std::hex in CheckVRegIdx()
301 bool Verifier::VerifyMethodId(const uint32_t &method_id) const in VerifyMethodId()
307 … LOG(ERROR, VERIFIER) << "Fail to verify method id. method_id(0x" << std::hex << method_id << ")!"; in VerifyMethodId()
313 bool Verifier::VerifyLiteralId(const uint32_t &literal_id) const in VerifyLiteralId()
317 …LOG(ERROR, VERIFIER) << "Fail to verify literal id. literal_id(0x" << std::hex << literal_id << ")… in VerifyLiteralId()
323 bool Verifier::VerifyStringId(const uint32_t &string_id) const in VerifyStringId()
329 … LOG(ERROR, VERIFIER) << "Fail to verify string id. string_id(0x" << std::hex << string_id << ")!"; in VerifyStringId()
335 std::optional<int64_t> Verifier::GetFirstImmFromInstruction(const BytecodeInstruction &bc_ins) in GetFirstImmFromInstruction()
347 std::optional<uint64_t> Verifier::GetSlotNumberFromAnnotation(panda_file::MethodDataAccessor &metho… in GetSlotNumberFromAnnotation()
367 bool Verifier::VerifyMethodIdInLiteralArray(const uint32_t &id) in VerifyMethodIdInLiteralArray()
372 LOG(ERROR, VERIFIER) << "Invalid method id(0x" << id << ") in literal array"; in VerifyMethodIdInLiteralArray()
378 bool Verifier::VerifyStringIdInLiteralArray(const uint32_t &id) in VerifyStringIdInLiteralArray()
382 LOG(ERROR, VERIFIER) << "Invalid string_id. string_id(0x" << std::hex << id << ")!"; in VerifyStringIdInLiteralArray()
389 LOG(ERROR, VERIFIER) << "Invalid string value(0x" << id << ") in literal array"; in VerifyStringIdInLiteralArray()
395 bool Verifier::VerifyLiteralIdInLiteralArray(const uint32_t &id) in VerifyLiteralIdInLiteralArray()
399 LOG(ERROR, VERIFIER) << "Invalid literal id(0x" << id << ") in literal array"; in VerifyLiteralIdInLiteralArray()
405 bool Verifier::VerifySingleLiteralArray(const panda_file::File::EntityId &literal_id) in VerifySingleLiteralArray()
474 LOG(ERROR, VERIFIER) << "Invalid literal tag"; in VerifySingleLiteralArray()
482 bool Verifier::IsModuleLiteralId(const panda_file::File::EntityId &id) const in IsModuleLiteralId()
487 bool Verifier::VerifyLiteralArrays() in VerifyLiteralArrays()
498 bool Verifier::IsJumpInstruction(const Opcode &ins_opcode) in IsJumpInstruction()
550 bool Verifier::VerifyJumpInstruction(const BytecodeInstruction &bc_ins, const BytecodeInstruction &… in VerifyJumpInstruction()
558 LOG(ERROR, VERIFIER) << "Fail to verify primary opcode!"; in VerifyJumpInstruction()
566 LOG(ERROR, VERIFIER) << "Fail to get immediate data!"; in VerifyJumpInstruction()
570 LOG(ERROR, VERIFIER) << "Jump forward out of boundary"; in VerifyJumpInstruction()
574 LOG(ERROR, VERIFIER) << "Jump backward out of boundary"; in VerifyJumpInstruction()
581 bool Verifier::GetIcSlotFromInstruction(const BytecodeInstruction &bc_ins, uint32_t &first_slot_ind… in GetIcSlotFromInstruction()
588 LOG(ERROR, VERIFIER) << "Fail to get first immediate data!"; in GetIcSlotFromInstruction()
597 LOG(ERROR, VERIFIER) << "Fail to get first immediate data!"; in GetIcSlotFromInstruction()
608 bool Verifier::VerifySlotNumber(panda_file::MethodDataAccessor &method_accessor, const uint32_t &sl… in VerifySlotNumber()
613 LOG(INFO, VERIFIER) << "There is no slot number information in annotaion."; in VerifySlotNumber()
621 LOG(ERROR, VERIFIER) << "Slot number has been falsified in method 0x" << method_id; in VerifySlotNumber()
625 bool Verifier::CheckConstantPoolMethodContent(const panda_file::File::EntityId &method_id) in CheckConstantPoolMethodContent()
641 LOG(ERROR, VERIFIER) << "Invalid target position of jump instruction"; in CheckConstantPoolMethodContent()
645 LOG(ERROR, VERIFIER) << "Fail to get first slot index!"; in CheckConstantPoolMethodContent()
661 bool Verifier::CheckConstantPoolIndex() const in CheckConstantPoolIndex()
683 } // namespace panda::verifier