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