FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ShellcodeCompiler/ShellcodeCompiler/FunctionOffsetAddress.cpp at master · barluc/ShellcodeCompiler · GitHub
barluc
ShellcodeCompiler
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ShellcodeCompiler
/
ShellcodeCompiler
/
FunctionOffsetAddress.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (30 loc) · 1.12 KB
Breadcrumbs
ShellcodeCompiler
/
ShellcodeCompiler
/
FunctionOffsetAddress.cpp
Copy path
File metadata and controls
46 lines (30 loc) · 1.12 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
#
include
"
FunctionOffsetAddress.h
"
//
Global data
vector<FunctionOffsetAddress::FunctionOffset> FunctionOffsetAddress::FunctionOffsets;
size_t
FunctionOffsetAddress::CurrentFunctionOffset =
1
;
//
Check if a function offset already exists
bool
FunctionOffsetAddress::FunctionOffsetExists
(string p_sFunctionName)
{
for
(
size_t
i =
0
; i < FunctionOffsets.
size
(); i++)
if
(FunctionOffsets[i].
Name
.
compare
(p_sFunctionName) ==
0
)
return
true
;
return
false
;
}
//
Add a function offset
void
FunctionOffsetAddress::AddFunctionOffset
(string p_sFunctionName)
{
FunctionOffset func;
//
Check if DLL already exists
if
(
FunctionOffsetExists
(p_sFunctionName))
return
;
func.
Name
= p_sFunctionName;
func.
Offset
= CurrentFunctionOffset;
FunctionOffsets.
push_back
(func);
CurrentFunctionOffset++;
}
//
Get function offset
size_t
FunctionOffsetAddress::GetFunctionOffset
(string p_sFunctionName)
{
for
(
size_t
i =
0
; i < FunctionOffsets.
size
(); i++)
if
(FunctionOffsets[i].
Name
.
compare
(p_sFunctionName) ==
0
)
return
FunctionOffsets[i].
Offset
;
cout <<
"
Error: Cannot find function offset for
"
<< p_sFunctionName << endl;
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL