How to read dll files?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Thread: How to read dll files?

  1. #1
    Join Date
    Feb 2006
    Posts
    157

    How to read dll files?

    How can I read the content of dll files (in Windows) by using Java. What comes after Runtime.getRuntime().load(path)?
    Thank you

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: How to read dll files?

    What do you mean by "Read" ??
    DLLs are binary files like Java classes. Are you asking "How to use functions implemented inside the dll" ? Or just want to parse the Format(Portable Executable) of DLL ?
    Last edited by Krishnaa; July 28th, 2006 at 06:35 AM.
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Feb 2006
    Posts
    157

    Re: How to read dll files?

    I would like to see what has been written (code) in dll. How can I see all classes, functions and variables defined within a dll file?

  4. #4
    Join Date
    Apr 2001
    Location
    South Africa, Jo'burg
    Posts
    680

    Re: How to read dll files?

    I'm no guru on DLL files but as I understand it and as Krishnaa mentioned they are binary files, just like java class files. This means they have already been compiled, and in order to view the code you would have to find a way to de-compile them before you can see the code (the actually code as you would write is not in the dll file, only the end result after your code has been compiled into "machine code").
    Byron Tymvios

    Please use [ CODE ] and [/ CODE ] tags when posting code! See THIS on how to use code tags.

  5. #5
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: How to read dll files?

    Quote Originally Posted by lontana
    I would like to see what has been written (code) in dll. How can I see all classes, functions and variables defined within a dll file?

    You can't see the code or clases, as those are windows platform dependant binaries. You can only translate the code written in DLL into Win32 Assembly.

    BTW why do you want to do that ? What exactly you are trying to do that.
    Regards,
    Ramkrishna Pawar

  6. #6
    Join Date
    Feb 2006
    Posts
    157

    Re: How to read dll files?

    I would simply like to see what certain dll file does. I have downloaded the program, for example and I would like to get more information about internal structure of the program. The program contains many dll files and I would like to find out what each of them does.
    Let me rephrase the question:
    How can I access source code through a dll file?
    Thanks again

  7. #7
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,716

    Re: How to read dll files?

    Just go with Some Good Assembler may be you will get something

  8. #8
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: How to read dll files?

    Quote Originally Posted by lontana
    Let me rephrase the question:
    How can I access source code through a dll file?
    Thanks again
    This is not possible, you can't get source back from a DLL, however you can disassemble it in good shape into Win32 Assembly code and analyse it there.
    Regards,
    Ramkrishna Pawar

  9. #9
    Join Date
    Feb 2006
    Posts
    157

    Re: How to read dll files?

    Quote Originally Posted by Krishnaa
    This is not possible, you can't get source back from a DLL, however you can disassemble it in good shape into Win32 Assembly code and analyse it there.
    Quote Originally Posted by humptydumpty
    Just go with Some Good Assembler may be you will get something
    .
    Could you explain to me how I can do that?
    Thanks

  10. #10
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: How to read dll files?

    OllyDbg is my favorite,

    There are others like MASM, PEBrowse, IDA Pro etc.

    Ans yes, you should be able to understand Assembly.

    Regards,
    Ramkrishna Pawar

  11. #11
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: How to read dll files?

    I would suggest that, in general, you'll be wasting your time trying to find out how a Win32 DLL works by disassembling it. You'll be able to see the entry-point names (exported functions or API), but even if you learn Assembler, unless full debug information is available (symbolic name table, etc), you'll probably find it very difficult to follow what the code does.

    You'd probably be better trying to find the source code or a detailed description/white paper.

    Having said that, PEBrowse is a pretty good disassembler if you want to see what you're up against!

    Java classes can usually be decompiled into reasonably readable source (unless an obfuscator or optimizing compiler was used) using tools like JAD (Java Decompiler).

    It is not knowledge, but the act of learning, not possession, but the act of getting there which generates the greatest satisfaction...
    F. Gauss
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  12. #12
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: How to read dll files?

    Java has reflection, and reflection requires storing structure of source (class names, method names, field names!). Most popular languages used to build PE don't store reflection information, most of what you see in dll is exported functions, that is functions you call externally, which doesn't reflrect internal structure of dll, more like what it's supposed to do.
    "Programs must be written for people to read, and only incidentally for machines to execute."

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center