HyperDbg Debugger
Loading...
Searching...
No Matches
HardwareDebugger.h
Go to the documentation of this file.
1
13#pragma once
14
16// Definitions //
18
23#define DEFAULT_INITIAL_DEBUGGEE_TO_DEBUGGER_OFFSET 0x200
24
29#define DEFAULT_INITIAL_DEBUGGER_TO_DEBUGGEE_OFFSET 0x0
30
36#define DEFAULT_INITIAL_BRAM_BUFFER_SIZE 256
37
42#define HWDBG_TEST_READ_INSTANCE_INFO_PATH "..\\..\\..\\..\\hwdbg\\sim\\hwdbg\\DebuggerModuleTestingBRAM\\bram_instance_info.txt"
43
48#define HWDBG_TEST_WRITE_SCRIPT_BUFFER_PATH "..\\..\\..\\..\\hwdbg\\src\\test\\bram\\script_buffer.hex.txt"
49
54#define HWDBG_TEST_WRITE_INSTANCE_INFO_PATH "..\\..\\..\\..\\hwdbg\\src\\test\\bram\\instance_info.hex.txt"
55
57// Enums //
59
71
83
95
97// Structures //
99
105{
107
109
114#pragma pack(push, 4) // This is to make sure the structure is packed (without padding alignment)
115typedef struct _HWDBG_INSTANCE_INFORMATION
116{
117 //
118 // ANY ADDITION TO THIS STRUCTURE SHOULD BE SYNCHRONIZED WITH SCALA AND INSTANCE INFO SENDER MODULE
119 //
120 UINT32 version; // Target version of HyperDbg (same as hwdbg)
121 UINT32 maximumNumberOfStages; // Number of stages that this instance of hwdbg supports (NumberOfSupportedStages == 0 means script engine is disabled)
122 UINT32 scriptVariableLength; // Maximum length of variables (and other script elements)
123 UINT32 numberOfSupportedLocalAndGlobalVariables; // Number of supported local (and global) variables
124 UINT32 numberOfSupportedTemporaryVariables; // Number of supported temporary variables
125 UINT32 maximumNumberOfSupportedGetScriptOperators; // Maximum supported GET operators in a single func
126 UINT32 maximumNumberOfSupportedSetScriptOperators; // Maximum supported SET operators in a single func
127 UINT32 sharedMemorySize; // Size of shared memory
128 UINT32 debuggerAreaOffset; // The memory offset of debugger
129 UINT32 debuggeeAreaOffset; // The memory offset of debuggee
130 UINT32 numberOfPins; // Number of pins
131 UINT32 numberOfPorts; // Number of ports
132
133 //
134 // ANY ADDITION TO THIS STRUCTURE SHOULD BE SYNCHRONIZED WITH SCALA AND INSTANCE INFO SENDER MODULE
135 //
136
138 {
139 //
140 // ANY ADDITION TO THIS MASK SHOULD BE ADDED TO HwdbgInterpreterShowScriptCapabilities
141 // and HwdbgInterpreterCheckScriptBufferWithScriptCapabilities as well Scala file
142 //
143 UINT64 assign_local_global_var : 1;
144 UINT64 assign_registers : 1;
145 UINT64 assign_pseudo_registers : 1;
147 UINT64 stack_assignments : 1;
148
149 UINT64 func_or : 1;
150 UINT64 func_xor : 1;
151 UINT64 func_and : 1;
152 UINT64 func_asr : 1;
153 UINT64 func_asl : 1;
154 UINT64 func_add : 1;
155 UINT64 func_sub : 1;
156 UINT64 func_mul : 1;
157 UINT64 func_div : 1;
158 UINT64 func_mod : 1;
159 UINT64 func_gt : 1;
160 UINT64 func_lt : 1;
161 UINT64 func_egt : 1;
162 UINT64 func_elt : 1;
163 UINT64 func_equal : 1;
164 UINT64 func_neq : 1;
165 UINT64 func_jmp : 1;
166 UINT64 func_jz : 1;
167 UINT64 func_jnz : 1;
168 UINT64 func_mov : 1;
169 UINT64 func_printf : 1;
170
171 //
172 // ANY ADDITION TO THIS MASK SHOULD BE ADDED TO HwdbgInterpreterShowScriptCapabilities
173 // and HwdbgInterpreterCheckScriptBufferWithScriptCapabilities as well Scala file
174 //
175
177
178 UINT32 bramAddrWidth; // BRAM address width
179 UINT32 bramDataWidth; // BRAM data width
180
181 //
182 // Here the details of port arrangements are located (HWDBG_PORT_INFORMATION_ITEMS)
183 // As the following type:
184 // HWDBG_PORT_INFORMATION_ITEMS portsConfiguration[numberOfPorts] ; Port arrangement
185 //
186
188#pragma pack(pop) // This is to make sure the structure is packed (without padding alignment)
189
194typedef struct _HWDBG_SCRIPT_BUFFER
195{
196 UINT32 scriptNumberOfSymbols; // Number of symbols in the script
197
198 //
199 // Here the script buffer is located
200 //
201 // UINT8 scriptBuffer[scriptNumberOfSymbols]; // The script buffer
202 //
203
unsigned int UINT32
Definition BasicTypes.h:54
_HWDBG_ACTION_ENUMS
Different action of hwdbg.
Definition HardwareDebugger.h:66
@ hwdbgActionSendInstanceInfo
Definition HardwareDebugger.h:67
@ hwdbgActionConfigureScriptBuffer
Definition HardwareDebugger.h:68
enum _HWDBG_RESPONSE_ENUMS HWDBG_RESPONSE_ENUMS
Different responses come from hwdbg.
struct _HWDBG_PORT_INFORMATION_ITEMS * PHWDBG_PORT_INFORMATION_ITEMS
_HWDBG_SUCCESS_OR_ERROR_ENUMS
Different success or error codes in hwdbg.
Definition HardwareDebugger.h:90
@ hwdbgOperationWasSuccessful
Definition HardwareDebugger.h:91
@ hwdbgErrorInvalidPacket
Definition HardwareDebugger.h:92
struct _HWDBG_SCRIPT_BUFFER * PHWDBG_SCRIPT_BUFFER
struct _HWDBG_INSTANCE_INFORMATION HWDBG_INSTANCE_INFORMATION
The structure of script capabilities information in hwdbg.
struct _HWDBG_INSTANCE_INFORMATION * PHWDBG_INSTANCE_INFORMATION
enum _HWDBG_SUCCESS_OR_ERROR_ENUMS HWDBG_SUCCESS_OR_ERROR_ENUMS
Different success or error codes in hwdbg.
struct _HWDBG_PORT_INFORMATION_ITEMS HWDBG_PORT_INFORMATION_ITEMS
The structure of port information (each item) in hwdbg.
_HWDBG_RESPONSE_ENUMS
Different responses come from hwdbg.
Definition HardwareDebugger.h:78
@ hwdbgResponseSuccessOrErrorMessage
Definition HardwareDebugger.h:79
@ hwdbgResponseInstanceInfo
Definition HardwareDebugger.h:80
struct _HWDBG_SCRIPT_BUFFER HWDBG_SCRIPT_BUFFER
The structure of script buffer in hwdbg.
enum _HWDBG_ACTION_ENUMS HWDBG_ACTION_ENUMS
Different action of hwdbg.
UINT64 func_or
Definition HardwareDebugger.h:149
UINT64 func_mov
Definition HardwareDebugger.h:168
UINT64 func_div
Definition HardwareDebugger.h:157
UINT64 assign_registers
Definition HardwareDebugger.h:144
UINT64 assign_local_global_var
Definition HardwareDebugger.h:143
UINT64 func_printf
Definition HardwareDebugger.h:169
UINT64 func_sub
Definition HardwareDebugger.h:155
UINT64 assign_pseudo_registers
Definition HardwareDebugger.h:145
UINT64 func_mul
Definition HardwareDebugger.h:156
UINT64 func_elt
Definition HardwareDebugger.h:162
UINT64 func_and
Definition HardwareDebugger.h:151
UINT64 func_gt
Definition HardwareDebugger.h:159
UINT64 func_jnz
Definition HardwareDebugger.h:167
UINT64 stack_assignments
Definition HardwareDebugger.h:147
UINT64 func_equal
Definition HardwareDebugger.h:163
UINT64 func_neq
Definition HardwareDebugger.h:164
UINT64 conditional_statements_and_comparison_operators
Definition HardwareDebugger.h:146
UINT64 func_jmp
Definition HardwareDebugger.h:165
UINT64 func_lt
Definition HardwareDebugger.h:160
UINT64 func_xor
Definition HardwareDebugger.h:150
UINT64 func_add
Definition HardwareDebugger.h:154
UINT64 func_asl
Definition HardwareDebugger.h:153
UINT64 func_egt
Definition HardwareDebugger.h:161
UINT64 func_mod
Definition HardwareDebugger.h:158
UINT64 func_jz
Definition HardwareDebugger.h:166
UINT64 func_asr
Definition HardwareDebugger.h:152
The structure of script capabilities information in hwdbg.
Definition HardwareDebugger.h:116
UINT32 version
Definition HardwareDebugger.h:120
UINT32 sharedMemorySize
Definition HardwareDebugger.h:127
UINT32 maximumNumberOfSupportedGetScriptOperators
Definition HardwareDebugger.h:125
UINT32 debuggeeAreaOffset
Definition HardwareDebugger.h:129
UINT32 numberOfSupportedLocalAndGlobalVariables
Definition HardwareDebugger.h:123
UINT32 debuggerAreaOffset
Definition HardwareDebugger.h:128
struct _HWDBG_INSTANCE_INFORMATION::_HWDBG_SCRIPT_CAPABILITIES scriptCapabilities
UINT32 maximumNumberOfStages
Definition HardwareDebugger.h:121
UINT32 numberOfSupportedTemporaryVariables
Definition HardwareDebugger.h:124
UINT32 numberOfPorts
Definition HardwareDebugger.h:131
UINT32 bramAddrWidth
Definition HardwareDebugger.h:178
UINT32 maximumNumberOfSupportedSetScriptOperators
Definition HardwareDebugger.h:126
UINT32 bramDataWidth
Definition HardwareDebugger.h:179
UINT32 numberOfPins
Definition HardwareDebugger.h:130
UINT32 scriptVariableLength
Definition HardwareDebugger.h:122
The structure of port information (each item) in hwdbg.
Definition HardwareDebugger.h:105
UINT32 PortSize
Definition HardwareDebugger.h:106
The structure of script buffer in hwdbg.
Definition HardwareDebugger.h:195
UINT32 scriptNumberOfSymbols
Definition HardwareDebugger.h:196