Solved I can't find the problem :(

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Alavon

Jr.Coder
Nobleman
Mar 24, 2013
83
439
0
I'm pretty new to C# and C++ but i followed fleep's memory aimbot and typed everything exactly like he did,
but i cant find the freakin problem, each time i get and error with that ive got the wrong input row (im dutch)
C++:
Form1.cs
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 ProcessMemoryReaderLib;
using System.Globalization;
using System.Diagnostics;

namespace Assault_Cube_Aimbot
{
    public partial class Form1 : Form
    {

        Process[] MyProcess;
        ProcessModule mainModule;
        ProcessMemoryReader Mem = new ProcessMemoryReader();
        PlayerData MainPlayer = new PlayerData();

        #region ----------Adresses----------
        int MainPlayerBase = 0x4E4DBC;
        int [] MainPlayerMultiLvl = new int[] { 0x30 };
        PlayerDataAddr MainPlayersOffsets = new PlayerDataAddr(0x10, 0x14, 0x4, 0xC, 0x8, 0xC4);

        #region ----------ENEMY Adresses----------
        List<PlayerData> EnemyAdresses = new List<PlayerData>();
        int [] enOneMultiLevel = new int[] { 0x4, 0x30 };
        //int [] enTwoMultiLevel = new int[] { 0x4, 0x30 };
        //int [] enThreeMultiLevel = new int[] { 0x4, 0x30 };




        #endregion

        #endregion

        float PI = 3.14159265f;

        bool GameFound = false;
        bool FocusingOnEnemy = false;
        int Focustarget = -1;


        public Form1()
        {
            InitializeComponent();
        }

        private void GameChoiceCB_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                for (int i = 0; i < MyProcess.Length; i++)
                {
                    if (GameChoiceCB.SelectedItem.ToString().Contains(MyProcess[i].ProcessName))
                    {
                        MyProcess[0] = Process.GetProcessById(int.Parse(GameChoiceCB.Text.Replace(MyProcess[i] + "-", "")));
                        mainModule = MyProcess[0].MainModule;
                        Mem.ReadProcess = MyProcess[0];
                        Mem.OpenProcess();
                        GameFound = true;

                        MainPlayer.baseAdress = MainPlayerBase;
                        MainPlayer.multilevel = MainPlayerMultiLvl;
                        MainPlayer.offsets = new PlayerDataAddr(MainPlayersOffsets.xMouse, MainPlayersOffsets.yMouse, MainPlayersOffsets.xpos, MainPlayersOffsets.zpos, MainPlayersOffsets.ypos, MainPlayersOffsets.health);


                        SetupEnemyVars();
                    }
                }



            }
            catch (Exception ex)
            {
                MessageBox.Show("Could not connect to Assault Cube, Because " + ex.Message);

            }

        }

        private void processTMR_Tick(object sender, EventArgs e)
        {
            if (GameFound)
            {
                int PlayerBase = Mem.ReadMultiLevelPointer(MainPlayer.baseAdress, 4, MainPlayer.multilevel);

                int hotkey = ProcessMemoryReaderApi.GetKeyState(02); //Right mouse
                if ((hotkey & 0x8000) != 0)
                {
                    FocusingOnEnemy = true;
                    Aimbot();
                }
                else
                {
                    FocusingOnEnemy = false;
                    Focustarget = -1;
                }
            }
            try
            {
                if (MyProcess != null)
                {
                    if (MyProcess[0].HasExited)
                        GameFound = false;
 
                }

            }

            catch (Exception ex)

            {
                MessageBox.Show("Aimbot could no longer run, because " + ex.Message);


            }
        }


        private void Aimbot()
        {
            PlayerDataVec playerDataVec = GetPlayerData(MainPlayer);
            List<PlayerDataVec> EnemiesDataVec = new List<PlayerDataVec>();

            for (int i = 0; i < EnemyAdresses.Count; i++)
            {
                PlayerDataVec enemyDataVector = GetPlayerData(EnemyAdresses[i]);
                EnemiesDataVec.Add(enemyDataVector);
            }
            if (playerDataVec.health > 0)
            {
                int target = 0;
                if (FocusingOnEnemy && Focustarget != -1)
                {
                    if (EnemiesDataVec[Focustarget].health > 0)
                        target = Focustarget;
                    else target = FindClosestEnemyIndex(EnemiesDataVec.ToArray(), playerDataVec);
                }
                else target = FindClosestEnemyIndex(EnemiesDataVec.ToArray(), playerDataVec);

                    if(target != -1)
                    {
                        Focustarget = target;
                        if(EnemiesDataVec[target].health > 0)
                        AimAtTarget(EnemiesDataVec[target], playerDataVec);

                       
                    }
            }

        }

        private void AimAtTarget(PlayerDataVec enemyDataVector, PlayerDataVec playerDataVector)
        {
            float pitchY = (float)Math.Asin((enemyDataVector.zPos - playerDataVector.zPos) /
                Get3dDistance(enemyDataVector, playerDataVector))
                * 180 / PI;
            float yawX = -(float)Math.Atan2(enemyDataVector.xPos - playerDataVector.xPos, enemyDataVector.yPos - playerDataVector.yPos
                / PI * 180 + 180);

            int PlayerBase = Mem.ReadMultiLevelPointer(MainPlayer.baseAdress, 4, MainPlayer.multilevel);

            Mem.WriteFloat(PlayerBase + MainPlayer.offsets.xMouse, yawX);
            Mem.WriteFloat(PlayerBase + MainPlayer.offsets.yMouse, pitchY);

        }


        private int FindClosestEnemyIndex(PlayerDataVec[] enemiesDataVec, PlayerDataVec myPosition)
        {
            float[] distances = new float[enemiesDataVec.Length];
            for (int i = 0; i < enemiesDataVec.Length; i++)
            {
                if (enemiesDataVec[i].health > 0)
                    distances[i] = Get3dDistance(enemiesDataVec[i], myPosition);
                else
                    distances[i] = float.MaxValue;
            }

            float [] newDistances = new float[distances.Length];
            Array.Copy(distances, newDistances, distances.Length);
            Array.Sort(newDistances);

            for (int i = 0; i < distances.Length; i++)
            {
                if (distances[i] == newDistances[0])
                    return i;
            }
            return -1;

        }

        private float Get3dDistance(PlayerDataVec to, PlayerDataVec from)
        {
            return (float)(Math.Sqrt(
                ((to.xPos - from.xPos) * (to.xPos - from.xPos)) +
                ((to.yPos - from.yPos) * (to.yPos - from.yPos)) +
                ((to.zPos - from.zPos) * (to.zPos - from.zPos))
                ));
        }
        private PlayerDataVec GetPlayerData(PlayerData updatePlayer)
        {
            PlayerDataVec playerRet = new PlayerDataVec();
            int PlayerBase = Mem.ReadMultiLevelPointer(updatePlayer.baseAdress, 4, updatePlayer.multilevel);
            playerRet.xMouse = Mem.ReadFloat(PlayerBase + updatePlayer.offsets.xMouse);
            playerRet.yMouse = Mem.ReadFloat(PlayerBase + updatePlayer.offsets.yMouse);
            playerRet.xPos = Mem.ReadFloat(PlayerBase + updatePlayer.offsets.xpos);
            playerRet.yPos = Mem.ReadFloat(PlayerBase + updatePlayer.offsets.ypos);
            playerRet.zPos = Mem.ReadFloat(PlayerBase + updatePlayer.offsets.zpos);
            playerRet.health = Mem.ReadInt(PlayerBase + updatePlayer.offsets.health);
            return playerRet;

        }

        private void GameChoiceCB_Click(object sender, EventArgs e)
        {
            GameChoiceCB.Items.Clear();
            MyProcess = Process.GetProcesses();
            for (int i = 0; i < MyProcess.Length; i++)
            {
                GameChoiceCB.Items.Add(MyProcess[i].ProcessName + "-" + MyProcess[i].Id);



            }
        }

        private void SetupEnemyVars()
        {
            PlayerData En1 = new PlayerData();
            En1.baseAdress = MyProcess[0].MainModule.BaseAddress.ToInt32() + 0x000E4E08;
            En1.multilevel = enOneMultiLevel;
            En1.offsets = MainPlayer.offsets;
            EnemyAdresses.Add(En1);

        }
    

    

        private void Form1_Load(object sender, EventArgs e)
        {
            processTMR.Enabled = true;
        }
    
  
    }
}
and my playerinfo.cs
C++:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Assault_Cube_Aimbot
{
    public class PlayerDataAddr
    {
        public int xMouse;
        public int yMouse;
        public int xpos;
        public int ypos;
        public int zpos;
        public int health;

        public PlayerDataAddr(int _xMouse, int _yMouse, int _xPos, int _yPos, int _zPos, int _health)
        {
            xMouse = _xMouse;
            yMouse = _yMouse;
            xpos = _xPos;
            ypos = _yPos;
            zpos = _zPos;
            health = _health;
        }
    }

    public struct PlayerData
    {
        public int baseAdress;
        public int[] multilevel;
        public PlayerDataAddr offsets;
    }

    public struct PlayerDataVec
    {
        public float xMouse;
        public float yMouse;
        public float xPos;
        public float yPos;
        public float zPos;
        public int health;

    }
}
and i added and included the extra files inside any conclusions?
helpp me please!
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,107
12,593
51
Ofcourse!

But also explain the difference at rar and zip, xD why just not rar?
Il do it!

Thx, I appriciate your help! ;)
You're welcome, as I said you 3 times now(double post,PM), line 61 is the problem:D

There is no difference between rar and zip. (There is but who cares xD)
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
What's the error you're getting? Also make sure in the future if you have questions or problems while working on one of the tutorials that you post it in the Tutorial Help section so your issue could be addressed properly. :)
 

Alavon

Jr.Coder
Nobleman
Mar 24, 2013
83
439
0
Thx for helping me, i didnt know that i should post it somewhere else , My pc is on dutch, so i get "De gebruikte invoerreeks is onjuist" in google translate i get "the selected item (of the combobox) is wrong"
Or something like that?
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,107
12,593
51
Is an exception being called or can't you even start the program?

In which line is it?
 

Alavon

Jr.Coder
Nobleman
Mar 24, 2013
83
439
0
There isn't any line called, the compiler doesn't recognize it as a problem, i've posted it under Tutorials Help or something like that and the files, so see it for urself and there's also a picture!
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,107
12,593
51
There isn't any line called, the compiler doesn't recognize it as a problem, i've posted it under Tutorials Help or something like that and the files, so see it for urself and there's also a picture!
Can't find it. Post link here.
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,107
12,593
51
I did like to, but it must be confirmed, I'm i right?
I send it half an hour ago, but it still didn't appear in the list.

It has to be approved by a moderator obviously -.-

How about compressing it to a zip file, upload it on file-upload.net and PM me?
 

Alavon

Jr.Coder
Nobleman
Mar 24, 2013
83
439
0
It has to be approved by a moderator obviously -.-

How about compressing it to a zip file, upload it on file-upload.net and PM me?
Ofcourse!

But also explain the difference at rar and zip, xD why just not rar?
Il do it!

Thx, I appriciate your help! ;)
 
Last edited by a moderator:

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
There is no difference between rar and zip. (There is but who cares xD)
I know I do. Better compression ratio. Check out: https://www.codinghorror.com/blog/2007/02/dont-use-zip-use-rar.html. I prefer to use 7zip myself. It supports Windows and *nix file formats. It also supports several compression methods for you to choose from. I tried using LZMA compression rate on my black ops trainer release instead of the standard DEFLATE used by windows zip. It was able to compress the 33mb into 5mb, but unfortunately it couldn't be opened with that compression method with any program that doesn't support it. I highly recommend everyone switch to 7zip, but that's my opinion. Here are the other compression methods for 7sip: https://www.7-zip.org/7z.htmll

EDIT: Posted wrong link on last link. Doh!
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,107
12,593
51
I know I do. Better compression ratio. Check out: https://www.codinghorror.com/blog/2007/02/dont-use-zip-use-rar.html. I prefer to use 7zip myself. It supports Windows and *nix file formats. It also supports several compression methods for you to choose from. I tried using LZMA compression rate on my black ops trainer release instead of the standard DEFLATE used by windows zip. It was able to compress the 33mb into 5mb, but unfortunately it couldn't be opened with that compression method with any program that doesn't support it. I highly recommend everyone switch to 7zip, but that's my opinion. Here are the other compression methods for 7sip: https://www.7-zip.org/7z.htmll

EDIT: Posted wrong link on last link. Doh!

Thanks, I've got 7-Zip already. I also prefer 7z the most but since not everyone has it (but should get it) I always compress as .zip. In the most cases, file size doesn't matter. (Only if you've got files > 200 MB), who cares about 200KB more or less if I compress source code etc..
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
Thanks, I've got 7-Zip already. I also prefer 7z the most but since not everyone has it (but should get it) I always compress as .zip. In the most cases, file size doesn't matter. (Only if you've got files > 200 MB), who cares about 200KB more or less if I compress source code etc..
I know the 200kb files don't make much of a difference, but when the file sizes get up like mine at 33mb with other trainers being submitted it builds up. Also helps increase download speed for anyone who has a slow connection (or on a slow vpn ;) )
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,107
12,593
51
Yes. But in this case there was no reason for compressing it with as 7z, as he didn't know whether I had 7zip. ZIP was enough.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods League of Legends Accounts