Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell what types are defined in a Delphi DCU?

Tags:

delphi

dcu

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

like image 720
JosephStyons Avatar asked Apr 22 '09 14:04

JosephStyons


3 Answers

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.

like image 127
Rob Kennedy Avatar answered Sep 20 '22 20:09

Rob Kennedy


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.

like image 39
schnaader Avatar answered Sep 21 '22 20:09

schnaader


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.

like image 2
Tim Sullivan Avatar answered Sep 19 '22 20:09

Tim Sullivan