PyQBDI 0.11.0__cp39-cp39-linux_armv7l.whl → 0.12.0__cp39-cp39-linux_armv7l.whl

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.

Potentially problematic release.


This version of PyQBDI might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PyQBDI
3
- Version: 0.11.0
3
+ Version: 0.12.0
4
4
  Summary: Python binding for QBDI
5
5
  Author: Nicolas Surbayrole
6
6
  Author-email: qbdi@quarkslab.com
@@ -9,7 +9,6 @@ Project-URL: Documentation, https://qbdi.readthedocs.io/
9
9
  Project-URL: Source, https://github.com/QBDI/QBDI
10
10
  Project-URL: Homepage, https://qbdi.quarkslab.com/
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: License :: OSI Approved :: Apache Software License
13
12
  Classifier: Operating System :: Microsoft :: Windows
14
13
  Classifier: Operating System :: MacOS
15
14
  Classifier: Operating System :: POSIX :: Linux
@@ -19,11 +18,14 @@ Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
22
23
  Classifier: Topic :: Security
23
24
  Classifier: Topic :: Software Development :: Debuggers
24
25
  Requires-Python: >=3.8
25
26
  Description-Content-Type: text/x-rst
26
27
  License-File: LICENSE.txt
28
+ Dynamic: license-file
27
29
 
28
30
  Introduction
29
31
  ============
@@ -66,16 +68,16 @@ Status
66
68
  .. role:: orange
67
69
  .. role:: red
68
70
 
69
- ======= ============================== ======================== =================================
70
- CPU Operating Systems Execution Memory Access Information
71
- ======= ============================== ======================== =================================
72
- x86-64 Android, Linux, macOS, Windows :green:`Supported` :green:`Supported`
73
- x86 Android, Linux, macOS, Windows :green:`Supported` :green:`Supported`
74
- ARM Android, Linux :yellow:`Supported (*)` :yellow:`Supported (*)`
75
- AArch64 Android, Linux, macOS :yellow:`Supported (*)` :yellow:`Supported (*)`
76
- ======= ============================== ======================== =================================
71
+ ======= ============================== ================== =========================
72
+ CPU Operating Systems Execution Memory Access Information
73
+ ======= ============================== ================== =========================
74
+ x86-64 Android, Linux, macOS, Windows :green:`Supported` :green:`Supported`
75
+ x86 Android, Linux, macOS, Windows :green:`Supported` :green:`Supported`
76
+ ARM Android, Linux :green:`Supported` :green:`Supported`
77
+ AArch64 Android, Linux, macOS, IOs (*) :green:`Supported` :green:`Supported`
78
+ ======= ============================== ================== =========================
77
79
 
78
- \* The ARM and AArch64 instruction sets are supported but in early support.
80
+ \* IOs support is unstable and need a jailbroken device.
79
81
 
80
82
  Installation
81
83
  ============
@@ -94,11 +96,7 @@ Devel packages
94
96
 
95
97
  There is no strict development timeline or scheduled release plan for the QBDI project.
96
98
  All the new features and fixes are merged onto the ``dev-next`` branch.
97
- Devel packages can be downloaded in the artefacts of:
98
-
99
- - `Github Actions <https://github.com/QBDI/QBDI/actions/workflows/python_linux.yml?query=branch%3Adev-next>`__ for Linux PyQBDI
100
- - `Github Actions <https://github.com/QBDI/QBDI/actions/workflows/python_osx.yml?query=branch%3Adev-next>`__ for OSX PyQBDI
101
- - `Github Actions <https://github.com/QBDI/QBDI/actions/workflows/python_windows.yml?query=branch%3Adev-next>`__ for windows PyQBDI
99
+ Devel packages can be downloaded in the artefacts of `Github Actions <https://github.com/QBDI/QBDI/actions/workflows/python.yml?query=branch%3Adev-next>`__.
102
100
 
103
101
  Compilation
104
102
  ===========
@@ -0,0 +1,8 @@
1
+ pyqbdi.cpython-39-arm-linux-gnueabihf.so,sha256=O8FCtcdz93Ibca2ZONKA8C-9vSp4aZoSbhaOIwaI6h0,4726664
2
+ pyqbdipreload.py,sha256=Ohb0H9EOEoXauU-Lhg7dNRcM7u6UjM3CnAMPukB5SeE,5654
3
+ pyqbdipreloadlib.cpython-39-arm-linux-gnueabihf.so,sha256=G1lh0oZPQVB2Gg9IfdSl2eSvJZM7bNiU_q-VoW4CyF0,4726732
4
+ pyqbdi-0.12.0.dist-info/licenses/LICENSE.txt,sha256=3I98YIJxiVsPtSQvFhiKYOYja3ODSp3wQMn02feOsv0,12462
5
+ pyqbdi-0.12.0.dist-info/METADATA,sha256=7E6rpDI3_3SujADxmWCWD1Pyzb0YdwdVpWSgSp7AYo8,4888
6
+ pyqbdi-0.12.0.dist-info/WHEEL,sha256=UPXN4hnAS1PQfJ3PwDg9p6DDLpUJ5CaAsK1FlGxIu_c,102
7
+ pyqbdi-0.12.0.dist-info/top_level.txt,sha256=vaVfPcyi2OkulsN7QdaZiIKzq2GbFV2q24OujHZlbRc,7
8
+ pyqbdi-0.12.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-linux_armv7l
5
5
 
@@ -210,7 +210,7 @@ QBDI source code is under the Apache License v2.0
210
210
  same "printed page" as the copyright notice for easier
211
211
  identification within third-party archives.
212
212
 
213
- Copyright 2017 - 2024 Quarkslab
213
+ Copyright 2017 - 2025 Quarkslab
214
214
 
215
215
  Licensed under the Apache License, Version 2.0 (the "License");
216
216
  you may not use this file except in compliance with the License.
Binary file
pyqbdipreload.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # This file is part of pyQBDI (python binding for QBDI).
4
4
  #
5
- # Copyright 2017 - 2024 Quarkslab
5
+ # Copyright 2017 - 2025 Quarkslab
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
8
8
  # you may not use this file except in compliance with the License.
@@ -16,13 +16,74 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
-
20
19
  import platform
21
20
  import pyqbdi
22
21
  from ctypes import util as ctypesutil
23
22
  import sys
24
23
  import os
25
24
  import argparse
25
+ import subprocess
26
+
27
+ def get_preloadlib():
28
+ if platform.system() == 'Windows':
29
+ import importlib
30
+ # ['.py', '.pyw', '.pyc', '.cp310-win_amd64.pyd', '.pyd']
31
+ # find correct extension on windows like .cp310-win_amd64.pyd
32
+ for ext in importlib.machinery.all_suffixes():
33
+ preloadlib = os.path.join(
34
+ os.path.dirname(pyqbdi.__file__),
35
+ f"pyqbdipreloadlib{ext}")
36
+ if os.path.isfile(preloadlib):
37
+ return preloadlib
38
+ else:
39
+ preloadlib = os.path.join(
40
+ os.path.dirname(pyqbdi.__file__),
41
+ os.path.basename(pyqbdi.__file__).replace("pyqbdi", "pyqbdipreloadlib"))
42
+
43
+ if not os.path.isfile(preloadlib):
44
+ print("Cannot find pyqbdi preload library : {}".format(preloadlib))
45
+ exit(1)
46
+ return preloadlib
47
+
48
+ def find_binary(environ, binary, canFail=False):
49
+ # https://docs.python.org/3.8/library/os.html#os.execve:
50
+ # "execve will not use the PATH variable to locate the executable; path must contain an appropriate absolute or relative path."
51
+ # seach the binary path in PATH if needed
52
+ binarypath = None
53
+ if '/' in binary or '\\' in binary:
54
+ # absolute or relative path
55
+ binarypath = binary
56
+ else:
57
+ if os.path.isfile(binary): # case for current dir on windows
58
+ return binary
59
+ if "PATH" in environ:
60
+ for p in environ["PATH"].split(os.pathsep):
61
+ if os.path.isfile(os.path.join(p, binary)):
62
+ binarypath = os.path.join(p, binary)
63
+ break
64
+
65
+ if not binarypath or not os.path.isfile(binarypath):
66
+ if canFail:
67
+ return None
68
+ print("Cannot find binary {} make sure its in your PATH env".format(binary))
69
+ exit(1)
70
+
71
+ return binarypath
72
+
73
+ def find_windows_inject_binary(environ):
74
+
75
+ listPreloader = [
76
+ os.path.join(os.path.dirname(pyqbdi.__file__), "pyqbdiWinPreloader.exe"),
77
+ "QBDIWinPreloader.exe"]
78
+
79
+ for binary in listPreloader:
80
+ binarypath = find_binary(environ, binary, True)
81
+ if binarypath is not None:
82
+ return binarypath
83
+
84
+ print("Cannot find Windows injector binary (within {}), make sure one of them are available".format(listPreloader))
85
+ exit(1)
86
+
26
87
 
27
88
  def run():
28
89
 
@@ -36,16 +97,11 @@ def run():
36
97
 
37
98
  script = args.script
38
99
  binary = args.target
39
- args = [args.target] + args.args
100
+ execargs = [args.target] + args.args
40
101
  environ = os.environ.copy()
41
102
 
42
- preloadlib = os.path.join(
43
- os.path.dirname(pyqbdi.__file__),
44
- os.path.basename(pyqbdi.__file__).replace("pyqbdi", "pyqbdipreloadlib"))
45
-
46
- if not os.path.isfile(preloadlib):
47
- print("Cannot found pyqbdi preload library : {}".format(preloadlib))
48
- exit(1)
103
+ preloadlib = get_preloadlib()
104
+ binarypath = find_binary(environ, binary)
49
105
 
50
106
  # add LD_PRELOAD or DYLD_INSERT_LIBRARIES
51
107
  if platform.system() == 'Darwin':
@@ -54,17 +110,32 @@ def run():
54
110
  environ["DYLD_LIBRARY_PATH"] = os.path.join(sys.base_prefix, 'lib')
55
111
  environ["DYLD_BIND_AT_LAUNCH"] = "1"
56
112
  elif platform.system() == 'Linux':
57
- libpythonname = "python{}.{}".format(sys.version_info.major, sys.version_info.minor)
113
+ libpythonname = "python{}.{}".format(
114
+ sys.version_info.major, sys.version_info.minor)
58
115
  libpython = ctypesutil.find_library(libpythonname)
59
116
  if not libpython:
60
- libpythonname = "python{}.{}{}".format(sys.version_info.major, sys.version_info.minor, sys.abiflags)
117
+ libpythonname = "python{}.{}{}".format(
118
+ sys.version_info.major, sys.version_info.minor, sys.abiflags)
61
119
  libpython = ctypesutil.find_library(libpythonname)
62
120
  if not libpython:
63
121
  print("PyQBDI in PRELOAD mode need lib{}.so".format(libpythonname))
64
122
  exit(1)
65
123
 
124
+ for s in [libpython, preloadlib]:
125
+ for c in [" ", ";", os.pathsep]:
126
+ if c in s:
127
+ print(f"Error: found character '{c}' in {s}")
128
+ print(f"PyQBDIPrelaod is based on ld.so, which didn't accept '{c}' in LD_PRELOAD.")
129
+ print("Please check your installation to avoid ' ' and ';' in file path")
130
+ exit(1)
131
+
132
+
66
133
  environ["LD_PRELOAD"] = os.pathsep.join([libpython, preloadlib])
67
134
  environ["LD_BIND_NOW"] = "1"
135
+ elif platform.system() == 'Windows':
136
+ targetbinary = binarypath
137
+ binarypath = find_windows_inject_binary(environ)
138
+ execargs = [binarypath, preloadlib, targetbinary] + execargs[1:]
68
139
  else:
69
140
  print("PyQBDI in PRELOAD mode is not supported on this platform")
70
141
  exit(1)
@@ -76,28 +147,14 @@ def run():
76
147
  else:
77
148
  environ["PYQBDI_TOOL"] = script
78
149
 
79
- ## https://docs.python.org/3.8/library/os.html#os.execve:
80
- # "execve will not use the PATH variable to locate the executable; path must contain an appropriate absolute or relative path."
81
- # seach the binary path in PATH if needed
82
- binarypath = None
83
- if '/' in binary:
84
- # absolute or relative path
85
- binarypath = binary
150
+ if platform.system() == 'Windows':
151
+ proc = subprocess.run(execargs, env=environ)
152
+ exit(proc.returncode)
86
153
  else:
87
- if "PATH" in environ:
88
- for p in environ["PATH"].split(os.pathsep):
89
- if os.path.isfile(os.path.join(p, binary)):
90
- binarypath = os.path.join(p, binary)
91
- break
92
-
93
- if not binarypath or not os.path.isfile(binarypath):
94
- print("Cannot find binary {}".format(binary))
154
+ os.execve(binarypath, execargs, environ)
155
+ print("Fail execve")
95
156
  exit(1)
96
157
 
97
- os.execve(binarypath, args, environ)
98
-
99
- print("Fail execve")
100
- exit(1)
101
158
 
102
159
  if __name__ == "__main__":
103
160
  run()
@@ -1,8 +0,0 @@
1
- pyqbdi.cpython-39-arm-linux-gnueabihf.so,sha256=7opHebxqo90SFnR4buQObfPkKWEjvB7EHO5OQz282k8,4187184
2
- pyqbdipreload.py,sha256=FkavEnds5DCFPnNLoHJ0LJtXVTjSRaWyYJRkcsjPFLc,3505
3
- pyqbdipreloadlib.cpython-39-arm-linux-gnueabihf.so,sha256=9BiOCH6c4R5Y4OoQZ1ZVUPU2fnSu1jYpA4Cpg_b_68A,4207736
4
- PyQBDI-0.11.0.dist-info/LICENSE.txt,sha256=J-slihDKKorAhYuNFzflMLU8JARSPYV9wfMZIHWr0qE,12462
5
- PyQBDI-0.11.0.dist-info/METADATA,sha256=fPm09oSNOR_cjMiaHya5YeXOOp4O0L1k7UfPLRKjG-0,5210
6
- PyQBDI-0.11.0.dist-info/WHEEL,sha256=DDolwiQn121HN6IXBPJD3kTznJAcgQu95S3CPKZi5QU,103
7
- PyQBDI-0.11.0.dist-info/top_level.txt,sha256=vaVfPcyi2OkulsN7QdaZiIKzq2GbFV2q24OujHZlbRc,7
8
- PyQBDI-0.11.0.dist-info/RECORD,,