Code:[DllImport("user32.dll")] public static extern short GetAsyncKeyState(int vKey);
Code:using System;using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; namespace VAM_Bhop_Tut { class Program { public static int aLocalPlayer = 0x00A8D53C; public static int oFlags = 0x100; public static int aJump = 0x04F457EC; public static string process = "csgo"; public static int bClient; [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true)] public static extern int GetAsyncKeyState(int vKey); static void Main(string[] args) { VAMemory vam = new VAMemory(process); if (GetModuleAddy()) { int fJump = bClient + aJump; aLocalPlayer = bClient + aLocalPlayer; int LocalPlayer = vam.ReadInt32((IntPtr)aLocalPlayer); int aFlags = LocalPlayer + oFlags; while (true) { if (GetAsyncKeyState(32) > 0) { Console.WriteLine("Pressing Space"); } while (GetAsyncKeyState(32) > 0) { int Flags = vam.ReadInt32((IntPtr)aFlags); if (Flags == 257) { vam.WriteInt32((IntPtr)fJump, 5); Thread.Sleep(10); vam.WriteInt32((IntPtr)fJump, 4); Console.Clear(); Console.WriteLine("Jumping", Console.ForegroundColor = ConsoleColor.Green); } } Console.Clear(); Console.WriteLine("Standing", Console.ForegroundColor = ConsoleColor.Yellow); Thread.Sleep(10); } } } static bool GetModuleAddy() { try { Process[] p = Process.GetProcessesByName(process); if (p.Length > 0) { foreach (ProcessModule m in p[0].Modules) { if (m.ModuleName == "client.dll") { bClient = (int)m.BaseAddress; return true; } } return true; } else { return false; } } catch (Exception ex) { return false; } } } }
- - - Updated - - -
After some research... I think I've found the cause. It's the GetASyncKeyState, it's not working, it's not detecting when I press Space :/
How do you create a properly working one in C#?
Code:[DllImport("user32.dll")] public static extern short GetAsyncKeyState(int vKey);
This might be useful
https://www.mpgh.net/forum/showthread.php?t=120656
[IMG]https://cloud-3.steamuserconten*****m/ugc/28484756670281268/F8BB74EE89D3C55FD4286CBAA083D7976AFAB5AA/[/IMG]
Hacking valve secure servers with a r00ted vpn irak.
There you go.Code:[DllImport("user32.dll")] static extern ushort GetAsyncKeyState(int vKey); public static bool IsKeyPushedDown(System.Windows.Forms.Keys vKey) { return 0 != (GetAsyncKeyState((int)vKey) & 0x8000); }
Please drop that yellow font of yours, can't read it
Faith-based morality isn't morality at all; it's obedience.
OVOMobZai (10-29-2016)
The problem with the code is that you pasted it without a single clue of what you are doing. Learn a coding language before you try to use it.
Been over a week since last update/bump after answers, assuming solved.
/Closed.