IDA Pro 6.2 with database snapshots support

The most frequently asked question we get during the IDA Pro trainings, on the support forum or via support emails is: “When will IDA Pro support the undo feature?” or “How can I undo an operation in IDA Pro”.

Our answer has always been: “Sorry, it is not possible to undo in IDA Pro” or “This feature will eventually be implemented sometime in the future”.

In this blog post, we introduce the new database snapshots feature that will be present in IDA Pro 6.2:

snap_man

Why there is no undo option in IDA Pro

The lack of the undo facility stems from the fact that IDA Pro’s database format is not transactional. Each operation in IDA Pro may entail a great deal of other operations that can change the database contents massively.

Take for instance the case when the user goes over an unexplored area and press “C” to create code. This is what happens:

  • IDA tries to create instructions
  • For each instruction there could be side effects:
    • Creating code, functions or data items
    • A new target address is added to the analysis queue
    • Another unexplored area will become explored
  • The whole algorithm keeps on repeating itself until the analysis queue becomes empty

So, sometimes pressing “C” in one place can completely change the database (functions will be created, data items will be defined, xrefs will be generated, etc…).

What about the case of deleting a segment:

  • Segment deletion will also entail deletion of all instructions
  • Deletion of all related cross references
  • etc…

What we discussed so far are the extreme cases, but what about simply undoing a rename operation? It is true that such a simple operations can be easily tracked, recorded and undone if needed.

In fact, IDA Pro provides a set of callbacks (IDB/IDP callbacks) that allow the programmer to register a callback function that will be triggered in a pre/post manner. The programmer will have a chance to record the operation, modify it before it is carried by the kernel or just handle it completely without passing it to the kernel.

Here’s an excerpt from “idp.hpp”:

// IDB event group. Some events are still in the processor group, so you will
// need to hook to both groups. These events do not returns anything.
// The callback function should return 0 but the kernel won't check it.
// Use the hook_to_notification_point() function to install your callback.
  enum event_code_t
  {
    byte_patched,           // A byte has been patched
                            // in: ea_t ea, uint32 old_value
    cmt_changed,            // An item comment has been changed
                            // in: ea_t ea, bool repeatable_cmt
    enum_created,           // An enum type has been created
                            // in: enum_t id
    enum_deleted,           // An enum type has been deleted
                            // in: enum_t id
    enum_renamed,           // An enum or member has been renamed
                            // in: tid_t id
    ....
    enum_cmt_changed,       // An enum or member type comment has been changed
                            // in: tid_t id, bool repeatable
    destroyed_items,        // Instructions/data have been destroyed in [ea1,ea2)
                            // in: ea_t ea1, ea_t ea2, bool will_disable_range
    ....

 

Real life plugins that use the IDP/IDB callback mechanism include the collabREate plugin by Chris Eagle and the IDA Sync plugin written by Pedram Amini. Nonetheless, those plugins do not aim at providing an undo functionality rather a way to make reverse engineering with IDA Pro a collaborative effort.

Introducing the database snapshot feature

Since the “undo” feature may not be implemented in the near future, we thought of implementing a nice and convenient way to take database snapshots and restore them easily from IDA Pro.

In a nutshell, an IDA Pro database snapshot is a copy of the current database with the following name: databasename_mmddyyyy_hhmmss.idb. In the future, we could optimize the database storage requirement so that only the difference will be stored on disk.

This new database snapshot feature is very similar to “VM snapshots” feature found in most virtualization products (such as VMWare, VirtualBochs, QEmu, etc…) where the user can take a snapshot of the VM at any point in time and work with it (restore, delete, etc…).

Taking a snapshot will be accessible from two places:

  • The first is in the file menu (or by pressing the Ctrl-Shift-W hotkey):

snap_quick

  • And the second method is through the database snapshot manager interface:

snap_man_menu

The snapshot manager interface

In the snapshot manager interface window, the user will be able to restore, rename, delete or take a snapshot:

snap_man

Finally, we would like to thank our kind customers that keep on giving us suggestions and ideas that help us improve the product.

This entry was posted in IDA Pro. Bookmark the permalink.

9 Responses to IDA Pro 6.2 with database snapshots support

  1. Omar says:

    Hey Elias,
    How are you? Thanks for the snapshot feature… good job!

  2. Elias Bachaalany says:

    Omar, glad to hear from you. Glad you like the feature.

  3. Ero Carrera says:

    Great feature! Will come really handy.

    One suggestion, I don’t know if it’ll increase the complexity dramatically but I’ve always found the hierarchical snapshot support in virtualization products much superior to simply linear snapshot. It’s not uncommon that during analysis I might want to go to an earlier stage and branch off following another analysis direction. A hierarchy of snapshots would be perfect for that.

    Regards,

  4. Someone says:

    Cool feature! Looking forward to it!

  5. James Koppel says:

    About once every two weeks, I copy the current state of my IDB to a folder and name it something like myprogram_20110729.idb. This feature will be greatly appreciated!

  6. Max says:

    I agree 100% with Ero, please take his suggestion into consideration.

  7. Elias Bachaalany says:

    Hello Max, Ero.

    Yes, we fancy the suggestion as well. It probably won’t make it into 6.2 but will definitely be there in 6.3.

  8. Avi Cohen Stuart says:

    Elias,

    Will the SDK be updated to save our own snapshots as well, will there be an API call to save and restore?

    Avi.

  9. Elias Bachaalany says:

    Eventually/most likely we will expose this functionality through the SDK. Maybe not in the upcoming release though.