strindex 3.3.1__tar.gz → 3.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strindex
3
- Version: 3.3.1
3
+ Version: 3.3.2
4
4
  Summary: A command line utility to extract and patch strings of various filetypes, with a focus on compatibility and translation.
5
5
  Home-page: https://github.com/zWolfrost/strindex
6
6
  Author: zWolfrost
@@ -3,7 +3,7 @@ from setuptools import setup
3
3
 
4
4
  setup(
5
5
  name = "strindex",
6
- version = "3.3.1",
6
+ version = "3.3.2",
7
7
  author = "zWolfrost",
8
8
  author_email = "zwolfrost@gmail.com",
9
9
  description = "A command line utility to extract and patch strings of various filetypes, with a focus on compatibility and translation.",
@@ -1,4 +1,4 @@
1
- from ..utils import Strindex, FileBytearray
1
+ from strindex.utils import Strindex, FileBytearray
2
2
 
3
3
 
4
4
  def get_last_chunk_pointer(data: FileBytearray) -> int:
@@ -1,4 +1,4 @@
1
- from ..utils import Strindex, FileBytearray
1
+ from strindex.utils import Strindex, FileBytearray
2
2
  import pefile
3
3
  pefile.fast_load = True
4
4
 
@@ -1,7 +1,7 @@
1
1
  import os, sys, argparse, re
2
2
  from hashlib import md5
3
- from importlib import import_module
4
- from .utils import PrintProgress, Strindex, FileBytearray, truncate_prev_char
3
+ from strindex.utils import PrintProgress, Strindex, FileBytearray, truncate_prev_char
4
+ from strindex.filetypes import pefile, datawin
5
5
 
6
6
 
7
7
  def get_module_methods(data: FileBytearray, action: str) -> dict:
@@ -9,17 +9,11 @@ def get_module_methods(data: FileBytearray, action: str) -> dict:
9
9
  Returns the methods of the module associated with the file type.
10
10
  """
11
11
 
12
- for file in os.listdir(os.path.join(os.path.dirname(__file__), "filetypes")):
13
- if file.endswith(".py") and file != "__init__.py":
14
- try:
15
- module = import_module(".filetypes." + file.rstrip('.py'), __package__)
16
- except ImportError:
17
- continue
18
-
19
- if module.is_valid(data):
20
- print(f'Detected filetype: "{file.rstrip(".py")}"')
21
- assert action in module.__dict__, f"Action '{action}' is not available for this file type."
22
- return module.__dict__[action]
12
+ for module in [pefile, datawin]:
13
+ if module.is_valid(data):
14
+ print(f'Detected filetype: "{module.__name__.split(".")[-1]}".')
15
+ assert action in module.__dict__, f"Action '{action}' is not available for this file type."
16
+ return module.__dict__[action]
23
17
 
24
18
  raise ValueError("This file type has no associated module, or the required libraries to handle it are not installed.")
25
19
 
@@ -50,7 +50,7 @@ class Strindex():
50
50
 
51
51
  DELIMITERS = (f"{'=' * 80}", f"{'-' * 80}", f'/', f'-')
52
52
  HEADER = f"You can freely delete informational lines in the header like this one.\n\n{{}}\n\n"
53
- INFO = f"#{'=' * 79}/ offset / rva / offset(s)-of-rva-pointer(s) /\n"
53
+ INFO = f"#{'=' * 79}/ offset / offset(s)-of-rva-pointer(s) /\n"
54
54
  COMPATIBLE_INFO = f"#{'=' * 79}[reallocate pointer(s) if 1]\n# replace this string...\n#{'-' * 79}\n# ...with this string!\n"
55
55
 
56
56
  full_header: str
@@ -60,7 +60,6 @@ class Strindex():
60
60
 
61
61
  overwrite: list[str]
62
62
  pointers: list[list[int]]
63
- rvas: list[int]
64
63
  offsets: list[int]
65
64
 
66
65
  original: list[str]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strindex
3
- Version: 3.3.1
3
+ Version: 3.3.2
4
4
  Summary: A command line utility to extract and patch strings of various filetypes, with a focus on compatibility and translation.
5
5
  Home-page: https://github.com/zWolfrost/strindex
6
6
  Author: zWolfrost
File without changes
File without changes
File without changes
File without changes
File without changes