Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973

    Aimbot locking on ground

    Hi,

    I'm having a issue that my aimbot is locking itself on the ground when I hold the key for it.
    Now, the weird thing is is that this exact aimbot works perfectly fine in my other project, the only difference is is that in this project I am not using /CLR. Before, I had the issue that when I started the aimbot it said 'Run-Time Check Failure #3 - The variable 'index' is being used without being initialized.' but I've moved the variable index to above the closestenemytocrosshair code and that seems to be solved now.

    Code:
    void CalcAngle(Vec3 src, Vec3 dst, Vec3 &angles)
    {
    	Vec3 delta;
    	delta.x = src.x - dst.x;
    	delta.y = src.y - dst.y;
    	delta.z = src.z - dst.z;
    	double hyp = sqrt(delta.x * delta.x + delta.y * delta.y);
    
    	angles.x = (float)(atan(delta.z / hyp) * 57.295779513082f);
    	angles.y = (float)(atan(delta.y / delta.x) * 57.295779513082f);
    	angles.z = 0.0f;
    
    	if (delta.x >= 0.0)
    		angles.y += 180.0f;
    }
    int index;
    int ClosestEnemyToCrosshair(float maxfov)
    {
    	DWORD LocalPlayer = Mem.Read <DWORD>(Client + 0x00A31504);
    	int LocalTeam = Mem.Read<int>(LocalPlayer + m_iTeamNum);
    	for (int i = 0; i < 64; i++)
    	{
    		DWORD entitybase = Mem.Read<DWORD>(Client + EntityList + (i * 0x10));
    		if (entitybase == LocalPlayer)
    			continue;
    		bool entitydormant = Mem.Read<bool>(entitybase + isDormant);
    		if (entitydormant)
    			continue;
    		int entityteam = Mem.Read<int>(entitybase + m_iTeamNum);
    
    		if (entityteam == LocalTeam)
    			continue;
    
    
    		int entitylifestate = Mem.Read<byte>(entitybase + 0x25B); //is lifestate
    		if (entitylifestate != 0)
    			continue;
    
    		DWORD Engine = Mem.Module("engine.dll");
    		DWORD clientstate = Mem.Read<DWORD>(Engine + clientState);
    		Vec3 currentangles = Mem.Read<Vec3>(clientstate + viewAngle);
    		Vec3 pos = BonePos(entitybase, 0x2698, aimbone); //bonematrix
    		float entitydistance = GetFOV(currentangles, position, pos);
    		if (entitydistance < maxfov)
    		{
    			maxfov = entitydistance;
    			index = i;
    		}
    	}
    	return index;
    }

  2. #2
    nexcat's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    59
    Reputation
    10
    Thanks
    549
    Your angles are being set to map origin, check for null pointers correctly.

  3. #3
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973
    Quote Originally Posted by nexcat View Post
    Your angles are being set to map origin, check for null pointers correctly.
    No had that problem before but fixed it, I already check for a null pointers in my Aimbot code.

  4. #4
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by F4DE View Post
    No had that problem before but fixed it, I already check for a null pointers in my Aimbot code.
    You aren't checking for nullptr's in your ClosestEnemyToCrosshair function.

  5. #5
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973
    Quote Originally Posted by WasserEsser View Post
    You aren't checking for nullptr's in your ClosestEnemyToCrosshair function.
    What / how / where should I check for null pointers?

    //EDIT: The closest enemy to crosshair code does seem to work, it only locks to the ground when the enemy is in sight

    //EDIT EDIT: Maybe it is a problem with procmem? I tried to add noflash as a feature, but that doesn't seem to be doing ANYTHING but the code can't really not work..
    Code:
    void NoFlash()
    {
    	if (visual_visibleonly && 0x0000A2F4 > 0.f)
    		/* Remove Flash by setting the value back to 0.f */
    		Mem.Write<float>(0x00A31504 + 0, 0.f);
    
    	/* Sleep to reduce CPU usage */
    	Sleep(1);
    }
    Used the offsets instead of using my premade offset list to make sure those are working, tried debugging the code and that actually worked too, it just doesn't understand / seem to trigger itself with the 0x0000A2F4 > 0.f
    Last edited by F4DE; 07-18-2016 at 12:30 PM.

  6. #6
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by F4DE View Post
    Code:
    void NoFlash()
    {
    	if (visual_visibleonly && 0x0000A2F4 > 0.f)
    		/* Remove Flash by setting the value back to 0.f */
    		Mem.Write<float>(0x00A31504 + 0, 0.f);
    
    	/* Sleep to reduce CPU usage */
    	Sleep(1);
    }
    Code:
    0x0000A2F4 > 0.f
    0xA2F4 is -0.000000, of course your check won't succeed. You want to check if the value of m_flFlashMaxAlpha is bigger than 0.f, it obviously won't work if you aren't even reading anything. You're also writing to a completely wrong memory address.

    What / how / where should I check for null pointers?
    By adding a check if it's valid into your ClosestEnemyToCrosshair function right after you get the entitybase.

    Code:
    if ( !entitybase ) continue;

  7. #7
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973
    Quote Originally Posted by WasserEsser View Post
    Code:
    0x0000A2F4 > 0.f
    0xA2F4 is -0.000000, of course your check won't succeed. You want to check if the value of m_flFlashMaxAlpha is bigger than 0.f, it obviously won't work if you aren't even reading anything. You're also writing to a completely wrong memory address.



    By adding a check if it's valid into your ClosestEnemyToCrosshair function right after you get the entitybase.

    Code:
    if ( !entitybase ) continue;
    Hmm, doesn't seem to fix the problem ;l
    Gif of what is happening;


    The noflash part was pritty dumb though I have this right now, but it seems to still not be doing anything and I'm out of ideas
    Code:
    void NoFlash()
    {
    	LocalBase = Mem.Read<DWORD>(Client + 0x00A31504);
    	FlashMaxAlpha = Mem.Read<float>(LocalBase + 0x0000A2F4);
    	while (true)
    	{
    		if (visual_visibleonly && FlashMaxAlpha > 0.f)
    			/* Remove Flash by setting the value back to 0.f */
    			Mem.Write<float>(LocalBase + 0x0000A2F4, 0.f);
    
    		/* Sleep to reduce CPU usage */
    		Sleep(1);
    	}
    }
    //EDIT: Think I know what is going on with the noflash, I think I should actually set LocalBase and FlashMaxAlpha in the loop to let it update
    Last edited by F4DE; 07-18-2016 at 02:06 PM.

  8. #8
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by F4DE View Post
    Hmm, doesn't seem to fix the problem ;l
    Gif of what is happening;


    The noflash part was pritty dumb though I have this right now, but it seems to still not be doing anything and I'm out of ideas
    Code:
    void NoFlash()
    {
    	LocalBase = Mem.Read<DWORD>(Client + 0x00A31504);
    	FlashMaxAlpha = Mem.Read<float>(LocalBase + 0x0000A2F4);
    	while (true)
    	{
    		if (visual_visibleonly && FlashMaxAlpha > 0.f)
    			/* Remove Flash by setting the value back to 0.f */
    			Mem.Write<float>(LocalBase + 0x0000A2F4, 0.f);
    
    		/* Sleep to reduce CPU usage */
    		Sleep(1);
    	}
    }
    Why is

    Code:
    LocalBase = Mem.Read<DWORD>(Client + 0x00A31504);
    FlashMaxAlpha = Mem.Read<float>(LocalBase + 0x0000A2F4);
    outside of the loop?

    You didn't show how you calculate your angle.

  9. #9
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973
    Quote Originally Posted by WasserEsser View Post
    Why is

    Code:
    LocalBase = Mem.Read<DWORD>(Client + 0x00A31504);
    FlashMaxAlpha = Mem.Read<float>(LocalBase + 0x0000A2F4);
    outside of the loop?

    You didn't show how you calculate your angle.
    Code:
    void CalcAngle(Vec3 src, Vec3 dst, Vec3 &angles)
    {
    	Vec3 delta;
    	delta.x = src.x - dst.x;
    	delta.y = src.y - dst.y;
    	delta.z = src.z - dst.z;
    	double hyp = sqrt(delta.x * delta.x + delta.y * delta.y);
    
    	angles.x = (float)(atan(delta.z / hyp) * 57.295779513082f);
    	angles.y = (float)(atan(delta.y / delta.x) * 57.295779513082f);
    	angles.z = 0.0f;
    
    	if (delta.x >= 0.0)
    		angles.y += 180.0f;
    }
    Code:
    void CalcAngle(Vec3 src, Vec3 dst, Vec3 &angles)
    {
    	Vec3 delta;
    	delta.x = src.x - dst.x;
    	delta.y = src.y - dst.y;
    	delta.z = src.z - dst.z;
    	double hyp = sqrt(delta.x * delta.x + delta.y * delta.y);
    
    	angles.x = (float)(atan(delta.z / hyp) * 57.295779513082f);
    	angles.y = (float)(atan(delta.y / delta.x) * 57.295779513082f);
    	angles.z = 0.0f;
    
    	if (delta.x >= 0.0)
    		angles.y += 180.0f;
    }
    Yeah, having this right now but it still doesn't do anything
    Code:
    void ReadData()
    {
    	while (true)
    	{
    		LocalBase = Mem.Read<DWORD>(Client + 0x00A31504);
    		FlashMaxAlpha = Mem.Read<float>(LocalBase + 0x0000A2F4);
    		Sleep(1);
    	}
    }
    
    void NoFlash()
    {
    	while (true)
    	{
    		if (visual_visibleonly && FlashMaxAlpha > 0.f)
    			/* Remove Flash by setting the value back to 0.f */
    			Mem.Write<float>(LocalBase + 0x0000A2F4, 0.f);
    
    		/* Sleep to reduce CPU usage */
    		Sleep(1);
    	}
    }

  10. #10
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by F4DE View Post
    Code:
    void CalcAngle(Vec3 src, Vec3 dst, Vec3 &angles)
    {
    	Vec3 delta;
    	delta.x = src.x - dst.x;
    	delta.y = src.y - dst.y;
    	delta.z = src.z - dst.z;
    	double hyp = sqrt(delta.x * delta.x + delta.y * delta.y);
    
    	angles.x = (float)(atan(delta.z / hyp) * 57.295779513082f);
    	angles.y = (float)(atan(delta.y / delta.x) * 57.295779513082f);
    	angles.z = 0.0f;
    
    	if (delta.x >= 0.0)
    		angles.y += 180.0f;
    }
    Code:
    void CalcAngle(Vec3 src, Vec3 dst, Vec3 &angles)
    {
    	Vec3 delta;
    	delta.x = src.x - dst.x;
    	delta.y = src.y - dst.y;
    	delta.z = src.z - dst.z;
    	double hyp = sqrt(delta.x * delta.x + delta.y * delta.y);
    
    	angles.x = (float)(atan(delta.z / hyp) * 57.295779513082f);
    	angles.y = (float)(atan(delta.y / delta.x) * 57.295779513082f);
    	angles.z = 0.0f;
    
    	if (delta.x >= 0.0)
    		angles.y += 180.0f;
    }
    Yeah, having this right now but it still doesn't do anything
    Code:
    void ReadData()
    {
    	while (true)
    	{
    		LocalBase = Mem.Read<DWORD>(Client + 0x00A31504);
    		FlashMaxAlpha = Mem.Read<float>(LocalBase + 0x0000A2F4);
    		Sleep(1);
    	}
    }
    
    void NoFlash()
    {
    	while (true)
    	{
    		if (visual_visibleonly && FlashMaxAlpha > 0.f)
    			/* Remove Flash by setting the value back to 0.f */
    			Mem.Write<float>(LocalBase + 0x0000A2F4, 0.f);
    
    		/* Sleep to reduce CPU usage */
    		Sleep(1);
    	}
    }
    You still don't show how you calculate your angle.

    Also where are you calling ReadData?

  11. #11
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973
    Ah I'm sorry, thought you meant the other thing.
    Code:
    			int entindex = ClosestEnemyToCrosshair(90.f);
    
    			if (entindex == 0)
    				continue;
    			DWORD LocalPlayer = Mem.Read <DWORD>(Client + 0x00A31504);
    			Vec3 origin = Mem.Read<Vec3>(LocalPlayer + 0x134);
    			Vec3 vecview = Mem.Read<Vec3>(LocalPlayer + 0x104);
    			position.x = origin.x + vecview.x;
    			position.y = origin.y + vecview.y;
    			position.z = origin.z + vecview.z;
    
    			Vec3 punch = Mem.Read<Vec3>(LocalPlayer + 0x3018);
    			Vec3 angles;
    
    			DWORD entitybase = Mem.Read<DWORD>(Client + EntityList + (entindex * 0x10));
    			Vec3 pos = BonePos(entitybase, 0x2698, bonePosition);
    
    			CalcAngle(position, pos, angles);
    			angles.x = angles.x - punch.x * 2.f;
    			angles.y = angles.y - punch.y * 2.f;
    			ClampAngles(angles);
    			if (angles.x == 0 && angles.y == 0)
    				continue;
    			DWORD Engine = Mem.Module("engine.dll");
    			DWORD clientstate = Mem.Read<DWORD>(Engine + clientState);
    			Mem.Write<Vec3>(clientstate + 0x4D0C, angles);
    I'm calling ReadData in the Main part, also calling it before the noflash thread.

    Code:
    		std::thread t3(ReadData);
    		std::thread t1(Aimbot);
    		std::thread t2(NoFlash);

  12. #12
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973
    Bumbing this to the top!

  13. #13
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by F4DE View Post
    Ah I'm sorry, thought you meant the other thing.
    Code:
    			int entindex = ClosestEnemyToCrosshair(90.f);
    
    			if (entindex == 0)
    				continue;
    			DWORD LocalPlayer = Mem.Read <DWORD>(Client + 0x00A31504);
    			Vec3 origin = Mem.Read<Vec3>(LocalPlayer + 0x134);
    			Vec3 vecview = Mem.Read<Vec3>(LocalPlayer + 0x104);
    			position.x = origin.x + vecview.x;
    			position.y = origin.y + vecview.y;
    			position.z = origin.z + vecview.z;
    
    			Vec3 punch = Mem.Read<Vec3>(LocalPlayer + 0x3018);
    			Vec3 angles;
    
    			DWORD entitybase = Mem.Read<DWORD>(Client + EntityList + (entindex * 0x10));
    			Vec3 pos = BonePos(entitybase, 0x2698, bonePosition);
    
    			CalcAngle(position, pos, angles);
    			angles.x = angles.x - punch.x * 2.f;
    			angles.y = angles.y - punch.y * 2.f;
    			ClampAngles(angles);
    			if (angles.x == 0 && angles.y == 0)
    				continue;
    			DWORD Engine = Mem.Module("engine.dll");
    			DWORD clientstate = Mem.Read<DWORD>(Engine + clientState);
    			Mem.Write<Vec3>(clientstate + 0x4D0C, angles);
    I'm calling ReadData in the Main part, also calling it before the noflash thread.

    Code:
    		std::thread t3(ReadData);
    		std::thread t1(Aimbot);
    		std::thread t2(NoFlash);
    How does your BonePos function look like?

    You should also normalize your angles after each operation you do on them.

  14. #14
    F4DE's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    The Netherlands
    Posts
    158
    Reputation
    10
    Thanks
    973
    Quote Originally Posted by WasserEsser View Post
    How does your BonePos function look like?

    You should also normalize your angles after each operation you do on them.
    Code:
    Vec3 BonePos(DWORD target, DWORD address, int boneId)
    {
    	DWORD boneBase = Mem.Read<DWORD>(target + address);
    	Vec3 vBone;
    	vBone.x = Mem.Read<float>(boneBase + 0x30 * boneId + 0x0C);
    	vBone.y = Mem.Read<float>(boneBase + 0x30 * boneId + 0x1C);
    	vBone.z = Mem.Read<float>(boneBase + 0x30 * boneId + 0x2C);
    	return vBone;
    }

  15. #15
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by F4DE View Post
    Code:
    Vec3 BonePos(DWORD target, DWORD address, int boneId)
    {
    	DWORD boneBase = Mem.Read<DWORD>(target + address);
    	Vec3 vBone;
    	vBone.x = Mem.Read<float>(boneBase + 0x30 * boneId + 0x0C);
    	vBone.y = Mem.Read<float>(boneBase + 0x30 * boneId + 0x1C);
    	vBone.z = Mem.Read<float>(boneBase + 0x30 * boneId + 0x2C);
    	return vBone;
    }
    Post your entire code.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Solved] gmod autocrouch when aimbot locked
    By RGswerhgerheherherherhrh in forum Garry's Mod Coding & Resources
    Replies: 4
    Last Post: 05-11-2016, 05:04 AM
  2. [Solved] CSGO aimbot teammates see you looking at the ground
    By Oyn in forum Counter-Strike 2 Help
    Replies: 1
    Last Post: 04-23-2015, 10:54 PM
  3. [Help] Aimbot with Lock on Key ?
    By Alatheas in forum Garry's Mod Discussions & Help
    Replies: 1
    Last Post: 12-09-2014, 06:34 PM
  4. Riot shield loses lock-on when using aimbots. Any help?
    By jalba in forum Call of Duty Modern Warfare 3 Help
    Replies: 2
    Last Post: 09-02-2012, 01:05 AM
  5. America's Army aimbot
    By garebear in forum General Game Hacking
    Replies: 6
    Last Post: 12-30-2005, 04:52 PM