BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
parser
include
bearparser
pe
CommonOrdinalsLookup.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <QtCore>
4
#include "
lookup/CommonOrdinalsMap.h
"
5
#include "
lookup/CommonOrdinalsWS2_32.h
"
6
#include "
lookup/CommonOrdinalsOleaut32.h
"
7
8
class
CommonOrdinalsLookup
9
{
10
public
:
11
CommonOrdinalsLookup
()
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
46
protected
:
47
QMap<QString, CommonOrdinalsMap*>
listsMap
;
48
};
CommonOrdinalsMap.h
CommonOrdinalsOleaut32.h
CommonOrdinalsWS2_32.h
CommonOrdinalsLookup
Definition
CommonOrdinalsLookup.h:9
CommonOrdinalsLookup::listsMap
QMap< QString, CommonOrdinalsMap * > listsMap
Definition
CommonOrdinalsLookup.h:47
CommonOrdinalsLookup::init
void init()
Definition
CommonOrdinalsLookup.h:31
CommonOrdinalsLookup::CommonOrdinalsLookup
CommonOrdinalsLookup()
Definition
CommonOrdinalsLookup.h:11
CommonOrdinalsLookup::findFuncName
QString findFuncName(QString dllName, int ordinal)
Definition
CommonOrdinalsLookup.h:16
CommonOrdinalsLookup::clear
void clear()
Definition
CommonOrdinalsLookup.h:38
CommonOrdinalsMap
Definition
CommonOrdinalsMap.h:6
CommonOrdinalsMap::ord_names
QMap< int, QString > ord_names
Definition
CommonOrdinalsMap.h:15
CommonOrdinalsOleaut32
Definition
CommonOrdinalsOleaut32.h:6
CommonOrdinalsWS2_32
Definition
CommonOrdinalsWS2_32.h:6
Generated by
1.12.0