Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#define SHOWDEBUG
- using System;
- using System.Collections.Generic;
- using System.Text;
- using UnityEngine;
- using System.Reflection;
- using System.Runtime.InteropServices;
- using System.IO;
- using System.Reflection.Emit;
- using RuntimeHelpers = System.Runtime.CompilerServices.RuntimeHelpers;
- class Hack : MonoBehaviour
- {
- static public int[] count = new int[25];
- bool bMenu = false;
- bool bHideGUI = false;
- bool bHideDebug = false;
- Rect windowRect = new Rect(256, 128, 192, 400);
- //Features
- bool bAimbot = true;
- bool bAimVisible = true;
- bool bAutoFire = false;
- bool bChams = true;
- bool bSkeleton = false;
- bool bHealth = true;
- bool bLine = false;
- bool bBox = false;
- //Options
- bool bLight = false;
- bool bNoRecoilSpread = true;
- bool bNoOcclusion = true;
- //Utility Functions
- Material lineMaterial = null;
- void CreateLineMaterial()
- {
- if (!lineMaterial)
- {
- lineMaterial = new Material("Shader \"Lines/Colored Blended\" {" +
- "SubShader { Pass { " +
- " Blend SrcAlpha OneMinusSrcAlpha " +
- " ZWrite Off Cull Off Fog { Mode Off } " +
- " ZTest Always" +
- " BindChannels {" +
- " Bind \"vertex\", vertex Bind \"color\", color }" +
- "} } }");
- lineMaterial.hideFlags = HideFlags.HideAndDontSave;
- lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
- }
- }
- public void DrawLine(Vector3 Start, Vector3 End, Color color)
- {
- lineMaterial.SetPass(0);
- GL.PushMatrix();
- GL.LoadOrtho();
- GL.Color(color);
- GL.Begin(GL.LINES);
- GL.Vertex3(Start.x / Screen.width, Start.y / Screen.height, 0);
- GL.Vertex3(End.x / Screen.width, End.y / Screen.height, 0);
- GL.End();
- GL.PopMatrix();
- }
- void DrawBox(Vector3 Pos, float Width, float Height, Color color)
- {
- DrawLine(new Vector3(Pos.x, Pos.y, 0), new Vector3(Pos.x + Width, Pos.y, 0), color);
- DrawLine(new Vector3(Pos.x + Width, Pos.y, 0), new Vector3(Pos.x + Width, Pos.y + Height, 0), color);
- DrawLine(new Vector3(Pos.x + Width, Pos.y + Height, 0), new Vector3(Pos.x, Pos.y + Height, 0), color);
- DrawLine(new Vector3(Pos.x, Pos.y + Height, 0), new Vector3(Pos.x, Pos.y, 0), color);
- }
- public void DrawBoxCentered(Vector3 Pos, float Width, float Height, Color color)
- {
- float hw = Width / 2;
- float hh = Height / 2;
- DrawLine(new Vector3(Pos.x - hw, Pos.y - hh, Pos.z), new Vector3(Pos.x + hw, Pos.y - hh, Pos.z), color);
- DrawLine(new Vector3(Pos.x - hw, Pos.y + hh, Pos.z), new Vector3(Pos.x + hw, Pos.y + hh, Pos.z), color);
- DrawLine(new Vector3(Pos.x - hw, Pos.y - hh, Pos.z), new Vector3(Pos.x - hw, Pos.y + hh, Pos.z), color);
- DrawLine(new Vector3(Pos.x + hw, Pos.y - hh, Pos.z), new Vector3(Pos.x + hw, Pos.y + hh, Pos.z), color);
- }
- public void DrawCircle(Vector3 Pos, float r, float s, Color color)
- {
- float Step = 3.14159265f * 2.0f / s;
- for (float a = 0; a < 3.14159265 * 2.0; a += Step)
- {
- float x1 = r * Mathf.Cos(a) + Pos.x;
- float y1 = r * Mathf.Sin(a) + Pos.y;
- float x2 = r * Mathf.Cos(a + Step) + Pos.x;
- float y2 = r * Mathf.Sin(a + Step) + Pos.y;
- DrawLine(new Vector3(x1, y1, 0), new Vector3(x2, y2, 0), color);
- }
- }
- Material ChamMaterial = null;
- Material[] ChamMats;
- void CreateChamMaterial()
- {
- if (!ChamMaterial)
- {
- ChamMaterial = new Material(
- "Shader \"Custom/Cham\"" +
- "{" +
- " SubShader " +
- " {" +
- " Pass " +
- " {" +
- " ZTest Less" +
- " ZWrite On" +
- " Color (1,0,0,1) " +
- " }" +
- " Pass " +
- " {" +
- " ZTest Greater" +
- " ZWrite Off" +
- " Color (0,0,1,1)" +
- " }" +
- " }" +
- "}");
- ChamMaterial.hideFlags = HideFlags.HideAndDontSave;
- ChamMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
- ChamMats = new Material[] { ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial, ChamMaterial };
- }
- }
- Material ChamMaterial2 = null;
- Material[] ChamMats2;
- void CreateChamMaterial2()
- {
- if (!ChamMaterial2)
- {
- ChamMaterial2 = new Material(
- "Shader \"Custom/Cham\"" +
- "{" +
- " SubShader " +
- " {" +
- " Pass " +
- " {" +
- " ZTest Less" +
- " ZWrite On" +
- " Color (1,1,0,1) " +
- " }" +
- " Pass " +
- " {" +
- " ZTest Greater" +
- " ZWrite Off" +
- " Color (0,1,0,1)" +
- " }" +
- " }" +
- "}");
- ChamMaterial2.hideFlags = HideFlags.HideAndDontSave;
- ChamMaterial2.shader.hideFlags = HideFlags.HideAndDontSave;
- ChamMats2 = new Material[] { ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2, ChamMaterial2 };
- }
- }
- //public bool IsVisible(GameObject obj, Vector3 Position)
- //{
- // RaycastHit hit;
- // //Vector3 rayDirection = Camera.main.transform.position - Position;
- // //if (Physics.Raycast(Position, rayDirection, out hit))
- // //{
- // // if (hit.transform == obj.transform)
- // // return true;
- // //}
- // //return false;
- // Vector3 FromPosition = Camera.main.transform.position;
- // //FromPosition += Camera.main.transform.forward * 2;
- // //0x440800
- // if (Physics.Linecast(FromPosition, Position, out hit, 0x440800))
- // {
- // Vector3 hitESP = Camera.main.WorldToScreenPoint(hit.point);
- // if (hitESP.z >= 0)
- // {
- // if (hit.collider)
- // {
- // if (hit.collider.gameObject.transform.root.gameObject == obj.transform.root.gameObject)
- // {
- // DrawCircle(hitESP, 10, 4, Color.cyan);
- // }
- // else
- // {
- // DrawCircle(hitESP, 10, 4, Color.magenta);
- // }
- // }
- // else
- // DrawCircle(hitESP, 10, 4, Color.white);
- // }
- // if (hit.collider)
- // {
- // if (hit.collider.gameObject.transform.root.gameObject == obj.transform.root.gameObject) return true;
- // }
- // }
- // return false;
- //}
- //Hacks
- public bool IsVisible(GameObject obj, Vector3 Position)
- {
- RaycastHit hit;
- Vector3 FromPosition = Camera.main.transform.position;
- if (Physics.Linecast(FromPosition, Position, out hit, 0x440800))
- {
- //Vector3 hitESP = Camera.main.WorldToScreenPoint(hit.point);
- //if (hitESP.z >= 0)
- //{
- // DrawCircle(hitESP, 10, 4, Color.white);
- //}
- return false;
- }
- return true;
- }
- bool CanDoHacks()
- {
- if (!Camera.main) return false;
- if (!Main.get_IsAlive()) return false;
- //if (!Peer.get_ClientGame()) return false;
- return true;
- }
- //Current Skeleton
- Vector3 Head = Vector3.zero;
- Vector3 Neck = Vector3.zero;
- Vector3 Pelvis = Vector3.zero;
- Vector3 LShoulder = Vector3.zero;
- Vector3 LElbow = Vector3.zero;
- Vector3 LHand = Vector3.zero;
- Vector3 LHip = Vector3.zero;
- Vector3 LKnee = Vector3.zero;
- Vector3 LFoot = Vector3.zero;
- Vector3 RShoulder = Vector3.zero;
- Vector3 RElbow = Vector3.zero;
- Vector3 RHand = Vector3.zero;
- Vector3 RHip = Vector3.zero;
- Vector3 RKnee = Vector3.zero;
- Vector3 RFoot = Vector3.zero;
- void ResetSkeleton()
- {
- Head = Vector3.zero;
- Neck = Vector3.zero;
- Pelvis = Vector3.zero;
- LShoulder = Vector3.zero;
- LElbow = Vector3.zero;
- LHand = Vector3.zero;
- LHip = Vector3.zero;
- LKnee = Vector3.zero;
- LFoot = Vector3.zero;
- RShoulder = Vector3.zero;
- RElbow = Vector3.zero;
- RHand = Vector3.zero;
- RHip = Vector3.zero;
- RKnee = Vector3.zero;
- RFoot = Vector3.zero;
- }
- void DrawBone(Vector3 Base, Vector3 Tip, Color color)
- {
- if (Base == Vector3.zero) return;
- if (Tip == Vector3.zero) return;
- Vector3 ScreenPos1 = Camera.main.WorldToScreenPoint(Base);
- if (ScreenPos1.z < 0) return;
- Vector3 ScreenPos2 = Camera.main.WorldToScreenPoint(Tip);
- if (ScreenPos2.z < 0) return;
- DrawLine(ScreenPos1, ScreenPos2, color);
- }
- void DrawSkeleton(Color color)
- {
- DrawBone(Head, Neck, color);
- DrawBone(Neck, Pelvis, color);
- DrawBone(Neck, LShoulder, color);
- DrawBone(LShoulder, LElbow, color);
- DrawBone(LElbow, LHand, color);
- DrawBone(Pelvis, LHip, color);
- DrawBone(LHip, LKnee, color);
- DrawBone(LKnee, LFoot, color);
- DrawBone(Neck, RShoulder, color);
- DrawBone(RShoulder, RElbow, color);
- DrawBone(RElbow, RHand, color);
- DrawBone(Pelvis, RHip, color);
- DrawBone(RHip, RKnee, color);
- DrawBone(RKnee, RFoot, color);
- }
- //void Aim(BaseMoveController controller,Vector3 Target)
- //{
- // GameObject obj = new GameObject();
- // obj.transform.position = Camera.main.transform.position;
- // obj.transform.LookAt(Target, Vector3.up);
- // float ax = obj.transform.eulerAngles.x - 270;
- // while (ax < 180)
- // {
- // ax += 180;
- // }
- // while (ax > 360)
- // {
- // ax -= 360;
- // }
- // controller.state.euler.y = obj.transform.eulerAngles.y;
- // controller.state.euler.x = ax;
- //}
- void DoHacks()
- {
- //GUILayout.Label("Doing Hacks");
- if (!CanDoHacks()) return;
- Camera.main.ResetWorldToCameraMatrix();
- this.transform.position = Camera.main.transform.position;
- BaseClientGame game = Peer.get_ClientGame();
- List<EntityNetPlayer> Players = game.get_AlivePlayers();
- ClientNetPlayer local = game.get_LocalPlayer();
- EntityNetPlayer localPlayer = local.get_Entity();
- BaseMoveController controller = local.get_Controller();
- Vector3 Target = Vector3.zero;
- float BestTargetDistance = 10000;
- foreach (EntityNetPlayer Player in Players)
- {
- if (Player == localPlayer) continue;
- bool bSameTeam = localPlayer.IsTeam(Player);
- //if (bSameTeam) continue;
- Vector3 BonePos = Player.get_NeckPosition();
- Vector3 ScreenPos = Camera.main.WorldToScreenPoint(BonePos);
- if (ScreenPos.z < 0) continue;
- Color cPlayer = Color.white;
- bool bVisible = IsVisible(Player.gameObject, BonePos);
- if (bSameTeam && bVisible) cPlayer = Color.green;
- if (bSameTeam && !bVisible) cPlayer = Color.blue;
- if (!bSameTeam && bVisible) cPlayer = Color.red;
- if (!bSameTeam && !bVisible) cPlayer = Color.yellow;
- ResetSkeleton();
- foreach (SkinnedMeshRenderer skin in Player.gameObject.GetComponentsInChildren<SkinnedMeshRenderer>())
- {
- if (bChams)
- {
- if (!bSameTeam)
- skin.materials = ChamMats;
- else
- skin.materials = ChamMats2;
- }
- foreach (Transform bone in skin.bones)
- {
- if (bone.name.Contains("NPC_Head")) Head = bone.position;
- else if (bone.name.Contains("NPC_Neck")) Neck = bone.position;
- else if (bone.name.Contains("NPC_Pelvis")) Pelvis = bone.position;
- else if (bone.name.Contains("NPC_L UpperArm")) LShoulder = bone.position;
- else if (bone.name.Contains("NPC_L Forearm")) LElbow = bone.position;
- else if (bone.name.Contains("NPC_L Hand")) LHand = bone.position;
- else if (bone.name.Contains("NPC_L Thigh")) LHip = bone.position;
- else if (bone.name.Contains("NPC_L Calf")) LKnee = bone.position;
- else if (bone.name.Contains("NPC_L Foot")) LFoot = bone.position;
- else if (bone.name.Contains("NPC_R UpperArm")) RShoulder = bone.position;
- else if (bone.name.Contains("NPC_R Forearm")) RElbow = bone.position;
- else if (bone.name.Contains("NPC_R Hand")) RHand = bone.position;
- else if (bone.name.Contains("NPC_R Thigh")) RHip = bone.position;
- else if (bone.name.Contains("NPC_R Calf")) RKnee = bone.position;
- else if (bone.name.Contains("NPC_R Foot")) RFoot = bone.position;
- }
- }
- if (bSkeleton) DrawSkeleton(cPlayer);
- if (bLine)
- {
- Vector3 linePos = Camera.main.WorldToScreenPoint(Pelvis);
- DrawLine(new Vector3(Screen.width / 2, 0, 0), linePos, cPlayer);
- }
- if (bBox)
- {
- Vector3 top = Camera.main.WorldToScreenPoint(Head);
- Vector3 middle = Camera.main.WorldToScreenPoint(Pelvis);
- Vector3 bottom = Camera.main.WorldToScreenPoint(LFoot);
- float s = bottom.y - top.y;
- DrawBoxCentered(middle, s / 2, s, cPlayer);
- }
- if (bHealth)
- {
- float Health = Player.get_Health();
- Color cHealth = Color.green;
- if (Health < 70) cHealth = Color.yellow;
- if (Health < 35) cHealth = Color.red;
- Vector3 HealthPos = ScreenPos;
- HealthPos.x -= 25;
- HealthPos.y += 16;
- DrawBox(HealthPos, 50, 1, Color.black);
- DrawBox(HealthPos, Health / 2, 1, cHealth);
- }
- if (!bSameTeam && (!bAimVisible || (bAimVisible && bVisible)))
- {
- float xDiff = ScreenPos.x - (Screen.width / 2);
- float yDiff = ScreenPos.y - (Screen.height / 2);
- float dist = (float)Math.Sqrt(xDiff * xDiff + yDiff * yDiff);
- if (dist < BestTargetDistance)
- {
- BestTargetDistance = dist;
- Target = Neck;
- }
- }
- }
- if (bAimbot && Input.GetKey(KeyCode.LeftShift))
- {
- if (Target != Vector3.zero)
- {
- Vector3 targetESP = Camera.main.WorldToScreenPoint(Target);
- DrawCircle(targetESP, 10, 10, Color.green);
- Aim(controller, Target);
- //Move(mx, my);
- //if (bAutoFire && (MoveSpeed < 5)) LeftClick();
- }
- }
- }
- void DoHacks1()
- {
- if (!CanDoHacks()) return;
- Camera.main.ResetWorldToCameraMatrix();
- this.transform.position = Camera.main.transform.position;
- BaseClientGame game = Peer.get_ClientGame();
- List<EntityNetPlayer> Players = game.get_AlivePlayers();
- ClientNetPlayer local = game.get_LocalPlayer();
- EntityNetPlayer localPlayer = local.get_Entity();
- BaseMoveController controller = local.get_Controller();
- Vector3 Target = Vector3.zero;
- float BestTargetDistance = 10000;
- bool bWasVisible = false;
- foreach (EntityNetPlayer Player in Players)
- {
- if (Player == localPlayer) continue;
- Vector3 BonePos = Player.get_NeckPosition();
- Vector3 ScreenPos = Camera.main.WorldToScreenPoint(BonePos);
- if (ScreenPos.z < 0) continue;
- bool bSameTeam = localPlayer.IsTeam(Player);
- Color cPlayer = Color.white;
- bool bVisible = IsVisible(Player.gameObject, BonePos);
- if (bSameTeam && bVisible) cPlayer = Color.green;
- if (bSameTeam && !bVisible) cPlayer = Color.blue;
- if (!bSameTeam && bVisible) cPlayer = Color.red;
- if (!bSameTeam && !bVisible) cPlayer = Color.yellow;
- foreach (SkinnedMeshRenderer skin in Player.gameObject.GetComponentsInChildren<SkinnedMeshRenderer>())
- {
- if (bChams)
- {
- if (!bSameTeam)
- skin.materials = ChamMats;
- else
- skin.materials = ChamMats2;
- }
- }
- if (bLine && !bSameTeam)
- {
- DrawLine(new Vector3(Screen.width / 2, 0, 0), ScreenPos, cPlayer);
- }
- if (bHealth && !bSameTeam)
- {
- float Health = Player.get_Health();
- Color cHealth = Color.green;
- if (Health < 70) cHealth = Color.yellow;
- if (Health < 35) cHealth = Color.red;
- Vector3 HealthPos = ScreenPos;
- HealthPos.x -= 25;
- HealthPos.y += 16;
- DrawBox(HealthPos, 50, 1, Color.black);
- DrawBox(HealthPos, Health / 2, 1, cHealth);
- }
- if (!bSameTeam && (!bAimVisible || (bAimVisible && bVisible)))
- {
- float xDiff = ScreenPos.x - (Screen.width / 2);
- float yDiff = ScreenPos.y - (Screen.height / 2);
- float dist = (float)Math.Sqrt(xDiff * xDiff + yDiff * yDiff);
- if (dist < BestTargetDistance)
- {
- BestTargetDistance = dist;
- Target = BonePos;
- bWasVisible = bVisible;
- }
- }
- }
- if (bAimbot && Target != Vector3.zero)
- {
- Vector3 targetESP = Camera.main.WorldToScreenPoint(Target);
- DrawCircle(targetESP, 10, 10, Color.green);
- if (bWasVisible)
- {
- DrawCircle(targetESP, 5, 10, Color.green);
- }
- }
- if (bAimbot && Input.GetKey(KeyCode.LeftShift))
- {
- if (Target != Vector3.zero)
- {
- Aim(controller, Target);
- }
- }
- }
- Vector3 TestPos;
- void DoHacks2()
- {
- //GUILayout.Label("Doing Hacks");
- if (!CanDoHacks()) return;
- Camera.main.ResetWorldToCameraMatrix();
- this.transform.position = Camera.main.transform.position;
- BaseClientGame game = Peer.get_ClientGame();
- List<EntityNetPlayer> Players = game.get_AlivePlayers();
- ClientNetPlayer local = game.get_LocalPlayer();
- EntityNetPlayer localPlayer = local.get_Entity();
- BaseMoveController controller = local.get_Controller();
- if (Input.GetKey(KeyCode.Keypad0))
- {
- //TestPos = controller.state.pos;
- TestPos = controller.transform.position;
- }
- Vector3 TestScreenPos = Camera.main.WorldToScreenPoint(TestPos);
- DrawCircle(TestScreenPos, 10, 10, Color.green);
- GUILayout.Label("State: " + controller.state.euler.x + "," + controller.state.euler.y);
- GameObject obj = new GameObject();
- obj.transform.position = Camera.main.transform.position;
- //obj.transform.position = controller.transform.position;
- //obj.transform.rotation = controller.transform.rotation;
- obj.transform.LookAt(TestPos,Vector3.up);
- GUILayout.Label("Look: " + obj.transform.eulerAngles.x + "," + obj.transform.eulerAngles.y);
- float ax = obj.transform.eulerAngles.x - 270;
- while (ax < 180)
- {
- ax += 180;
- }
- while (ax > 360)
- {
- ax -= 360;
- }
- GUILayout.Label("ax: " + ax);
- if (Input.GetKey(KeyCode.LeftShift))
- {
- controller.state.euler.y = obj.transform.eulerAngles.y;
- controller.state.euler.x = ax;
- }
- if (Input.GetKey(KeyCode.LeftControl))
- {
- controller.state.euler.x = ax;
- }
- if (Input.GetKey(KeyCode.Keypad1))
- {
- controller.state.euler.x += 1;
- }
- foreach (EntityNetPlayer Player in Players)
- {
- if (Player == localPlayer) continue;
- bool bSameTeam = localPlayer.IsTeam(Player);
- if (bSameTeam) continue;
- if (bChams)
- {
- foreach (SkinnedMeshRenderer skin in Player.gameObject.GetComponentsInChildren<SkinnedMeshRenderer>())
- {
- skin.materials = ChamMats;
- }
- }
- Vector3 BonePos = Player.get_NeckPosition();
- Vector3 ScreenPos = Camera.main.WorldToScreenPoint(BonePos);
- if (ScreenPos.z < 0) continue;
- if (bHealth)
- {
- float Health = Player.get_Health();
- Color cHealth = Color.green;
- if (Health < 70) cHealth = Color.yellow;
- if (Health < 35) cHealth = Color.red;
- Vector3 HealthPos = ScreenPos;
- HealthPos.x -= 25;
- HealthPos.y += 16;
- DrawBox(HealthPos, 50, 1, Color.black);
- DrawBox(HealthPos, Health / 2, 1, cHealth);
- }
- }
- }
- //Hooks
- class _h1 : BaseWeapon
- {
- public float get_CurrentAccuracy()
- {
- return 0;
- }
- //public float get_firerate()
- //{
- // return 1;
- //}
- //public float get_reloadSpeed()
- //{
- // return 1f;
- //}
- }
- class _h2 : HtmlLayer
- {
- public static void SendFile(string actions, byte[] data, RequestFinished finished = null, RequestFailed failed = null)
- {
- Hack.count[0] += 1;
- return;
- }
- }
- class _h3 : AntiWallHack
- {
- private void Update()
- {
- Hack.count[1] += 1;
- return;
- }
- public void Ban()
- {
- Hack.count[2] += 1;
- return;
- }
- private void DisconnectAndBan()
- {
- Hack.count[3] += 1;
- return;
- }
- public bool IsEquals(Color col1, Color col2)
- {
- Hack.count[4] += 1;
- return false;
- }
- public static void CaptureScreenshot(string reporterNick, int reporterID)
- {
- Hack.count[5] += 1;
- return;
- }
- public void InvokeCheck()
- {
- Hack.count[6] += 1;
- return;
- }
- }
- class _h4 : Main
- {
- private void OnEmuFailure(string method)
- {
- Hack.count[7] += 1;
- return;
- }
- }
- class _h5 : MipmapCheck
- {
- public static void Check()
- {
- Hack.count[8] += 1;
- return;
- }
- private bool IsEuqal(Color col1, Color col2)
- {
- Hack.count[9] += 1;
- return false;
- }
- }
- class _h6 : Utility
- {
- public static Texture2D CaptureCustomScreenshot(int width, int height)
- {
- Hack.count[10] += 1;
- Texture2D texture2D1 = new Texture2D(width, height, (TextureFormat)3, true, false);
- //texture2D1.ReadPixels(new Rect(0.0f, 0.0f, (float)width, (float)height), 0, 0);
- int num = Screen.width / 800;
- Texture2D texture2D2 = new Texture2D(width >> num, height >> num, (TextureFormat)3, false, false);
- texture2D2.SetPixels32(texture2D1.GetPixels32(num));
- texture2D2.Apply();
- return texture2D2;
- }
- }
- class _h7 : HoneyPot
- {
- public override void Initialize(object[] args)
- {
- Hack.count[11] += 1;
- return;
- }
- }
- bool HookFunction(MethodBase Original, MethodBase HookClass)
- {
- if (Original == null) return false;
- if (HookClass == null) return false;
- IntPtr pBody1 = Original.MethodHandle.GetFunctionPointer();
- IntPtr pBody2 = HookClass.MethodHandle.GetFunctionPointer();
- if (pBody1 == null) return false;
- if (pBody2 == null) return false;
- unsafe
- {
- var ptr = (byte*)pBody1.ToPointer();
- Int32 Source = (Int32)pBody1.ToPointer();
- Int32 Dest = (Int32)pBody2.ToPointer();
- (*(byte*)(ptr + 0)) = 0xE9;
- (*(Int32*)(ptr + 1)) = Dest - (Source + 5);
- }
- GUILayout.Label("Hooked: " + Original.Name);
- return true;
- }
- bool b1 = false;
- bool b2 = false;
- bool b3 = false;
- bool b4 = false;
- bool b5 = false;
- bool b6 = false;
- bool b7 = false;
- bool b8 = false;
- bool b9 = false;
- bool b10 = false;
- bool b11 = false;
- bool b12 = false;
- bool b13 = false;
- bool b14 = false;
- bool b15 = false;
- void DoHooks()
- {
- #if SHOWDEBUG
- GUILayout.Label("Hooking Shit : " + cygwin_x32.CygWin32L.Instance.AssemblyCount);
- GUILayout.Label("b1 : " + b1);
- GUILayout.Label("b2 : " + b2);
- GUILayout.Label("b3 : " + b3);
- GUILayout.Label("b4 : " + b4);
- GUILayout.Label("b5 : " + b5);
- GUILayout.Label("b6 : " + b6);
- GUILayout.Label("b7 : " + b7);
- GUILayout.Label("b8 : " + b8);
- GUILayout.Label("b9 : " + b9);
- GUILayout.Label("b10 : " + b10);
- GUILayout.Label("b11 : " + b11);
- GUILayout.Label("b12 : " + b12);
- GUILayout.Label("b13 : " + b13);
- GUILayout.Label("b14 : " + b14);
- GUILayout.Label("b15 : " + b15);
- #endif
- //{
- // MethodBase method1 = typeof(NetEmulation).GetMethod("OnEmuFailure", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // MethodBase method2 = typeof(_h4).GetMethod("OnEmuFailure", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // HookFunction(method1, method2);
- //}
- {
- if (!b1)
- {
- MethodBase method1 = typeof(Main).GetMethod("OnEmuFailure", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h4).GetMethod("OnEmuFailure", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b1 = HookFunction(method1, method2);
- }
- }
- {
- if (!b2)
- {
- MethodBase method1 = typeof(HtmlLayer).GetMethod("SendFile", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h2).GetMethod("SendFile", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b2 = HookFunction(method1, method2);
- }
- }
- {
- if (!b3)
- {
- MethodBase method1 = typeof(HoneyPot).GetMethod("Initialize", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h7).GetMethod("Initialize", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b3 = HookFunction(method1, method2);
- }
- }
- {
- if (!b4)
- {
- MethodBase method1 = typeof(AntiWallHack).GetMethod("Update", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h3).GetMethod("Update", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b4 = HookFunction(method1, method2);
- }
- }
- {
- if (!b5)
- {
- MethodBase method1 = typeof(AntiWallHack).GetMethod("Ban", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h3).GetMethod("Ban", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b5 = HookFunction(method1, method2);
- }
- }
- {
- if (!b6)
- {
- MethodBase method1 = typeof(AntiWallHack).GetMethod("DisconnectAndBan", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h3).GetMethod("DisconnectAndBan", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b6 = HookFunction(method1, method2);
- }
- }
- {
- if (!b13)
- {
- MethodBase method1 = typeof(AntiWallHack).GetMethod("IsEquals", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h3).GetMethod("IsEquals", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b13 = HookFunction(method1, method2);
- }
- }
- {
- if (!b7)
- {
- MethodBase method1 = typeof(AntiWallHack).GetMethod("CaptureScreenshot", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h3).GetMethod("CaptureScreenshot", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b7 = HookFunction(method1, method2);
- }
- }
- {
- if (!b8)
- {
- MethodBase method1 = typeof(AntiWallHack).GetMethod("InvokeCheck", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h3).GetMethod("InvokeCheck", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b8 = HookFunction(method1, method2);
- }
- }
- {
- if (!b9)
- {
- MethodBase method1 = typeof(Utility).GetMethod("CaptureCustomScreenshot", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h6).GetMethod("CaptureCustomScreenshot", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b9 = HookFunction(method1, method2);
- }
- }
- {
- if (!b10)
- {
- MethodBase method1 = typeof(MipmapCheck).GetMethod("Check", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h5).GetMethod("Check", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b10 = HookFunction(method1, method2);
- }
- }
- {
- if (!b11)
- {
- MethodBase method1 = typeof(MipmapCheck).GetMethod("IsEuqal", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- MethodBase method2 = typeof(_h5).GetMethod("IsEuqal", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- b11 = HookFunction(method1, method2);
- }
- }
- //{
- // if (bNoRecoilSpread)
- // {
- // if (!b12)
- // {
- // MethodBase method1 = typeof(ClientWeapon).GetMethod("get_CurrentAccuracy", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // MethodBase method2 = typeof(_h1).GetMethod("get_CurrentAccuracy", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // b12 = HookFunction(method1, method2);
- // }
- // }
- //}
- //{
- // MethodBase method1 = typeof(ClientWeapon).GetMethod("get_firerate", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // MethodBase method2 = typeof(ClientWeapon_hook).GetMethod("get_firerate", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // HookFunction(method1, method2);
- //}
- //{
- // MethodBase method1 = typeof(ClientWeapon).GetMethod("get_reloadSpeed", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // MethodBase method2 = typeof(ClientWeapon_hook).GetMethod("get_reloadSpeed", BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
- // HookFunction(method1, method2);
- //}
- }
- //Handle GUI Stuff...
- void Update()
- {
- //return;
- CVars.AWHType = 0;
- if (Input.GetKeyDown(KeyCode.Insert)) bHideGUI = !bHideGUI;
- if (Input.GetKeyDown(KeyCode.Home)) bMenu = !bMenu;
- //if (Input.GetKeyDown(KeyCode.End)) bHideDebug = !bHideDebug;
- if (Input.GetKeyDown(KeyCode.End)) bLight = !bLight;
- }
- ObjEdit editor = null;
- void OnGUI()
- {
- //DoHooks();
- //GUILayout.Label("Loaded...");
- //return;
- CreateLineMaterial();
- CreateChamMaterial();
- CreateChamMaterial2();
- if (!this.light)
- {
- this.gameObject.AddComponent<Light>();
- this.light.color = Color.white;
- this.light.type = LightType.Point;
- this.light.range = 300;
- this.light.shadows = LightShadows.None;
- this.light.intensity = 1;
- }
- else
- {
- this.light.enabled = bLight;
- }
- GUI.color = Color.red;
- GUI.color = Color.white;
- //if (!editor) editor = this.GetComponent<ObjEdit>();
- //if (editor && editor.bActive)
- //{
- // bMenu = false;
- // if (GUI.Button(new Rect(0, 0, 80, 20), "EXIT")) editor.bActive = false;
- // return;
- //}
- if (bHideGUI == false)
- {
- if (GUI.Button(new Rect(Screen.width - 305, Screen.height-25, 300, 20), "GameAnarchy Contract Wars v1.33c")) bMenu = !bMenu;
- if (bMenu)
- {
- GUI.color = Color.red;
- windowRect = GUI.Window(50, windowRect, WindowFunction, "Hacks");
- }
- }
- //if (Event.current.type == EventType.Repaint)
- //{
- // if (Camera.main != null)
- // {
- // Camera.main.ResetWorldToCameraMatrix();
- // Camera.main.useOcclusionCulling = !bNoOcclusion;
- // //DoHooks();
- // }
- //}
- DoHacks1();
- //GUI.color = Color.white;
- //GUILayout.Label("Test");
- //for (int i = 0; i < 12; i++)
- //{
- // GUILayout.Label(i + ": " + count[i].ToString());
- //}
- DoHooks();
- }
- class GAExit : MonoBehaviour
- {
- void Update()
- {
- GameObject.Destroy(this);
- }
- }
- void WindowFunction(int windowID)
- {
- GUI.color = Color.white;
- GUILayout.BeginVertical();
- bAimbot = GUILayout.Toggle(bAimbot, "Aim Assist");
- bAimVisible = GUILayout.Toggle(bAimVisible, "Aim Visible");
- //bAutoFire = GUILayout.Toggle(bAutoFire, "Auto Fire");
- bChams = GUILayout.Toggle(bChams, "Chams");
- //bSkeleton = GUILayout.Toggle(bSkeleton, "Skeletons");
- bHealth = GUILayout.Toggle(bHealth, "Health Bars");
- //bLine = GUILayout.Toggle(bLine, "Lines");
- //bBox = GUILayout.Toggle(bBox, "Boxes");
- GUILayout.Label("- OPTIONS -");
- bLight = GUILayout.Toggle(bLight, "Light");
- //bNoRecoilSpread = GUILayout.Toggle(bNoRecoilSpread, "No Spread/Recoil");
- //bNoOcclusion = GUILayout.Toggle(bNoOcclusion, "No Occlusion");
- //if (GUILayout.Button("Editor"))
- //{
- // if (editor != null) editor.bActive = true;
- //}
- if (GUILayout.Button("HELP"))
- {
- Application.OpenURL("http://gameanarchy.net/666/");
- }
- if (GUILayout.Button("Quit Hack"))
- {
- GameObject.Destroy(_HOOK.tst);
- GameObject e = new GameObject();
- e.AddComponent<GAExit>();
- }
- GUILayout.EndVertical();
- GUI.DragWindow();
- }
- }
- class _HOOK
- {
- public static GameObject tst = null;
- static void InitHack()
- {
- if (tst == null)
- {
- tst = new GameObject();
- tst.AddComponent<Hack>();
- //tst.AddComponent<ObjEdit>();
- GameObject.DontDestroyOnLoad(tst);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement