Advertisement
BaSs_HaXoR

C++ MW3 Structs

Oct 13th, 2014
1,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.11 KB | None | 0 0
  1. //Some structs
  2.  
  3. struct Vector3;
  4. struct gentity_s;
  5. struct playerState_s;
  6. struct Vector3
  7. {
  8.     float v[3];
  9.     Vector3(float v1, float v2, float v3)
  10.     {
  11.         v[0] = v1; v[1] = v2; v[2] = v3;
  12.     }
  13.     VOID Print(PCHAR Text)
  14.     {
  15.         DbgPrint("%s addr: %X v1: %f v2: %f v3: %f\n", Text, v, v[0], v[1], v[2]);
  16.     }
  17. };
  18. struct gentity_s
  19. {
  20.     INT EntityNumber;
  21.     BYTE _0x4[0x14];
  22.     Vector3 Origin;
  23.     BYTE _0x1B[0x18];
  24.     Vector3 Angles;
  25.     BYTE _0x36[0x110];
  26.     playerState_s* playerState;
  27.     BYTE _0x15C[0xC];
  28.     UINT16 ModelIndex;
  29.     BYTE _0x16A[0x32];
  30.     INT Health;
  31.     BYTE _0x1A0[0xE0];
  32. };
  33. struct playerState_s
  34. {
  35.     BYTE _0x0[0x1C];
  36.     Vector3 Origin;
  37.     Vector3 Velocity;
  38.     BYTE _0x22[0x32E4];
  39.     INT Score;
  40.     BYTE _0x331C[0x70];
  41.     CHAR PlayerName[32];
  42.     INT MaxHealth;
  43.     BYTE _0x33B0[0x24];
  44.     INT Team;
  45.     BYTE _0x33D8[0x78];
  46.     CHAR ClanTag[4];
  47.     BYTE _0x3454[0x1A8];
  48.     INT MovementFlags;
  49.     BYTE _0x3600[0x380];
  50.  
  51.     VOID SetOrigin(Vector3 NewOrigin)
  52.     {
  53.         memcpy((PVOID)Origin.v, (PVOID)NewOrigin.v, sizeof(float) * 3);
  54.     }
  55.     VOID SetVelocity(Vector3 NewVelocity)
  56.     {
  57.         memcpy((PVOID)Velocity.v, (PVOID)NewVelocity.v, sizeof(float) * 3);
  58.     }
  59. };
  60. gentity_s *gentity(INT Index)
  61. {
  62.     return (gentity_s*)(0x82DCCC80 + (Index * 0x280));
  63. }
  64. DWORD gclient(INT Client)
  65. {
  66.     return *(DWORD*)(0x834C0480 + 0x205E90) + (Client * 0x68B80);
  67. }
  68.  
  69.  
  70.  
  71. //Some functions
  72.  
  73.  
  74. VOID (__cdecl *ClientCommand)(INT ClientNumber) = (VOID (__cdecl *)(INT))0x82239C80;
  75. BOOL (__cdecl *Dvar_GetBool)(PCHAR Dvar) = (BOOL (__cdecl *)(PCHAR))0x8232E200;
  76. PCHAR (__cdecl *Dvar_GetString)(PCHAR Dvar) = (PCHAR (__cdecl *)(PCHAR))0x8232E3C0;
  77. VOID (__cdecl *SV_Cmd_EndTokenizedString)() = (VOID (__cdecl *)())0x82288988;
  78. VOID (__cdecl *SV_Cmd_TokenizeString)(PCHAR TextIn) = (VOID (__cdecl *)(PCHAR))0x82288968;
  79. UINT16 (__cdecl *Scr_ExecEntThreadNum)(INT EntityNumber, UINT32 ClassNumber, INT Handle, UINT32 ParameterCount) = (UINT16 (__cdecl *)(INT, UINT32, INT, UINT32))0x822C40C0;
  80. VOID (__cdecl *CBuf_AddText)(INT LocalClientNumber, PCHAR Text) = (VOID (__cdecl *)(INT, PCHAR))0x82287EE0;
  81. PCHAR (__cdecl *va)(PCHAR Format, ...) = va = (PCHAR (__cdecl *)(PCHAR, ...))0x82336528;
  82.  
  83.  
  84.  
  85. //Monitor connection/disconnection damage and death + more
  86. //Code (Text):
  87. UINT16 Scr_ExecEntThread(gentity_s *gentity, INT Handle, UINT32 ParameterCount)
  88. {
  89.     //DbgPrint("Scr_ExecEntThread - gentity[%X] Handle[%X] ParameterCount[%X]\n", gentity, Handle, ParameterCount);
  90.  
  91.     switch(Handle)
  92.     {
  93.     case 0x1037F4:
  94.         DbgPrint("Player %i Connected!\n", gentity->EntityNumber);
  95.         break;
  96.     case 0x103814:
  97.         DbgPrint("Player %i Disconnected!\n", gentity->EntityNumber);
  98.         break;
  99.     case 0x103822:
  100.         //DbgPrint("Player %i Damaged!\n", gentity->EntityNumber);
  101.         break;
  102.     case 0x103851:
  103.         //DbgPrint("Player %i Killed!\n", gentity->EntityNumber);
  104.         break;
  105.     }
  106.  
  107.     return Scr_ExecEntThreadNum(gentity->EntityNumber, NULL, Handle, ParameterCount);
  108. }
  109.  
  110.  
  111.  
  112.  
  113. //Then add this
  114. //Code (Text):
  115. DetourFunction((PDWORD)0x8226AEE8, (DWORD)Scr_ExecEntThread);
  116.  
  117. For a modded lobby
  118. Code (Text):
  119.     *(UINT16*)(0x8222E59C + 0x02) = 450; // G_Speed
  120.     *(FLOAT*)0x82001D68 = 999; // Super Jump
  121.     *(FLOAT*)0x82000C04 = 9999; // No Fall
  122.     *(INT*)0x820F63E4 = 0x7D495378; // Unlimited Ammo - mr r9, r10
  123.     *(INT*)0x820F46DC = 0x39600000; // Full Auto Guns - li r11, 0
  124.     *(INT*)0x82233A7C = 0x60000000; // Disable PlayerCmd_FreezeControls
  125.  
  126. Real Godmode (no blood)
  127. Code (Text):
  128. gentity(Client)->playerState->MaxHealth = 9999;
  129. gentity(Client)->Health = 9999;
  130.  
  131.  
  132.  
  133. //----------------------------------------------------------------------
  134.  
  135. *(int*)(getEntity(clientIndex) + 0x184) = 1; -> god mode On
  136. *(int*)(getEntity(clientIndex) + 0x184) = 0; -> god mode Off
  137. *(int*)(getEntity(clientIndex) + 0x184) = 3; -> no Knockback but no godMode
  138. *(int*)(getEntity(clientIndex) + 0x184) = 2; -> demigod (i think)
  139.  
  140.  
  141.  
  142.  
  143. //SOURCE http://www.se7ensins.com/forums/threads/all-important-and-useful-mw3-offsets-tu23-some-bytes.1194562/page-3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement