DFM from DCU file

I'm dying here!  My hard disk became corrupted and I've lost some important delphi code.  Some of my program units have working .PAS files but stuffed .DFM files.  Is there any way of regenerating the .DFM file from the .DCU compiled version?
ashbenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
hI
sorry the dcu is just the compiled delphi code..doesnt contain the form info :-(
if you have the exe file i can point you in direction to get back forms but without there is no chance ..

Regards Barry
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ashbenAuthor Commented:
Yes, I have the exe file, so any help getting forms would be appreciated (at the moment I'm creating objects on the forms using the names from the .PAS files but I obviously can't identify the rest of the property values :(
0
intheCommented:
ill give you this but note ,it is only to be used on your own software  not other persons as it is illegal if used on someone else's.

you can get back all the form and its contents and all resourses and the units come back like:

{*****************************************************************************}
{*      -> Multi Ripper 2.60 <-       The Multi-Purpose File Extractor       *}
{******** To have the last release send an email to baccan@isanet.it *********}
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, StdCtrls, Buttons, ExtCtrls, CommCtrl;

type
  TForm1 = class(TForm)
    DGCScreen1: TDGCScreen;
    DGCImageLib1: TDGCImageLib;
    DGCSpriteMgr1: TDGCSpriteMgr;
    DGCSoundLib1: TDGCSoundLib;
    DGCAudio1: TDGCAudio;
    procedure DGCSpriteMgr1SpriteDirChange(Sender: TObject);
    procedure DGCScreen1CleanUp(Sender: TObject);
    procedure DGCScreen1Initialize(Sender: TObject);
    procedure DGCScreen1Flip(Sender: TObject);
    procedure FormKeyPress(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.DGCSpriteMgr1SpriteDirChange(Sender: TObject);
begin
  { Address xxxxxx }
end;

procedure TForm1.DGCScreen1CleanUp(Sender: TObject);
begin
  { Address xxxxxx }
end;

procedure TForm1.DGCScreen1Initialize(Sender: TObject);
begin
  { Address xxxxxx }
end;

procedure TForm1.DGCScreen1Flip(Sender: TObject);
begin
  { Address xxxxxx }
end;

procedure TForm1.FormKeyPress(Sender: TObject);
begin
  { Address xxxxxx }
end;

end.

and you get a directory full of icons etc and the pas, dpr, dfm files etc..

see:
http://www.csee.uq.edu.au/~csmweb/decompilation/mrip260.zip 

another:
http://www.ems.ru/~gold/exe2dpr.html 
 
ps..really only use on your own exe's or you may face prison or something ;-)
these where found using www.yahoo.com and are totally nothing to do with me

most importantly for you the forms come back fully,only the coede from pas files isnt filled in..
hope it a help
Regards Barry
0
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

ashbenAuthor Commented:
You have just saved me several days' work!  Thanks Barry :)

And don't worry, I'll use this program for good, not evil!  It's probably a good thing it only produces DFM files actually, otherwise I don't think I'd feel safe distributing Delphi programs any more!!!
0
intheCommented:
bit worrying isnt it but our code will remain safe for a long while yet ,this is one of the good things about dcu format ,no one know how to uncode ;-)

good luck
0
ashbenAuthor Commented:
Quick update - i've managed to recover all my DFM files (7 of them) - now I just need to reprogram 1 PAS file (fortunately a simple one) and my work is done :)

One note about the MRip program - I had to do a bit of hex editing of the DFM headers before Delphi would recognise them (maybe this is because I'm using Delphi 5? or maybe because I used the shareware version of the ripper, and it was only supposed to correctly rip 3 forms?)

Cheers
0
intheCommented:
good ;-)
yes there is some shareware thing if i remeber right..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.