daily pastebin goal
91%
SHARE
TWEET

Untitled

a guest May 16th, 2018 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Offsets::Initialise()
  2. {
  3.     // Modules
  4.     Modules::Client = Utilities::Memory::WaitOnModuleHandle("client.dll");
  5.     Modules::Engine = Utilities::Memory::WaitOnModuleHandle("engine.dll");
  6.     Modules::VGUI2 = Utilities::Memory::WaitOnModuleHandle("vgui2.dll");
  7.     Modules::VGUISurface = Utilities::Memory::WaitOnModuleHandle("vguimatsurface.dll");
  8.     Modules::Material = Utilities::Memory::WaitOnModuleHandle("materialsystem.dll");
  9.     Modules::VPhysics = Utilities::Memory::WaitOnModuleHandle("vphysics.dll");
  10.     Modules::Stdlib = Utilities::Memory::WaitOnModuleHandle("vstdlib.dll");
  11.     Modules::InputLib = Utilities::Memory::WaitOnModuleHandle("inputsystem.dll");
  12.  
  13.     //------------------------------------------------------------------------
  14.     // VTables
  15. #pragma region VTables
  16.     VMT::CHL_GetAllClasses = 8;
  17.  
  18.     VMT::Engine_GetScreenSize = 5;
  19.     VMT::Engine_GetPlayerInfo = 8;
  20.     VMT::Engine_GetLocalPlayer = 12;
  21.     VMT::Engine_Time = 14;
  22.     VMT::Engine_GetViewAngles = 18;
  23.     VMT::Engine_SetViewAngles = 19;
  24.     VMT::Engine_GetMaxClients = 20;
  25.     VMT::Engine_IsConnected = 27;
  26.     VMT::Engine_IsInGame = 26;
  27.     VMT::Engine_WorldToScreenMatrix = 37;
  28.     VMT::Engine_ClientCmd_Unrestricted = 114;
  29.  
  30.     VMT::Panel_GetName = 36;
  31.     VMT::Panel_PaintTraverse = 41;
  32.  
  33.     VMT::Surface_DrawSetColorA = 14;
  34.     VMT::Surface_DrawSetColorB = 15;
  35.     VMT::Surface_DrawFilledRect = 16;
  36.     VMT::Surface_DrawOutlinedRect = 18;
  37.     VMT::Surface_DrawLine = 19;
  38.     VMT::Surface_DrawSetTextFont = 23;
  39.     VMT::Surface_DrawSetTextColorA = 24;
  40.     VMT::Surface_DrawSetTextColorB = 25;
  41.     VMT::Surface_DrawSetTextPos = 26;
  42.     VMT::Surface_DrawPrintText = 28;
  43.     VMT::Surface_DrawSetTextureRGBA = 37;
  44.     VMT::Surface_DrawSetTexture = 38;
  45.     VMT::Surface_CreateNewTextureID  = 43;
  46.     VMT::Surface_FontCreate = 71;
  47.     VMT::Surface_SetFontGlyphSet = 72;
  48.     VMT::Surface_GetTextSize = 79;
  49.     VMT::Surface_DrawOutlinedCircle = 103;
  50.     VMT::Surface_SurfaceGetCursorPos = 66;
  51.     VMT::Surface_DrawTexturedPolygon = 106;
  52.  
  53.     VMT::Material_GetName = 0;
  54.     VMT::Material_SetMaterialVarFlag = 30;
  55.     VMT::Material_GetMaterialVarFlag = 31;
  56.     VMT::Material_AlphaModulate = 28;
  57.     VMT::Material_ColorModulate = 29;
  58.     VMT::Material_IncrementReferenceCount = 14;
  59.    
  60.     VMT::MaterialSystem_FindMaterial = 84;
  61.     VMT::MaterialSystem_CreateMaterial = 83;
  62.    
  63.     VMT::ModelRender_ForcedMaterialOverride = 1;
  64.     VMT::ModelRender_DrawModelExecute = 21;
  65.    
  66.     VMT::ModelInfo_GetModelName = 3;
  67.     VMT::ModelInfo_GetStudiomodel = 30;
  68.  
  69.     VMT::RenderView_SetBlend = 4;
  70.     VMT::RenderView_SetColorModulation = 6;
  71.  
  72. #pragma endregion Contains the VTable Indexs
  73.  
  74.     // I cbf trying to get the KeyValues part of the SDK working solo, so we'll just
  75.     // Do some dirty shit
  76.     Functions::KeyValues_KeyValues = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\x68\x00\x00\x00\x00\x8B\xC8\xE8\x00\x00\x00\x00\x89\x45\xFC\xEB\x07\xC7\x45\x00\x00\x00\x00\x00\x8B\x03\x56", "x????xxx????xxxxxxx?????xxx");
  77.     Functions::KeyValues_KeyValues += 7;
  78.     Functions::KeyValues_KeyValues = Functions::KeyValues_KeyValues + *reinterpret_cast< PDWORD_PTR >(Functions::KeyValues_KeyValues + 1) + 5;
  79.  
  80.     Functions::KeyValues_LoadFromBuffer = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\xE8\x00\x00\x00\x00\x80\x7D\xF8\x00\x00\x00\x85\xDB", "x????xxxx??xx");
  81.     Functions::KeyValues_LoadFromBuffer = Functions::KeyValues_LoadFromBuffer + *reinterpret_cast< PDWORD_PTR >(Functions::KeyValues_LoadFromBuffer + 1) + 5;
  82.  
  83.     Functions::dwCalcPlayerView = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\x84\xC0\x75\x08\x57\x8B\xCE\xE8\x00\x00\x00\x00\x8B\x06", "xxxxxxxx????xx");
  84.  
  85.     Functions::dwGetPlayerCompRank = GameUtils::FindPattern1(strenc("client.dll"), strenc("55 8B EC 8B 0D ? ? ? ? 68 ? ? ? ? "));
  86.  
  87.     Functions::dwIsReady = GameUtils::FindPattern1(strenc("client.dll"), strenc("55 8B EC 51 56 8B 35 ? ? ? ? 80 7E 58 00"));
  88.  
  89.     Utilities::Log("Offsets/Indexes Up to Date");
  90. }
  91.  
  92. namespace Offsets
  93. {
  94.     // Addresses of loaded game modules
  95.     namespace Modules
  96.     {
  97.         DWORD Client;
  98.         DWORD Engine;
  99.         DWORD VGUI2;
  100.         DWORD VGUISurface;
  101.         DWORD Material;
  102.         DWORD VPhysics;
  103.         DWORD Stdlib;
  104.         DWORD Offsets::Modules::InputLib;
  105.     };
  106.  
  107.     // Virtual Method Table Indexes
  108.     namespace VMT
  109.     {
  110.         //CHL Client
  111.         DWORD CHL_GetAllClasses;
  112.  
  113.         //Engine Client
  114.         DWORD Engine_GetScreenSize;
  115.         DWORD Engine_GetPlayerInfo;
  116.         DWORD Engine_GetLocalPlayer;
  117.         DWORD Engine_Time;
  118.         DWORD Engine_GetViewAngles;
  119.         DWORD Engine_SetViewAngles;
  120.         DWORD Engine_GetMaxClients;
  121.         DWORD Engine_IsConnected;
  122.         DWORD Engine_IsInGame;
  123.         DWORD Engine_WorldToScreenMatrix;
  124.         DWORD Engine_GetNetChannelInfo;
  125.         DWORD Engine_ClientCmd_Unrestricted;
  126.  
  127.         // Panels
  128.         DWORD Panel_GetName;
  129.         DWORD Panel_PaintTraverse;
  130.  
  131.         // Surface
  132.         DWORD Surface_DrawSetColorA;
  133.         DWORD Surface_DrawSetColorB;
  134.         DWORD Surface_DrawFilledRect;
  135.         DWORD Surface_DrawOutlinedRect;
  136.         DWORD Surface_DrawLine;
  137.         DWORD Surface_DrawSetTextFont;
  138.         DWORD Surface_DrawSetTextColorA;
  139.         DWORD Surface_DrawSetTextColorB;
  140.         DWORD Surface_DrawSetTextPos;
  141.         DWORD Surface_DrawPrintText;
  142.         DWORD Surface_DrawSetTextureRGBA;
  143.         DWORD Surface_DrawSetTexture;
  144.         DWORD Surface_CreateNewTextureID;
  145.         DWORD Surface_FontCreate;
  146.         DWORD Surface_SetFontGlyphSet;
  147.         DWORD Surface_GetTextSize;
  148.         DWORD Surface_DrawOutlinedCircle;
  149.         DWORD Surface_SurfaceGetCursorPos;
  150.         DWORD Surface_DrawTexturedPolygon;
  151.  
  152.         DWORD Material_GetName;
  153.         DWORD Material_SetMaterialVarFlag;
  154.         DWORD Material_GetMaterialVarFlag;
  155.         DWORD Material_AlphaModulate;
  156.         DWORD Material_ColorModulate;
  157.         DWORD Material_IncrementReferenceCount;
  158.  
  159.         DWORD MaterialSystem_FindMaterial;
  160.         DWORD MaterialSystem_CreateMaterial;
  161.  
  162.         DWORD ModelRender_ForcedMaterialOverride;
  163.         DWORD ModelRender_DrawModelExecute;
  164.  
  165.         DWORD ModelInfo_GetModelName;
  166.         DWORD ModelInfo_GetStudiomodel;
  167.  
  168.         DWORD RenderView_SetBlend;
  169.         DWORD RenderView_SetColorModulation;
  170.  
  171.         // Weapon entities
  172.         DWORD Weapon_GetSpread;
  173.     };
  174.  
  175.     // Addresses of engine functions to call
  176.     namespace Functions
  177.     {
  178.         DWORD KeyValues_KeyValues;
  179.         DWORD KeyValues_LoadFromBuffer;
  180.         DWORD dwCalcPlayerView;
  181.         DWORD dwGetPlayerCompRank;
  182.         DWORD dwIsReady;
  183.     };
  184.  
  185. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top