Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Создание читов H1Z1. Программная информация

  • Автор темы Автор темы GOVARD
  • Дата начала Дата начала
Администратор
Администратор
Администратор
Статус
Онлайн
Регистрация
20 Янв 2014
Сообщения
7,202
Реакции
8,686
Немного информативного кода для тех людей, кто захочет попробовать себя в создании читов для H1Z1. Также просмотрите тему "H1Z1 Reversal"- это основная тема, которая содержит дамп H1Z1.

Информация H1Z1

Offsets:
Код:
Expand Collapse Copy
World2screen : 0x14030B420
cGame : 0x142CA4128
cGraphics : 0x142CA3E88
firstObject : 0x11D8 
nextObject : 0x350
vec3Location : 0x1D0
name : 0x3CC
classID: 0x500
SizeofEntitys: 0x1020
Playerstate : 0x4F8
Speedhack: 0x4310
Itemvector: 0x1330

Playerstate:
Код:
Expand Collapse Copy
Standing = 0
Crouching = 1
Walking = 2
Running = 3
Jumping = 4
Crouch Walking = 5
Prone = 6

Entity Types:
Код:
Expand Collapse Copy
TYPE_Player = 4,
    TYPE_Zombie = 91,
    TYPE_Zombie2 = 12,

    // Lootables
    TYPE_Dresser = 22,
    TYPE_Armoire = 23,
    TYPE_FileCabinet = 25,
    TYPE_WreckedSedan = 68,
    TYPE_GarbageCan = 38,
    TYPE_Dumpster = 39,
    TYPE_Cabinets = 34,
    TYPE_Cabinets2 = 40,
    TYPE_Cabinets3 = 130,
    TYPE_WreckedTruck = 70,
    TYPE_WreckedVan = 69,
    TYPE_Refrigirator = 37,
    TYPE_MilitaryCache = 147,
    TYPE_ToolCabinet = 49,
    TYPE_Desk = 25,
    TYPE_StorageContainer = 51,
    TYPE_Chest = 66,
    TYPE_LootCache = 127,
    TYPE_Locker = 111,
    TYPE_WeaponsLocker = 112,

    TYPE_WoodenBarricade = 61,

    TYPE_Deer = 19,
    TYPE_Wolf = 20,
    TYPE_Bear = 80,
    TYPE_Rabbit = 85,
    TYPE_Raven = 89,

    TYPE_Food = 21,

    TYPE_GroundTamper = 95,

    TYPE_Furance = 47,
    TYPE_CampFire = 27,
    TYPE_Barbeque = 83,
    TYPE_DewCollector = 54,
    TYPE_FireDrum = 55,

        // Airdrop leftovers or quest caches?
    TYPE_TheMedic_Cache = 152,
    TYPE_TheLoneWolf_Cache = 150,
    TYPE_TheBuilder_Cache = 155,
    TYPE_TheFarmer_Cache = 155,

    TYPE_Trap = 53,
    TYPE_AggressiveItems = 56, // punji sticks, barbed wire

    TYPE_Shed = 76, // wood
    TYPE_LargeShelter = 95,
    TYPE_Shed = 94, // metal
    TYPE_BasicShackDoor = 98,
    TYPE_Stash = 109

    TYPE_Bed = 122,
    TYPE_Misc = 44, // Seems to be a major group like cloths, bandages
    TYPE_Loot = 46,

    TYPE_Door = 25, 
    TYPE_Door2 = 124,
    TYPE_Door3 = 121,
    TYPE_FireHydrant = 125,

    TYPE_OffRoader = 17,
    TYPE_PickupTruck = 114,
    TYPE_PoliceCar = 118,

    TYPE_308_ROUND = 134,
    
    TYPE_Flare = 45,

    TYPE_HandWeapons = 52,

Get Direction (C++):
Код:
Expand Collapse Copy
D3DXVECTOR3 getDirectionShit(QWORD entity)
{
    float fx = entity + 0x1F0;
    float fy = entity + 0x1F4;
    D3DXVECTOR3 r;
    r.x = sinf(fx) * cosf(fy);
    r.y = sin(fy);
    r.z = cosf(fy) * cosf(fx);
    return r;
}

ViewMatrix (C++):
Код:
Expand Collapse Copy
bool WorldToScreen ( const Vector3& World, Vector3& Out ) 
{ 
    DWORD_PTR Graphics = *(DWORD_PTR*)( 0x142CD83A8 ); 
    DWORD_PTR Camera = *(DWORD_PTR*)( Graphics + 0x48 ); 
    DWORD_PTR CameraMatrix = *(DWORD_PTR*)( Camera + 0x20 ); 

    CameraMatrix += 0x10; 

    D3DXMATRIX Matrix = *(D3DXMATRIX*)( CameraMatrix + 0x1A0 ); 

    int ScreenWidth = *(int*)( Graphics + 0x28 ); 
    int ScreenHeight = *(int*)( Graphics + 0x2C ); 

    D3DXMatrixTranspose ( &Matrix, &Matrix ); 

    Matrix._21 *= -1; 
    Matrix._22 *= -1; 
    Matrix._23 *= -1; 
    Matrix._24 *= -1; 

    float w = GetMatrixAxis ( Matrix, 3 ).Dot ( World ) + Matrix.m[3][3]; 

    if ( w < 0.098 ) 
        return false; 

    float x = GetMatrixAxis ( Matrix, 0 ).Dot ( World ) + Matrix.m[0][3]; 
    float y = GetMatrixAxis ( Matrix, 1 ).Dot ( World ) + Matrix.m[1][3]; 

    Out.x = (ScreenWidth / 2) * (1.0 + x / w); 
    Out.y = (ScreenHeight / 2) * (1.0 - y / w); 

    return true; 
}

GetMatrixAxis (C++):
Код:
Expand Collapse Copy
inline Vector3& GetMatrixAxis ( const D3DXMATRIX& matrix, UINT i ) 
{ 
    return *(Vector3*)&matrix.m[i][0]; 
}

Worldtoscreen (C#):
Код:
Expand Collapse Copy
private bool WorldToScreen(Vector3 vector, out Vector3 screen)
        {
            screen = Vector3.Zero;
            Int64 Graphics = Program.processHandle.ReadInt64(0x142CD4228);
            Int64 Camera = Program.processHandle.ReadInt64(Graphics + 0x48);
            Int64 CameraMatrix = Program.processHandle.ReadInt64(Camera + 0x20);
            CameraMatrix += 0x10;
            Matrix _Matrix = Program.processHandle.ReadMatrix(CameraMatrix + 0x1A0);

            int ScreenWidth = Program.processHandle.ReadInt32(Graphics + 0x28);
            int ScreenHeight = Program.processHandle.ReadInt32(Graphics + 0x2C);

            _Matrix.Transpose();

            _Matrix.M21 *= -1;
            _Matrix.M22 *= -1;
            _Matrix.M23 *= -1;
            _Matrix.M24 *= -1;

            float W = Dot(GetMatrixAxis(_Matrix, 3), vector) + _Matrix.M44;

            if (W < 0.098f)
            {
                return false;
            }

            float X = Dot(GetMatrixAxis(_Matrix, 0), vector) + _Matrix.M14;
            float Y = Dot(GetMatrixAxis(_Matrix, 1), vector) + _Matrix.M24;

            screen.X = (ScreenWidth / 2) * (1.0f + X / W);
            screen.Y = (ScreenHeight / 2) * (1.0f - Y / W);

            return true;
        }

GetMatrixAxis (C#):
Код:
Expand Collapse Copy
public static Vector3 GetMatrixAxis(Matrix matrix, int i)
        {
            switch (i)
            {
                case 0:
                    {
                        return new Vector3(matrix.M11, matrix.M12, matrix.M13);
                    }
                case 1:
                    {
                        return new Vector3(matrix.M21, matrix.M22, matrix.M23);
                    }
                case 2:
                    {
                        return new Vector3(matrix.M31, matrix.M32, matrix.M33);
                    }
                case 3:
                    {
                        return new Vector3(matrix.M41, matrix.M42, matrix.M43);
                    }
            }

            return Vector3.Zero;
        }

MapPosition Calculation:
Код:
Expand Collapse Copy
Vector2 mapExtents( 8192.0f, 8192.0f );
Vector3 origin = GetOrigin();
origin += Vector3( 4096.0f, 0.0f, 4096.0f );

float sX = origin.z / ( mapExtents.x / texExtents.x );
float sY = ( mapExtents.y - origin.x ) / ( mapExtents.y / texExtents.y );
 
Назад
Сверху Снизу