Skip to content

Instantly share code, notes, and snippets.

@iljavs
Created October 15, 2020 16:31
Show Gist options
  • Save iljavs/3cc3205fe9a127431dfe2f4096e8ae0e to your computer and use it in GitHub Desktop.
Save iljavs/3cc3205fe9a127431dfe2f4096e8ae0e to your computer and use it in GitHub Desktop.
#include <ntddk.h>
#define SIMPLE_TAG 'pmis'
void* p;
void SimpleUnload(PDRIVER_OBJECT DriverObject) {
UNREFERENCED_PARAMETER(DriverObject);
DbgPrint("SimpleUnload called \n");
if (p) {
ExFreePool(p);
}
}
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) {
UNREFERENCED_PARAMETER(DriverObject);
DbgPrint("Simple DriverEntry called: %wZ\n", RegistryPath);
p = NULL;
DriverObject->DriverUnload = SimpleUnload;
p = ExAllocatePoolWithTag(PagedPool, 100, SIMPLE_TAG);
DbgPrint("Allocated pointer: 0x%p\n", p);
return STATUS_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment