Loading parsespec/extractbehaviours.py +3 −1 Original line number Diff line number Diff line import json import requests import tlsh # Function translations def is_a_behaviour_header(type, value): Loading Loading @@ -100,8 +101,9 @@ while current_index < number_of_blocks: testcasemetadata['progressive_subid'] += 1 testcasemetadata['tp_id_fromspec'] = f"{str(testcasemetadata['seqnumber']).zfill(3)}_{str(testcasemetadata['progressive_subid']).zfill(2)}" testcasemetadata['description'] = " ".join(el['c'] for el in value if el['t'] == "Str") testcasemetadata['hash_description'] = tlsh.hash(testcasemetadata['description'].encode()) # push a deep copy of the object into the array testcases_fromspec.append(testcasemetadata.copy()) testcases_fromspec.append(json.loads(json.dumps(testcasemetadata))) print(f"..collecting Block {current_index} of {len(value)} in {testcasemetadata['tp_id_fromspec']}") # [Add logging to file or other operations here] else: Loading Loading
parsespec/extractbehaviours.py +3 −1 Original line number Diff line number Diff line import json import requests import tlsh # Function translations def is_a_behaviour_header(type, value): Loading Loading @@ -100,8 +101,9 @@ while current_index < number_of_blocks: testcasemetadata['progressive_subid'] += 1 testcasemetadata['tp_id_fromspec'] = f"{str(testcasemetadata['seqnumber']).zfill(3)}_{str(testcasemetadata['progressive_subid']).zfill(2)}" testcasemetadata['description'] = " ".join(el['c'] for el in value if el['t'] == "Str") testcasemetadata['hash_description'] = tlsh.hash(testcasemetadata['description'].encode()) # push a deep copy of the object into the array testcases_fromspec.append(testcasemetadata.copy()) testcases_fromspec.append(json.loads(json.dumps(testcasemetadata))) print(f"..collecting Block {current_index} of {len(value)} in {testcasemetadata['tp_id_fromspec']}") # [Add logging to file or other operations here] else: Loading