Edit physical and virtual memory.
442{
443 UINT32 LengthOfEachChunk = 0;
444 PVOID DestinationAddress = 0;
445 PVOID SourceAddress = 0;
446
447
448
449
451 {
452 LengthOfEachChunk = 1;
453 }
455 {
456 LengthOfEachChunk = 4;
457 }
459 {
460 LengthOfEachChunk = 8;
461 }
462 else
463 {
464
465
466
469 }
470
471
472
473
475 {
477 {
478
479
480
483 }
485 {
486
487
488
491 }
492
493
494
495
497 {
498 DestinationAddress = (PVOID)((
UINT64)EditMemRequest->
Address + (i * LengthOfEachChunk));
500
501
502
503
504
505
507 }
508 }
510 {
511
512
513
515 {
518 }
519
520
521
522
524 {
525 DestinationAddress = (PVOID)((
UINT64)EditMemRequest->
Address + (i * LengthOfEachChunk));
527
529 }
530 }
531 else
532 {
533
534
535
538 }
539
540
541
542
544
545 return STATUS_SUCCESS;
546}
BOOLEAN CheckAddressPhysical(UINT64 PAddr)
Checks if the physical address is correct or not based on physical address width.
Definition AddressCheck.c:120
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
_Use_decl_annotations_ UINT64 VirtualAddressToPhysicalAddressByProcessId(PVOID VirtualAddress, UINT32 ProcessId)
Converts Virtual Address to Physical Address based on a specific process id's kernel cr3.
Definition Conversion.c:171
_Use_decl_annotations_ UINT64 VirtualAddressToPhysicalAddress(_In_ PVOID VirtualAddress)
Converts Virtual Address to Physical Address.
Definition Conversion.c:154
#define DEBUGGER_ERROR_EDIT_MEMORY_STATUS_INVALID_ADDRESS_BASED_ON_OTHER_PROCESS
error, an invalid address is specified based on anotehr process's cr3 in !e* or e* commands
Definition ErrorCodes.h:114
#define DEBUGGER_ERROR_EDIT_MEMORY_STATUS_INVALID_ADDRESS_BASED_ON_CURRENT_PROCESS
error, an invalid address is specified based on current cr3 in !e* or e* commands
Definition ErrorCodes.h:106
#define DEBUGGER_ERROR_INVALID_ADDRESS
error, invalid address specified for debugger
Definition ErrorCodes.h:63
#define DEBUGGER_ERROR_EDIT_MEMORY_STATUS_INVALID_PARAMETER
error, invalid parameters in !e* e* commands
Definition ErrorCodes.h:99
_Use_decl_annotations_ BOOLEAN MemoryMapperWriteMemoryUnsafe(UINT64 Destination, PVOID Source, SIZE_T SizeToWrite, UINT32 TargetProcessId)
Write memory safely by mapping the buffer (It's a wrapper)
Definition MemoryMapper.c:1411
_Use_decl_annotations_ BOOLEAN MemoryMapperWriteMemorySafeByPhysicalAddress(UINT64 DestinationPa, UINT64 Source, SIZE_T SizeToWrite)
Write memory safely by mapping the buffer.
Definition MemoryMapper.c:1432
@ EDIT_PHYSICAL_MEMORY
Definition RequestStructures.h:463
@ EDIT_VIRTUAL_MEMORY
Definition RequestStructures.h:462
@ EDIT_QWORD
Definition RequestStructures.h:474
@ EDIT_DWORD
Definition RequestStructures.h:473
@ EDIT_BYTE
Definition RequestStructures.h:472
#define SIZEOF_DEBUGGER_EDIT_MEMORY
Definition RequestStructures.h:454
#define STATUS_UNSUCCESSFUL
Definition Windows.h:172
UINT32 Result
Definition RequestStructures.h:483
UINT64 Address
Definition RequestStructures.h:484
DEBUGGER_EDIT_MEMORY_TYPE MemoryType
Definition RequestStructures.h:486
UINT32 CountOf64Chunks
Definition RequestStructures.h:488
UINT32 ProcessId
Definition RequestStructures.h:485
DEBUGGER_EDIT_MEMORY_BYTE_SIZE ByteSize
Definition RequestStructures.h:487