trainerbase 3.13.0__tar.gz → 3.14.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-3.13.0 → trainerbase-3.14.1}/PKG-INFO +1 -1
- {trainerbase-3.13.0 → trainerbase-3.14.1}/pyproject.toml +1 -1
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/codeinjection.py +3 -2
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/common/helpers.py +17 -4
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/helpers.py +3 -2
- {trainerbase-3.13.0 → trainerbase-3.14.1}/LICENSE +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/README.md +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/__init__.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/common/__init__.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/common/abc.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/common/keyboard.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/common/teleport.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/config.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gameobject.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/__init__.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/injections.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/misc.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/objects.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/scripts.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/speedhack.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/teleport.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/gui/types.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/main.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/memory.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/process.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/scriptengine.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/speedhack.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase/tts.py +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase_vendor/FASM.EXE +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase_vendor/speedhack32.dll +0 -0
- {trainerbase-3.13.0 → trainerbase-3.14.1}/trainerbase_vendor/speedhack64.dll +0 -0
|
@@ -8,7 +8,7 @@ from typing import ClassVar, Final, Self, override
|
|
|
8
8
|
|
|
9
9
|
from pymem.exception import MemoryWriteError
|
|
10
10
|
|
|
11
|
-
from trainerbase.memory import ARCH, ConvertibleToAddress, ensure_address, pm
|
|
11
|
+
from trainerbase.memory import ARCH, ConvertibleToAddress, allocate, ensure_address, pm
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
FASM_EXECUTABLE_PATH: Final[Path] = Path(__file__).resolve().parent.parent / "trainerbase_vendor" / "FASM.EXE"
|
|
@@ -67,6 +67,7 @@ class AllocatingCodeInjection(AbstractCodeInjection): # pylint: disable=too-man
|
|
|
67
67
|
self,
|
|
68
68
|
address: ConvertibleToAddress,
|
|
69
69
|
code_to_inject: Code,
|
|
70
|
+
*,
|
|
70
71
|
original_code_length: int = 0,
|
|
71
72
|
new_memory_size: int = 1024,
|
|
72
73
|
is_long_x64_jump_needed: bool | None = None,
|
|
@@ -92,7 +93,7 @@ class AllocatingCodeInjection(AbstractCodeInjection): # pylint: disable=too-man
|
|
|
92
93
|
def inject(self):
|
|
93
94
|
self.injection_point = self.address.resolve()
|
|
94
95
|
|
|
95
|
-
self.new_memory_address: int =
|
|
96
|
+
self.new_memory_address: int = allocate(self.new_memory_size)
|
|
96
97
|
|
|
97
98
|
self.original_code = pm.read_bytes(self.injection_point, self.original_code_length)
|
|
98
99
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from collections.abc import Iterator, Sequence
|
|
2
|
+
from typing import overload
|
|
2
3
|
from uuid import uuid4
|
|
3
4
|
|
|
4
5
|
from trainerbase.gameobject import AbstractReadableObject, GameObject
|
|
@@ -30,11 +31,17 @@ class ASMArrayManager(Sequence):
|
|
|
30
31
|
def __len__(self) -> int:
|
|
31
32
|
return self.array_length
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
target_address = Address(element_address, self.offsets, self.add)
|
|
34
|
+
@overload
|
|
35
|
+
def __getitem__(self, index: int) -> Address: ...
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
@overload
|
|
38
|
+
def __getitem__(self, index: slice) -> list[Address]: ...
|
|
39
|
+
|
|
40
|
+
def __getitem__(self, index: int | slice) -> Address | list[Address]:
|
|
41
|
+
if isinstance(index, int):
|
|
42
|
+
return self.get_address_of_element(index)
|
|
43
|
+
|
|
44
|
+
return [self.get_address_of_element(i) for i in range(index.start, index.stop, index.step)]
|
|
38
45
|
|
|
39
46
|
def __iter__(self) -> Iterator[Address]:
|
|
40
47
|
for index in range(len(self)):
|
|
@@ -43,6 +50,12 @@ class ASMArrayManager(Sequence):
|
|
|
43
50
|
def get_pointer_to_element(self, index: int) -> int:
|
|
44
51
|
return self.array_address + self.element_size * index
|
|
45
52
|
|
|
53
|
+
def get_address_of_element(self, index: int) -> Address:
|
|
54
|
+
element_address = self.get_pointer_to_element(index)
|
|
55
|
+
target_address = Address(element_address, self.offsets, self.add)
|
|
56
|
+
|
|
57
|
+
return Address(target_address.resolve())
|
|
58
|
+
|
|
46
59
|
def generate_asm_append_code(self, from_register: str) -> str:
|
|
47
60
|
array_address_register = "rbx" if pm.is_64_bit else "ebx"
|
|
48
61
|
array_index_register = "rcx" if pm.is_64_bit else "ecx"
|
|
@@ -18,10 +18,9 @@ def simple_trainerbase_menu(window_title: str, width: int, height: int):
|
|
|
18
18
|
dpg.create_context()
|
|
19
19
|
dpg.create_viewport(
|
|
20
20
|
title=window_title,
|
|
21
|
-
min_width=width,
|
|
22
|
-
min_height=height,
|
|
23
21
|
width=width,
|
|
24
22
|
height=height,
|
|
23
|
+
resizable=False,
|
|
25
24
|
)
|
|
26
25
|
dpg.setup_dearpygui()
|
|
27
26
|
|
|
@@ -33,9 +32,11 @@ def simple_trainerbase_menu(window_title: str, width: int, height: int):
|
|
|
33
32
|
no_move=True,
|
|
34
33
|
no_title_bar=True,
|
|
35
34
|
horizontal_scrollbar=True,
|
|
35
|
+
autosize=True,
|
|
36
36
|
):
|
|
37
37
|
initializer()
|
|
38
38
|
|
|
39
|
+
dpg.set_primary_window("menu", value=True)
|
|
39
40
|
dpg.show_viewport()
|
|
40
41
|
|
|
41
42
|
on_initialized()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|