Advertisement
Hattiwatti

Frostbitex64.h

May 29th, 2014
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.83 KB | None | 0 0
  1. #ifndef __FrostBiteX64_h
  2. #define __FrostBiteX64_h
  3.  
  4. #define BF4_GAMERENDERER        0x142439140     // 48 8B 0D ? ? ? ? 48 85 C9 74 06 48 8B 01 FF 50 50
  5. #define BF4_CLIENTGAMECONTEXT   0x14242DB68     // 48 8B 0D ? ? ? ? E8 ? ? ? ? 48 8B D8 48 89 44 24 ? 4C 8D B6 ? ? ? ? 49 8B 3E 48 8B AE ? ? ? ? 48 3B FD
  6. #define BF4_MAIN                0x14212BDB8     // 48 89 0D ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? 80 7F 20 00 74 1A
  7.  
  8. #include <windows.h>
  9. #include <DXGI.h>
  10. #include <D3D11.h>
  11. #include <d3d9.h>
  12. #include <d3dx9.h>
  13.  
  14. namespace fb
  15. {
  16.     class ClientPlayerManager;
  17.     class Main;
  18.     class Client;
  19.     class ClientPlayerManager;
  20.     class ClientGameContext;
  21.     class ClientPlayer;
  22.     class GameRenderer;
  23.  
  24.     class Color32
  25.     {
  26.     public:
  27.         union
  28.         {
  29.             struct
  30.             {
  31.                 BYTE R;
  32.                 BYTE G;
  33.                 BYTE B;
  34.                 BYTE A;
  35.             };
  36.             DWORD dwColor;
  37.         };
  38.  
  39.     public:
  40.         Color32(const DWORD _Color)
  41.         {
  42.             dwColor=_Color;
  43.         }
  44.  
  45.         Color32(const BYTE Red,const BYTE Green,const BYTE Blue, const BYTE Alpha)
  46.         {
  47.             A=Alpha;
  48.             R=Red;
  49.             G=Green;
  50.             B=Blue;
  51.         }
  52.     };
  53.  
  54.     class Vec3
  55.     {
  56.     public:
  57.         union
  58.         {
  59.             struct
  60.             {
  61.                 FLOAT x;
  62.                 FLOAT y;
  63.                 FLOAT z;
  64.                 FLOAT w;
  65.             };
  66.             FLOAT data[4];
  67.         };
  68.  
  69.     public:
  70.  
  71.         Vec3()
  72.         {
  73.         }
  74.  
  75.         Vec3(FLOAT X,FLOAT Y,FLOAT Z)
  76.         {
  77.             x = X;
  78.             y = Y;
  79.             z = Z;
  80.         }
  81.     };
  82.  
  83.     class Vec2
  84.     {
  85.     public:
  86.         union
  87.         {
  88.             struct
  89.             {
  90.                 FLOAT x;
  91.                 FLOAT y;
  92.             };
  93.  
  94.             FLOAT data[2];
  95.         };
  96.     };
  97.  
  98.     class Vec4
  99.     {
  100.     public:
  101.         union
  102.         {
  103.             struct
  104.             {
  105.                 FLOAT x;
  106.                 FLOAT y;
  107.                 FLOAT z;
  108.                 FLOAT w;
  109.             };
  110.             FLOAT data[4];
  111.         };
  112.     };
  113.  
  114.     class LinearTransform
  115.     {
  116.     public:
  117.        
  118.         union
  119.         {
  120.             struct
  121.             {
  122.                 Vec3 left;
  123.                 Vec3 up;
  124.                 Vec3 forward;
  125.                 Vec3 trans;
  126.             };
  127.             struct
  128.             {
  129.                 Vec3 m_rows[4];
  130.             };
  131.             FLOAT data[4][4];
  132.         };
  133.  
  134.     public:
  135.         LinearTransform()
  136.         {
  137.         }
  138.     };
  139.  
  140.     template< class T > class WeakPtr
  141.     {
  142.     private:
  143.         T** m_ptr;
  144.  
  145.     public:
  146.         T* GetData()
  147.         {
  148.             if( !m_ptr )
  149.                 return NULL;
  150.  
  151.             if( !*m_ptr )
  152.                 return NULL;
  153.  
  154.             T* ptr = *m_ptr;
  155.  
  156.             return ( T* )( ( DWORD64 )ptr - 0x8 ); //--> Tried "0x0", 0x4 and 0x12
  157.         }
  158.     };
  159.  
  160.     enum ClientState
  161.     {
  162.  
  163.         ClientState_WaitingForStaticBundleLoad,                     // constant 0x0
  164.         ClientState_LoadProfileOptions,                     // constant 0x1
  165.         ClientState_Startup,                     // constant 0x2
  166.         ClientState_StartServer,                     // constant 0x3
  167.         ClientState_WaitingForLevel,                     // constant 0x4
  168.         ClientState_StartLoadingLevel,                     // constant 0x5
  169.         ClientState_WaitingForLevelLoaded,                     // constant 0x6
  170.         ClientState_WaitingForLevelLink,                     // constant 0x7
  171.         ClientState_LevelLinked,                     // constant 0x8
  172.         ClientState_WaitingUIIngame,                     // constant 0x9
  173.         ClientState_WaitingForLoadingScreenUnLoad,                     // constant 0xA
  174.         ClientState_Ingame,                     // constant 0xB
  175.         InGame,                     // constant 0xC
  176.         ClientState_ConnectToServer,                     // constant 0xD
  177.         ClientState_WaitingForFrontEndUnLoad,                     // constant 0xE
  178.         Exiting,                     // constant 0xF
  179.         ClientState_WaitingUIUnload,                     // constant 0x10
  180.         ClientState_None                     // constant 0x11
  181.  
  182.     };
  183.  
  184.     class Client
  185.     {
  186.     public:
  187.         char pad_0x0000[0x28];
  188.         ClientGameContext* m_pGameContext; //0x0028
  189.         __int64 m_pSettings; //0x0030
  190.         char pad_0x0038[0x8];
  191.         ClientPlayerManager* m_pClientPlayerManager; //0x0040
  192.         char pad_0x0048[0x18];
  193.         DWORD_PTR m_pGameTime; //0x0060    
  194.         DWORD_PTR m_pBorderInputNode; //0x0068
  195.         char pad_0x0070[0x8];
  196.         DWORD_PTR m_Level;
  197.         BYTE Pad_0xdnno[0x268];
  198.         ClientState m_state;
  199.     };
  200.  
  201.     class Main
  202.     {
  203.     public:
  204.         char pad_0x0000[0x20];
  205.         BYTE m_isDedicatedServer; //0x0020
  206.         BYTE m_isDedicatedServerData; //0x0021
  207.         BYTE m_isPaused; //0x0022
  208.         char pad_0x0024[0x2D];
  209.         Client* m_pClient; //0x0050
  210.  
  211.         static Main* GetInstance( )
  212.         {
  213.             return *( Main** )( BF4_MAIN ); // 0x1420784B8
  214.         }
  215.     };
  216.  
  217.     class ClientPlayer
  218.     {
  219.     public:
  220.         virtual void Function0( );
  221.         virtual DWORD_PTR GetCharacterEntity( ); // ClientSoldierEntity + 188
  222.         virtual DWORD_PTR GetCharacterUserData( ); // PlayerCharacterUserData
  223.         virtual DWORD_PTR GetEntryComponent( );
  224.         virtual bool InVehicle( );
  225.  
  226.         // +15C0 timetowait
  227.  
  228.         BYTE pad00[0x38];                                // 0x000
  229.         CHAR szName[0x10];                                // 0x040
  230.         char _0x0050[0x137C];
  231.         BYTE m_teamId; //0x13CC
  232.         char _0x13AD[0xF3];
  233.         DWORD_PTR m_pAttachedControllable; //0x14C0
  234.         __int32 m_attachedEntryId; //0x14A8
  235.         char _0x14AC[4];
  236.         DWORD_PTR m_pControlledControllable; //0x14D0
  237.         __int32 m_ControlledEntryId; //0x14B8
  238.         char _0x14BC[44];
  239.         __int64 m_EntryComponent; //0x14E8 fb::ClientPlayerEntryComponent
  240.         __int64 m_PlayerManager; //0x14F0
  241.         __int64 m_ownPlayerView; //0x14F8
  242.         __int64 m_PlayerView; //0x1500
  243.         char _0x1508[24];
  244.         __int64 m_InputConfiguration; //0x1520
  245.         BYTE Pad_1528[0x80];
  246.         DWORD m_squadId;
  247.         bool m_isSquadLeader;
  248.         bool m_privateSquad;
  249.     };
  250.  
  251.     class ClientPlayerManager
  252.     {
  253.     public:
  254.         virtual void function();
  255.  
  256.         BYTE pad00[0x538];                  // 0x00
  257.         ClientPlayer*    m_pLocalPlayer;        // 0x540
  258.     };
  259.  
  260.     class ClientGameContext
  261.     {
  262.     public:
  263.         BYTE pad00[0x60];                        // 0x00
  264.         ClientPlayerManager* m_pPlayerManager;    // 0x60
  265.         static ClientGameContext* GetInstance( )
  266.         {
  267.             return *( ClientGameContext** )( BF4_CLIENTGAMECONTEXT );
  268.         }
  269.     };
  270.  
  271.     class RenderView
  272.     {
  273.     public:
  274.         char _0x0000[64];
  275.         D3DXMATRIX m_Transform; //0x0040
  276.         char _0x0080[52];
  277.         float m_FovY; //0x00B4
  278.         float defualtFovY; //0x00B8
  279.         float nearPlane; //0x00BC
  280.         float farPlane; //0x00C0
  281.         float m_Aspect; //0x00C4
  282.         float orthoWidth; //0x00C8
  283.         float orthoHeight; //0x00CC
  284.         char _0x00D0[384];
  285.         float fovX; //0x0250
  286.         float depthHeightRatio; //0x0254
  287.         float fovScale; //0x0258
  288.         float fovScaleSqr; //0x025C
  289.         D3DXMATRIX m_viewMatrix; //0x0260
  290.         D3DXMATRIX m_viewMatrixTranspose; //0x02A0
  291.         D3DXMATRIX m_viewMatrixInverse; //0x02E0
  292.         D3DXMATRIX m_ProjectionMatrix; //0x0320
  293.         D3DXMATRIX m_viewMatrixAtOrigin; //0x0360
  294.         D3DXMATRIX m_ProjectionTranspose; //0x03A0
  295.         D3DXMATRIX m_ProjectionInverse; //0x03E0
  296.         D3DXMATRIX m_ViewProj; //0x0420
  297.         D3DXMATRIX m_ViewProjTranspose; //0x0460
  298.         D3DXMATRIX m_ViewProjInverse; //0x04A0
  299.         D3DXMATRIX m_UnknMatrix; //0x04E0  
  300.         D3DXMATRIX m_Transform2; //0x0520
  301.         D3DXMATRIX m_UnknMatrix2; //0x0560
  302.     };
  303.  
  304.  
  305.     class GameRenderer
  306.     {
  307.     public:
  308.         BYTE Pad000[0x48];
  309.         DWORD_PTR m_settings;
  310.         BYTE pad00[0x10];                // 0x00
  311.         RenderView* m_pRenderView;        // 0x60
  312.  
  313.         static GameRenderer* GetInstance( )
  314.         {
  315.             return *( GameRenderer** )( BF4_GAMERENDERER );
  316.         }
  317.     };
  318.  
  319. }
  320.  
  321. #endif // __ClientHeader_h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement