- Sponsored Advertisement -
Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
Call of Duty 6: Code Section hacks cheats tutorials downloads source code
You are Unregistered, please register to gain Full access.
Simple Bone Aimbot
11-21-2009, 09:25 PM
#1 Donator
Join Date: Sep 2007
Posts: 718
Reputation: 26481 Rep Power: 332
Points: 20,308, Level: 19
Last Achievements Simple Bone Aimbot
Ok, I have made many aimbots....for the life of me it doesnt aim correctly (spins) and aims at nothing. If I comment out the ViewAngle mod at the end, it puts
the X on the players head just fine, so my shot selection is good. All my offsets are correct.
PHP Code:
void CEngine :: doAim ( void ) { if(! IsAlive ( GetEntityIndex ( getLocalIndex ()))) return; float fAngleX = 0.0f ; float fAngleY = 0.0f ; float maxDistance = 100.00f ; vec3_t AimLocation ; vec3_t targetVec ; float ScreenX , ScreenY ; float flXHairDistance = 99999.0f ; int Target = - 1 ; unsigned short iHeadTag = RegisterTag ( "j_head" ); for ( unsigned int iPlayers = 0 ; iPlayers < 2048 ; iPlayers ++ ) { CEntity * myEnt = GetEntityIndex ( iPlayers ); if(! myEnt ) continue; if( iPlayers == getLocalIndex ()) continue; if( myEnt -> Type != ET_PLAYER_MP ) continue; CClientInfo * pClientInfo = GetClientInfoIndex ( iPlayers ); if(! isEnemyTarget ( pClientInfo )) continue; float fDistance = GetDistance ( myEnt -> LerpOrigin , m_pRefDef -> Location ) / 48 ; if(! GetTagPosition ( iHeadTag , myEnt ,& AimLocation )) continue; if(! WorldToScreen ( AimLocation , & ScreenX , & ScreenY )) continue; float xDelta = m_pRefDef -> iWidth / 2 - ScreenX ; float yDelta = m_pRefDef -> iHeight / 2 - ScreenY ; float screenLen = sqrtf ( xDelta * xDelta + yDelta * yDelta ); if( screenLen < flXHairDistance ) { Target = iPlayers ; VectorSet ( targetVec , AimLocation [ 0 ], AimLocation [ 1 ], AimLocation [ 2 ] ); flXHairDistance = screenLen ; } } if( Target == - 1 ) return; if( GetAsyncKeyState ( 0x56 )) //&0x8000) { if(! WorldToScreen ( targetVec , & ScreenX , & ScreenY )) return; DrawTextWithEngine ( farFont , ScreenX , ScreenY ,& Red , "X" ); GetAngleToOrigin ( targetVec , fAngleX , fAngleY ); * ViewAngleX += fAngleX ; * ViewAngleY += fAngleY ; } }
__________________
KozmoK
Last edited by Kozmo; 11-21-2009 at 09:30 PM .
Kozmo is online now
11-21-2009, 09:43 PM
#2 My household appliance is on drugs. Horrible.
Join Date: Oct 2005
Location: ALWAYS WON NEVER DEFEAT
Posts: 812
Reputation: 70378 Rep Power: 796
what are you using as your viewangles?
(to set them)
s0beit is offline
11-21-2009, 10:12 PM
#3 Donator
Threadstarter Join Date: Sep 2007
Posts: 718
Reputation: 26481 Rep Power: 332
Points: 20,308, Level: 19
Last Achievements Whats crazy is, I know it should work as it does in all my other cod series hacks.
My View Angles:
float *ViewAngleX = ( float *) 0xB2C38C; float *ViewAngleY = ( float *) 0xB2C388; my GetAngleToOrgin: PHP Code:
void GetAngleToOrigin ( vec3_t Origin , FLOAT & fAngleX , FLOAT & fAngleY ) { vec3_t vEntity , vAngle ; VectorSubtract ( Origin , m_pRefDef -> Location , vEntity ); VectorToAngle ( vEntity , vAngle ); if ( vAngle [ YAW ] > 180.0f ) vAngle [ YAW ] -= 360.0f ; else if ( vAngle [ YAW ] < - 180.0f ) vAngle [ YAW ] += 360.0f ; if ( vAngle [ PITCH ] > 180.0f ) vAngle [ PITCH ] -= 360.0f ; else if ( vAngle [ PITCH ] < - 180.0f ) vAngle [ PITCH ] += 360.0f ; float * refdeflerpAngles = ( float *) 0x79F200 ; //this was checking my angles against my class, and they are the same...(Sanity check) //add_log("%f=%f %f=%f",refdeflerpAngles[0],m_pRefDef->RefDefViewAngles[0],refdeflerpAngles[1],m_pRefDef->RefDefViewAngles[1]); vAngle [ YAW ] -= refdeflerpAngles [ YAW ]; vAngle [ PITCH ] -= refdeflerpAngles [ PITCH ]; if ( vAngle [ YAW ] > 180.0f ) vAngle [ YAW ] -= 360.0f ; else if ( vAngle [ YAW ] < - 180.0f ) vAngle [ YAW ] += 360.0f ; if ( vAngle [ PITCH ] > 180.0f ) vAngle [ PITCH ] -= 360.0f ; else if ( vAngle [ PITCH ] < - 180.0f ) vAngle [ PITCH ] += 360.0f ; fAngleX = vAngle [ YAW ]; fAngleY = vAngle [ PITCH ]; }
__________________
KozmoK
Kozmo is online now
11-22-2009, 12:29 AM
#4 The Legendary Cheater Join Date: Nov 2008
Location: Sweden
Posts: 486
Reputation: 17501 Rep Power: 224
Quote:
Originally Posted by
s0beit what are you using as your viewangles?
(to set them)
Code:
/* MW2 1.0.168 (2009-11-21)
0045138F CC INT3
00451390 /$ 8B4424 08 MOV EAX,DWORD PTR SS:[ESP+8] ; SetViewAngles
00451394 |. D900 FLD DWORD PTR DS:[EAX]
00451396 |. D91D 88C3B200 FSTP DWORD PTR DS:[B2C388] ; ViewAngleY (Pitch)
0045139C |. D940 04 FLD DWORD PTR DS:[EAX+4]
0045139F |. D91D 8CC3B200 FSTP DWORD PTR DS:[B2C38C] ; ViewAngleX (Yaw)
004513A5 |. D940 08 FLD DWORD PTR DS:[EAX+8]
004513A8 >|. D91D 90C3B200 FSTP DWORD PTR DS:[B2C390] ; ViewAngleZ (Roll)
004513AE \. C3 RETN
004513AF CC INT3
*/ Should work
Pitch at 180 degrees = awesome.
[Auto Merged - 23:39:11 UTC]
My math is a bit off, but..
Code:
// l = sqrt( (Bx - Ax)^2 + (By - Ay)^2 )
// b = acos( Bx - Ax / l )
double beta = Math.Acos((Target.X - myPosition.X) / Utils.GetDistance2D(myPosition, Target));
float newrot = ((float)beta - myRotation);
__________________
Moo. ‾\(º_˚ )/‾
Last edited by Nov; 11-28-2009 at 06:45 PM .
Nov is online now
11-22-2009, 01:39 AM
#5 Level 3
Join Date: May 2005
Posts: 1,103
Reputation: 38964 Rep Power: 494
Quote:
Originally Posted by
Nov Code:
/* MW2 1.0.168 (2009-11-21)
0045138F CC INT3
00451390 /$ 8B4424 08 MOV EAX,DWORD PTR SS:[ESP+8] ; SetViewAngles
00451394 |. D900 FLD DWORD PTR DS:[EAX]
00451396 |. D91D 88C3B200 FSTP DWORD PTR DS:[B2C388] ; ViewAngleY (Pitch)
0045139C |. D940 04 FLD DWORD PTR DS:[EAX+4]
0045139F |. D91D 8CC3B200 FSTP DWORD PTR DS:[B2C38C] ; ViewAngleX (Yaw)
004513A5 |. D940 08 FLD DWORD PTR DS:[EAX+8]
004513A8 >|. D91D 90C3B200 FSTP DWORD PTR DS:[B2C390] ; ViewAngleZ (Roll)
004513AE \. C3 RETN
004513AF CC INT3
*/ Should work
Pitch at 180 degrees = awesome.
[Auto Merged - 23:39:11 UTC]
My math is a bit off, but..
Code:
// l = sqrt( (Bx - Ax)^2 + (By - Ay)^2 )
// b = acos( Bx - Ax / l )
double beta = Math.Acos((Target.X - myPosition.X) / Utils.GetDistance2D(myPosition, Target));
float newrot = ((float)beta - myRotation);
lol does it look liek ur back is broken or u shooting out of your ass like crossfire?
xD
Last edited by fatboy88; 11-29-2009 at 03:12 AM .
fatboy88 is online now
11-22-2009, 03:14 AM
#6 Donator
Threadstarter Join Date: Sep 2007
Posts: 718
Reputation: 26481 Rep Power: 332
Points: 20,308, Level: 19
Last Achievements I've checked everything 5 times...Its bizzare, the only thing that is different is im using MSVC 2008.
I'm going drinking tonight, I will mess with it tomorrow
Thanks Guys!
KozmoK
__________________
KozmoK
Kozmo is online now
11-22-2009, 09:08 PM
#7 Level 3
Join Date: Sep 2006
Location: The Netherlands
Posts: 1,233
Reputation: 19321 Rep Power: 284
Quote:
Originally Posted by
s0beit what are you using as your viewangles?
(to set them)
I heard alot of people had problems with that in cod:mw2. I'm using the EXACT same way as in cod4, working fine
I'm using this:
Code:
FLOAT AngleX = asinf( Vec3DotProduct( &pRefdef->vViewAxis[1], &vDir ) );
FLOAT AngleY = asinf( Vec3DotProduct( &pRefdef->vViewAxis[2], &vDir ) );
pCamera->vAngles.Yaw += VecToDegree(AngleX) * AimSpeed;
pCamera->vAngles.Pitch -= VecToDegree(AngleY) * AimSpeed;
R4z8r is offline
11-22-2009, 09:48 PM
#8 My household appliance is on drugs. Horrible.
Join Date: Oct 2005
Location: ALWAYS WON NEVER DEFEAT
Posts: 812
Reputation: 70378 Rep Power: 796
yeah, but where is your pCamera? :P
i use the same addresses as you, btw (Nov), ive been having some trouble too,
on the upside, i found out that they left the lean code in MW2, so you can force lean.
s0beit is offline
11-22-2009, 10:13 PM
#9 :3 1337 :3
Join Date: Nov 2008
Location: The Netherlands
Posts: 979
Reputation: 14563 Rep Power: 204
Points: 13,900, Level: 15
Last Achievements Quote:
Originally Posted by
s0beit yeah, but where is your pCamera? :P
i use the same addresses as you, btw (Nov), ive been having some trouble too,
on the upside, i found out that they left the lean code in MW2, so you can force lean.
Lol were would ya leen for, its no use :P
__________________
hai
Wieter20 is offline
11-22-2009, 10:32 PM
#10 Donator
Threadstarter Join Date: Sep 2007
Posts: 718
Reputation: 26481 Rep Power: 332
Points: 20,308, Level: 19
Last Achievements I dont use a Camera class. I am setting the view angles directly as so:
float * viewX = ( float *)0xB2C38C; float * viewY = ( float *)0xB2C388;
*viewX += fAngleX;
*viewY += fAngleY; Quote:
Originally Posted by
s0beit yeah, but where is your pCamera? :P
i use the same addresses as you, btw (Nov), ive been having some trouble too,
on the upside, i found out that they left the lean code in MW2, so you can force lean.
__________________
KozmoK
Kozmo is online now
11-23-2009, 06:33 AM
#11 Level 3
Join Date: Dec 2006
Posts: 436
Reputation: 8917 Rep Power: 160
Quote:
Originally Posted by
Kozmo Ok, I have made many aimbots....for the life of me it doesnt aim correctly (spins) and aims at nothing. If I comment out the ViewAngle mod at the end, it puts
the X on the players head just fine, so my shot selection is good. All my offsets are correct.
PHP Code:
void CEngine :: doAim ( void )
{
if(! IsAlive ( GetEntityIndex ( getLocalIndex ())))
return;
float fAngleX = 0.0f ;
float fAngleY = 0.0f ;
float maxDistance = 100.00f ;
vec3_t AimLocation ;
vec3_t targetVec ;
float ScreenX , ScreenY ;
float flXHairDistance = 99999.0f ;
int Target = - 1 ;
unsigned short iHeadTag = RegisterTag ( "j_head" );
for ( unsigned int iPlayers = 0 ; iPlayers < 2048 ; iPlayers ++ )
{
CEntity * myEnt = GetEntityIndex ( iPlayers );
if(! myEnt )
continue;
if( iPlayers == getLocalIndex ())
continue;
if( myEnt -> Type != ET_PLAYER_MP )
continue;
CClientInfo * pClientInfo = GetClientInfoIndex ( iPlayers );
if(! isEnemyTarget ( pClientInfo ))
continue;
float fDistance = GetDistance ( myEnt -> LerpOrigin , m_pRefDef -> Location ) / 48 ;
if(! GetTagPosition ( iHeadTag , myEnt ,& AimLocation ))
continue;
if(! WorldToScreen ( AimLocation , & ScreenX , & ScreenY ))
continue;
float xDelta = m_pRefDef -> iWidth / 2 - ScreenX ;
float yDelta = m_pRefDef -> iHeight / 2 - ScreenY ;
float screenLen = sqrtf ( xDelta * xDelta + yDelta * yDelta );
if( screenLen < flXHairDistance )
{
Target = iPlayers ;
VectorSet ( targetVec , AimLocation [ 0 ], AimLocation [ 1 ], AimLocation [ 2 ] );
flXHairDistance = screenLen ;
}
}
if( Target == - 1 )
return;
if( GetAsyncKeyState ( 0x56 )) //&0x8000)
{
if(! WorldToScreen ( targetVec , & ScreenX , & ScreenY ))
return;
DrawTextWithEngine ( farFont , ScreenX , ScreenY ,& Red , "X" );
GetAngleToOrigin ( targetVec , fAngleX , fAngleY );
* ViewAngleX += fAngleX ;
* ViewAngleY += fAngleY ;
}
}
Can you post your GetTagPosition() prototype or asm code? I see GetTagPos called in 3 difference places but I cannot make out how I can call it.
silverfish is online now
11-23-2009, 07:49 AM
#12 Senior Member Join Date: Jan 2009
Location: Australia
Posts: 87
Reputation: 1882 Rep Power: 57
Last Achievements Quote:
Originally Posted by
silverfish Can you post your GetTagPosition() prototype or asm code? I see GetTagPos called in 3 difference places but I cannot make out how I can call it.
http://www.uc-forum.com/forum/call-d...playertag.html
I explain exactly how to do it i just didnt give out the code. If you check out the aim assist one and find out were its called what i said should make perfect sense to you.
Encrypted92 is offline
Update.....
11-23-2009, 09:54 PM
#13 Donator
Threadstarter Join Date: Sep 2007
Posts: 718
Reputation: 26481 Rep Power: 332
Points: 20,308, Level: 19
Last Achievements Update.....
This is embarrasing... I have narrowed it down to CRefDef class I think!
PHP Code:
class CRefDef { public: char szUnknown0 [ 8 ]; //0x0000 __int32 iWidth ; //0x0008 __int32 iHeight ; //0x000C float fovx ; //0x0010 float fovy ; //0x0014 vec3_t vOrigin ; //0x0018 vec3_t vViewAxis [ 3 ]; //0x0024 char szUnknown1 [ 16200 ]; //0x0048 vec3_t RefDefViewAngles ; //0x3F90 };
__________________
KozmoK
Kozmo is online now
11-24-2009, 12:20 AM
#14 Hax 101
Join Date: Jan 2008
Posts: 355
Reputation: 5711 Rep Power: 114
Last Achievements RefDefViewAngles most likely o.o
|KungFuPenguin| is offline
11-24-2009, 01:21 AM
#15 Donator
Threadstarter Join Date: Sep 2007
Posts: 718
Reputation: 26481 Rep Power: 332
Points: 20,308, Level: 19
Last Achievements Quote:
Originally Posted by
|KungFuPenguin| RefDefViewAngles most likely o.o
I dont think so, I did it two ways and they matched up when logging:
PHP Code:
[ SIZE = 2 ][ COLOR = #008000]//float *refdeflerpAngles= (float *)0x79F200;[/COLOR][/SIZE] [ SIZE = 2 ][ COLOR = #008000][SIZE=2][COLOR=#008000]//add_log("%f=%f %f=%f",refdeflerpAngles[0],m_pRefDef->RefDefViewAngles[0],refdeflerpAngles[1],m_pRefDef->RefDefViewAngles[1]);[/COLOR][/SIZE] [ SIZE = 2 ][ COLOR = #008000][/COLOR][/SIZE][/COLOR][/SIZE]
Here is the log: [23:40:18] 4.004517=4.004517 109.204102=109.204102 [23:40:18] 4.004517=4.004517 109.204102=109.204102 [23:40:18] 4.004517=4.004517 109.204102=109.204102 [23:40:18] 4.004517=4.004517 109.204102=109.204102 [23:40:18] 4.004517=4.004517 109.204102=109.204102 [23:40:18] -26.674805=-26.674805 104.913940=104.913940 [23:40:18] -26.674805=-26.674805 104.913940=104.913940 [23:40:18] -26.674805=-26.674805 104.913940=104.913940 [23:40:18] -26.674805=-26.674805 104.913940=104.913940 [23:40:18] -26.674805=-26.674805 104.913940=104.913940 [23:40:18] 85.000000=85.000000 122.129517=122.129517 [23:40:18] 85.000000=85.000000 122.129517=122.129517 [23:40:18] 85.000000=85.000000 122.129517=122.129517 [23:40:18] 85.000000=85.000000 122.129517=122.129517 [23:40:18] 85.000000=85.000000 122.129517=122.129517 [23:40:18] 10.309448=10.309448 68.263550=68.263550 [23:40:18] 10.309448=10.309448 68.263550=68.263550 [23:40:18] 10.309448=10.309448 68.263550=68.263550 [23:40:18] 10.309448=10.309448 68.263550=68.263550 [23:40:18] 10.309448=10.309448 68.263550=68.263550 [Auto Merged - 5:02:55 UTC] Thanks to Kanavel My aimbot is working now. The code posted is working code, my mistake was elsewhere. HE IS THE MAN
__________________
KozmoK
Last edited by Kozmo; 11-24-2009 at 03:48 PM .
Kozmo is online now
11-24-2009, 10:08 AM
#16 The Legendary Cheater Join Date: Nov 2008
Location: Sweden
Posts: 486
Reputation: 17501 Rep Power: 224
So what was the problemo? :P
__________________
Moo. ‾\(º_˚ )/‾
Nov is online now
11-24-2009, 03:42 PM
#17 Join Date: Oct 2008
Posts: 58
Reputation: 141 Rep Power: 0
great, now u can release it lol
pcwiz123 is offline
11-24-2009, 04:20 PM
#18 « Forum Admin »
Join Date: Nov 2004
Posts: 3,163
Reputation: 85707 Rep Power: 1009
Quote:
Originally Posted by
pcwiz123 great, now u can release it lol
he already did release it, the working code is on the first post.
Winslow is online now
11-24-2009, 05:35 PM
#19 Donator
Threadstarter Join Date: Sep 2007
Posts: 718
Reputation: 26481 Rep Power: 332
Points: 20,308, Level: 19
Last Achievements Quote:
Originally Posted by
Nov So what was the problemo? :P
I was hooking a render function that allowed me to see my engine drawing functions at the main menu - Which you don't get when you hook EndFrame. It worked great for my esp, but not so great for setting the ViewAngles - It was doing it more then once per frame I think, causeng it to be jacked up!
I must have spent 8 hours on doing my aimbot every which way but lose, while all my aimbot code was 100% correct. Sometimes you need a second set of eyes to help you through tought times.
KozmoK out!
__________________
KozmoK
Kozmo is online now
11-24-2009, 07:47 PM
#20 Hax 101
Join Date: Jan 2008
Posts: 355
Reputation: 5711 Rep Power: 114
Last Achievements Well for mine i hook clientframe and it sets the view angles just fine. Unless that isnt the one you used..
|KungFuPenguin| is offline
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 03:00 PM .