samedi 22 février 2014

[Need some help] Aim bot VecDir Write topic




hi, me and some friend work on an external tool for arma (esp, aimbot, radar etc...)

We have an aimbot who use w32 api to move the mouse, this is pretty good but i wana be more precise.

I found this source for arma 2
-> http://www.unknowncheats.me/forum/793035-post7.html

so i convert this code to c# for arma 3


Code C#

public static void MoveYaw(float degrees)
        {

            //Get Current player
            var Self = PlayerManager.GetPlayer();
            //Get Vec3 Dir
            var SelfDir = Vec3.ReadMemory( Self.entityStruct.VecPosPtr + 0x1c );
           
            var coordsOfs = Self.entityStruct.VecPosPtr + 0x1c;

            double angle = Math.Atan2(SelfDir.x, SelfDir.z) * (180/Math.PI);

            if (angle < 0) angle += 360;

            var writeVal = degreeToYaw((float)angle + degrees, SelfDir.x, SelfDir.z);

            WriteMemory(coordsOfs, writeVal.y);
            WriteMemory(coordsOfs+0x8, writeVal.x);

        }

        private static Vec2 degreeToYaw(float degrees, float dy, float dx)
        {
            double theta = degrees*Math.PI/180;
            double len = Math.Sqrt(dx*dx + dy*dy);
            Vec2 v2;
            v2.x = (float) (len*Math.Cos(theta));
            v2.y = (float) (len*Math.Sin(theta));

            return v2;
        }


Self.entityStruct.VecPosPtr + 0x1c -> EntityPtr + 0x68] + 0x1c (Ofs for entity Vec3 Dir)

invert x, y, z in this code seem chinese for me, i just copy/convert and paste.
The trouble is when i write the memory with the result, my charactere seem to have a strange reaction :
- never stop he's movement, cant go to the left or right with my mouse (depend on the argument degrees i have been send ;D)

If someone have a solution i will take it with pleasure !





Aucun commentaire:

Enregistrer un commentaire