Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
CabboShiba committed Feb 17, 2023
1 parent f0e1a75 commit 491c099
Show file tree
Hide file tree
Showing 29 changed files with 33,451 additions and 0 deletions.
25 changes: 25 additions & 0 deletions DisDisHarmony.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33403.182
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisDisHarmony", "DisDisHarmony\DisDisHarmony.csproj", "{29DA51A6-7BF9-45AD-B6A2-6FEDAA5D44D0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{29DA51A6-7BF9-45AD-B6A2-6FEDAA5D44D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29DA51A6-7BF9-45AD-B6A2-6FEDAA5D44D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29DA51A6-7BF9-45AD-B6A2-6FEDAA5D44D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29DA51A6-7BF9-45AD-B6A2-6FEDAA5D44D0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {754747F7-D072-494C-8988-80412B498F7C}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions DisDisHarmony/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
58 changes: 58 additions & 0 deletions DisDisHarmony/DisDisHarmony.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{29DA51A6-7BF9-45AD-B6A2-6FEDAA5D44D0}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>DisDisHarmony</RootNamespace>
<AssemblyName>DisDisHarmony</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Patch\Hook.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
26 changes: 26 additions & 0 deletions DisDisHarmony/Patch/Hook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using HarmonyLib;
using System;
using System.Runtime.InteropServices;

namespace DisDisHarmony.Patch
{
internal class Hook
{
[HarmonyPatch(typeof(Marshal), nameof(Marshal.ReadByte), new[] {typeof(IntPtr)})]
class HookMarshal
{
static bool Prefix(IntPtr ptr, ref byte __result)
{
try
{
__result = 0;
}
catch(Exception ex)
{
Program.Log("Error: " + ex.Message, "ERROR", ConsoleColor.Red);
}
return false;
}
}
}
}
38 changes: 38 additions & 0 deletions DisDisHarmony/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using HarmonyLib;
using System;
using System.IO;
using System.Reflection;

namespace DisDisHarmony
{
internal class Program
{
static void Main(string[] args)
{
try
{
Console.Title = $"[{DateTime.Now}] DisDisHarmony made by https://github.com/CabboShiba";
object[] parameters = null;
var LoadedAssembly = Assembly.LoadFile(Path.GetFullPath(args[0]));
var paraminfo = LoadedAssembly.EntryPoint.GetParameters();
parameters = new object[paraminfo.Length];
Harmony patch = new Harmony("DisDisHarmony_https://github.com/CabboShiba");
patch.PatchAll(Assembly.GetExecutingAssembly());
LoadedAssembly.EntryPoint.Invoke(null, parameters);
}
catch (Exception ex)
{
Log("Error: " + ex.Message, "Error", ConsoleColor.Red);
}
Console.ReadLine();
}


public static void Log(string Data, string Type, ConsoleColor Color)
{
Console.ForegroundColor = Color;
Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")} - {Type}] {Data}");
Console.ResetColor();
}
}
}
36 changes: 36 additions & 0 deletions DisDisHarmony/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("DisDisHarmony")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DisDisHarmony")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]

// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("29da51a6-7bf9-45ad-b6a2-6fedaa5d44d0")]

// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Versione principale
// Versione secondaria
// Numero di build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file added DisDisHarmony/bin/Debug/0Harmony.dll
Binary file not shown.
Loading

0 comments on commit 491c099

Please sign in to comment.