Skip to content

Commit

Permalink
ida_plugin: bugfix: typedef types when exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Sep 7, 2020
1 parent 4ea86d2 commit 442458a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions fa/ida_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,13 @@ def OnFormChange(self, fid):
structs_buf = idc.print_decls(','.join(ordinals),
idc.PDF_DEF_BASE)

for struct_name in re.findall(
for struct_type, struct_name in re.findall(
r'(struct|enum) .*?([a-zA-Z0-9_\-]+?)\s+\{',
structs_buf):
f.write('typedef struct {struct_name} {struct_name};\n'
.format(struct_name=struct_name))
f.write(
'typedef {struct_type} {struct_name} {struct_name};\n'
.format(struct_type=struct_type,
struct_name=struct_name))

structs_buf = structs_buf.replace('__fastcall', '')
f.write('\n')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='fa',
version='0.2.1',
version='0.2.2',
description='FA Plugin',
author='DoronZ',
author_email='[email protected]',
Expand Down

0 comments on commit 442458a

Please sign in to comment.