FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ShellcodeCompiler/ShellcodeCompiler/DLLBaseAddress.cpp at master · kissthink/ShellcodeCompiler · GitHub
kissthink
ShellcodeCompiler
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ShellcodeCompiler
/
ShellcodeCompiler
/
DLLBaseAddress.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (38 loc) · 1.11 KB
Breadcrumbs
ShellcodeCompiler
/
ShellcodeCompiler
/
DLLBaseAddress.cpp
Copy path
File metadata and controls
56 lines (38 loc) · 1.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
include
"
DLLBaseAddress.h
"
//
Global data
vector<DLLBaseAddress::DLLBase> DLLBaseAddress::DLLOffsets;
size_t
DLLBaseAddress::CurrentDLLIOffset =
4
;
//
Create kernel32 DLL base index
void
DLLBaseAddress::InitDLLBaseAddress
()
{
DLLBase kernel;
kernel.
Name
=
"
kernel32.dll
"
;
kernel.
Offset
=
1
;
DLLOffsets.
push_back
(kernel);
}
//
Check if a DLL base index already exists
bool
DLLBaseAddress::DLLBaseExists
(string p_sDLLName)
{
for
(
size_t
i =
0
; i < DLLOffsets.
size
(); i++)
if
(DLLOffsets[i].
Name
.
compare
(p_sDLLName) ==
0
)
return
true
;
return
false
;
}
//
Add a DLL base index
void
DLLBaseAddress::AddDLLBase
(string p_sDLLName)
{
DLLBase dll;
//
Check if DLL already exists
if
(
DLLBaseExists
(p_sDLLName))
return
;
dll.
Name
= p_sDLLName;
dll.
Offset
= CurrentDLLIOffset;
DLLOffsets.
push_back
(dll);
CurrentDLLIOffset++;
}
//
Get DLL base index
size_t
DLLBaseAddress::GetDLLBase
(string p_sDLLName)
{
for
(
size_t
i =
0
; i < DLLOffsets.
size
(); i++)
if
(DLLOffsets[i].
Name
.
compare
(p_sDLLName) ==
0
)
return
DLLOffsets[i].
Offset
;
cout <<
"
Error: Cannot find DLL base index for
"
<< p_sDLLName << endl;
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL