HyperDbg Debugger
Loading...
Searching...
No Matches
Keywords.c File Reference

Script engine keywords implementations. More...

#include "pch.h"

Functions

UINT64 ScriptEngineKeywordPoi (PUINT64 Address, BOOL *HasError)
 Implementation of poi keyword.
 
WORD ScriptEngineKeywordHi (PUINT64 Address, BOOL *HasError)
 Implementation of hi keyword.
 
WORD ScriptEngineKeywordLow (PUINT64 Address, BOOL *HasError)
 Implementation of low keyword.
 
BYTE ScriptEngineKeywordDb (PUINT64 Address, BOOL *HasError)
 Implementation of db keyword.
 
DWORD ScriptEngineKeywordDd (PUINT64 Address, BOOL *HasError)
 Implementation of dd keyword.
 
WORD ScriptEngineKeywordDw (PUINT64 Address, BOOL *HasError)
 Implementation of dw keyword.
 
QWORD ScriptEngineKeywordDq (PUINT64 Address, BOOL *HasError)
 Implementation of dq keyword.
 

Detailed Description

Script engine keywords implementations.

Author
M.H. Gholamrezaei (mh@hy.nosp@m.perd.nosp@m.bg.or.nosp@m.g)
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.2
Date
2022-06-29

Function Documentation

◆ ScriptEngineKeywordDb()

BYTE ScriptEngineKeywordDb ( PUINT64 Address,
BOOL * HasError )

Implementation of db keyword.

Parameters
Address
HasError
Returns
BYTE
130{
131 BYTE Result = NULL_ZERO;
132
133#ifdef SCRIPT_ENGINE_KERNEL_MODE
134
136 {
137 *HasError = TRUE;
138
139 return NULL_ZERO;
140 }
141
142#endif // SCRIPT_ENGINE_KERNEL_MODE
143
144#ifdef SCRIPT_ENGINE_USER_MODE
145 Result = (BYTE)*Address;
146#endif // SCRIPT_ENGINE_USER_MODE
147
148#ifdef SCRIPT_ENGINE_KERNEL_MODE
150#endif // SCRIPT_ENGINE_KERNEL_MODE
151
152 return Result;
153}
BOOLEAN CheckAccessValidityAndSafety(UINT64 TargetAddress, UINT32 Size)
Check the safety to access the memory.
Definition AddressCheck.c:156
#define NULL_ZERO
Definition BasicTypes.h:51
unsigned char BYTE
Definition BasicTypes.h:24
#define TRUE
Definition BasicTypes.h:55
unsigned __int64 UINT64
Definition BasicTypes.h:21
UINT64 Address
Definition HyperDbgScriptImports.h:67
_Use_decl_annotations_ BOOLEAN MemoryMapperReadMemorySafeOnTargetProcess(UINT64 VaAddressToRead, PVOID BufferToSaveMemory, SIZE_T SizeToRead)
Read memory safely by mapping the buffer on the target process memory (It's a wrapper)
Definition MemoryMapper.c:1120

◆ ScriptEngineKeywordDd()

DWORD ScriptEngineKeywordDd ( PUINT64 Address,
BOOL * HasError )

Implementation of dd keyword.

Parameters
Address
HasError
Returns
DWORD
164{
165 DWORD Result = NULL_ZERO;
166
167#ifdef SCRIPT_ENGINE_KERNEL_MODE
168
170 {
171 *HasError = TRUE;
172
173 return NULL_ZERO;
174 }
175
176#endif // SCRIPT_ENGINE_KERNEL_MODE
177
178#ifdef SCRIPT_ENGINE_USER_MODE
179 Result = (DWORD)*Address;
180#endif // SCRIPT_ENGINE_USER_MODE
181
182#ifdef SCRIPT_ENGINE_KERNEL_MODE
184#endif // SCRIPT_ENGINE_KERNEL_MODE
185
186 return Result;
187}
unsigned long DWORD
Definition BasicTypes.h:22

◆ ScriptEngineKeywordDq()

QWORD ScriptEngineKeywordDq ( PUINT64 Address,
BOOL * HasError )

Implementation of dq keyword.

Parameters
Address
HasError
Returns
QWORD
232{
233 QWORD Result = (QWORD)NULL;
234
235#ifdef SCRIPT_ENGINE_KERNEL_MODE
236
238 {
239 *HasError = TRUE;
240
241 return (QWORD)NULL;
242 }
243
244#endif // SCRIPT_ENGINE_KERNEL_MODE
245
246#ifdef SCRIPT_ENGINE_USER_MODE
247 Result = *Address;
248#endif // SCRIPT_ENGINE_USER_MODE
249
250#ifdef SCRIPT_ENGINE_KERNEL_MODE
252#endif // SCRIPT_ENGINE_KERNEL_MODE
253
254 return Result;
255}
unsigned long long QWORD
Definition BasicTypes.h:20
NULL()
Definition test-case-generator.py:530

◆ ScriptEngineKeywordDw()

WORD ScriptEngineKeywordDw ( PUINT64 Address,
BOOL * HasError )

Implementation of dw keyword.

Parameters
Address
HasError
Returns
WORD
198{
199 WORD Result = NULL_ZERO;
200
201#ifdef SCRIPT_ENGINE_KERNEL_MODE
202
204 {
205 *HasError = TRUE;
206
207 return NULL_ZERO;
208 }
209
210#endif // SCRIPT_ENGINE_KERNEL_MODE
211
212#ifdef SCRIPT_ENGINE_USER_MODE
213 Result = (WORD)*Address;
214#endif // SCRIPT_ENGINE_USER_MODE
215
216#ifdef SCRIPT_ENGINE_KERNEL_MODE
218#endif // SCRIPT_ENGINE_KERNEL_MODE
219
220 return Result;
221}
unsigned short WORD
Definition BasicTypes.h:25

◆ ScriptEngineKeywordHi()

WORD ScriptEngineKeywordHi ( PUINT64 Address,
BOOL * HasError )

Implementation of hi keyword.

Parameters
Address
HasError
Returns
WORD
62{
63 QWORD Result = NULL64_ZERO;
64
65#ifdef SCRIPT_ENGINE_KERNEL_MODE
66
68 {
69 *HasError = TRUE;
70
71 return NULL64_ZERO;
72 }
73
74#endif // SCRIPT_ENGINE_KERNEL_MODE
75
76#ifdef SCRIPT_ENGINE_USER_MODE
77 Result = *Address;
78#endif // SCRIPT_ENGINE_USER_MODE
79
80#ifdef SCRIPT_ENGINE_KERNEL_MODE
82#endif // SCRIPT_ENGINE_KERNEL_MODE
83
84 return HIWORD(Result);
85}
#define NULL64_ZERO
Definition BasicTypes.h:52
#define HIWORD(l)
Definition Constants.h:555

◆ ScriptEngineKeywordLow()

WORD ScriptEngineKeywordLow ( PUINT64 Address,
BOOL * HasError )

Implementation of low keyword.

Parameters
Address
HasError
Returns
WORD
96{
97 QWORD Result = NULL64_ZERO;
98
99#ifdef SCRIPT_ENGINE_KERNEL_MODE
100
102 {
103 *HasError = TRUE;
104
105 return NULL64_ZERO;
106 }
107
108#endif // SCRIPT_ENGINE_KERNEL_MODE
109
110#ifdef SCRIPT_ENGINE_USER_MODE
111 Result = *Address;
112#endif // SCRIPT_ENGINE_USER_MODE
113
114#ifdef SCRIPT_ENGINE_KERNEL_MODE
116#endif // SCRIPT_ENGINE_KERNEL_MODE
117
118 return LOWORD(Result);
119}
#define LOWORD(l)
Definition Constants.h:551

◆ ScriptEngineKeywordPoi()

UINT64 ScriptEngineKeywordPoi ( PUINT64 Address,
BOOL * HasError )

Implementation of poi keyword.

Parameters
Address
HasError
Returns
UINT64
28{
29 UINT64 Result = (UINT64)NULL;
30
31#ifdef SCRIPT_ENGINE_KERNEL_MODE
32
34 {
35 *HasError = TRUE;
36
37 return (UINT64)NULL;
38 }
39
40#endif // SCRIPT_ENGINE_KERNEL_MODE
41
42#ifdef SCRIPT_ENGINE_USER_MODE
43 Result = *Address;
44#endif // SCRIPT_ENGINE_USER_MODE
45
46#ifdef SCRIPT_ENGINE_KERNEL_MODE
48#endif // SCRIPT_ENGINE_KERNEL_MODE
49
50 return Result;
51}