Skip to content

Commit

Permalink
Support for Windows 11 23H2
Browse files Browse the repository at this point in the history
  • Loading branch information
valinet committed Mar 15, 2024
1 parent f512782 commit e096b64
Show file tree
Hide file tree
Showing 28 changed files with 122,405 additions and 300 deletions.
7 changes: 2 additions & 5 deletions GDRVLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
#include "global.h"
#include "binary/dropper.h"

const wchar_t* DriverPath = L"C:\\Windows\\System32\\Drivers\\gdrv.sys";
#define CUSTOM_DRIVER L"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
NTSTATUS Status = STATUS_UNSUCCESSFUL;
{
if (DropDriverFromBytes(DriverPath))
//if (DropDriverFromBytes(DriverPath))
{
Status = WindLoadDriver((PWCHAR)DriverPath, (PWCHAR)CUSTOM_DRIVER, FALSE);
Status = WindLoadDriver((PWCHAR)L"", (PWCHAR)CUSTOM_DRIVER, FALSE);

if (NT_SUCCESS(Status))
printf("Driver loaded successfully\n");

DeleteFile((PWSTR)DriverPath);
}
}
{
Expand Down
899 changes: 617 additions & 282 deletions LICENSE

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions NOP.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "gui", "NOP\gui\gui.csproj",
ProjectSection(ProjectDependencies) = postProject
{592D31AB-A734-4DEE-B85F-57BB67759963} = {592D31AB-A734-4DEE-B85F-57BB67759963}
{8480DA70-45E9-4D91-A89C-24B27D0F4924} = {8480DA70-45E9-4D91-A89C-24B27D0F4924}
{AAFAF49F-EE20-4E9F-AE53-5254457AB141} = {AAFAF49F-EE20-4E9F-AE53-5254457AB141}
{C2F662DB-3ED6-47EE-A331-2EBE11AA36C3} = {C2F662DB-3ED6-47EE-A331-2EBE11AA36C3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loader2", "NOP\loader2\DSE-Patcher.vcxproj", "{AAFAF49F-EE20-4E9F-AE53-5254457AB141}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -91,6 +94,22 @@ Global
{E109B8FE-CAD8-466A-9502-9AD85ED78B45}.Release|x64.Build.0 = Release|Any CPU
{E109B8FE-CAD8-466A-9502-9AD85ED78B45}.Release|x86.ActiveCfg = Release|Any CPU
{E109B8FE-CAD8-466A-9502-9AD85ED78B45}.Release|x86.Build.0 = Release|Any CPU
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|Any CPU.ActiveCfg = Debug|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|Any CPU.Build.0 = Debug|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|ARM64.ActiveCfg = Debug|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|ARM64.Build.0 = Debug|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|x64.ActiveCfg = Debug|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|x64.Build.0 = Debug|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|x86.ActiveCfg = Debug|Win32
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Debug|x86.Build.0 = Debug|Win32
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|Any CPU.ActiveCfg = Release|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|Any CPU.Build.0 = Release|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|ARM64.ActiveCfg = Release|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|ARM64.Build.0 = Release|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|x64.ActiveCfg = Release|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|x64.Build.0 = Release|x64
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|x86.ActiveCfg = Release|Win32
{AAFAF49F-EE20-4E9F-AE53-5254457AB141}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
26 changes: 24 additions & 2 deletions NOP/gui/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private void btnApplyRestart_Click(object sender, EventArgs e)

// Extract loader to scratch dir
string loaderResourceName = "gui.loader.exe";
string loaderPath = Path.Combine(tempFolderName, "Press Yes to apply settings to olk.exe");
string loaderPath = Path.Combine(tempFolderName, "loader.exe");
try
{
using (Stream resourceStream = assembly.GetManifestResourceStream(loaderResourceName))
Expand All @@ -251,6 +251,28 @@ private void btnApplyRestart_Click(object sender, EventArgs e)
return;
}

// Extract loader2 to scratch dir
string loader2ResourceName = "gui.loader2.exe";
string loader2Path = Path.Combine(tempFolderName, "Press Yes to apply settings to olk.exe");
try
{
using (Stream resourceStream = assembly.GetManifestResourceStream(loader2ResourceName))
{
if (resourceStream != null)
{
byte[] buffer = new byte[resourceStream.Length];
resourceStream.Read(buffer, 0, buffer.Length);
File.WriteAllBytes(loader2Path, BytesReplace(buffer, Encoding.Unicode.GetBytes("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"), Encoding.Unicode.GetBytes(loaderPath).Concat(new byte[2] { 0x00, 0x00 }).ToArray()));
}
}
}
catch (Exception ex)
{
MessageBox.Show("Unable to extract driver resource.", "NewOutlookPatcher", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.TopMost = true;
return;
}

// Patch with selected options
try
{
Expand All @@ -261,7 +283,7 @@ private void btnApplyRestart_Click(object sender, EventArgs e)
processes[0].WaitForExit();

ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = loaderPath;
psi.FileName = loader2Path;
psi.UseShellExecute = true;
psi.Verb = "runas";
System.Diagnostics.Process.Start(psi).WaitForExit();
Expand Down
7 changes: 4 additions & 3 deletions NOP/gui/gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<ImplicitUsings>enable</ImplicitUsings>
<ForceDesignerDPIUnaware>true</ForceDesignerDPIUnaware>
<Title>NewOutlookPatcher</Title>
<AssemblyVersion>2024.03.15.02</AssemblyVersion>
<FileVersion>2024.03.15.02</FileVersion>
<AssemblyVersion>2024.03.15.03</AssemblyVersion>
<FileVersion>2024.03.15.03</FileVersion>
<PackageProjectUrl>https://github.com/valinet/NewOutlookPatcher</PackageProjectUrl>
<Copyright>Copyright 2024 VALINET Solutions. All rights reserved.</Copyright>
<Description>Disable ads and product placement in the new Outlook for Windows app.</Description>
<Version>2024.03.15.02</Version>
<Version>2024.03.15.03</Version>
<PublishSingleFile>true</PublishSingleFile>
<PackageId>NewOutlookPatcher</PackageId>
<Authors>NewOutlookPatcher</Authors>
Expand All @@ -31,6 +31,7 @@
<ItemGroup>
<EmbeddedResource Include="$(SolutionDir)\x64\Release\dxgi.dll" />
<EmbeddedResource Include="$(SolutionDir)\x64\Release\loader.exe" />
<EmbeddedResource Include="$(SolutionDir)\x64\Release\loader2.exe" />
<EmbeddedResource Include="$(SolutionDir)\x64\Release\installer.sys" />
</ItemGroup>

Expand Down
Binary file added NOP/loader2/16.ico
Binary file not shown.
Binary file added NOP/loader2/32.ico
Binary file not shown.
Loading

0 comments on commit e096b64

Please sign in to comment.