FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ShellcodeCompiler/ShellcodeCompiler/StringOffsetAddress.cpp at master · dnangle/ShellcodeCompiler · GitHub
dnangle
ShellcodeCompiler
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ShellcodeCompiler
/
ShellcodeCompiler
/
StringOffsetAddress.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (29 loc) · 1016 Bytes
Breadcrumbs
ShellcodeCompiler
/
ShellcodeCompiler
/
StringOffsetAddress.cpp
Copy path
File metadata and controls
45 lines (29 loc) · 1016 Bytes
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
#
include
"
StringOffsetAddress.h
"
//
Global data
vector<StringOffsetAddress::StringOffset> StringOffsetAddress::StringOffsets;
size_t
StringOffsetAddress::CurrentStringOffset =
0
;
//
Check if a string offset already exists
bool
StringOffsetAddress::StringOffsetExists
(string p_sString)
{
for
(
size_t
i =
0
; i < StringOffsets.
size
(); i++)
if
(StringOffsets[i].
Name
.
compare
(p_sString) ==
0
)
return
true
;
return
false
;
}
//
Add a string offset
void
StringOffsetAddress::AddStringOffset
(string p_sString)
{
StringOffset str;
//
Check if string already exists
if
(
StringOffsetExists
(p_sString))
return
;
str.
Name
= p_sString;
str.
Offset
= CurrentStringOffset;
StringOffsets.
push_back
(str);
}
//
Get string offset
size_t
StringOffsetAddress::GetStringOffset
(string p_sString)
{
for
(
size_t
i =
0
; i < StringOffsets.
size
(); i++)
if
(StringOffsets[i].
Name
.
compare
(p_sString) ==
0
)
return
StringOffsets[i].
Offset
;
cout <<
"
Error: Cannot find string offset for
"
<< p_sString << endl;
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL