输入流程更新 添加自动输出脚本

This commit is contained in:
huihun 2023-12-03 21:05:22 +08:00
parent 5de6c4568c
commit 73c9da0599
4 changed files with 47 additions and 1 deletions

18
ida_file_cerate.bat Normal file
View File

@ -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

19
ida_print.py Normal file
View File

@ -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]

View File

@ -1,3 +1,4 @@
import idc
from func import * from func import *
from raw_graphs import * from raw_graphs import *
from idc import * from idc import *
@ -13,8 +14,11 @@ def parse_command():
if __name__ == '__main__': if __name__ == '__main__':
# def main_op(store_file_path):
args = parse_command() args = parse_command()
# path = os.path.join("../")
path = idc.ARGV[2] path = idc.ARGV[2]
print os.getcwd()
analysis_flags = idc.GetShortPrm(idc.INF_START_AF) analysis_flags = idc.GetShortPrm(idc.INF_START_AF)
analysis_flags &= ~idc.AF_IMMOFF analysis_flags &= ~idc.AF_IMMOFF
# turn off "automatically make offset" heuristic # turn off "automatically make offset" heuristic
@ -25,3 +29,6 @@ if __name__ == '__main__':
fullpath = os.path.join(path, binary_name) fullpath = os.path.join(path, binary_name)
pickle.dump(cfgs, open(fullpath, 'w')) pickle.dump(cfgs, open(fullpath, 'w'))
idc.Exit(0) idc.Exit(0)

View File

@ -94,4 +94,6 @@ if __name__ == '__main__':