fix/update old api use

This commit is contained in:
cosine0 2022-10-27 10:07:30 +09:00
parent af77d37912
commit 264b56f4f3
2 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,6 @@ import re
import struct import struct
import time import time
import types import types
from typing import Union
import capstone import capstone
import cffi import cffi
@ -138,8 +137,8 @@ def hook_dll(module_name, target_export_name_or_offset, timeout_seconds=5):
install_jump(decorator_scope_vars['target_address'], decorator_scope_vars['invoker_address']) install_jump(decorator_scope_vars['target_address'], decorator_scope_vars['invoker_address'])
# make c wrapper for callbacker # make c wrapper for callbacker
argspec = inspect.getargspec(callback) argspec = inspect.getfullargspec(callback)
if argspec.varargs is not None or argspec.keywords is not None: if argspec.varargs is not None or argspec.varkw is not None:
raise ValueError("Varargs are not allowed in 'callback'") raise ValueError("Varargs are not allowed in 'callback'")
callbacker_c_wrapper = ctypes.CFUNCTYPE(None, *[ctypes.c_uint32] * len(argspec.args)) callbacker_c_wrapper = ctypes.CFUNCTYPE(None, *[ctypes.c_uint32] * len(argspec.args))

View File

@ -43,7 +43,7 @@ def main():
if os.path.basename(INTERPRETER_DIR).lower() == 'scripts': if os.path.basename(INTERPRETER_DIR).lower() == 'scripts':
# in venv # in venv
library_path = INTERPRETER_DIR / 'lib' / 'site-packages' library_path = INTERPRETER_DIR.parent / 'lib' / 'site-packages'
venv_setup = f'import sys\nsys.path.append(' \ venv_setup = f'import sys\nsys.path.append(' \
f'{library_path.absolute().as_posix()!r})' f'{library_path.absolute().as_posix()!r})'
with open(INTERPRETER_DIR.parent / 'pyvenv.cfg') as f: with open(INTERPRETER_DIR.parent / 'pyvenv.cfg') as f: