Results 1 to 5 of 5

Thread: Reconstruct Delphi control classes

  1. #1

    Unhappy Reconstruct Delphi control classes

    Hello!

    I have a problem. I am manipulating a program written in Delphi 5/6 (depending on the program's version). Now, I have created a 2 DLLs, written in Delphi, one compiled with Delphi 5, the other one compiled with Delphi 6, and a loader which starts the target and injects the right DLL. Now, I can easily manipulate the controls used by the app, TMaskEdit's for example.

    But the problem is: many of the controls used by the app are not default Delphi controls, but self-written by the app's programmer. I have seen that in the executable file there are written the names of the public properties of these classes. But is there any way to kind of "decompile" them to get Delphi source of the declarations again, or at least the offsets and sizes of the public properties?

    Thanks in advance,

    Cherry

  2. #2
    Fucntions in typinfo.pas will allow you to do almost anything to a component without decompiling. Start with GetTypeData and GetPropInfos.

  3. #3
    I don't understand this.

    I found a lot of examples, but all are using a unit called "rttiobj", which I can't find anywhere...

    EDIT: Okay, I found it(http://fpc.freedoors.org/fpcbuild-2.2.0/fpcdocs/typinfex/rttiobj.pp), but I can't compile:
    Code:
    [Error] rttiobj.pas(3): Invalid compiler directive: 'Mode'
    [Error] rttiobj.pas(15): Number of elements differs from declaration
    [Error] rttiobj.pas(17): Undeclared identifier: 'tkbool'
    [Error] rttiobj.pas(468): Undeclared identifier: 'PByte'
    [Error] rttiobj.pas(478): Pointer type required
    [Error] rttiobj.pas(478): Pointer type required
    [Error] rttiobj.pas(479): Pointer type required
    [Error] rttiobj.pas(481): Pointer type required
    [Error] rttiobj.pas(494): Undeclared identifier: 'ptfield'
    [Error] rttiobj.pas(495): Undeclared identifier: 'ptstatic'
    [Error] rttiobj.pas(496): Undeclared identifier: 'ptVirtual'
    [Error] rttiobj.pas(497): Undeclared identifier: 'ptconst'
    [Fatal Error] Project1.dpr(7): Could not compile used unit 'rttiobj.pas'
    Maybe it needs a newer version of Delphi...?

    Could somebody give me an easy example how I can get class name and published properties (name, type) of an unknown object and then change its properties?
    Last edited by Cherry; May 7th, 2009 at 14:28.

  4. #4
    TypInfo unit should be included with Delphi. RttiObj is probably some FreePascal thing. Maybe check RTTI articles from here:
    http://www.suite101.com/articles.cfm/delphi_programming

  5. #5
    <script>alert(0)</script> disavowed's Avatar
    Join Date
    Apr 2002
    Posts
    1,281
    you may also want to check out the source code for DeDe to see how it's doing a lot of its work.

Similar Threads

  1. Replies: 21
    Last Post: August 17th, 2011, 00:33
  2. How to extract java classes from executable.
    By Magister in forum Malware Analysis and Unpacking Forum
    Replies: 6
    Last Post: August 28th, 2009, 09:47
  3. Extracting java classes from exe ?
    By MrSmith in forum Malware Analysis and Unpacking Forum
    Replies: 9
    Last Post: December 17th, 2008, 16:35
  4. Full Delphi 6 and Delphi 7 Signature For IDA
    By TQN in forum Tools of Our Trade (TOT) Messageboard
    Replies: 28
    Last Post: June 25th, 2007, 11:20
  5. article on classes restoration by example of Delphi
    By pyatachok in forum Advanced Reversing and Programming
    Replies: 3
    Last Post: October 2nd, 2004, 06:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •