Skip to content

Commit

Permalink
Fix issue 7 regarding renaming jmps to dynamic imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Brooks committed Mar 2, 2018
1 parent 485a738 commit e1d6f7f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions r2utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,23 @@ def get_call_from_wrapper(self, funcj):

def get_import_from_import_jmp_func(self, funcj):

# Note: the prefix1/2 logic was added after an r2
# update. I am unsure why some disasm has the [ bracket
# while others do not.

import_string = ''
prefix = 'jmp dword ['
prefix1 = 'jmp dword ['
prefix2 = 'jmp dword '

for op in funcj['ops']:
import_string = op.get('opcode','N/A')

return import_string[len(prefix):len(import_string)-1]
import_string = op.get('disasm','N/A')

if prefix1 in op.get('disasm','N/A'):
return import_string[len(prefix1):len(import_string)-1]

elif prefix2 in op.get('disasm','N/A'):
return import_string[len(prefix2):len(import_string)]


####################################################################
Expand Down

0 comments on commit e1d6f7f

Please sign in to comment.