forked from NytroRST/ShellcodeCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeclaredFunctionsStates.cpp
More file actions
60 lines (49 loc) · 2.16 KB
/
DeclaredFunctionsStates.cpp
File metadata and controls
60 lines (49 loc) · 2.16 KB
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
57
58
59
60
#include "DeclaredFunctionsStates.h"
// Declare functions states
DeclaredStates::State DeclaredFunctionsStates::DF_function;
DeclaredStates::State DeclaredFunctionsStates::DF_FunctionName;
DeclaredStates::State DeclaredFunctionsStates::DF_FunctionDLLStr;
DeclaredStates::State DeclaredFunctionsStates::DF_ReadStringInQuotes;
DeclaredStates::State DeclaredFunctionsStates::DF_GotStrInQuotes;
DeclaredStates::State DeclaredFunctionsStates::DF_FinishStrInQuotes;
void DeclaredFunctionsStates::CreateDeclareFunctionsStates()
{
DeclaredStates::Transform T;
// From "DF_function" with space go to "DF_FunctionName"
T.Character = ' ';
T.NextState = &DF_FunctionName;
DF_function.Transforms.push_back(T);
DF_function.Name = "function";
// From "DF_FunctionName" with AlphaNum go to "DF_FunctionName"
T.Character = CHR_READ_ALPHANUMSTR;
T.NextState = &DF_FunctionName;
DF_FunctionName.Transforms.push_back(T);
DF_FunctionName.Name = "FunctionName";
DF_FunctionName.Process = true;
DF_FunctionName.ProcessStateData = DeclaredStates::ProcessStateData_FunctionName;
// From "DF_FunctionName" with "(" go to "DF_FunctionDLLStr"
T.Character = '(';
T.NextState = &DF_FunctionDLLStr;
DF_FunctionName.Transforms.push_back(T);
// From "DF_FunctionDLLStr" with "\"" go to "DF_ReadStrInQuotes"
T.Character = '"';
T.NextState = &DF_ReadStringInQuotes;
DF_FunctionDLLStr.Transforms.push_back(T);
DF_FunctionDLLStr.Name = "FunctionDLLStr";
// From "DF_ReadStrInQuotes" with AlphaNum go to "DF_ReadStrInQuotes"
T.Character = CHR_READ_ALPHANUMSTR;
T.NextState = &DF_ReadStringInQuotes;
DF_ReadStringInQuotes.Transforms.push_back(T);
DF_ReadStringInQuotes.Name = "ReadStringInQuotes";
DF_ReadStringInQuotes.Process = true;
DF_ReadStringInQuotes.ProcessStateData = DeclaredStates::ProcessStateData_FunctionDLLName;
// From "DF_ReadStringInQuotes" with "\"" go to "DF_GotStrInQuotes"
T.Character = '"';
T.NextState = &DF_GotStrInQuotes;
DF_ReadStringInQuotes.Transforms.push_back(T);
// From "DF_GotStrInQuotes" with ")" go to "DF_FinishStrInQuotes"
T.Character = ')';
T.NextState = &DF_FinishStrInQuotes;
DF_GotStrInQuotes.Transforms.push_back(T);
DF_GotStrInQuotes.Name = "GotStrInQuotes";
}