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