MCPcopy Create free account
hub / github.com/HyperDbg/HyperDbg / ScriptEngineFunctionEqPa

Function ScriptEngineFunctionEqPa

hyperdbg/script-eval/code/Functions.c:164–196  ·  view source on GitHub ↗

* @brief Implementation of eq function (Physical Memory) * * @param Address * @param Value * @param HasError * @return BOOLEAN */

Source from the content-addressed store, hash-verified

162 * @return BOOLEAN
163 */
164BOOLEAN
165ScriptEngineFunctionEqPa(UINT64 Address, QWORD Value, BOOL * HasError)
166{
167 UNREFERENCED_PARAMETER(HasError);
168
169#ifdef SCRIPT_ENGINE_KERNEL_MODE
170
171 if (!CheckAddressPhysical(Address))
172 {
173 //
174 // Instead of indicating an error, just return false
175 // to assign it as a return result to a variable
176 //
177 // *HasError = TRUE;
178
179 return FALSE;
180 }
181
182#endif // SCRIPT_ENGINE_KERNEL_MODE
183
184#ifdef SCRIPT_ENGINE_USER_MODE
185
186 ShowMessages("err, using physical address functions (eq_pa) is not possible in user-mode\n");
187 return FALSE;
188
189#endif // SCRIPT_ENGINE_USER_MODE
190
191#ifdef SCRIPT_ENGINE_KERNEL_MODE
192 MemoryMapperWriteMemorySafeByPhysicalAddress(Address, (UINT64)&Value, sizeof(QWORD));
193#endif // SCRIPT_ENGINE_KERNEL_MODE
194
195 return TRUE;
196}
197
198/**
199 * @brief Implementation of ed function (Physical Memory)

Callers 1

ScriptEngineExecuteFunction · 0.85

Calls 3

CheckAddressPhysicalFunction · 0.85
ShowMessagesFunction · 0.50

Tested by

no test coverage detected