-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
74 lines (55 loc) · 2.48 KB
/
Program.cs
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
using System;
using System.Runtime.InteropServices;
using System.Threading;
namespace MHP3rdController
{
class Program
{
static ConsoleEventDelegate handler;
private delegate bool ConsoleEventDelegate(int eventType);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool SetConsoleCtrlHandler(ConsoleEventDelegate callback, bool add);
public static bool Running = false;
static void Main(string[] args)
{
Setting.LoadIni();
Emulator.Run();
handler = new ConsoleEventDelegate(ConsoleEventCallback);
SetConsoleCtrlHandler(handler, true);
GameMemory.LoadAddresses();
MouseMoveHandler.Run();
MouseClickHandler.Run();
KeyboardHandler.Run();
Timer timer = new Timer(TimerCallback, null, 0, 10);
Running = true;
System.Windows.Forms.Application.Run();
}
private static void TimerCallback(object sender)
{
Console.Clear();
Console.WriteLine("Base address: " + GameMemory.Address.Base.ToString("X"));
Console.WriteLine("");
Console.WriteLine("IsInFocus: " + Emulator.IsInFocus.ToString());
Console.WriteLine("IsMouseEnabled: " + MouseMoveHandler.IsMouseEnabled.ToString());
Console.WriteLine("IsScopeActive: " + GameMemory.IsScopeActive.ToString());
Console.WriteLine("");
Console.WriteLine("Camera X: " + GameMemory.LookHorisontal.ToString());
Console.WriteLine("Scope X: " + GameMemory.ScopeHorisontal.ToString());
Console.WriteLine("Scope Y: " + GameMemory.ScopeVertical.ToString());
Console.WriteLine("");
Console.WriteLine("Middle point: " + Emulator.MidPoint.X.ToString() + " : " + Emulator.MidPoint.Y.ToString());
Console.WriteLine("");
Console.WriteLine("IsShooting: " + Shooter.IsShooting.ToString());
Console.WriteLine("IsWeaponEquipped: " + GameMemory.IsWeaponEquipped.ToString());
Console.WriteLine("Bullet count: " + GameMemory.AmmoCurAmount.ToString());
}
static bool ConsoleEventCallback(int eventType)
{
if (eventType == 2)
{
Emulator.EmulatorProcess.Kill();
}
return false;
}
}
}