reait 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.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.
- reait/api.py +23 -5
- {reait-1.0.0.dist-info → reait-1.0.1.dist-info}/METADATA +3 -3
- reait-1.0.1.dist-info/RECORD +9 -0
- {reait-1.0.0.dist-info → reait-1.0.1.dist-info}/WHEEL +1 -1
- reait-1.0.0.dist-info/RECORD +0 -9
- {reait-1.0.0.dist-info → reait-1.0.1.dist-info}/LICENSE +0 -0
- {reait-1.0.0.dist-info → reait-1.0.1.dist-info}/entry_points.txt +0 -0
- {reait-1.0.0.dist-info → reait-1.0.1.dist-info}/top_level.txt +0 -0
reait/api.py
CHANGED
@@ -17,7 +17,7 @@ from numpy import array, vstack, dot, arccos, pi
|
|
17
17
|
from pandas import DataFrame
|
18
18
|
from lief import parse, Binary, ELF, PE, MachO
|
19
19
|
|
20
|
-
__version__ = "1.0.
|
20
|
+
__version__ = "1.0.1"
|
21
21
|
|
22
22
|
re_conf = {
|
23
23
|
"apikey": "l1br3",
|
@@ -387,7 +387,7 @@ def RE_compute_distance(embedding: list, embeddings: list, nns: int = 5) -> list
|
|
387
387
|
json_sims = [{"similaritiy": float(d[0]),
|
388
388
|
"vaddr": int(df.iloc[v]["vaddr"]),
|
389
389
|
"name": str(df.iloc[v]["name"]),
|
390
|
-
"size": int(df.iloc[v]["size"])
|
390
|
+
"size": int(df.iloc[v]["size"]),
|
391
391
|
} for d, v in similarities]
|
392
392
|
return json_sims
|
393
393
|
|
@@ -405,7 +405,8 @@ def RE_nearest_symbols_batch(function_ids: list[int], nns: int = 5, collections:
|
|
405
405
|
params = {"function_id_list": function_ids,
|
406
406
|
"result_per_function": nns,
|
407
407
|
"debug_mode": debug_enabled,
|
408
|
-
"distance": distance,
|
408
|
+
"distance": distance,
|
409
|
+
}
|
409
410
|
|
410
411
|
if collections:
|
411
412
|
# api param is collection, not collections
|
@@ -437,7 +438,8 @@ def RE_nearest_functions(fpath: str, binary_id: int = 0, nns: int = 5,
|
|
437
438
|
|
438
439
|
params = {"result_per_function": nns,
|
439
440
|
"debug_mode": debug_enabled,
|
440
|
-
"distance": distance,
|
441
|
+
"distance": distance,
|
442
|
+
}
|
441
443
|
|
442
444
|
res: Response = reveng_req(requests.post, end_point, json_data=params)
|
443
445
|
|
@@ -500,6 +502,22 @@ def RE_functions_rename(function_id: int, new_name: str) -> Response:
|
|
500
502
|
return res
|
501
503
|
|
502
504
|
|
505
|
+
def RE_functions_rename_batch(mapping: dict[int, str]) -> Response:
|
506
|
+
"""
|
507
|
+
Send a list of dictionaries, with a corresponding key as function ID and the desired function_name
|
508
|
+
:param mapping: dictionary containing the function_id as key and function_name as value
|
509
|
+
"""
|
510
|
+
params = {"new_name_mapping":
|
511
|
+
[{"function_id": func_id,
|
512
|
+
"function_name": func_name,
|
513
|
+
} for func_id, func_name in mapping.items()]
|
514
|
+
}
|
515
|
+
|
516
|
+
res: Response = reveng_req(requests.post, "v1/functions/batch/rename", json_data=params)
|
517
|
+
|
518
|
+
res.raise_for_status()
|
519
|
+
return res
|
520
|
+
|
503
521
|
def RE_settings() -> Response:
|
504
522
|
"""
|
505
523
|
Get the configuration settings
|
@@ -551,7 +569,7 @@ def re_binary_id(fpath: str) -> str:
|
|
551
569
|
else:
|
552
570
|
logger.error("File '%s' doesn't exist or isn't readable", fpath)
|
553
571
|
|
554
|
-
return "
|
572
|
+
return "Undefined"
|
555
573
|
|
556
574
|
|
557
575
|
def _binary_isa(binary: Binary, exec_type: str) -> str:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: reait
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.1
|
4
4
|
Home-page: https://github.com/RevEng-AI/reait
|
5
5
|
Author: James Patrick-Evans
|
6
6
|
Author-email: James Patrick-Evans <james@reveng.ai>
|
@@ -692,15 +692,15 @@ Classifier: Operating System :: OS Independent
|
|
692
692
|
Requires-Python: >=3.7
|
693
693
|
Description-Content-Type: text/markdown
|
694
694
|
License-File: LICENSE
|
695
|
+
Requires-Dist: argparse
|
695
696
|
Requires-Dist: requests
|
696
697
|
Requires-Dist: rich
|
697
|
-
Requires-Dist: argparse
|
698
698
|
Requires-Dist: tomli
|
699
699
|
Requires-Dist: pandas
|
700
700
|
Requires-Dist: numpy
|
701
701
|
Requires-Dist: scipy
|
702
|
-
Requires-Dist: lief
|
703
702
|
Requires-Dist: scikit-learn
|
703
|
+
Requires-Dist: lief
|
704
704
|
|
705
705
|
# reait
|
706
706
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
reait/__init__.py,sha256=U3Y2DK1m2kht0sK_mBvvQskWRM5PwL5JtIDWurZOyBw,66
|
2
|
+
reait/api.py,sha256=RqyC2wROiTTSyMwXl3hkyz97Jwr4Y_dxN4np-fdhdfg,22596
|
3
|
+
reait/main.py,sha256=IDfmtQxiA-lHb1Xcp90oCP9wqRnPZCnmLpMxkRaZxiU,17066
|
4
|
+
reait-1.0.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
5
|
+
reait-1.0.1.dist-info/METADATA,sha256=98HnmSd_jb8AsWzCzHDsFQKtghk3u_uE7_NarkEMcWA,47455
|
6
|
+
reait-1.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
7
|
+
reait-1.0.1.dist-info/entry_points.txt,sha256=8Ek11o7a6O8hjBFw6-1vmkBfbv_45O2vOKj5CDUB1e4,42
|
8
|
+
reait-1.0.1.dist-info/top_level.txt,sha256=EnJssmctKe3Ugjcmu66L9_Q4elLdAwaXK6M8E6E8f_M,6
|
9
|
+
reait-1.0.1.dist-info/RECORD,,
|
reait-1.0.0.dist-info/RECORD
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
reait/__init__.py,sha256=U3Y2DK1m2kht0sK_mBvvQskWRM5PwL5JtIDWurZOyBw,66
|
2
|
-
reait/api.py,sha256=W2FDqKYzLk_ZRf6MueXCWXx1p9tuXg0ALftU8ak7JNg,21942
|
3
|
-
reait/main.py,sha256=IDfmtQxiA-lHb1Xcp90oCP9wqRnPZCnmLpMxkRaZxiU,17066
|
4
|
-
reait-1.0.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
5
|
-
reait-1.0.0.dist-info/METADATA,sha256=mxr_fzWU6gWMrQtGfsBKTl-s33So9-vBLOozN7FAiQY,47455
|
6
|
-
reait-1.0.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7
|
-
reait-1.0.0.dist-info/entry_points.txt,sha256=8Ek11o7a6O8hjBFw6-1vmkBfbv_45O2vOKj5CDUB1e4,42
|
8
|
-
reait-1.0.0.dist-info/top_level.txt,sha256=EnJssmctKe3Ugjcmu66L9_Q4elLdAwaXK6M8E6E8f_M,6
|
9
|
-
reait-1.0.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|