MCPcopy Create free account
hub / github.com/avast/retdec / initVtables

Method initVtables

src/bin2llvmir/optimizations/decoder/decoder_init.cpp:992–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

990}
991
992void Decoder::initVtables()
993{
994 LOG << "\n" << "initVtables():" << std::endl;
995
996 std::vector<const common::Vtable*> vtable;
997 for (auto& p : _image->getRtti().getVtablesGcc())
998 {
999 vtable.push_back(&p.second);
1000 }
1001 for (auto& p : _image->getRtti().getVtablesMsvc())
1002 {
1003 vtable.push_back(&p.second);
1004 }
1005
1006 for (auto* p : vtable)
1007 {
1008 auto& vt = *p;
1009 for (auto& item : vt.items)
1010 {
1011 if (auto* jt = _jumpTargets.push(
1012 item.getTargetFunctionAddress(),
1013 JumpTarget::eType::VTABLE,
1014 item.isThumb() ? CS_MODE_THUMB : _c2l->getBasicMode(),
1015 Address::Undefined))
1016 {
1017 auto* nf = createFunction(jt->getAddress());
1018 _vtableFncs.insert(jt->getAddress());
1019
1020 LOG << "\t" << "[+] " << item.getTargetFunctionAddress()
1021 << " @ " << nf->getName().str() << std::endl;
1022 }
1023 else
1024 {
1025 LOG << "\t" << "[-] " << item.getTargetFunctionAddress()
1026 << " (no JT)" << std::endl;
1027 }
1028 }
1029 }
1030}
1031
1032void Decoder::initConfigFunctions()
1033{

Callers

nothing calls this directly

Calls 8

pushMethod · 0.80
getBasicModeMethod · 0.80
strMethod · 0.80
isThumbMethod · 0.45
getAddressMethod · 0.45
insertMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected