Of pitch curving.

Hacking Any Other First-Person Shooter Game

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Of pitch curving.

Postby Johnson » Tue Oct 04, 2011 1:37 pm

How do I disable pitch curving, or an acceleration curve?
Johnson
I Ask A Lot Of Questions
 
Posts: 19
Joined: Mon Apr 28, 2008 6:33 pm

Re: Of pitch curving.

Postby L. Spiro » Tue Oct 04, 2011 1:52 pm

What he is asking is sometimes you hack an FPS game and you see a 16-bit number going up and down as you aim your character up and down (*cough* Unreal Tournament 2003 *cough*).
This is a sin/cos table. The 16-bit value is used to index into a table of 65,535 floats for sine values and 65,535 floats for cosine values.

Today, these tables cannot keep up with simply calling cos() or sin() due to the slowness of cache hits using tables vs. the raw speed of the FPU at simply calculating these numbers.
But they were more efficient back in the day.


So you have encountered this 16-but unsigned short that moves up and down as you angle up and down. What do you do with it? Use it as an index into one of the tables, of course.

One way is to find the tables in the game RAM.
You could copy them to your local RAM for efficient access, or use ithem directly if you are using DLL injection.


Another way is to generate your own tables. The code below illustrates how to make and use the tables.
Code: Select all
#define LSM_TABLESIZE            (0xFFFF+1)


   LSREAL      CMathLib::m_fCosTable[LSM_TABLESIZE] = { LSM_ZERO };
   LSREAL      CMathLib::m_fSinTable[LSM_TABLESIZE] = { LSM_ZERO };



         // Create a cos/sin look-up tables.
         for ( LSINT32 I = LSM_TABLESIZE; --I >= 0; ) {
            LSREAL fCos = LSMCOS( (2.0 * LSM_PI_DOUBLE / LSM_TABLESIZE) * I );
            LSREAL fSin = LSMSIN( (2.0 * LSM_PI_DOUBLE / LSM_TABLESIZE) * I );
            m_fCosTable[I] = fCos;
            m_fSinTable[I] = fSin;
         }



Code: Select all
LSMREAL fCos = m_fCosTable[ui16Index];


ui16Index here is the 16-bit value you discovered in the game. fCos represents the cosine of that value.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: Of pitch curving.

Postby Johnson » Tue Oct 04, 2011 2:07 pm

I do not know, whether it uses a table; because I never found indices, but did modify the floats.

What does this mean?
Johnson
I Ask A Lot Of Questions
 
Posts: 19
Joined: Mon Apr 28, 2008 6:33 pm

Re: Of pitch curving.

Postby L. Spiro » Tue Oct 04, 2011 4:25 pm

I don’t know. What floats?
If you did not find indices, what did you find?


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: Of pitch curving.

Postby Johnson » Tue Oct 04, 2011 5:24 pm

I found a vector for the pitch, and a vector for the yaw.

The pitch and yaw are stored in radians, at vPitch.m_rX and vYaw.m_rY.

But the pitch seems to be curved!
Johnson
I Ask A Lot Of Questions
 
Posts: 19
Joined: Mon Apr 28, 2008 6:33 pm

Re: Of pitch curving.

Postby L. Spiro » Tue Oct 04, 2011 8:27 pm

What does “curved” mean?


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: Of pitch curving.

Postby Johnson » Tue Oct 04, 2011 8:42 pm

I was told that the pitch becomes more sensitive around body, but less sensitive around the feet or sky; and that this may be handy for consoles.
Johnson
I Ask A Lot Of Questions
 
Posts: 19
Joined: Mon Apr 28, 2008 6:33 pm

Re: Of pitch curving.

Postby L. Spiro » Wed Oct 05, 2011 6:35 pm

Unless you describe it more clearly I cannot help.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: Of pitch curving.

Postby Johnson » Wed Oct 05, 2011 7:07 pm

Imagine you're playing a FPS with a controller.

Most aiming is done around the center; there it is more sensitive.

Aiming done on extremes is made less sensitive, because would make it a pain on controller.

Or not?
Johnson
I Ask A Lot Of Questions
 
Posts: 19
Joined: Mon Apr 28, 2008 6:33 pm

Re: Of pitch curving.

Postby L. Spiro » Wed Oct 05, 2011 7:50 pm

So what is the data you have and what do you want to do with it?


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: Of pitch curving.

Postby Johnson » Wed Oct 05, 2011 7:58 pm

If an aimbot is to work, it needs to curve the pitch, no?
Johnson
I Ask A Lot Of Questions
 
Posts: 19
Joined: Mon Apr 28, 2008 6:33 pm

Re: Of pitch curving.

Postby L. Spiro » Thu Oct 06, 2011 9:09 am

That is an input mechanism, but an internal mechanism.
An auto-aim only needs to point the player at a target using standard vector math.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Others (FPS)

Who is online

Users browsing this forum: No registered users and 0 guests