Compare commits

...

2 Commits

Author SHA1 Message Date
a2x 2664e39b1b Game update (13997) 2024-03-16 10:45:14 +10:00
a2x 0866120bc4 Fix compilation issue in offset tests 2024-03-16 10:44:41 +10:00
79 changed files with 337 additions and 373 deletions

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class AimMatrixOpFixedSettings_t {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class AimMatrixOpFixedSettings_t:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
public static class ActiveModelConfig_t {
@ -1800,6 +1800,7 @@ public static class C_CSGO_PreviewModel { // C_BaseFlex
public const nint m_defaultAnim = 0x1080; // CUtlString
public const nint m_nDefaultAnimLoopMode = 0x1088; // AnimLoopMode_t
public const nint m_flInitialModelScale = 0x108C; // float
public const nint m_sInitialWeaponState = 0x1090; // CUtlString
}
public static class C_CSGO_PreviewModelAlias_csgo_item_previewmodel { // C_CSGO_PreviewModel

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#pragma once
@ -1804,6 +1804,7 @@ namespace C_CSGO_PreviewModel { // C_BaseFlex
constexpr std::ptrdiff_t m_defaultAnim = 0x1080; // CUtlString
constexpr std::ptrdiff_t m_nDefaultAnimLoopMode = 0x1088; // AnimLoopMode_t
constexpr std::ptrdiff_t m_flInitialModelScale = 0x108C; // float
constexpr std::ptrdiff_t m_sInitialWeaponState = 0x1090; // CUtlString
}
namespace C_CSGO_PreviewModelAlias_csgo_item_previewmodel { // C_CSGO_PreviewModel

View File

@ -5954,6 +5954,10 @@
"m_nDefaultAnimLoopMode": {
"value": 4232,
"comment": "AnimLoopMode_t"
},
"m_sInitialWeaponState": {
"value": 4240,
"comment": "CUtlString"
}
},
"comment": "C_BaseFlex"

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:41 +0000
Sat, 16 Mar 2024 00:42:38 +0000
'''
class ActiveModelConfig_t:
@ -1632,6 +1632,7 @@ class C_CSGO_PreviewModel: # C_BaseFlex
m_defaultAnim = 0x1080 # CUtlString
m_nDefaultAnimLoopMode = 0x1088 # AnimLoopMode_t
m_flInitialModelScale = 0x108C # float
m_sInitialWeaponState = 0x1090 # CUtlString
class C_CSGO_PreviewModelAlias_csgo_item_previewmodel: # C_CSGO_PreviewModel

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]
@ -1802,6 +1802,7 @@ pub mod C_CSGO_PreviewModel { // C_BaseFlex
pub const m_defaultAnim: usize = 0x1080; // CUtlString
pub const m_nDefaultAnimLoopMode: usize = 0x1088; // AnimLoopMode_t
pub const m_flInitialModelScale: usize = 0x108C; // float
pub const m_sInitialWeaponState: usize = 0x1090; // CUtlString
}
pub mod C_CSGO_PreviewModelAlias_csgo_item_previewmodel { // C_CSGO_PreviewModel

View File

@ -1460,6 +1460,7 @@ C_CSGO_PreviewModel: # C_BaseFlex
m_defaultAnim: 4224 # CUtlString
m_nDefaultAnimLoopMode: 4232 # AnimLoopMode_t
m_flInitialModelScale: 4236 # float
m_sInitialWeaponState: 4240 # CUtlString
C_CSGO_PreviewModelAlias_csgo_item_previewmodel: # C_CSGO_PreviewModel
C_CSGO_PreviewModel_GraphController: # CAnimGraphControllerBase
m_pszCharacterMode: 24 # CAnimGraphParamOptionalRef<char*>

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class CEmptyEntityInstance {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class CEmptyEntityInstance:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
public static class CAnimScriptBase {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:42 +0000
Sat, 16 Mar 2024 00:42:38 +0000
'''
class CAnimScriptBase:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
public static class animationsystem_dll { // animationsystem.dll
@ -9,14 +9,14 @@ public static class animationsystem_dll { // animationsystem.dll
}
public static class client_dll { // client.dll
public const nint LegacyGameUI001 = 0x8AEEA0;
public const nint Source2ClientUI001 = 0x89E100;
public const nint Source2ClientPrediction001 = 0x7AF770;
public const nint ClientToolsInfo_001 = 0x732CE0;
public const nint Source2Client002 = 0x732D00;
public const nint GameClientExports001 = 0x732CF0;
public const nint EmptyWorldService001_Client = 0x480640;
public const nint Source2ClientConfig001 = 0x46BA50;
public const nint LegacyGameUI001 = 0x8AEC50;
public const nint Source2ClientUI001 = 0x89E270;
public const nint Source2ClientPrediction001 = 0x7AF7A0;
public const nint ClientToolsInfo_001 = 0x732D10;
public const nint Source2Client002 = 0x732D30;
public const nint GameClientExports001 = 0x732D20;
public const nint EmptyWorldService001_Client = 0x480670;
public const nint Source2ClientConfig001 = 0x46BA80;
}
public static class engine2_dll { // engine2.dll

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#pragma once
@ -13,14 +13,14 @@ namespace animationsystem_dll { // animationsystem.dll
}
namespace client_dll { // client.dll
constexpr std::ptrdiff_t LegacyGameUI001 = 0x8AEEA0;
constexpr std::ptrdiff_t Source2ClientUI001 = 0x89E100;
constexpr std::ptrdiff_t Source2ClientPrediction001 = 0x7AF770;
constexpr std::ptrdiff_t ClientToolsInfo_001 = 0x732CE0;
constexpr std::ptrdiff_t Source2Client002 = 0x732D00;
constexpr std::ptrdiff_t GameClientExports001 = 0x732CF0;
constexpr std::ptrdiff_t EmptyWorldService001_Client = 0x480640;
constexpr std::ptrdiff_t Source2ClientConfig001 = 0x46BA50;
constexpr std::ptrdiff_t LegacyGameUI001 = 0x8AEC50;
constexpr std::ptrdiff_t Source2ClientUI001 = 0x89E270;
constexpr std::ptrdiff_t Source2ClientPrediction001 = 0x7AF7A0;
constexpr std::ptrdiff_t ClientToolsInfo_001 = 0x732D10;
constexpr std::ptrdiff_t Source2Client002 = 0x732D30;
constexpr std::ptrdiff_t GameClientExports001 = 0x732D20;
constexpr std::ptrdiff_t EmptyWorldService001_Client = 0x480670;
constexpr std::ptrdiff_t Source2ClientConfig001 = 0x46BA80;
}
namespace engine2_dll { // engine2.dll

View File

@ -15,35 +15,35 @@
"client_dll": {
"data": {
"ClientToolsInfo_001": {
"value": 7548128,
"value": 7548176,
"comment": null
},
"EmptyWorldService001_Client": {
"value": 4720192,
"value": 4720240,
"comment": null
},
"GameClientExports001": {
"value": 7548144,
"value": 7548192,
"comment": null
},
"LegacyGameUI001": {
"value": 9105056,
"value": 9104464,
"comment": null
},
"Source2Client002": {
"value": 7548160,
"value": 7548208,
"comment": null
},
"Source2ClientConfig001": {
"value": 4635216,
"value": 4635264,
"comment": null
},
"Source2ClientPrediction001": {
"value": 8058736,
"value": 8058784,
"comment": null
},
"Source2ClientUI001": {
"value": 9036032,
"value": 9036400,
"comment": null
}
},

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:42 +0000
Sat, 16 Mar 2024 00:42:38 +0000
'''
class animationsystem_dll: # animationsystem.dll
@ -8,14 +8,14 @@ class animationsystem_dll: # animationsystem.dll
AnimationSystem_001 = 0x6DA00
class client_dll: # client.dll
LegacyGameUI001 = 0x8AEEA0
Source2ClientUI001 = 0x89E100
Source2ClientPrediction001 = 0x7AF770
ClientToolsInfo_001 = 0x732CE0
Source2Client002 = 0x732D00
GameClientExports001 = 0x732CF0
EmptyWorldService001_Client = 0x480640
Source2ClientConfig001 = 0x46BA50
LegacyGameUI001 = 0x8AEC50
Source2ClientUI001 = 0x89E270
Source2ClientPrediction001 = 0x7AF7A0
ClientToolsInfo_001 = 0x732D10
Source2Client002 = 0x732D30
GameClientExports001 = 0x732D20
EmptyWorldService001_Client = 0x480670
Source2ClientConfig001 = 0x46BA80
class engine2_dll: # engine2.dll
SimpleEngineLoopService_001 = 0x1F6E10

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]
@ -11,14 +11,14 @@ pub mod animationsystem_dll { // animationsystem.dll
}
pub mod client_dll { // client.dll
pub const LegacyGameUI001: usize = 0x8AEEA0;
pub const Source2ClientUI001: usize = 0x89E100;
pub const Source2ClientPrediction001: usize = 0x7AF770;
pub const ClientToolsInfo_001: usize = 0x732CE0;
pub const Source2Client002: usize = 0x732D00;
pub const GameClientExports001: usize = 0x732CF0;
pub const EmptyWorldService001_Client: usize = 0x480640;
pub const Source2ClientConfig001: usize = 0x46BA50;
pub const LegacyGameUI001: usize = 0x8AEC50;
pub const Source2ClientUI001: usize = 0x89E270;
pub const Source2ClientPrediction001: usize = 0x7AF7A0;
pub const ClientToolsInfo_001: usize = 0x732D10;
pub const Source2Client002: usize = 0x732D30;
pub const GameClientExports001: usize = 0x732D20;
pub const EmptyWorldService001_Client: usize = 0x480670;
pub const Source2ClientConfig001: usize = 0x46BA80;
}
pub mod engine2_dll { // engine2.dll

View File

@ -3,14 +3,14 @@ animationsystem_dll: # animationsystem.dll
AnimationSystemUtils_001: 470656
AnimationSystem_001: 449024
client_dll: # client.dll
LegacyGameUI001: 9105056
Source2ClientUI001: 9036032
Source2ClientPrediction001: 8058736
ClientToolsInfo_001: 7548128
Source2Client002: 7548160
GameClientExports001: 7548144
EmptyWorldService001_Client: 4720192
Source2ClientConfig001: 4635216
LegacyGameUI001: 9104464
Source2ClientUI001: 9036400
Source2ClientPrediction001: 8058784
ClientToolsInfo_001: 7548176
Source2Client002: 7548208
GameClientExports001: 7548192
EmptyWorldService001_Client: 4720240
Source2ClientConfig001: 4635264
engine2_dll: # engine2.dll
SimpleEngineLoopService_001: 2059792
ClientServerEngineLoopService_001: 2010144

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class MaterialParamBuffer_t { // MaterialParam_t

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class MaterialParamBuffer_t: # MaterialParam_t

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class ChangeAccessorFieldPathIndex_t {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class ChangeAccessorFieldPathIndex_t:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,33 +1,33 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
public static class client_dll { // client.dll
public const nint dwEntityList = 0x18BFC08;
public const nint dwForceAttack = 0x172D030;
public const nint dwForceAttack2 = 0x172D0C0;
public const nint dwForceBackward = 0x172D300;
public const nint dwForceCrouch = 0x172D5D0;
public const nint dwForceForward = 0x172D270;
public const nint dwForceJump = 0x172D540;
public const nint dwForceLeft = 0x172D390;
public const nint dwForceRight = 0x172D420;
public const nint dwGameEntitySystem = 0x19DD590;
public const nint dwEntityList = 0x18C2D58;
public const nint dwForceAttack = 0x1730020;
public const nint dwForceAttack2 = 0x17300B0;
public const nint dwForceBackward = 0x17302F0;
public const nint dwForceCrouch = 0x17305C0;
public const nint dwForceForward = 0x1730260;
public const nint dwForceJump = 0x1730530;
public const nint dwForceLeft = 0x1730380;
public const nint dwForceRight = 0x1730410;
public const nint dwGameEntitySystem = 0x19E0790;
public const nint dwGameEntitySystem_getHighestEntityIndex = 0x1510;
public const nint dwGameRules = 0x191CB50;
public const nint dwGlobalVars = 0x1727BB0;
public const nint dwGlowManager = 0x191CF70;
public const nint dwInterfaceLinkList = 0x1A0E6D8;
public const nint dwLocalPlayerController = 0x190F428;
public const nint dwLocalPlayerPawn = 0x17341B8;
public const nint dwPlantedC4 = 0x1925988;
public const nint dwPrediction = 0x1734080;
public const nint dwSensitivity = 0x191D898;
public const nint dwGameRules = 0x191FCA0;
public const nint dwGlobalVars = 0x172ABA0;
public const nint dwGlowManager = 0x19200C0;
public const nint dwInterfaceLinkList = 0x1A118D8;
public const nint dwLocalPlayerController = 0x1912578;
public const nint dwLocalPlayerPawn = 0x17371A8;
public const nint dwPlantedC4 = 0x1928AD8;
public const nint dwPrediction = 0x1737070;
public const nint dwSensitivity = 0x19209E8;
public const nint dwSensitivity_sensitivity = 0x40;
public const nint dwViewAngles = 0x192D860;
public const nint dwViewMatrix = 0x1921050;
public const nint dwViewRender = 0x19218D0;
public const nint dwViewAngles = 0x19309B0;
public const nint dwViewMatrix = 0x19241A0;
public const nint dwViewRender = 0x1924A20;
}
public static class engine2_dll { // engine2.dll
@ -42,7 +42,7 @@ public static class engine2_dll { // engine2.dll
}
public static class game_info { // Some additional information about the game at dump time
public const nint buildNumber = 0x36AC; // Game build number
public const nint buildNumber = 0x36AD; // Game build number
}
public static class inputsystem_dll { // inputsystem.dll

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#pragma once
@ -8,30 +8,30 @@
#include <cstddef>
namespace client_dll { // client.dll
constexpr std::ptrdiff_t dwEntityList = 0x18BFC08;
constexpr std::ptrdiff_t dwForceAttack = 0x172D030;
constexpr std::ptrdiff_t dwForceAttack2 = 0x172D0C0;
constexpr std::ptrdiff_t dwForceBackward = 0x172D300;
constexpr std::ptrdiff_t dwForceCrouch = 0x172D5D0;
constexpr std::ptrdiff_t dwForceForward = 0x172D270;
constexpr std::ptrdiff_t dwForceJump = 0x172D540;
constexpr std::ptrdiff_t dwForceLeft = 0x172D390;
constexpr std::ptrdiff_t dwForceRight = 0x172D420;
constexpr std::ptrdiff_t dwGameEntitySystem = 0x19DD590;
constexpr std::ptrdiff_t dwEntityList = 0x18C2D58;
constexpr std::ptrdiff_t dwForceAttack = 0x1730020;
constexpr std::ptrdiff_t dwForceAttack2 = 0x17300B0;
constexpr std::ptrdiff_t dwForceBackward = 0x17302F0;
constexpr std::ptrdiff_t dwForceCrouch = 0x17305C0;
constexpr std::ptrdiff_t dwForceForward = 0x1730260;
constexpr std::ptrdiff_t dwForceJump = 0x1730530;
constexpr std::ptrdiff_t dwForceLeft = 0x1730380;
constexpr std::ptrdiff_t dwForceRight = 0x1730410;
constexpr std::ptrdiff_t dwGameEntitySystem = 0x19E0790;
constexpr std::ptrdiff_t dwGameEntitySystem_getHighestEntityIndex = 0x1510;
constexpr std::ptrdiff_t dwGameRules = 0x191CB50;
constexpr std::ptrdiff_t dwGlobalVars = 0x1727BB0;
constexpr std::ptrdiff_t dwGlowManager = 0x191CF70;
constexpr std::ptrdiff_t dwInterfaceLinkList = 0x1A0E6D8;
constexpr std::ptrdiff_t dwLocalPlayerController = 0x190F428;
constexpr std::ptrdiff_t dwLocalPlayerPawn = 0x17341B8;
constexpr std::ptrdiff_t dwPlantedC4 = 0x1925988;
constexpr std::ptrdiff_t dwPrediction = 0x1734080;
constexpr std::ptrdiff_t dwSensitivity = 0x191D898;
constexpr std::ptrdiff_t dwGameRules = 0x191FCA0;
constexpr std::ptrdiff_t dwGlobalVars = 0x172ABA0;
constexpr std::ptrdiff_t dwGlowManager = 0x19200C0;
constexpr std::ptrdiff_t dwInterfaceLinkList = 0x1A118D8;
constexpr std::ptrdiff_t dwLocalPlayerController = 0x1912578;
constexpr std::ptrdiff_t dwLocalPlayerPawn = 0x17371A8;
constexpr std::ptrdiff_t dwPlantedC4 = 0x1928AD8;
constexpr std::ptrdiff_t dwPrediction = 0x1737070;
constexpr std::ptrdiff_t dwSensitivity = 0x19209E8;
constexpr std::ptrdiff_t dwSensitivity_sensitivity = 0x40;
constexpr std::ptrdiff_t dwViewAngles = 0x192D860;
constexpr std::ptrdiff_t dwViewMatrix = 0x1921050;
constexpr std::ptrdiff_t dwViewRender = 0x19218D0;
constexpr std::ptrdiff_t dwViewAngles = 0x19309B0;
constexpr std::ptrdiff_t dwViewMatrix = 0x19241A0;
constexpr std::ptrdiff_t dwViewRender = 0x1924A20;
}
namespace engine2_dll { // engine2.dll
@ -46,7 +46,7 @@ namespace engine2_dll { // engine2.dll
}
namespace game_info { // Some additional information about the game at dump time
constexpr std::ptrdiff_t buildNumber = 0x36AC; // Game build number
constexpr std::ptrdiff_t buildNumber = 0x36AD; // Game build number
}
namespace inputsystem_dll { // inputsystem.dll

View File

@ -2,43 +2,43 @@
"client_dll": {
"data": {
"dwEntityList": {
"value": 25951240,
"value": 25963864,
"comment": null
},
"dwForceAttack": {
"value": 24301616,
"value": 24313888,
"comment": null
},
"dwForceAttack2": {
"value": 24301760,
"value": 24314032,
"comment": null
},
"dwForceBackward": {
"value": 24302336,
"value": 24314608,
"comment": null
},
"dwForceCrouch": {
"value": 24303056,
"value": 24315328,
"comment": null
},
"dwForceForward": {
"value": 24302192,
"value": 24314464,
"comment": null
},
"dwForceJump": {
"value": 24302912,
"value": 24315184,
"comment": null
},
"dwForceLeft": {
"value": 24302480,
"value": 24314752,
"comment": null
},
"dwForceRight": {
"value": 24302624,
"value": 24314896,
"comment": null
},
"dwGameEntitySystem": {
"value": 27121040,
"value": 27133840,
"comment": null
},
"dwGameEntitySystem_getHighestEntityIndex": {
@ -46,39 +46,39 @@
"comment": null
},
"dwGameRules": {
"value": 26331984,
"value": 26344608,
"comment": null
},
"dwGlobalVars": {
"value": 24279984,
"value": 24292256,
"comment": null
},
"dwGlowManager": {
"value": 26333040,
"value": 26345664,
"comment": null
},
"dwInterfaceLinkList": {
"value": 27322072,
"value": 27334872,
"comment": null
},
"dwLocalPlayerController": {
"value": 26276904,
"value": 26289528,
"comment": null
},
"dwLocalPlayerPawn": {
"value": 24330680,
"value": 24342952,
"comment": null
},
"dwPlantedC4": {
"value": 26368392,
"value": 26381016,
"comment": null
},
"dwPrediction": {
"value": 24330368,
"value": 24342640,
"comment": null
},
"dwSensitivity": {
"value": 26335384,
"value": 26348008,
"comment": null
},
"dwSensitivity_sensitivity": {
@ -86,15 +86,15 @@
"comment": null
},
"dwViewAngles": {
"value": 26400864,
"value": 26413488,
"comment": null
},
"dwViewMatrix": {
"value": 26349648,
"value": 26362272,
"comment": null
},
"dwViewRender": {
"value": 26351824,
"value": 26364448,
"comment": null
}
},
@ -140,7 +140,7 @@
"game_info": {
"data": {
"buildNumber": {
"value": 13996,
"value": 13997,
"comment": "Game build number"
}
},

View File

@ -1,33 +1,33 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:42 +0000
Sat, 16 Mar 2024 00:42:38 +0000
'''
class client_dll: # client.dll
dwEntityList = 0x18BFC08
dwForceAttack = 0x172D030
dwForceAttack2 = 0x172D0C0
dwForceBackward = 0x172D300
dwForceCrouch = 0x172D5D0
dwForceForward = 0x172D270
dwForceJump = 0x172D540
dwForceLeft = 0x172D390
dwForceRight = 0x172D420
dwGameEntitySystem = 0x19DD590
dwEntityList = 0x18C2D58
dwForceAttack = 0x1730020
dwForceAttack2 = 0x17300B0
dwForceBackward = 0x17302F0
dwForceCrouch = 0x17305C0
dwForceForward = 0x1730260
dwForceJump = 0x1730530
dwForceLeft = 0x1730380
dwForceRight = 0x1730410
dwGameEntitySystem = 0x19E0790
dwGameEntitySystem_getHighestEntityIndex = 0x1510
dwGameRules = 0x191CB50
dwGlobalVars = 0x1727BB0
dwGlowManager = 0x191CF70
dwInterfaceLinkList = 0x1A0E6D8
dwLocalPlayerController = 0x190F428
dwLocalPlayerPawn = 0x17341B8
dwPlantedC4 = 0x1925988
dwPrediction = 0x1734080
dwSensitivity = 0x191D898
dwGameRules = 0x191FCA0
dwGlobalVars = 0x172ABA0
dwGlowManager = 0x19200C0
dwInterfaceLinkList = 0x1A118D8
dwLocalPlayerController = 0x1912578
dwLocalPlayerPawn = 0x17371A8
dwPlantedC4 = 0x1928AD8
dwPrediction = 0x1737070
dwSensitivity = 0x19209E8
dwSensitivity_sensitivity = 0x40
dwViewAngles = 0x192D860
dwViewMatrix = 0x1921050
dwViewRender = 0x19218D0
dwViewAngles = 0x19309B0
dwViewMatrix = 0x19241A0
dwViewRender = 0x1924A20
class engine2_dll: # engine2.dll
dwBuildNumber = 0x513574
@ -40,7 +40,7 @@ class engine2_dll: # engine2.dll
dwWindowWidth = 0x5CBC60
class game_info: # Some additional information about the game at dump time
buildNumber = 0x36AC # Game build number
buildNumber = 0x36AD # Game build number
class inputsystem_dll: # inputsystem.dll
dwInputSystem = 0x367A0

View File

@ -1,35 +1,35 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:42 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]
pub mod client_dll { // client.dll
pub const dwEntityList: usize = 0x18BFC08;
pub const dwForceAttack: usize = 0x172D030;
pub const dwForceAttack2: usize = 0x172D0C0;
pub const dwForceBackward: usize = 0x172D300;
pub const dwForceCrouch: usize = 0x172D5D0;
pub const dwForceForward: usize = 0x172D270;
pub const dwForceJump: usize = 0x172D540;
pub const dwForceLeft: usize = 0x172D390;
pub const dwForceRight: usize = 0x172D420;
pub const dwGameEntitySystem: usize = 0x19DD590;
pub const dwEntityList: usize = 0x18C2D58;
pub const dwForceAttack: usize = 0x1730020;
pub const dwForceAttack2: usize = 0x17300B0;
pub const dwForceBackward: usize = 0x17302F0;
pub const dwForceCrouch: usize = 0x17305C0;
pub const dwForceForward: usize = 0x1730260;
pub const dwForceJump: usize = 0x1730530;
pub const dwForceLeft: usize = 0x1730380;
pub const dwForceRight: usize = 0x1730410;
pub const dwGameEntitySystem: usize = 0x19E0790;
pub const dwGameEntitySystem_getHighestEntityIndex: usize = 0x1510;
pub const dwGameRules: usize = 0x191CB50;
pub const dwGlobalVars: usize = 0x1727BB0;
pub const dwGlowManager: usize = 0x191CF70;
pub const dwInterfaceLinkList: usize = 0x1A0E6D8;
pub const dwLocalPlayerController: usize = 0x190F428;
pub const dwLocalPlayerPawn: usize = 0x17341B8;
pub const dwPlantedC4: usize = 0x1925988;
pub const dwPrediction: usize = 0x1734080;
pub const dwSensitivity: usize = 0x191D898;
pub const dwGameRules: usize = 0x191FCA0;
pub const dwGlobalVars: usize = 0x172ABA0;
pub const dwGlowManager: usize = 0x19200C0;
pub const dwInterfaceLinkList: usize = 0x1A118D8;
pub const dwLocalPlayerController: usize = 0x1912578;
pub const dwLocalPlayerPawn: usize = 0x17371A8;
pub const dwPlantedC4: usize = 0x1928AD8;
pub const dwPrediction: usize = 0x1737070;
pub const dwSensitivity: usize = 0x19209E8;
pub const dwSensitivity_sensitivity: usize = 0x40;
pub const dwViewAngles: usize = 0x192D860;
pub const dwViewMatrix: usize = 0x1921050;
pub const dwViewRender: usize = 0x19218D0;
pub const dwViewAngles: usize = 0x19309B0;
pub const dwViewMatrix: usize = 0x19241A0;
pub const dwViewRender: usize = 0x1924A20;
}
pub mod engine2_dll { // engine2.dll
@ -44,7 +44,7 @@ pub mod engine2_dll { // engine2.dll
}
pub mod game_info { // Some additional information about the game at dump time
pub const buildNumber: usize = 0x36AC; // Game build number
pub const buildNumber: usize = 0x36AD; // Game build number
}
pub mod inputsystem_dll { // inputsystem.dll

View File

@ -1,29 +1,29 @@
---
client_dll: # client.dll
dwEntityList: 25951240
dwForceAttack: 24301616
dwForceAttack2: 24301760
dwForceBackward: 24302336
dwForceCrouch: 24303056
dwForceForward: 24302192
dwForceJump: 24302912
dwForceLeft: 24302480
dwForceRight: 24302624
dwGameEntitySystem: 27121040
dwEntityList: 25963864
dwForceAttack: 24313888
dwForceAttack2: 24314032
dwForceBackward: 24314608
dwForceCrouch: 24315328
dwForceForward: 24314464
dwForceJump: 24315184
dwForceLeft: 24314752
dwForceRight: 24314896
dwGameEntitySystem: 27133840
dwGameEntitySystem_getHighestEntityIndex: 5392
dwGameRules: 26331984
dwGlobalVars: 24279984
dwGlowManager: 26333040
dwInterfaceLinkList: 27322072
dwLocalPlayerController: 26276904
dwLocalPlayerPawn: 24330680
dwPlantedC4: 26368392
dwPrediction: 24330368
dwSensitivity: 26335384
dwGameRules: 26344608
dwGlobalVars: 24292256
dwGlowManager: 26345664
dwInterfaceLinkList: 27334872
dwLocalPlayerController: 26289528
dwLocalPlayerPawn: 24342952
dwPlantedC4: 26381016
dwPrediction: 24342640
dwSensitivity: 26348008
dwSensitivity_sensitivity: 64
dwViewAngles: 26400864
dwViewMatrix: 26349648
dwViewRender: 26351824
dwViewAngles: 26413488
dwViewMatrix: 26362272
dwViewRender: 26364448
engine2_dll: # engine2.dll
dwBuildNumber: 5322100
dwNetworkGameClient_deltaTick: 600
@ -34,7 +34,7 @@ engine2_dll: # engine2.dll
dwWindowHeight: 6077540
dwWindowWidth: 6077536
game_info: # Some additional information about the game at dump time
buildNumber: 13996 # Game build number
buildNumber: 13997 # Game build number
inputsystem_dll: # inputsystem.dll
dwInputSystem: 223136
matchmaking_dll: # matchmaking.dll

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class CBaseRendererSource2 { // CParticleFunctionRenderer

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:41 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class CBaseRendererSource2: # CParticleFunctionRenderer

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class CBasePulseGraphInstance {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:41 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class CBasePulseGraphInstance:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class RenderInputLayoutField_t {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class RenderInputLayoutField_t:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class AABB_t {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class AABB_t:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class CSSDSEndFrameViewInfo {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class CSSDSEndFrameViewInfo:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class CExampleSchemaVData_Monomorphic {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class CExampleSchemaVData_Monomorphic:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class ActiveModelConfig_t {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:41 +0000
Sat, 16 Mar 2024 00:42:38 +0000
'''
class ActiveModelConfig_t:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:41 +0000
* Sat, 16 Mar 2024 00:42:38 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class CDSPMixgroupModifier {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class CDSPMixgroupModifier:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class CFeIndexedJiggleBone {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class CFeIndexedJiggleBone:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
public static class AggregateLODSetup_t {

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#pragma once

View File

@ -1,6 +1,6 @@
'''
Generated using https://github.com/a2x/cs2-dumper
Thu, 14 Mar 2024 05:07:40 +0000
Sat, 16 Mar 2024 00:42:37 +0000
'''
class AggregateLODSetup_t:

View File

@ -1,6 +1,6 @@
/*
* Generated using https://github.com/a2x/cs2-dumper
* Thu, 14 Mar 2024 05:07:40 +0000
* Sat, 16 Mar 2024 00:42:37 +0000
*/
#![allow(non_snake_case, non_upper_case_globals)]

View File

@ -136,108 +136,76 @@ pub fn dump_offsets(
mod tests {
use super::*;
use core::arch::x86_64::_bittest;
use serde_json::Value;
use std::ffi::{c_char, c_void};
use std::fs;
use std::mem::offset_of;
use std::thread::sleep;
use std::thread;
use std::time::Duration;
fn setup() -> Result<Process> {
let mut process = Process::new("cs2.exe")?;
use core::arch::x86_64::_bittest;
process.initialize()?;
use anyhow::anyhow;
Ok(process)
use serde_json::Value;
fn read_json_value(file_path: &str) -> Result<Value> {
let content = fs::read_to_string(file_path)?;
serde_json::from_str(&content).map_err(Into::into)
}
fn get_class_field(module_name: &str, class_name: &str, class_key: &str) -> Option<u64> {
let content = match fs::read_to_string(format!("generated/{}.json", module_name)) {
Ok(content) => content,
Err(e) => {
eprintln!("Error reading file: {}", e);
fn get_class_field(module_name: &str, class_name: &str, class_key: &str) -> Result<u64> {
let value = read_json_value(&format!("generated/{}.json", module_name))
.expect("unable to read json file");
return None;
}
};
let value: Value = match serde_json::from_str(&content) {
Ok(parsed_value) => parsed_value,
Err(e) => {
eprintln!("Error parsing JSON: {}", e);
return None;
}
};
let class_value = &value[class_name];
let class_data = &class_value["data"];
let class_key_value = &class_data[class_key];
let value = class_key_value["value"].as_u64();
value
value[class_name]["data"][class_key]["value"]
.as_u64()
.ok_or_else(|| {
anyhow!(
"unable to find class field {} in class {}",
class_key,
class_name
)
})
}
fn get_offset_value(module_name: &str, offset_name: &str) -> Option<u64> {
let content = match fs::read_to_string("generated/offsets.json") {
Ok(content) => content,
Err(e) => {
eprintln!("Error reading file: {}", e);
fn get_offset_value(module_name: &str, offset_name: &str) -> Result<u64> {
let value = read_json_value("generated/offsets.json").expect("unable to read offsets.json");
return None;
}
};
let value: Value = match serde_json::from_str(&content) {
Ok(parsed_value) => parsed_value,
Err(e) => {
eprintln!("Error parsing JSON: {}", e);
return None;
}
};
let class_value = &value[module_name.replace(".", "_")];
let class_data = &class_value["data"];
let class_key_value = &class_data[offset_name];
let value = class_key_value["value"].as_u64();
value
value[module_name.replace(".", "_")]["data"][offset_name]["value"]
.as_u64()
.ok_or_else(|| anyhow!("unable to find offset"))
}
#[test]
fn build_number() -> Result<()> {
let process = setup()?;
let process = Process::new("cs2.exe")?;
let engine_base = process
.get_module_by_name("engine2.dll")
.expect("Failed to find engine2.dll")
.expect("unable to find engine2.dll")
.base();
let build_number_offset = get_offset_value("engine2.dll", "dwBuildNumber")
.expect("Failed to find dwBuildNumber offset");
let build_number_offset = get_offset_value("engine2.dll", "dwBuildNumber")?;
let build_number =
process.read_memory::<u32>(engine_base + build_number_offset as usize)?;
println!("Build number: {}", build_number);
println!("build number: {}", build_number);
Ok(())
}
#[test]
fn force_buttons() -> Result<()> {
let process = setup()?;
fn key_buttons() -> Result<()> {
let process = Process::new("cs2.exe")?;
let client_base = process
.get_module_by_name("client.dll")
.expect("Failed to find client.dll")
.expect("unable to find client.dll")
.base();
const FORCE_BUTTONS: [&str; 8] = [
const KEY_BUTTONS: [&str; 8] = [
"dwForceAttack",
"dwForceAttack2",
"dwForceBackward",
@ -248,24 +216,21 @@ mod tests {
"dwForceRight",
];
let get_key_state = |value: u32| -> &str {
match value {
256 => "Key up",
65537 => "Key down",
_ => "Unknown",
}
let get_key_state = |value: u32| match value {
256 => "key up",
65537 => "key down",
_ => "unknown",
};
// Sleep for a second, so we're able to test.
sleep(Duration::from_secs(1));
thread::sleep(Duration::from_secs(1));
for button in &FORCE_BUTTONS {
let offset = get_offset_value("client.dll", button)
.expect(&format!("Failed to find {} offset", button));
for button in &KEY_BUTTONS {
let offset = get_offset_value("client.dll", button).expect("unable to find client.dll");
let value = process.read_memory::<u32>(client_base + offset as usize)?;
println!("{}: {}", button, get_key_state(value));
println!("key button: {} (state: {})", button, get_key_state(value));
}
Ok(())
@ -312,15 +277,14 @@ mod tests {
}
}
let process = setup()?;
let process = Process::new("cs2.exe")?;
let client_base = process
.get_module_by_name("client.dll")
.expect("Failed to find client.dll")
.expect("unable to find client.dll")
.base();
let global_vars_offset = get_offset_value("client.dll", "dwGlobalVars")
.expect("Failed to find dwGlobalVars offset");
let global_vars_offset = get_offset_value("client.dll", "dwGlobalVars")?;
let global_vars = process
.read_memory::<*const GlobalVarsBase>(client_base + global_vars_offset as usize)?;
@ -331,58 +295,55 @@ mod tests {
.unwrap_or_default()
};
println!("Current map name: {}", current_map_name);
println!("current map name: {}", current_map_name);
Ok(())
}
#[test]
fn is_key_down() -> Result<()> {
let process = setup()?;
let process = Process::new("cs2.exe")?;
let input_system_base = process
.get_module_by_name("inputsystem.dll")
.expect("Failed to find inputsystem.dll")
.expect("unable to find inputsystem.dll")
.base();
let input_system_offset = get_offset_value("inputsystem.dll", "dwInputSystem")
.expect("Failed to find dwInputSystem offset");
let input_system_offset = get_offset_value("inputsystem.dll", "dwInputSystem")?;
let input_system = input_system_base + input_system_offset as usize;
let is_key_down = |key_code: i32| -> bool {
let key_map_element = process
let element = process
.read_memory::<i32>((input_system + 0x4 * (key_code as usize / 32) + 0x12A0).into())
.unwrap_or(0);
.unwrap_or_default();
unsafe { _bittest(&key_map_element, key_code & 0x1F) != 0 }
unsafe { _bittest(&element, key_code & 0x1F) != 0 }
};
// Sleep for a second, so we're able to test.
sleep(Duration::from_secs(1));
thread::sleep(Duration::from_secs(1));
// See https://www.unknowncheats.me/forum/3855779-post889.html for button codes.
println!("INSERT key down: {}", is_key_down(73));
println!("insert key down: {}", is_key_down(73));
Ok(())
}
#[test]
fn local_player_controller() -> Result<()> {
let process = setup()?;
let process = Process::new("cs2.exe")?;
let client_base = process
.get_module_by_name("client.dll")
.expect("Failed to find client.dll")
.expect("unable to find client.dll")
.base();
let local_player_controller_offset =
get_offset_value("client.dll", "dwLocalPlayerController")
.expect("Failed to find dwLocalPlayerController offset");
get_offset_value("client.dll", "dwLocalPlayerController")?;
let player_name_offset =
get_class_field("client.dll", "CBasePlayerController", "m_iszPlayerName")
.expect("Failed to find m_iszPlayerName offset");
get_class_field("client.dll", "CBasePlayerController", "m_iszPlayerName")?;
let local_player_controller =
process.read_memory::<usize>(client_base + local_player_controller_offset as usize)?;
@ -390,7 +351,7 @@ mod tests {
let player_name =
process.read_string((local_player_controller + player_name_offset as usize).into())?;
println!("Local player name: {}", player_name);
println!("local player name: {}", player_name);
Ok(())
}
@ -405,23 +366,20 @@ mod tests {
z: f32,
}
let process = setup()?;
let process = Process::new("cs2.exe")?;
let client_base = process
.get_module_by_name("client.dll")
.expect("Failed to find client.dll")
.expect("unable to find client.dll")
.base();
let local_player_pawn_offset = get_offset_value("client.dll", "dwLocalPlayerPawn")
.expect("Failed to find dwLocalPlayerPawn offset");
let local_player_pawn_offset = get_offset_value("client.dll", "dwLocalPlayerPawn")?;
let game_scene_node_offset =
get_class_field("client.dll", "C_BaseEntity", "m_pGameSceneNode")
.expect("Failed to find m_pGameSceneNode offset");
get_class_field("client.dll", "C_BaseEntity", "m_pGameSceneNode")?;
let absolute_origin_offset =
get_class_field("client.dll", "CGameSceneNode", "m_vecAbsOrigin")
.expect("Failed to find m_vecAbsOrigin offset");
get_class_field("client.dll", "CGameSceneNode", "m_vecAbsOrigin")?;
let local_player_pawn =
process.read_memory::<usize>(client_base + local_player_pawn_offset as usize)?;
@ -432,25 +390,22 @@ mod tests {
let absolute_origin = process
.read_memory::<Vector3D>((game_scene_node + absolute_origin_offset as usize).into())?;
println!("Local player origin: {:?}", absolute_origin);
println!("local player origin: {:?}", absolute_origin);
Ok(())
}
#[test]
fn window_size() -> Result<()> {
let process = setup()?;
let process = Process::new("cs2.exe")?;
let engine_base = process
.get_module_by_name("engine2.dll")
.expect("Failed to find engine2.dll")
.expect("unable to find engine2.dll")
.base();
let window_width_offset = get_offset_value("engine2.dll", "dwWindowWidth")
.expect("Failed to find dwWindowWidth offset");
let window_height_offset = get_offset_value("engine2.dll", "dwWindowHeight")
.expect("Failed to find dwWindowHeight offset");
let window_width_offset = get_offset_value("engine2.dll", "dwWindowWidth")?;
let window_height_offset = get_offset_value("engine2.dll", "dwWindowHeight")?;
let window_width =
process.read_memory::<u32>(engine_base + window_width_offset as usize)?;
@ -458,7 +413,7 @@ mod tests {
let window_height =
process.read_memory::<u32>(engine_base + window_height_offset as usize)?;
println!("Window size: {}x{}", window_width, window_height);
println!("window size: {}x{}", window_width, window_height);
Ok(())
}