|
1 | 1 | import idaapi
|
2 | 2 |
|
3 |
| -from . import actions |
4 |
| -from . import dialogs |
| 3 | +try: |
| 4 | + import rematch.actions as actions |
| 5 | + import rematch.dialogs as dialogs |
| 6 | +except ImportError: |
| 7 | + from . import actions |
| 8 | + from . import dialogs |
5 | 9 |
|
6 | 10 |
|
7 | 11 | def main():
|
8 | 12 | # add file
|
9 |
| - add_file_silent = dialogs.silent.SilentDialog([['submit', {}], |
10 |
| - ['response', {}]]) |
11 |
| - actions.project.AddFileAction(add_file_silent).activate(None) |
12 | 13 | description = "Automatically collected / uploaded by autoupload.py"
|
13 |
| - ############## |
| 14 | + calls = [('submit', {'project': -1, 'name': "filename", 'md5hash': "hash", |
| 15 | + 'description': description, 'shareidb': True})] |
| 16 | + add_file_silent = dialogs.silent.SilentDialog(calls) |
| 17 | + actions.project.AddFileAction(add_file_silent).activate(None) |
14 | 18 |
|
15 |
| - # upload data |
16 |
| - # actions.match.MatchAction(MatchSilentUI) |
| 19 | + ############## |
| 20 | + # skipped: add a project for file |
| 21 | + calls = [('submit', {'name': "proj_name", 'description': description, |
| 22 | + 'private': False, 'bind_current': True})] |
| 23 | + add_file_silent = dialogs.silent.SilentDialog(calls) |
| 24 | + |
| 25 | + # upload data and start matching |
| 26 | + calls = [('submit', {'source': 'idb', 'source_single': None, |
| 27 | + 'source_range': None, 'target': 'db', |
| 28 | + 'target_project': None, 'target_file': None, |
| 29 | + 'matchers': None})] |
| 30 | + match_silent = dialogs.silent.SilentDialog(calls) |
| 31 | + actions.match.MatchAction(match_silent).activate(None) |
17 | 32 |
|
18 | 33 |
|
19 | 34 | if __name__ == "__main__":
|
|
0 commit comments