idapro 0.0.5__tar.gz → 0.0.6.dev2__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.
- {idapro-0.0.5 → idapro-0.0.6.dev2}/PKG-INFO +5 -1
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro/__init__.py +23 -24
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro/config.py +15 -12
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro/stubs/ida_allins.pyi +325 -47
- idapro-0.0.6.dev2/idapro/stubs/ida_auto.pyi +329 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_bitrange.pyi +161 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_bytes.pyi +3138 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_dbg.pyi +3108 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_dirtree.pyi +1297 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_diskio.pyi +506 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_entry.pyi +93 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_expr.pyi +861 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_fixup.pyi +412 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_fpro.pyi +203 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_frame.pyi +952 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_funcs.pyi +1931 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_gdl.pyi +1217 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_graph.pyi +4102 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_hexrays.pyi +25331 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_ida.pyi +2282 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_idaapi.pyi +2074 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_idc.pyi +15 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_idd.pyi +3639 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_idp.pyi +4327 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_ieee.pyi +330 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_kernwin.pyi +10837 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_libfuncs.pyi +160 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_lines.pyi +373 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_loader.pyi +942 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_merge.pyi +948 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro/stubs/ida_mergemod.pyi +6 -46
- idapro-0.0.6.dev2/idapro/stubs/ida_moves.pyi +1094 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_nalt.pyi +2121 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_name.pyi +854 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_netnode.pyi +389 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_offset.pyi +167 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_pro.pyi +5386 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_problems.pyi +83 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_range.pyi +844 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_regfinder.pyi +664 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_registry.pyi +186 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_search.pyi +63 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_segment.pyi +1044 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_segregs.pyi +269 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_srclang.pyi +102 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_strlist.pyi +224 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_tryblks.pyi +947 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_typeinf.pyi +10336 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_ua.pyi +1575 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_undo.pyi +43 -0
- idapro-0.0.6.dev2/idapro/stubs/ida_xref.pyi +594 -0
- idapro-0.0.6.dev2/idapro/stubs/idaapi.pyi +117152 -0
- idapro-0.0.6.dev2/idapro/stubs/idadex.pyi +1157 -0
- idapro-0.0.6.dev2/idapro/stubs/idautils.pyi +573 -0
- idapro-0.0.6.dev2/idapro/stubs/idc.pyi +5723 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro.egg-info/PKG-INFO +5 -1
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro.egg-info/SOURCES.txt +0 -1
- {idapro-0.0.5 → idapro-0.0.6.dev2}/setup.py +4 -1
- idapro-0.0.5/idapro/stubs/ida_api.pyi +0 -34096
- idapro-0.0.5/idapro/stubs/ida_auto.pyi +0 -311
- idapro-0.0.5/idapro/stubs/ida_bitrange.pyi +0 -158
- idapro-0.0.5/idapro/stubs/ida_bytes.pyi +0 -2637
- idapro-0.0.5/idapro/stubs/ida_dbg.pyi +0 -2398
- idapro-0.0.5/idapro/stubs/ida_dirtree.pyi +0 -952
- idapro-0.0.5/idapro/stubs/ida_diskio.pyi +0 -409
- idapro-0.0.5/idapro/stubs/ida_entry.pyi +0 -124
- idapro-0.0.5/idapro/stubs/ida_expr.pyi +0 -697
- idapro-0.0.5/idapro/stubs/ida_fixup.pyi +0 -355
- idapro-0.0.5/idapro/stubs/ida_fpro.pyi +0 -192
- idapro-0.0.5/idapro/stubs/ida_frame.pyi +0 -772
- idapro-0.0.5/idapro/stubs/ida_funcs.pyi +0 -1472
- idapro-0.0.5/idapro/stubs/ida_gdl.pyi +0 -878
- idapro-0.0.5/idapro/stubs/ida_graph.pyi +0 -2856
- idapro-0.0.5/idapro/stubs/ida_hexrays.pyi +0 -17971
- idapro-0.0.5/idapro/stubs/ida_ida.pyi +0 -1707
- idapro-0.0.5/idapro/stubs/ida_idaapi.pyi +0 -1573
- idapro-0.0.5/idapro/stubs/ida_idc.pyi +0 -53
- idapro-0.0.5/idapro/stubs/ida_idd.pyi +0 -2562
- idapro-0.0.5/idapro/stubs/ida_idp.pyi +0 -3570
- idapro-0.0.5/idapro/stubs/ida_ieee.pyi +0 -278
- idapro-0.0.5/idapro/stubs/ida_kernwin.pyi +0 -8279
- idapro-0.0.5/idapro/stubs/ida_libfuncs.pyi +0 -171
- idapro-0.0.5/idapro/stubs/ida_lines.pyi +0 -355
- idapro-0.0.5/idapro/stubs/ida_loader.pyi +0 -760
- idapro-0.0.5/idapro/stubs/ida_merge.pyi +0 -776
- idapro-0.0.5/idapro/stubs/ida_moves.pyi +0 -685
- idapro-0.0.5/idapro/stubs/ida_nalt.pyi +0 -1590
- idapro-0.0.5/idapro/stubs/ida_name.pyi +0 -719
- idapro-0.0.5/idapro/stubs/ida_netnode.pyi +0 -287
- idapro-0.0.5/idapro/stubs/ida_offset.pyi +0 -194
- idapro-0.0.5/idapro/stubs/ida_pro.pyi +0 -3507
- idapro-0.0.5/idapro/stubs/ida_problems.pyi +0 -117
- idapro-0.0.5/idapro/stubs/ida_range.pyi +0 -621
- idapro-0.0.5/idapro/stubs/ida_regfinder.pyi +0 -552
- idapro-0.0.5/idapro/stubs/ida_registry.pyi +0 -202
- idapro-0.0.5/idapro/stubs/ida_search.pyi +0 -92
- idapro-0.0.5/idapro/stubs/ida_segment.pyi +0 -903
- idapro-0.0.5/idapro/stubs/ida_segregs.pyi +0 -263
- idapro-0.0.5/idapro/stubs/ida_srclang.pyi +0 -100
- idapro-0.0.5/idapro/stubs/ida_strlist.pyi +0 -204
- idapro-0.0.5/idapro/stubs/ida_tryblks.pyi +0 -634
- idapro-0.0.5/idapro/stubs/ida_typeinf.pyi +0 -7441
- idapro-0.0.5/idapro/stubs/ida_ua.pyi +0 -1257
- idapro-0.0.5/idapro/stubs/ida_undo.pyi +0 -79
- idapro-0.0.5/idapro/stubs/ida_xref.pyi +0 -486
- idapro-0.0.5/idapro/stubs/idaapi.pyi +0 -90764
- idapro-0.0.5/idapro/stubs/idadex.pyi +0 -756
- idapro-0.0.5/idapro/stubs/idautils.pyi +0 -486
- idapro-0.0.5/idapro/stubs/idc.pyi +0 -5159
- {idapro-0.0.5 → idapro-0.0.6.dev2}/LICENSE +0 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/README.md +0 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro/py.typed +0 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro.egg-info/dependency_links.txt +0 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro.egg-info/not-zip-safe +0 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/idapro.egg-info/top_level.txt +0 -0
- {idapro-0.0.5 → idapro-0.0.6.dev2}/setup.cfg +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: idapro
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6.dev2
|
|
4
4
|
Summary: IDA Library Python module
|
|
5
5
|
Author: Hex-Rays SA
|
|
6
6
|
Author-email: support@hex-rays.com
|
|
7
7
|
License: MIT
|
|
8
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
8
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
10
|
Classifier: Programming Language :: Python :: 3
|
|
10
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -24,6 +25,9 @@ Dynamic: summary
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
# IDA Library Python Module
|
|
28
|
+
|
|
29
|
+
**⚠️ This is a dev pre-release version. APIs may change without notice and pre-release versions may be deleted at any time.**
|
|
30
|
+
|
|
27
31
|
The IDA Library Python module enables running IDA Pro as an independent Python package outside the IDA UI environment, allowing for programmatic binary analysis and reverse engineering tasks.
|
|
28
32
|
|
|
29
33
|
## Prerequisites
|
|
@@ -9,7 +9,7 @@ from .config import get_ida_install_dir
|
|
|
9
9
|
|
|
10
10
|
def find_file(name, path):
|
|
11
11
|
"""Internal method used for recursively find a file in a folder"""
|
|
12
|
-
for root,
|
|
12
|
+
for root, _, files in os.walk(path):
|
|
13
13
|
if name in files:
|
|
14
14
|
return os.path.join(root, name)
|
|
15
15
|
return None
|
|
@@ -28,30 +28,9 @@ else:
|
|
|
28
28
|
|
|
29
29
|
# Get the ida-install-dir setting
|
|
30
30
|
root_dir = get_ida_install_dir()
|
|
31
|
-
|
|
32
|
-
if platform_str == "Windows":
|
|
33
|
-
# IDA kernel and modules may need dependencies in its root dir (e.g. clp64.dll)
|
|
34
|
-
# tell Windows loader where they can be found
|
|
35
|
-
# NB: for AddDllDirectory() be effective for indirectly loaded DLLs,
|
|
36
|
-
# SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_USER_DIRS) has to be called first
|
|
37
|
-
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
|
|
38
|
-
SetDefaultDllDirectories = getattr(kernel32, "SetDefaultDllDirectories")
|
|
39
|
-
if SetDefaultDllDirectories:
|
|
40
|
-
from ctypes.wintypes import DWORD, BOOL
|
|
41
|
-
SetDefaultDllDirectories.argtypes = [DWORD]
|
|
42
|
-
SetDefaultDllDirectories.restype = BOOL
|
|
43
|
-
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000
|
|
44
|
-
LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400
|
|
45
|
-
flags = LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_USER_DIRS
|
|
46
|
-
if SetDefaultDllDirectories(flags):
|
|
47
|
-
# finally, add IDA's directory for dependencies
|
|
48
|
-
os.add_dll_directory(root_dir)
|
|
49
|
-
else:
|
|
50
|
-
os.environ['PATH'] = root_dir + os.pathsep + os.environ.get('PATH', '')
|
|
51
|
-
|
|
52
|
-
idalib_path = find_file(name=name, path=root_dir)
|
|
31
|
+
idalib_path = find_file(name=name, path=root_dir) if root_dir else None
|
|
53
32
|
if idalib_path is None:
|
|
54
|
-
raise ImportError(f"
|
|
33
|
+
raise ImportError(f"Cannot load IDA library file {name}. Please make sure you are using IDA version 9.0 or newer and the IDADIR environment variable is set and points to the active IDA installation.")
|
|
55
34
|
|
|
56
35
|
if "IDA_IS_INTERACTIVE" in os.environ:
|
|
57
36
|
if os.environ["IDA_IS_INTERACTIVE"] == "1":
|
|
@@ -59,6 +38,26 @@ if "IDA_IS_INTERACTIVE" in os.environ:
|
|
|
59
38
|
|
|
60
39
|
# load the library and initialize the kernel
|
|
61
40
|
try:
|
|
41
|
+
if platform_str == "Windows":
|
|
42
|
+
# IDA kernel and modules may need dependencies in its root dir (e.g. clp64.dll)
|
|
43
|
+
# tell Windows loader where they can be found
|
|
44
|
+
# NB: for AddDllDirectory() be effective for indirectly loaded DLLs,
|
|
45
|
+
# SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_USER_DIRS) has to be called first
|
|
46
|
+
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
|
|
47
|
+
SetDefaultDllDirectories = getattr(kernel32, "SetDefaultDllDirectories")
|
|
48
|
+
if SetDefaultDllDirectories:
|
|
49
|
+
from ctypes.wintypes import DWORD, BOOL
|
|
50
|
+
SetDefaultDllDirectories.argtypes = [DWORD]
|
|
51
|
+
SetDefaultDllDirectories.restype = BOOL
|
|
52
|
+
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000
|
|
53
|
+
LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400
|
|
54
|
+
flags = LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_USER_DIRS
|
|
55
|
+
if SetDefaultDllDirectories(flags):
|
|
56
|
+
# finally, add IDA's directory for dependencies
|
|
57
|
+
os.add_dll_directory(root_dir)
|
|
58
|
+
else:
|
|
59
|
+
os.environ['PATH'] = root_dir + os.pathsep + os.environ.get('PATH', '')
|
|
60
|
+
|
|
62
61
|
libida = ctypes.cdll.LoadLibrary(idalib_path)
|
|
63
62
|
except Exception as e:
|
|
64
63
|
raise ImportError(f"Failed loading IDA library file {idalib_path}, exception {e}\n")
|
|
@@ -7,12 +7,16 @@ def get_user_config_path():
|
|
|
7
7
|
"""Get the path to the user's config file based on platform following IDA's user directories."""
|
|
8
8
|
system = platform.system()
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
config_dir = Path(
|
|
10
|
+
idausr_env = os.getenv("IDAUSR")
|
|
11
|
+
if idausr_env:
|
|
12
|
+
config_dir = Path(idausr_env)
|
|
13
13
|
else:
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if system == "Windows":
|
|
15
|
+
# On Windows, use the %APPDATA%\Hex-Rays\IDA Pro directory
|
|
16
|
+
config_dir = Path(os.getenv('APPDATA')) / "Hex-Rays" / "IDA Pro"
|
|
17
|
+
else:
|
|
18
|
+
# On macOS and Linux, use ~/.idapro
|
|
19
|
+
config_dir = Path.home() / ".idapro"
|
|
16
20
|
|
|
17
21
|
# Return the full path to the config file (now in JSON format)
|
|
18
22
|
user_config_path = config_dir / "ida-config.json"
|
|
@@ -71,12 +75,11 @@ def set_ida_install_dir(new_path):
|
|
|
71
75
|
def get_ida_install_dir():
|
|
72
76
|
"""Retrieve the IDA installation directory."""
|
|
73
77
|
|
|
78
|
+
# $IDADIR overrides JSON config
|
|
79
|
+
idadir = os.environ.get('IDADIR')
|
|
80
|
+
if idadir:
|
|
81
|
+
return idadir
|
|
82
|
+
|
|
74
83
|
# Read the configuration JSON file
|
|
75
84
|
config = load_config()
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
# Fallback to IDADIR env var if the JSON value is not set
|
|
79
|
-
if install_dir is None or len(install_dir) == 0:
|
|
80
|
-
install_dir = os.environ.get('IDADIR', '')
|
|
81
|
-
|
|
82
|
-
return install_dir
|
|
85
|
+
return config['Paths'].get('ida-install-dir', None)
|