diff --git a/ida_file_cerate.bat b/ida_file_cerate.bat new file mode 100644 index 0000000..1171460 --- /dev/null +++ b/ida_file_cerate.bat @@ -0,0 +1,18 @@ +@echo off +setlocal enabledelayedexpansion + +set "IDA_PATH=D:\IDA_Pro_v6.8\idaq.exe" +set "FOLDER_PATH=D:\bishe\Gencoding\A2C" +set "SCRIPT_PATH=../raw-feature-extractor/preprocessing_ida.py" +set "SAVE_PATH=../store/" +set "LOG_PATH=../log/" + + + +for %%f in ("%FOLDER_PATH%\*.exe") do ( + echo !time! %%f + %IDA_PATH% -c -B -S"%SCRIPT_PATH% --path %SAVE_PATH%" %%f + ) + +endlocal + diff --git a/ida_print.py b/ida_print.py new file mode 100644 index 0000000..9b104e7 --- /dev/null +++ b/ida_print.py @@ -0,0 +1,19 @@ +import os +import subprocess + + +directory = './' + + +if __name__ == '__main__': + cmd = 'D:\IDA_Pro_v6.8\idaq.exe -c -S"raw-feature-extractor/preprocessing_ida.py --path ./store/" ' + + for filename in os.listdir(directory): + if filename[-3:] == 'exe': + process = subprocess.Popen(["powershell", cmd+filename], stdout=subprocess.PIPE) + + output = process.communicate()[0] + + + + diff --git a/raw-feature-extractor/preprocessing_ida.py b/raw-feature-extractor/preprocessing_ida.py index 57e9fc4..263146d 100644 --- a/raw-feature-extractor/preprocessing_ida.py +++ b/raw-feature-extractor/preprocessing_ida.py @@ -1,3 +1,4 @@ +import idc from func import * from raw_graphs import * from idc import * @@ -13,8 +14,11 @@ def parse_command(): if __name__ == '__main__': + # def main_op(store_file_path): args = parse_command() + # path = os.path.join("../") path = idc.ARGV[2] + print os.getcwd() analysis_flags = idc.GetShortPrm(idc.INF_START_AF) analysis_flags &= ~idc.AF_IMMOFF # turn off "automatically make offset" heuristic @@ -25,3 +29,6 @@ if __name__ == '__main__': fullpath = os.path.join(path, binary_name) pickle.dump(cfgs, open(fullpath, 'w')) idc.Exit(0) + + + diff --git a/raw-feature-extractor/print_test.py b/raw-feature-extractor/print_test.py index 6e6312b..885aa03 100644 --- a/raw-feature-extractor/print_test.py +++ b/raw-feature-extractor/print_test.py @@ -94,4 +94,6 @@ if __name__ == '__main__': - \ No newline at end of file + + +