PDA

View Full Version : [Crysis 3 beta] NameTag Hack + Source



distiny
February 8th, 2013, 01:28 AM
Simple nametag hack:

http://distiny.eu/screenshots/2013-02-08_00-26-41.jpg

source is in C#


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace crysis_3_beta_nametag_hack
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}


[DllImport("kernel32.dll")]
private static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll")]
private static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesRead);
[DllImport("kernel32.dll")]
private static extern Int32 WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesWritten);
public void WriteString(int Address, string Text)
{
byte[] Buffer = new ASCIIEncoding().GetBytes(Text);
IntPtr Zero = IntPtr.Zero;
Convert.ToByte(10);
WriteProcessMemory(Open_Memory(), (IntPtr)Address, Buffer, (UInt32)25, out Zero);
}
private uint ReadInt(uint Addr)
{
byte[] buffer = new byte[4];
IntPtr R;
ReadProcessMemory(Open_Memory(), (IntPtr)Addr, buffer, 4, out R);
return BitConverter.ToUInt32(buffer, 0);
}
private IntPtr Open_Memory()
{
if (Process.GetProcessesByName("Crysis 3 MP Open Beta").Length != 0)
{
return OpenProcess(0x1F0FFF, true, Process.GetProcessesByName("Crysis 3 MP Open Beta")[0].Id);
}
else return (IntPtr)0x0;
}
private uint BaseAddress(string Module_Name)
{
if (Process.GetProcessesByName("Crysis 3 MP Open Beta").Length != 0)
{
foreach (ProcessModule Mod in Process.GetProcessesByName("Crysis 3 MP Open Beta")[0].Modules)
{
if (Mod.ModuleName == Module_Name)
return (uint)Mod.BaseAddress.ToInt32();
}
return 0;
}
else return 0;
}


public void WriteBytes(uint Address, byte[] Bytes)
{
IntPtr Zero = IntPtr.Zero;
WriteProcessMemory(Open_Memory(), (IntPtr)Address, Bytes, (uint)Bytes.Length, out Zero);
}


private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{

//here's the magic :)

byte[] nametagbyteson = new byte[] { 0xFF, 0xB3, 0x01 };


uint base_address = BaseAddress("Crysis 3 MP Open Beta.exe"); //"Crysis 3 MP Open Beta.exe"+D1C678:
base_address = base_address + 0xD1C678;

WriteBytes(base_address, nametagbyteson); //enable hack
label1.Text = "NameTags Enabled";
label1.ForeColor = System.Drawing.Color.Green;


}
}
}

so if you purely want to copy paste just create a button and a label as in the screenshot