File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 11
11
12
12
import concurrent
13
13
14
- def get_bnames_ename (symbols_name ):
15
- """
16
- Older algorithm with many false positives
17
- """
18
- bin_name = []
19
- eid = get_export_id (symbols_name )
20
- bid_list = get_bid_using_fid (eid )
21
- if bid_list :
22
- bin_name .extend (get_bname (bid ) for bid in bid_list )
23
- return bin_name
14
+ # def get_bnames_ename(symbols_name):
15
+ # """
16
+ # Older algorithm with many false positives
17
+ # """
18
+ # bin_name = []
19
+ # eid = get_export_id(symbols_name)
20
+ # bid_list = get_bid_using_fid(eid)
21
+ # if bid_list:
22
+ # bin_name.extend(get_bname(bid) for bid in bid_list)
23
+ # return bin_name
24
24
25
25
def return_binaries_detected (eid ):
26
26
"""
27
- New scoring algorithm
27
+ Current scoring algorithm
28
28
"""
29
29
binaries_detected_dict = {}
30
30
bid_list = get_bid_using_fid (eid )
@@ -64,6 +64,14 @@ def detect_binaries_utilized(sybmols_list) -> set:
64
64
65
65
return binary_detected
66
66
67
+ def get_bid_using_ename (export_name ):
68
+ BLINTDB_LOC = os .getenv ("BLINTDB_LOC" )
69
+ with closing (sqlite3 .connect (BLINTDB_LOC )) as connection :
70
+ with closing (connection .cursor ()) as c :
71
+ c .execute ("SELECT bid from BinariesExports where eid = (SELECT rowid from Exports where infunc=?)" , (export_name ,))
72
+ res = c .fetchall ()
73
+ connection .commit ()
74
+ return map (lambda x : x [0 ], res ) if res else None
67
75
68
76
def get_export_id (export_name ):
69
77
BLINTDB_LOC = os .getenv ("BLINTDB_LOC" )
Original file line number Diff line number Diff line change @@ -456,7 +456,9 @@ def process_exe_file(
456
456
if os .environ .get ("USE_BLINTDB" , "" ) in ["1" , "true" ]:
457
457
# utilize voting logic along with blitndb
458
458
# we iterate through each symbol and try to find a match in the database
459
- dynamic_symbols_list = metadata .get ("dynamic_symbols" , [])
459
+ print ("Utilizing blint_db" )
460
+ # TODO: utilize both symtab_symbols and dynamic_symbols
461
+ dynamic_symbols_list = metadata .get ("symtab_symbols" , [])
460
462
binaries_detected = detect_binaries_utilized (dynamic_symbols_list )
461
463
# adds the components in a similar way to dynamic entries
462
464
for binary in binaries_detected :
You can’t perform that action at this time.
0 commit comments