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

Function ScriptEngineFunctionEdPa

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

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

Source from the content-addressed store, hash-verified

204 * @return BOOLEAN
205 */
206BOOLEAN
207ScriptEngineFunctionEdPa(UINT64 Address, DWORD Value, BOOL * HasError)
208{
209 UNREFERENCED_PARAMETER(HasError);
210
211#ifdef SCRIPT_ENGINE_KERNEL_MODE
212
213 if (!CheckAddressPhysical(Address))
214 {
215 //
216 // Instead of indicating an error, just return false
217 // to assign it as a return result to a variable
218 //
219 // *HasError = TRUE;
220
221 return FALSE;
222 }
223
224#endif // SCRIPT_ENGINE_KERNEL_MODE
225
226#ifdef SCRIPT_ENGINE_USER_MODE
227
228 ShowMessages("err, using physical address functions (ed_pa) is not possible in user-mode\n");
229 return FALSE;
230
231#endif // SCRIPT_ENGINE_USER_MODE
232
233#ifdef SCRIPT_ENGINE_KERNEL_MODE
234 MemoryMapperWriteMemorySafeByPhysicalAddress(Address, (UINT64)&Value, sizeof(DWORD));
235#endif // SCRIPT_ENGINE_KERNEL_MODE
236
237 return TRUE;
238}
239
240/**
241 * @brief Implementation of eb function (Physical Memory)

Callers 1

ScriptEngineExecuteFunction · 0.85

Calls 3

CheckAddressPhysicalFunction · 0.85
ShowMessagesFunction · 0.50

Tested by

no test coverage detected