Compare commits

..

No commits in common. "main" and "1.0.1" have entirely different histories.
main ... 1.0.1

4 changed files with 21 additions and 84 deletions

View File

@ -2,13 +2,10 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net4.7.2</TargetFramework> <TargetFramework>net4.7.2</TargetFramework>
<Version>1.1.1</Version> <Version>1.0.1</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.2.2" />
</ItemGroup>
</Project> </Project>

View File

@ -1,15 +1,13 @@
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Compression;
using System.Net; using System.Net;
using System.Reflection; using System.Reflection;
using HarmonyLib;
namespace DeezShade { namespace DeezShade {
public class Program { public class Program {
public static void Main(string[] args) { public static void Main(string[] args) {
var version = Assembly.GetExecutingAssembly().GetName().Version; Console.WriteLine("DeezShade v1.0.0, by NotNet and friends");
Console.WriteLine($"DeezShade v{version}, by NotNet and friends");
Console.WriteLine("Built for GShade v4.1.1."); Console.WriteLine("Built for GShade v4.1.1.");
Console.Write("Enter the path to your game install: "); Console.Write("Enter the path to your game install: ");
@ -36,15 +34,21 @@ namespace DeezShade {
} }
} }
var installerUrl = "https://gshade.org/releases/GShade.Latest.Installer.exe"; var installerUrl =
"https://github.com/Mortalitas/GShade/releases/latest/download/GShade.Latest.Installer.exe";
var zipUrl = "https://github.com/Mortalitas/GShade/releases/latest/download/GShade.Latest.zip";
var exePath = tempPath + "GShade.Latest.Installer.exe"; var exePath = tempPath + "GShade.Latest.Installer.exe";
var zipPath = tempPath + "GShade.Latest.zip";
Console.WriteLine("Downloading GShade installer..."); Console.WriteLine("Downloading GShade installer...");
using (var client = new WebClient()) { using (var client = new WebClient()) {
client.DownloadFile(installerUrl, exePath); client.DownloadFile(installerUrl, exePath);
client.DownloadFile(zipUrl, zipPath);
} }
// I'm using the official GShade installer, am I not? :^ // I'm using the official GShade installer, am I not? :^
Console.WriteLine("Requesting new files through GShade installer...");
var assembly = Assembly.LoadFile(exePath); var assembly = Assembly.LoadFile(exePath);
var type = assembly.GetType("GShadeInstaller.App"); var type = assembly.GetType("GShadeInstaller.App");
@ -52,21 +56,13 @@ namespace DeezShade {
type.GetField("_gsTempPath").SetValue(null, tempPath); type.GetField("_gsTempPath").SetValue(null, tempPath);
type.GetField("_exeParentPath").SetValue(null, gameInstall); type.GetField("_exeParentPath").SetValue(null, gameInstall);
// Patch GShade from shutting off your computer (LMAO)
Console.WriteLine("Patching GShade malware...");
var harmony = new Harmony("com.notnite.thanks-marot");
var getProcessesByName = typeof(Process).GetMethod("GetProcessesByName", new[] { typeof(string) });
harmony.Patch(getProcessesByName, new HarmonyMethod(typeof(Program).GetMethod(nameof(ProcessDetour))));
Console.WriteLine("Requesting new files through GShade installer...");
type.GetMethod("CopyZipDeployProcess").Invoke(null, null); type.GetMethod("CopyZipDeployProcess").Invoke(null, null);
type.GetMethod("PresetDownloadProcess").Invoke(null, null); type.GetMethod("PresetDownloadProcess").Invoke(null, null);
type.GetMethod("PresetInstallProcess").Invoke(null, null); type.GetMethod("PresetInstallProcess").Invoke(null, null);
// File.Copy gives an access denied error, so let's make it ourself // File.Copy gives an access denied error, so let's make it ourself
var src = tempPath + "gshade-shaders"; var src = tempPath + "gshade-shaders";
var dst = Path.Combine(gameInstall, "reshade-shaders"); var dst = Path.Combine(gameInstall, "gshade-shaders");
void RecursiveClone(string path) { void RecursiveClone(string path) {
var path2 = Path.Combine(src, path); var path2 = Path.Combine(src, path);
@ -89,52 +85,20 @@ namespace DeezShade {
Console.WriteLine("Moving shaders to game directory..."); Console.WriteLine("Moving shaders to game directory...");
RecursiveClone(""); RecursiveClone("");
Directory.CreateDirectory(Path.Combine(gameInstall, "reshade-addons")); Directory.CreateDirectory(gameInstall + "gshade-addons");
Directory.Move(Path.Combine(gameInstall, "gshade-presets"), Path.Combine(gameInstall, "reshade-presets")); Console.WriteLine("Extracting DLL and config...");
var zip = ZipFile.OpenRead(zipPath);
Console.WriteLine("Downloading ReShade...");
var reshadeUrl = "http://reshade.me/downloads/ReShade_Setup_5.7.0_Addon.exe";
var reshadePath = tempPath + "ReShade_Setup_5.7.0_Addon.exe";
using (var client = new WebClient()) {
client.DownloadFile(reshadeUrl, reshadePath);
}
Console.WriteLine("Installing ReShade...");
if (File.Exists(Path.Combine(gameInstall, "dxgi.dll"))) { if (File.Exists(Path.Combine(gameInstall, "dxgi.dll"))) {
File.Move(Path.Combine(gameInstall, "dxgi.dll"), Path.Combine(gameInstall, "dxgi.dll.old")); File.Move(Path.Combine(gameInstall, "dxgi.dll"), Path.Combine(gameInstall, "dxgi.dll.old"));
} }
var reshadeProcess = new Process(); zip.GetEntry("GShade64.dll").ExtractToFile(gameInstall + "dxgi.dll", true);
reshadeProcess.StartInfo.FileName = reshadePath; zip.GetEntry("GShade.ini").ExtractToFile(gameInstall + "GShade.ini", true);
reshadeProcess.StartInfo.Arguments =
$"\"{Path.Combine(gameInstall, "ffxiv_dx11.exe")}\" --api dxgi --headless";
reshadeProcess.Start();
var configPath = Path.Combine(gameInstall, "ReShade.ini");
if (!File.Exists(configPath)) {
Console.WriteLine("Writing ReShade config...");
var configText = @"[GENERAL]
[GENERAL]
EffectSearchPaths=.\reshade-shaders\Shaders\**
TextureSearchPaths=.\reshade-shaders\Textures\**
".Trim();
File.WriteAllText(configPath, configText);
}
Console.WriteLine("Done!\nSupport FOSS, and thank you for using DeezShade!\nPress any key to continue."); Console.WriteLine("Done!\nSupport FOSS, and thank you for using DeezShade!\nPress any key to continue.");
Console.ReadKey(); Console.ReadKey();
} }
public static bool ProcessDetour(ref Process[] __result, string processName) {
if (processName == "GShade.Installer") {
__result = Array.Empty<Process>();
return false;
}
return true;
}
} }
} }

22
LICENSE
View File

@ -1,22 +0,0 @@
MIT-except-for-GShade-Developers License
Copyright (c) 2023 NotNite
Permission is hereby granted, free of charge, to any person not involved with
the GShade project, obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,12 +1,10 @@
# DeezShade # DeezShade
![license badge](https://img.shields.io/badge/license-%20MIT--except--for--GShade--Developers-green)
Okay, now it's just funny. With love from NotNet and friends. Okay, now it's just funny. With love from NotNet and friends.
DeezShade is a continuation of [GeezShade](https://git.n2.pm/NotNite/geezshade), in C#. It allows you to download GShade shaders and presets while using them with ReShade. DeezShade is a continuation of [GeezShade](https://git.n2.pm/NotNite/geezshade), in C#.
Warning: This might break or be dangerous, and I don't always have time to fix it. Marot can and has done arbitrary things through DeezShade like performing a PC shutdown. Consider following [this guide](https://gist.github.com/ry00001/3e2e63b986cb0c673645ea42ffafcc26) for manual installation steps. Note that this doesn't actually install vanilla ReShade (yet) - [do that yourself](https://reshade.me/) (but get the full addon build).
[CLICK HERE TO INSTALL IT.](https://git.n2.pm/NotNite/DeezShade/releases/latest) [CLICK HERE TO INSTALL IT.](https://git.n2.pm/NotNite/DeezShade/releases/latest)