| 990 | } |
| 991 | |
| 992 | void 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 | |
| 1032 | void Decoder::initConfigFunctions() |
| 1033 | { |
nothing calls this directly
no test coverage detected