Skip to content

Commit

Permalink
ida remote: add get_func_start
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyg committed Nov 2, 2020
1 parent 60a52df commit e1186a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/ida/idaclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def self.add_command(name, *rq_args, &postprocess)
add_command('get_next_head', :addr) { |a| addr(a) }
add_command('get_item_size', :addr) { |a| Integer(a) }
add_command('get_functions', :addr_start, :addr_end) { |lst| lst.split.map { |a| addr(a) } }
add_command('get_function_start', :addr) { |a| addr(a) }
add_command('get_function_name', :addr) { |s| s if s != '' }
add_command('get_function_comment', :addr) { |s| s if s != '' }
add_command('set_function_comment', :addr, :comment, :can_ignore_ret) { |s| s == "ok" }
Expand Down
5 changes: 5 additions & 0 deletions samples/ida/idaremote.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ def cmd_get_item_size(self, a):
def cmd_get_functions(self, a_start, a_end):
return " ".join([self.fmt_addr(a) for a in Functions(int(a_start, 0), int(a_end, 0))])

# return the address of a function from the address of an instruction
def cmd_get_function_start(self, a):
addr = idc.get_name_ea_simple(idc.get_func_name(int(a, 0)))
return self.fmt_addr(addr)

# return the name of a function from the address of an instruction of the body
def cmd_get_function_name(self, a):
return idc.get_func_name(int(a, 0))
Expand Down

0 comments on commit e1186a5

Please sign in to comment.