trainerbase 2.11.7__tar.gz → 2.12.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trainerbase-2.12.1/PKG-INFO +16 -0
- trainerbase-2.12.1/README.md +1 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/pyproject.toml +26 -25
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/common.py +1 -1
- trainerbase-2.12.1/trainerbase/config.py +9 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/gameobject.py +49 -22
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/memory.py +4 -4
- {TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/main.py +0 -1
- trainerbase-2.12.1/trainerbase/template/trainerbase.toml +4 -0
- trainerbase-2.12.1/trainerbase/use_trainer_template.py +5 -0
- TrainerBase-2.11.7/PKG-INFO +0 -23
- TrainerBase-2.11.7/README.md +0 -12
- TrainerBase-2.11.7/trainerbase/template/config.py +0 -1
- TrainerBase-2.11.7/trainerbase/use_trainer_template.py +0 -5
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/LICENSE +0 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/fasm/FASM.EXE +0 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/__init__.py +0 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/codeinjection.py +0 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/gui.py +0 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/scriptengine.py +0 -0
- {TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/__init__.py +0 -0
- {TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/gui.py +1 -1
- {TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/injections.py +0 -0
- {TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/memory.py +0 -0
- {TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/objects.py +0 -0
- {TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/scripts.py +0 -0
- {TrainerBase-2.11.7 → trainerbase-2.12.1}/trainerbase/tts.py +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: TrainerBase
|
|
3
|
+
Version: 2.12.1
|
|
4
|
+
Summary: Framework for creating game trainers/mods
|
|
5
|
+
Home-page: https://gitlab.com/v01d-gm/trainer-base
|
|
6
|
+
Author-Email: v01d <v01d@v01d.ru>, doomayka <zd@doomayka.ru>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://gitlab.com/v01d-gm/trainer-base
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Requires-Dist: pymem>=1.12.0
|
|
11
|
+
Requires-Dist: dearpygui>=1.9.1
|
|
12
|
+
Requires-Dist: keyboard>=0.13.5
|
|
13
|
+
Requires-Dist: pyttsx3>=2.90
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# TrainerBase
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# TrainerBase
|
|
@@ -1,37 +1,19 @@
|
|
|
1
|
-
[tool.black]
|
|
2
|
-
target-version = [
|
|
3
|
-
"py311",
|
|
4
|
-
]
|
|
5
|
-
line-length = 120
|
|
6
|
-
|
|
7
|
-
[tool.pdm.build]
|
|
8
|
-
includes = [
|
|
9
|
-
"fasm/",
|
|
10
|
-
"trainerbase/",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
[tool.pdm.dev-dependencies]
|
|
14
|
-
dev = [
|
|
15
|
-
"black>=23.3.0",
|
|
16
|
-
"pylint>=2.17.2",
|
|
17
|
-
]
|
|
18
|
-
|
|
19
1
|
[project]
|
|
20
2
|
name = "TrainerBase"
|
|
21
|
-
version = "2.
|
|
3
|
+
version = "2.12.1"
|
|
22
4
|
description = "Framework for creating game trainers/mods"
|
|
23
5
|
authors = [
|
|
24
6
|
{ name = "v01d", email = "v01d@v01d.ru" },
|
|
25
7
|
{ name = "doomayka", email = "zd@doomayka.ru" },
|
|
26
8
|
]
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
readme = "README.md"
|
|
27
11
|
dependencies = [
|
|
28
|
-
"pymem>=1.
|
|
29
|
-
"dearpygui>=1.9.
|
|
12
|
+
"pymem>=1.12.0",
|
|
13
|
+
"dearpygui>=1.9.1",
|
|
30
14
|
"keyboard>=0.13.5",
|
|
31
15
|
"pyttsx3>=2.90",
|
|
32
16
|
]
|
|
33
|
-
requires-python = ">=3.11"
|
|
34
|
-
readme = "README.md"
|
|
35
17
|
|
|
36
18
|
[project.license]
|
|
37
19
|
text = "MIT"
|
|
@@ -41,6 +23,25 @@ homepage = "https://gitlab.com/v01d-gm/trainer-base"
|
|
|
41
23
|
|
|
42
24
|
[build-system]
|
|
43
25
|
requires = [
|
|
44
|
-
"pdm-
|
|
26
|
+
"pdm-backend",
|
|
27
|
+
]
|
|
28
|
+
build-backend = "pdm.backend"
|
|
29
|
+
|
|
30
|
+
[tool.black]
|
|
31
|
+
target-version = [
|
|
32
|
+
"py311",
|
|
33
|
+
]
|
|
34
|
+
line-length = 120
|
|
35
|
+
|
|
36
|
+
[tool.pdm.build]
|
|
37
|
+
includes = [
|
|
38
|
+
"fasm/",
|
|
39
|
+
"trainerbase/",
|
|
40
|
+
]
|
|
41
|
+
package-dir = "trainerbase"
|
|
42
|
+
|
|
43
|
+
[tool.pdm.dev-dependencies]
|
|
44
|
+
dev = [
|
|
45
|
+
"black>=23.7.0",
|
|
46
|
+
"pylint>=2.17.5",
|
|
45
47
|
]
|
|
46
|
-
build-backend = "pdm.pep517.api"
|
|
@@ -123,7 +123,7 @@ class Teleport:
|
|
|
123
123
|
self.set_coords(*new_coords)
|
|
124
124
|
|
|
125
125
|
def create_movement_vector_updater_script(self):
|
|
126
|
-
if self.movement_vector_updater_script
|
|
126
|
+
if self.movement_vector_updater_script is None:
|
|
127
127
|
self.movement_vector_updater_script = Script(self.update_movement_vector, enabled=True)
|
|
128
128
|
|
|
129
129
|
return self.movement_vector_updater_script
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
1
2
|
from uuid import uuid4
|
|
2
3
|
from typing import Self
|
|
3
|
-
from collections.abc import Callable
|
|
4
4
|
|
|
5
5
|
from trainerbase.memory import Address, make_address, pm
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class GameObject:
|
|
8
|
+
class GameObject(ABC):
|
|
9
9
|
DPG_TAG_PREFIX = "object__"
|
|
10
10
|
DPG_TAG_POSTFIX_IS_FROZEN = "__frozen"
|
|
11
11
|
DPG_TAG_POSTFIX_GETTER = "__getter"
|
|
@@ -13,19 +13,25 @@ class GameObject:
|
|
|
13
13
|
|
|
14
14
|
updated_objects: list[Self] = []
|
|
15
15
|
|
|
16
|
+
@staticmethod
|
|
17
|
+
@abstractmethod
|
|
18
|
+
def pm_read(address: int):
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
@staticmethod
|
|
22
|
+
@abstractmethod
|
|
23
|
+
def pm_write(address: int, value):
|
|
24
|
+
pass
|
|
25
|
+
|
|
16
26
|
def __init__(
|
|
17
27
|
self,
|
|
18
28
|
address: Address | int,
|
|
19
|
-
pm_read: Callable,
|
|
20
|
-
pm_write: Callable,
|
|
21
29
|
frozen=None,
|
|
22
30
|
):
|
|
23
31
|
GameObject.updated_objects.append(self)
|
|
24
32
|
|
|
25
33
|
self.address = make_address(address)
|
|
26
34
|
self.frozen = frozen
|
|
27
|
-
self.pm_read = pm_read
|
|
28
|
-
self.pm_write = pm_write
|
|
29
35
|
|
|
30
36
|
dpg_tag = f"{GameObject.DPG_TAG_PREFIX}{uuid4()}"
|
|
31
37
|
self.dpg_tag_frozen = f"{dpg_tag}{GameObject.DPG_TAG_POSTFIX_IS_FROZEN}"
|
|
@@ -59,30 +65,25 @@ class GameObject:
|
|
|
59
65
|
self.pm_write(self.address.resolve(), self.before_write(new_value))
|
|
60
66
|
|
|
61
67
|
|
|
62
|
-
class
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
pointer,
|
|
66
|
-
pm.read_int,
|
|
67
|
-
pm.write_int,
|
|
68
|
-
)
|
|
68
|
+
class GameFloat(GameObject):
|
|
69
|
+
pm_read = pm.read_float
|
|
70
|
+
pm_write = pm.write_float
|
|
69
71
|
|
|
72
|
+
def before_write(self, value):
|
|
73
|
+
return float(value)
|
|
70
74
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
pm.read_float,
|
|
76
|
-
pm.write_float,
|
|
77
|
-
)
|
|
75
|
+
|
|
76
|
+
class GameDouble(GameObject):
|
|
77
|
+
pm_read = pm.read_double
|
|
78
|
+
pm_write = pm.write_double
|
|
78
79
|
|
|
79
80
|
def before_write(self, value):
|
|
80
81
|
return float(value)
|
|
81
82
|
|
|
82
83
|
|
|
83
84
|
class GameByte(GameObject):
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
pm_read = pm.read_bytes
|
|
86
|
+
pm_write = pm.write_bytes
|
|
86
87
|
|
|
87
88
|
def before_write(self, value: int):
|
|
88
89
|
return value.to_bytes(1, "little")
|
|
@@ -97,3 +98,29 @@ class GameByte(GameObject):
|
|
|
97
98
|
@value.setter
|
|
98
99
|
def value(self, new_value):
|
|
99
100
|
self.pm_write(self.address.resolve(), self.before_write(new_value), 1)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def create_simple_game_object_class(pm_type_name: str, class_name: str = None) -> GameObject:
|
|
104
|
+
if class_name is None:
|
|
105
|
+
class_name = f"Game{pm_type_name}"
|
|
106
|
+
|
|
107
|
+
pm_type_name = pm_type_name.lower()
|
|
108
|
+
|
|
109
|
+
try:
|
|
110
|
+
pm_read = getattr(pm, f"read_{pm_type_name}")
|
|
111
|
+
pm_write = getattr(pm, f"write_{pm_type_name}")
|
|
112
|
+
except AttributeError as e:
|
|
113
|
+
raise ValueError(f"Pymem doesn't have reader/writer for type {pm_type_name}") from e
|
|
114
|
+
|
|
115
|
+
return type(class_name, (GameObject,), {"pm_read": pm_read, "pm_write": pm_write})
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
GameInt = create_simple_game_object_class("Int")
|
|
119
|
+
GameShort = create_simple_game_object_class("Short")
|
|
120
|
+
GameLongLong = create_simple_game_object_class("LongLong")
|
|
121
|
+
|
|
122
|
+
GameUnsignedInt = create_simple_game_object_class("uint", "GameUnsignedInt")
|
|
123
|
+
GameUnsignedShort = create_simple_game_object_class("ushort", "GameUnsignedShort")
|
|
124
|
+
GameUnsignedLongLong = create_simple_game_object_class("ulonglong", "GameUnsignedLongLong")
|
|
125
|
+
|
|
126
|
+
GameBool = create_simple_game_object_class("Bool")
|
|
@@ -3,17 +3,17 @@ from typing import Self
|
|
|
3
3
|
from pymem import Pymem
|
|
4
4
|
from pymem.exception import ProcessNotFound
|
|
5
5
|
|
|
6
|
-
from config import
|
|
6
|
+
from trainerbase.config import pymem_config
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
for process_name in
|
|
9
|
+
for process_name in pymem_config["process_names"]:
|
|
10
10
|
try:
|
|
11
|
-
pm = Pymem(process_name)
|
|
11
|
+
pm = Pymem(process_name, exact_match=pymem_config["exact_match"], ignore_case=pymem_config["ignore_case"])
|
|
12
12
|
except ProcessNotFound:
|
|
13
13
|
continue
|
|
14
14
|
break
|
|
15
15
|
else:
|
|
16
|
-
raise ProcessNotFound(f"not any: {
|
|
16
|
+
raise ProcessNotFound(f"not any: {pymem_config['process_names']}")
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
ARCH = 32 if pm.is_WoW64 else 64
|
TrainerBase-2.11.7/PKG-INFO
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: TrainerBase
|
|
3
|
-
Version: 2.11.7
|
|
4
|
-
Summary: Framework for creating game trainers/mods
|
|
5
|
-
License: MIT
|
|
6
|
-
Author-email: v01d <v01d@v01d.ru>,doomayka <zd@doomayka.ru>
|
|
7
|
-
Requires-Python: >=3.11
|
|
8
|
-
Project-URL: homepage, https://gitlab.com/v01d-gm/trainer-base
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
|
|
11
|
-
# Trainer Base
|
|
12
|
-
|
|
13
|
-
[](https://badge.fury.io/py/trainerbase)
|
|
14
|
-
[](https://pepy.tech/project/trainerbase)
|
|
15
|
-
|
|
16
|
-
## To create project from template
|
|
17
|
-
```
|
|
18
|
-
> python -m trainerbase.use_trainer_template
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Examples
|
|
22
|
-
[v01d's GameMods](https://gitlab.com/v01d-gm)
|
|
23
|
-
|
TrainerBase-2.11.7/README.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Trainer Base
|
|
2
|
-
|
|
3
|
-
[](https://badge.fury.io/py/trainerbase)
|
|
4
|
-
[](https://pepy.tech/project/trainerbase)
|
|
5
|
-
|
|
6
|
-
## To create project from template
|
|
7
|
-
```
|
|
8
|
-
> python -m trainerbase.use_trainer_template
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Examples
|
|
12
|
-
[v01d's GameMods](https://gitlab.com/v01d-gm)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
PROCESS_NAMES = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/memory.py
RENAMED
|
File without changes
|
{TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/objects.py
RENAMED
|
File without changes
|
{TrainerBase-2.11.7/trainerbase/template → trainerbase-2.12.1/trainerbase/template/scr}/scripts.py
RENAMED
|
File without changes
|
|
File without changes
|