HyperDbg Debugger
Toggle main menu visibility
Loading...
Searching...
No Matches
main.cpp File Reference
perform tests
More...
#include "pch.h"
Functions
int
main
(int argc, char *argv[])
Main function of test process.
Detailed Description
perform tests
Author
Sina Karvandi (
sina@
.nosp@m.
hype
.nosp@m.
rdbg.
.nosp@m.
org
)
Version
0.11
Date
2024-08-11
Copyright
This project is released under the GNU Public License v3.
Function Documentation
◆
main()
int main
(
int
argc
,
char *
argv
[] )
Main function of test process.
Parameters
argc
argv
Returns
int
23
{
24
if
(argc != 2)
25
{
26
printf
(
"you should not test functionalities directly, instead use 'test all' "
27
"command from HyperDbg...\n"
);
28
return
1;
29
}
30
31
if
(!strcmp(
argv
[1],
TEST_CASE_PARAMETER_FOR_MAIN_COMMAND_PARSER
))
32
{
33
//
34
// # Test case 1
35
// Testing command parser
36
//
37
if
(
TestCommandParser
())
38
{
39
printf
(
"\n[*] The main command parser test cases passed successfully\n"
);
40
}
41
else
42
{
43
printf
(
"\n[x] The main command parser test cases failed\n"
);
44
}
45
}
46
else
if
(!strcmp(
argv
[1],
TEST_CASE_PARAMETER_FOR_PE_PARSER
))
47
{
48
//
49
// # Test case 2
50
// Testing PE parser helpers
51
//
52
if
(
TestPeParser
())
53
{
54
printf
(
"\n[*] The PE parser test cases passed successfully\n"
);
55
}
56
else
57
{
58
printf
(
"\n[x] The PE parser test cases failed\n"
);
59
}
60
}
61
else
if
(!strcmp(
argv
[1],
TEST_CASE_PARAMETER_FOR_SCRIPT_SEMANTIC_TEST_CASES
))
62
{
63
//
64
// # Test case 3
65
// Testing script semantic test cases
66
//
67
if
(
TestSemanticScripts
())
68
{
69
printf
(
"\n[*] The script semantic test cases passed successfully\n"
);
70
}
71
else
72
{
73
printf
(
"\n[x] The script semantic test cases failed\n"
);
74
}
75
}
76
else
if
(!strcmp(
argv
[1],
TEST_CASE_PARAMETER_FOR_CODEVIEW_RSDS_PARSER
))
77
{
78
//
79
// # Test case 4
80
// Testing CodeView RSDS parser helpers
81
//
82
if
(
TestCodeViewRsdsParser
())
83
{
84
printf
(
"\n[*] The CodeView RSDS parser test cases passed successfully\n"
);
85
}
86
else
87
{
88
printf
(
"\n[x] The CodeView RSDS parser test cases failed\n"
);
89
}
90
}
91
else
if
(!strcmp(
argv
[1],
TEST_HWDBG_FUNCTIONALITIES
))
92
{
93
//
94
// # Test hwdbg functionalities
95
//
96
if
(
HwdbgTestCreateTestCases
())
97
{
98
printf
(
"\n[*] The hwdbg test cases passed successfully\n"
);
99
}
100
else
101
{
102
printf
(
"\n[x] The hwdbg test cases failed\n"
);
103
}
104
}
105
else
106
{
107
printf
(
"unknown test case\n"
);
108
}
109
110
printf
(
"\npress any key to exit..."
);
111
112
_getch();
113
114
return
0;
115
}
TEST_CASE_PARAMETER_FOR_CODEVIEW_RSDS_PARSER
#define TEST_CASE_PARAMETER_FOR_CODEVIEW_RSDS_PARSER
Test case parameter for testing CodeView RSDS parser.
Definition
Definition.h:90
TEST_CASE_PARAMETER_FOR_MAIN_COMMAND_PARSER
#define TEST_CASE_PARAMETER_FOR_MAIN_COMMAND_PARSER
Test case parameter for testing main command parser.
Definition
Definition.h:80
TEST_CASE_PARAMETER_FOR_SCRIPT_SEMANTIC_TEST_CASES
#define TEST_CASE_PARAMETER_FOR_SCRIPT_SEMANTIC_TEST_CASES
Test case parameter for testing semantic script tests.
Definition
Definition.h:95
TEST_CASE_PARAMETER_FOR_PE_PARSER
#define TEST_CASE_PARAMETER_FOR_PE_PARSER
Test case parameter for testing PE parser.
Definition
Definition.h:85
TEST_HWDBG_FUNCTIONALITIES
#define TEST_HWDBG_FUNCTIONALITIES
Test case parameter for testing main command parser.
Definition
Definition.h:75
printf
printf("ho")
HwdbgTestCreateTestCases
BOOLEAN HwdbgTestCreateTestCases()
Create test cases for hwdbg.
Definition
hwdbg-tests.cpp:195
argv
char ** argv
Definition
symbol-parser.h:47
TestCodeViewRsdsParser
BOOLEAN TestCodeViewRsdsParser()
Runs a series of test cases to validate the behavior of the RSDS parser helper functions.
Definition
test-codeview-rsds-parser.cpp:449
TestCommandParser
BOOLEAN TestCommandParser()
Test command parser.
Definition
test-parser.cpp:285
TestPeParser
BOOLEAN TestPeParser()
Runs all PE parser unit tests and reports pass/fail results.
Definition
test-pe-parser.cpp:213
TestSemanticScripts
BOOLEAN TestSemanticScripts()
Test semantic scripts.
Definition
test-semantic-scripts.cpp:95
hyperdbg
hyperdbg-test
code
main.cpp
Generated by
1.17.0