C# Base tutorial + CLR Injector + Sources

Posts 1–4 of 4 · Page 1 of 1
C# Base tutorial + CLR Injector + Sources
My Previous thread was deleted, i didn't got any information, why, maybe somebody missed something...
Even @BACKD00R didn't understood the reason...

So here is the second try:
--------------------------------------------------------------------------
Notice:
-The CLR injector isn't my project... The source goes to @Jason
-I made this for real coders so i won't explain every little detail
-The base is C+P ready, so beware for leechers above 30 IQ
-There is no D3D in the base, i use my special tricks to show a clickable menu
-This is a C# Managed base, so you MUST have an injector wich capable for managed injection
-The source made for CrossFire Eu, so the Pointers won't work with Cf Na / any other
---------------------------------------------------------------------------
Lets start:

1; Create a new Console Application Project

2; Change to DLL project
(Project -> <Proj Name> Properties -> Application page -> Output type: "Class Library")

3; In program.cs (defualt class file for Console Projects) create a method:
Code:
static int DllMain(String arg)
The injector i included will look for this Method (watch out for type: "static int" and Capital letters in name)

4; Now, we have to create a new thread:
Code:
ThreadStart HackThreadStart = new ThreadStart(Hackin);
Thread HackThread = new Thread(HackThreadStart);
HackThread.Start();
Or a short version:
Code:
new Thread(new ThreadStart(Hackin)).Start();
Ok, so we created a new thread... Now we need the actual method, which is the hack itself...
I call it "Hackin" in the previous code...
Code:
public static unsafe void Hackin()
{
Thread.Sleep(500);
CShell = GetModuleHandle("CShell.dll");
while (CShell == (IntPtr)0)
{
CShell = GetModuleHandle("CShell.dll");
Thread.Sleep(10);
}
while (true)
{
 Thread.Sleep(10);
 //Hacking
}
}


In C# the data types are different, but the expressions are the same...
So:
C++ C#
DWORD IntPtr
hModule IntPtr

You have to use this, if you converting your C++ base to C#
Here is an example:
Code:
IntPtr pWeaponMgr = *(IntPtr*)(CShell + WeaponMgr);
In C#, you don't have the GetModuleHandle built in....
So we use WinAPIs:
Code:
[DllImport("Kernel32.dll")]
  public static extern IntPtr GetModuleHandle(string ModuleName);


Oookay... You have the basics of you base, the other parts depends on you...
But for now, here is my Full projects source, with all classes

################################################## #
The next part is fucked up by vBulletin auto correction, or something else, always when i correct it, and save, it got fucked up again...
The second Expandable button contains the Code itself
################################################## #



 
Source


The Program.cs which include the DllMain and the hacking thread:
 
Program.cs

 
Source
 
Program.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.Reflection;

namespace CodeTester
{
    public class MainClass
    {
        [DllImport("Kernel32.dll")]
        public static extern IntPtr GetModuleHandle(string ModuleName);

        static int DllMain(String arg)
        {
            ThreadStart HackThreadStart = new ThreadStart(Hackin);
            Thread HackThread = new Thread(HackThreadStart);
            HackThread.Start();

            new Thread(new ThreadStart(Hackin)).Start();

            ThreadStart OpenMenuStart = new ThreadStart(OpenMenuMethod);
            Thread OpenMenu = new Thread(OpenMenuStart);
            OpenMenu.Start();

            return 0;
        }

        public static void OpenMenuMethod()
        {
            Application.Run(new MenuForm());
        }
        public static IntPtr CShell = (IntPtr)0;
        public static unsafe void Hackin()
        {
            Thread.Sleep(500);
            CShell = GetModuleHandle("CShell.dll");
            while (CShell == (IntPtr)0)
            {
                CShell = GetModuleHandle("CShell.dll");
                Thread.Sleep(10);
            }
            bool GotpWeaponMgr = false;
            bool GotpBasicPlayerInfo = false;
            MenuForm.Console.Items.Add("Found CShell at: " + CShell.ToString());
            while (true)
            {
                Thread.Sleep(10);
                IntPtr pWeaponMgr = *(IntPtr*)(CShell + (int)Storage.Pointers.WeaponMgr);
                IntPtr pBasicPlayerInfo = *(IntPtr*)(CShell + (int)Storage.Pointers.BasicPlayerInfo);
                IntPtr pPlayerPointer = *(IntPtr*)(CShell + (int)Storage.Pointers.PlayerPtr);
                IntPtr pDamageZonePointer = (IntPtr)(CShell + (int)Storage.Pointers.DamageZone);
                IntPtr pVisibleZoneIndex = (IntPtr)(CShell + (int)Storage.Pointers.VisibleZoneIndex);
                IntPtr pFallDamagePointer = *(IntPtr*)(CShell + (int)Storage.Pointers.FallDamage);
                IntPtr pDamagePerSec = (IntPtr)(CShell + (int)Storage.Pointers.DamagePerSec);

                //IntPtr pWallMgr = *(IntPtr*)(WallMgr + CShell);
                //IntPtr pPlayerPos = *(IntPtr*)(CShell + (ClientShell + 0x100));

                //***********************************************************************Calling ByPass
                /*
                if (!Storage.IsBypassDone && CShell != (IntPtr)0)
                {
                    ByPass.BackUp(CShell, (IntPtr)Storage.Pointers.WeaponMgr);
                    if (*(byte*)(CShell + (int)Storage.Pointers.ByPass) != 0)
                    {
                        ByPass.MakeCall((IntPtr)((byte*)(CShell + (int)Storage.Pointers.ByPass)), (IntPtr)((void*)(ByPass.Bypass)), 5);
                        Storage.IsBypassDone = true;
                    }
                    else continue;
                }
                */
                //***********************************************************************Hacking Like a Buch Of Hell
                //Weapon Manager Hacks
                for (int i = 0; i < 999; i++)
                {
                    if (pWeaponMgr != (IntPtr)0)
                    {
                        if (!GotpWeaponMgr) MenuForm.Console.Items.Add("Found pWeaponMgr at: " + pWeaponMgr.ToString());
                        GotpWeaponMgr = true;
                        IntPtr CurrentWeapon = *(IntPtr*)(pWeaponMgr + (4 * i));

                        if (CurrentWeapon != (IntPtr)0)
                        {
                            //Log Weapons Official Values
                            if (!Storage.IsWeaponsLogged)
                            {
                                Storage.MovementSpeed[i] = *(float*)(CurrentWeapon + (int)Storage.Offsets.MoveSpeedPenalty);
                                Storage.WeaponBioDamage[i] = *(float*)(CurrentWeapon + (int)Storage.Offsets.AIModeAmmoDamage);
                            }

                            *(float*)(CurrentWeapon + 0x86E) = 0;
                            //No Reload
                            if (Storage.IsBypassDone) *(float*)(CurrentWeapon + 0xC3C) = Storage.ReloadValue;

                            //No Recoil
                            /*
                            for (int y = 0; y < 9; y++)
                            {
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.DetailPerturbShot + (4 * y))) = 0.3f;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.DetailReactYawShot + (4 * y))) = 0.3f;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.DetailReactPitchShot + (4 * y))) = 0.3f;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.ShotReactPitch + (4 * y))) = 0.3f;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.ShotReactYaw + (4 * y))) = 0.3f;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.BulletPosOffset + (4 * y))) = 0.3f;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.PerturbMin + (4 * y))) = 0.3f;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.PerturbMax + (4 * y))) = 0.3f;
                            }
                            */
                            //Speed Knife
                            for (int j = 0; j < 3; j++)
                            {
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.KnifeNormalAniRate + (4 * j))) = Storage.KnifeAnimRatio;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.KnifeBigshotAniRate + (4 * j))) = Storage.KnifeAnimRatio * 5;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.KnifeNormalAniRate2 + (4 * j))) = Storage.KnifeAnimRatio;
                                *(float*)(CurrentWeapon + ((int)Storage.Offsets.KnifeBigshotAniRate2 + (4 * j))) = Storage.KnifeAnimRatio * 5;
                            }

                            //Bio Mode Boss Damage
                            if (Storage.BioModeBossDamage) *(float*)(CurrentWeapon + (int)Storage.Offsets.AIModeAmmoDamage) = 10000;
                            else *(float*)(CurrentWeapon + (int)Storage.Offsets.AIModeAmmoDamage) = Storage.WeaponBioDamage[i];

                            //Speed Hack
                            if (Storage.SpeedHack) *(float*)(CurrentWeapon + (int)Storage.Offsets.MoveSpeedPenalty) = 0.0f;
                            else if (Storage.SuperSpeed) *(float*)(CurrentWeapon + (int)Storage.Offsets.MoveSpeedPenalty) = 5.0f;
                            else *(float*)(CurrentWeapon + (int)Storage.Offsets.MoveSpeedPenalty) = Storage.MovementSpeed[i];

                            //No Nade Damage
                            if (Storage.GetWeaponType(i) == Storage.WeaponType.Grenade)
                            {
                                *(float*)(CurrentWeapon + (int)Storage.Offsets.AmmoDamage) = 0;
                            }

                            //Weapon Range
                            *(float*)(CurrentWeapon + (int)Storage.Offsets.WeaponRange) = 9999999;

                            //No Flash
                            if (i == 7) *(float*)(CurrentWeapon + (int)Storage.Offsets.WeaponRange) = 0;

                            //Anti Assassin Grenade
                            if (i == 423) *(float*)(CurrentWeapon + (int)Storage.Offsets.WeaponRange) = 0;

                            //No Change Delay
                            if (Storage.IsBypassDone) *(float*)(CurrentWeapon + (int)Storage.Offsets.ChangeWeaponAnimRatio) = Storage.ChangeAnimRatio;

                            if (Storage.GetWeaponType(i) != Storage.WeaponType.Hypomed)
                                *(byte*)(CurrentWeapon + (int)Storage.Offsets.LeftClickAttribute) = 2;

                            //Zoom With All Weapon
                            if (Storage.GetWeaponType(i) != Storage.WeaponType.Meele)
                            {
                                *(int*)(CurrentWeapon + (int)Storage.Offsets.RightClickAttribute) = 2;
                                *(int*)(CurrentWeapon + (int)Storage.Offsets.ZoomAttribute) = 8;
                                *(float*)(CurrentWeapon + (0x3918 + (0 * 4))) = 1;
                                *(float*)(CurrentWeapon + (0x3918 + (1 * 4))) = 2.5f;
                                *(float*)(CurrentWeapon + (0x3918 + (10 * 4))) = 2.802597E-45f;
                                *(float*)(CurrentWeapon + (0x3918 + (11 * 4))) = 500;
                                *(float*)(CurrentWeapon + (0x3918 + (12 * 4))) = 500;
                            }
                            //##################### Experimental ################
                            //Alternate weapon
                            //*(int*)(CurrentWeapon + 0xB10) = 391;

                        }//End if(CurrentWeapon)
                    }//End If (pWeaponMgr)
                }//End For (int i = 0; i < 999; i++)

                if (!Storage.IsWeaponsLogged && (pWeaponMgr != (IntPtr)0))
                {
                    Storage.IsWeaponsLogged = true;
                    MenuForm.Console.Items.Add("Weapon Values Logged: MoveSpeedPenalty");
                    MenuForm.Console.Items.Add("Weapon Values Logged: AIModeAmmoDamage");
                }

                //Basic Player Info Hacks
                if (pBasicPlayerInfo != (IntPtr)0)
                {
                    if (!GotpBasicPlayerInfo) MenuForm.Console.Items.Add("Found pBasicPlayerInfo at: " + pBasicPlayerInfo.ToString());
                    GotpBasicPlayerInfo = true;

                    //Speed Defuse
                    *(float*)(pBasicPlayerInfo + (int)Storage.Offsets.C4DefuseTime) = Storage.DefuseTime;

                    //Crounch Speed
                    *(float*)(pBasicPlayerInfo + (int)Storage.Offsets.MovementDuckWalkRate) = Storage.CrounchSpeed;

                    //SeeGhost
                    //*(float*)(pBasicPlayerInfo + (int)Storage.Offsets.CharacterHiddenAlpha) = Storage.SeeGhost; 
                    *(float*)(pBasicPlayerInfo + (int)Storage.Offsets.CharacterHiddenWalkAlpha) = Storage.SeeGhost;
                    *(float*)(pBasicPlayerInfo + (int)Storage.Offsets.CharacterHiddenRunAlpha) = Storage.SeeGhost;
                }



                //No Bug Damage
                if (pDamageZonePointer != (IntPtr)0) *(float*)(pDamageZonePointer) = 0.001f;
                if (pVisibleZoneIndex != (IntPtr)0) *(float*)(pVisibleZoneIndex) = 0.001f;
                if (pDamagePerSec != (IntPtr)0) *(float*)(pDamagePerSec) = 0.001f;

                //No Fall Damage
                if (pFallDamagePointer != (IntPtr)0) *(float*)(pFallDamagePointer) = 9999999;



                //Player Pointer Hacks
                if (pPlayerPointer != (IntPtr)0)
                {
                    //Fly
                    if (MenuForm.GetAsyncKeyState(Keys.E) < 0 && Storage.IsFlyEnabled)
                        *(float*)(pPlayerPointer + 0x5F0 + 0x8) = -1.9f;
                    else
                        *(float*)(pPlayerPointer + 0x5F0 + 0x8) = 1;

                    //Lift off
                    if (MenuForm.GetAsyncKeyState(Keys.Q) < 0 && Storage.IsLifting)
                    {
                        *(float*)(pPlayerPointer + 0x5F0 + 0x8) = -2.5f;
                    }

                    //No Reload
                    //*(float*)(pPlayerPointer + (int)Storage.Offsets.PlayerPointer_NoReload) = 20;
                    //No Change
                    //*(float*)(pPlayerPointer + (int)Storage.Offsets.PlayerPointer_NoChangeDelay) = 20;
                    //No Recoil
                    //*(float*)(pPlayerPointer + (int)Storage.Offsets.PlayerPointer_NoRecoil1) = Storage.PlayerPtrNoRecoil1;
                    //*(float*)(pPlayerPointer + (int)Storage.Offsets.PlayerPointer_NoRecoil2) = Storage.PlayerPtrNoRecoil2;
                    //*(float*)(pPlayerPointer + (int)Storage.Offsets.PlayerPointer_NoRecoil3) = Storage.PlayerPtrNoRecoil3;
                }
            }//End if (CShell)
        } //End While(true)
    } //End hackin()
}




I use Windows Forms for my menu, here is the code:
 
MenuForm.cs


Code:

 
MenuForm.cs
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System****;

namespace CodeTester
{
    public partial class MenuForm : Form
    {
        [DllImport("user32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool GetWindowRect(IntPtr hwnd, out Rectangle Rect);

        [DllImport("user32.dll")]
        public static extern IntPtr FindWindow(string ClassName, string WindowName);

        [DllImport("user32.dll")]
        public static extern IntPtr GetActiveWindow();

        [DllImport("user32.dll")]
        public static extern int GetAsyncKeyState(Keys Key);

        [DllImport("user32.dll", EntryPoint = "SetWindowPos")]
        public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags);

        public static Xhair CrossHair = new Xhair();

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams param = base.CreateParams;
                param.ExStyle |= 0x08000000 | 0x00000008;
                return param;
            }

        }
        public static System.Windows.Forms.ListBox Console;
        public MenuForm()
        {
            InitializeComponent();
            Console = new System.Windows.Forms.ListBox(); 
            Console.FormattingEnabled = true;
            Console.Location = new System.Drawing.Point(12, this.Height - Console.Height - 12);
            Console.Name = "Console";
            Console.Size = new System.Drawing.Size(this.Width - 24, 95);
            Console.TabIndex = 1;
            this.Controls.Add(Console);
        }

        private void MenuForm_Load(object sender, EventArgs e)
        {
            this.TopMost = true;
            this.TopLevel = true;
            this.ShowInTaskbar = false;

            CrossHair.Show();
            SwitchXhairVisible.Checked = false;
        }

        private void CheckCrossFireWindow_Tick(object sender, EventArgs e)
        {
            Rectangle CrossWindow = new Rectangle();
            IntPtr CrossFireHandle = FindWindow(null, "CrossFire");
            GetWindowRect(CrossFireHandle, out CrossWindow);
            this.Location = new Point(CrossWindow.Location.X, CrossWindow.Location.Y);

            int Width = Screen.PrimaryScreen.Bounds.Width / 2;
            int Height = Screen.PrimaryScreen.Bounds.Height / 2;
            CrossHair.Location = new Point(Width - CrossHair.Width / 2, Height - CrossHair.Height / 2);
        }

        private void CheckInsertKey_Tick(object sender, EventArgs e)
        {
            if (GetAsyncKeyState(Keys.Insert) < 0)
            {
                this.Visible = !this.Visible;
                this.BringToFront();
            }
            while (GetAsyncKeyState(Keys.Insert) < 0) ;

            if (new Rectangle(this.Location,this.Size).Contains(Cursor.Position)) this.Opacity = 1;
            else this.Opacity = 0.4;
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            CrossHair.Visible = SwitchXhairVisible.Checked;
        }
        //████████████████████████████████████████████████████████████ Hack Switches
        private void NoReloadSwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.ReloadValue = NoReloadSwitch.Checked ? 20 : 1;
        }

        private void SpeedKnifeSwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.KnifeAnimRatio = SpeedKnifeSwitch.Checked ? 1.5f : 1;
        }

        private void SpeedHackSwitch_CheckedChanged(object sender, EventArgs e)
        {
            SuperSpeedSwitch.Checked = false;
            Storage.SpeedHack = SpeedKnifeSwitch.Checked;
        }

        private void BioBossDamageSwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.BioModeBossDamage = BioBossDamageSwitch.Checked;
        }

        private void SpeedDefuseSwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.DefuseTime = SpeedKnifeSwitch.Checked ? 9 : 5;
        }

        private void CrounchSpeedSwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.CrounchSpeed = CrounchSpeedSwitch.Checked ? 1.1f : 0.38028f;
        }
        private void NoChangeDelaySwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.ChangeAnimRatio = NoChangeDelaySwitch.Checked ? 20 : 1;
        }

        private static string ByteToString(byte[] Array)
        {
            string Return = "";
            for (int i = 0; i < Array.Length; i++)
            {
                Return += Array[i].ToString() + " ";
            }
            return Return;
        }

        private void CreateAddyLogButton_Click(object sender, EventArgs e)
        {
            MenuForm.Console.Items.Add("Starting Address Logging");

            StreamWriter WriteFile = new StreamWriter(@"C:\AddyLog.txt");
            WriteFile.WriteLine("Rabir  Dimensional Beast v1");
            WriteFile.WriteLine(">> CrossFire Eu Addy Log <<");
            WriteFile.WriteLine();
            WriteFile.WriteLine(">>->-    WeaponMgr    -<-<<");

            MenuForm.Console.Items.Add("Logging WeaponMgr");
            WriteFile.WriteLine("WeaponMgr: 0x" + PatternScanner.DecToHex((int)PatternScanner.FindPattern(MainClass.CShell, 0xFFFFFF, new byte[] { 0x8B, 0x4F, 0x04, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x85, 0xC0, 0x8B, 0x51, 0x04, 0x8B, 0x6A, 0x04 }, "xxxx????xxxxxxxx" , 4)).ToString());
            
            MenuForm.Console.Items.Add("Logging CShellPointer");
            WriteFile.WriteLine("CShellPointer: 0x" + PatternScanner.DecToHex((int)PatternScanner.FindPattern2(MainClass.CShell, 0xFFFFFF, new byte[] { 0xc6, 0x01, 0x01, 0x8b, 0x15, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x82, 0x00, 0x00, 0x00, 0x00, 0x8B }, "xxxxx????xx????x", 5)).ToString());

            WriteFile.Close();
        }

        private void EnableFlySwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.IsFlyEnabled = EnableFlySwitch.Checked;
        }

        private void SuperSpeedSwitch_CheckedChanged(object sender, EventArgs e)
        {
            SpeedHackSwitch.Checked = false;
            Storage.SuperSpeed = SuperSpeedSwitch.Checked;
        }

        private void LiftOffSwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.IsLifting = LiftOffSwitch.Checked;
        }

        private unsafe void CreateFullWeaponLog_Click(object sender, EventArgs e)
        {
            StreamWriter WriteLog = new StreamWriter(@"C:\WeaponLog.txt");
            IntPtr pWeaponMgr = *(IntPtr*)(MainClass.GetModuleHandle("CShell.dll") + (int)Storage.Pointers.WeaponMgr);
            for (int i = 0; i < 999; i++)
            {
                if (pWeaponMgr != (IntPtr)0)
                {
                    IntPtr CurrentWeapon = *(IntPtr*)(pWeaponMgr + (4 * i));

                    if (CurrentWeapon != (IntPtr)0)
                    {
                        string WeaponName = "";
                        for (int k = 0; k < 14; k++)
                        {
                            WeaponName += *(char*)(CurrentWeapon + 0x8 + k);
                        }
                        WriteLog.WriteLine("############# Index: " + i.ToString() + " Name: " + WeaponName + " ##############")
                        WriteLog.WriteLine("WeaponClass: " + (*(byte*)(CurrentWeapon + 0x2)).ToString());
                        WriteLog.WriteLine("PairWeapon: " + (*(float*)(CurrentWeapon + 0x4)).ToString());
                        WriteLog.WriteLine("PairType: " + (*(byte*)(CurrentWeapon + 0x8)).ToString());
                        WriteLog.WriteLine("ReloadAnimRatio: " + (*(float*)(CurrentWeapon + 0xC3C)).ToString());
                        WriteLog.WriteLine("AIModeAmmoDamage: " + (*(float*)(CurrentWeapon + (int)Storage.Offsets.AIModeAmmoDamage)).ToString());
                        WriteLog.WriteLine("AIModeAmmoDamage: " + (*(float*)(CurrentWeapon + (int)Storage.Offsets.MoveSpeedPenalty)).ToString());
                        WriteLog.WriteLine("AmmoDamage: " + (*(float*)(CurrentWeapon + (int)Storage.Offsets.AmmoDamage)).ToString());
                        WriteLog.WriteLine("WeaponRange: " + (*(float*)(CurrentWeapon + (int)Storage.Offsets.WeaponRange)).ToString());
                        WriteLog.WriteLine("LeftClickAttribute: " + (*(byte*)(CurrentWeapon + (int)Storage.Offsets.LeftClickAttribute)).ToString());

                        //###################### EXPERIMENTAL #######################
                        //Zoom With All Weapon
                        WriteLog.WriteLine("RightClickAttribute: " + (*(int*)(CurrentWeapon + (int)Storage.Offsets.RightClickAttribute)).ToString());
                        WriteLog.WriteLine("ZoomAttribute: " + (*(int*)(CurrentWeapon + (int)Storage.Offsets.ZoomAttribute)).ToString());
                        for (int k = 0; k < 13; k++)
                        {
                            WriteLog.WriteLine("ZoomAction [" + k.ToString() + "]: " + (*(float*)(CurrentWeapon + (0x3918 + (k * 4)))).ToString());
                        }
                        WriteLog.WriteLine("HaveKnife: " + (*(byte*)(CurrentWeapon + 0x3C44)).ToString());
                        WriteLog.WriteLine("MoveSpeedPenalty: " + (*(float*)(CurrentWeapon + 0x20)).ToString());
                        WriteLog.WriteLine("CrossHairRatioPerRealSize: " + (*(float*)(CurrentWeapon + 0x3B8C)).ToString());
                        WriteLog.WriteLine("SubType: " + (*(byte*)(CurrentWeapon + 0x82C)).ToString());
                        WriteLog.WriteLine("ReloadSingleAmmo: " + (*(float*)(CurrentWeapon + 0x874)).ToString());
                        WriteLog.WriteLine("WeaponPrice: " + (*(int*)(CurrentWeapon + 0x86E)).ToString());
                        WriteLog.WriteLine("ShotsPerAmmo: " + (*(byte*)(CurrentWeapon + 0x86E)).ToString());

                    }//End if(CurrentWeapon)
                }//End If (pWeaponMgr)
            }//End For (int i = 0; i < 999; i++)
            WriteLog.Flush();
        }

        private void ScopeSwitch_CheckedChanged(object sender, EventArgs e)
        {
            Storage.IsScopeEnabled = ScopeSwitch.Checked;
        }
    }
}



 
MenuForm.Designer.cs


Code:

 
MenuForm.Designer.cs
Code:
namespace CodeTester
{
    partial class MenuForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.CheckCrossFireWindow = new System.Windows.Forms.Timer(this.components);
            this.CheckInsertKey = new System.Windows.Forms.Timer(this.components);
            this.SwitchXhairVisible = new System.Windows.Forms.CheckBox();
            this.NoReloadSwitch = new System.Windows.Forms.CheckBox();
            this.SpeedKnifeSwitch = new System.Windows.Forms.CheckBox();
            this.SpeedHackSwitch = new System.Windows.Forms.CheckBox();
            this.BioBossDamageSwitch = new System.Windows.Forms.CheckBox();
            this.NoNadeSwitch = new System.Windows.Forms.CheckBox();
            this.AntiAssassinNadeSwitch = new System.Windows.Forms.CheckBox();
            this.NoFlashSwitch = new System.Windows.Forms.CheckBox();
            this.NoChangeDelaySwitch = new System.Windows.Forms.CheckBox();
            this.SpeedDefuseSwitch = new System.Windows.Forms.CheckBox();
            this.CrounchSpeedSwitch = new System.Windows.Forms.CheckBox();
            this.SwwGhostSwitch = new System.Windows.Forms.CheckBox();
            this.CreateAddyLogButton = new System.Windows.Forms.Button();
            this.EnableFlySwitch = new System.Windows.Forms.CheckBox();
            this.SuperSpeedSwitch = new System.Windows.Forms.CheckBox();
            this.RepeatFireSwitch = new System.Windows.Forms.CheckBox();
            this.LiftOffSwitch = new System.Windows.Forms.CheckBox();
            this.CreateFullWeaponLog = new System.Windows.Forms.Button();
            this.ScopeSwitch = new System.Windows.Forms.CheckBox();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // CheckCrossFireWindow
            // 
            this.CheckCrossFireWindow.Enabled = true;
            this.CheckCrossFireWindow.Tick += new System.EventHandler(this.CheckCrossFireWindow_Tick);
            // 
            // CheckInsertKey
            // 
            this.CheckInsertKey.Enabled = true;
            this.CheckInsertKey.Interval = 10;
            this.CheckInsertKey.Tick += new System.EventHandler(this.CheckInsertKey_Tick);
            // 
            // SwitchXhairVisible
            // 
            this.SwitchXhairVisible.AutoSize = true;
            this.SwitchXhairVisible.Checked = true;
            this.SwitchXhairVisible.CheckState = System.Windows.Forms.CheckState.Checked;
            this.SwitchXhairVisible.Location = new System.Drawing.Point(12, 38);
            this.SwitchXhairVisible.Name = "SwitchXhairVisible";
            this.SwitchXhairVisible.Size = new System.Drawing.Size(96, 17);
            this.SwitchXhairVisible.TabIndex = 0;
            this.SwitchXhairVisible.Text = "ShowCrosshair";
            this.SwitchXhairVisible.UseVisualStyleBackColor = true;
            this.SwitchXhairVisible.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
            // 
            // NoReloadSwitch
            // 
            this.NoReloadSwitch.AutoSize = true;
            this.NoReloadSwitch.Location = new System.Drawing.Point(12, 61);
            this.NoReloadSwitch.Name = "NoReloadSwitch";
            this.NoReloadSwitch.Size = new System.Drawing.Size(94, 17);
            this.NoReloadSwitch.TabIndex = 2;
            this.NoReloadSwitch.Text = "No Reload [D]";
            this.NoReloadSwitch.UseVisualStyleBackColor = true;
            this.NoReloadSwitch.CheckedChanged += new System.EventHandler(this.NoReloadSwitch_CheckedChanged);
            // 
            // SpeedKnifeSwitch
            // 
            this.SpeedKnifeSwitch.AutoSize = true;
            this.SpeedKnifeSwitch.Location = new System.Drawing.Point(12, 85);
            this.SpeedKnifeSwitch.Name = "SpeedKnifeSwitch";
            this.SpeedKnifeSwitch.Size = new System.Drawing.Size(82, 17);
            this.SpeedKnifeSwitch.TabIndex = 3;
            this.SpeedKnifeSwitch.Text = "Faster Knife";
            this.SpeedKnifeSwitch.UseVisualStyleBackColor = true;
            this.SpeedKnifeSwitch.CheckedChanged += new System.EventHandler(this.SpeedKnifeSwitch_CheckedChanged);
            // 
            // SpeedHackSwitch
            // 
            this.SpeedHackSwitch.AutoSize = true;
            this.SpeedHackSwitch.Location = new System.Drawing.Point(13, 180);
            this.SpeedHackSwitch.Name = "SpeedHackSwitch";
            this.SpeedHackSwitch.Size = new System.Drawing.Size(86, 17);
            this.SpeedHackSwitch.TabIndex = 4;
            this.SpeedHackSwitch.Text = "Speed Hack";
            this.SpeedHackSwitch.UseVisualStyleBackColor = true;
            this.SpeedHackSwitch.CheckedChanged += new System.EventHandler(this.SpeedHackSwitch_CheckedChanged);
            // 
            // BioBossDamageSwitch
            // 
            this.BioBossDamageSwitch.AutoSize = true;
            this.BioBossDamageSwitch.Location = new System.Drawing.Point(12, 133);
            this.BioBossDamageSwitch.Name = "BioBossDamageSwitch";
            this.BioBossDamageSwitch.Size = new System.Drawing.Size(93, 17);
            this.BioBossDamageSwitch.TabIndex = 5;
            this.BioBossDamageSwitch.Text = "Bio Mode 1Hit";
            this.BioBossDamageSwitch.UseVisualStyleBackColor = true;
            this.BioBossDamageSwitch.CheckedChanged += new System.EventHandler(this.BioBossDamageSwitch_CheckedChanged);
            // 
            // NoNadeSwitch
            // 
            this.NoNadeSwitch.AutoSize = true;
            this.NoNadeSwitch.Checked = true;
            this.NoNadeSwitch.CheckState = System.Windows.Forms.CheckState.Checked;
            this.NoNadeSwitch.Enabled = false;
            this.NoNadeSwitch.Location = new System.Drawing.Point(133, 38);
            this.NoNadeSwitch.Name = "NoNadeSwitch";
            this.NoNadeSwitch.Size = new System.Drawing.Size(112, 17);
            this.NoNadeSwitch.TabIndex = 6;
            this.NoNadeSwitch.Text = "No Nade Damage";
            this.NoNadeSwitch.UseVisualStyleBackColor = true;
            // 
            // AntiAssassinNadeSwitch
            // 
            this.AntiAssassinNadeSwitch.AutoSize = true;
            this.AntiAssassinNadeSwitch.Checked = true;
            this.AntiAssassinNadeSwitch.CheckState = System.Windows.Forms.CheckState.Checked;
            this.AntiAssassinNadeSwitch.Enabled = false;
            this.AntiAssassinNadeSwitch.Location = new System.Drawing.Point(133, 61);
            this.AntiAssassinNadeSwitch.Name = "AntiAssassinNadeSwitch";
            this.AntiAssassinNadeSwitch.Size = new System.Drawing.Size(117, 17);
            this.AntiAssassinNadeSwitch.TabIndex = 6;
            this.AntiAssassinNadeSwitch.Text = "Anti Assassin Nade";
            this.AntiAssassinNadeSwitch.UseVisualStyleBackColor = true;
            // 
            // NoFlashSwitch
            // 
            this.NoFlashSwitch.AutoSize = true;
            this.NoFlashSwitch.Checked = true;
            this.NoFlashSwitch.CheckState = System.Windows.Forms.CheckState.Checked;
            this.NoFlashSwitch.Enabled = false;
            this.NoFlashSwitch.Location = new System.Drawing.Point(133, 84);
            this.NoFlashSwitch.Name = "NoFlashSwitch";
            this.NoFlashSwitch.Size = new System.Drawing.Size(68, 17);
            this.NoFlashSwitch.TabIndex = 6;
            this.NoFlashSwitch.Text = "No Flash";
            this.NoFlashSwitch.UseVisualStyleBackColor = true;
            // 
            // NoChangeDelaySwitch
            // 
            this.NoChangeDelaySwitch.AutoSize = true;
            this.NoChangeDelaySwitch.Location = new System.Drawing.Point(12, 201);
            this.NoChangeDelaySwitch.Name = "NoChangeDelaySwitch";
            this.NoChangeDelaySwitch.Size = new System.Drawing.Size(127, 17);
            this.NoChangeDelaySwitch.TabIndex = 6;
            this.NoChangeDelaySwitch.Text = "No Change Delay [D]";
            this.NoChangeDelaySwitch.UseVisualStyleBackColor = true;
            this.NoChangeDelaySwitch.CheckedChanged += new System.EventHandler(this.NoChangeDelaySwitch_CheckedChanged);
            // 
            // SpeedDefuseSwitch
            // 
            this.SpeedDefuseSwitch.AutoSize = true;
            this.SpeedDefuseSwitch.Location = new System.Drawing.Point(13, 157);
            this.SpeedDefuseSwitch.Name = "SpeedDefuseSwitch";
            this.SpeedDefuseSwitch.Size = new System.Drawing.Size(94, 17);
            this.SpeedDefuseSwitch.TabIndex = 7;
            this.SpeedDefuseSwitch.Text = "Speed Defuse";
            this.SpeedDefuseSwitch.UseVisualStyleBackColor = true;
            this.SpeedDefuseSwitch.CheckedChanged += new System.EventHandler(this.SpeedDefuseSwitch_CheckedChanged);
            // 
            // CrounchSpeedSwitch
            // 
            this.CrounchSpeedSwitch.AutoSize = true;
            this.CrounchSpeedSwitch.Location = new System.Drawing.Point(12, 109);
            this.CrounchSpeedSwitch.Name = "CrounchSpeedSwitch";
            this.CrounchSpeedSwitch.Size = new System.Drawing.Size(100, 17);
            this.CrounchSpeedSwitch.TabIndex = 8;
            this.CrounchSpeedSwitch.Text = "Crounch Speed";
            this.CrounchSpeedSwitch.UseVisualStyleBackColor = true;
            this.CrounchSpeedSwitch.CheckedChanged += new System.EventHandler(this.CrounchSpeedSwitch_CheckedChanged);
            // 
            // SwwGhostSwitch
            // 
            this.SwwGhostSwitch.AutoSize = true;
            this.SwwGhostSwitch.Checked = true;
            this.SwwGhostSwitch.CheckState = System.Windows.Forms.CheckState.Checked;
            this.SwwGhostSwitch.Enabled = false;
            this.SwwGhostSwitch.Location = new System.Drawing.Point(133, 109);
            this.SwwGhostSwitch.Name = "SwwGhostSwitch";
            this.SwwGhostSwitch.Size = new System.Drawing.Size(136, 17);
            this.SwwGhostSwitch.TabIndex = 6;
            this.SwwGhostSwitch.Text = "See Ghost (Only Move)";
            this.SwwGhostSwitch.UseVisualStyleBackColor = true;
            // 
            // CreateAddyLogButton
            // 
            this.CreateAddyLogButton.Location = new System.Drawing.Point(12, 251);
            this.CreateAddyLogButton.Name = "CreateAddyLogButton";
            this.CreateAddyLogButton.Size = new System.Drawing.Size(119, 23);
            this.CreateAddyLogButton.TabIndex = 10;
            this.CreateAddyLogButton.Text = "Create Addy Log";
            this.CreateAddyLogButton.UseVisualStyleBackColor = true;
            this.CreateAddyLogButton.Click += new System.EventHandler(this.CreateAddyLogButton_Click);
            // 
            // EnableFlySwitch
            // 
            this.EnableFlySwitch.AutoSize = true;
            this.EnableFlySwitch.Location = new System.Drawing.Point(133, 155);
            this.EnableFlySwitch.Name = "EnableFlySwitch";
            this.EnableFlySwitch.Size = new System.Drawing.Size(151, 17);
            this.EnableFlySwitch.TabIndex = 11;
            this.EnableFlySwitch.Text = "Enable Walk In Air (E Key)";
            this.EnableFlySwitch.UseVisualStyleBackColor = true;
            this.EnableFlySwitch.CheckedChanged += new System.EventHandler(this.EnableFlySwitch_CheckedChanged);
            // 
            // SuperSpeedSwitch
            // 
            this.SuperSpeedSwitch.AutoSize = true;
            this.SuperSpeedSwitch.Location = new System.Drawing.Point(133, 178);
            this.SuperSpeedSwitch.Name = "SuperSpeedSwitch";
            this.SuperSpeedSwitch.Size = new System.Drawing.Size(88, 17);
            this.SuperSpeedSwitch.TabIndex = 12;
            this.SuperSpeedSwitch.Text = "Super Speed";
            this.SuperSpeedSwitch.UseVisualStyleBackColor = true;
            this.SuperSpeedSwitch.CheckedChanged += new System.EventHandler(this.SuperSpeedSwitch_CheckedChanged);
            // 
            // RepeatFireSwitch
            // 
            this.RepeatFireSwitch.AutoSize = true;
            this.RepeatFireSwitch.Checked = true;
            this.RepeatFireSwitch.CheckState = System.Windows.Forms.CheckState.Checked;
            this.RepeatFireSwitch.Enabled = false;
            this.RepeatFireSwitch.Location = new System.Drawing.Point(133, 132);
            this.RepeatFireSwitch.Name = "RepeatFireSwitch";
            this.RepeatFireSwitch.Size = new System.Drawing.Size(81, 17);
            this.RepeatFireSwitch.TabIndex = 6;
            this.RepeatFireSwitch.Text = "Repeat Fire";
            this.RepeatFireSwitch.UseVisualStyleBackColor = true;
            // 
            // LiftOffSwitch
            // 
            this.LiftOffSwitch.AutoSize = true;
            this.LiftOffSwitch.Location = new System.Drawing.Point(12, 224);
            this.LiftOffSwitch.Name = "LiftOffSwitch";
            this.LiftOffSwitch.Size = new System.Drawing.Size(57, 17);
            this.LiftOffSwitch.TabIndex = 6;
            this.LiftOffSwitch.Text = "Lift Off";
            this.LiftOffSwitch.UseVisualStyleBackColor = true;
            this.LiftOffSwitch.CheckedChanged += new System.EventHandler(this.LiftOffSwitch_CheckedChanged);
            // 
            // CreateFullWeaponLog
            // 
            this.CreateFullWeaponLog.Location = new System.Drawing.Point(137, 251);
            this.CreateFullWeaponLog.Name = "CreateFullWeaponLog";
            this.CreateFullWeaponLog.Size = new System.Drawing.Size(113, 23);
            this.CreateFullWeaponLog.TabIndex = 13;
            this.CreateFullWeaponLog.Text = "Create Weapon Log";
            this.CreateFullWeaponLog.UseVisualStyleBackColor = true;
            this.CreateFullWeaponLog.Click += new System.EventHandler(this.CreateFullWeaponLog_Click);
            // 
            // ScopeSwitch
            // 
            this.ScopeSwitch.AutoSize = true;
            this.ScopeSwitch.Location = new System.Drawing.Point(133, 201);
            this.ScopeSwitch.Name = "ScopeSwitch";
            this.ScopeSwitch.Size = new System.Drawing.Size(115, 17);
            this.ScopeSwitch.TabIndex = 14;
            this.ScopeSwitch.Text = "All Weapon Scope";
            this.ScopeSwitch.UseVisualStyleBackColor = true;
            this.ScopeSwitch.CheckedChanged += new System.EventHandler(this.ScopeSwitch_CheckedChanged);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
            this.label1.Location = new System.Drawing.Point(38, 9);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(207, 20);
            this.label1.TabIndex = 15;
            this.label1.Text = "Rabir Dimensional Beast";
            // 
            // MenuForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ActiveCaption;
            this.ClientSize = new System.Drawing.Size(293, 439);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.ScopeSwitch);
            this.Controls.Add(this.CreateFullWeaponLog);
            this.Controls.Add(this.SuperSpeedSwitch);
            this.Controls.Add(this.EnableFlySwitch);
            this.Controls.Add(this.CreateAddyLogButton);
            this.Controls.Add(this.CrounchSpeedSwitch);
            this.Controls.Add(this.SpeedDefuseSwitch);
            this.Controls.Add(this.RepeatFireSwitch);
            this.Controls.Add(this.SwwGhostSwitch);
            this.Controls.Add(this.LiftOffSwitch);
            this.Controls.Add(this.NoChangeDelaySwitch);
            this.Controls.Add(this.NoFlashSwitch);
            this.Controls.Add(this.AntiAssassinNadeSwitch);
            this.Controls.Add(this.NoNadeSwitch);
            this.Controls.Add(this.BioBossDamageSwitch);
            this.Controls.Add(this.SpeedHackSwitch);
            this.Controls.Add(this.SpeedKnifeSwitch);
            this.Controls.Add(this.NoReloadSwitch);
            this.Controls.Add(this.SwitchXhairVisible);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name = "MenuForm";
            this.Text = "MenuForm";
            this.Load += new System.EventHandler(this.MenuForm_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Timer CheckCrossFireWindow;
        private System.Windows.Forms.Timer CheckInsertKey;
        private System.Windows.Forms.CheckBox SwitchXhairVisible;
        private System.Windows.Forms.CheckBox NoReloadSwitch;
        private System.Windows.Forms.CheckBox SpeedKnifeSwitch;
        private System.Windows.Forms.CheckBox SpeedHackSwitch;
        private System.Windows.Forms.CheckBox BioBossDamageSwitch;
        private System.Windows.Forms.CheckBox NoNadeSwitch;
        private System.Windows.Forms.CheckBox AntiAssassinNadeSwitch;
        private System.Windows.Forms.CheckBox NoFlashSwitch;
        private System.Windows.Forms.CheckBox NoChangeDelaySwitch;
        private System.Windows.Forms.CheckBox SpeedDefuseSwitch;
        private System.Windows.Forms.CheckBox CrounchSpeedSwitch;
        private System.Windows.Forms.CheckBox SwwGhostSwitch;
        private System.Windows.Forms.Button CreateAddyLogButton;
        private System.Windows.Forms.CheckBox EnableFlySwitch;
        private System.Windows.Forms.CheckBox SuperSpeedSwitch;
        private System.Windows.Forms.CheckBox RepeatFireSwitch;
        private System.Windows.Forms.CheckBox LiftOffSwitch;
        private System.Windows.Forms.Button CreateFullWeaponLog;
        private System.Windows.Forms.CheckBox ScopeSwitch;
        private System.Windows.Forms.Label label1;
    }
}



Also, i use Another Window form for the CrossHair:
 
Xhair.cs

Code:

 
Xhair.cs
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace CodeTester
{
    public partial class Xhair : Form
    {
        [DllImport("user32.dll", SetLastError = true)]
        static extern int GetWindowLong(IntPtr hWnd, int nIndex);

        [DllImport("user32.dll")]
        static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

        public const int WM_NCHITTEST = 0x84;
        public const int HTTRANSPARENT = -1;

        public Xhair()
        {
            InitializeComponent();
        }

        private void Xhair_Load(object sender, EventArgs e)
        {
            this.Size = new Size(20, 20);
            this.TopMost = true;
            this.TopLevel = true;
            this.ShowInTaskbar = false;
            this.BackColor = this.TransparencyKey = Color.Bisque;

            int initialStyle = GetWindowLong(this.Handle, -20);
            SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20);
        }

        private void Xhair_Paint(object sender, PaintEventArgs e)
        {
            Pen DrawXhair = new Pen(Color.Red, 2);
            e.Graphics.DrawLine(DrawXhair, this.Width / 2 - 10, this.Height / 2, this.Width / 2 + 10, this.Height / 2);
            e.Graphics.DrawLine(DrawXhair, this.Width / 2, this.Height / 2 - 10, this.Width / 2, this.Height / 2 + 10);
        }
    }
}



 
Xhair.Designer.cs

Code:

 
Xhair.Designer.cs
Code:
namespace CodeTester
{
    partial class Xhair
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.SuspendLayout();
            // 
            // Xhair
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(26, 23);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name = "Xhair";
            this.Text = "Xhair";
            this.Load += new System.EventHandler(this.Xhair_Load);
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Xhair_Paint);
            this.ResumeLayout(false);

        }

        #endregion
    }
}



So, i like to organize my codes, so i use another class to store stuffs:
 
Storage.cs

Code:

 
Storage.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CodeTester
{
    class Storage
    {
        //Hack Storage
        public static float ReloadValue = 1;
        public static float KnifeAnimRatio = 1;
        public static float DefuseTime = 9;
        public static float CrounchSpeed = 0.38028f;
        public static float SeeGhost = 0.7f;
        public static float ChangeAnimRatio = 1;

        public static float PlayerPtrNoRecoil1 = -1;
        public static float PlayerPtrNoRecoil2 = 10000000;
        public static float PlayerPtrNoRecoil3 = 10000000;

        //Official Values
        public static float[] MovementSpeed = new float[1000];
        public static float[] WeaponBioDamage = new float[1000];
        public static float[][] ScopeAttributes = new float[999][];
        public static int[] RightClickAttribute = new int[1000];
        public static int[] ZoomMode = new int[1000];

        //Remiders
        public static bool IsWeaponsLogged = false;
        public static bool BioModeBossDamage = false;
        public static bool SpeedHack = false;
        public static bool IsBypassDone = false;
        public static bool IsFlyEnabled = false;
        public static bool SuperSpeed = false;
        public static bool IsLifting = false;
        public static bool IsScopeEnabled = false;

        public static bool SingleTest = false;

        //Pointers
        public enum Pointers
        {
            PlayerPointer = 0x4D9378,
            PlayerPtr = 0x4D93CC,
            WeaponMgr = 0xE36A2C,
            BasicPlayerInfo = 0xDCF760,
            WallMgr = 0xE36A14,
            PTC_OFFSET = 0x200,
            PTC = 0x4CB19C,
            CShell = 0x905A4D,
            CShell_Pointer = 0x4CB1A8,
            CShell_Player = 0x54,
            //CShell_Client = 0xT,
            PlayerClient = 0x8A2B1FC,
            Send2Server = 0x60C4B0,
            WallArrary = 0x45B764,
            ByPass = 0x33FF95,

            DamageZone = 0x45B1DC,
            VisibleZoneIndex = 0x45B140,
            DamagePerSec = 0x45B1CC,

            FallDamage = 0xE36A0C,

            WallHack = 0x7149CC
        }
        public enum Offsets
        {
            //*************************************************WeaponMgr
            //Reload
            ReloadAnimRatio = 0xC3C,

            //No Recoil
            DetailPerturbShot = 0x11CC,
            DetailReactYawShot = 0x1064,
            DetailReactPitchShot = 0xEFC,
            ShotReactPitch = 0x370C,
            ShotReactYaw = 0x3710,
            BulletPosOffset = 0x352C,
            PerturbMin = 0x540,
            PerturbMax = 0x6A8,

            //Speed Knife
            KnifeNormalAniRate = 0xA74,
            KnifeBigshotAniRate = 0xA98,
            KnifeNormalAniRate2 = 0xABC,
            KnifeBigshotAniRate2 = 0xAE0,

            //Knife 360
            KnifeNormalAngle = 0xA64,
            KnifeBigshotAngle = 0xA88,
            KnifeNormalAngle2 = 0xAA4,
            KnifeBigshotAngle2 = 0xAC8,

            //LongKnife
            KnifeNormalRange = 0xA58,
            KnifeNormalRange2 = 0xA98,
            KnifeBigshotRange = 0xA7C,
            KnifeBigshotRange2 = 0xABC,

            //Knife 1Hit
            KnifeNormalAmmoDamage = 0xC00,
            KnifeBigshotAmmoDamage = 0xC0C,
            KnifeNormalAmmoDamage2 = 0xC18,
            KnifeBigshotAmmoDamage2 = 0xC24,

            //Bio Mode Damage
            AIModeAmmoDamage = 0x4,

            //No Change Delay
            ChangeWeaponAnimRatio = 0xC40,

            //Speed Hack
            MoveSpeedPenalty = 0x20,

            //Damage Hacks
            AmmoDamage = 0x81C,

            //Weapon Range Hacks (Inf Range, No Flash, Anti-Assassin Grenade)
            WeaponRange = 0x80C,

            //KnockBack
            Knockback,

            //RepeatFire
            LeftClickAttribute = 0xAEC,

            //Tesztelés Alatt
            RightClickAttribute = 0xAF0,
            ZoomAttribute = 0xAF4,

            //################# BETA ###############
            PlayerPointer_NoReload = 0x2F8,
            PlayerPointer_NoChangeDelay = 0x2F8,
            PlayerPointer_NoRecoil1 = 0x22E,
            PlayerPointer_NoRecoil2 = 0xC,
            PlayerPointer_NoRecoil3 = 0x234,


            //*************************************** BasicPlayerInfo
            //############### BETA ####################

            MovementHiddenRate = 0x94,

            InvisbleAsGhost = 0x1B0,

            //No Gatling Slow Mo
            MoveInDelayFire = 0x394C,
            //Fast Defuse
            C4DefuseTime = 0x80,
            //CrounchSpeed
            MovementDuckWalkRate = 0xC,
            //See Ghost (Memory)
            CharacterHiddenAlpha = 0x88,
            CharacterHiddenWalkAlpha = 0x8C,
            CharacterHiddenRunAlpha = 0x90,
            //*************************************** PlayerPointer
            FlyOffset = 0x5F0
        }

        public enum WeaponType
        {
            Grenade,
            MachineGun,
            SubMachineGun,
            AssaultRifle,
            SniperRifle,
            Pistol,
            Shotgun,
            Meele,
            Hypomed,
            UnKnown
        }

        public static WeaponType GetWeaponType(int i /*Weapon Index*/)
        {
            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.SniperRifle;

            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 == 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.SubMachineGun;

            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.AssaultRifle;

            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.MachineGun;

            if (i == 328 || i == 348)
                return WeaponType.Hypomed;

            return WeaponType.UnKnown;
        }


    }
}




In the MenuForm, you can see a PatternScanner... This is a very raw, and rapid-made patternscanner:
 
PatternScanner.cs

Code:

 
PatternScanner.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.Reflection;

namespace CodeTester
{
    class PatternScanner
    {
        private static unsafe IntPtr ScanPattern(IntPtr StartAddress, int Length, byte[] Pattern, string Mask)
        {
            IntPtr FinalAddy = (IntPtr)0;
            byte[] Dump = new byte[Length];

            //Create a Dump of the process
            for (int i = 0; i < Length; i++)
            {
                Dump[i] = *(byte*)(StartAddress + i);
            }

            //Scan for the pattern
            for (int i = 0; i < Length - Pattern.Length; i++)
            {
                bool Found = true;
                for (int k = 0; k < Pattern.Length; k++)
                {

                    Found = Found && ((Dump[i + k] == Pattern[k]) && (Mask[k] == 'x')) || (Mask[k] == '?');
                }
                if (Found)
                {
                    Dump = new byte[0]; //Free Up the Dump Memory
                    return (IntPtr)(StartAddress + i); //Return the specified Address
                }
            }
            Dump = new byte[0]; //Free Up the Dump Memory
            return (IntPtr)0; //Pattern not found, return 0
        }

        public static unsafe IntPtr FindPattern(IntPtr StartAddress, int Length, byte[] BytePattern, string Mask, int Plus)
        {
            IntPtr pointer = PatternScanner.ScanPattern(StartAddress, Length, BytePattern, Mask);
            return *(IntPtr*)(pointer + Plus) - (int)MainClass.CShell;
        }

        public static unsafe IntPtr FindPattern2(IntPtr StartAddress, int Length, byte[] BytePattern, string Mask, int Plus)
        {
            IntPtr pointer = PatternScanner.ScanPattern(StartAddress, Length, BytePattern, Mask);
            return *(IntPtr*)(pointer + Plus);
        }

        public static string DecToHex(int Dec)
        {
            return Dec.ToString("X");
        }
    }
}




The ByPass is very unfinished, and i don't really think that my code is correct, but here it is, maybe one of you can do something with it:
 
ByPass.cs


Code:

 
ByPass.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace CodeTester
{
    class ByPass
    {
        /*
         * C# WeaponMgr Bypass
         * Converter: Rabir
         * */

        [DllImport("kernel32.dll")]
        static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize, uint flNewProtect, out uint lpflOldProtect);

        //BETA idea for WeaponMgrCopy data type
        public static byte[][] TestData = new byte[999][];

        public static unsafe void BackUp(IntPtr CShell, IntPtr WeaponMgr)
        {
            IntPtr pWeaponMgr = *(IntPtr*)(CShell + (int)WeaponMgr);

            for (int i = 0; i < 999; i++)
            {
                IntPtr CurrentWeapon = *(IntPtr*)(pWeaponMgr + (4 * i));
                if (CurrentWeapon != (IntPtr)0)
                {
                    TestData[i] = new byte[0x3000];
                    fixed (byte* LoL = &TestData[i][0])
                    {
                        SharpMemCpy((IntPtr)(LoL), CurrentWeapon, 0x1400);
                    }
                }
            }
        }
        
        public static unsafe IntPtr Bypass(int GunIndexNR)
        {
            fixed (byte* LoL = &TestData[GunIndexNR][0])
            {
                return (IntPtr)(LoL);
            }
        }


        public static unsafe void MakeCall(IntPtr pAddress, IntPtr YourFunction, int Length)
        {
            IntPtr dwRelAddr;
            uint dwOldProtect, dwBkup;

            VirtualProtect(pAddress, (uint)Length, 0x40, out dwOldProtect);

            dwRelAddr = (IntPtr)(YourFunction - (int)pAddress) - 5;

            //*paddress = 0xE8;
            IntPtr* pAddressPointer = &pAddress;
            *pAddressPointer = (IntPtr)0xE8;

            *((IntPtr*)(pAddress + 0x1)) = dwRelAddr;

            for (int x = 0x5; x < Length; x++)
            {
                *(byte*)(pAddress + x) = 0x90;
            }
            VirtualProtect(pAddress, (uint)Length, dwOldProtect, out dwBkup);

            return;
        }

        //##################################################################################
        public static unsafe void SharpMemCpy(IntPtr Destination, IntPtr Source, int Length)
        {
            for (int i = 0; i < Length; i++)
            {
                *(byte*)(Destination + i) = *(byte*)(Source + i);
            }
        }
    }
}





That should be all... A C# doder will know what to do, a leecher will just copy it...

The CLR Injector:
-As i said, its @Jason 's project
-Open it up, type in the process...
-Open you Hack Dll
-And then the Bootstrap.Dll (included in archive)
-Type in the NameSpace which contains the class which contains the DllMain (For leechers, its: "CodeTester")
-Type in the Class Name which contains the DllMain (for leechers, its: "MainClass")
-Enable "Auto Inject" and "Close After Injection"

Start the desired game / program...

Scans for CLR Injector:
http://virusscan.jotti.org/en/scanre...aa17ab541c2b73

https://www.virustotal.com/hu/file/7...is/1369649614/



CLRInjector_mpgh.net.rar13 KB · 200 downloads Scanning…
DWORD isn't always the same size as an IntPtr by the way.

An IntPtr is essentially just a managed struct with a single "void*" member. Its size is architecture dependent (and can be checked through the Size static property). When deployed as a x86 application or as AnyCPU in a x86 environment, IntPtr.Size == 4, however when compiled as x64 or AnyCPU in a x64 environment, IntPtr.Size == 8.

On the other hand, VC++'s "DWORD" is actually just a typedef for C++'s "unsigned long" data type (not to be confused with C#'s ulong data type!). On all modern Windows systems (as far as I know) the size of a long is guaranteed to be 32-bits (4 bytes). This means the corresponding C# data type should really be a UInt32, or uint for short.

When interoping between managed and unmanaged code, you should usually use IntPtr (or ref/out where appropriate) for arguments that are of a pointer type (HANDLE,PVOID,HMODULE,PBYTE...etc), but for DWORD/WORD/BYTE you should be using other C# types (uint/ushort/byte).

My old CLR bootstrapping code is so messy haha
Quote Originally Posted by Jason View Post
DWORD isn't always the same size as an IntPtr by the way.

An IntPtr is essentially just a managed struct with a single "void*" member. Its size is architecture dependent (and can be checked through the Size static property). When deployed as a x86 application or as AnyCPU in a x86 environment, IntPtr.Size == 4, however when compiled as x64 or AnyCPU in a x64 environment, IntPtr.Size == 8.

On the other hand, VC++'s "DWORD" is actually just a typedef for C++'s "unsigned long" data type (not to be confused with C#'s ulong data type!). On all modern Windows systems (as far as I know) the size of a long is guaranteed to be 32-bits (4 bytes). This means the corresponding C# data type should really be a UInt32, or uint for short.

When interoping between managed and unmanaged code, you should usually use IntPtr (or ref/out where appropriate) for arguments that are of a pointer type (HANDLE,PVOID,HMODULE,PBYTE...etc), but for DWORD/WORD/BYTE you should be using other C# types (uint/ushort/byte).

My old CLR bootstrapping code is so messy haha
Ohhmm.. I didn't counted with it...
I have x64 system, but my VS build it to X86 so i didn't had any confusion with this...

Your CLR Injector works well, the method which tried to find DllMain was really "bad"...
Only found it a couple of times, so i replaced it with manual way...
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?