|
6 | 6 | import json
|
7 | 7 | import logging
|
8 | 8 | import shutil
|
9 |
| -import re |
10 | 9 | import sys
|
11 | 10 | import time
|
12 | 11 | from collections import defaultdict
|
13 | 12 | from multiprocessing import Process, SimpleQueue, Manager, Event, cpu_count
|
14 |
| -from typing import List, Tuple, Type, Any, Dict, DefaultDict |
| 13 | +from typing import List, Tuple, Any, Dict, DefaultDict |
15 | 14 | from os.path import join, getsize
|
16 | 15 | import os
|
17 | 16 |
|
|
21 | 20 |
|
22 | 21 | ## Constants
|
23 | 22 |
|
24 |
| -TAC_GEN_CONFIG_FILE = 'tac_gen_config.json' |
| 23 | +DEFAULT_TAC_GEN_CONFIG_FILE = join(GIGAHORSE_DIR, 'tac_gen_config.json') |
25 | 24 |
|
26 | 25 | DEFAULT_RESULTS_FILE = 'results.json'
|
27 | 26 | """File to write results to by default."""
|
|
192 | 191 | default=False,
|
193 | 192 | help="Run souffle in interpreted mode.")
|
194 | 193 |
|
| 194 | +parser.add_argument( |
| 195 | + "--tac_gen_config", |
| 196 | + nargs="?", |
| 197 | + default=DEFAULT_TAC_GEN_CONFIG_FILE, |
| 198 | + metavar="TAC_GEN_CONFIG", |
| 199 | + help="the location of the TAC generation configuration file", |
| 200 | +) |
195 | 201 |
|
196 | 202 | def get_working_dir(contract_name: str) -> str:
|
197 | 203 | return join(os.path.abspath(args.working_dir), os.path.split(contract_name)[1].split('.')[0])
|
@@ -589,7 +595,7 @@ def run_gigahorse(args, fact_generator: AbstractFactGenerator) -> None:
|
589 | 595 |
|
590 | 596 | args = parser.parse_args()
|
591 | 597 |
|
592 |
| - tac_gen_config_json = os.path.join(os.path.dirname(os.path.abspath(__file__)),TAC_GEN_CONFIG_FILE) |
| 598 | + tac_gen_config_json = args.tac_gen_config |
593 | 599 | with open(tac_gen_config_json, 'r') as config:
|
594 | 600 | tac_gen_config = json.loads(config.read())
|
595 | 601 | if len(tac_gen_config["handlers"]) == 0: #if no handlers defined, default to classic decompilation
|
|
0 commit comments