-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from hfiref0x/dev132
v 1.3.2
- Loading branch information
Showing
69 changed files
with
723 additions
and
113 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,107 @@ | ||
/******************************************************************************* | ||
* | ||
* (C) COPYRIGHT AUTHORS, 2023 | ||
* | ||
* TITLE: HP.CPP | ||
* | ||
* VERSION: 1.32 | ||
* | ||
* DATE: 20 May 2022 | ||
* | ||
* Hewlett Packard 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/hp.h" | ||
|
||
/* | ||
* HpEtdReadVirtualMemory | ||
* | ||
* Purpose: | ||
* | ||
* Read virtual memory via HP ETD driver. | ||
* | ||
*/ | ||
_Success_(return != FALSE) | ||
BOOL WINAPI HpEtdReadVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_Out_writes_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes) | ||
{ | ||
PBYTE BufferPtr = (PBYTE)Buffer; | ||
ULONG_PTR virtAddress = VirtualAddress; | ||
ULONG readBytes = 0; | ||
HP_VMEM_REQUEST request; | ||
|
||
for (ULONG i = 0; i < NumberOfBytes; i++) { | ||
|
||
RtlSecureZeroMemory(&request, sizeof(request)); | ||
|
||
request.Source = virtAddress; | ||
request.Granularity = HpByte; | ||
|
||
if (!supCallDriver(DeviceHandle, IOCTL_HP_READ_VMEM, | ||
&request, sizeof(request), | ||
&request, sizeof(request))) | ||
{ | ||
break; | ||
} | ||
|
||
BufferPtr[i] = request.InputOutput.ValueByType.vtByte; | ||
virtAddress += sizeof(BYTE); | ||
readBytes += sizeof(BYTE); | ||
} | ||
|
||
return (readBytes == NumberOfBytes); | ||
} | ||
|
||
/* | ||
* HpEtdWriteVirtualMemory | ||
* | ||
* Purpose: | ||
* | ||
* Write virtual memory via HP ETD driver. | ||
* | ||
*/ | ||
_Success_(return != FALSE) | ||
BOOL WINAPI HpEtdWriteVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_In_reads_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes | ||
) | ||
{ | ||
PBYTE BufferPtr = (PBYTE)Buffer; | ||
|
||
ULONG_PTR virtAddress = VirtualAddress; | ||
ULONG writeBytes = 0; | ||
HP_VMEM_REQUEST request; | ||
|
||
for (ULONG i = 0; i < NumberOfBytes; i++) { | ||
|
||
RtlSecureZeroMemory(&request, sizeof(request)); | ||
|
||
request.Source = virtAddress; | ||
request.Granularity = HpByte; | ||
request.InputOutput.ValueByType.vtByte = BufferPtr[i]; | ||
|
||
if (!supCallDriver(DeviceHandle, IOCTL_HP_WRITE_VMEM, | ||
&request, sizeof(request), | ||
NULL, 0)) | ||
{ | ||
break; | ||
} | ||
|
||
virtAddress += sizeof(BYTE); | ||
writeBytes += sizeof(BYTE); | ||
} | ||
|
||
return (writeBytes == 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/******************************************************************************* | ||
* | ||
* (C) COPYRIGHT AUTHORS, 2023 | ||
* | ||
* TITLE: HP.H | ||
* | ||
* VERSION: 1.32 | ||
* | ||
* DATE: 20 May 2023 | ||
* | ||
* Hewlett Packard 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 | ||
|
||
// | ||
// Hewlett Packard interface for ETDi Service Driver. | ||
// | ||
|
||
#define HP_DEVICE_TYPE (DWORD)0x8000 | ||
|
||
#define HP_READ_VMEM (DWORD)0x80F | ||
#define HP_WRITE_VMEM (DWORD)0x80E | ||
|
||
#define IOCTL_HP_READ_VMEM \ | ||
CTL_CODE(HP_DEVICE_TYPE, HP_READ_VMEM, METHOD_BUFFERED, FILE_READ_ACCESS) //0x8000603C | ||
|
||
#define IOCTL_HP_WRITE_VMEM \ | ||
CTL_CODE(HP_DEVICE_TYPE, HP_WRITE_VMEM, METHOD_BUFFERED, FILE_WRITE_ACCESS) //0x80006038 | ||
|
||
typedef enum _HP_VALUE_GRANULARITY { | ||
HpByte = 1, | ||
HpWord = 2, | ||
HpDword = 4 | ||
} HP_VALUE_GRANULARITY; | ||
|
||
typedef struct _HP_VMEM_REQUEST { //sizeof 32 | ||
HP_VALUE_GRANULARITY Granularity; | ||
ULONG Spare0; | ||
ULONG_PTR Unused0; | ||
ULONG_PTR Source; | ||
union { | ||
union { | ||
BYTE vtByte; | ||
WORD vtWord; | ||
DWORD vtDword; | ||
} ValueByType; | ||
DWORD Value; | ||
} InputOutput; | ||
ULONG Spare1; | ||
} HP_VMEM_REQUEST, * PHP_VMEM_REQUEST; | ||
|
||
_Success_(return != FALSE) | ||
BOOL WINAPI HpEtdReadVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_Out_writes_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes); | ||
|
||
_Success_(return != FALSE) | ||
BOOL WINAPI HpEtdWriteVirtualMemory( | ||
_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
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,64 @@ | ||
/******************************************************************************* | ||
* | ||
* (C) COPYRIGHT AUTHORS, 2023 | ||
* | ||
* TITLE: ZODIACON.CPP | ||
* | ||
* VERSION: 1.32 | ||
* | ||
* DATE: 20 May 2022 | ||
* | ||
* Zodiacon 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/zodiacon.h" | ||
|
||
/* | ||
* KObExpReadVirtualMemory | ||
* | ||
* Purpose: | ||
* | ||
* Read virtual memory via KObExp driver. | ||
* | ||
*/ | ||
BOOL WINAPI KObExpReadVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_In_reads_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes) | ||
{ | ||
return supCallDriver(DeviceHandle, IOCTL_KOBEXP_READ_VMEM, | ||
&VirtualAddress, | ||
sizeof(VirtualAddress), | ||
Buffer, | ||
NumberOfBytes); | ||
} | ||
|
||
/* | ||
* KObExpWriteVirtualMemory | ||
* | ||
* Purpose: | ||
* | ||
* Write virtual memory via KObExp driver. | ||
* | ||
*/ | ||
BOOL WINAPI KObExpWriteVirtualMemory( | ||
_In_ HANDLE DeviceHandle, | ||
_In_ ULONG_PTR VirtualAddress, | ||
_In_reads_bytes_(NumberOfBytes) PVOID Buffer, | ||
_In_ ULONG NumberOfBytes | ||
) | ||
{ | ||
return supCallDriver(DeviceHandle, IOCTL_KOBEXP_WRITE_VMEM, | ||
&VirtualAddress, | ||
sizeof(VirtualAddress), | ||
Buffer, | ||
NumberOfBytes); | ||
} |
Oops, something went wrong.