tags:

views:

334

answers:

3

I have a set of compiled Delphi dcu files, without source. Is there a way to determine what types are defined inside that dcu?

+5  A: 

You could have a look at DCU32INT, a Delphi DCU decompiler. It generates an .int file that is somehow readable but not compilable, but if you only want to determine the types defined, this could be enough.

schnaader
dcu32int worked for me. The .int file was quite readable.
JosephStyons
+2  A: 

The DCU format is undocumented, last I checked. However, there is a tool I found that might give you some basic info called DCUtoPAS. It's not very well rated on the site, but it might at least extract the types for you. There is also DCU32INT, which might help as well.

Otherwise, you might just have to open the file with a hex editor and dig around for strings.

Tim Sullivan
DCUtoPAS didn't work at all... DCU32INT did though.
JosephStyons
+6  A: 

To find out what's in a unit named FooUnit, type the following in your editor:

unit Test;

interface

uses FooUnit;

var
  x: FooUnit.

Press Ctrl+Space at the end, and the IDE will present a list of possible completion values, which should consist primarily, if not exclusively, of type names.

Rob Kennedy
Simplest solution, and it works well. I accepted schnaader's though, since it actually breaks apart the DCU directly, rather than relying on the IDE.
JosephStyons