Skip to content

Commit

Permalink
Compile and execute .idc file containing structures to import.
Browse files Browse the repository at this point in the history
  • Loading branch information
giladreich committed Jan 27, 2020
1 parent e7ee17d commit c4921a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ida_migrator/import_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,17 @@ def rename_functions(self):
def on_start_clicked(self):
count = self.rename_functions()
print("[IDA Migrator]: {} functions has been renamed.".format(count))

answer = QMessageBox.question(self, 'QUESTION',
"""Would you like to import type information as well? (structs, enums)
\nYou'll need to provide the dumped IDC file.""",
QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)

if answer == QMessageBox.Yes:
# idc.process_ui_action('Execute')
dir_path = os.path.dirname(idc.GetIdbPath())
file_path, _ = QFileDialog.getOpenFileName(self, "Select File to Import", dir_path, "IDC Script (*.idc)")
if file_path:
ida_expr.exec_idc_script(None, file_path.encode(), "main", None, 0)

QMessageBox.information(self, "SUCCESS", "Successfully renamed {} functions.".format(count))
1 change: 1 addition & 0 deletions src/ida_migrator/migrator_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import idc
import idaapi
import idautils
import ida_expr

from ida_migrator import UI_DIR

Expand Down

0 comments on commit c4921a6

Please sign in to comment.