Closed GoogleCodeExporter closed 8 years ago
This is actually not IDAPython "messing" with the object. You get the same
behavior if you use SDK functions in a C++ plugin. What happens is that the
returned func_t* points inside the internal cache of func_t objects, and as you
do more get_func() calls eventually that cache slot gets replaced by another
function.
The solution is simple - you need to use the helper class lock_func, e.g.:
f = idaapi.get_func(here())
print f.startEA
flock = idaapi.lock_func(f) # lock the pointer
for x in idautils.Heads(f.startEA):
idaapi.get_func(x)
print f.startEA
flock = None # don't need it anymore, free the lock
Original comment by skochin...@gmail.com
on 20 Feb 2013 at 1:38
Thanks for the explanation! Although the design feels a little cumbersome, it
is good to know how to get things working right :)
Original comment by smallm...@gmail.com
on 20 Feb 2013 at 2:49
Original comment by skochin...@gmail.com
on 20 Feb 2013 at 4:02
Original issue reported on code.google.com by
smallm...@gmail.com
on 15 Feb 2013 at 10:32