using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RabirDimensionalBeast
{
unsafe class Weapon
{
private uint Pointer;
public bool RealWeapon;
public Weapon(uint Pointer)
{
RealWeapon = (Pointer != 0);
this.Pointer = Pointer;
}
public string WeaponName
{
get
{
string Name = "";
for (int i = 0; i < 30; i++)
Name += (char)(*(byte*)(Pointer + 0x9 + i));
return Name;
}
}
public float ReloadAnimRatio
{
get { return *(float*)(Pointer + Storage.GetOffset("ReloadAnimRatio")); }
set { *(float*)(Pointer + Storage.GetOffset("ReloadAnimRatio")) = value; }
}
public float ChangeWeaponAnimRatio
{
get { return *(float*)(Pointer + Storage.GetOffset("ChangeWeaponAnimRatio")); }
set { *(float*)(Pointer + Storage.GetOffset("ChangeWeaponAnimRatio")) = value; }
}
public int LeftClickAttributes
{
get { return *(int*)(Pointer + Storage.GetOffset("LeftClickAttributes")); }
set { *(int*)(Pointer + Storage.GetOffset("LeftClickAttributes")) = value; }
}
public int RightClickAttributes
{
get { return *(int*)(Pointer + Storage.GetOffset("RightClickAttributes")); }
set { *(int*)(Pointer + Storage.GetOffset("RightClickAttributes")) = value; }
}
public int ZoomAttributes
{
get { return *(int*)(Pointer + Storage.GetOffset("ZoomAttributes")); }
set { *(int*)(Pointer + Storage.GetOffset("ZoomAttributes")) = value; }
}
public float[] ZoomAction
{
get
{
//"ZoomAction"
float[] Array = new float[13];
for (int i = 0; i < 13; i++)
{
if (i == 10)
Array[i] = (float)*(int*)(Pointer + Storage.GetOffset("ZoomAction") + (4 * i));
else
Array[i] = *(float*)(Pointer + Storage.GetOffset("ZoomAction") + (4 * i));
}
return Array;
}
set
{
for (int i = 0; i < 13; i++)
if (i == 10)
*(int*)(Pointer + Storage.GetOffset("ZoomAction") + (4 * i)) = (int)value[i];
else *(float*)(Pointer + Storage.GetOffset("ZoomAction") + (4 * i)) = value[i];
}
}
public float Range
{
get { return *(float*)(Pointer + Storage.GetOffset("Range")); }
set { *(float*)(Pointer + Storage.GetOffset("Range")) = value; }
}
public float AiModeRange
{
get { return *(float*)(Pointer + Storage.GetOffset("AiModeRange")); }
set { *(float*)(Pointer + Storage.GetOffset("AiModeRange")) = value; }
}
public float AmmoDamage
{
get { return *(float*)(Pointer + Storage.GetOffset("AmmoDamage")); }
set { *(float*)(Pointer + Storage.GetOffset("AmmoDamage")) = value; }
}
public float DamageVariantionFactor
{
get { return *(float*)(Pointer + Storage.GetOffset("DamageVariantionFactor")); }
set { *(float*)(Pointer + Storage.GetOffset("DamageVariantionFactor")) = value; }
}
}
//###################################################################################################################
unsafe class BasicPlayerInfo
{
private uint Pointer;
public BasicPlayerInfo(uint Pointer)
{
this.Pointer = Pointer;
}
public float C4DefuseTime
{
get { return *(float*)(Pointer + Storage.GetOffset("C4DefuseTime")); }
set { *(float*)(Pointer + Storage.GetOffset("C4DefuseTime")) = value; }
}
public float CharacterHiddenWalkAlpha
{
get { return *(float*)(Pointer + Storage.GetOffset("CharacterHiddenWalkAlpha")); }
set { *(float*)(Pointer + Storage.GetOffset("CharacterHiddenWalkAlpha")) = value; }
}
public float CharacterRunAlpha
{
get { return *(float*)(Pointer + Storage.GetOffset("CharacterRunAlpha")); }
set { *(float*)(Pointer + Storage.GetOffset("CharacterRunAlpha")) = value; }
}
public float MovementWalkRate
{
get { return *(float*)(Pointer + Storage.GetOffset("MovementWalkRate")); }
set { *(float*)(Pointer + Storage.GetOffset("MovementWalkRate")) = value; }
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RabirDimensionalBeast
{
class Console
{
public static bool UpDated = false;
public static string ConsoleBuffer = "";
public static void WriteLine(string Text)
{
ConsoleBuffer += Text + "\r\n";
UpDated = true;
}
public static void WriteLine()
{
ConsoleBuffer += "\r\n";
UpDated = true;
}
public static void Write(string Text)
{
ConsoleBuffer += Text ;
UpDated = true;
}
public static void Write(char Chr)
{
ConsoleBuffer += Chr;
UpDated = true;
}
public static void Clear()
{
ConsoleBuffer = "";
UpDated = true;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace RabirDimensionalBeast
{
class CShellFunctions
{
// Function delegate..
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void _PushToConsole([MarshalAs(UnmanagedType.LPStr)] string Text);
//**************************************************
public static unsafe void PushToConsole(uint CShell, uint PTCPointer, int PTCOffset, string Command)
{
uint LTClient = *(uint*)((CShell + PTCPointer));
uint PTCAddy = *(uint*)(LTClient + PTCOffset);
var PTC = (_PushToConsole)Marshal.GetDelegateForFunctionPointer(new IntPtr(PTCAddy), typeof(_PushToConsole));
PTC(Command);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace RabirDimensionalBeast
{
class PatternScanner
{
private static unsafe uint FindPattern(int StartAddress, int Length, string bMask, string szMask)
{
byte[] ByteMask = new byte[szMask.Length];
//Creating Byte Array
int State = 0;
for (int i = 0; i < bMask.Length; i++)
{
if (bMask[i] == 'x')
{
ByteMask[State] = byte.Parse(bMask.Substring(i + 1, 2), System.Globalization.NumberStyles.HexNumber);
State++;
}
}
//Searching Byte Pattern
for (int i = 0; i < Length; i++)
{
bool Found = true;
for (int j = 0; j < ByteMask.Length; j++)
{
Found = Found && ((ByteMask[j] == *(byte*)(StartAddress + i + j)) || szMask[j] == '?');
}
if (Found) return (uint)(StartAddress + i); //Found it
}
return 0; //Didn't found it
}
public static unsafe int[] SequentedOffsetScanner(int StartAddress, int Length, string bMask, string szMask, int OffsetPos)
{
List<int> FoundOffsets = new List<int>();
//Creating Byte Array
byte[] ByteMask = new byte[szMask.Length];
int State = 0;
for (int i = 0; i < bMask.Length; i++)
{
if (bMask[i] == 'x')
{
ByteMask[State] = byte.Parse(bMask.Substring(i + 1, 2), System.Globalization.NumberStyles.HexNumber);
State++;
}
}
//Searching Byte Pattern
for (int i = 0; i < Length; i++)
{
bool Found = true;
for (int j = 0; j < ByteMask.Length; j++)
{
Found = Found && ((ByteMask[j] == *(byte*)(StartAddress + i + j)) || szMask[j] == '?');
}
if (Found)
{
if (!FoundOffsets.Contains(*(int*)(StartAddress + i + OffsetPos)))
FoundOffsets.Add(*(int*)(StartAddress + i + OffsetPos));
}
}
return FoundOffsets.ToArray();
}
public static unsafe int[] SequentedByteOffsetScanner(int StartAddress, int Length, string bMask, string szMask, int OffsetPos)
{
List<int> FoundOffsets = new List<int>();
//Creating Byte Array
byte[] ByteMask = new byte[szMask.Length];
int State = 0;
for (int i = 0; i < bMask.Length; i++)
{
if (bMask[i] == 'x')
{
ByteMask[State] = byte.Parse(bMask.Substring(i + 1, 2), System.Globalization.NumberStyles.HexNumber);
State++;
}
}
//Searching Byte Pattern
for (int i = 0; i < Length; i++)
{
bool Found = true;
for (int j = 0; j < ByteMask.Length; j++)
{
Found = Found && ((ByteMask[j] == *(byte*)(StartAddress + i + j)) || szMask[j] == '?');
}
if (Found)
{
if (!FoundOffsets.Contains((int)(*(byte*)(StartAddress + i + OffsetPos))))
FoundOffsets.Add((int)(*(byte*)(StartAddress + i + OffsetPos)));
}
}
return FoundOffsets.ToArray();
}
//######################### Find Addys #####################
//******************Pointers
public static unsafe uint FindWeaponMgr(uint CShell)
{
uint WeaponMgr = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x4F\x04\xA1\x00\x00\x00\x00\x85\xC0\x8B\x51\x04\x8B\x6A\x04", "xxxx????xxxxxxxx");
WeaponMgr = (*(uint*)(WeaponMgr + 4)) - CShell;
return WeaponMgr;
}
public static unsafe uint FindCShellPointer(uint CShell)
{
uint CShell_Pointer = FindPattern((int)CShell, 0xFFFFFF, @"\xc6\x01\x01\x8b\x15\x00\x00\x00\x00\x8b\x82\x00\x00\x00\x00\x8B", "xxxxx????xx????x");
CShell_Pointer = (*(uint*)(CShell_Pointer + 5)) - CShell;
return CShell_Pointer;
}
public static unsafe uint FindBasicPlayerInfo(uint CShell)
{
uint BasicPlayerInfo = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\xD8\x52\xF6\x10\x83\xC4\x04\x69\xC0\xA8\x00\x00\x00\xD9\x9C\x08\x88\x00\x00\x00\x8B\x4C\x24\x30\x3B\xCB", "xx????xxxxx????xxx????xxx?xx");
BasicPlayerInfo = (*(uint*)(BasicPlayerInfo + 2)) - CShell;
return BasicPlayerInfo;
}
public static unsafe uint FindPushToConsole(uint CShell)
{
uint PTC = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\x44\xA2\x59\x10\x8B\x91\x04\x02\x00\x00\x68\xB8\x55\x4C\x10\xFF\xD2\x83\xC4\x04\x53\xE8\x46\xF3\xFD\xFF\x8B\xC8\xE8\xBF\x5F\x2F\x00", "xx????xx????x????xxxxxxx????xxx????");
PTC = (*(uint*)(PTC + 2)) - CShell;
return PTC;
}
public static unsafe uint FindBypass(uint CShell)
{
uint ByPass = FindPattern((int)CShell, 0xFFFFFF, @"\xE8\xF6\x06\xE9\xFF\x8B\xF0\x83\xC4\x04\x85\xF6\x0F\x84\xE2\x01\x00\x00\xD9\x86\x3C\x0C\x00\x00\x0F\xB6\x86\x6C\x08\x00\x00\xD9\x5C\x24\x08\x89\x44\x24\x04\xD9\x86\x40\x0C\x00\x00\x57", "x????xxxx?xxxx????xx????xxx????xxx?xxx?xx????x");
return ByPass - CShell;
}
public static unsafe uint FindSecondBypass(uint CShell)
{
uint ByPass = FindPattern((int)CShell, 0xFFFFFF, @"\x66\x8B\x54\x24\x04\x33\xC0\x66\x85\xD2\x7C\x26\x56\x8B\x35\x50\xAA\xFD\x10", "xxxx?xxxxxx?xxx????");
return ByPass - CShell;
}
public static unsafe uint FindWallHack(uint CShell)
{
uint WallHack = FindPattern((int)Main.GetModuleHandle("crossfire.exe"), 0x2D7000, @"\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x06\x8B\x50\x18", "x????x????xxxxx");
WallHack = *(uint*)(WallHack + 1);
WallHack += 0xA4;
return WallHack;
}
public static unsafe uint FindMemorySeeGhost(uint CShell)
{
uint WallHack = FindPattern((int)Main.GetModuleHandle("crossfire.exe"), 0x2D7000, @"\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x06\x8B\x50\x18", "x????x????xxxxx");
WallHack = *(uint*)(WallHack + 1);
WallHack += 0xB8;
return WallHack;
}
public static unsafe uint FindDamageZone(uint CShell)
{
uint DamageZoneMgr = FindPattern((int)CShell, 0xFFFFFF, "\x68\x00\x00\x00\x00\x8D\x4C\x24\x24\x51\x8D\x54\x24\x34", "x????xxxxxxxxx");
DamageZoneMgr = *(uint*)(DamageZoneMgr + 0x01);
return DamageZoneMgr;
}
//*****************Offsets
public static unsafe void BetaOffsetSearch(uint CShell)
{
int[] Offsets = SequentedByteOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x5C\x24\x24\x8B\x0D\xD4\x52\xF6\x10\xD9\x44\x24\x24\x8B\x15\xD8\x52\xF6\x10\x83\xC4\x04\x69\xC9\xA8\x00\x00\x00\xD9\x5C\x11\x08", "xxx?xx????xxx?xx????xx?xx????xxx?", 32);
for (int i = 0; i < Offsets.Length; i++)
Console.WriteLine("Found Offset(C4DefuTimePattern): 0x" + Storage.DecToHex(Offsets[i]));
}
//WeaponMgr
public static unsafe uint FindReloadAnimRatio(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x0D\xA4\xC5\xFC\x10\x53\x8D\x3C\xB1\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x07\xD9\x98\x3C\x0C\x00\x00\x83\xC4\x04", "xx????xxxxxx????xxx?xxx?xxxx????xx?", 28);
return (uint)Offsets[1];
}
public static unsafe uint FindChangeWeaponAnimRatio(uint CShell)
{
uint Value = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\xA4\xC5\xFC\x10\x53\x8D\x3C\xB1\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\x8B\x17\xD9\x44\x24\x14\x8B\x3D\xE0\xC4\x4D\x10\xD9\x9A\x40\x0C\x00\x00\x83\xC4\x04", "xx????xxxxxx????xxx?xxxxx?xx????xx????xx?");
return (*(uint*)(Value + 34));
}
public static unsafe uint FindLeftClickAttributes(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x2B\xC1\xC1\xF8\x02\x3B\xF0\x72\x0C\xFF\x15\xE0\xC4\x4D\x10\x8B\x0D\xA4\xC5\xFC\x10\x8B\x04\xB1\x83\x88\xEC\x0A\x00\x00\x01", "xxxx?xxxxxx????xx????xxxxx?????", 26);
return (uint)Offsets[0];
}
public static unsafe uint FindRightClickAttributes(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x2B\xC1\xC1\xF8\x02\x3B\xF0\x72\x0C\xFF\x15\xE0\xC4\x4D\x10\x8B\x0D\xA4\xC5\xFC\x10\x8B\x04\xB1\x83\x88\xEC\x0A\x00\x00\x01", "xxxx?xxxxxx????xx????xxxxx?????", 26);
return (uint)Offsets[1];
}
public static unsafe uint FindZoomAttributes(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x2B\xC1\xC1\xF8\x02\x3B\xF0\x72\x0C\xFF\x15\xE0\xC4\x4D\x10\x8B\x0D\xA4\xC5\xFC\x10\x8B\x04\xB1\x83\x88\xEC\x0A\x00\x00\x01", "xxxx?xxxxxx????xx????xxxxx?????", 26);
return (uint)Offsets[2];
}
public static unsafe uint FindZoomAction(uint CShell)
{
uint Value = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\xA4\xC5\xFC\x10\x55\x8D\x1C\xB1\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x0B\xD9\x9C\xB9\x20\x39\x00\x00", "xx????xxxxxx????xxx?xxx?xxxxx????");
return (*(uint*)(Value + 29));
}
public static unsafe uint FindRange(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x44\x24\x14\x8B\x06\xDC\x0D\x50\xFC\x54\x10\x83\xC4\x04\xD9\x5C\x24\x10\xD9\x44\x24\x10\xD9\x98\x0C\x08\x00\x00", "xxx?xxxx????xx?xxx?xxx?xx????", 25);
return (uint)Offsets[0];
}
public static unsafe uint FindAiModeRange(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x44\x24\x14\x8B\x06\xDC\x0D\x50\xFC\x54\x10\x83\xC4\x04\xD9\x5C\x24\x10\xD9\x44\x24\x10\xD9\x98\x0C\x08\x00\x00", "xxx?xxxx????xx?xxx?xxx?xx????", 25);
return (uint)Offsets[1];
}
public static unsafe uint FindDamageVariantionFactor(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8D\x34\xA9\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x16\xD9\x9A\x38\x08\x00\x00", "xxxxx????xxx?xxx?xxxx????", 21);
return (uint)Offsets[2];
}
public static unsafe uint FindAmmoDamage(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8D\x34\xA9\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x06\xD9\x98\x1C\x08\x00\x00", "xxxxx????xxx?xxx?xxxx????", 21);
return (uint)Offsets[0];
}
//BasicPlayerInfo
public static unsafe uint FindC4DefuseTime(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x15\xD4\x52\xF6\x10\xD9\x44\x24\x24\xA1\xD8\x52\xF6\x10\x83\xC4\x04\x69\xD2\xA8\x00\x00\x00\xD9\x9C\x02\x80\x00\x00\x00", "xx????xxx?x????xx?xx????xxx????", 27);
return (uint)Offsets[0];
}
public static unsafe uint FindCharacterHiddenWalkAlpha(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x15\xD4\x52\xF6\x10\xD9\x44\x24\x24\xA1\xD8\x52\xF6\x10\x83\xC4\x04\x69\xD2\xA8\x00\x00\x00\xD9\x9C\x02\x80\x00\x00\x00", "xx????xxx?x????xx?xx????xxx????", 27);
return (uint)Offsets[1];
}
public static unsafe uint FindCharacterHiddenRunAlpha(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x15\xD4\x52\xF6\x10\xD9\x44\x24\x24\xA1\xD8\x52\xF6\x10\x83\xC4\x04\x69\xD2\xA8\x00\x00\x00\xD9\x9C\x02\x80\x00\x00\x00", "xx????xxx?x????xx?xx????xxx????", 27);
return (uint)Offsets[1] + 4;
}
public static unsafe uint FindMovementWalkRate(uint CShell)
{
int[] Offsets = SequentedByteOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x5C\x24\x24\x8B\x0D\xD4\x52\xF6\x10\xD9\x44\x24\x24\x8B\x15\xD8\x52\xF6\x10\x83\xC4\x04\x69\xC9\xA8\x00\x00\x00\xD9\x5C\x11\x08", "xxx?xx????xxx?xx????xx?xx????xxx?", 32);
return (uint)Offsets[0];
}
//PTC
public static unsafe uint FindPushToConsoleOffset(uint CShell)
{
uint PTC = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\x44\xA2\x59\x10\x8B\x91\x04\x02\x00\x00\x68\xB8\x55\x4C\x10\xFF\xD2\x83\xC4\x04\x53\xE8\x46\xF3\xFD\xFF\x8B\xC8\xE8\xBF\x5F\x2F\x00", "xx????xx????x????xxxxxxx????xxx????");
PTC = (*(uint*)(PTC + 8));
return PTC;
}
//###################################################################################################
public static void LogAddresses(uint CShell)
{
//*******************************Define Offsets
//WeaponMgr
Console.WriteLine("Start Searching For Offsets");
Console.WriteLine(">>>>WeaponMgr<<<<");
Storage.SetOffset((int)FindReloadAnimRatio(CShell), "ReloadAnimRatio"); //float
Storage.SetOffset((int)FindChangeWeaponAnimRatio(CShell), "ChangeWeaponAnimRatio"); //float
Storage.SetOffset((int)FindLeftClickAttributes(CShell), "LeftClickAttributes"); //int
Storage.SetOffset((int)FindRightClickAttributes(CShell), "RightClickAttributes"); //int
Storage.SetOffset((int)FindZoomAttributes(CShell), "ZoomAttributes"); //int
Storage.SetOffset((int)FindZoomAction(CShell), "ZoomAction"); //float[13] Index[10] = Int
/*
Storage.SetOffset(0x3B20, "ThrowVelocity"); //float
Storage.SetOffset(0x3B24, "ThrowAngle"); //float
Storage.SetOffset(0x3B28, "ThrowAirRes"); //float
Storage.SetOffset(0x3B2C, "ThrowTime"); //float (Grenade Delay)
*/
Storage.SetOffset((int)PatternScanner.FindRange(CShell), "Range"); //float
Storage.SetOffset((int)PatternScanner.FindAiModeRange(CShell), "AiModeRange"); //float
Storage.SetOffset((int)PatternScanner.FindAmmoDamage(CShell), "AmmoDamage"); //float
Storage.SetOffset(0x820, "AiModeAmmoDamage"); //float
Storage.SetOffset((int)PatternScanner.FindDamageVariantionFactor(CShell), "DamageVariantionFactor"); //float
/*
Storage.SetOffset(0xA5C, "KnifeNormalRange"); //float[3]
Storage.SetOffset(0xA80, "KnifeBigshotRange"); //float[3]
Storage.SetOffset(0xA9C, "KnifeNormalRange2"); //float[3]
Storage.SetOffset(0xAC0, "KnifeBigshotRange2"); //float[3]
Storage.SetOffset(0xA70, "KnifeNormalAniRate"); //float[3]
Storage.SetOffset(0xA98, "KnifeBigshotAniRate"); //float[3]
Storage.SetOffset(0xAB8, "KnifeNormalAniRate2"); //float[3]
Storage.SetOffset(0xADC, "KnifeBigshotAniRate2"); //float[3]
Storage.SetOffset(0xA68, "KnifeNormalAngle"); //float[3]
Storage.SetOffset(0xA8C, "KnifeBigshotAngle"); //float[3]
Storage.SetOffset(0xAA8, "KnifeNormalAngle2"); //float[3]
Storage.SetOffset(0xACC, "KnifeBigshotAngle2"); //float[3]
*/
/*
Storage.SetOffset(0xC04, "KnifeNormalAmmoDamage"); //float[3]
Storage.SetOffset(0xC10, "KnifeBigshotAmmoDamage"); //float[3]
Storage.SetOffset(0xC1C, "KnifeNormalAmmoDamage2"); //float[3]
Storage.SetOffset(0xC28, "KnifeBigshotAmmoDamage2"); //float[3]
*/
/*
Storage.SetOffset(0x352C, "BulletPosOffset"); //float[4]
Storage.SetOffset(0x353C, "ShotReactYaw"); //float[9]
Storage.SetOffset(0x370C, "ShotReactPitch"); //float[9]
Storage.SetOffset(0x11CC, "DatailReactYawShot"); //float[9]
Storage.SetOffset(0x1064, "DatailReactPitchShot"); //float[9]
Storage.SetOffset(0xEFC, "DetailPerturbShot"); //float[9]
Storage.SetOffset(0x540, "PerturbMin"); //float[9]
Storage.SetOffset(0x6A8, "PerturbMax"); //float[9]
*/
Console.WriteLine(">>>>Basic Player Info<<<<");
//BasicPlayerInfo
Storage.SetOffset((int)FindC4DefuseTime(CShell), "C4DefuseTime"); //float
Storage.SetOffset(0x88, "CharacterHiddenAlpha"); //float
Storage.SetOffset((int)FindCharacterHiddenWalkAlpha(CShell), "CharacterHiddenWalkAlpha"); //float
Storage.SetOffset((int)FindCharacterHiddenRunAlpha(CShell), "CharacterRunAlpha"); //float
Storage.SetOffset(0xC, "MovementDuckWalkRate"); //float
Storage.SetOffset((int)FindMovementWalkRate(CShell), "MovementWalkRate"); //float
Storage.SetOffset(0x84, "MaxCanDefuseDistance"); //float
//PlayerPointer
//Storage.SetOffset(0x64C, "FlyOffset"); //float
//PTC
Console.WriteLine(">>>>PushToConsole<<<<");
Storage.SetOffset((int)FindPushToConsoleOffset(CShell), "PTCOffset");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/*
* Rabir Dimensional Beast Storage Class
*/
namespace RabirDimensionalBeast
{
//####################### Data Types #################################
class Pointer
{
public uint Address;
public string Name;
public Pointer(uint Address, string Name)
{
this.Address = Address;
this.Name = Name;
}
}
class Offset
{
public int Addy;
public string Name;
public Offset(int Addy, string Name)
{
this.Addy = Addy;
this.Name = Name;
}
}
class ByteValue
{
public byte Value;
public string Name;
public ByteValue(byte Value, string Name)
{
this.Value = Value;
this.Name = Name;
}
}
class IntValue
{
public int Value;
public string Name;
public IntValue(int Value, string Name)
{
this.Value = Value;
this.Name = Name;
}
}
class FloatValue
{
public float Value;
public string Name;
public FloatValue(float Value, string Name)
{
this.Value = Value;
this.Name = Name;
}
}
//####################### Actual Storage Handling ####################
class Storage
{
//*********************** OTher
public static float[] DamageVariantFactor = new float[999];
//*********************** Pointers & Offsets & Values
private static List<Pointer> PointerList = new List<Pointer>();
private static List<Offset> OffsetList = new List<Offset>();
private static List<ByteValue> ByteValueList = new List<ByteValue>();
private static List<IntValue> IntValueList = new List<IntValue>();
private static List<FloatValue> FloatValueList = new List<FloatValue>();
//***************************************************************** Pointers
public static void SetPointer(uint Address, string Name)
{
foreach (Pointer Ptr in PointerList)
{
if (Ptr.Name.ToUpper() == Name.ToUpper())
{
Ptr.Address = Address;
Console.WriteLine("Pointer updated \"" + Ptr.Name + "\" = [0x" + Storage.DecToHex((int)Ptr.Address).ToString() + "]");
return;
}
}
PointerList.Add(new Pointer(Address, Name));
Console.WriteLine("Pointer created \"" + Name + "\" = [0x" + Storage.DecToHex((int)Address).ToString() + "]");
}
public static uint GetPointer(string Name)
{
foreach (Pointer Ptr in PointerList)
{
if (Ptr.Name.ToUpper() == Name.ToUpper())
{
return Ptr.Address;
}
}
return 0;
}
//******************************************************************* Offsets
public static void SetOffset(int Addy, string Name)
{
foreach (Offset Off in OffsetList)
{
if (Off.Name.ToUpper() == Name.ToUpper())
{
Off.Addy = Addy;
Console.WriteLine("Offset updated \"" + Off.Name + "\" = [0x" + Storage.DecToHex(Off.Addy).ToString() + "]");
return;
}
}
OffsetList.Add(new Offset(Addy, Name));
Console.WriteLine("Offset created \"" + Name + "\" = [0x" + Storage.DecToHex(Addy).ToString() + "]");
}
public static int GetOffset(string Name)
{
foreach (Offset Off in OffsetList)
{
if (Off.Name.ToUpper() == Name.ToUpper())
{
return Off.Addy;
}
}
return 0;
}
//********************************************************************* Values
//Byte
public static void SetByteValue(byte Value, string Name)
{
foreach (ByteValue Val in ByteValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
Val.Value = Value;
Console.WriteLine("Byte value updated \"" + Val.Name + "\" = [" + Val.Value.ToString() + "]");
return;
}
}
ByteValueList.Add(new ByteValue(Value, Name));
Console.WriteLine("Byte value created \"" + Name + "\" = [" + Value.ToString() + "]");
}
public static byte GetByteValue(string Name)
{
foreach (ByteValue Val in ByteValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
return Val.Value;
}
}
return 0;
}
//Int
public static void SetIntValue(int Value, string Name)
{
foreach (IntValue Val in IntValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
Val.Value = Value;
Console.WriteLine("Int value updated \"" + Val.Name + "\" = [" + Val.Value.ToString() + "]");
return;
}
}
IntValueList.Add(new IntValue(Value, Name));
Console.WriteLine("Int value created \"" + Name + "\" = [" + Value.ToString() + "]");
}
public static int GetIntValue(string Name)
{
foreach (IntValue Val in IntValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
return Val.Value;
}
}
return 0;
}
//Float
public static void SetFloatValue(float Value, string Name)
{
foreach (FloatValue Val in FloatValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
Val.Value = Value;
Console.WriteLine("Float value updated \"" + Val.Name + "\" = [" + Val.Value.ToString() + "]");
return;
}
}
FloatValueList.Add(new FloatValue(Value, Name));
Console.WriteLine("Float value created \"" + Name + "\" = [" + Value.ToString() + "]");
}
public static float GetFloatValue(string Name)
{
foreach (FloatValue Val in FloatValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
return Val.Value;
}
}
return 0;
}
//############################# Other Tools ###################
public static string DecToHex(int Dec)
{
return Dec.ToString("X");
}
//############################# Weapon Handling ###############
public enum WeaponType
{
Rifle,
Pistol,
Grenade,
Meele,
Sniper,
Shotgun,
SMG,
MG,
Smoke,
Flash,
Hypomed,
UnKnown
}
public static WeaponType GetWeaponType(int i)
{
if (i == 6 || i == 126 || i == 200 || i == 209 || i == 210 || i == 240 || i == 313 || i == 338 || i == 357 || i == 416 || i == 423 || i == 438 || i == 473 || i == 481 || i == 519 || i == 654 || i == 696 || i == 720 || i == 729)
return WeaponType.Grenade;
if (i == 5 || i == 35 || i == 74 || i == 120 || i == 132 || i == 176 || i == 177 || i == 178 || i == 182 || i == 195 || i == 196 || i == 197 || i == 198 || i == 199 || i == 223 || i == 224 || i == 225 || i == 226 || i == 227 || i == 228 || i == 244 || i == 302 || i == 303 || i == 304 || i == 305 || i == 306 || i == 307 || i == 318 || i == 345 || i == 346 || i == 376 || i == 404 || i == 405 || i == 406 || i == 407 || i == 408 || i == 409 || i == 437 || i == 455 || i == 456 || i == 457 || i == 517 || i == 518 || i == 548 || i == 576 || i == 541 || i == 587 || i == 693 || i == 718 || i == 719 || i == 728)
return WeaponType.Meele;
if (i == 714 || i == 14 || i == 15 || i == 16 || i == 23 || i == 43 || i == 46 || i == 91 || i == 110 || i == 111 || i == 122 || i == 136 || i == 150 || i == 152 || i == 163 || i == 185 || i == 186 || i == 194 || i == 232 || i == 249 || i == 268 || i == 279 || i == 294 || i == 323 || i == 368 || i == 378 || i == 500 || i == 513 || i == 525 || i == 554 || i == 602 || i == 632 || i == 657 || i == 714 || i == 724)
return WeaponType.Sniper;
if (i == 1 || i == 4 || i == 18 || i == 19 || i == 20 || i == 26 || i == 33 || i == 37 || i == 44 || i == 60 || i == 75 || i == 78 || i == 92 || i == 105 || i == 115 || i == 116 || i == 153 || i == 155 || i == 156 || i == 217 || i == 235 || i == 241 || i == 247 || i == 328 || i == 348 || i == 350 || i == 370 || i == 371 || i == 439 || i == 470 || i == 497 || i == 515 || i == 516 || i == 528 || i == 589 || i == 600 || i == 644 || i == 670 || i == 694 || i == 716 || i == 717 || i == 725)
return WeaponType.Pistol;
if (i == 8 || i == 64 || i == 65 || i == 384 || i == 521 || i == 722)
return WeaponType.Smoke;
if (i == 7 || i == 383 || i == 520 || i == 721)
return WeaponType.Flash;
if (i == 0 || i == 36 || i == 68 || i == 171 || i == 243 || i == 286 || i == 329 || i == 331 || i == 336 || i == 342 || i == 369 || i == 388 || i == 432 || i == 498 || i == 514 || i == 555 || i == 590 || i == 641 || i == 663 || i == 689 || i == 715)
return WeaponType.Shotgun;
if (i == 2 || i == 3 || i == 10 || i == 21 || i == 28 || i == 32 || i == 39 || i == 55 || i == 67 || i == 112 || i == 128 || i == 145 || i == 147 || i == 148 || i == 149 || i == 157 || i == 183 || i == 211 || i == 213 || i == 216 || i == 229 || i == 245 || i == 276 || i == 293 || i == 362 || i == 363 || i == 422 || i == 463 || i == 476 || i == 487 || i == 507 || i == 508 || i == 527 || i == 529 || i == 550 || i == 604 || i == 614 || i == 651 || i == 680 || i == 711)
return WeaponType.SMG;
if (i == 716 || i == 715 || i == 713 || i == 712 || i == 711 || i == 11 || i == 12 || i == 13 || i == 22 || i == 24 || i == 25 || i == 27 || i == 29 || i == 30 || i == 31 || i == 34 || i == 38 || i == 40 || i == 41 || i == 42 || i == 45 || i == 47 || i == 49 || i == 50 || i == 56 || i == 72 || i == 73 || i == 76 || i == 77 || i == 85 || i == 87 || i == 90 || i == 94 || i == 95 || i == 96 || i == 97 || i == 98 || i == 103 || i == 104 || i == 106 || i == 113 || i == 121 || i == 127 || i == 133 || i == 140 || i == 141 || i == 160 || i == 161 || i == 164 || i == 167 || i == 174 || i == 175 || i == 179 || i == 187 || i == 190 || i == 201 || i == 203 || i == 206 || i == 208 || i == 212 || i == 222 || i == 230 || i == 233 || i == 234 || i == 236 || i == 237 || i == 291 || i == 333 || i == 340 || i == 349 || i == 351 || i == 364 || i == 365 || i == 366 || i == 367 || i == 374 || i == 377 || i == 390 || i == 391 || i == 403 || i == 415 || i == 418 || i == 421 || i == 429 || i == 431 || i == 436 || i == 440 || i == 471 || i == 479 || i == 484 || i == 486 || i == 499 || i == 502 || i == 509 || i == 510 || i == 511 || i == 512 || i == 526 || i == 532 || i == 536 || i == 538 || i == 539 || i == 542 || i == 559 || i == 573 || i == 591 || i == 597 || i == 598 || i == 619 || i == 630 || i == 636 || i == 676 || i == 678 || i == 679 || i == 691 || i == 712 || i == 713 || i == 723 || i == 726 || i == 727)
return WeaponType.Rifle;
if (i == 710 || i == 17 || i == 61 || i == 124 || i == 158 || i == 159 || i == 166 || i == 188 || i == 257 || i == 300 || i == 315 || i == 316 || i == 352 || i == 361 || i == 441 || i == 506 || i == 524 || i == 556 || i == 558 || i == 564 || i == 565 || i == 575 || i == 588 || i == 653 || i == 710)
return WeaponType.MG;
if (i == 328 || i == 348)
return WeaponType.Hypomed;
return WeaponType.UnKnown;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Threading;
namespace RabirDimensionalBeast
{
unsafe class ByPass
{
[DllImport("kernel32.dll")]
static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize, uint flNewProtect, out uint lpflOldProtect);
//ByPass Delegates
[UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Auto, SetLastError = true)]
public delegate uint GetWeaponPointerDelegate(int WeaponIndex);
public static GetWeaponPointerDelegate ByPassDelegate = new GetWeaponPointerDelegate(Bypass);
public static unsafe void CreateBypass(uint CShell, uint WeaponMgr, uint ByPassPointer)
{
Console.WriteLine(">>>>>>>>>>>> 28_3 Sharp Bypass Start <<<<<<<<<<<<<<");
uint Ptr = (uint)Marshal.GetFunctionPointerForDelegate(ByPassDelegate);
Console.WriteLine("Bypass function pointer: 0x" + Storage.DecToHex((int)Ptr));
if (*(byte*)(CShell + ByPassPointer) != 0)
{
MakeCall((byte*)(CShell + ByPassPointer), Ptr, 5);
backup(CShell, WeaponMgr);
}
Console.WriteLine(">>>>>>>>>>>> 28_3 Sharp Bypass Done <<<<<<<<<<<<<<");
}
//***********************************************************************************
public static uint Bypass(int GunIndex)
{
Console.WriteLine("Access: " + GunIndex.ToString());
fixed (byte* WeaponPtr = WeaponMgrCopy[GunIndex])
return (uint)WeaponPtr;
}
public static byte[][] WeaponMgrCopy = new byte[999][];
public static uint pWeap = 0;
public static void backup(uint CShell, uint weaponMgr)
{
uint pWeaponMgr = *(uint*)(CShell + weaponMgr);
pWeap = pWeaponMgr;
Console.WriteLine("Creating Fake WeaponMgr Copy");
for (int i = 0; i < 999; i++)
{
uint Weapon = *(uint*)(pWeaponMgr + (4 * i));
if (Weapon != 0)
{
WeaponMgrCopy[i] = new byte[0x3000];
//memcpy(Weapons[i], (void*)(Weapon), 0x1400);
for (int k = 0; k < 0x1400; k++)
{
fixed (byte* wPtr = WeaponMgrCopy[i])
*(byte*)(wPtr + k) = *(byte*)(Weapon + k);
}
}
}
Console.WriteLine("Done");
}
public static void MakeCall(byte* paddress, uint yourfunction, uint dwLen)
{
Console.WriteLine("OverWrite Function");
uint dwOldProtect, dwBkup, dwRelAddr;
VirtualProtect((IntPtr)paddress, dwLen, 0x40, out dwOldProtect);
dwRelAddr = (uint)(yourfunction - (uint)paddress) - 5; //Count Call Address
*paddress = 0xE8;
*((uint*)(paddress + 0x1)) = dwRelAddr;
for (uint x = 0x5; x < dwLen; x++) *(paddress + x) = 0x90;
VirtualProtect((IntPtr)paddress, dwLen, dwOldProtect, out dwBkup);
}
//################################################################################################
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RabirDimensionalBeast
{
class Console
{
public static bool UpDated = false;
public static string ConsoleBuffer = "";
public static void WriteLine(string Text)
{
ConsoleBuffer += Text + "\r\n";
UpDated = true;
}
public static void WriteLine()
{
ConsoleBuffer += "\r\n";
UpDated = true;
}
public static void Write(string Text)
{
ConsoleBuffer += Text ;
UpDated = true;
}
public static void Write(char Chr)
{
ConsoleBuffer += Chr;
UpDated = true;
}
public static void Clear()
{
ConsoleBuffer = "";
UpDated = true;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace RabirDimensionalBeast
{
class CShellFunctions
{
// Function delegate..
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void _PushToConsole([MarshalAs(UnmanagedType.LPStr)] string Text);
//**************************************************
public static unsafe void PushToConsole(uint CShell, uint PTCPointer, int PTCOffset, string Command)
{
uint LTClient = *(uint*)((CShell + PTCPointer));
uint PTCAddy = *(uint*)(LTClient + PTCOffset);
var PTC = (_PushToConsole)Marshal.GetDelegateForFunctionPointer(new IntPtr(PTCAddy), typeof(_PushToConsole));
PTC(Command);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace RabirDimensionalBeast
{
class PatternScanner
{
private static unsafe uint FindPattern(int StartAddress, int Length, string bMask, string szMask)
{
byte[] ByteMask = new byte[szMask.Length];
//Creating Byte Array
int State = 0;
for (int i = 0; i < bMask.Length; i++)
{
if (bMask[i] == 'x')
{
ByteMask[State] = byte.Parse(bMask.Substring(i + 1, 2), System.Globalization.NumberStyles.HexNumber);
State++;
}
}
//Searching Byte Pattern
for (int i = 0; i < Length; i++)
{
bool Found = true;
for (int j = 0; j < ByteMask.Length; j++)
{
Found = Found && ((ByteMask[j] == *(byte*)(StartAddress + i + j)) || szMask[j] == '?');
}
if (Found) return (uint)(StartAddress + i); //Found it
}
return 0; //Didn't found it
}
public static unsafe int[] SequentedOffsetScanner(int StartAddress, int Length, string bMask, string szMask, int OffsetPos)
{
List<int> FoundOffsets = new List<int>();
//Creating Byte Array
byte[] ByteMask = new byte[szMask.Length];
int State = 0;
for (int i = 0; i < bMask.Length; i++)
{
if (bMask[i] == 'x')
{
ByteMask[State] = byte.Parse(bMask.Substring(i + 1, 2), System.Globalization.NumberStyles.HexNumber);
State++;
}
}
//Searching Byte Pattern
for (int i = 0; i < Length; i++)
{
bool Found = true;
for (int j = 0; j < ByteMask.Length; j++)
{
Found = Found && ((ByteMask[j] == *(byte*)(StartAddress + i + j)) || szMask[j] == '?');
}
if (Found)
{
if (!FoundOffsets.Contains(*(int*)(StartAddress + i + OffsetPos)))
FoundOffsets.Add(*(int*)(StartAddress + i + OffsetPos));
}
}
return FoundOffsets.ToArray();
}
public static unsafe int[] SequentedByteOffsetScanner(int StartAddress, int Length, string bMask, string szMask, int OffsetPos)
{
List<int> FoundOffsets = new List<int>();
//Creating Byte Array
byte[] ByteMask = new byte[szMask.Length];
int State = 0;
for (int i = 0; i < bMask.Length; i++)
{
if (bMask[i] == 'x')
{
ByteMask[State] = byte.Parse(bMask.Substring(i + 1, 2), System.Globalization.NumberStyles.HexNumber);
State++;
}
}
//Searching Byte Pattern
for (int i = 0; i < Length; i++)
{
bool Found = true;
for (int j = 0; j < ByteMask.Length; j++)
{
Found = Found && ((ByteMask[j] == *(byte*)(StartAddress + i + j)) || szMask[j] == '?');
}
if (Found)
{
if (!FoundOffsets.Contains((int)(*(byte*)(StartAddress + i + OffsetPos))))
FoundOffsets.Add((int)(*(byte*)(StartAddress + i + OffsetPos)));
}
}
return FoundOffsets.ToArray();
}
//######################### Find Addys #####################
//******************Pointers
public static unsafe uint FindWeaponMgr(uint CShell)
{
uint WeaponMgr = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x4F\x04\xA1\x00\x00\x00\x00\x85\xC0\x8B\x51\x04\x8B\x6A\x04", "xxxx????xxxxxxxx");
WeaponMgr = (*(uint*)(WeaponMgr + 4)) - CShell;
return WeaponMgr;
}
public static unsafe uint FindCShellPointer(uint CShell)
{
uint CShell_Pointer = FindPattern((int)CShell, 0xFFFFFF, @"\xc6\x01\x01\x8b\x15\x00\x00\x00\x00\x8b\x82\x00\x00\x00\x00\x8B", "xxxxx????xx????x");
CShell_Pointer = (*(uint*)(CShell_Pointer + 5)) - CShell;
return CShell_Pointer;
}
public static unsafe uint FindBasicPlayerInfo(uint CShell)
{
uint BasicPlayerInfo = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\xD8\x52\xF6\x10\x83\xC4\x04\x69\xC0\xA8\x00\x00\x00\xD9\x9C\x08\x88\x00\x00\x00\x8B\x4C\x24\x30\x3B\xCB", "xx????xxxxx????xxx????xxx?xx");
BasicPlayerInfo = (*(uint*)(BasicPlayerInfo + 2)) - CShell;
return BasicPlayerInfo;
}
public static unsafe uint FindPushToConsole(uint CShell)
{
uint PTC = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\x44\xA2\x59\x10\x8B\x91\x04\x02\x00\x00\x68\xB8\x55\x4C\x10\xFF\xD2\x83\xC4\x04\x53\xE8\x46\xF3\xFD\xFF\x8B\xC8\xE8\xBF\x5F\x2F\x00", "xx????xx????x????xxxxxxx????xxx????");
PTC = (*(uint*)(PTC + 2)) - CShell;
return PTC;
}
public static unsafe uint FindBypass(uint CShell)
{
uint ByPass = FindPattern((int)CShell, 0xFFFFFF, @"\xE8\xF6\x06\xE9\xFF\x8B\xF0\x83\xC4\x04\x85\xF6\x0F\x84\xE2\x01\x00\x00\xD9\x86\x3C\x0C\x00\x00\x0F\xB6\x86\x6C\x08\x00\x00\xD9\x5C\x24\x08\x89\x44\x24\x04\xD9\x86\x40\x0C\x00\x00\x57", "x????xxxx?xxxx????xx????xxx????xxx?xxx?xx????x");
return ByPass - CShell;
}
public static unsafe uint FindSecondBypass(uint CShell)
{
uint ByPass = FindPattern((int)CShell, 0xFFFFFF, @"\x66\x8B\x54\x24\x04\x33\xC0\x66\x85\xD2\x7C\x26\x56\x8B\x35\x50\xAA\xFD\x10", "xxxx?xxxxxx?xxx????");
return ByPass - CShell;
}
public static unsafe uint FindWallHack(uint CShell)
{
uint WallHack = FindPattern((int)Main.GetModuleHandle("crossfire.exe"), 0x2D7000, @"\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x06\x8B\x50\x18", "x????x????xxxxx");
WallHack = *(uint*)(WallHack + 1);
WallHack += 0xA4;
return WallHack;
}
public static unsafe uint FindMemorySeeGhost(uint CShell)
{
uint WallHack = FindPattern((int)Main.GetModuleHandle("crossfire.exe"), 0x2D7000, @"\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x06\x8B\x50\x18", "x????x????xxxxx");
WallHack = *(uint*)(WallHack + 1);
WallHack += 0xB8;
return WallHack;
}
public static unsafe uint FindDamageZone(uint CShell)
{
uint DamageZoneMgr = FindPattern((int)CShell, 0xFFFFFF, "\x68\x00\x00\x00\x00\x8D\x4C\x24\x24\x51\x8D\x54\x24\x34", "x????xxxxxxxxx");
DamageZoneMgr = *(uint*)(DamageZoneMgr + 0x01);
return DamageZoneMgr;
}
//*****************Offsets
public static unsafe void BetaOffsetSearch(uint CShell)
{
int[] Offsets = SequentedByteOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x5C\x24\x24\x8B\x0D\xD4\x52\xF6\x10\xD9\x44\x24\x24\x8B\x15\xD8\x52\xF6\x10\x83\xC4\x04\x69\xC9\xA8\x00\x00\x00\xD9\x5C\x11\x08", "xxx?xx????xxx?xx????xx?xx????xxx?", 32);
for (int i = 0; i < Offsets.Length; i++)
Console.WriteLine("Found Offset(C4DefuTimePattern): 0x" + Storage.DecToHex(Offsets[i]));
}
//WeaponMgr
public static unsafe uint FindReloadAnimRatio(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x0D\xA4\xC5\xFC\x10\x53\x8D\x3C\xB1\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x07\xD9\x98\x3C\x0C\x00\x00\x83\xC4\x04", "xx????xxxxxx????xxx?xxx?xxxx????xx?", 28);
return (uint)Offsets[1];
}
public static unsafe uint FindChangeWeaponAnimRatio(uint CShell)
{
uint Value = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\xA4\xC5\xFC\x10\x53\x8D\x3C\xB1\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\x8B\x17\xD9\x44\x24\x14\x8B\x3D\xE0\xC4\x4D\x10\xD9\x9A\x40\x0C\x00\x00\x83\xC4\x04", "xx????xxxxxx????xxx?xxxxx?xx????xx????xx?");
return (*(uint*)(Value + 34));
}
public static unsafe uint FindLeftClickAttributes(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x2B\xC1\xC1\xF8\x02\x3B\xF0\x72\x0C\xFF\x15\xE0\xC4\x4D\x10\x8B\x0D\xA4\xC5\xFC\x10\x8B\x04\xB1\x83\x88\xEC\x0A\x00\x00\x01", "xxxx?xxxxxx????xx????xxxxx?????", 26);
return (uint)Offsets[0];
}
public static unsafe uint FindRightClickAttributes(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x2B\xC1\xC1\xF8\x02\x3B\xF0\x72\x0C\xFF\x15\xE0\xC4\x4D\x10\x8B\x0D\xA4\xC5\xFC\x10\x8B\x04\xB1\x83\x88\xEC\x0A\x00\x00\x01", "xxxx?xxxxxx????xx????xxxxx?????", 26);
return (uint)Offsets[1];
}
public static unsafe uint FindZoomAttributes(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x2B\xC1\xC1\xF8\x02\x3B\xF0\x72\x0C\xFF\x15\xE0\xC4\x4D\x10\x8B\x0D\xA4\xC5\xFC\x10\x8B\x04\xB1\x83\x88\xEC\x0A\x00\x00\x01", "xxxx?xxxxxx????xx????xxxxx?????", 26);
return (uint)Offsets[2];
}
public static unsafe uint FindZoomAction(uint CShell)
{
uint Value = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\xA4\xC5\xFC\x10\x55\x8D\x1C\xB1\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x0B\xD9\x9C\xB9\x20\x39\x00\x00", "xx????xxxxxx????xxx?xxx?xxxxx????");
return (*(uint*)(Value + 29));
}
public static unsafe uint FindRange(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x44\x24\x14\x8B\x06\xDC\x0D\x50\xFC\x54\x10\x83\xC4\x04\xD9\x5C\x24\x10\xD9\x44\x24\x10\xD9\x98\x0C\x08\x00\x00", "xxx?xxxx????xx?xxx?xxx?xx????", 25);
return (uint)Offsets[0];
}
public static unsafe uint FindAiModeRange(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x44\x24\x14\x8B\x06\xDC\x0D\x50\xFC\x54\x10\x83\xC4\x04\xD9\x5C\x24\x10\xD9\x44\x24\x10\xD9\x98\x0C\x08\x00\x00", "xxx?xxxx????xx?xxx?xxx?xx????", 25);
return (uint)Offsets[1];
}
public static unsafe uint FindDamageVariantionFactor(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8D\x34\xA9\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x16\xD9\x9A\x38\x08\x00\x00", "xxxxx????xxx?xxx?xxxx????", 21);
return (uint)Offsets[2];
}
public static unsafe uint FindAmmoDamage(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8D\x34\xA9\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x06\xD9\x98\x1C\x08\x00\x00", "xxxxx????xxx?xxx?xxxx????", 21);
return (uint)Offsets[0];
}
//BasicPlayerInfo
public static unsafe uint FindC4DefuseTime(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x15\xD4\x52\xF6\x10\xD9\x44\x24\x24\xA1\xD8\x52\xF6\x10\x83\xC4\x04\x69\xD2\xA8\x00\x00\x00\xD9\x9C\x02\x80\x00\x00\x00", "xx????xxx?x????xx?xx????xxx????", 27);
return (uint)Offsets[0];
}
public static unsafe uint FindCharacterHiddenWalkAlpha(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x15\xD4\x52\xF6\x10\xD9\x44\x24\x24\xA1\xD8\x52\xF6\x10\x83\xC4\x04\x69\xD2\xA8\x00\x00\x00\xD9\x9C\x02\x80\x00\x00\x00", "xx????xxx?x????xx?xx????xxx????", 27);
return (uint)Offsets[1];
}
public static unsafe uint FindCharacterHiddenRunAlpha(uint CShell)
{
int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x15\xD4\x52\xF6\x10\xD9\x44\x24\x24\xA1\xD8\x52\xF6\x10\x83\xC4\x04\x69\xD2\xA8\x00\x00\x00\xD9\x9C\x02\x80\x00\x00\x00", "xx????xxx?x????xx?xx????xxx????", 27);
return (uint)Offsets[1] + 4;
}
public static unsafe uint FindMovementWalkRate(uint CShell)
{
int[] Offsets = SequentedByteOffsetScanner((int)CShell, 0xFFFFFF, @"\xD9\x5C\x24\x24\x8B\x0D\xD4\x52\xF6\x10\xD9\x44\x24\x24\x8B\x15\xD8\x52\xF6\x10\x83\xC4\x04\x69\xC9\xA8\x00\x00\x00\xD9\x5C\x11\x08", "xxx?xx????xxx?xx????xx?xx????xxx?", 32);
return (uint)Offsets[0];
}
//PTC
public static unsafe uint FindPushToConsoleOffset(uint CShell)
{
uint PTC = FindPattern((int)CShell, 0xFFFFFF, @"\x8B\x0D\x44\xA2\x59\x10\x8B\x91\x04\x02\x00\x00\x68\xB8\x55\x4C\x10\xFF\xD2\x83\xC4\x04\x53\xE8\x46\xF3\xFD\xFF\x8B\xC8\xE8\xBF\x5F\x2F\x00", "xx????xx????x????xxxxxxx????xxx????");
PTC = (*(uint*)(PTC + 8));
return PTC;
}
//###################################################################################################
public static void LogAddresses(uint CShell)
{
//*******************************Define Offsets
//WeaponMgr
Console.WriteLine("Start Searching For Offsets");
Console.WriteLine(">>>>WeaponMgr<<<<");
Storage.SetOffset((int)FindReloadAnimRatio(CShell), "ReloadAnimRatio"); //float
Storage.SetOffset((int)FindChangeWeaponAnimRatio(CShell), "ChangeWeaponAnimRatio"); //float
Storage.SetOffset((int)FindLeftClickAttributes(CShell), "LeftClickAttributes"); //int
Storage.SetOffset((int)FindRightClickAttributes(CShell), "RightClickAttributes"); //int
Storage.SetOffset((int)FindZoomAttributes(CShell), "ZoomAttributes"); //int
Storage.SetOffset((int)FindZoomAction(CShell), "ZoomAction"); //float[13] Index[10] = Int
/*
Storage.SetOffset(0x3B20, "ThrowVelocity"); //float
Storage.SetOffset(0x3B24, "ThrowAngle"); //float
Storage.SetOffset(0x3B28, "ThrowAirRes"); //float
Storage.SetOffset(0x3B2C, "ThrowTime"); //float (Grenade Delay)
*/
Storage.SetOffset((int)PatternScanner.FindRange(CShell), "Range"); //float
Storage.SetOffset((int)PatternScanner.FindAiModeRange(CShell), "AiModeRange"); //float
Storage.SetOffset((int)PatternScanner.FindAmmoDamage(CShell), "AmmoDamage"); //float
Storage.SetOffset(0x820, "AiModeAmmoDamage"); //float
Storage.SetOffset((int)PatternScanner.FindDamageVariantionFactor(CShell), "DamageVariantionFactor"); //float
/*
Storage.SetOffset(0xA5C, "KnifeNormalRange"); //float[3]
Storage.SetOffset(0xA80, "KnifeBigshotRange"); //float[3]
Storage.SetOffset(0xA9C, "KnifeNormalRange2"); //float[3]
Storage.SetOffset(0xAC0, "KnifeBigshotRange2"); //float[3]
Storage.SetOffset(0xA70, "KnifeNormalAniRate"); //float[3]
Storage.SetOffset(0xA98, "KnifeBigshotAniRate"); //float[3]
Storage.SetOffset(0xAB8, "KnifeNormalAniRate2"); //float[3]
Storage.SetOffset(0xADC, "KnifeBigshotAniRate2"); //float[3]
Storage.SetOffset(0xA68, "KnifeNormalAngle"); //float[3]
Storage.SetOffset(0xA8C, "KnifeBigshotAngle"); //float[3]
Storage.SetOffset(0xAA8, "KnifeNormalAngle2"); //float[3]
Storage.SetOffset(0xACC, "KnifeBigshotAngle2"); //float[3]
*/
/*
Storage.SetOffset(0xC04, "KnifeNormalAmmoDamage"); //float[3]
Storage.SetOffset(0xC10, "KnifeBigshotAmmoDamage"); //float[3]
Storage.SetOffset(0xC1C, "KnifeNormalAmmoDamage2"); //float[3]
Storage.SetOffset(0xC28, "KnifeBigshotAmmoDamage2"); //float[3]
*/
/*
Storage.SetOffset(0x352C, "BulletPosOffset"); //float[4]
Storage.SetOffset(0x353C, "ShotReactYaw"); //float[9]
Storage.SetOffset(0x370C, "ShotReactPitch"); //float[9]
Storage.SetOffset(0x11CC, "DatailReactYawShot"); //float[9]
Storage.SetOffset(0x1064, "DatailReactPitchShot"); //float[9]
Storage.SetOffset(0xEFC, "DetailPerturbShot"); //float[9]
Storage.SetOffset(0x540, "PerturbMin"); //float[9]
Storage.SetOffset(0x6A8, "PerturbMax"); //float[9]
*/
Console.WriteLine(">>>>Basic Player Info<<<<");
//BasicPlayerInfo
Storage.SetOffset((int)FindC4DefuseTime(CShell), "C4DefuseTime"); //float
Storage.SetOffset(0x88, "CharacterHiddenAlpha"); //float
Storage.SetOffset((int)FindCharacterHiddenWalkAlpha(CShell), "CharacterHiddenWalkAlpha"); //float
Storage.SetOffset((int)FindCharacterHiddenRunAlpha(CShell), "CharacterRunAlpha"); //float
Storage.SetOffset(0xC, "MovementDuckWalkRate"); //float
Storage.SetOffset((int)FindMovementWalkRate(CShell), "MovementWalkRate"); //float
Storage.SetOffset(0x84, "MaxCanDefuseDistance"); //float
//PlayerPointer
//Storage.SetOffset(0x64C, "FlyOffset"); //float
//PTC
Console.WriteLine(">>>>PushToConsole<<<<");
Storage.SetOffset((int)FindPushToConsoleOffset(CShell), "PTCOffset");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/*
* Rabir Dimensional Beast Storage Class
*/
namespace RabirDimensionalBeast
{
//####################### Data Types #################################
class Pointer
{
public uint Address;
public string Name;
public Pointer(uint Address, string Name)
{
this.Address = Address;
this.Name = Name;
}
}
class Offset
{
public int Addy;
public string Name;
public Offset(int Addy, string Name)
{
this.Addy = Addy;
this.Name = Name;
}
}
class ByteValue
{
public byte Value;
public string Name;
public ByteValue(byte Value, string Name)
{
this.Value = Value;
this.Name = Name;
}
}
class IntValue
{
public int Value;
public string Name;
public IntValue(int Value, string Name)
{
this.Value = Value;
this.Name = Name;
}
}
class FloatValue
{
public float Value;
public string Name;
public FloatValue(float Value, string Name)
{
this.Value = Value;
this.Name = Name;
}
}
//####################### Actual Storage Handling ####################
class Storage
{
//*********************** OTher
public static float[] DamageVariantFactor = new float[999];
//*********************** Pointers & Offsets & Values
private static List<Pointer> PointerList = new List<Pointer>();
private static List<Offset> OffsetList = new List<Offset>();
private static List<ByteValue> ByteValueList = new List<ByteValue>();
private static List<IntValue> IntValueList = new List<IntValue>();
private static List<FloatValue> FloatValueList = new List<FloatValue>();
//***************************************************************** Pointers
public static void SetPointer(uint Address, string Name)
{
foreach (Pointer Ptr in PointerList)
{
if (Ptr.Name.ToUpper() == Name.ToUpper())
{
Ptr.Address = Address;
Console.WriteLine("Pointer updated \"" + Ptr.Name + "\" = [0x" + Storage.DecToHex((int)Ptr.Address).ToString() + "]");
return;
}
}
PointerList.Add(new Pointer(Address, Name));
Console.WriteLine("Pointer created \"" + Name + "\" = [0x" + Storage.DecToHex((int)Address).ToString() + "]");
}
public static uint GetPointer(string Name)
{
foreach (Pointer Ptr in PointerList)
{
if (Ptr.Name.ToUpper() == Name.ToUpper())
{
return Ptr.Address;
}
}
return 0;
}
//******************************************************************* Offsets
public static void SetOffset(int Addy, string Name)
{
foreach (Offset Off in OffsetList)
{
if (Off.Name.ToUpper() == Name.ToUpper())
{
Off.Addy = Addy;
Console.WriteLine("Offset updated \"" + Off.Name + "\" = [0x" + Storage.DecToHex(Off.Addy).ToString() + "]");
return;
}
}
OffsetList.Add(new Offset(Addy, Name));
Console.WriteLine("Offset created \"" + Name + "\" = [0x" + Storage.DecToHex(Addy).ToString() + "]");
}
public static int GetOffset(string Name)
{
foreach (Offset Off in OffsetList)
{
if (Off.Name.ToUpper() == Name.ToUpper())
{
return Off.Addy;
}
}
return 0;
}
//********************************************************************* Values
//Byte
public static void SetByteValue(byte Value, string Name)
{
foreach (ByteValue Val in ByteValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
Val.Value = Value;
Console.WriteLine("Byte value updated \"" + Val.Name + "\" = [" + Val.Value.ToString() + "]");
return;
}
}
ByteValueList.Add(new ByteValue(Value, Name));
Console.WriteLine("Byte value created \"" + Name + "\" = [" + Value.ToString() + "]");
}
public static byte GetByteValue(string Name)
{
foreach (ByteValue Val in ByteValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
return Val.Value;
}
}
return 0;
}
//Int
public static void SetIntValue(int Value, string Name)
{
foreach (IntValue Val in IntValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
Val.Value = Value;
Console.WriteLine("Int value updated \"" + Val.Name + "\" = [" + Val.Value.ToString() + "]");
return;
}
}
IntValueList.Add(new IntValue(Value, Name));
Console.WriteLine("Int value created \"" + Name + "\" = [" + Value.ToString() + "]");
}
public static int GetIntValue(string Name)
{
foreach (IntValue Val in IntValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
return Val.Value;
}
}
return 0;
}
//Float
public static void SetFloatValue(float Value, string Name)
{
foreach (FloatValue Val in FloatValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
Val.Value = Value;
Console.WriteLine("Float value updated \"" + Val.Name + "\" = [" + Val.Value.ToString() + "]");
return;
}
}
FloatValueList.Add(new FloatValue(Value, Name));
Console.WriteLine("Float value created \"" + Name + "\" = [" + Value.ToString() + "]");
}
public static float GetFloatValue(string Name)
{
foreach (FloatValue Val in FloatValueList)
{
if (Val.Name.ToUpper() == Name.ToUpper())
{
return Val.Value;
}
}
return 0;
}
//############################# Other Tools ###################
public static string DecToHex(int Dec)
{
return Dec.ToString("X");
}
//############################# Weapon Handling ###############
public enum WeaponType
{
Rifle,
Pistol,
Grenade,
Meele,
Sniper,
Shotgun,
SMG,
MG,
Smoke,
Flash,
Hypomed,
UnKnown
}
public static WeaponType GetWeaponType(int i)
{
if (i == 6 || i == 126 || i == 200 || i == 209 || i == 210 || i == 240 || i == 313 || i == 338 || i == 357 || i == 416 || i == 423 || i == 438 || i == 473 || i == 481 || i == 519 || i == 654 || i == 696 || i == 720 || i == 729)
return WeaponType.Grenade;
if (i == 5 || i == 35 || i == 74 || i == 120 || i == 132 || i == 176 || i == 177 || i == 178 || i == 182 || i == 195 || i == 196 || i == 197 || i == 198 || i == 199 || i == 223 || i == 224 || i == 225 || i == 226 || i == 227 || i == 228 || i == 244 || i == 302 || i == 303 || i == 304 || i == 305 || i == 306 || i == 307 || i == 318 || i == 345 || i == 346 || i == 376 || i == 404 || i == 405 || i == 406 || i == 407 || i == 408 || i == 409 || i == 437 || i == 455 || i == 456 || i == 457 || i == 517 || i == 518 || i == 548 || i == 576 || i == 541 || i == 587 || i == 693 || i == 718 || i == 719 || i == 728)
return WeaponType.Meele;
if (i == 714 || i == 14 || i == 15 || i == 16 || i == 23 || i == 43 || i == 46 || i == 91 || i == 110 || i == 111 || i == 122 || i == 136 || i == 150 || i == 152 || i == 163 || i == 185 || i == 186 || i == 194 || i == 232 || i == 249 || i == 268 || i == 279 || i == 294 || i == 323 || i == 368 || i == 378 || i == 500 || i == 513 || i == 525 || i == 554 || i == 602 || i == 632 || i == 657 || i == 714 || i == 724)
return WeaponType.Sniper;
if (i == 1 || i == 4 || i == 18 || i == 19 || i == 20 || i == 26 || i == 33 || i == 37 || i == 44 || i == 60 || i == 75 || i == 78 || i == 92 || i == 105 || i == 115 || i == 116 || i == 153 || i == 155 || i == 156 || i == 217 || i == 235 || i == 241 || i == 247 || i == 328 || i == 348 || i == 350 || i == 370 || i == 371 || i == 439 || i == 470 || i == 497 || i == 515 || i == 516 || i == 528 || i == 589 || i == 600 || i == 644 || i == 670 || i == 694 || i == 716 || i == 717 || i == 725)
return WeaponType.Pistol;
if (i == 8 || i == 64 || i == 65 || i == 384 || i == 521 || i == 722)
return WeaponType.Smoke;
if (i == 7 || i == 383 || i == 520 || i == 721)
return WeaponType.Flash;
if (i == 0 || i == 36 || i == 68 || i == 171 || i == 243 || i == 286 || i == 329 || i == 331 || i == 336 || i == 342 || i == 369 || i == 388 || i == 432 || i == 498 || i == 514 || i == 555 || i == 590 || i == 641 || i == 663 || i == 689 || i == 715)
return WeaponType.Shotgun;
if (i == 2 || i == 3 || i == 10 || i == 21 || i == 28 || i == 32 || i == 39 || i == 55 || i == 67 || i == 112 || i == 128 || i == 145 || i == 147 || i == 148 || i == 149 || i == 157 || i == 183 || i == 211 || i == 213 || i == 216 || i == 229 || i == 245 || i == 276 || i == 293 || i == 362 || i == 363 || i == 422 || i == 463 || i == 476 || i == 487 || i == 507 || i == 508 || i == 527 || i == 529 || i == 550 || i == 604 || i == 614 || i == 651 || i == 680 || i == 711)
return WeaponType.SMG;
if (i == 716 || i == 715 || i == 713 || i == 712 || i == 711 || i == 11 || i == 12 || i == 13 || i == 22 || i == 24 || i == 25 || i == 27 || i == 29 || i == 30 || i == 31 || i == 34 || i == 38 || i == 40 || i == 41 || i == 42 || i == 45 || i == 47 || i == 49 || i == 50 || i == 56 || i == 72 || i == 73 || i == 76 || i == 77 || i == 85 || i == 87 || i == 90 || i == 94 || i == 95 || i == 96 || i == 97 || i == 98 || i == 103 || i == 104 || i == 106 || i == 113 || i == 121 || i == 127 || i == 133 || i == 140 || i == 141 || i == 160 || i == 161 || i == 164 || i == 167 || i == 174 || i == 175 || i == 179 || i == 187 || i == 190 || i == 201 || i == 203 || i == 206 || i == 208 || i == 212 || i == 222 || i == 230 || i == 233 || i == 234 || i == 236 || i == 237 || i == 291 || i == 333 || i == 340 || i == 349 || i == 351 || i == 364 || i == 365 || i == 366 || i == 367 || i == 374 || i == 377 || i == 390 || i == 391 || i == 403 || i == 415 || i == 418 || i == 421 || i == 429 || i == 431 || i == 436 || i == 440 || i == 471 || i == 479 || i == 484 || i == 486 || i == 499 || i == 502 || i == 509 || i == 510 || i == 511 || i == 512 || i == 526 || i == 532 || i == 536 || i == 538 || i == 539 || i == 542 || i == 559 || i == 573 || i == 591 || i == 597 || i == 598 || i == 619 || i == 630 || i == 636 || i == 676 || i == 678 || i == 679 || i == 691 || i == 712 || i == 713 || i == 723 || i == 726 || i == 727)
return WeaponType.Rifle;
if (i == 710 || i == 17 || i == 61 || i == 124 || i == 158 || i == 159 || i == 166 || i == 188 || i == 257 || i == 300 || i == 315 || i == 316 || i == 352 || i == 361 || i == 441 || i == 506 || i == 524 || i == 556 || i == 558 || i == 564 || i == 565 || i == 575 || i == 588 || i == 653 || i == 710)
return WeaponType.MG;
if (i == 328 || i == 348)
return WeaponType.Hypomed;
return WeaponType.UnKnown;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Threading;
namespace RabirDimensionalBeast
{
unsafe class ByPass
{
[DllImport("kernel32.dll")]
static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize, uint flNewProtect, out uint lpflOldProtect);
//ByPass Delegates
[UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Auto, SetLastError = true)]
public delegate uint GetWeaponPointerDelegate(int WeaponIndex);
public static GetWeaponPointerDelegate ByPassDelegate = new GetWeaponPointerDelegate(Bypass);
public static unsafe void CreateBypass(uint CShell, uint WeaponMgr, uint ByPassPointer)
{
Console.WriteLine(">>>>>>>>>>>> 28_3 Sharp Bypass Start <<<<<<<<<<<<<<");
uint Ptr = (uint)Marshal.GetFunctionPointerForDelegate(ByPassDelegate);
Console.WriteLine("Bypass function pointer: 0x" + Storage.DecToHex((int)Ptr));
if (*(byte*)(CShell + ByPassPointer) != 0)
{
MakeCall((byte*)(CShell + ByPassPointer), Ptr, 5);
backup(CShell, WeaponMgr);
}
Console.WriteLine(">>>>>>>>>>>> 28_3 Sharp Bypass Done <<<<<<<<<<<<<<");
}
//***********************************************************************************
public static uint Bypass(int GunIndex)
{
Console.WriteLine("Access: " + GunIndex.ToString());
fixed (byte* WeaponPtr = WeaponMgrCopy[GunIndex])
return (uint)WeaponPtr;
}
public static byte[][] WeaponMgrCopy = new byte[999][];
public static uint pWeap = 0;
public static void backup(uint CShell, uint weaponMgr)
{
uint pWeaponMgr = *(uint*)(CShell + weaponMgr);
pWeap = pWeaponMgr;
Console.WriteLine("Creating Fake WeaponMgr Copy");
for (int i = 0; i < 999; i++)
{
uint Weapon = *(uint*)(pWeaponMgr + (4 * i));
if (Weapon != 0)
{
WeaponMgrCopy[i] = new byte[0x3000];
//memcpy(Weapons[i], (void*)(Weapon), 0x1400);
for (int k = 0; k < 0x1400; k++)
{
fixed (byte* wPtr = WeaponMgrCopy[i])
*(byte*)(wPtr + k) = *(byte*)(Weapon + k);
}
}
}
Console.WriteLine("Done");
}
public static void MakeCall(byte* paddress, uint yourfunction, uint dwLen)
{
Console.WriteLine("OverWrite Function");
uint dwOldProtect, dwBkup, dwRelAddr;
VirtualProtect((IntPtr)paddress, dwLen, 0x40, out dwOldProtect);
dwRelAddr = (uint)(yourfunction - (uint)paddress) - 5; //Count Call Address
*paddress = 0xE8;
*((uint*)(paddress + 0x1)) = dwRelAddr;
for (uint x = 0x5; x < dwLen; x++) *(paddress + x) = 0x90;
VirtualProtect((IntPtr)paddress, dwLen, dwOldProtect, out dwBkup);
}
//################################################################################################
}
}



