BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
CommonOrdinalsLookup.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore>
7
9{
10public:
12 {
13 init();
14 }
15
16 QString findFuncName(QString dllName, int ordinal)
17 {
18 dllName = dllName.toLower();
19
20 if (!listsMap.contains(dllName)) {
21 return QString();
22 }
23
24 CommonOrdinalsMap* ordinalsMap = listsMap[dllName];
25 if (!ordinalsMap || !ordinalsMap->ord_names.contains(ordinal)) {
26 return QString();
27 }
28 return ordinalsMap->ord_names[ordinal];
29 }
30
31 void init()
32 {
33 listsMap["wsock32"] = new CommonOrdinalsWS2_32();
34 listsMap["ws2_32"] = new CommonOrdinalsWS2_32();
35 listsMap["oleaut32"] = new CommonOrdinalsOleaut32();
36 }
37
38 void clear()
39 {
40 for (auto itr = listsMap.begin(); itr != listsMap.end(); ++itr) {
41 delete itr.value();
42 }
43 listsMap.clear();
44 }
45
46protected:
47 QMap<QString, CommonOrdinalsMap*> listsMap;
48};
QMap< QString, CommonOrdinalsMap * > listsMap
QString findFuncName(QString dllName, int ordinal)
QMap< int, QString > ord_names