trainerbase 3.12.1__tar.gz → 3.13.0__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.
Files changed (31) hide show
  1. {trainerbase-3.12.1 → trainerbase-3.13.0}/PKG-INFO +1 -1
  2. {trainerbase-3.12.1 → trainerbase-3.13.0}/pyproject.toml +1 -1
  3. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/codeinjection.py +7 -12
  4. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/process.py +3 -1
  5. {trainerbase-3.12.1 → trainerbase-3.13.0}/LICENSE +0 -0
  6. {trainerbase-3.12.1 → trainerbase-3.13.0}/README.md +0 -0
  7. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/__init__.py +0 -0
  8. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/common/__init__.py +0 -0
  9. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/common/abc.py +0 -0
  10. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/common/helpers.py +0 -0
  11. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/common/keyboard.py +0 -0
  12. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/common/teleport.py +0 -0
  13. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/config.py +0 -0
  14. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gameobject.py +0 -0
  15. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/__init__.py +0 -0
  16. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/helpers.py +0 -0
  17. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/injections.py +0 -0
  18. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/misc.py +0 -0
  19. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/objects.py +0 -0
  20. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/scripts.py +0 -0
  21. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/speedhack.py +0 -0
  22. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/teleport.py +0 -0
  23. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/gui/types.py +0 -0
  24. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/main.py +0 -0
  25. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/memory.py +0 -0
  26. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/scriptengine.py +0 -0
  27. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/speedhack.py +0 -0
  28. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase/tts.py +0 -0
  29. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase_vendor/FASM.EXE +0 -0
  30. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase_vendor/speedhack32.dll +0 -0
  31. {trainerbase-3.12.1 → trainerbase-3.13.0}/trainerbase_vendor/speedhack64.dll +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trainerbase
3
- Version: 3.12.1
3
+ Version: 3.13.0
4
4
  Summary: Framework for creating game trainers/mods
5
5
  Home-page: https://gitlab.com/python-trainers/trainer-base
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "trainerbase"
3
- version = "3.12.1"
3
+ version = "3.13.0"
4
4
  description = "Framework for creating game trainers/mods"
5
5
  authors = ["v01d <v01d@v01d.ru>", "doomayka <zd@doomayka.ru>"]
6
6
  license = "MIT"
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
  from subprocess import DEVNULL
5
5
  from subprocess import run as run_executable
6
6
  from tempfile import TemporaryDirectory
7
- from typing import ClassVar, Final, Never, Self, override
7
+ from typing import ClassVar, Final, Self, override
8
8
 
9
9
  from pymem.exception import MemoryWriteError
10
10
 
@@ -69,21 +69,16 @@ class AllocatingCodeInjection(AbstractCodeInjection): # pylint: disable=too-man
69
69
  code_to_inject: Code,
70
70
  original_code_length: int = 0,
71
71
  new_memory_size: int = 1024,
72
- is_long_x64_jump_needed: Never = Never,
72
+ is_long_x64_jump_needed: bool | None = None,
73
73
  ):
74
- if is_long_x64_jump_needed is not Never:
75
- raise Exception( # pylint: disable=broad-exception-raised
76
- "Since TrainerBase 3.4.0 is_long_x64_jump_needed has been deprecated."
77
- " Now there is not need to manually pop and push rax. That's why you must"
78
- " rewrite injections based on manual pop rax, push rax and then remove is_long_x64_jump_needed"
79
- " argument"
80
- )
74
+ if is_long_x64_jump_needed is None:
75
+ is_long_x64_jump_needed = pm.is_64_bit
81
76
 
77
+ self.is_long_x64_jump_needed = is_long_x64_jump_needed
82
78
  self.address = ensure_address(address)
83
-
84
79
  self.code_to_inject = compile_asm(code_to_inject)
85
80
 
86
- if pm.is_64_bit:
81
+ if self.is_long_x64_jump_needed:
87
82
  self.code_to_inject = compile_asm("pop rax") + self.code_to_inject + compile_asm("push rax")
88
83
 
89
84
  self.original_code: bytes = b""
@@ -101,7 +96,7 @@ class AllocatingCodeInjection(AbstractCodeInjection): # pylint: disable=too-man
101
96
 
102
97
  self.original_code = pm.read_bytes(self.injection_point, self.original_code_length)
103
98
 
104
- if pm.is_64_bit:
99
+ if self.is_long_x64_jump_needed:
105
100
  jump_to_new_mem = compile_asm(get_long_x64_jump_to_new_mem_code(self.new_memory_address))
106
101
  jumper_length = len(jump_to_new_mem)
107
102
  jump_back_address = self.injection_point + jumper_length - 1
@@ -24,7 +24,9 @@ def attach_to_process() -> Pymem:
24
24
  for process_name in cycle(process_names):
25
25
  try:
26
26
  pm = Pymem(
27
- process_name, exact_match=pymem_config["exact_match"], ignore_case=pymem_config["ignore_case"]
27
+ process_name,
28
+ exact_match=pymem_config["exact_match"],
29
+ ignore_case=pymem_config["ignore_case"],
28
30
  )
29
31
  except ProcessNotFound:
30
32
  continue
File without changes
File without changes