Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Jujstme authored Oct 24, 2019
0 parents commit 549b6e6
Show file tree
Hide file tree
Showing 10 changed files with 476 additions and 0 deletions.
93 changes: 93 additions & 0 deletions ASRT No AI Tool.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?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>{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>ASRT_No_AI_Tool</RootNamespace>
<AssemblyName>ASRT No AI Tool</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>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
31 changes: 31 additions & 0 deletions ASRT No AI Tool.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29409.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASRT No AI Tool", "ASRT No AI Tool.csproj", "{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Debug|Any CPU.Build.0 = Release|Any CPU
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Debug|x86.ActiveCfg = Debug|x86
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Debug|x86.Build.0 = Debug|x86
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Release|Any CPU.Build.0 = Release|Any CPU
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Release|x86.ActiveCfg = Release|x86
{AFBFCAD8-6EE1-4493-A734-DC597DDFEA0F}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2E5FF71C-D121-4537-BA60-C0BEBAC462E4}
EndGlobalSection
EndGlobal
84 changes: 84 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace ASRT_No_AI_Tool
{
public class Program
{
[DllImport("kernel32")]
private static extern int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId);

[DllImport("kernel32")]
private static extern bool WriteProcessMemory(int hProcess, int lpBaseAddress, byte[] lpbuffer, int nSize, int lpNumberOfBytesWritten);

[DllImport("kernel32")]
private static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, int lpNumberOfBytesRead);

[DllImport("kernel32")]
private static extern int VirtualAllocEx(int hProcess, IntPtr lpAddress, int nSize, uint flAllocationType, uint flProtect);

[DllImport("kernel32")]
private static extern int VirtualFreeEx(int hProcess, int lpAddress, int nSize, uint dwFreeType);

private static int processHandle;

public static void Main()
{
Application.EnableVisualStyles();
Process[] processList = Process.GetProcessesByName("ASN_App_PcDx9_Final");
if (processList.Length == 0)
{
MessageBox.Show("Please start the game first!", "ASRT No AI Tool", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0);
}
foreach (Process process in processList)
{
processHandle = OpenProcess(0x38, 0, process.Id);

if (processHandle == 0)
{
MessageBox.Show("Could not access the game, please run as administrator!", "ASRT No AI Tool", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(2);
}

if (process.MainModule.ModuleMemorySize != 0xC7C000 && process.MainModule.ModuleMemorySize != 0xD06000)
{
MessageBox.Show("Cannot apply patch. Please ensure you are\n" +
"running the correct version of the game!", "ASRT No AI Tool", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(2);
}
byte[] status = new byte[4];
int bytesRead = 0;
int injectionpoint = 0x8C3BEC;
ReadProcessMemory(processHandle, injectionpoint, status, 1, bytesRead);
if (BitConverter.ToInt32(status, 0) != 0xE8)
{
byte[] injectedcode = new byte[] {0x8B, 0x0D, 0x30, 0x74, 0xBC, 0x00, 0x43, 0xEB, 0x04, 0x3B, 0x59, 0x28, 0xC3, 0x50, 0xA1, 0x88, 0x1A,
0xEC, 0x00, 0x83, 0xB8, 0x25, 0x05, 0x00, 0x00, 0x00, 0x58, 0x75, 0xEC, 0x50, 0x53, 0x51, 0x52, 0x31, 0xC0, 0x31, 0xD2, 0xB9, 0x3F, 0x0F,
0xBD, 0x00, 0x41, 0x8B, 0x19, 0x00, 0xD8, 0xFE, 0xC2, 0x80, 0xFA, 0x04, 0x75, 0xF4, 0x5A, 0x59, 0x5B, 0x39, 0xC3, 0x58, 0xEB, 0xCE};
int injectionaddress = VirtualAllocEx(processHandle, IntPtr.Zero, injectedcode.Length, 0x00001000, 0x40);
WriteProcessMemory(processHandle, injectionaddress, injectedcode, injectedcode.Length, 0);
byte[] injectedcodecall = new byte[] { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90 };
BitConverter.GetBytes(injectionaddress - (injectionpoint + 5)).CopyTo(injectedcodecall, 1);
WriteProcessMemory(processHandle, injectionpoint, injectedcodecall, injectedcodecall.Length, 0);
MessageBox.Show("You are now free from the AI in Single Race mode!", "ASRT No AI Tool", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
if (MessageBox.Show("It appears your game is already patched\n" +
"Do you want to remove the patch and restore stock settings?", "ASRT No AI Tool", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
byte[] offset = new byte[4];
ReadProcessMemory(processHandle, injectionpoint + 1, offset, offset.Length, bytesRead);
WriteProcessMemory(processHandle, injectionpoint, new byte[] { 0x8B, 0x0D, 0x30, 0x74, 0xBC, 0x00, 0x43, 0x3B, 0x59, 0x28 }, 10, 0);
VirtualFreeEx(processHandle, injectionpoint + 5 + BitConverter.ToInt32(offset, 0), 10, 0x4000);
MessageBox.Show("No AI mod has been disabled!\n" +
"Enjoy your stock experience!", "ASRT No AI Tool", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
}
}
36 changes: 36 additions & 0 deletions 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("ASRT No AI Tool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ASRT No AI Tool")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[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("afbfcad8-6ee1-4493-a734-dc597ddfea0f")]

// 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")]
71 changes: 71 additions & 0 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 549b6e6

Please sign in to comment.