From 2b05ae9861be446657b6a0e968ad809b7a3e273a Mon Sep 17 00:00:00 2001 From: Nir Izraeli Date: Sat, 27 May 2017 18:04:17 -0700 Subject: [PATCH] Advancemant of functional autoupload.py Signed-off-by: Nir Izraeli --- idaplugin/rematch/autoupload.py | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/idaplugin/rematch/autoupload.py b/idaplugin/rematch/autoupload.py index 13241991d..32313209e 100755 --- a/idaplugin/rematch/autoupload.py +++ b/idaplugin/rematch/autoupload.py @@ -1,19 +1,34 @@ import idaapi -from . import actions -from . import dialogs +try: + import rematch.actions as actions + import rematch.dialogs as dialogs +except ImportError: + from . import actions + from . import dialogs def main(): # add file - add_file_silent = dialogs.silent.SilentDialog([['submit', {}], - ['response', {}]]) - actions.project.AddFileAction(add_file_silent).activate(None) description = "Automatically collected / uploaded by autoupload.py" - ############## + calls = [('submit', {'project': -1, 'name': "filename", 'md5hash': "hash", + 'description': description, 'shareidb': True})] + add_file_silent = dialogs.silent.SilentDialog(calls) + actions.project.AddFileAction(add_file_silent).activate(None) - # upload data - # actions.match.MatchAction(MatchSilentUI) + ############## + # skipped: add a project for file + calls = [('submit', {'name': "proj_name", 'description': description, + 'private': False, 'bind_current': True})] + add_file_silent = dialogs.silent.SilentDialog(calls) + + # upload data and start matching + calls = [('submit', {'source': 'idb', 'source_single': None, + 'source_range': None, 'target': 'db', + 'target_project': None, 'target_file': None, + 'matchers': None})] + match_silent = dialogs.silent.SilentDialog(calls) + actions.match.MatchAction(match_silent).activate(None) if __name__ == "__main__":