Advertisement
BitEmE

GTA V - SHARED DATA

Jun 22nd, 2014
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.02 KB | None | 0 0
  1. /*****************************************************************************\
  2.  
  3. Copyright (C) 2013-2014 - bitE mE - <bitE0mE at outlook dot com>
  4.  
  5. This software is provided 'as-is', without any express or implied
  6. warranty.  In no event will the authors be held liable for any damages
  7. arising from the use of this software.
  8.  
  9. Permission is granted to anyone to use this software for any purpose,
  10. including commercial applications, and to alter it and redistribute it
  11. freely, subject to the following restrictions:
  12.  
  13. 1. The origin of this software must not be misrepresented; you must not
  14. claim that you wrote the original software. If you use this software
  15. in a product, an acknowledgment in the product documentation would be
  16. appreciated but is not required.
  17. 2. Altered source versions must be plainly marked as such, and must not be
  18. misrepresented as being the original software.
  19. 3. This notice may not be removed or altered from any source distribution.
  20.  
  21. \*****************************************************************************/
  22.  
  23. static int GetSizeFromFlag(int flag, int baseSize)
  24. {
  25.     baseSize <<= (int)(flag & 0xf);
  26.     int size = (int)
  27.                 ((((flag >> 17) & 0x7f) +
  28.                 (((flag >> 11) & 0x3f) << 1) +
  29.                 (((flag >> 7) & 0xf) << 2) +
  30.                 (((flag >> 5) & 0x3) << 3) +
  31.                 (((flag >> 4) & 0x1) << 4)) * baseSize);
  32.    
  33.     for (int i = 0; i < 4; ++i)
  34.         size += (((flag >> (24 + i)) & 1) == 1) ? (baseSize >> (1 + i)) : 0;
  35.  
  36.     return size;
  37. }
  38.  
  39. static int GetFlagFromSize(int size, int baseSize)
  40. {
  41.     if (size % baseSize != 0)
  42.         return -1;
  43.  
  44.     for (int i = 0; i < 0x7FFFFFFF; i++)
  45.     {
  46.         if (GetSizeFromFlag(i, baseSize) == size)
  47.             return i;
  48.     }
  49.    
  50.     return -1;
  51. }
  52.  
  53. // Pads:
  54. enum eVPADStates {
  55.     PAD_RSTICK_DOWN,
  56.     PAD_RSTICK_UP,
  57.     PAD_RSTICK_LEFT,
  58.     PAD_DPAD_NONE,
  59.     PAD_DPAD_UPDOWN,
  60.     PAD_DPAD_ALL,
  61.     PAD_LSTICK_DOWN,
  62.     PAD_LSTICK_UP,
  63.     PAD_LSTICk_LEFT,
  64.     PAD_DPAD_DOWN,
  65.     PAD_DPAD_UP,
  66.     PAD_LSTICK_ALL,
  67.     PAD_DPAD_LEFT,
  68.     PAD_DPAD_RIGHT,
  69.     PAD_RSTICK_ALL,
  70.     PAD_RSTICK_NONE,
  71.     PAD_LSTICK_RIGHT,
  72.     PAD_RSTICK_ROTATE,
  73.     PAD_LSTICK_NONE,
  74.     PAD_RSTICK_UPDOWN,
  75.     PAD_LSTICK_UPDOWN,
  76.     PAD_LSTICK_ROTATE,
  77.     PAD_DPAD_LEFTRIGHT,
  78.     PAD_RSTICK_LEFTRIGHT,
  79.     PAD_RSTICK_RIGHT,
  80.     PAD_LSTICK_LEFTRIGHT
  81. };
  82.  
  83. // Traffic light colors:
  84. enum eVTrafficLightColors {
  85.     TRAFFICLIGHT_DONTWALK_COLOR = 0x8201166C,
  86.     TRAFFICLIGHT_WALK = 0x82011688,
  87.     TRAFFICLIGHT_NEARFADEEND = 0x820116A0,
  88.     TRAFFICLIGHT_NEARFADESTART = 0x820116BC,
  89.     TRAFFICLIGHT_FARFADEEND = 0x820116D8,
  90.     TRAFFICLIGHT_FARFADESTART = 0x820116F0,
  91.     TRAFFICLIGHT_AMBER.COLOR = 0x8201170C,
  92.     TRAFFICLIGHT_GREEN.COLOR = 0x82011728,
  93.     TRAFFICLIGHT_RED.COLOR = 0x82011744
  94. };
  95.  
  96. // General offsets
  97. enum eVTrafficLightInfo {
  98.     dwTrafficLightsInfo = 0x82011744,
  99.     dwTrafficLight_1 = 0x82011D48,
  100.     dwTrafficLight_1 = 0x82011D38,
  101.     dwTrafficLight_2 = 0x82011D28,
  102.     dwTrafficLight_3 = 0x82011D18
  103. };
  104.  
  105. /*
  106. static DWORD dwFilePath_LEVELS_XML = 0x82011F68;
  107. static DWORD dwFilePath_GARAGES = 0x820128AC;
  108. static DWORD dwFilePath_STARTUP = 0x820130B8;
  109. static DWORD dwFilePath_SCALEFORMPREALLOCATION = 0x82013090;
  110. static DWORD dwFilePath_DEFAULT = 0x82013078;
  111. static DWORD dwFilePath_SHADERS = 0x82015744;
  112.  
  113. // General addresses
  114. .text:82575A80 RegisterGameClassesInstances : # CODE XREF : sub_82577270 + 2Cp
  115. .text:82577270 LoadGame : # CODE XREF : .text : loc_8257782Cp
  116.  
  117. .text:82577284                   bl        NotifyEngineToLoad
  118. .text : 82577288                 bl        RegisterRAGEClasses
  119. .text : 8257728C                 bl        RegisterBackgroundGTAClasses
  120. .text : 82577290                 bl        RegisterGTAInstances
  121. .text : 82577294                 bl        ReigsterGameClasses
  122. .text : 82577298                 bl        RegisterUserClasses
  123. .text : 8257729C                 bl        RegisterGameClassesInstances
  124. .text : 825772A0                 bl        RegisterInGameClasses
  125. .text : 825772A4                 bl        RegisterRAGEBackgroundClasses
  126. .text : 825772A8                 bl        RegisterGraphicsClasses
  127. .text : 825772AC                 bl        ReigsterMemoryManagementClasses
  128.  
  129. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement