Skip to content

Commit 18aae69

Browse files
authored
Add files via upload
1 parent 8b20bfb commit 18aae69

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed

Cheat DLL.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using UnityEngine;
3+
using UnityEngine.Rendering;
4+
5+
namespace CheatDLL
6+
{
7+
public class Cheat : MonoBehaviour
8+
{
9+
private Rect windowRect = new Rect(100, 100, 300, 75);
10+
public float hSliderValue = 1.0F;
11+
public bool speedChanged;
12+
13+
void OnGUI()
14+
{
15+
windowRect = GUI.Window(0, windowRect, DrawWindow, "Speed Hack");
16+
}
17+
18+
void DrawWindow(int windowID)
19+
{
20+
GUI.Label(new Rect(140, 25, 100, 20), Mathf.Round(hSliderValue).ToString());
21+
hSliderValue = GUI.HorizontalSlider(new Rect(50, 40, 200, 100), hSliderValue, 0.0F, 100.0F);
22+
23+
24+
GUI.DragWindow(new Rect(0, 0, 10000, 20));
25+
}
26+
27+
public void Update()
28+
{
29+
Time.timeScale = hSliderValue;
30+
}
31+
}
32+
33+
public class Loader
34+
{
35+
public static void Init()
36+
{
37+
GameObject gameObject = new GameObject("CheatObject");
38+
gameObject.AddComponent<Cheat>();
39+
}
40+
}
41+
}

Speed Hack Loader.cs

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Diagnostics;
6+
using System.Drawing;
7+
using System.IO;
8+
using System.Linq;
9+
using System.Reflection;
10+
using System.Text;
11+
using System.Threading.Tasks;
12+
using System.Windows.Forms;
13+
using System.Reflection;
14+
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
15+
16+
namespace Speed_Hack_Loader
17+
{
18+
public partial class SpeedHack : Form
19+
{
20+
public string tempPath;
21+
public string smiPath;
22+
public string cheatPath;
23+
24+
public SpeedHack()
25+
{
26+
InitializeComponent();
27+
this.FormBorderStyle = FormBorderStyle.FixedSingle;
28+
this.MaximizeBox = false;
29+
}
30+
31+
private void Form1_Load(object sender, EventArgs e)
32+
{
33+
tempPath = Path.GetTempPath();
34+
35+
smiPath = Path.Combine(tempPath, "smi.exe");
36+
37+
cheatPath = Path.Combine(tempPath, "CheatDLL.dll");
38+
39+
var assembly = Assembly.GetExecutingAssembly();
40+
41+
ExtractBinaryResource(assembly, "Speed_Hack_Loader.CheatDLL.dll", Path.Combine(tempPath, "CheatDLL.dll"));
42+
43+
ExtractBinaryResource(assembly, "Speed_Hack_Loader.SharpMonoInjector.dll", Path.Combine(tempPath, "SharpMonoInjector.dll"));
44+
45+
ExtractBinaryResource(assembly, "Speed_Hack_Loader.smi.exe", Path.Combine(tempPath, "smi.exe"));
46+
47+
Process[] processes = Process.GetProcesses();
48+
49+
foreach (Process process in processes)
50+
{
51+
string processName = process.ProcessName;
52+
GameDropDown.Items.Add(processName);
53+
}
54+
}
55+
56+
private void GameDropDown_SelectedIndexChanged(object sender, EventArgs e)
57+
{
58+
59+
}
60+
61+
private void GameLabel_Click(object sender, EventArgs e)
62+
{
63+
64+
}
65+
66+
private void StartButton_Click(object sender, EventArgs e)
67+
{
68+
Process.Start(smiPath, $"inject -p \"{GameDropDown.SelectedItem.ToString()}\" -a \"{cheatPath}\" -n CheatDLL -c Loader -m Init");
69+
}
70+
71+
static void ExtractBinaryResource(Assembly assembly, string resourceName, string outputPath)
72+
{
73+
using (Stream resourceStream = assembly.GetManifestResourceStream(resourceName))
74+
{
75+
if (resourceStream == null)
76+
{
77+
MessageBox.Show($"Resource {resourceName} not found!");
78+
return;
79+
}
80+
81+
using (FileStream fileStream = new FileStream(outputPath, FileMode.Create, FileAccess.Write))
82+
{
83+
resourceStream.CopyTo(fileStream);
84+
}
85+
}
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)