📦 Game Update 13963 (2)

This commit is contained in:
a2x 2023-10-20 15:23:43 +10:00
parent 415cbf1ec5
commit 74a0693f53
100 changed files with 845 additions and 630 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "cs2-dumper"
version = "1.1.2"
version = "1.1.3"
authors = ["a2x"]
edition = "2021"
readme = "README.md"
@ -8,6 +8,7 @@ repository = "https://github.com/a2x/cs2-dumper"
license = "MIT"
[dependencies]
anyhow = "1.0"
chrono = "0.4"
clap = { version = "4.4", features = ["derive"] }
convert_case = "0.6"
@ -17,7 +18,6 @@ regex = "1.9"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
simple_logger = "4.2"
thiserror = "1.0"
[dependencies.windows]
version = "0.51"

View File

@ -1,5 +1,15 @@
{
"signatures": [
{
"name": "dwBaseEntityModel_setModel",
"module": "client.dll",
"pattern": "E8 ? ? ? ? F3 0F 10 4C 3B ?",
"operations": [
{
"type": "jmp"
}
]
},
{
"name": "dwBuildNumber",
"module": "engine2.dll",
@ -142,6 +152,34 @@
}
]
},
{
"name": "dwGameEntitySystem_getBaseEntity",
"module": "client.dll",
"pattern": "8B D3 E8 ? ? ? ? 48 8B F8 48 85 C0 74 76",
"operations": [
{
"type": "add",
"value": 2
},
{
"type": "jmp"
}
]
},
{
"name": "dwGameEntitySystem_getHighestEntityIndex",
"module": "client.dll",
"pattern": "33 DB E8 ? ? ? ? 8B 08",
"operations": [
{
"type": "add",
"value": 2
},
{
"type": "jmp"
}
]
},
{
"name": "dwGameRules",
"module": "client.dll",
@ -326,44 +364,6 @@
"length": 6
}
]
},
{
"name": "dwGameEntitySystem_getBaseEntity",
"module": "client.dll",
"pattern": "8B D3 E8 ? ? ? ? 48 8B F8 48 85 C0 74 76",
"operations": [
{
"type": "add",
"value": 2
},
{
"type": "jmp"
}
]
},
{
"name": "dwGameEntitySystem_getHighestEntityIndex",
"module": "client.dll",
"pattern": "33 DB E8 ? ? ? ? 8B 08",
"operations": [
{
"type": "add",
"value": 2
},
{
"type": "jmp"
}
]
},
{
"name": "dwBaseEntityModel_setModel",
"module": "client.dll",
"pattern": "E8 ? ? ? ? F3 0F 10 4C 3B ?",
"operations": [
{
"type": "jmp"
}
]
}
]
}

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.213446 UTC
* 2023-10-20 05:22:27.883081 UTC
*/
public static class AimMatrixOpFixedSettings_t {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.199375900 UTC
* 2023-10-20 05:22:27.859265700 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.231577500 UTC
2023-10-20 05:22:27.907858400 UTC
'''
class AimMatrixOpFixedSettings_t:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.245564500 UTC
* 2023-10-20 05:22:27.931239900 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.957008200 UTC
* 2023-10-20 05:22:29.318309900 UTC
*/
public static class ActiveModelConfig_t {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.930569700 UTC
* 2023-10-20 05:22:29.276213200 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.989492600 UTC
2023-10-20 05:22:29.362919900 UTC
'''
class ActiveModelConfig_t:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:51.017179600 UTC
* 2023-10-20 05:22:29.405160900 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.143205700 UTC
* 2023-10-20 05:22:27.733574 UTC
*/
public static class CEmptyEntityInstance {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.142139400 UTC
* 2023-10-20 05:22:27.731819400 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.144595200 UTC
2023-10-20 05:22:27.735552400 UTC
'''
class CEmptyEntityInstance:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.145727600 UTC
* 2023-10-20 05:22:27.737782400 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:51.044620700 UTC
* 2023-10-20 05:22:29.449205 UTC
*/
public static class CAnimScriptBase {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:51.044401200 UTC
* 2023-10-20 05:22:29.448860 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:51.044839 UTC
2023-10-20 05:22:29.449680900 UTC
'''
class CAnimScriptBase:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:51.045033300 UTC
* 2023-10-20 05:22:29.450005300 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,14 +1,14 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:51.205790700 UTC
* 2023-10-20 05:22:29.721663200 UTC
*/
public static class AnimationsystemDll {
public static class AnimationsystemDll { // animationsystem.dll
public const nint AnimationSystemUtils_001 = 0x64670;
public const nint AnimationSystem_001 = 0x5F1D0;
}
public static class ClientDll {
public static class ClientDll { // client.dll
public const nint LegacyGameUI001 = 0x88FF10;
public const nint Source2ClientUI001 = 0x87E9B0;
public const nint Source2ClientPrediction001 = 0x79C1F0;
@ -19,7 +19,7 @@ public static class ClientDll {
public const nint Source2ClientConfig001 = 0x472CD0;
}
public static class Engine2Dll {
public static class Engine2Dll { // engine2.dll
public const nint SimpleEngineLoopService_001 = 0x1E1FD0;
public const nint ClientServerEngineLoopService_001 = 0x1D7CA0;
public const nint KeyValueCache001 = 0x1D42E0;
@ -54,12 +54,12 @@ public static class Engine2Dll {
public const nint Source2EngineToClient001 = 0x5A1D0;
}
public static class FilesystemStdioDll {
public static class FilesystemStdioDll { // filesystem_stdio.dll
public const nint VAsyncFileSystem2_001 = 0x66D30;
public const nint VFileSystem017 = 0x66D20;
}
public static class HostDll {
public static class HostDll { // host.dll
public const nint Source2Host001 = 0x18E10;
public const nint SinglePlayerSharedMemory001 = 0x18A90;
public const nint SaveRestoreDataVersion001 = 0x18A80;
@ -70,25 +70,25 @@ public static class HostDll {
public const nint DebugDrawQueueManager001 = 0x11710;
}
public static class ImemanagerDll {
public static class ImemanagerDll { // imemanager.dll
public const nint IMEManager001 = 0xC470;
}
public static class InputsystemDll {
public static class InputsystemDll { // inputsystem.dll
public const nint InputSystemVersion001 = 0x28D0;
public const nint InputStackSystemVersion001 = 0x16F0;
}
public static class LocalizeDll {
public static class LocalizeDll { // localize.dll
public const nint Localize_001 = 0x3830;
}
public static class MatchmakingDll {
public static class MatchmakingDll { // matchmaking.dll
public const nint GameTypes001 = 0x50270;
public const nint MATCHFRAMEWORK_001 = 0x101030;
}
public static class Materialsystem2Dll {
public static class Materialsystem2Dll { // materialsystem2.dll
public const nint MaterialUtils_001 = 0x4DB90;
public const nint TextLayout_001 = 0x4A2E0;
public const nint PostProcessingSystem_001 = 0x42A60;
@ -96,67 +96,67 @@ public static class Materialsystem2Dll {
public const nint VMaterialSystem2_001 = 0x25EC0;
}
public static class MeshsystemDll {
public static class MeshsystemDll { // meshsystem.dll
public const nint MeshSystem001 = 0x7270;
}
public static class NavsystemDll {
public static class NavsystemDll { // navsystem.dll
public const nint NavSystem001 = 0x76F0;
}
public static class NetworksystemDll {
public static class NetworksystemDll { // networksystem.dll
public const nint SerializedEntitiesVersion001 = 0xD1A70;
public const nint NetworkSystemVersion001 = 0xBBF80;
public const nint NetworkMessagesVersion001 = 0x9C020;
public const nint FlattenedSerializersVersion001 = 0x7B8A0;
}
public static class PanoramaDll {
public static class PanoramaDll { // panorama.dll
public const nint PanoramaUIEngine001 = 0x57EE0;
}
public static class PanoramaTextPangoDll {
public static class PanoramaTextPangoDll { // panorama_text_pango.dll
public const nint PanoramaTextServices001 = 0x4CBD0;
}
public static class PanoramauiclientDll {
public static class PanoramauiclientDll { // panoramauiclient.dll
public const nint PanoramaUIClient001 = 0x12780;
}
public static class ParticlesDll {
public static class ParticlesDll { // particles.dll
public const nint ParticleSystemMgr003 = 0x52D20;
}
public static class PulseSystemDll {
public static class PulseSystemDll { // pulse_system.dll
public const nint IPulseSystem_001 = 0x5B80;
}
public static class Rendersystemdx11Dll {
public static class Rendersystemdx11Dll { // rendersystemdx11.dll
public const nint RenderUtils_001 = 0x52C90;
public const nint VRenderDeviceMgrBackdoor001 = 0x4A3A0;
public const nint RenderDeviceMgr001 = 0x4A390;
}
public static class ResourcesystemDll {
public static class ResourcesystemDll { // resourcesystem.dll
public const nint ResourceSystem013 = 0x10650;
}
public static class ScenefilecacheDll {
public static class ScenefilecacheDll { // scenefilecache.dll
public const nint SceneFileCache002 = 0x68E0;
public const nint ResponseRulesCache001 = 0x3190;
}
public static class ScenesystemDll {
public static class ScenesystemDll { // scenesystem.dll
public const nint SceneUtils_001 = 0x13D030;
public const nint SceneSystem_002 = 0xCAE10;
public const nint RenderingPipelines_001 = 0x8EED0;
}
public static class SchemasystemDll {
public static class SchemasystemDll { // schemasystem.dll
public const nint SchemaSystem_001 = 0xA930;
}
public static class ServerDll {
public static class ServerDll { // server.dll
public const nint NavGameTest001 = 0xA2D150;
public const nint ServerToolsInfo_001 = 0x831AC0;
public const nint Source2GameClients001 = 0x831AD0;
@ -169,18 +169,18 @@ public static class ServerDll {
public const nint Source2GameDirector001 = 0x13EFC0;
}
public static class SoundsystemDll {
public static class SoundsystemDll { // soundsystem.dll
public const nint SoundOpSystem001 = 0x1567E0;
public const nint SoundOpSystemEdit001 = 0x8BBC0;
public const nint VMixEditTool001 = 0x71740;
public const nint SoundSystem001 = 0x46540;
}
public static class SteamaudioDll {
public static class SteamaudioDll { // steamaudio.dll
public const nint SteamAudio001 = 0x12EE0;
}
public static class Steamclient64Dll {
public static class Steamclient64Dll { // steamclient64.dll
public const nint IVALIDATE001 = 0x833640;
public const nint CLIENTENGINE_INTERFACE_VERSION005 = 0x82F4C0;
public const nint SteamClient020 = 0x62CAF0;
@ -202,39 +202,39 @@ public static class Steamclient64Dll {
public const nint p2pvoicesingleton002 = 0xD5840;
}
public static class Tier0Dll {
public static class Tier0Dll { // tier0.dll
public const nint VStringTokenSystem001 = 0x18C060;
public const nint TestScriptMgr001 = 0x13F3C0;
public const nint VProcessUtils002 = 0x12F540;
public const nint VEngineCvar007 = 0x61920;
}
public static class V8SystemDll {
public static class V8SystemDll { // v8system.dll
public const nint Source2V8System001 = 0x1670;
}
public static class ValveAviDll {
public static class ValveAviDll { // valve_avi.dll
public const nint VAvi001 = 0x2F90;
}
public static class ValveWmfDll {
public static class ValveWmfDll { // valve_wmf.dll
public const nint VMediaFoundation001 = 0x12D0;
}
public static class Vphysics2Dll {
public static class Vphysics2Dll { // vphysics2.dll
public const nint VPhysics2_Handle_Interface_001 = 0x5FA50;
public const nint VPhysics2_Interface_001 = 0x5B7F0;
}
public static class VscriptDll {
public static class VscriptDll { // vscript.dll
public const nint VScriptManager010 = 0x31DA0;
}
public static class VstdlibS64Dll {
public static class VstdlibS64Dll { // vstdlib_s64.dll
public const nint IVALIDATE001 = 0x24FF0;
public const nint VEngineCvar002 = 0x5750;
}
public static class WorldrendererDll {
public static class WorldrendererDll { // worldrenderer.dll
public const nint WorldRendererMgr001 = 0x21530;
}

View File

@ -1,18 +1,18 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:51.204572300 UTC
* 2023-10-20 05:22:29.719798500 UTC
*/
#pragma once
#include <cstddef>
namespace AnimationsystemDll {
namespace AnimationsystemDll { // animationsystem.dll
constexpr std::ptrdiff_t AnimationSystemUtils_001 = 0x64670;
constexpr std::ptrdiff_t AnimationSystem_001 = 0x5F1D0;
}
namespace ClientDll {
namespace ClientDll { // client.dll
constexpr std::ptrdiff_t LegacyGameUI001 = 0x88FF10;
constexpr std::ptrdiff_t Source2ClientUI001 = 0x87E9B0;
constexpr std::ptrdiff_t Source2ClientPrediction001 = 0x79C1F0;
@ -23,7 +23,7 @@ namespace ClientDll {
constexpr std::ptrdiff_t Source2ClientConfig001 = 0x472CD0;
}
namespace Engine2Dll {
namespace Engine2Dll { // engine2.dll
constexpr std::ptrdiff_t SimpleEngineLoopService_001 = 0x1E1FD0;
constexpr std::ptrdiff_t ClientServerEngineLoopService_001 = 0x1D7CA0;
constexpr std::ptrdiff_t KeyValueCache001 = 0x1D42E0;
@ -58,12 +58,12 @@ namespace Engine2Dll {
constexpr std::ptrdiff_t Source2EngineToClient001 = 0x5A1D0;
}
namespace FilesystemStdioDll {
namespace FilesystemStdioDll { // filesystem_stdio.dll
constexpr std::ptrdiff_t VAsyncFileSystem2_001 = 0x66D30;
constexpr std::ptrdiff_t VFileSystem017 = 0x66D20;
}
namespace HostDll {
namespace HostDll { // host.dll
constexpr std::ptrdiff_t Source2Host001 = 0x18E10;
constexpr std::ptrdiff_t SinglePlayerSharedMemory001 = 0x18A90;
constexpr std::ptrdiff_t SaveRestoreDataVersion001 = 0x18A80;
@ -74,25 +74,25 @@ namespace HostDll {
constexpr std::ptrdiff_t DebugDrawQueueManager001 = 0x11710;
}
namespace ImemanagerDll {
namespace ImemanagerDll { // imemanager.dll
constexpr std::ptrdiff_t IMEManager001 = 0xC470;
}
namespace InputsystemDll {
namespace InputsystemDll { // inputsystem.dll
constexpr std::ptrdiff_t InputSystemVersion001 = 0x28D0;
constexpr std::ptrdiff_t InputStackSystemVersion001 = 0x16F0;
}
namespace LocalizeDll {
namespace LocalizeDll { // localize.dll
constexpr std::ptrdiff_t Localize_001 = 0x3830;
}
namespace MatchmakingDll {
namespace MatchmakingDll { // matchmaking.dll
constexpr std::ptrdiff_t GameTypes001 = 0x50270;
constexpr std::ptrdiff_t MATCHFRAMEWORK_001 = 0x101030;
}
namespace Materialsystem2Dll {
namespace Materialsystem2Dll { // materialsystem2.dll
constexpr std::ptrdiff_t MaterialUtils_001 = 0x4DB90;
constexpr std::ptrdiff_t TextLayout_001 = 0x4A2E0;
constexpr std::ptrdiff_t PostProcessingSystem_001 = 0x42A60;
@ -100,67 +100,67 @@ namespace Materialsystem2Dll {
constexpr std::ptrdiff_t VMaterialSystem2_001 = 0x25EC0;
}
namespace MeshsystemDll {
namespace MeshsystemDll { // meshsystem.dll
constexpr std::ptrdiff_t MeshSystem001 = 0x7270;
}
namespace NavsystemDll {
namespace NavsystemDll { // navsystem.dll
constexpr std::ptrdiff_t NavSystem001 = 0x76F0;
}
namespace NetworksystemDll {
namespace NetworksystemDll { // networksystem.dll
constexpr std::ptrdiff_t SerializedEntitiesVersion001 = 0xD1A70;
constexpr std::ptrdiff_t NetworkSystemVersion001 = 0xBBF80;
constexpr std::ptrdiff_t NetworkMessagesVersion001 = 0x9C020;
constexpr std::ptrdiff_t FlattenedSerializersVersion001 = 0x7B8A0;
}
namespace PanoramaDll {
namespace PanoramaDll { // panorama.dll
constexpr std::ptrdiff_t PanoramaUIEngine001 = 0x57EE0;
}
namespace PanoramaTextPangoDll {
namespace PanoramaTextPangoDll { // panorama_text_pango.dll
constexpr std::ptrdiff_t PanoramaTextServices001 = 0x4CBD0;
}
namespace PanoramauiclientDll {
namespace PanoramauiclientDll { // panoramauiclient.dll
constexpr std::ptrdiff_t PanoramaUIClient001 = 0x12780;
}
namespace ParticlesDll {
namespace ParticlesDll { // particles.dll
constexpr std::ptrdiff_t ParticleSystemMgr003 = 0x52D20;
}
namespace PulseSystemDll {
namespace PulseSystemDll { // pulse_system.dll
constexpr std::ptrdiff_t IPulseSystem_001 = 0x5B80;
}
namespace Rendersystemdx11Dll {
namespace Rendersystemdx11Dll { // rendersystemdx11.dll
constexpr std::ptrdiff_t RenderUtils_001 = 0x52C90;
constexpr std::ptrdiff_t VRenderDeviceMgrBackdoor001 = 0x4A3A0;
constexpr std::ptrdiff_t RenderDeviceMgr001 = 0x4A390;
}
namespace ResourcesystemDll {
namespace ResourcesystemDll { // resourcesystem.dll
constexpr std::ptrdiff_t ResourceSystem013 = 0x10650;
}
namespace ScenefilecacheDll {
namespace ScenefilecacheDll { // scenefilecache.dll
constexpr std::ptrdiff_t SceneFileCache002 = 0x68E0;
constexpr std::ptrdiff_t ResponseRulesCache001 = 0x3190;
}
namespace ScenesystemDll {
namespace ScenesystemDll { // scenesystem.dll
constexpr std::ptrdiff_t SceneUtils_001 = 0x13D030;
constexpr std::ptrdiff_t SceneSystem_002 = 0xCAE10;
constexpr std::ptrdiff_t RenderingPipelines_001 = 0x8EED0;
}
namespace SchemasystemDll {
namespace SchemasystemDll { // schemasystem.dll
constexpr std::ptrdiff_t SchemaSystem_001 = 0xA930;
}
namespace ServerDll {
namespace ServerDll { // server.dll
constexpr std::ptrdiff_t NavGameTest001 = 0xA2D150;
constexpr std::ptrdiff_t ServerToolsInfo_001 = 0x831AC0;
constexpr std::ptrdiff_t Source2GameClients001 = 0x831AD0;
@ -173,18 +173,18 @@ namespace ServerDll {
constexpr std::ptrdiff_t Source2GameDirector001 = 0x13EFC0;
}
namespace SoundsystemDll {
namespace SoundsystemDll { // soundsystem.dll
constexpr std::ptrdiff_t SoundOpSystem001 = 0x1567E0;
constexpr std::ptrdiff_t SoundOpSystemEdit001 = 0x8BBC0;
constexpr std::ptrdiff_t VMixEditTool001 = 0x71740;
constexpr std::ptrdiff_t SoundSystem001 = 0x46540;
}
namespace SteamaudioDll {
namespace SteamaudioDll { // steamaudio.dll
constexpr std::ptrdiff_t SteamAudio001 = 0x12EE0;
}
namespace Steamclient64Dll {
namespace Steamclient64Dll { // steamclient64.dll
constexpr std::ptrdiff_t IVALIDATE001 = 0x833640;
constexpr std::ptrdiff_t CLIENTENGINE_INTERFACE_VERSION005 = 0x82F4C0;
constexpr std::ptrdiff_t SteamClient020 = 0x62CAF0;
@ -206,39 +206,39 @@ namespace Steamclient64Dll {
constexpr std::ptrdiff_t p2pvoicesingleton002 = 0xD5840;
}
namespace Tier0Dll {
namespace Tier0Dll { // tier0.dll
constexpr std::ptrdiff_t VStringTokenSystem001 = 0x18C060;
constexpr std::ptrdiff_t TestScriptMgr001 = 0x13F3C0;
constexpr std::ptrdiff_t VProcessUtils002 = 0x12F540;
constexpr std::ptrdiff_t VEngineCvar007 = 0x61920;
}
namespace V8SystemDll {
namespace V8SystemDll { // v8system.dll
constexpr std::ptrdiff_t Source2V8System001 = 0x1670;
}
namespace ValveAviDll {
namespace ValveAviDll { // valve_avi.dll
constexpr std::ptrdiff_t VAvi001 = 0x2F90;
}
namespace ValveWmfDll {
namespace ValveWmfDll { // valve_wmf.dll
constexpr std::ptrdiff_t VMediaFoundation001 = 0x12D0;
}
namespace Vphysics2Dll {
namespace Vphysics2Dll { // vphysics2.dll
constexpr std::ptrdiff_t VPhysics2_Handle_Interface_001 = 0x5FA50;
constexpr std::ptrdiff_t VPhysics2_Interface_001 = 0x5B7F0;
}
namespace VscriptDll {
namespace VscriptDll { // vscript.dll
constexpr std::ptrdiff_t VScriptManager010 = 0x31DA0;
}
namespace VstdlibS64Dll {
namespace VstdlibS64Dll { // vstdlib_s64.dll
constexpr std::ptrdiff_t IVALIDATE001 = 0x24FF0;
constexpr std::ptrdiff_t VEngineCvar002 = 0x5750;
}
namespace WorldrendererDll {
namespace WorldrendererDll { // worldrenderer.dll
constexpr std::ptrdiff_t WorldRendererMgr001 = 0x21530;
}

View File

@ -10,7 +10,7 @@
"comment": null
}
},
"comment": null
"comment": "animationsystem.dll"
},
"ClientDll": {
"data": {
@ -47,7 +47,7 @@
"comment": null
}
},
"comment": null
"comment": "client.dll"
},
"Engine2Dll": {
"data": {
@ -180,7 +180,7 @@
"comment": null
}
},
"comment": null
"comment": "engine2.dll"
},
"FilesystemStdioDll": {
"data": {
@ -193,7 +193,7 @@
"comment": null
}
},
"comment": null
"comment": "filesystem_stdio.dll"
},
"HostDll": {
"data": {
@ -230,7 +230,7 @@
"comment": null
}
},
"comment": null
"comment": "host.dll"
},
"ImemanagerDll": {
"data": {
@ -239,7 +239,7 @@
"comment": null
}
},
"comment": null
"comment": "imemanager.dll"
},
"InputsystemDll": {
"data": {
@ -252,7 +252,7 @@
"comment": null
}
},
"comment": null
"comment": "inputsystem.dll"
},
"LocalizeDll": {
"data": {
@ -261,7 +261,7 @@
"comment": null
}
},
"comment": null
"comment": "localize.dll"
},
"MatchmakingDll": {
"data": {
@ -274,7 +274,7 @@
"comment": null
}
},
"comment": null
"comment": "matchmaking.dll"
},
"Materialsystem2Dll": {
"data": {
@ -299,7 +299,7 @@
"comment": null
}
},
"comment": null
"comment": "materialsystem2.dll"
},
"MeshsystemDll": {
"data": {
@ -308,7 +308,7 @@
"comment": null
}
},
"comment": null
"comment": "meshsystem.dll"
},
"NavsystemDll": {
"data": {
@ -317,7 +317,7 @@
"comment": null
}
},
"comment": null
"comment": "navsystem.dll"
},
"NetworksystemDll": {
"data": {
@ -338,7 +338,7 @@
"comment": null
}
},
"comment": null
"comment": "networksystem.dll"
},
"PanoramaDll": {
"data": {
@ -347,7 +347,7 @@
"comment": null
}
},
"comment": null
"comment": "panorama.dll"
},
"PanoramaTextPangoDll": {
"data": {
@ -356,7 +356,7 @@
"comment": null
}
},
"comment": null
"comment": "panorama_text_pango.dll"
},
"PanoramauiclientDll": {
"data": {
@ -365,7 +365,7 @@
"comment": null
}
},
"comment": null
"comment": "panoramauiclient.dll"
},
"ParticlesDll": {
"data": {
@ -374,7 +374,7 @@
"comment": null
}
},
"comment": null
"comment": "particles.dll"
},
"PulseSystemDll": {
"data": {
@ -383,7 +383,7 @@
"comment": null
}
},
"comment": null
"comment": "pulse_system.dll"
},
"Rendersystemdx11Dll": {
"data": {
@ -400,7 +400,7 @@
"comment": null
}
},
"comment": null
"comment": "rendersystemdx11.dll"
},
"ResourcesystemDll": {
"data": {
@ -409,7 +409,7 @@
"comment": null
}
},
"comment": null
"comment": "resourcesystem.dll"
},
"ScenefilecacheDll": {
"data": {
@ -422,7 +422,7 @@
"comment": null
}
},
"comment": null
"comment": "scenefilecache.dll"
},
"ScenesystemDll": {
"data": {
@ -439,7 +439,7 @@
"comment": null
}
},
"comment": null
"comment": "scenesystem.dll"
},
"SchemasystemDll": {
"data": {
@ -448,7 +448,7 @@
"comment": null
}
},
"comment": null
"comment": "schemasystem.dll"
},
"ServerDll": {
"data": {
@ -493,7 +493,7 @@
"comment": null
}
},
"comment": null
"comment": "server.dll"
},
"SoundsystemDll": {
"data": {
@ -514,7 +514,7 @@
"comment": null
}
},
"comment": null
"comment": "soundsystem.dll"
},
"SteamaudioDll": {
"data": {
@ -523,7 +523,7 @@
"comment": null
}
},
"comment": null
"comment": "steamaudio.dll"
},
"Steamclient64Dll": {
"data": {
@ -604,7 +604,7 @@
"comment": null
}
},
"comment": null
"comment": "steamclient64.dll"
},
"Tier0Dll": {
"data": {
@ -625,7 +625,7 @@
"comment": null
}
},
"comment": null
"comment": "tier0.dll"
},
"V8SystemDll": {
"data": {
@ -634,7 +634,7 @@
"comment": null
}
},
"comment": null
"comment": "v8system.dll"
},
"ValveAviDll": {
"data": {
@ -643,7 +643,7 @@
"comment": null
}
},
"comment": null
"comment": "valve_avi.dll"
},
"ValveWmfDll": {
"data": {
@ -652,7 +652,7 @@
"comment": null
}
},
"comment": null
"comment": "valve_wmf.dll"
},
"Vphysics2Dll": {
"data": {
@ -665,7 +665,7 @@
"comment": null
}
},
"comment": null
"comment": "vphysics2.dll"
},
"VscriptDll": {
"data": {
@ -674,7 +674,7 @@
"comment": null
}
},
"comment": null
"comment": "vscript.dll"
},
"VstdlibS64Dll": {
"data": {
@ -687,7 +687,7 @@
"comment": null
}
},
"comment": null
"comment": "vstdlib_s64.dll"
},
"WorldrendererDll": {
"data": {
@ -696,6 +696,6 @@
"comment": null
}
},
"comment": null
"comment": "worldrenderer.dll"
}
}

View File

@ -1,13 +1,13 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:51.207183800 UTC
2023-10-20 05:22:29.724470400 UTC
'''
class AnimationsystemDll:
class AnimationsystemDll: # animationsystem.dll
AnimationSystemUtils_001 = 0x64670
AnimationSystem_001 = 0x5F1D0
class ClientDll:
class ClientDll: # client.dll
LegacyGameUI001 = 0x88FF10
Source2ClientUI001 = 0x87E9B0
Source2ClientPrediction001 = 0x79C1F0
@ -17,7 +17,7 @@ class ClientDll:
EmptyWorldService001_Client = 0x48BCC0
Source2ClientConfig001 = 0x472CD0
class Engine2Dll:
class Engine2Dll: # engine2.dll
SimpleEngineLoopService_001 = 0x1E1FD0
ClientServerEngineLoopService_001 = 0x1D7CA0
KeyValueCache001 = 0x1D42E0
@ -51,11 +51,11 @@ class Engine2Dll:
Source2EngineToClientStringTable001 = 0x83790
Source2EngineToClient001 = 0x5A1D0
class FilesystemStdioDll:
class FilesystemStdioDll: # filesystem_stdio.dll
VAsyncFileSystem2_001 = 0x66D30
VFileSystem017 = 0x66D20
class HostDll:
class HostDll: # host.dll
Source2Host001 = 0x18E10
SinglePlayerSharedMemory001 = 0x18A90
SaveRestoreDataVersion001 = 0x18A80
@ -65,75 +65,75 @@ class HostDll:
GameModelInfo001 = 0x11CC0
DebugDrawQueueManager001 = 0x11710
class ImemanagerDll:
class ImemanagerDll: # imemanager.dll
IMEManager001 = 0xC470
class InputsystemDll:
class InputsystemDll: # inputsystem.dll
InputSystemVersion001 = 0x28D0
InputStackSystemVersion001 = 0x16F0
class LocalizeDll:
class LocalizeDll: # localize.dll
Localize_001 = 0x3830
class MatchmakingDll:
class MatchmakingDll: # matchmaking.dll
GameTypes001 = 0x50270
MATCHFRAMEWORK_001 = 0x101030
class Materialsystem2Dll:
class Materialsystem2Dll: # materialsystem2.dll
MaterialUtils_001 = 0x4DB90
TextLayout_001 = 0x4A2E0
PostProcessingSystem_001 = 0x42A60
FontManager_001 = 0x37900
VMaterialSystem2_001 = 0x25EC0
class MeshsystemDll:
class MeshsystemDll: # meshsystem.dll
MeshSystem001 = 0x7270
class NavsystemDll:
class NavsystemDll: # navsystem.dll
NavSystem001 = 0x76F0
class NetworksystemDll:
class NetworksystemDll: # networksystem.dll
SerializedEntitiesVersion001 = 0xD1A70
NetworkSystemVersion001 = 0xBBF80
NetworkMessagesVersion001 = 0x9C020
FlattenedSerializersVersion001 = 0x7B8A0
class PanoramaDll:
class PanoramaDll: # panorama.dll
PanoramaUIEngine001 = 0x57EE0
class PanoramaTextPangoDll:
class PanoramaTextPangoDll: # panorama_text_pango.dll
PanoramaTextServices001 = 0x4CBD0
class PanoramauiclientDll:
class PanoramauiclientDll: # panoramauiclient.dll
PanoramaUIClient001 = 0x12780
class ParticlesDll:
class ParticlesDll: # particles.dll
ParticleSystemMgr003 = 0x52D20
class PulseSystemDll:
class PulseSystemDll: # pulse_system.dll
IPulseSystem_001 = 0x5B80
class Rendersystemdx11Dll:
class Rendersystemdx11Dll: # rendersystemdx11.dll
RenderUtils_001 = 0x52C90
VRenderDeviceMgrBackdoor001 = 0x4A3A0
RenderDeviceMgr001 = 0x4A390
class ResourcesystemDll:
class ResourcesystemDll: # resourcesystem.dll
ResourceSystem013 = 0x10650
class ScenefilecacheDll:
class ScenefilecacheDll: # scenefilecache.dll
SceneFileCache002 = 0x68E0
ResponseRulesCache001 = 0x3190
class ScenesystemDll:
class ScenesystemDll: # scenesystem.dll
SceneUtils_001 = 0x13D030
SceneSystem_002 = 0xCAE10
RenderingPipelines_001 = 0x8EED0
class SchemasystemDll:
class SchemasystemDll: # schemasystem.dll
SchemaSystem_001 = 0xA930
class ServerDll:
class ServerDll: # server.dll
NavGameTest001 = 0xA2D150
ServerToolsInfo_001 = 0x831AC0
Source2GameClients001 = 0x831AD0
@ -145,16 +145,16 @@ class ServerDll:
customnavsystem001 = 0x245270
Source2GameDirector001 = 0x13EFC0
class SoundsystemDll:
class SoundsystemDll: # soundsystem.dll
SoundOpSystem001 = 0x1567E0
SoundOpSystemEdit001 = 0x8BBC0
VMixEditTool001 = 0x71740
SoundSystem001 = 0x46540
class SteamaudioDll:
class SteamaudioDll: # steamaudio.dll
SteamAudio001 = 0x12EE0
class Steamclient64Dll:
class Steamclient64Dll: # steamclient64.dll
IVALIDATE001 = 0x833640
CLIENTENGINE_INTERFACE_VERSION005 = 0x82F4C0
SteamClient020 = 0x62CAF0
@ -175,31 +175,31 @@ class Steamclient64Dll:
p2pvoice002 = 0xD8EA0
p2pvoicesingleton002 = 0xD5840
class Tier0Dll:
class Tier0Dll: # tier0.dll
VStringTokenSystem001 = 0x18C060
TestScriptMgr001 = 0x13F3C0
VProcessUtils002 = 0x12F540
VEngineCvar007 = 0x61920
class V8SystemDll:
class V8SystemDll: # v8system.dll
Source2V8System001 = 0x1670
class ValveAviDll:
class ValveAviDll: # valve_avi.dll
VAvi001 = 0x2F90
class ValveWmfDll:
class ValveWmfDll: # valve_wmf.dll
VMediaFoundation001 = 0x12D0
class Vphysics2Dll:
class Vphysics2Dll: # vphysics2.dll
VPhysics2_Handle_Interface_001 = 0x5FA50
VPhysics2_Interface_001 = 0x5B7F0
class VscriptDll:
class VscriptDll: # vscript.dll
VScriptManager010 = 0x31DA0
class VstdlibS64Dll:
class VstdlibS64Dll: # vstdlib_s64.dll
IVALIDATE001 = 0x24FF0
VEngineCvar002 = 0x5750
class WorldrendererDll:
class WorldrendererDll: # worldrenderer.dll
WorldRendererMgr001 = 0x21530

View File

@ -1,16 +1,16 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:51.208394400 UTC
* 2023-10-20 05:22:29.726731400 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]
pub mod AnimationsystemDll {
pub mod AnimationsystemDll { // animationsystem.dll
pub const AnimationSystemUtils_001: usize = 0x64670;
pub const AnimationSystem_001: usize = 0x5F1D0;
}
pub mod ClientDll {
pub mod ClientDll { // client.dll
pub const LegacyGameUI001: usize = 0x88FF10;
pub const Source2ClientUI001: usize = 0x87E9B0;
pub const Source2ClientPrediction001: usize = 0x79C1F0;
@ -21,7 +21,7 @@ pub mod ClientDll {
pub const Source2ClientConfig001: usize = 0x472CD0;
}
pub mod Engine2Dll {
pub mod Engine2Dll { // engine2.dll
pub const SimpleEngineLoopService_001: usize = 0x1E1FD0;
pub const ClientServerEngineLoopService_001: usize = 0x1D7CA0;
pub const KeyValueCache001: usize = 0x1D42E0;
@ -56,12 +56,12 @@ pub mod Engine2Dll {
pub const Source2EngineToClient001: usize = 0x5A1D0;
}
pub mod FilesystemStdioDll {
pub mod FilesystemStdioDll { // filesystem_stdio.dll
pub const VAsyncFileSystem2_001: usize = 0x66D30;
pub const VFileSystem017: usize = 0x66D20;
}
pub mod HostDll {
pub mod HostDll { // host.dll
pub const Source2Host001: usize = 0x18E10;
pub const SinglePlayerSharedMemory001: usize = 0x18A90;
pub const SaveRestoreDataVersion001: usize = 0x18A80;
@ -72,25 +72,25 @@ pub mod HostDll {
pub const DebugDrawQueueManager001: usize = 0x11710;
}
pub mod ImemanagerDll {
pub mod ImemanagerDll { // imemanager.dll
pub const IMEManager001: usize = 0xC470;
}
pub mod InputsystemDll {
pub mod InputsystemDll { // inputsystem.dll
pub const InputSystemVersion001: usize = 0x28D0;
pub const InputStackSystemVersion001: usize = 0x16F0;
}
pub mod LocalizeDll {
pub mod LocalizeDll { // localize.dll
pub const Localize_001: usize = 0x3830;
}
pub mod MatchmakingDll {
pub mod MatchmakingDll { // matchmaking.dll
pub const GameTypes001: usize = 0x50270;
pub const MATCHFRAMEWORK_001: usize = 0x101030;
}
pub mod Materialsystem2Dll {
pub mod Materialsystem2Dll { // materialsystem2.dll
pub const MaterialUtils_001: usize = 0x4DB90;
pub const TextLayout_001: usize = 0x4A2E0;
pub const PostProcessingSystem_001: usize = 0x42A60;
@ -98,67 +98,67 @@ pub mod Materialsystem2Dll {
pub const VMaterialSystem2_001: usize = 0x25EC0;
}
pub mod MeshsystemDll {
pub mod MeshsystemDll { // meshsystem.dll
pub const MeshSystem001: usize = 0x7270;
}
pub mod NavsystemDll {
pub mod NavsystemDll { // navsystem.dll
pub const NavSystem001: usize = 0x76F0;
}
pub mod NetworksystemDll {
pub mod NetworksystemDll { // networksystem.dll
pub const SerializedEntitiesVersion001: usize = 0xD1A70;
pub const NetworkSystemVersion001: usize = 0xBBF80;
pub const NetworkMessagesVersion001: usize = 0x9C020;
pub const FlattenedSerializersVersion001: usize = 0x7B8A0;
}
pub mod PanoramaDll {
pub mod PanoramaDll { // panorama.dll
pub const PanoramaUIEngine001: usize = 0x57EE0;
}
pub mod PanoramaTextPangoDll {
pub mod PanoramaTextPangoDll { // panorama_text_pango.dll
pub const PanoramaTextServices001: usize = 0x4CBD0;
}
pub mod PanoramauiclientDll {
pub mod PanoramauiclientDll { // panoramauiclient.dll
pub const PanoramaUIClient001: usize = 0x12780;
}
pub mod ParticlesDll {
pub mod ParticlesDll { // particles.dll
pub const ParticleSystemMgr003: usize = 0x52D20;
}
pub mod PulseSystemDll {
pub mod PulseSystemDll { // pulse_system.dll
pub const IPulseSystem_001: usize = 0x5B80;
}
pub mod Rendersystemdx11Dll {
pub mod Rendersystemdx11Dll { // rendersystemdx11.dll
pub const RenderUtils_001: usize = 0x52C90;
pub const VRenderDeviceMgrBackdoor001: usize = 0x4A3A0;
pub const RenderDeviceMgr001: usize = 0x4A390;
}
pub mod ResourcesystemDll {
pub mod ResourcesystemDll { // resourcesystem.dll
pub const ResourceSystem013: usize = 0x10650;
}
pub mod ScenefilecacheDll {
pub mod ScenefilecacheDll { // scenefilecache.dll
pub const SceneFileCache002: usize = 0x68E0;
pub const ResponseRulesCache001: usize = 0x3190;
}
pub mod ScenesystemDll {
pub mod ScenesystemDll { // scenesystem.dll
pub const SceneUtils_001: usize = 0x13D030;
pub const SceneSystem_002: usize = 0xCAE10;
pub const RenderingPipelines_001: usize = 0x8EED0;
}
pub mod SchemasystemDll {
pub mod SchemasystemDll { // schemasystem.dll
pub const SchemaSystem_001: usize = 0xA930;
}
pub mod ServerDll {
pub mod ServerDll { // server.dll
pub const NavGameTest001: usize = 0xA2D150;
pub const ServerToolsInfo_001: usize = 0x831AC0;
pub const Source2GameClients001: usize = 0x831AD0;
@ -171,18 +171,18 @@ pub mod ServerDll {
pub const Source2GameDirector001: usize = 0x13EFC0;
}
pub mod SoundsystemDll {
pub mod SoundsystemDll { // soundsystem.dll
pub const SoundOpSystem001: usize = 0x1567E0;
pub const SoundOpSystemEdit001: usize = 0x8BBC0;
pub const VMixEditTool001: usize = 0x71740;
pub const SoundSystem001: usize = 0x46540;
}
pub mod SteamaudioDll {
pub mod SteamaudioDll { // steamaudio.dll
pub const SteamAudio001: usize = 0x12EE0;
}
pub mod Steamclient64Dll {
pub mod Steamclient64Dll { // steamclient64.dll
pub const IVALIDATE001: usize = 0x833640;
pub const CLIENTENGINE_INTERFACE_VERSION005: usize = 0x82F4C0;
pub const SteamClient020: usize = 0x62CAF0;
@ -204,39 +204,39 @@ pub mod Steamclient64Dll {
pub const p2pvoicesingleton002: usize = 0xD5840;
}
pub mod Tier0Dll {
pub mod Tier0Dll { // tier0.dll
pub const VStringTokenSystem001: usize = 0x18C060;
pub const TestScriptMgr001: usize = 0x13F3C0;
pub const VProcessUtils002: usize = 0x12F540;
pub const VEngineCvar007: usize = 0x61920;
}
pub mod V8SystemDll {
pub mod V8SystemDll { // v8system.dll
pub const Source2V8System001: usize = 0x1670;
}
pub mod ValveAviDll {
pub mod ValveAviDll { // valve_avi.dll
pub const VAvi001: usize = 0x2F90;
}
pub mod ValveWmfDll {
pub mod ValveWmfDll { // valve_wmf.dll
pub const VMediaFoundation001: usize = 0x12D0;
}
pub mod Vphysics2Dll {
pub mod Vphysics2Dll { // vphysics2.dll
pub const VPhysics2_Handle_Interface_001: usize = 0x5FA50;
pub const VPhysics2_Interface_001: usize = 0x5B7F0;
}
pub mod VscriptDll {
pub mod VscriptDll { // vscript.dll
pub const VScriptManager010: usize = 0x31DA0;
}
pub mod VstdlibS64Dll {
pub mod VstdlibS64Dll { // vstdlib_s64.dll
pub const IVALIDATE001: usize = 0x24FF0;
pub const VEngineCvar002: usize = 0x5750;
}
pub mod WorldrendererDll {
pub mod WorldrendererDll { // worldrenderer.dll
pub const WorldRendererMgr001: usize = 0x21530;
}

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.149975900 UTC
* 2023-10-20 05:22:27.745949200 UTC
*/
public static class MaterialParamBuffer_t { // MaterialParam_t

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.149222 UTC
* 2023-10-20 05:22:27.744746100 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.150877700 UTC
2023-10-20 05:22:27.747369300 UTC
'''
class MaterialParamBuffer_t: # MaterialParam_t

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.151564700 UTC
* 2023-10-20 05:22:27.748540900 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.152804600 UTC
* 2023-10-20 05:22:27.750279400 UTC
*/
public static class ChangeAccessorFieldPathIndex_t {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.152637 UTC
* 2023-10-20 05:22:27.750018800 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.152996500 UTC
2023-10-20 05:22:27.750682500 UTC
'''
class ChangeAccessorFieldPathIndex_t:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.153085200 UTC
* 2023-10-20 05:22:27.750912400 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,9 +1,10 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:55.050527700 UTC
* 2023-10-20 05:22:30.276442300 UTC
*/
public static class ClientDll {
public static class ClientDll { // client.dll
public const nint dwBaseEntityModel_setModel = 0x57C750;
public const nint dwEntityList = 0x1793DC8;
public const nint dwForceAttack = 0x169AE50;
public const nint dwForceAttack2 = 0x169AEE0;
@ -13,6 +14,8 @@ public static class ClientDll {
public const nint dwForceJump = 0x169B360;
public const nint dwForceLeft = 0x169B1B0;
public const nint dwForceRight = 0x169B240;
public const nint dwGameEntitySystem_getBaseEntity = 0x5FFD50;
public const nint dwGameEntitySystem_getHighestEntityIndex = 0x5F1A40;
public const nint dwGameRules = 0x17EFAD8;
public const nint dwGlobalVars = 0x1696F40;
public const nint dwGlowManager = 0x17EF258;
@ -23,12 +26,9 @@ public static class ClientDll {
public const nint dwViewAngles = 0x18E0DA0;
public const nint dwViewMatrix = 0x1881D70;
public const nint dwViewRender = 0x1882768;
public const nint dwGameEntitySystem_getBaseEntity = 0x5FFD50;
public const nint dwGameEntitySystem_getHighestEntityIndex = 0x5F1A40;
public const nint dwBaseEntityModel_setModel = 0x57C750;
}
public static class Engine2Dll {
public static class Engine2Dll { // engine2.dll
public const nint dwBuildNumber = 0x487514;
public const nint dwNetworkGameClient = 0x486AB0;
public const nint dwNetworkGameClient_getLocalPlayer = 0xF0;

View File

@ -1,13 +1,14 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:55.050247700 UTC
* 2023-10-20 05:22:30.275924300 UTC
*/
#pragma once
#include <cstddef>
namespace ClientDll {
namespace ClientDll { // client.dll
constexpr std::ptrdiff_t dwBaseEntityModel_setModel = 0x57C750;
constexpr std::ptrdiff_t dwEntityList = 0x1793DC8;
constexpr std::ptrdiff_t dwForceAttack = 0x169AE50;
constexpr std::ptrdiff_t dwForceAttack2 = 0x169AEE0;
@ -17,6 +18,8 @@ namespace ClientDll {
constexpr std::ptrdiff_t dwForceJump = 0x169B360;
constexpr std::ptrdiff_t dwForceLeft = 0x169B1B0;
constexpr std::ptrdiff_t dwForceRight = 0x169B240;
constexpr std::ptrdiff_t dwGameEntitySystem_getBaseEntity = 0x5FFD50;
constexpr std::ptrdiff_t dwGameEntitySystem_getHighestEntityIndex = 0x5F1A40;
constexpr std::ptrdiff_t dwGameRules = 0x17EFAD8;
constexpr std::ptrdiff_t dwGlobalVars = 0x1696F40;
constexpr std::ptrdiff_t dwGlowManager = 0x17EF258;
@ -27,12 +30,9 @@ namespace ClientDll {
constexpr std::ptrdiff_t dwViewAngles = 0x18E0DA0;
constexpr std::ptrdiff_t dwViewMatrix = 0x1881D70;
constexpr std::ptrdiff_t dwViewRender = 0x1882768;
constexpr std::ptrdiff_t dwGameEntitySystem_getBaseEntity = 0x5FFD50;
constexpr std::ptrdiff_t dwGameEntitySystem_getHighestEntityIndex = 0x5F1A40;
constexpr std::ptrdiff_t dwBaseEntityModel_setModel = 0x57C750;
}
namespace Engine2Dll {
namespace Engine2Dll { // engine2.dll
constexpr std::ptrdiff_t dwBuildNumber = 0x487514;
constexpr std::ptrdiff_t dwNetworkGameClient = 0x486AB0;
constexpr std::ptrdiff_t dwNetworkGameClient_getLocalPlayer = 0xF0;

View File

@ -90,7 +90,7 @@
"comment": null
}
},
"comment": null
"comment": "client.dll"
},
"Engine2Dll": {
"data": {
@ -123,6 +123,6 @@
"comment": null
}
},
"comment": null
"comment": "engine2.dll"
}
}

View File

@ -1,9 +1,10 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:55.050894100 UTC
2023-10-20 05:22:30.277115700 UTC
'''
class ClientDll:
class ClientDll: # client.dll
dwBaseEntityModel_setModel = 0x57C750
dwEntityList = 0x1793DC8
dwForceAttack = 0x169AE50
dwForceAttack2 = 0x169AEE0
@ -13,6 +14,8 @@ class ClientDll:
dwForceJump = 0x169B360
dwForceLeft = 0x169B1B0
dwForceRight = 0x169B240
dwGameEntitySystem_getBaseEntity = 0x5FFD50
dwGameEntitySystem_getHighestEntityIndex = 0x5F1A40
dwGameRules = 0x17EFAD8
dwGlobalVars = 0x1696F40
dwGlowManager = 0x17EF258
@ -23,11 +26,8 @@ class ClientDll:
dwViewAngles = 0x18E0DA0
dwViewMatrix = 0x1881D70
dwViewRender = 0x1882768
dwGameEntitySystem_getBaseEntity = 0x5FFD50
dwGameEntitySystem_getHighestEntityIndex = 0x5F1A40
dwBaseEntityModel_setModel = 0x57C750
class Engine2Dll:
class Engine2Dll: # engine2.dll
dwBuildNumber = 0x487514
dwNetworkGameClient = 0x486AB0
dwNetworkGameClient_getLocalPlayer = 0xF0

View File

@ -1,11 +1,12 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:55.051133700 UTC
* 2023-10-20 05:22:30.277591900 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]
pub mod ClientDll {
pub mod ClientDll { // client.dll
pub const dwBaseEntityModel_setModel: usize = 0x57C750;
pub const dwEntityList: usize = 0x1793DC8;
pub const dwForceAttack: usize = 0x169AE50;
pub const dwForceAttack2: usize = 0x169AEE0;
@ -15,6 +16,8 @@ pub mod ClientDll {
pub const dwForceJump: usize = 0x169B360;
pub const dwForceLeft: usize = 0x169B1B0;
pub const dwForceRight: usize = 0x169B240;
pub const dwGameEntitySystem_getBaseEntity: usize = 0x5FFD50;
pub const dwGameEntitySystem_getHighestEntityIndex: usize = 0x5F1A40;
pub const dwGameRules: usize = 0x17EFAD8;
pub const dwGlobalVars: usize = 0x1696F40;
pub const dwGlowManager: usize = 0x17EF258;
@ -25,12 +28,9 @@ pub mod ClientDll {
pub const dwViewAngles: usize = 0x18E0DA0;
pub const dwViewMatrix: usize = 0x1881D70;
pub const dwViewRender: usize = 0x1882768;
pub const dwGameEntitySystem_getBaseEntity: usize = 0x5FFD50;
pub const dwGameEntitySystem_getHighestEntityIndex: usize = 0x5F1A40;
pub const dwBaseEntityModel_setModel: usize = 0x57C750;
}
pub mod Engine2Dll {
pub mod Engine2Dll { // engine2.dll
pub const dwBuildNumber: usize = 0x487514;
pub const dwNetworkGameClient: usize = 0x486AB0;
pub const dwNetworkGameClient_getLocalPlayer: usize = 0xF0;

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.439498700 UTC
* 2023-10-20 05:22:28.324672100 UTC
*/
public static class CBaseRendererSource2 { // CParticleFunctionRenderer

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.414490100 UTC
* 2023-10-20 05:22:28.282948800 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.470124400 UTC
2023-10-20 05:22:28.366569300 UTC
'''
class CBaseRendererSource2: # CParticleFunctionRenderer

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.494753300 UTC
* 2023-10-20 05:22:28.406481700 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.326056900 UTC
* 2023-10-20 05:22:28.086047300 UTC
*/
public static class CBasePulseGraphInstance {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.324466800 UTC
* 2023-10-20 05:22:28.083463700 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.328079900 UTC
2023-10-20 05:22:28.088863400 UTC
'''
class CBasePulseGraphInstance:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.329574300 UTC
* 2023-10-20 05:22:28.091376600 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.137693700 UTC
* 2023-10-20 05:22:27.722747600 UTC
*/
public static class RenderInputLayoutField_t {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.137496400 UTC
* 2023-10-20 05:22:27.722343400 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.137957600 UTC
2023-10-20 05:22:27.723331500 UTC
'''
class RenderInputLayoutField_t:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.138462900 UTC
* 2023-10-20 05:22:27.723693600 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.134949600 UTC
* 2023-10-20 05:22:27.718005600 UTC
*/
public static class AABB_t {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.134321 UTC
* 2023-10-20 05:22:27.716939 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.135814 UTC
2023-10-20 05:22:27.719280600 UTC
'''
class AABB_t:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.136394600 UTC
* 2023-10-20 05:22:27.720298200 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.307256100 UTC
* 2023-10-20 05:22:28.048326700 UTC
*/
public static class CSSDSEndFrameViewInfo {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.306855500 UTC
* 2023-10-20 05:22:28.047734700 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.308014600 UTC
2023-10-20 05:22:28.049264300 UTC
'''
class CSSDSEndFrameViewInfo:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.308354900 UTC
* 2023-10-20 05:22:28.049873800 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.130476300 UTC
* 2023-10-20 05:22:27.709594300 UTC
*/
public static class CExampleSchemaVData_Monomorphic {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.130115100 UTC
* 2023-10-20 05:22:27.708925300 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.130944700 UTC
2023-10-20 05:22:27.710442200 UTC
'''
class CExampleSchemaVData_Monomorphic:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.131314700 UTC
* 2023-10-20 05:22:27.711039300 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.703786 UTC
* 2023-10-20 05:22:28.858064700 UTC
*/
public static class ActiveModelConfig_t {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.658875 UTC
* 2023-10-20 05:22:28.785072600 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.757550400 UTC
2023-10-20 05:22:28.932997900 UTC
'''
class ActiveModelConfig_t:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.801761700 UTC
* 2023-10-20 05:22:29.004583300 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.299998100 UTC
* 2023-10-20 05:22:28.036316100 UTC
*/
public static class CDSPMixgroupModifier {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.298183300 UTC
* 2023-10-20 05:22:28.033213400 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.302243400 UTC
2023-10-20 05:22:28.039638200 UTC
'''
class CDSPMixgroupModifier:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.304054900 UTC
* 2023-10-20 05:22:28.042668600 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.277276200 UTC
* 2023-10-20 05:22:27.995719900 UTC
*/
public static class CFeIndexedJiggleBone {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.272860600 UTC
* 2023-10-20 05:22:27.988494100 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.283793800 UTC
2023-10-20 05:22:28.003492100 UTC
'''
class CFeIndexedJiggleBone:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.288308 UTC
* 2023-10-20 05:22:28.011057800 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.314670600 UTC
* 2023-10-20 05:22:28.064212600 UTC
*/
public static class AggregateLODSetup_t {

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.313284800 UTC
* 2023-10-20 05:22:28.061909600 UTC
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
https://github.com/a2x/cs2-dumper
2023-10-18 10:31:50.316336200 UTC
2023-10-20 05:22:28.066771600 UTC
'''
class AggregateLODSetup_t:

View File

@ -1,6 +1,6 @@
/*
* https://github.com/a2x/cs2-dumper
* 2023-10-18 10:31:50.317656600 UTC
* 2023-10-20 05:22:28.069032 UTC
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -2,6 +2,7 @@ use std::io::{Result, Write};
use super::FileBuilder;
/// Represents a C++ header file builder.
#[derive(Debug, PartialEq)]
pub struct CppFileBuilder;
@ -17,7 +18,12 @@ impl FileBuilder for CppFileBuilder {
Ok(())
}
fn write_namespace(&mut self, output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()> {
fn write_namespace(
&mut self,
output: &mut dyn Write,
name: &str,
comment: Option<&str>,
) -> Result<()> {
if let Some(comment) = comment {
write!(output, "namespace {} {{ // {}\n", name, comment)?;
} else {

View File

@ -2,6 +2,7 @@ use std::io::{Result, Write};
use super::FileBuilder;
/// Represents a C# file builder.
#[derive(Debug, PartialEq)]
pub struct CSharpFileBuilder;
@ -14,7 +15,12 @@ impl FileBuilder for CSharpFileBuilder {
Ok(())
}
fn write_namespace(&mut self, output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()> {
fn write_namespace(
&mut self,
output: &mut dyn Write,
name: &str,
comment: Option<&str>,
) -> Result<()> {
if let Some(comment) = comment {
write!(output, "public static class {} {{ // {}\n", name, comment)?;
} else {

View File

@ -1,12 +1,22 @@
use std::io::{Result, Write};
/// Represents a file builder.
pub trait FileBuilder {
/// Returns the file extension.
fn extension(&mut self) -> &str;
/// Writes the top level of the file.
fn write_top_level(&mut self, output: &mut dyn Write) -> Result<()>;
fn write_namespace(&mut self, output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()>;
/// Writes a namespace.
fn write_namespace(
&mut self,
output: &mut dyn Write,
name: &str,
comment: Option<&str>,
) -> Result<()>;
/// Writes a variable.
fn write_variable(
&mut self,
output: &mut dyn Write,
@ -15,5 +25,6 @@ pub trait FileBuilder {
comment: Option<&str>,
) -> Result<()>;
/// Writes a closure.
fn write_closure(&mut self, output: &mut dyn Write, eof: bool) -> Result<()>;
}

View File

@ -1,25 +1,30 @@
use std::{io::{Result, Write}, collections::BTreeMap};
use std::{
collections::BTreeMap,
io::{Result, Write},
};
use serde::Serialize;
use super::FileBuilder;
/// Represents an offset value in JSON format.
#[derive(Debug, PartialEq, Default, Serialize)]
struct JsonOffsetValue {
value: usize,
comment: Option<String>,
}
/// Represents a module in JSON format.
#[derive(Debug, PartialEq, Default, Serialize)]
struct JsonMod {
struct JsonModule {
data: BTreeMap<String, JsonOffsetValue>,
comment: Option<String>,
}
/// Represents a JSON file builder.
#[derive(Debug, PartialEq, Default)]
pub struct JsonFileBuilder {
data: BTreeMap<String, JsonMod>,
data: BTreeMap<String, JsonModule>,
current_namespace: String,
}
@ -32,7 +37,12 @@ impl FileBuilder for JsonFileBuilder {
Ok(())
}
fn write_namespace(&mut self, _output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()> {
fn write_namespace(
&mut self,
_output: &mut dyn Write,
name: &str,
comment: Option<&str>,
) -> Result<()> {
self.current_namespace = name.to_string();
self.data.entry(name.to_string()).or_default().comment = comment.map(str::to_string);
@ -46,11 +56,17 @@ impl FileBuilder for JsonFileBuilder {
value: usize,
comment: Option<&str>,
) -> Result<()> {
self.data.entry(self.current_namespace.clone()).or_default().data
.insert(name.to_string(), JsonOffsetValue {
value: value,
comment: comment.map(str::to_string)
});
self.data
.entry(self.current_namespace.clone())
.or_default()
.data
.insert(
name.to_string(),
JsonOffsetValue {
value: value,
comment: comment.map(str::to_string),
},
);
Ok(())
}

View File

@ -14,6 +14,7 @@ pub mod json_file_builder;
pub mod python_file_builder;
pub mod rust_file_builder;
/// Represents a file builder enum.
#[derive(Debug, PartialEq)]
pub enum FileBuilderEnum {
CppFileBuilder(CppFileBuilder),
@ -32,7 +33,12 @@ impl FileBuilder for FileBuilderEnum {
self.as_mut().write_top_level(output)
}
fn write_namespace(&mut self, output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()> {
fn write_namespace(
&mut self,
output: &mut dyn Write,
name: &str,
comment: Option<&str>,
) -> Result<()> {
self.as_mut().write_namespace(output, name, comment)
}

View File

@ -2,6 +2,7 @@ use std::io::{Result, Write};
use super::FileBuilder;
/// Represents a Python file builder.
#[derive(Debug, PartialEq)]
pub struct PythonFileBuilder;
@ -14,7 +15,12 @@ impl FileBuilder for PythonFileBuilder {
Ok(())
}
fn write_namespace(&mut self, output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()> {
fn write_namespace(
&mut self,
output: &mut dyn Write,
name: &str,
comment: Option<&str>,
) -> Result<()> {
if let Some(comment) = comment {
write!(output, "class {}: # {}\n", name, comment)?;
} else {

View File

@ -2,6 +2,7 @@ use std::io::{Result, Write};
use super::FileBuilder;
/// Represents a Rust file builder.
#[derive(Debug, Default, PartialEq)]
pub struct RustFileBuilder;
@ -19,7 +20,12 @@ impl FileBuilder for RustFileBuilder {
Ok(())
}
fn write_namespace(&mut self, output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()> {
fn write_namespace(
&mut self,
output: &mut dyn Write,
name: &str,
comment: Option<&str>,
) -> Result<()> {
if let Some(comment) = comment {
write!(output, "pub mod {} {{ // {}\n", name, comment)?;
} else {

View File

@ -1,8 +1,9 @@
use anyhow::Result;
use convert_case::{Case, Casing};
use crate::builder::FileBuilderEnum;
use crate::dumpers::Entry;
use crate::error::Result;
use crate::remote::Process;
use crate::sdk::InterfaceReg;
@ -21,14 +22,14 @@ pub fn dump_interfaces(builders: &mut Vec<FileBuilderEnum>, process: &Process) -
if let Some(create_interface_export) = module.export("CreateInterface") {
log::info!("Dumping interfaces in {}...", module_name);
let create_interface_address =
process.resolve_rip(create_interface_export.va, None, None)?;
let create_interface_addr =
process.resolve_rip(create_interface_export.va.into(), None, None)?;
if let Ok(mut interface_reg) =
process.read_memory::<*mut InterfaceReg>(create_interface_address)
process.read_memory::<*mut InterfaceReg>(create_interface_addr)
{
while !interface_reg.is_null() {
let ptr = unsafe { (*interface_reg).ptr(process) }?;
let ptr = unsafe { (*interface_reg).pointer(process) }?;
let name = unsafe { (*interface_reg).name(process) }?;
log::debug!(
@ -36,23 +37,25 @@ pub fn dump_interfaces(builders: &mut Vec<FileBuilderEnum>, process: &Process) -
name,
ptr,
module_name,
ptr - module.base()
ptr - module.base_address()
);
entries
let container = entries
.entry(
module_name
.replace(".", "_")
.to_case(Case::Snake)
.to_case(Case::Pascal),
)
.or_default()
.data
.push(Entry {
name: name.clone(),
value: ptr - module.base(),
comment: None,
});
.or_default();
container.comment = Some(module_name.clone());
container.data.push(Entry {
name: name.clone(),
value: (ptr - module.base_address()).into(),
comment: None,
});
interface_reg = unsafe { (*interface_reg).next(process) }?;
}

View File

@ -2,10 +2,11 @@ use std::collections::BTreeMap;
use std::fs::File;
use std::io::Write;
use anyhow::Result;
use chrono::Utc;
use crate::builder::{FileBuilder, FileBuilderEnum};
use crate::error::Result;
pub use interfaces::dump_interfaces;
pub use offsets::dump_offsets;
@ -15,20 +16,25 @@ pub mod interfaces;
pub mod offsets;
pub mod schemas;
/// A single entry.
#[derive(Debug, PartialEq)]
pub struct Entry {
pub name: String,
pub value: usize,
pub comment: Option<String>,
}
/// A container for entries.
#[derive(Default)]
pub struct EntriesContainer {
pub data: Vec<Entry>,
pub comment: Option<String>
pub comment: Option<String>,
}
/// A map of entries.
pub type Entries = BTreeMap<String, EntriesContainer>;
/// Generate a file with the given builder.
pub fn generate_file(
builder: &mut FileBuilderEnum,
entries: &Entries,
@ -66,6 +72,7 @@ pub fn generate_file(
Ok(())
}
/// Generate files with the given builders.
pub fn generate_files(
builders: &mut [FileBuilderEnum],
entries: &Entries,
@ -76,15 +83,16 @@ pub fn generate_files(
.try_for_each(|builder| generate_file(builder, entries, file_name))
}
fn write_banner_to_file(file: &mut File, extension: &str) -> Result<()> {
let chrono_now = Utc::now();
/// Writes the banner to the given file.
fn write_banner_to_file(file: &mut File, file_ext: &str) -> Result<()> {
const REPO_URL: &str = "https://github.com/a2x/cs2-dumper";
const URL: &str = "https://github.com/a2x/cs2-dumper";
let now_utc = Utc::now();
let banner = match extension {
let banner = match file_ext {
"json" => None,
"py" => Some(format!("'''\n{}\n{}\n'''\n\n", URL, chrono_now)),
_ => Some(format!("/*\n * {}\n * {}\n */\n\n", URL, chrono_now)),
"py" => Some(format!("'''\n{}\n{}\n'''\n\n", REPO_URL, now_utc)),
_ => Some(format!("/*\n * {}\n * {}\n */\n\n", REPO_URL, now_utc)),
};
if let Some(banner) = banner {

View File

@ -1,25 +1,28 @@
use std::fs::File;
use anyhow::Result;
use convert_case::{Case, Casing};
use crate::builder::FileBuilderEnum;
use crate::config::{Config, Operation::*};
use crate::dumpers::Entry;
use crate::error::{Error, Result};
use crate::mem::Address;
use crate::remote::Process;
use super::{generate_files, Entries};
#[cfg(test)]
mod tests {
use std::ffi::c_char;
use std::mem::offset_of;
use super::*;
#[test]
fn build_number() -> Result<()> {
let process = Process::new("cs2.exe")?;
let engine_base = process.get_module_by_name("engine2.dll")?.base();
let engine_base = process.get_module_by_name("engine2.dll")?.base_address();
let build_number = process.read_memory::<u32>(engine_base + 0x487514)?;
@ -30,14 +33,54 @@ mod tests {
#[test]
fn global_vars() -> Result<()> {
#[derive(Debug)]
#[repr(C)]
struct GlobalVarsBase {
real_time: f32, // 0x0000
frame_count: i32, // 0x0004
pad_0: [u8; 0x8], // 0x0008
max_clients: i32, // 0x0010
interval_per_tick: f32, // 0x0014
pad_1: [u8; 0x14], // 0x0018
current_time: f32, // 0x002C
current_time2: f32, // 0x0030
pad_2: [u8; 0xC], // 0x0034
tick_count: i32, // 0x0040
interval_per_tick2: f32, // 0x0044
pad_3: [u8; 0x138], // 0x0048
current_map: *const c_char, // 0x0180
current_map_name: *const c_char, // 0x0188
}
impl GlobalVarsBase {
fn current_map(&self, process: &Process) -> Result<String> {
let name_ptr = process.read_memory::<usize>(
(self as *const _ as usize + offset_of!(Self, current_map)).into(),
)?;
process.read_string(name_ptr.into())
}
fn current_map_name(&self, process: &Process) -> Result<String> {
let name_ptr = process.read_memory::<usize>(
(self as *const _ as usize + offset_of!(Self, current_map_name)).into(),
)?;
process.read_string(name_ptr.into())
}
}
let process = Process::new("cs2.exe")?;
let client_base = process.get_module_by_name("client.dll")?.base();
let client_base = process.get_module_by_name("client.dll")?.base_address();
let global_vars = process.read_memory::<usize>(client_base + 0x1696F40)?;
let global_vars = process.read_memory::<*const GlobalVarsBase>(client_base + 0x1696F40)?;
let current_map_name =
process.read_string(process.read_memory::<usize>(global_vars + 0x188)?)?;
let current_map_name = unsafe {
(*global_vars)
.current_map_name(&process)
.unwrap_or_default()
};
println!("Current map name: {}", current_map_name);
@ -48,11 +91,11 @@ mod tests {
fn local_player() -> Result<()> {
let process = Process::new("cs2.exe")?;
let client_base = process.get_module_by_name("client.dll")?.base();
let client_base = process.get_module_by_name("client.dll")?.base_address();
let local_player_controller = process.read_memory::<usize>(client_base + 0x17DE508)?;
let local_player_controller = process.read_memory::<usize>(client_base + 0x17E27C8)?;
let player_name = process.read_string(local_player_controller + 0x610)?;
let player_name = process.read_string((local_player_controller + 0x610).into())?;
println!("Local player name: {}", player_name);
@ -63,10 +106,10 @@ mod tests {
fn window_size() -> Result<()> {
let process = Process::new("cs2.exe")?;
let engine_base = process.get_module_by_name("engine2.dll")?.base();
let engine_base = process.get_module_by_name("engine2.dll")?.base_address();
let window_width = process.read_memory::<u32>(engine_base + 0x538670)?;
let window_height = process.read_memory::<u32>(engine_base + 0x538674)?;
let window_width = process.read_memory::<u32>(engine_base + 0x5386D0)?;
let window_height = process.read_memory::<u32>(engine_base + 0x5386D4)?;
println!("Window size: {}x{}", window_width, window_height);
@ -77,7 +120,7 @@ mod tests {
pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> Result<()> {
let file = File::open("config.json")?;
let config: Config = serde_json::from_reader(file).map_err(Error::SerdeError)?;
let config: Config = serde_json::from_reader(file)?;
let mut entries = Entries::new();
@ -85,10 +128,11 @@ pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
for signature in config.signatures {
log::info!("Searching for {}...", signature.name);
let module = process.get_module_by_name(&signature.module)?;
let mut address = match process.find_pattern(&signature.module, &signature.pattern) {
Ok(a) => Address::from(a),
let mut addr = match process.find_pattern(&signature.module, &signature.pattern) {
Ok(a) => a,
Err(_) => {
log::error!("Failed to find pattern for {}.", signature.name);
@ -96,59 +140,53 @@ pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
}
};
for operation in signature.operations {
match operation {
Add { value } => address += value,
for op in signature.operations {
match op {
Add { value } => addr += value,
Dereference { times, size } => {
let times = times.unwrap_or(1);
let size = size.unwrap_or(8);
for _ in 0..times {
process.read_memory_raw(
address.0,
&mut address.0 as *mut _ as *mut _,
size,
)?;
process.read_memory_raw(addr, &mut addr.0 as *mut _ as *mut _, size)?;
}
}
Jmp { offset, length } => {
address = process.resolve_jmp(address.0, offset, length)?.into()
}
Jmp { offset, length } => addr = process.resolve_jmp(addr, offset, length)?.into(),
RipRelative { offset, length } => {
address = process.resolve_rip(address.0, offset, length)?.into()
addr = process.resolve_rip(addr, offset, length)?.into()
}
Slice { start, end } => {
let mut result: usize = 0;
process.read_memory_raw(
address.add(start).0,
addr.add(start),
&mut result as *mut _ as *mut _,
end - start,
)?;
address = result.into();
addr = result.into();
}
Subtract { value } => address -= value,
Subtract { value } => addr -= value,
}
}
let (name, value) = if address.0 < module.base() {
log::debug!(" └─ {} @ {:#X}", signature.name, address.0);
let (name, value) = if addr < module.base_address() {
log::debug!(" └─ {} @ {:#X}", signature.name, addr.0);
(signature.name, address.0)
(signature.name, addr.0)
} else {
log::debug!(
" └─ {} @ {:#X} ({} + {:#X})",
signature.name,
address,
addr,
signature.module,
address.sub(module.base())
addr.sub(module.base_address().0)
);
(signature.name, address.sub(module.base()).0)
(signature.name, addr.sub(module.base_address().0).0)
};
entries
let container = entries
.entry(
signature
.module
@ -156,13 +194,15 @@ pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
.to_case(Case::Snake)
.to_case(Case::Pascal),
)
.or_default()
.data
.push(Entry {
name,
value,
comment: None,
});
.or_default();
container.comment = Some(signature.module);
container.data.push(Entry {
name,
value,
comment: None,
});
}
generate_files(builders, &entries, "offsets")?;

View File

@ -1,6 +1,7 @@
use anyhow::Result;
use crate::builder::FileBuilderEnum;
use crate::dumpers::Entry;
use crate::error::Result;
use crate::remote::Process;
use crate::sdk::SchemaSystem;
@ -20,6 +21,7 @@ pub fn dump_schemas(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
log::debug!(" {}", class.name());
let container = entries.entry(class.name().replace("::", "_")).or_default();
container.comment = class.parent()?.map(|p| p.name().to_string());
for field in class.fields()? {

View File

@ -1,40 +0,0 @@
use std::io;
use std::string::FromUtf8Error;
use serde_json::Error as SerdeError;
use thiserror::Error;
use windows::core::Error as WindowsError;
#[derive(Debug, Error)]
pub enum Error {
#[error("Buffer size mismatch. Expected {0}, got {1}")]
BufferSizeMismatch(usize, usize),
#[error("Invalid magic: {0:#X}")]
InvalidMagic(u32),
#[error("IO error: {0}")]
IOError(#[from] io::Error),
#[error("Module not found: {0}")]
ModuleNotFound(String),
#[error("Pattern not found: {0}")]
PatternNotFound(String),
#[error("Process not found: {0}")]
ProcessNotFound(String),
#[error("Serde error: {0}")]
SerdeError(#[from] SerdeError),
#[error("UTF-8 error: {0}")]
Utf8Error(#[from] FromUtf8Error),
#[error("Windows error: {0}")]
WindowsError(#[from] WindowsError),
}
pub type Result<T> = std::result::Result<T, Error>;

View File

@ -4,19 +4,19 @@
use std::fs;
use std::time::Instant;
use anyhow::Result;
use clap::Parser;
use simple_logger::SimpleLogger;
use builder::*;
use dumpers::*;
use error::Result;
use remote::Process;
mod builder;
mod config;
mod dumpers;
mod error;
mod mem;
mod remote;
mod sdk;

View File

@ -1,23 +1,33 @@
use std::fmt::{LowerHex, UpperHex};
use std::ops::{Add, AddAssign, Sub, SubAssign};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
/// Represents a memory address.
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct Address(pub usize);
impl Address {
/// Add the given value to the address.
pub fn add(&self, value: usize) -> Self {
Self(self.0 + value)
}
/// Returns `true` if the address is zero.
pub fn is_zero(&self) -> bool {
self.0 == 0
}
/// Subtract the given value from the address.
pub fn sub(&self, value: usize) -> Self {
Self(self.0 - value)
}
/// Get the address as a pointer.
pub fn as_ptr<T>(&self) -> *const T {
self.0 as *const T
}
/// Get the address as a mutable pointer.
pub fn as_mut_ptr<T>(&self) -> *mut T {
self.0 as *mut T
}

View File

@ -2,161 +2,201 @@ use std::ffi::CStr;
use std::mem;
use std::slice;
use anyhow::{bail, Result};
use windows::Win32::System::Diagnostics::Debug::*;
use windows::Win32::System::SystemServices::*;
use crate::error::{Error, Result};
use crate::mem::Address;
use super::Process;
/// Represents an export in a module.
#[derive(Debug)]
pub struct Export {
/// Name of the export.
pub name: String,
/// Address of the export.
pub va: usize,
}
/// Represents a section in a module.
#[derive(Debug)]
pub struct Section {
/// Name of the section.
pub name: String,
/// Base address of the section.
pub start_va: usize,
/// End address of the section.
pub end_va: usize,
/// Size of the section.
pub size: usize,
}
/// Represents a module in a process.
pub struct Module<'a> {
base: usize,
nt_headers: &'a IMAGE_NT_HEADERS64,
/// Base address of the module.
base_addr: Address,
/// DOS header.
dos_hdr: &'a IMAGE_DOS_HEADER,
/// NT header.
nt_hdr: &'a IMAGE_NT_HEADERS64,
/// Size of the module.
size: u32,
/// List of exports.
exports: Vec<Export>,
/// List of sections.
sections: Vec<Section>,
}
impl<'a> Module<'a> {
pub fn new(process: &'a Process, base: usize) -> Result<Self> {
let mut headers: [u8; 0x1000] = [0; 0x1000];
pub fn new(process: &'a Process, base_addr: Address) -> Result<Self> {
let mut buf: [u8; 0x1000] = [0; 0x1000];
process.read_memory_raw(base, headers.as_mut_ptr() as *mut _, headers.len())?;
process.read_memory_raw(base_addr, buf.as_mut_ptr() as *mut _, buf.len())?;
if headers.len() < mem::size_of::<IMAGE_DOS_HEADER>() {
return Err(Error::BufferSizeMismatch(
if buf.len() < mem::size_of::<IMAGE_DOS_HEADER>() {
bail!(
"Buffer size mismatch. Expected {} bytes, got {} bytes",
mem::size_of::<IMAGE_DOS_HEADER>(),
headers.len(),
));
buf.len()
);
}
let dos_header = unsafe { &*(headers.as_ptr() as *const IMAGE_DOS_HEADER) };
let dos_hdr = unsafe { &*(buf.as_ptr() as *const IMAGE_DOS_HEADER) };
if dos_header.e_magic != IMAGE_DOS_SIGNATURE {
return Err(Error::InvalidMagic(dos_header.e_magic as u32));
if dos_hdr.e_magic != IMAGE_DOS_SIGNATURE {
bail!(
"Invalid DOS signature. Expected 0x{:X}, got 0x{:X}",
IMAGE_DOS_SIGNATURE,
dos_hdr.e_magic
);
}
let nt_headers = unsafe {
&*(headers.as_ptr().offset(dos_header.e_lfanew as isize) as *const IMAGE_NT_HEADERS64)
let nt_hdr = unsafe {
&*(buf.as_ptr().offset(dos_hdr.e_lfanew as isize) as *const IMAGE_NT_HEADERS64)
};
if nt_headers.Signature != IMAGE_NT_SIGNATURE {
return Err(Error::InvalidMagic(nt_headers.Signature));
if nt_hdr.Signature != IMAGE_NT_SIGNATURE {
bail!(
"Invalid NT signature. Expected 0x{:X}, got 0x{:X}",
IMAGE_NT_SIGNATURE,
nt_hdr.Signature
);
}
let size = nt_headers.OptionalHeader.SizeOfImage;
let size = nt_hdr.OptionalHeader.SizeOfImage;
let exports = unsafe { Self::parse_exports(process, base, size, nt_headers)? };
let sections = unsafe { Self::parse_sections(base, nt_headers) };
let exports = unsafe { Self::parse_exports(process, base_addr, size, nt_hdr)? };
let sections = unsafe { Self::parse_sections(base_addr, nt_hdr) };
Ok(Self {
base,
nt_headers,
base_addr,
dos_hdr,
nt_hdr,
size,
exports,
sections,
})
}
/// Returns the base address of the module.
#[inline]
pub fn base(&self) -> usize {
self.base
pub fn base_address(&self) -> Address {
self.base_addr
}
/// Returns the exports of the module.
#[inline]
pub fn exports(&self) -> &Vec<Export> {
&self.exports
}
/// Returns the sections of the module.
#[inline]
pub fn sections(&self) -> &Vec<Section> {
&self.sections
}
/// Returns the export with the given name.
#[inline]
pub fn export(&self, name: &str) -> Option<&Export> {
self.exports.iter().find(|export| export.name == name)
}
/// Returns the section with the given name.
#[inline]
pub fn section(&self, name: &str) -> Option<&Section> {
self.sections.iter().find(|section| section.name == name)
}
/// Returns the size of the module.
#[inline]
pub fn size(&self) -> u32 {
self.size
}
/// Parses the exports of the module.
unsafe fn parse_exports(
process: &Process,
address: usize,
base_addr: Address,
size: u32,
nt_headers: &IMAGE_NT_HEADERS64,
nt_hdr: &IMAGE_NT_HEADERS64,
) -> Result<Vec<Export>> {
let export_data_directory =
nt_headers.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT.0 as usize];
let export_data_dir =
nt_hdr.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT.0 as usize];
let export_directory_start = address + export_data_directory.VirtualAddress as usize;
let export_directory_end = export_directory_start + export_data_directory.Size as usize;
let export_dir_start = base_addr + export_data_dir.VirtualAddress as usize;
let export_dir_end = export_dir_start + export_data_dir.Size as usize;
let mut buffer: Vec<u8> = vec![0; export_data_directory.Size as usize];
let mut buf: Vec<u8> = vec![0; export_data_dir.Size as usize];
process.read_memory_raw(
export_directory_start,
buffer.as_mut_ptr() as *mut _,
buffer.len(),
)?;
process.read_memory_raw(export_dir_start, buf.as_mut_ptr() as *mut _, buf.len())?;
if buffer.len() < mem::size_of::<IMAGE_EXPORT_DIRECTORY>() {
return Err(Error::BufferSizeMismatch(
if buf.len() < mem::size_of::<IMAGE_EXPORT_DIRECTORY>() {
bail!(
"Buffer size mismatch. Expected {} bytes, got {} bytes",
mem::size_of::<IMAGE_EXPORT_DIRECTORY>(),
buffer.len(),
));
buf.len()
);
}
let export_directory = &*(buffer.as_ptr() as *const IMAGE_EXPORT_DIRECTORY);
let export_dir = &*(buf.as_ptr() as *const IMAGE_EXPORT_DIRECTORY);
let delta =
export_directory as *const _ as usize - export_data_directory.VirtualAddress as usize;
let delta = export_dir as *const _ as usize - export_data_dir.VirtualAddress as usize;
let name_table = (delta + export_directory.AddressOfNames as usize) as *const u32;
let ordinal_table = (delta + export_directory.AddressOfNameOrdinals as usize) as *const u16;
let function_table = (delta + export_directory.AddressOfFunctions as usize) as *const u32;
let name_table = (delta + export_dir.AddressOfNames as usize) as *const u32;
let ordinal_table = (delta + export_dir.AddressOfNameOrdinals as usize) as *const u16;
let function_table = (delta + export_dir.AddressOfFunctions as usize) as *const u32;
let mut exports: Vec<Export> = Vec::with_capacity(export_directory.NumberOfNames as usize);
let mut exports: Vec<Export> = Vec::with_capacity(export_dir.NumberOfNames as usize);
for i in 0..export_directory.NumberOfNames {
let target = ordinal_table as usize + i as usize * mem::size_of::<u16>();
for i in 0..export_dir.NumberOfNames {
let target_va = ordinal_table as usize + i as usize * mem::size_of::<u16>();
if target > address + size as usize || target < ordinal_table as usize {
if target_va > base_addr.add(size as usize).0 || target_va < ordinal_table as usize {
continue;
}
let function_ordinal = *ordinal_table.offset(i as isize);
let func_ordinal = *ordinal_table.offset(i as isize);
if function_ordinal as usize > export_directory.NumberOfFunctions as usize {
if func_ordinal as usize > export_dir.NumberOfFunctions as usize {
continue;
}
let function_va = address + *function_table.offset(function_ordinal as isize) as usize;
let func_va = base_addr.add(*function_table.offset(func_ordinal as isize) as usize);
// Skip forwarded exports.
if function_va >= export_directory_start && function_va <= export_directory_end {
if func_va >= export_dir_start && func_va <= export_dir_end {
continue;
}
@ -170,24 +210,22 @@ impl<'a> Module<'a> {
exports.push(Export {
name,
va: function_va,
va: func_va.0,
});
}
Ok(exports)
}
unsafe fn parse_sections(address: usize, nt_headers: &IMAGE_NT_HEADERS64) -> Vec<Section> {
let optional_header_ptr = &nt_headers.OptionalHeader as *const _ as *const u8;
/// Parses the sections of the module.
unsafe fn parse_sections(base_addr: Address, nt_hdr: &IMAGE_NT_HEADERS64) -> Vec<Section> {
let optional_hdr = &nt_hdr.OptionalHeader as *const _ as *const u8;
let section_header_ptr = optional_header_ptr
.offset(nt_headers.FileHeader.SizeOfOptionalHeader as isize)
let section_hdr = optional_hdr.offset(nt_hdr.FileHeader.SizeOfOptionalHeader as isize)
as *const IMAGE_SECTION_HEADER;
let sections_raw = slice::from_raw_parts(
section_header_ptr,
nt_headers.FileHeader.NumberOfSections as usize,
);
let sections_raw =
slice::from_raw_parts(section_hdr, nt_hdr.FileHeader.NumberOfSections as usize);
sections_raw
.iter()
@ -199,15 +237,15 @@ impl<'a> Module<'a> {
let start_rva = section.VirtualAddress as usize;
let end_rva = start_rva + section.Misc.VirtualSize as usize;
let start_va = address + start_rva;
let end_va = address + end_rva;
let start_va = base_addr + start_rva;
let end_va = base_addr + end_rva;
let size = section.SizeOfRawData as usize;
Section {
name,
start_va,
end_va,
start_va: start_va.0,
end_va: end_va.0,
size,
}
})

View File

@ -2,15 +2,18 @@ use std::ffi::{c_void, CStr};
use std::mem;
use std::ptr;
use anyhow::{bail, Result};
use windows::Win32::Foundation::*;
use windows::Win32::System::Diagnostics::Debug::*;
use windows::Win32::System::Diagnostics::ToolHelp::*;
use windows::Win32::System::Threading::*;
use crate::error::{Error, Result};
use crate::mem::Address;
use super::Module;
/// Represents a Win32 process.
#[derive(Debug)]
pub struct Process {
process_id: u32,
@ -29,24 +32,25 @@ impl Process {
})
}
pub fn find_pattern(&self, module_name: &str, pattern: &str) -> Result<usize> {
/// Finds an sequence of bytes in memory.
pub fn find_pattern(&self, module_name: &str, pattern: &str) -> Result<Address> {
let module = self.get_module_by_name(module_name)?;
let mut module_data: Vec<u8> = vec![0; module.size() as usize];
self.read_memory_raw(
module.base(),
module.base_address(),
module_data.as_mut_ptr() as *mut _,
module_data.len(),
)?;
let pattern_bytes = Self::pattern_to_bytes(pattern);
let pat_bytes = Self::pattern_to_bytes(pattern);
for i in 0..module.size() as usize - pattern.len() {
let mut found = true;
for j in 0..pattern_bytes.len() {
if module_data[i + j] != pattern_bytes[j] as u8 && pattern_bytes[j] != -1 {
for j in 0..pat_bytes.len() {
if module_data[i + j] != pat_bytes[j] as u8 && pat_bytes[j] != -1 {
found = false;
break;
@ -54,13 +58,14 @@ impl Process {
}
if found {
return Ok(module.base() + i);
return Ok(module.base_address() + i);
}
}
Err(Error::PatternNotFound(pattern.to_owned()))
bail!("Pattern not found: {}", pattern)
}
/// Returns a list of loaded modules.
pub fn get_loaded_modules(&self) -> Result<Vec<String>> {
let snapshot = unsafe { CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, self.process_id) }?;
@ -86,6 +91,7 @@ impl Process {
Ok(modules)
}
/// Returns a module by name.
pub fn get_module_by_name(&self, module_name: &str) -> Result<Module> {
let snapshot = unsafe { CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, self.process_id) }?;
@ -103,20 +109,21 @@ impl Process {
.into_owned();
if name == module_name {
return Module::new(self, entry.modBaseAddr as usize);
return Module::new(self, Address::from(entry.modBaseAddr as usize));
}
}
}
Err(Error::ModuleNotFound(module_name.to_owned()))
bail!("Module not found: {}", module_name)
}
pub fn read_memory_raw(&self, address: usize, buffer: *mut c_void, size: usize) -> Result<()> {
/// Reads raw data from memory.
pub fn read_memory_raw(&self, addr: Address, buf: *mut c_void, size: usize) -> Result<()> {
unsafe {
ReadProcessMemory(
self.process_handle,
address as *const _,
buffer,
addr.as_ptr(),
buf,
size,
Some(ptr::null_mut()),
)
@ -124,17 +131,13 @@ impl Process {
.map_err(Into::into)
}
pub fn write_memory_raw(
&self,
address: usize,
buffer: *const c_void,
size: usize,
) -> Result<()> {
/// Writes raw data to memory.
pub fn write_memory_raw(&self, addr: Address, buf: *const c_void, size: usize) -> Result<()> {
unsafe {
WriteProcessMemory(
self.process_handle,
address as *const _,
buffer,
addr.as_ptr(),
buf,
size,
Some(ptr::null_mut()),
)
@ -142,57 +145,72 @@ impl Process {
.map_err(Into::into)
}
pub fn read_memory<T>(&self, address: usize) -> Result<T> {
let mut buffer: T = unsafe { mem::zeroed() };
/// Reads a value from memory.
pub fn read_memory<T>(&self, addr: Address) -> Result<T> {
let mut buf: T = unsafe { mem::zeroed() };
self.read_memory_raw(
address,
&mut buffer as *const _ as *mut _,
mem::size_of::<T>(),
)?;
self.read_memory_raw(addr, &mut buf as *const _ as *mut _, mem::size_of::<T>())?;
Ok(buffer)
Ok(buf)
}
pub fn write_memory<T>(&self, address: usize, value: T) -> Result<()> {
self.write_memory_raw(address, &value as *const _ as *const _, mem::size_of::<T>())
/// Writes a value to memory.
pub fn write_memory<T>(&self, addr: Address, val: T) -> Result<()> {
self.write_memory_raw(addr, &val as *const _ as *const _, mem::size_of::<T>())
}
pub fn read_string(&self, address: usize) -> Result<String> {
let mut buffer = Vec::new();
/// Reads a string.
pub fn read_string(&self, addr: Address) -> Result<String> {
let mut buf = Vec::new();
for i in 0.. {
match self.read_memory::<u8>(address + i) {
Ok(byte) if byte != 0 => buffer.push(byte),
match self.read_memory::<u8>(addr + i) {
Ok(byte) if byte != 0 => buf.push(byte),
_ => break,
}
}
Ok(String::from_utf8(buffer)?)
Ok(String::from_utf8(buf)?)
}
/// Reads a string with a specified length.
pub fn read_string_len(&self, addr: Address, len: usize) -> Result<String> {
let mut buf: Vec<u8> = vec![0; len];
self.read_memory_raw(addr, buf.as_mut_ptr() as *mut _, len)?;
if let Some(end) = buf.iter().position(|&x| x == 0) {
buf.truncate(end);
}
Ok(String::from_utf8(buf)?)
}
/// Resolves a JMP/CALL instruction.
pub fn resolve_jmp(
&self,
address: usize,
addr: Address,
offset: Option<usize>,
length: Option<usize>,
) -> Result<usize> {
let displacement = self.read_memory::<i32>(address + offset.unwrap_or(0x1))?;
len: Option<usize>,
) -> Result<Address> {
let disp = self.read_memory::<i32>(addr + offset.unwrap_or(0x1))?;
Ok(((address + length.unwrap_or(0x5)) as isize + displacement as isize) as usize)
Ok(((addr.add(len.unwrap_or(0x5)).0 as isize + disp as isize) as usize).into())
}
/// Resolves a RIP-relative address.
pub fn resolve_rip(
&self,
address: usize,
addr: Address,
offset: Option<usize>,
length: Option<usize>,
) -> Result<usize> {
let displacement = self.read_memory::<i32>(address + offset.unwrap_or(0x3))?;
len: Option<usize>,
) -> Result<Address> {
let disp = self.read_memory::<i32>(addr + offset.unwrap_or(0x3))?;
Ok(((address + length.unwrap_or(0x7)) as isize + displacement as isize) as usize)
Ok(((addr.add(len.unwrap_or(0x7)).0 as isize + disp as isize) as usize).into())
}
/// Returns the process ID of a process by name.
fn get_process_id_by_name(process_name: &str) -> Result<u32> {
let snapshot = unsafe { CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) }?;
@ -215,9 +233,10 @@ impl Process {
}
}
Err(Error::ProcessNotFound(process_name.to_owned()))
bail!("Process not found: {}", process_name)
}
/// Converts a pattern to a list of bytes.
fn pattern_to_bytes(pattern: &str) -> Vec<i32> {
let mut bytes = Vec::new();
@ -241,9 +260,7 @@ impl Process {
}
if i + 1 < chars.len() {
let value = i32::from_str_radix(&pattern[i..i + 2], 16);
match value {
match i32::from_str_radix(&pattern[i..i + 2], 16) {
Ok(v) => bytes.push(v),
Err(_) => {}
}
@ -259,6 +276,7 @@ impl Process {
}
impl Drop for Process {
/// Closes the process handle.
fn drop(&mut self) {
if !self.process_handle.is_invalid() {
unsafe { CloseHandle(self.process_handle).unwrap() }

View File

@ -1,7 +1,9 @@
use std::ffi::c_char;
use std::mem::offset_of;
use crate::error::Result;
use anyhow::Result;
use crate::mem::Address;
use crate::remote::Process;
#[derive(Debug)]
@ -13,21 +15,29 @@ pub struct InterfaceReg {
}
impl InterfaceReg {
pub fn ptr(&self, process: &Process) -> Result<usize> {
/// Returns the pointer of the interface.
pub fn pointer(&self, process: &Process) -> Result<Address> {
process
.read_memory::<usize>(self as *const _ as usize + offset_of!(InterfaceReg, create_fn))
.read_memory::<usize>(
(self as *const _ as usize + offset_of!(InterfaceReg, create_fn)).into(),
)
.map(|ptr| ptr.into())
}
/// Returns the name of the interface.
/// E.g. "Source2Client002"
pub fn name(&self, process: &Process) -> Result<String> {
let name_ptr = process
.read_memory::<usize>(self as *const _ as usize + offset_of!(InterfaceReg, name))?;
let name_ptr = process.read_memory::<usize>(
(self as *const _ as usize + offset_of!(InterfaceReg, name)).into(),
)?;
process.read_string(name_ptr)
process.read_string(name_ptr.into())
}
/// Returns the next interface in the list.
pub fn next(&self, process: &Process) -> Result<*mut InterfaceReg> {
process.read_memory::<*mut InterfaceReg>(
self as *const _ as usize + offset_of!(InterfaceReg, next),
(self as *const _ as usize + offset_of!(InterfaceReg, next)).into(),
)
}
}

View File

@ -1,31 +1,40 @@
use crate::error::Result;
use anyhow::Result;
use crate::mem::Address;
use crate::remote::Process;
use super::SchemaType;
/// Represents a class field in a schema.
pub struct SchemaClassFieldData<'a> {
process: &'a Process,
address: usize,
/// Address of the class field.
addr: Address,
}
impl<'a> SchemaClassFieldData<'a> {
pub fn new(process: &'a Process, address: usize) -> Self {
Self { process, address }
pub fn new(process: &'a Process, addr: Address) -> Self {
Self { process, addr }
}
/// Returns the name of the field.
pub fn name(&self) -> Result<String> {
let name_ptr = self.process.read_memory::<usize>(self.address)?;
let name_ptr = self.process.read_memory::<usize>(self.addr + 0x0)?;
self.process.read_string(name_ptr)
self.process.read_string_len(name_ptr.into(), 64)
}
/// Returns the type of the field.
pub fn r#type(&self) -> Result<SchemaType> {
let type_ptr = self.process.read_memory::<usize>(self.address + 0x8)?;
Ok(SchemaType::new(self.process, type_ptr))
Ok(SchemaType::new(
self.process,
self.process.read_memory::<usize>(self.addr + 0x8)?.into(),
))
}
/// Returns the offset of the field.
pub fn offset(&self) -> Result<u16> {
self.process.read_memory::<u16>(self.address + 0x10)
self.process.read_memory::<u16>(self.addr + 0x10)
}
}

View File

@ -1,59 +1,76 @@
use crate::error::Result;
use anyhow::Result;
use crate::mem::Address;
use crate::remote::Process;
use super::SchemaClassFieldData;
/// Represents a class in a schema.
pub struct SchemaClassInfo<'a> {
process: &'a Process,
address: usize,
/// Address of the class.
addr: Address,
/// Name of the class.
class_name: String,
}
impl<'a> SchemaClassInfo<'a> {
pub fn new(process: &'a Process, address: usize, class_name: &str) -> Self {
pub fn new(process: &'a Process, addr: Address, class_name: &str) -> Self {
Self {
process,
address,
addr,
class_name: class_name.to_string(),
}
}
/// Returns the name of the class.
#[inline]
pub fn name(&self) -> &str {
&self.class_name
}
/// Returns a list of fields in the class.
pub fn fields(&self) -> Result<Vec<SchemaClassFieldData>> {
let addr = self.process.read_memory::<usize>(self.addr + 0x28)?;
if addr == 0 {
return Ok(Vec::new());
}
let count = self.fields_count()?;
let base_address = self.process.read_memory::<usize>(self.address + 0x28)?;
let fields: Vec<SchemaClassFieldData> = (0..count as usize)
.map(|i| base_address + (i * 0x20))
.filter_map(|address| {
if address != 0 {
Some(SchemaClassFieldData::new(self.process, address))
} else {
None
}
})
let fields: Vec<SchemaClassFieldData> = (addr..addr + count as usize * 0x20)
.step_by(0x20)
.map(|address| SchemaClassFieldData::new(self.process, address.into()))
.collect();
Ok(fields)
}
/// Returns the number of fields in the class.
pub fn fields_count(&self) -> Result<u16> {
self.process.read_memory::<u16>(self.address + 0x1C)
self.process.read_memory::<u16>(self.addr + 0x1C)
}
/// Returns the parent class.
pub fn parent(&self) -> Result<Option<SchemaClassInfo>> {
let addr = self.process.read_memory::<u64>(self.address + 0x38)?;
let addr = self.process.read_memory::<usize>(self.addr + 0x38)?;
if addr == 0 {
return Ok(None);
}
let parent = self.process.read_memory::<u64>(addr as usize + 0x8)?;
let name = self.process.read_string(self.process.read_memory::<usize>(parent as usize + 0x8)?)?;
Ok(Some(SchemaClassInfo::new(self.process, parent as usize, &name)))
let parent = self.process.read_memory::<usize>((addr + 0x8).into())?;
let name_ptr = self.process.read_memory::<usize>((parent + 0x8).into())?;
let name = self.process.read_string(name_ptr.into())?;
Ok(Some(SchemaClassInfo::new(
self.process,
parent.into(),
&name,
)))
}
}

View File

@ -1,42 +1,53 @@
use std::mem;
use crate::error::Result;
use anyhow::{bail, Result};
use crate::mem::Address;
use crate::remote::Process;
use super::SchemaSystemTypeScope;
/// Represents the schema system.
pub struct SchemaSystem<'a> {
process: &'a Process,
address: usize,
/// Address of the schema system.
addr: Address,
}
impl<'a> SchemaSystem<'a> {
pub fn new(process: &'a Process) -> Result<Self> {
let mut address = process.find_pattern(
let mut addr = process.find_pattern(
"schemasystem.dll",
"48 8D 0D ? ? ? ? E9 ? ? ? ? CC CC CC CC 48 8D 0D ? ? ? ? E9 ? ? ? ? CC CC CC CC 48 83 EC 28"
)?;
address = process.resolve_rip(address, None, None)?;
addr = process.resolve_rip(addr, None, None)?;
Ok(Self { process, address })
Ok(Self { process, addr })
}
/// Returns a list of type scopes.
pub fn type_scopes(&self) -> Result<Vec<SchemaSystemTypeScope>> {
let size = self.process.read_memory::<u32>(self.address + 0x190)?;
let data = self.process.read_memory::<usize>(self.address + 0x198)?;
let size = self.process.read_memory::<u32>(self.addr + 0x190)?;
if size == 0 {
bail!("Type scopes size is 0");
}
let data = self.process.read_memory::<usize>(self.addr + 0x198)?;
let mut addresses: Vec<usize> = vec![0; size as usize];
self.process.read_memory_raw(
data,
data.into(),
addresses.as_mut_ptr() as *mut _,
addresses.len() * mem::size_of::<usize>(),
)?;
let type_scopes: Vec<SchemaSystemTypeScope> = addresses
.iter()
.map(|&address| SchemaSystemTypeScope::new(self.process, address))
.map(|&addr| SchemaSystemTypeScope::new(self.process, addr.into()))
.collect();
Ok(type_scopes)

View File

@ -1,42 +1,49 @@
use crate::error::Result;
use anyhow::Result;
use crate::mem::Address;
use crate::remote::Process;
use super::{SchemaClassInfo, SchemaTypeDeclaredClass, UtlTsHash};
/// Represents a schema system type scope.
pub struct SchemaSystemTypeScope<'a> {
process: &'a Process,
address: usize,
/// Address of the schema system type scope.
addr: Address,
}
impl<'a> SchemaSystemTypeScope<'a> {
pub fn new(process: &'a Process, address: usize) -> Self {
Self { process, address }
pub fn new(process: &'a Process, addr: Address) -> Self {
Self { process, addr }
}
/// Returns a list of classes in the type scope.
pub fn classes(&self) -> Result<Vec<SchemaClassInfo>> {
let classes = self
let declared_classes = self
.process
.read_memory::<UtlTsHash<*mut SchemaTypeDeclaredClass>>(self.address + 0x588)?;
.read_memory::<UtlTsHash<*mut SchemaTypeDeclaredClass>>(self.addr + 0x588)?;
let classes: Vec<SchemaClassInfo> = classes
let classes: Vec<SchemaClassInfo> = declared_classes
.elements(self.process)?
.iter()
.filter_map(|&address| {
let address = address as usize;
.filter_map(|&addr| {
let addr = Address::from(addr as usize);
let declared_class = SchemaTypeDeclaredClass::new(self.process, address);
let declared_class = SchemaTypeDeclaredClass::new(self.process, addr);
declared_class
.name()
.ok()
.map(|name| SchemaClassInfo::new(self.process, address, &name))
.map(|name| SchemaClassInfo::new(self.process, addr, &name))
})
.collect();
Ok(classes)
}
/// Returns the name of the module that the type scope belongs to.
pub fn module_name(&self) -> Result<String> {
self.process.read_string(self.address + 0x8)
self.process.read_string_len(self.addr + 0x8, 256)
}
}

View File

@ -1,12 +1,15 @@
use std::collections::HashMap;
use anyhow::Result;
use lazy_static::lazy_static;
use regex::Regex;
use crate::error::Result;
use crate::mem::Address;
use crate::remote::Process;
/// Map of type names to their C equivalents.
const TYPE_MAP: &[(&'static str, &'static str)] = &[
("uint8", "uint8_t"),
("uint16", "uint16_t"),
@ -32,22 +35,26 @@ lazy_static! {
};
}
/// Represents a schema type.
pub struct SchemaType<'a> {
process: &'a Process,
address: usize,
/// Address of the schema type.
addr: Address,
}
impl<'a> SchemaType<'a> {
pub fn new(process: &'a Process, address: usize) -> Self {
Self { process, address }
pub fn new(process: &'a Process, addr: Address) -> Self {
Self { process, addr }
}
/// Returns the name of the type.
pub fn name(&self) -> Result<String> {
let name_ptr = self.process.read_memory::<usize>(self.address + 0x8)?;
let name_ptr = self.process.read_memory::<usize>(self.addr + 0x8)?;
let name = self
.process
.read_string(name_ptr)?
.read_string(name_ptr.into())?
.replace(" ", "")
.to_string();

View File

@ -1,19 +1,25 @@
use crate::error::Result;
use anyhow::Result;
use crate::mem::Address;
use crate::remote::Process;
/// Represents a schema type declared class.
pub struct SchemaTypeDeclaredClass<'a> {
process: &'a Process,
address: usize,
/// Address of the schema type declared class.
addr: Address,
}
impl<'a> SchemaTypeDeclaredClass<'a> {
pub fn new(process: &'a Process, address: usize) -> Self {
Self { process, address }
pub fn new(process: &'a Process, addr: Address) -> Self {
Self { process, addr }
}
/// Returns the name of the class.
pub fn name(&self) -> Result<String> {
let name_ptr = self.process.read_memory::<usize>(self.address + 0x8)?;
let name_ptr = self.process.read_memory::<usize>(self.addr + 0x8)?;
self.process.read_string(name_ptr)
self.process.read_string_len(name_ptr.into(), 64)
}
}

View File

@ -1,8 +1,10 @@
use anyhow::Result;
use std::mem::offset_of;
use crate::error::Result;
use crate::remote::Process;
/// Represents a hash bucket.
#[derive(Debug)]
#[repr(C)]
pub struct HashFixedDataInternal<T, K> {
@ -14,11 +16,12 @@ pub struct HashFixedDataInternal<T, K> {
impl<T, K> HashFixedDataInternal<T, K> {
pub fn next(&self, process: &Process) -> Result<*mut HashFixedDataInternal<T, K>> {
process.read_memory::<*mut HashFixedDataInternal<T, K>>(
(self as *const _ as usize) + offset_of!(HashFixedDataInternal<T, K>, next),
(self as *const _ as usize + offset_of!(HashFixedDataInternal<T, K>, next)).into(),
)
}
}
/// Represents a hash bucket.
#[derive(Debug)]
#[repr(C)]
pub struct HashBucketDataInternal<T, K> {
@ -30,11 +33,12 @@ pub struct HashBucketDataInternal<T, K> {
impl<T, K> HashBucketDataInternal<T, K> {
pub fn next(&self, process: &Process) -> Result<*mut HashFixedDataInternal<T, K>> {
process.read_memory::<*mut HashFixedDataInternal<T, K>>(
(self as *const _ as usize) + offset_of!(HashBucketDataInternal<T, K>, next),
(self as *const _ as usize + offset_of!(HashBucketDataInternal<T, K>, next)).into(),
)
}
}
/// Represents a hash table.
#[derive(Debug)]
#[repr(C)]
pub struct HashAllocatedData<T, K> {
@ -45,11 +49,12 @@ pub struct HashAllocatedData<T, K> {
impl<T, K> HashAllocatedData<T, K> {
pub fn list(&self, process: &Process) -> Result<[HashFixedDataInternal<T, K>; 128]> {
process.read_memory::<[HashFixedDataInternal<T, K>; 128]>(
(self as *const _ as usize) + offset_of!(HashAllocatedData<T, K>, list),
(self as *const _ as usize + offset_of!(HashAllocatedData<T, K>, list)).into(),
)
}
}
/// Represents a hash table.
#[derive(Debug)]
#[repr(C)]
pub struct HashUnallocatedData<T, K> {
@ -63,23 +68,24 @@ pub struct HashUnallocatedData<T, K> {
impl<T, K> HashUnallocatedData<T, K> {
pub fn next(&self, process: &Process) -> Result<*mut HashUnallocatedData<T, K>> {
process.read_memory::<*mut HashUnallocatedData<T, K>>(
self as *const _ as usize + offset_of!(HashUnallocatedData<T, K>, next),
(self as *const _ as usize + offset_of!(HashUnallocatedData<T, K>, next)).into(),
)
}
pub fn ui_key(&self, process: &Process) -> Result<K> {
process.read_memory::<K>(
(self as *const _ as usize) + offset_of!(HashUnallocatedData<T, K>, ui_key),
(self as *const _ as usize + offset_of!(HashUnallocatedData<T, K>, ui_key)).into(),
)
}
pub fn block_list(&self, process: &Process) -> Result<[HashBucketDataInternal<T, K>; 256]> {
process.read_memory::<[HashBucketDataInternal<T, K>; 256]>(
(self as *const _ as usize) + offset_of!(HashUnallocatedData<T, K>, block_list),
(self as *const _ as usize + offset_of!(HashUnallocatedData<T, K>, block_list)).into(),
)
}
}
/// Represents a hash bucket.
#[derive(Debug)]
#[repr(C)]
pub struct HashBucket<T, K> {
@ -100,17 +106,20 @@ pub struct UtlMemoryPool {
}
impl UtlMemoryPool {
/// Returns the number of blocks per blob.
#[inline]
pub fn block_size(&self) -> i32 {
self.blocks_per_blob
}
/// Returns the number of blocks allocated.
#[inline]
pub fn count(&self) -> i32 {
self.block_allocated_size
}
}
/// Represents a thread-safe hash table.
#[derive(Debug)]
#[repr(C)]
pub struct UtlTsHash<T, K = u64> {
@ -122,16 +131,19 @@ impl<T, K> UtlTsHash<T, K>
where
T: Copy,
{
/// Returns the number of blocks per blob.
#[inline]
pub fn block_size(&self) -> i32 {
self.entry_memory.block_size()
}
/// Returns the number of blocks allocated.
#[inline]
pub fn count(&self) -> i32 {
self.entry_memory.count()
}
/// Returns a list of elements in the hash table.
pub fn elements(&self, process: &Process) -> Result<Vec<T>> {
let min_size = (self.block_size() as usize).min(self.count() as usize);