• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sipping
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Page 1 of 3 123 LastLast
    Results 1 to 10 of 25
    1. #1
      Jr.Coder
      <3 D3D
       
      Coding
       
      gnuzim's Avatar
      Join Date
      Nov 2012
      Posts
      67
      Thanks (-->)
      43
      Thanks (<--)
      28

      Unhappy [C#] Help Unlimited Ammo

      How to Manual Map DLL
      Hey guys, i'm trying to make a trainer using C#, i've followed fleep's tutorial but i'm having a small problem with multiple pointers!
      Since the tutorial is for another game, i'm doing one for assault cube and trying to understand those things, i could get Health HACK to work but my AmmoHack isn't.

      I'm stuck !

      Code:
      bool UnlimitedAmmo = false;
      int[] AmmoOffset = { 0x0, 0x14, 0x378 };
      int AmmoToFill = 20;
      
      if (UnlimitedAmmo)
      {
      int pointerAddress = HexToDec(globalPointer);
      int bytesWritten;
      byte[] valueToWrite = BitConverter.GetBytes(AmmoToFill); //convert AmmoFils to Bytes
      string writtenAddress = myMemory.PointerWrite((IntPtr)pointerAddress, //Static address
                                                                          valueToWrite, //attribute value
                                                                          AmmoOffset, //Offsets 
                                                                          out bytesWritten);
      }
      Attached Files Attached Files
      Last edited by gnuzim; 05-04-2013 at 12:35 AM.

    2. #2
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      646
      Thanks (-->)
      111
      Thanks (<--)
      228
      There doesn't appear to be anything wrong with your code by just glancing over it quickly. Do you ever set UnlimitedAmmo to true? Also, what is globalPointer? Is it something along the lines of: myProcess[0].MainModule.BaseAddress.ToInt32() + 0x00000000; ?

      Crazywink

    3. Thanks gnuzim thanked for this post
    4. #3
      Jr.Coder
      <3 D3D
       
      Coding
       
      gnuzim's Avatar
      Join Date
      Nov 2012
      Posts
      67
      Thanks (-->)
      43
      Thanks (<--)
      28
      Ah, sorry, that globalPointer is the memory address which is the same for Ammo and Health, just changing offsets!
      Yes, i have a button that activate Ammo and Health separately, Health is working fine, if i change the ammo offsets to health offsets it works as health, and i can't understand why ammo doesn't work, when i set manually the address using CE it works!

      I'm following Fleeps tutorial "How to Make a TRAINER C#" and using external files that he provided, Memory.cs, which contains all this ProcessMemory thing you said!

      Health HACK is working nicely, my problem is the Ammo HACK!
      Can it be wrong pointers? Health doesn't have multiple pointers

      Thanks for helping
      Last edited by gnuzim; 05-03-2013 at 09:05 PM.

    5. #4
      Learning to hack games!
       
      Feeling Normal
       

      Join Date
      Jan 1970
      Posts
      0
      Thanks (-->)
      294
      Thanks (<--)
      328
      Hello gnuzim,

      Could you maybe post your full source so we're able to get a better look at your problem.


      ~ Magnificient

    6. Thanks gnuzim thanked for this post
    7. #5
      Jr.Coder
      <3 D3D
       
      Coding
       
      gnuzim's Avatar
      Join Date
      Nov 2012
      Posts
      67
      Thanks (-->)
      43
      Thanks (<--)
      28
      Ok

      Form1.cs
      [HTML]
      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.Diagnostics;
      using System.Runtime.InteropServices;
      using System.Globalization;
      using System.Threading;

      namespace CubeTrainer
      {
      public partial class Form1 : Form
      {
      #region Global variables
      Memory myMemory = new Memory();
      Process[] myProcess;
      bool isGameAvailable = false;
      string globalPointer = "4DF73C";
      bool tuse = false;

      bool UnlimitedAmmo = false;
      int[] AmmoOffset = { 0x000, 0x014, 0x378 };
      int AmmoToFill = 20;
      bool t = false;

      bool UnlimitedHealth = false;
      int[] HealthOffset = { 0xF4 };
      int HealthToFill = 100;

      #endregion

      public Form1()
      {
      InitializeComponent();
      }

      private void Form1_Load(object sender, EventArgs e)
      {

      }

      private void UnlimAmmoBTN_Click(object sender, EventArgs e)
      {
      if (isGameAvailable)
      {
      if (UnlimitedAmmo)
      {
      UnlimitedAmmo = false;
      UnlimAmmoBTN.Text = "1.OFF";
      }
      else
      {
      UnlimitedAmmo = true;
      UnlimAmmoBTN.Text = "1.ON";
      }
      }
      }

      private void GameAvailabilityTMR_Tick(object sender, EventArgs e)
      {
      myProcess = Process.GetProcessesByName("ac_client") ;
      if (myProcess.Length != 0)
      {
      isGameAvailable = true;
      statusLBL.Text = "Status: Assault Cube Availiable";
      }
      else
      {
      isGameAvailable = false;
      statusLBL.Text = "Status: Assault Cube NOT Availiable";
      }
      }

      private void UpdateCheatsTMR_Tick(object sender, EventArgs e)
      {
      if (isGameAvailable)
      {
      myMemory.ReadProcess = myProcess[0];
      myMemory.Open();

      #region Unlimited Ammo
      if (UnlimitedAmmo)
      {
      int pointerAddress = HexToDec(globalPointer);
      int bytesWritten;
      byte[] valueToWrite = BitConverter.GetBytes(AmmoToFill); //convert AmmoFils to Bytes
      string writtenAddress = myMemory.PointerWrite((IntPtr)pointerAddress, //Endereço estatico MUNIÇÃO
      valueToWrite, //valor a atribuir
      AmmoOffset, //Offsets
      out bytesWritten);
      if (!tuse)
      {
      tuse = true;
      MessageBox.Show(bytesWritten.ToString("X"));
      }

      }
      #endregion

      #region Unlimited Health
      if (UnlimitedHealth)
      {
      int pointerAddress = HexToDec(globalPointer);
      int bytesWritten;
      byte[] valueToWrite = BitConverter.GetBytes(HealthToFill); //convert HealthFils to Bytes
      string writtenAddress = myMemory.PointerWrite((IntPtr)pointerAddress, //Endereço estatico HP
      valueToWrite, //Valor a atribuir
      HealthOffset, //offsets
      out bytesWritten);
      if (!tuse)
      {
      tuse = true;
      MessageBox.Show(bytesWritten.ToString("X"));
      }
      }
      myMemory.CloseHandle();
      #endregion
      }
      }

      public static string HexToDec(int DEC)
      {
      return DEC.ToString("X");
      }
      public static int HexToDec(string Hex)
      {
      return int.Parse(Hex, NumberStyles.HexNumber);
      }

      private void UnlimHealthBTN_Click(object sender, EventArgs e)
      {
      if (isGameAvailable)
      {
      if (UnlimitedHealth)
      {
      UnlimitedHealth = false;
      UnlimHealthBTN.Text = "1.OFF";
      }
      else
      {
      UnlimitedHealth = true;
      UnlimHealthBTN.Text = "1.ON";
      }
      }
      }

      }
      }
      [/HTML]

      I can't add the Memory.cs cause its 2 big

      // Download links that leads outside GuidedHacking are not allowed. Please attach it to your thread the next time.

      Uploaded by Fleep to his tutorial

      Thanks
      Last edited by Spock; 05-04-2013 at 12:27 AM.

    8. #6
      Jr.Coder
      <3 D3D
       
      Coding
       
      gnuzim's Avatar
      Join Date
      Nov 2012
      Posts
      67
      Thanks (-->)
      43
      Thanks (<--)
      28
      Memory.cs
      [HTML]
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Runtime.InteropServices; //USED TO CALL THE DLL IMPORTS
      using System.Globalization;
      using System.Diagnostics;
      using System.Windows.Forms; //DELETE ME
      namespace CubeTrainer
      {
      //Class wasnt done by me
      //FULL CREDITS TO
      //https://forum.cheatengine.org/viewtopic.php?t=530207


      public class Memory
      {
      private Process m_ReadProcess = null;
      private IntPtr m_hProcess = IntPtr.Zero;

      public Process ReadProcess
      {
      get
      {
      return m_ReadProcess;
      }
      set
      {
      m_ReadProcess = value;
      }
      }

      public void Open()
      {
      ProcessAccessType access = ProcessAccessType.PROCESS_VM_READ
      | ProcessAccessType.PROCESS_VM_WRITE
      | ProcessAccessType.PROCESS_VM_OPERATION;
      m_hProcess = OpenProcess((uint)access, 1, (uint)m_ReadProcess.Id);
      }

      public void CloseHandle()
      {
      int iRetValue;
      iRetValue = CloseHandle(m_hProcess);
      if (iRetValue == 0)
      {
      throw new Exception("CloseHandle Failed");
      }
      }

      public byte[] Read(IntPtr MemoryAddress, uint bytesToRead, out int bytesRead)
      {
      byte[] buffer = new byte[bytesToRead];
      IntPtr ptrBytesRead;
      ReadProcessMemory(m_hProcess, MemoryAddress, buffer, bytesToRead, out ptrBytesRead);
      bytesRead = ptrBytesRead.ToInt32();
      return buffer;
      }

      public byte[] PointerRead(IntPtr MemoryAddress, uint bytesToRead, int[] Offset, out int bytesRead)
      {
      int iPointerCount = Offset.Length - 1;
      IntPtr ptrBytesRead;
      bytesRead = 0;
      byte[] buffer = new byte[4]; //DWORD to hold an Address
      int tempAddress = 0;

      if (iPointerCount == 0)
      {


      ReadProcessMemory(m_hProcess, MemoryAddress, buffer, 4, out ptrBytesRead);
      tempAddress = ToDec(Make(buffer)) + Offset[0]; //Final Address

      buffer = new byte[bytesToRead];
      ReadProcessMemory(m_hProcess, (IntPtr)tempAddress, buffer, bytesToRead, out ptrBytesRead);

      bytesRead = ptrBytesRead.ToInt32();

      //MessageBox.Show(bytesRead.ToString());

      return buffer;


      }

      for (int i = 0; i <= iPointerCount; i++)
      {
      if (i == iPointerCount)
      {
      ReadProcessMemory(m_hProcess, (IntPtr)tempAddress, buffer, 4, out ptrBytesRead);
      tempAddress = ToDec(Make(buffer)) + Offset[i]; //Final Address

      buffer = new byte[bytesToRead];
      ReadProcessMemory(m_hProcess, (IntPtr)tempAddress, buffer, bytesToRead, out ptrBytesRead);

      bytesRead = ptrBytesRead.ToInt32();
      return buffer;
      }
      else if (i == 0)
      {
      ReadProcessMemory(m_hProcess, MemoryAddress, buffer, 4, out ptrBytesRead);
      tempAddress = ToDec(Make(buffer)) + Offset[1];
      }
      else
      {
      ReadProcessMemory(m_hProcess, (IntPtr)tempAddress, buffer, 4, out ptrBytesRead);
      tempAddress = ToDec(Make(buffer)) + Offset[i];
      }
      }

      return buffer;
      }

      public void Write(IntPtr MemoryAddress, byte[] bytesToWrite, out int bytesWritten)
      {
      IntPtr ptrBytesWritten;
      WriteProcessMemory(m_hProcess, MemoryAddress, bytesToWrite, (uint)bytesToWrite.Length, out ptrBytesWritten);
      bytesWritten = ptrBytesWritten.ToInt32();
      }

      public string PointerWrite(IntPtr MemoryAddress, byte[] bytesToWrite, int[] Offset, out int bytesWritten)
      {
      int iPointerCount = Offset.Length - 1;
      IntPtr ptrBytesWritten;
      bytesWritten = 0;
      byte[] buffer = new byte[4]; //DWORD to hold an Address
      int tempAddress = 0;

      if (iPointerCount == 0)
      {
      ReadProcessMemory(m_hProcess, MemoryAddress, buffer, 4, out ptrBytesWritten);
      tempAddress = ToDec(Make(buffer)) + Offset[0]; //Final Address
      WriteProcessMemory(m_hProcess, (IntPtr)tempAddress, bytesToWrite, (uint)bytesToWrite.Length, out ptrBytesWritten);

      bytesWritten = ptrBytesWritten.ToInt32();
      return ToHex(tempAddress);
      }

      //only necessary for multiple OFFSETS
      for (int i = 0; i <= iPointerCount; i++)
      {
      if (i == iPointerCount)
      {
      ReadProcessMemory(m_hProcess, (IntPtr)tempAddress, buffer, 4, out ptrBytesWritten);
      tempAddress = ToDec(Make(buffer)) + Offset[i]; //Final Address
      WriteProcessMemory(m_hProcess, (IntPtr)tempAddress, bytesToWrite, (uint)bytesToWrite.Length, out ptrBytesWritten);

      bytesWritten = ptrBytesWritten.ToInt32();
      return ToHex(tempAddress);
      }
      else if (i == 0)
      {
      ReadProcessMemory(m_hProcess, MemoryAddress, buffer, 4, out ptrBytesWritten);
      tempAddress = ToDec(Make(buffer)) + Offset[i];
      }
      else
      {
      ReadProcessMemory(m_hProcess, (IntPtr)tempAddress, buffer, 4, out ptrBytesWritten);
      tempAddress = ToDec(Make(buffer)) + Offset[i];
      }
      }

      return ToHex(tempAddress);
      }

      public int PID()
      {
      return m_ReadProcess.Id;
      }

      public string BaseAddressH()
      {
      return ToHex(m_ReadProcess.MainModule.BaseAddress.ToInt32 ());
      }

      public int BaseAddressD()
      {
      return m_ReadProcess.MainModule.BaseAddress.ToInt32();
      }

      [Flags]
      public enum ProcessAccessType
      {
      PROCESS_TERMINATE = (0x0001),
      PROCESS_CREATE_THREAD = (0x0002),
      PROCESS_SET_SESSIONID = (0x0004),
      PROCESS_VM_OPERATION = (0x0008),
      PROCESS_VM_READ = (0x0010),
      PROCESS_VM_WRITE = (0x0020),
      PROCESS_DUP_HANDLE = (0x0040),
      PROCESS_CREATE_PROCESS = (0x0080),
      PROCESS_SET_QUOTA = (0x0100),
      PROCESS_SET_INFORMATION = (0x0200),
      PROCESS_QUERY_INFORMATION = (0x0400)
      }

      public static string Make(byte[] buffer)
      {
      string sTemp = "";

      for (int i = 0; i < buffer.Length; i++)
      {
      if (Convert.ToInt16(buffer[i]) < 10)
      {
      sTemp = "0" + ToHex(buffer[i]) + sTemp;
      }
      else
      {
      sTemp = ToHex(buffer[i]) + sTemp;
      }
      }
      return sTemp;
      }

      public static string ToHex(int Decimal)
      {
      return Decimal.ToString("X"); //Convert Decimal to Hexadecimal
      }

      public static int ToDec(string Hex)
      {
      return int.Parse(Hex, NumberStyles.HexNumber); //Convert Hexadecimal to Decimal
      }

      [DllImport("kernel32.dll")]
      public static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Int32 bInheritHandle, UInt32 dwProcessId);

      [DllImport("kernel32.dll")]
      public static extern Int32 CloseHandle(IntPtr hObject);

      [DllImport("kernel32.dll")]
      public static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesRead);

      [DllImport("kernel32.dll")]
      public static extern Int32 WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesWritten);

      }
      }
      [/HTML]

      I guess thats all!
      Thanks

    9. #7
      Learning to hack games!
       
      Feeling Normal
       

      Join Date
      Jan 1970
      Posts
      0
      Thanks (-->)
      294
      Thanks (<--)
      328
      If you give me a minute. I'll go back to Assault Cube and try to look for something real quick. I'll post back in 5 - 10 minutes.

    10. Thanks gnuzim thanked for this post
    11. #8
      Jr.Coder
      <3 D3D
       
      Coding
       
      gnuzim's Avatar
      Join Date
      Nov 2012
      Posts
      67
      Thanks (-->)
      43
      Thanks (<--)
      28
      Ok, thank you!
      I'll wait

    12. #9
      Learning to hack games!
       
      Feeling Normal
       

      Join Date
      Jan 1970
      Posts
      0
      Thanks (-->)
      294
      Thanks (<--)
      328
      Could you try this for a minute and see if it works. Maybe your offsets are wrong because Health, Ammo etc is all within one structure.

      Health:

      Pointer: 4E4DBC
      Offset: F4

      Ammo:

      Pointer: 4E4DBC
      Offset: 140

    13. Thanks gnuzim thanked for this post
    14. #10
      Jr.Coder
      <3 D3D
       
      Coding
       
      gnuzim's Avatar
      Join Date
      Nov 2012
      Posts
      67
      Thanks (-->)
      43
      Thanks (<--)
      28
      Cheat Engine Tutorials
      Still not working for me
      [HTML]
      #region Global variables
      Memory myMemory = new Memory();
      Process[] myProcess;
      bool isGameAvailable = false;
      string globalPointer = "4E4DBC";

      bool UnlimitedAmmo = false;
      int[] AmmoOffset = { 0x140 };
      int AmmoToFill = 20;

      bool UnlimitedHealth = false;
      int[] HealthOffset = { 0xF4 };
      int HealthToFill = 100;

      #endregion
      [/HTML]

    Page 1 of 3 123 LastLast

    Similar Game Hacker Threads

    1. Outlast God Mode, Unlimited Batteries Cheat
      By Fleep in forum Other Game Hacks
      Replies: 8
      Last Post: 01-17-2018, 12:00 AM
    2. Replies: 34
      Last Post: 09-30-2017, 07:29 PM
    3. [Release] Ammo + Health With GUI
      By Syntax Error in forum Assault Cube Hacks
      Replies: 5
      Last Post: 05-31-2015, 06:44 PM
    4. [Help] Ammo unfreez, please help.
      By rickblack28 in forum Hacking Help
      Replies: 1
      Last Post: 11-03-2014, 05:34 AM
    5. [Help] Regarding Infintie Ammo
      By TheGreatUnknown in forum Hacking Help
      Replies: 13
      Last Post: 10-23-2014, 10:04 PM

    Tags for this Thread