-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.py
More file actions
executable file
·23 lines (18 loc) · 1.03 KB
/
cli.py
File metadata and controls
executable file
·23 lines (18 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
from lib.dexwave import DexWave
from argparse import ArgumentParser
from dotenv import load_dotenv
import os
if __name__ == '__main__':
dexWave = DexWave()
dexWave.logging_setup()
parser = ArgumentParser()
parser.add_argument('input_dex_path', type=str, help='path of the input dex file')
parser.add_argument('output_dex_path', type=str, help='path of the output obfuscated dex file')
parser.add_argument('--weights_path', type=str, help='path of the tensorflow model weights', default=None)
parser.add_argument('--classificator_labels', type=str, help='classificator labels string divided by commas', default=None)
args = parser.parse_args()
load_dotenv(os.path.join(os.path.realpath(os.path.dirname(__file__)), 'resources', '.wave'), verbose=True)
weights_path = os.getenv('CLASSIFICATOR_WEIGHTS_PATH') or args.weights_path
classificator_labels = os.getenv('CLASSIFICATOR_LABELS') or args.classificator_labels
dexWave.attack(args.input_dex_path, args.output_dex_path, weights_path, classificator_labels)