forked from mikebaldi/Idle-Champions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IC_GameSettingsClass.ahk
72 lines (65 loc) · 4.11 KB
/
IC_GameSettingsClass.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include IC_GameObjectStructureClass.ahk
; GameSettings class contains IC's GameSettings class structure. Useful for finding details for doing server calls.
class GameSettings
{
StaticOffset := 0xD20
__new()
{
this.Refresh()
}
GetVersion()
{
return "v1.0, 11/16/21, IC v0.412, Steam"
}
Refresh()
{
;Open a process with sufficient access to read and write memory addresses (this is required before you can use the other functions)
;You only need to do this once. But if the process closes/restarts, then you will need to perform this step again. Refer to the notes section below.
;Also, if the target process is running as admin, then the script will also require admin rights!
;Note: The program identifier can be any AHK windowTitle i.e.ahk_exe, ahk_class, ahk_pid, or simply the window title.
;hProcessCopy is an optional variable in which the opened handled is stored.
this.Main := new _ClassMemory("ahk_exe IdleDragons.exe", "", hProcessCopy)
this.BaseAddress := this.Main.getModuleBaseAddress("mono-2.0-bdwgc.dll")+0x003A1C54
this.GameSettings := new GameObjectStructure([0xA8])
this.GameSettings.BaseAddress := this.BaseAddress
this.GameSettings.UserID := new GameObjectStructure(this.GameSettings,,[this.StaticOffset + 0x20])
this.GameSettings.Hash := new GameObjectStructure(this.GameSettings,"UTF-16",[this.StaticOffset + 0x28, 0xC])
this.GameSettings.Platform := new GameObjectStructure(this.GameSettings,,[this.StaticOffset + 0x30])
this.GameSettings.Version := new GameObjectStructure(this.GameSettings,,[this.StaticOffset + 0x38]) ; Push MobileClientVersion
this.GameSettings.PostFix := new GameObjectStructure(this.GameSettings,"UTF-16",[this.StaticOffset + 0x3C, 0xC])
this.GameSettings.GameSettingsInstanceLocation := new GameObjectStructure(this.GameSettings,,[this.StaticOffset, 0x0])
this.GameSettings.GameSettingsInstanceLocation.InstanceID := new GameObjectStructure(this.GameSettings.GameSettingsInstanceLocation,,[0x10])
}
}
; EGS variation of GameSettings (Thanks to Fenume for updating offsets for 412)
class GameSettingsEGS
{
StaticOffset := 0xE00
__new()
{
this.Refresh()
}
GetVersion()
{
return "v1.0, 11/16/21, IC v0.412, EGS"
}
Refresh()
{
;Open a process with sufficient access to read and write memory addresses (this is required before you can use the other functions)
;You only need to do this once. But if the process closes/restarts, then you will need to perform this step again. Refer to the notes section below.
;Also, if the target process is running as admin, then the script will also require admin rights!
;Note: The program identifier can be any AHK windowTitle i.e.ahk_exe, ahk_class, ahk_pid, or simply the window title.
;hProcessCopy is an optional variable in which the opened handled is stored.
this.Main := new _ClassMemory("ahk_exe IdleDragons.exe", "", hProcessCopy)
this.BaseAddress := this.Main.getModuleBaseAddress("mono-2.0-bdwgc.dll")+0x00493DC8
this.GameSettings := new GameObjectStructure([0xE0])
this.GameSettings.BaseAddress := this.BaseAddress
this.GameSettings.UserID := new GameObjectStructure(this.GameSettings,,[this.StaticOffset + 0x40])
this.GameSettings.Hash := new GameObjectStructure(this.GameSettings,"UTF-16",[this.StaticOffset + 0x48, 0x14])
this.GameSettings.Platform := new GameObjectStructure(this.GameSettings,,[this.StaticOffset + 0x58])
this.GameSettings.Version := new GameObjectStructure(this.GameSettings,,[this.StaticOffset + 0x68]) ; Push MobileClientVersion
this.GameSettings.PostFix := new GameObjectStructure(this.GameSettings,"UTF-16",[this.StaticOffset + 0x70, 0x14])
this.GameSettings.GameSettingsInstanceLocation := new GameObjectStructure(this.GameSettings,,[this.StaticOffset, 0x0])
this.GameSettings.GameSettingsInstanceLocation.InstanceID := new GameObjectStructure(this.GameSettings.GameSettingsInstanceLocation,,[0x18])
}
}