Add files via upload

This commit is contained in:
dpcpointer
2025-05-28 19:20:14 -06:00
committed by GitHub
commit 7c13035673
7 changed files with 449 additions and 0 deletions

43
source/PdFwKrnl.h Normal file
View File

@@ -0,0 +1,43 @@
#pragma once
#include <Windows.h>
#include <winioctl.h>
#include <stdio.h>
#include <stdint.h>
#include <Psapi.h>
#include <vector>
#include <string>
#include <stdexcept>
const ULONG IOCTL_AMDPDFW_MEMCPY = CTL_CODE(0x8000, 0x805, METHOD_BUFFERED, FILE_ANY_ACCESS);
typedef struct _PDFW_MEMCPY {
BYTE Reserved[16];
PVOID Destination;
PVOID Source;
PVOID Reserved2;
DWORD Size;
DWORD Reserved3;
} PDFW_MEMCPY, * PPDFW_MEMCPY;
inline class _pdfwkrnl {
private:
HANDLE hDevice;
public:
_pdfwkrnl();
~_pdfwkrnl();
bool attach();
void detach();
uint64_t get_ntoskrnl_base();
uint64_t get_ntoskrnl_export(const char* function);
bool read_virtual_memory(UINT64 address, void* buffer, ULONG size);
bool write_virtual_memory(UINT64 address, void* buffer, ULONG size);
template <typename T>
T read_virtual_memory(UINT64 address) {
T buffer{};
read_virtual_memory(address, &buffer, sizeof(T));
return buffer;
}
}pdfwkrnl;