fishhook 0.3.1__tar.gz → 0.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,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fishhook
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Allows for runtime hooking of static class functions
5
- Home-page: https://github.com/chilaxan/fishhook
6
- Author: chilaxan
7
- Author-email: chilaxan@gmail.com
5
+ Author-email: chilaxan <chilaxan@gmail.com>
6
+ License: MIT
7
+ Project-URL: repository, https://github.com/chilaxan/fishhook
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
@@ -57,7 +57,7 @@ void invalidateInstructionCache(void *addr, size_t length) {
57
57
  __builtin___clear_cache((char*)addr, (char*)(addr + length));
58
58
  #endif
59
59
  #else
60
- #error "cannot determine way to clear instruction cache (required on arm64, otherwise make an issue here: https://github.com/chilaxan/fishhook)"
60
+ // cannot determine way to clear instruction cache (required on arm64, otherwise make an issue here: https://github.com/chilaxan/fishhook)
61
61
  #endif
62
62
  }
63
63
 
@@ -1,13 +1,10 @@
1
1
  from ctypes import *
2
2
  import platform
3
+ import weakref
3
4
 
4
5
  if platform.system() == 'Windows':
5
6
  raise RuntimeError('fishhook.asm does not currently work on Windows')
6
7
 
7
- import sys
8
- import weakref
9
- import capstone as CS
10
- import keystone as KS
11
8
  from ._asm import writeExecutableMemory
12
9
  from .fishhook import getmem
13
10
  from .jit import TRAMPOLINE
@@ -2,7 +2,24 @@ from ctypes import *
2
2
  import sys
3
3
  import platform
4
4
 
5
- import capstone as CS
5
+ try:
6
+ import capstone as CS
7
+ except ModuleNotFoundError as err:
8
+ if err.name == 'distutils':
9
+ # capstone depends on distutils and pkg_resources, but in most configs does not need them
10
+ # 3.12+ has deprecated these modules
11
+ # we can stub them out and re-attempt the import
12
+ class stub:
13
+ def __getattr__(self, attr):
14
+ return self
15
+ def __call__(self, *args):
16
+ return ''
17
+
18
+ sys.modules['distutils'] = stub()
19
+ sys.modules['distutils.sysconfig'] = stub()
20
+ sys.modules['pkg_resources'] = stub()
21
+ import capstone as CS
22
+
6
23
  import keystone as KS
7
24
 
8
25
  ENDIAN = 'LITTLE' if memoryview(b'\1\0').cast('h')[0]==1 else 'BIG'
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fishhook
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Allows for runtime hooking of static class functions
5
- Home-page: https://github.com/chilaxan/fishhook
6
- Author: chilaxan
7
- Author-email: chilaxan@gmail.com
5
+ Author-email: chilaxan <chilaxan@gmail.com>
6
+ License: MIT
7
+ Project-URL: repository, https://github.com/chilaxan/fishhook
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
@@ -1,5 +1,6 @@
1
1
  LICENSE
2
2
  README.md
3
+ pyproject.toml
3
4
  setup.py
4
5
  fishhook/__init__.py
5
6
  fishhook/_asmmodule.c
@@ -0,0 +1,29 @@
1
+ [project]
2
+ name = "fishhook"
3
+ version = "0.3.2"
4
+ description = "Allows for runtime hooking of static class functions"
5
+ authors = [
6
+ { name = "chilaxan", email = "chilaxan@gmail.com" },
7
+ ]
8
+ license = { text = "MIT" }
9
+ readme = "README.md"
10
+ classifiers = [
11
+ "Programming Language :: Python :: 3",
12
+ "License :: OSI Approved :: MIT License",
13
+ "Operating System :: OS Independent",
14
+ ]
15
+ requires-python = ">=3.8"
16
+ dependencies = [
17
+ "capstone",
18
+ "keystone-engine",
19
+ ]
20
+
21
+ [project.urls]
22
+ repository = "https://github.com/chilaxan/fishhook"
23
+
24
+ [build-system]
25
+ requires = ["setuptools"]
26
+ build-backend = "setuptools.build_meta"
27
+
28
+ [tool.setuptools]
29
+ packages = ["fishhook"]
@@ -0,0 +1,7 @@
1
+ import setuptools
2
+
3
+ setuptools.setup(
4
+ ext_modules=[
5
+ setuptools.Extension("fishhook._asm", sources=["fishhook/_asmmodule.c"])
6
+ ],
7
+ )
fishhook-0.3.1/setup.py DELETED
@@ -1,24 +0,0 @@
1
- import setuptools
2
-
3
- with open("README.md", "r") as fh:
4
- long_description = fh.read()
5
-
6
- setuptools.setup(
7
- name="fishhook",
8
- version="0.3.1",
9
- author="chilaxan",
10
- author_email="chilaxan@gmail.com",
11
- description="Allows for runtime hooking of static class functions",
12
- long_description=long_description,
13
- long_description_content_type="text/markdown",
14
- url="https://github.com/chilaxan/fishhook",
15
- packages=['fishhook'],
16
- classifiers=[
17
- "Programming Language :: Python :: 3",
18
- "License :: OSI Approved :: MIT License",
19
- "Operating System :: OS Independent",
20
- ],
21
- python_requires='>=3.8',
22
- ext_modules=[setuptools.Extension('fishhook._asm', sources=['fishhook/_asmmodule.c'])],
23
- install_requires=['capstone', 'keystone-engine']
24
- )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes