|
RDFU
1.0
|
Functions related to memory operations (including dumping memory) More...
#include "EfiScannerHeaders.h"
Go to the source code of this file.
Functions | |
| VOID * | MemAllocate (UINTN Size) |
| __inline VOID | MemFree (VOID *Mem) |
| __inline VOID | MemCopy (VOID *Dest, VOID *Src, UINTN Size) |
| __inline VOID | MemZero (VOID *Mem, UINTN Size) |
| __inline EFI_STATUS | MemRead (VOID *Dest, VOID *Src, UINTN Size) |
| EFI_STATUS | DumpMemoryToFile (C_PTR Address, UINTN Size, CHAR16 *FilePath, BOOLEAN UseProxy) |
Functions related to memory operations (including dumping memory)
Definition in file Memory.c.
| EFI_STATUS DumpMemoryToFile | ( | C_PTR | Address, |
| UINTN | Size, | ||
| CHAR16 * | FilePath, | ||
| BOOLEAN | UseProxy | ||
| ) |
Function dumps memory from Address to (Address + Size) to file.
If UseProxy is set to TRUE then before we will execute File->Write the source memory will be copied to our newly allocated buffer. This decreases the performance but on the other hand it increases the stability. On real systems for example when you are trying to dump images from memory and you want to do this directly (without the memory proxy) your machine will often freeze. Obviously in some cases this method will not work due to the gigantic Size parameter. Additionally maybe we should disable this option when doing a full memory dump (just to keep the memory layout intact).
| Address | Address inidicating memory to dump |
| Size | Size of memory to dump |
| FilePath | Pointer to file path (unicode) |
| UseProxy | Should we copy the source to our memory firstly |
| EFI_SUCCESS | On success |
| EFI_ERROR* | On error |
Definition at line 174 of file Memory.c.
References EFI_STATUS(), LogFullAscii(), MemAllocate(), MemCopy(), MemFree(), and OpenFile().
Referenced by CommandDumpMem(), DumpFirmwareFromROM(), DumpImageToDisk(), DumpMemoryMap(), DumpPEFile(), DumpTEFile(), and hooked_LoadImage().


| VOID* MemAllocate | ( | UINTN | Size | ) |
Function allocates memory and fills it with zeros.
| Size | Requested size |
| Pointer | On success function returns pointer to the newly allocated memory |
| NULL | On error |
Definition at line 25 of file Memory.c.
References EFI_STATUS(), and LogFullAscii().
Referenced by AddImageToList(), DumpMemoryToFile(), GetAllEvents(), GetAllHandles(), GetAllHandlesWithDescription(), GetAllImagesWithDescription(), GetMemoryMapList(), ImageAllocateStruct(), and ReadConfiguration().


| __inline VOID MemCopy | ( | VOID * | Dest, |
| VOID * | Src, | ||
| UINTN | Size | ||
| ) |
Function copies source memory to destination memory.
| Dest | Pointer to destination memory |
| Src | Pointer to source memory |
| Size | Size of data to copy |
| NONE |
Definition at line 77 of file Memory.c.
Referenced by AddImageToList(), DumpMemoryToFile(), GetAllEvents(), GetArguments(), MemRead(), and ParseConfiguration().

| __inline VOID MemFree | ( | VOID * | Mem | ) |
Function frees allocated memory.
| Mem | Pointer to the allocated memory |
| NONE |
Definition at line 58 of file Memory.c.
Referenced by AddImageToList(), DumpMemoryToFile(), FreeEvents(), FreeHandles(), FreeImages(), FreeMemMap(), GetAllEvents(), GetAllHandles(), GetAllHandlesWithDescription(), GetAllImagesWithDescription(), GetImagePathAndName(), GetMemoryMapList(), ImageAllocateStruct(), ImageFree(), and ReadConfiguration().

| __inline EFI_STATUS MemRead | ( | VOID * | Dest, |
| VOID * | Src, | ||
| UINTN | Size | ||
| ) |
Function reads selected portion (Size) of memory (Src) to Dest. In current states it uses CopyMem from BootServices but it can be freely changed to other "memcpy" implementation. Due to EFI memory characteristics you can probe all available memory without a page fault (at least in theory).
| Dest | Pointer to destination memory |
| Src | Pointer to source memory |
| Size | Size of data to copy |
| EFI_SUCCESS |
Definition at line 117 of file Memory.c.
References MemCopy().
Referenced by ScanMemoryForExecutables().


| __inline VOID MemZero | ( | VOID * | Mem, |
| UINTN | Size | ||
| ) |
Function zeros memory.
| Mem | Pointer to destination memory |
| Size | Size of data to nullify |
| NONE |
Definition at line 94 of file Memory.c.
Referenced by ComConsoleStart(), InstallEventScanner(), and ProcessCommand().
