Results 1 to 3 of 3

Thread: IDAPython simulating UI actions?

  1. #1

    IDAPython simulating UI actions?

    hi,
    i have a line that looks like this in IDA (ARM):

    Code:
    0F941DF4       MOV             R0, #0xFA15A40
    the address #0xFA15A40 can be resolved to a string by pressing 'O' or 'Ctrl+O' and the line looking like this after i have pressed:
    Code:
    0F941DF4       MOV             R0, #aDisplayInitFail_0
    i have already created a scripts that add ref to the string location and it shows me now the line like this:
    Code:
    0F941DF4       MOV             R1, #0xFA15A40  ; "Display init fail.."
    but this is not good because when i want to use the decompiler option it doesn't understand this reference. the decompiler only understand the address reference after i press 'O' or 'Ctrl+O'

    and from some reason IDA doesn't do it automatically (even after re-analyze), so how can i simulate the key pressing by executing a command of IDAPython ?

  2. #2
    Teach, Not Flame Kayaker's Avatar
    Join Date
    Oct 2000
    Posts
    4,047
    Blog Entries
    5
    It appears you could use Class UI_Hooks
    https://www.hex-rays.com/products/ida/support/idapython_docs/idaapi.UI_Hooks-class.html

    name - ui command name (these names can be looked up in ida[tg]ui.cfg)
    "OpOffsetCs" = "Ctrl-O"

    Though just issuing OpOffsetCs might not work as well?
    https://www.hex-rays.com/products/ida/support/idadoc/468.shtml

  3. #3
    this works just need to put the correct "n" value:

    OpOff(ea, n, BADADDR);


    Parameters:
    ea - linear address
    n - number of operand
    0 - the first operand
    1 - the second, third and all other operands
    -1 - all operands
    base - base of the offset as a linear address If base == BADADDR then the current operand becomes non-offset

Similar Threads

  1. Replies: 0
    Last Post: April 15th, 2014, 03:18
  2. Replies: 0
    Last Post: May 6th, 2013, 06:42
  3. Implementing command completion for IDAPython
    By Hex Blog in forum Blogs Forum
    Replies: 0
    Last Post: July 19th, 2010, 21:18
  4. Extending IDC and IDAPython
    By Hex Blog in forum Blogs Forum
    Replies: 0
    Last Post: June 23rd, 2010, 11:18
  5. Using custom viewers from IDAPython
    By Hex Blog in forum Blogs Forum
    Replies: 0
    Last Post: March 25th, 2010, 13:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •