diff --git a/src/driver/loader/fortdl.c b/src/driver/loader/fortdl.c index 8befc0fe..ff0c9723 100644 --- a/src/driver/loader/fortdl.c +++ b/src/driver/loader/fortdl.c @@ -10,7 +10,6 @@ static void fortdl_init(PDRIVER_OBJECT driver, PVOID context, ULONG count) { NTSTATUS status; - UNUSED(context); UNUSED(count); DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, "FORT: Loader Init: %d\n", count); @@ -23,7 +22,7 @@ static void fortdl_init(PDRIVER_OBJECT driver, PVOID context, ULONG count) status = fort_file_open(context, &fileHandle); DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, - "FORT: Loader File Load: %w status=%d\n", (PCWSTR) context, status); + "FORT: Loader File Open: %w status=%d\n", (PCWSTR) context, status); if (NT_SUCCESS(status)) { status = fort_file_read(fileHandle, FORT_LOADER_POOL_TAG, &data, &dataSize); @@ -38,10 +37,11 @@ static void fortdl_init(PDRIVER_OBJECT driver, PVOID context, ULONG count) ExFreePool(context); } - // Prepare the driver image + /* Prepare the driver image */ PUCHAR image = NULL; + DWORD imageSize = 0; if (NT_SUCCESS(status)) { - status = fort_image_load(data, dataSize, &image); + status = fort_image_load(data, dataSize, &image, &imageSize); /* Free the driver file's allocated data */ fort_mem_free(data, FORT_LOADER_POOL_TAG); diff --git a/src/driver/loader/fortimg.c b/src/driver/loader/fortimg.c index 12ebed22..6c55a127 100644 --- a/src/driver/loader/fortimg.c +++ b/src/driver/loader/fortimg.c @@ -2,7 +2,7 @@ #include "fortimg.h" -FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image) +FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image, DWORD *outSize) { NTSTATUS status; diff --git a/src/driver/loader/fortimg.h b/src/driver/loader/fortimg.h index 6689c095..c4cf8542 100644 --- a/src/driver/loader/fortimg.h +++ b/src/driver/loader/fortimg.h @@ -7,7 +7,7 @@ extern "C" { #endif -FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image); +FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image, DWORD *outSize); #ifdef __cplusplus } // extern "C"