10

Is there a way to convert a .rdata vtable entry to an IDA struct? An example of the vtable entry:

And what the resulting struct should look like (but with all entries - this vtable specifically, should have 109 vfuncs):

I would assume there's some option to give IDA an address, and vtable length, I think I am just missing it. Or maybe there's a script I don't know of, which does this?

I'm using IDA v6.1.

Jarryd Le Breton
  • 101
  • 1
  • 1
  • 5

3 Answers3

6

There is a great IDA plugin called HexRaysCodeXplorer that does automatic type reconstruction for C++ objects . It should do what you need.

jvoisin
  • 2,516
  • 16
  • 23
jiboutin
  • 71
  • 3
4

In the next version, 6.5, it should be as easy as selecting the corresponding VTable area, right click and selecting the menu option "Create struct from data" (leak from IDA Beta testing). In the meantime, you can use this IDAPython script I use myself. I hope you'll find it helpful.

joxeankoret
  • 4,488
  • 2
  • 21
  • 35
  • The "Create struct from data" command has been available for a while now - what changed in 6.5 that makes it more useful in this case? – DCoder Dec 02 '13 at 10:39
  • Awesome! Hopefully I can get my hands on 6.5 in the future. I don't have IDA available at the moment, but I'll definitely check out that script when I get a chance. :) – Jarryd Le Breton Dec 02 '13 at 17:06
0

Answer as of IDA 7.6 (can't guarantee it's correct):

  1. Select your whole vtable in IDA View
  2. Click Edit -> Structs -> Create struct from selection

I don't know of a better way currently, but the problems with this approach is that function names aren't synchronized back to the struct if you rename some subroutine, and also in my case the first member's name was also wrong...

p0358
  • 1