From 0920dee45ef777649b0bfcdb67aed9e23c0be9ba Mon Sep 17 00:00:00 2001 From: Zephyr Lykos Date: Sat, 30 Mar 2024 17:46:25 +0800 Subject: [PATCH] even: move DbgPrint to head --- even.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/even.c b/even.c index 06e3bfe..9a54db4 100644 --- a/even.c +++ b/even.c @@ -194,6 +194,7 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO switch (io_stack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_CHECK_1: { + DbgPrint("Even Htsysm7679: Check 1\r\n"); if (io_stack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(htsysm_check_1)) { Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; @@ -203,11 +204,11 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO RtlCopyBytes(Irp->AssociatedIrp.SystemBuffer, &htsysm_check_1, sizeof(htsysm_check_1)); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = sizeof(htsysm_check_1); - DbgPrint("Even Htsysm7679: Check 1\r\n"); } break; case IOCTL_CHECK_2: { + DbgPrint("Even Htsysm7679: Check 2\r\n"); if (io_stack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(htsysm_check_2)) { Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; @@ -217,11 +218,11 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO RtlCopyBytes(Irp->AssociatedIrp.SystemBuffer, &htsysm_check_2, sizeof(htsysm_check_2)); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = sizeof(htsysm_check_2); - DbgPrint("Even Htsysm7679: Check 2\r\n"); } break; case IOCTL_CHECK_3: { + DbgPrint("Even Htsysm7679: Check 3\r\n"); if (io_stack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(htsysm_check_3)) { Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; @@ -231,11 +232,11 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO RtlCopyBytes(Irp->AssociatedIrp.SystemBuffer, &htsysm_check_3, sizeof(htsysm_check_3)); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = sizeof(htsysm_check_3); - DbgPrint("Even Htsysm7679: Check 3\r\n"); } break; case IOCTL_WRITE_PEB_1: { + DbgPrint("Even Htsysm7679: Write PEB 1\r\n"); struct even_ioctl_in_data *even_in_data = (struct even_ioctl_in_data *)Irp->AssociatedIrp.SystemBuffer; struct even_ioctl_out_data *even_out_data = (struct even_ioctl_out_data *)Irp->AssociatedIrp.SystemBuffer; @@ -270,7 +271,6 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO RtlCopyBytes(&value, even_in_data->value, sizeof(value)); value = ~value; - DbgPrint("Even Htsysm7679: Write PEB 1\r\n"); DbgPrint("Even Htsysm7679: Offset = %0x, Value = %0x\r\n", even_in_data->offset, value); for (size_t i = 0; i < 4; i++) { @@ -284,6 +284,7 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO break; case IOCTL_WRITE_PEB_2: { + DbgPrint("Even Htsysm7679: Write PEB 2\r\n"); struct even_ioctl_in_data *even_in_data = (struct even_ioctl_in_data *)Irp->AssociatedIrp.SystemBuffer; struct even_ioctl_out_data *even_out_data = (struct even_ioctl_out_data *)Irp->AssociatedIrp.SystemBuffer; @@ -325,12 +326,12 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO even_out_data->result = 1; Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = sizeof(*even_out_data); - DbgPrint("Even Htsysm7679: Write PEB 2\r\n"); DbgPrint("Even Htsysm7679: Offset = %0x, Value = %0x\r\n", even_in_data->offset, value); } break; case IOCTL_READ_PEB: { + DbgPrint("Even Htsysm7679: Read PEB\r\n"); struct even_ioctl_in_data *even_in_data = (struct even_ioctl_in_data *)Irp->AssociatedIrp.SystemBuffer; struct even_ioctl_out_data1 *even_out_data = (struct even_ioctl_out_data1 *)Irp->AssociatedIrp.SystemBuffer; @@ -374,7 +375,6 @@ static NTSTATUS __stdcall even_dispatch_device_control(IN PDEVICE_OBJECT DeviceO Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = sizeof(*even_out_data); - DbgPrint("Even Htsysm7679: Read PEB\r\n"); DbgPrint("Even Htsysm7679: Offset = %0x, Value = %0x\r\n", even_in_data->offset, *(int *)even_in_data->value); DbgPrint("Even Htsysm7679: Return = %0x\r\n", *(int *)value); }