📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  IDA Pro  >>  Recovering when IDA Pro plugins go bad?

Topic created on: May 16, 2008 20:26 CDT by cmiller .

I have an IDA Pro plugin that iterates through all the functions and does something to each.  Sometimes this "something" causes something bad to happen, such as reading from address zero.  At this point the plugin just stops.  I'd like it to continue because it works for MOST functions.  Is there such a thing as a try/catch or something in the in the IDA API or in IDC?

  cseagle     May 16, 2008 21:45.44 CDT
> cmiller: Is there such a thing as a try/catch or something in the in the IDA API or in IDC?

IDA plugins are written C++.  C++ has try/catch though it seems like you should attempt to correct the problem that is causing the null pointer deref.

  nezumi     May 23, 2008 21:07.03 CDT
who reads zero-pointer? your code? IDA-Pro? passing incorrect args to an external function is a good way to get an access violation - if IDA-Pro uses her own handlers, she stops your plug-in or... just mystically disappears leaving the database open. this happens quite often, especially with console version. if an exception occurs in your code, well, use try/catch, or check pointers before using them.

IDC is C-like lang. no way to use try/catch over there, and there is a problem. for example: fprintf(f,"%s",0); Message("ok, done\n"); doesn't produce error or raise any exception; IDA doesn't even stop the IDC-script and we see "ok, done", but there is no way to execute fprintf(f,"%s",0). IDA-Pro just forces fprintf() to return error and continue executing the script. btw, IDC-functions don't work with memory directly, so in common case they don't generate exceptions, however, there're undocumented _peek() and _poke() functions working with a real memory (not virtual IDA one), so this is easy to blow IDA up, using them as well as set up your own SEH-handler (very ugly hack!!!).

  cmiller   May 27, 2008 21:46.13 CDT
I got it figured out.  It was indeed a bug in my C code (well actually it was Chris Eagle's code since I'm making some changes to ida-x86emu)  :)  Thanks Chris, its a cool plugin.  

Anyway, it wasn't IDAs fault

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit