Advertisement
Guest User

Untitled

a guest
May 1st, 2022
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def decompile_function( function_location ):
  2. decompile_handle = ida_hexrays.decompile( function_location )
  3.  
  4. for local_variable in decompile_handle.lvars:
  5. type_info = local_variable.type()
  6.  
  7. if ida_type.is_type_ptr( type_info.get_decltype() ):
  8. dword_type = ida_type.tinfo_t()
  9. ida_type.parse_decl( dword_type, ida_type.get_idati(), "_DWORD;", ida_type.PT_TYP )
  10.  
  11. ChangeVariableType( function_location, local_variable, dword_type )
  12.  
  13. decompile_handle.refresh_func_ctext()
  14.  
  15. pseudo_code = decompile_handle.get_pseudocode()
  16. decompile_result = ""
  17.  
  18. for code_line in pseudo_code:
  19. decompile_result = decompile_result + ida_lines.tag_remove( code_line.line ) + "\n";
  20.  
  21. return decompile_result
Advertisement
RAW Paste Data Copied
Advertisement