Skip to content

Commit

Permalink
Updated to latest winver
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccrystal committed Jul 19, 2021
1 parent 6988d96 commit 856f4dd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 113 deletions.
86 changes: 0 additions & 86 deletions driver/driver.inf

This file was deleted.

5 changes: 2 additions & 3 deletions driver/driver.vcxproj
Expand Up @@ -67,6 +67,7 @@
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
Expand All @@ -75,6 +76,7 @@
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
Expand Down Expand Up @@ -153,9 +155,6 @@
<EntryPointSymbol>DriverEntry</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Inf Include="driver.inf" />
</ItemGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
</ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions driver/driver.vcxproj.filters
Expand Up @@ -18,11 +18,6 @@
<Extensions>inf;inv;inx;mof;mc;</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Inf Include="driver.inf">
<Filter>Driver Files</Filter>
</Inf>
</ItemGroup>
<ItemGroup>
<ClCompile Include="core.c">
<Filter>Source Files</Filter>
Expand Down
40 changes: 21 additions & 19 deletions driver/main.c
Expand Up @@ -38,33 +38,35 @@ NTSTATUS Main() {
return STATUS_FAILED_DRIVER_ENTRY;
}

// MiAllocateVad (yes I'm this lazy)
PBYTE addr = (PBYTE)FindPatternImage(base, "\x41\xB8\x00\x00\x00\x00\x48\x8B\xD6\x49\x8B\xCE\xE8\x00\x00\x00\x00\x48\x8B\xD8", "xx????xxxxxxx????xxx");
if (!addr) {
printf("! failed to find MiAllocateVad !\n");
// MiAllocateVad
PBYTE addr = (PBYTE)FindPatternImage(base, "\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x48\x8B\xE9\x41\x8B\xF8\xB9\x00\x00\x00\x00\x48\x8B\xF2\x8B\xD1\x41\xB8\x00\x00\x00\x00", "xxxx?xxxx?xxxx?xxxxxxxxxxxx????xxxxxxx????");
if (!addr)
{
DbgPrintEx(0, 0, "[driver] MiAllocateVad not found!\n");
return STATUS_FAILED_DRIVER_ENTRY;
}

*(PVOID *)&MiAllocateVad = RELATIVE_ADDR(addr + 12, 5);

*(PVOID*)&MiAllocateVad = addr;
// MiInsertVadCharges
addr = FindPatternImage(base, "\xE8\x00\x00\x00\x00\x8B\xF8\x85\xC0\x78\x31", "x????xxxxxx");
if (!addr) {
printf("! failed to find MiInsertVadCharges !\n");
addr = FindPatternImage(base, "\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x20\x8B\x41\x18\x48\x8B\xD9\x44\x0F\xB6\x71\x00\x45\x33\xE4", "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxxxxxxxxx?xxx");
if (!addr)
{
DbgPrintEx(0, 0, "[driver] MiInsertVadCharges not found!\n");
return STATUS_FAILED_DRIVER_ENTRY;
}

*(PVOID *)&MiInsertVadCharges = RELATIVE_ADDR(addr, 5);

*(PVOID*)&MiInsertVadCharges = addr;
// MiInsertVad
addr = FindPatternImage(base, "\x48\x2B\xD1\x48\xFF\xC0\x48\x03\xC2", "xxxxxxxxx");
if (!addr) {
printf("! failed to find MiInsertVad !\n");
addr = FindPatternImage(base, "\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x20\x8B\x41\x1C\x33\xED\x0F\xB6\x59\x21", "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxxxxxxxx");
if (!addr)
{
DbgPrintEx(0, 0, "[driver] MiInsertVad not found!\n");
return STATUS_FAILED_DRIVER_ENTRY;
}

for (; *addr != 0xE8 || *(addr + 5) != 0x8B; ++addr);
*(PVOID *)&MiInsertVad = RELATIVE_ADDR(addr, 5);

*(PVOID*)&MiInsertVad = addr;

// Intended be manually mapped
addr = FindPatternImage(base, "\x48\x8B\x05\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\xC8\x85\xC0\x78\x40", "xxx????x????xxxxxx");
Expand Down

0 comments on commit 856f4dd

Please sign in to comment.