Driver on

[Help] How to load my driver using capcom

properly, grasp wlan already did the whole lot: drvmap – driver guide mapper utilizing capcom .

you may obtain the undertaking or the executable and use it immediately. simply pay attention to the necessities of utilizing it, issues like customized entry level and such.

you can too use TDL https://github.com/hfiref0x/TDL

Code:

NTSTATUS DriverInitialize(
	_In_  struct _DRIVER_OBJECT *DriverObject,
	_In_  PUNICODE_STRING RegistryPath
	)
{
	NTSTATUS        standing;
	UNICODE_STRING  SymLink, DevName;
	PDEVICE_OBJECT  devobj;
	ULONG           t;

	//RegistryPath is NULL
	UNREFERENCED_PARAMETER(RegistryPath);   

#ifdef DEBUGPRINT
	DbgPrint("%sn", __FUNCTION__);
#endif

	RtlInitUnicodeString(&DevName, L"DeviceTDLD");
	standing = IoCreateDevice(DriverObject, 0, &DevName, FILE_DEVICE_UNKNOWN, FILE_DEVICE_SECURE_OPEN, TRUE, &devobj);

#ifdef DEBUGPRINT
	DbgPrint("%s IoCreateDevice(%wZ) = %lxn", __FUNCTION__, DevName, standing);
#endif

	if (!NT_SUCCESS(standing)) {
		return standing;
	}

	RtlInitUnicodeString(&SymLink, L"DosDevicesTDLD");
	standing = IoCreateSymbolicLink(&SymLink, &DevName);

#ifdef DEBUGPRINT
	DbgPrint("%s IoCreateSymbolicLink(%wZ) = %lxn", __FUNCTION__, SymLink, standing);
#endif

	devobj->Flags |= DO_BUFFERED_IO;

	for (t = 0; t <= IRP_MJ_MAXIMUM_FUNCTION; t++)
		DriverObject->MajorFunction[t] = &UnsupportedDispatch;

	DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = &DevioctlDispatch;
	DriverObject->MajorFunction[IRP_MJ_CREATE] = &CreateDispatch;
	DriverObject->MajorFunction[IRP_MJ_CLOSE] = &CloseDispatch;
	DriverObject->DriverUnload = NULL; //nonstandard method of driver loading, no unload

	devobj->Flags &= ~DO_DEVICE_INITIALIZING;
	return standing;
}

/*
* DriverEntry
*
* Objective:
*
* Driver base entry level.
*
*/
NTSTATUS DriverEntry(
  _In_  struct _DRIVER_OBJECT *DriverObject,
  _In_  PUNICODE_STRING RegistryPath
)
{
	NTSTATUS        standing;
	UNICODE_STRING  drvName;   
    
	/* This parameters are invalid on account of nonstandard method of loading and shouldn't be used. */
	UNREFERENCED_PARAMETER(DriverObject);
	UNREFERENCED_PARAMETER(RegistryPath);

    PrintIrql();

#ifdef DEBUGPRINT
	DbgPrint("%sn", __FUNCTION__);
#endif

	RtlInitUnicodeString(&drvName, L"DriverTDLD");
	standing = IoCreateDriver(&drvName, &DriverInitialize);

#ifdef DEBUGPRINT
	DbgPrint("%s IoCreateDriver(%wZ) = %lxn", __FUNCTION__, drvName, standing);
#endif

	return standing;
}

https://github.com/hfiref0x/TDL/blob…2/dummy/important.c

Good luck.

Leave a Reply

Your email address will not be published. Required fields are marked *