
Hi,
In an IDAPython script that I'm writing, I'm trying to get the stack variable referenced in an instruction's operand. Once I get the stack variable I'd like to rename it. I'm using the following code: -
op = get_instruction_operand ( cmd, n )
stackVar = get_stkvar ( op, op.addr, op.addr )
However this gives me the following error: -
stackVar = get_stkvar ( op, op.addr, op.addr )
File "C:\Program Files\IDA\python\idaapi.py", line 3347, in get_stkvar
return _idaapi.get_stkvar(*args)
TypeError: in method 'get_stkvar', argument 3 of type 'sval_t *'
I have tried using 0 (zero) as the third argument, but still got the same error message.
I'm using IDA Pro 5.2 with IDAPython 0.9.55 final with Python 2.5.1 final.
I have read Steve Micallef's IDA Plug-in Writing in C/C++ tutorial, IDAPython's API Documentation, the IDA SDK header files, and a few example scripts. I haven't been able to find any scripts that use get_stkvar(), and even searching google for "get_stkvar" only returns the IDAPython API Documentation. I'm quite surprised, I'm guessing people use a different method to get the stack variables.
Any help would be appreciated. Thank you in advance.