📚 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  >>  #773: bug in IDA-Pro [fails to debug zero-base PE]

Topic created on: May 14, 2008 07:49 CDT by nezumi .

IDA-Pro embedded debugger doesn't support PE files with zero image base.

the debugger says (I quote):
"IDA Pro couldn't automatically determine if the program should be rebased in the database because the database format is too old and doesn't contain enough information. Create a new database if you want automated rebasing to work properly. Notice you can always manually rebase the program by using the Edit, Segments, Rebase program command".

I have checked 4.7 (standard) and 5.2 (advanced) versions - they are both buggy.

after pressing F9 debugger loses the control, ignores breakpoints (!!!), allowing to the process running on its own, breaking through the debugger!!! really bad news for malware researchers!

to know your enemy - write a simple "hello, world" application and build it as follows:

# ida-bug-773.c
main()
{
ExitProcess (MessageBox (0, "after one bad thing another follows", "sudah jatuh, ditimpa tangga", 0));
}

# building ida-bug-773
cl.exe /c /Ox ida-bug-773.c
link.exe ida-bug-773.obj /FIXED:NO /BASE:0 USER32.LIB

ignore linker warning! (after all, it's just a warning). the file has zero image base, but works fine, coz windows automatically rebases it to the appropriately place. IDA-Pro does rebases files by default, since she doesn't reserve lowest part of address space like windows does.

to debug the file with IDA-Pro debugger we have to rebase it before debugging: /Edit/Segments/Rebase program/Target, where Target is 0x40000 or something like that. we can use ms editbin.exe tool (if IDA-Pro is unable to rebase the program, however, if the program checks PE-header, it definitely find out that the file was rebased).

  aeppert     May 14, 2008 08:17.03 CDT
Has this bug been submitted to Hex-Rays?

  igorsk     May 14, 2008 11:13.51 CDT
You can also turn on "Manual Loading" when opening the PE and enter the new imagebase. But yes, probably the check for zero should be added.

  nezumi     May 14, 2008 11:30.13 CDT
igorsk
IDA-Pro doesn't show image base in the "Load File of New Format" dialogue, so we see no reason to load it manually, and after loading and disassembling it's too late to kill the ida-database and re-create in again. better to rebase the file via Segment menu.
the point is: if we haven't noticed that image base is zero and press F9 to run debugger - alas!!! even we press escape on the warning screen, or click "ok" - IDA Pro will launch the process, ignoring breakpoints that means, debugger has no control. very bad.

I think, if IDA Pro realizes that she is unable to rebase process on the fly, she should not launch process or at least ask for confirmation.

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