Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XDevkit;
- using System.Runtime.InteropServices;
- using XRPCLib;
- using XRPCPlusPlus;
- using XDevkitPlusPlus;
- namespace GhostsTU7ClassLib
- {
- public class Tu8Offsets
- {
- public static uint ChromePlayers = 0x82659F2B; //TU8
- public static uint Recoil = 0x822BAE9C; //tu8
- public static uint Ammo = 0x8223A0E8; //tu8
- public static uint AdvUAV = 0x82257003; // tu8
- public static uint FallDamage = 0x82222780; // tu8
- public static uint JumpValue = 0x820157B4; //tu8
- public static uint RedBoxes = 0x8225ED6C;//tu8
- public static uint Laser = 0x82270DEB; // tu8
- public static uint G_GivePlayerWeapon = 0x8241FFD8; //TU8
- public static uint G_GetWeaponIndexForName = 0x8223BF28;//TU8
- public static uint Automatic = 0x8224A03C; // tu8
- public static uint SV_GameSendServerCommand = 0x824C2764;//TU8
- public static uint SV_SetConfigstring = 0x824C4E58;//tu8
- public static uint CBuf = 0x82439B90;//TU8
- public static uint HudElem_Alloc = 0x823DA550; //TU8
- public static uint MaterialIndex = 0x821556E0;//TU8
- public static uint LocalisedStringIndex = 0x82157920;//TU8
- }
- public class Tu8Stats
- {
- public static uint Entry = 0x834EDDA4;
- public static uint Deaths = 0x5D;
- public static uint Suicides = 0x9A;
- public static uint Kills = 0x85;
- public static uint KillStreaks = 0x89;
- public static uint GamePlayed = 0x75;
- public static uint Losses = 0x8D;
- public static uint Wins = 0xD6;
- public static uint Score = 0xAE;
- public static uint TimePlayed = 0xCA;
- public static uint Hits = 0x6D;
- public static uint Misses = 0x92;
- public static uint SquadPoints = 0x4C30;
- public static uint Prestige = 0x4F28;
- public static uint RankXP = 0x9A;
- public static uint PerSquadPlayer = 0x564;
- }
- public class FPSOffsets
- {
- public static uint FPS = 0x82526C1C;//TU8
- public static uint TextSize = 0x82000B58;//ti7
- public static uint TextColor = 0x8204C2CC;//tu7
- public static uint TextPos1 = 0x82002890;//tu7
- public static uint TextPos2 = 0x8201B028;//tu7
- public static uint Text = 0x82049CFC;//TU8
- }
- public class ButtonMonitoring
- {
- public static int
- DPAD_Right = 0x17,
- DPAD_Left = 0x16,
- DPAD_Down = 0x15,
- DPAD_Up = 0x14,
- Right_Trigger = 0x13,
- Left_Trigger = 0x12,
- Right_Bumper = 0x06,
- Left_Bumper = 0x05,
- Back_Button = 0x0F,
- Start_Button = 0x0E,
- Left_Stick = 0x10,
- Right_Stick = 0x11,
- A = 0x01,
- B = 0x02,
- X = 0x03,
- Y = 0x04;
- }
- public class TextSpawnging
- {
- public class FPS
- {
- public void EnableFPS(bool enabled, XRPC Tex)
- {
- if (enabled)
- {
- Tex.WriteByte(FPSOffsets.FPS, 0x40);
- }
- else
- {
- Tex.WriteByte(FPSOffsets.FPS, 0x41);
- }
- }
- public void TextPositionX(float X, XRPC Tex)
- {
- Tex.WriteFloat(FPSOffsets.TextPos1, X);
- }
- public void TextPostionY(float Y, XRPC Tex)
- {
- Tex.WriteFloat(FPSOffsets.TextPos2, Y);
- }
- public void ClearFPSText(XRPC Tex)
- {
- Tex.SetMemory(FPSOffsets.Text, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
- }
- public void SpawnFPSText(string str, XRPC Tex)
- {
- Tex.SetMemory(FPSOffsets.Text, Encoding.ASCII.GetBytes(str));
- }
- }
- public class HudElems
- {
- }
- }
- public class Position
- {
- //public XRPC Pos = new XRPC();
- public float x;
- public float y;
- public float z;
- public uint PlayerState(int clientNum)
- {
- return (uint)(0x8328F100 + (clientNum * 0x3600));
- }
- public void GetOrigin(int client, XRPC Pos)
- {
- x = Pos.ReadFloat(PlayerState(client) + 0x1C);
- y = Pos.ReadFloat(PlayerState(client) + 0x20);
- z = Pos.ReadFloat(PlayerState(client) + 0x24);
- }
- public void SetOrigin(int client, float Ypos, float Xpos, float Zpos, XRPC Pos)
- {
- Pos.WriteFloat(PlayerState(client) + 0x1C, Xpos);
- Pos.WriteFloat(PlayerState(client) + 0x20, Ypos);
- Pos.WriteFloat(PlayerState(client) + 0x24, Zpos);
- }
- public void TeleportTo(int client, XRPC Console)
- {
- for (int i = 0; i < 18; i++)
- {
- GetOrigin(client, Console);
- SetOrigin(i, x, y, z, Console);
- }
- }
- }
- public class GameFunctions
- {
- //public XRPC GF = new XRPC();
- public void SV_GameSendServerCommand(int client, int t, string command, XRPC GF)
- {
- GF.Call(Tu8Offsets.SV_GameSendServerCommand, new object[] { client, t, command });
- }
- public void CommandBuffer_AddText(int client, string command, XRPC GF)
- {
- if (client == -1)
- for (int i = 0; i < 4; i++)
- {
- GF.Call(Tu8Offsets.CBuf, new object[] { i, command });
- }
- else
- {
- GF.Call(Tu8Offsets.CBuf, new object[] { client, command });
- }
- }
- }
- public class SV_GameSendSeverCommand_Examples
- {
- public void KillfeedText(int client, string text, XRPC Console)
- {
- new GameFunctions().SV_GameSendServerCommand(client, 0, "e\"" + text + "\"", Console);
- }
- public void CenteredText(int client, string text, XRPC Console)
- {
- new GameFunctions().SV_GameSendServerCommand(client, 0, "f\"" + text + "\"", Console);
- }
- public void SetVision(int client, string vision, XRPC Console)
- {
- new GameFunctions().SV_GameSendServerCommand(client, 0, "J \"" + vision + "\"", Console);
- }
- public void KickClient(int client, string message, XRPC Console)
- {
- new GameFunctions().SV_GameSendServerCommand(client, 0, "r \"" + message + "\"", Console);
- }
- }
- public class CBuf_Examples
- {
- public void SendXp(int client, XRPC Console)
- {
- new GameFunctions().CommandBuffer_AddText(client, "set scr_dom_score_kill \"251600\"", Console);
- new GameFunctions().CommandBuffer_AddText(client, "set scr_dom_scorelimit \"50000\"", Console);
- new GameFunctions().CommandBuffer_AddText(client, "set scr_war_score_kill \"251600\"", Console);
- new GameFunctions().CommandBuffer_AddText(client, "set scr_sr_score_kill \"251600\"", Console);
- new GameFunctions().CommandBuffer_AddText(client, "set scr_conf_score_kill \"251600\"", Console);
- }
- public void ForceHost(XRPC Console)
- {
- new GameFunctions().CommandBuffer_AddText(-1, "set party_minplayers \"1\"", Console);
- new GameFunctions().CommandBuffer_AddText(-1, "set hostmigration \"0\"", Console);
- new GameFunctions().CommandBuffer_AddText(-1, "set host \"1\"", Console);
- new GameFunctions().CommandBuffer_AddText(-1, "set migration_timeBetween \"30000\"", Console);
- new GameFunctions().CommandBuffer_AddText(-1, "set migration_msgtimeout \"500\"", Console);
- new GameFunctions().CommandBuffer_AddText(-1, "set badhost_maxHappyPingTime \"400\"", Console );
- }
- public void SetDvar_(int client, string Dvar, XRPC Console)
- {
- new GameFunctions().CommandBuffer_AddText(client, Dvar, Console);
- /* Example :
- * CBuf_Examples(0, "r_znear 99");
- * Dont use "set "
- *
- */
- }
- }
- public class OffXex
- {
- private static XRPC Xex;
- public void JumpHeight(float value)
- {
- Xex.WriteFloat(Tu8Offsets.JumpValue, value);
- }
- public void ChromePlayer(bool enabled)
- {
- if (enabled)
- {
- Xex.SetMemory(Tu8Offsets.ChromePlayers, new byte[]{ 0x01});
- }
- else
- {
- Xex.SetMemory(Tu8Offsets.ChromePlayers, new byte[] { 0x00 });
- }
- }
- public void NoFallDamage(float value)
- {
- Xex.WriteFloat(Tu8Offsets.FallDamage, value);
- }
- public void AdvancedUAV(bool enabled)
- {
- if (enabled)
- {
- Xex.SetMemory(Tu8Offsets.AdvUAV, new byte[] { 0x01 });
- }
- else
- {
- Xex.SetMemory(Tu8Offsets.AdvUAV, new byte[] { 0x00 });
- }
- }
- public void Laser(bool enabled)
- {
- if (enabled)
- {
- Xex.SetMemory(Tu8Offsets.Laser, new byte[] { 0x01 });
- }
- else
- {
- Xex.SetMemory(Tu8Offsets.Laser, new byte[] { 0x00 });
- }
- }
- public void UnlimitedAmmo(bool enabled)
- {
- if (enabled)
- {
- Xex.SetMemory(Tu8Offsets.Ammo, new byte[] { 0x05 });
- }
- else
- {
- Xex.SetMemory(Tu8Offsets.Ammo, new byte[] { 0x01 });
- }
- }
- public void NoRecoil(bool enabled)
- {
- if (enabled)
- {
- Xex.SetMemory(Tu8Offsets.Recoil, new byte[] { 0x60, 0x00, 0x00, 0x00 });
- }
- else
- {
- Xex.SetMemory(Tu8Offsets.Recoil, new byte[] { 0x41, 0x9A, 0x00, 0x0C });
- }
- }
- public void FullyAutomatic(bool enabled)
- {
- if(enabled)
- {
- Xex.SetMemory(Tu8Offsets.Automatic, new byte[] { 0x41 });
- }
- else
- {
- Xex.SetMemory(Tu8Offsets.Automatic, new byte[] { 0x4B });
- }
- }
- public void RedBox(bool enabled)
- {
- if (enabled)
- {
- Xex.SetMemory(Tu8Offsets.RedBoxes, new byte[] { 0x40 });
- }
- else
- {
- Xex.SetMemory(Tu8Offsets.RedBoxes, new byte[] { 0x41 });
- }
- }
- }
- public class P_State
- {
- private static XRPC Pars;
- public uint getPlayerState(int clientNum)
- {
- return (uint)(0x8328F100 + (clientNum * 0x3600)); // tu8
- }
- public uint client_s(uint Client)
- {
- return (uint)(0x83987680 + 0x207E90) + (Client * 0x6C600);
- }
- public uint gEntity(int clientNum)
- {
- return (uint)(0x83306580 + (clientNum * 0x280)); // tu8
- }
- public uint ButtonPressed(int p)
- {
- return Pars.ReadUInt32(getPlayerState(p) + 0x568C);
- }
- public void GodMode(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteInt32(getPlayerState(client) + 0x18, 0x1);
- }
- else
- {
- Pars.WriteInt32(getPlayerState(client) + 0x18, ~0x1);
- }
- }
- public void Invisible(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.AND_Int32(getPlayerState(client) + 0x124, 0x32);
- }
- else
- {
- Pars.AND_Int32(getPlayerState(client) + 0x124, ~0x32);
- }
- }
- public void setSpread(int Client, uint Spread)
- {
- Pars.WriteUInt32(getPlayerState(Client) + 0x430, Spread);
- Pars.WriteUInt32(getPlayerState(Client) + 0x434, 2);
- }
- public void ThirdPerson(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x10, 0x2);
- }
- else
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x10, 0x0);
- }
- }
- public void Laser(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x124, 0x10000);
- }
- else
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x124, 0x00);
- }
- }
- public void Freeze(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x321C, 0x04);
- }
- else
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x321C, 0x00);
- }
- }
- public void UFOMode(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x321C, 0x02);
- }
- else
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x321C, 0x00);
- }
- }
- public void NoClipping(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x321C, 0x01);
- }
- else
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x321C, 0x00);
- }
- }
- public void NormalMovement(int client)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x321C, 0x00);
- }
- public void MovePreGame(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x01, 0x00);
- }
- else
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x01, 0x01);
- }
- }
- public void SetSpeed(int client, float value)
- {
- Pars.WriteFloat(getPlayerState(client) + 0x2F50, value);
- }
- public void GiveWeapon(int client, string wName)
- {
- int wIndex = (int)Pars.Call(Tu8Offsets.G_GivePlayerWeapon, new object[] { wName });
- Pars.Call(Tu8Offsets.G_GivePlayerWeapon, getPlayerState(client), wIndex, 0, 0);
- }
- public void RedBoxesThermal(int client, bool enabled)
- {
- Pars.SetMemory(getPlayerState(client) + 0x13, new byte[] { 0x18 });
- }
- public void ThermalVision(int client, bool enabled)
- {
- if (enabled)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x10, 0x08);
- }
- else
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x10, 0x00);
- }
- }
- public void TakeAllWeapons(int client)
- {
- Pars.WriteUInt32(getPlayerState(client) + 0x41C, 0);
- for (int i = 0; i < 0xF; i++)
- Pars.WriteUInt32((uint)(getPlayerState(client) + 0x2E4 + (0x4 * i)), 0);
- }
- public void BindExample(int client)
- {
- for (int i = 0; i <= 0x11; i++)
- {
- if (ButtonPressed(i) == ButtonMonitoring.Right_Trigger)
- {
- /*Mod goes Here*/
- }
- }
- }
- public string GetGamertag(int Client)
- {
- if (Pars.ReadByte(getPlayerState(Client) + 0x2F9C) != 0)
- return Pars.ReadString(getPlayerState(Client) + 0x2F9C, new byte[] {0x32});
- return "";
- }
- public void SetClantag(int client, string str)
- {
- Pars.WriteString(getPlayerState(client) + 0x300C, str + "\0");
- }
- public void SetGamertag(int Client, string Gamertag)
- {
- Pars.WriteString(getPlayerState(Client) + 0x2F9C, Gamertag + "\0");
- }
- }
- public class SetStats
- {
- private static XRPC St;
- public uint non;
- public void Prestige(int Value)
- {
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Prestige, Value, false);
- }
- public void Deaths(int Value)
- {
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Deaths, Value, false);
- }
- public void Suicides(int Value)
- {
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Suicides, Value, false);
- }
- public void Kills(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Kills, Value, false);
- }
- public void HighestKillStreak(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.KillStreaks, Value, false);
- }
- public void GamesPlayed(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.GamePlayed, Value, false);
- }
- public void GamesLost(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Losses, Value, false);
- }
- public void GamesWon(int Value)
- {
- // byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Wins, Value, false);
- }
- public void RankXP(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.RankXP, Value, false);
- }
- public void OveralScore(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Score, Value, false);
- }
- public void TimePlayed(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.TimePlayed, Value, false);
- }
- public void ShotHits(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Hits, Value, false);
- }
- public void ShotMisses(int Value)
- {
- // byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.Misses, Value, false);
- }
- public void SquadPoints(int Value)
- {
- // byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.SquadPoints, Value, false);
- }
- public void SquadRank(int Value)
- {
- //byte[] data = BitConverter.GetBytes((uint)Value);
- St.xbCon.DebugTarget.WriteInt32(Tu8Stats.Entry + Tu8Stats.PerSquadPlayer, Value, false);
- }
- public void UnlockAll()
- {
- byte[] buffer = new byte[2] { 4, 4 };
- uint Offset;
- for (uint Off = 0x4300; Off < 0x4B00; Off += 0x0002)
- {
- Offset = Tu8Stats.Entry + Off;
- St.SetMemory(Offset, buffer);
- }
- for (uint iO = 0x7700; iO < 0x7750; iO += 0x0002)
- {
- Offset = Tu8Stats.Entry + iO;
- St.SetMemory(Offset, buffer);
- }
- }
- public void AllSquadLevel60()
- {
- for (uint c = 0; c < 10; c++)
- {
- St.SetMemory(Tu8Stats.Entry + (c * 0x564) + 0xFE8, new byte[] { 0xFF });
- }
- }
- public void AllPerks()
- {
- for (uint h = 0; h < 10; h++)
- {
- for (uint i = 0; i < 6; i++)
- {
- St.SetMemory(Tu8Stats.Entry + (h * 0x564) + (i * 0x80) + 0xD39, new byte[] { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F });
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment