CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15
  1. #1
    Join Date
    Apr 2004
    Posts
    61

    Viewing DLL Functions and parameters

    Hi. i was wondering if there is a way to view the functions inside a .dll AND the parameters.

    Example:

    FunctionBlah(char* Test)

    If there is no way to do this, is there a way to watch a program access a .dll and figure out the function parameters?

    Any help appreicated!!


  2. #2
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496

    Re: Viewing DLL Functions and parameters

    Open the DLL in Dependency Walker. The tool ships with Visual Studio. You'll get there a list of the functions in that DLL. I assume there should be some function that would allow you to achieve the same result programatically.
    Har Har

  3. #3
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3,128

    Re: Viewing DLL Functions and parameters

    Dependency Walker does display the list of functions available in the dll. However, it doesn't show the parameter list. I am not sure if it is possible to find out the parameter list though.

  4. #4
    Join Date
    Apr 2004
    Posts
    61

    Re: Viewing DLL Functions and parameters

    hmmm tried dependency walker and a few other programs, but they dont show the function parameters

    anybody??

  5. #5
    Join Date
    Jun 2003
    Location
    India
    Posts
    118

    Re: Viewing DLL Functions and parameters

    Hi,

    Few days back i have asked same kind of question on this forum. Form somebody i got the response that it is possible through COM component.

    'underlay', what all other tools you have used?

    However, Dependancy walker is showing you only functions exported but not the parameter list. I working on this problem; may be i will reinitiate this thread once i finished.

    -PiyuNewe

  6. #6
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496

    Re: Viewing DLL Functions and parameters

    Quote Originally Posted by PiyuNewe
    I working on this problem; may be i will reinitiate this thread once i finished.
    Please do so. Lots of people do not bother providing feedback to the solutions they received.
    Har Har

  7. #7
    Join Date
    Jun 2002
    Location
    Latvia, Riga
    Posts
    35

    Re: Viewing DLL Functions and parameters

    Is there any update on this? It would be highly useful!

  8. #8
    Join Date
    Mar 2004
    Posts
    137

    Re: Viewing DLL Functions and parameters

    I tired to search on google few days back, but didn't find any solution. I think if any one knows good assembly can help us.

    bashish

  9. #9
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: Viewing DLL Functions and parameters

    If you know the decorated name, you can use the undname utility to see the parameters. For example, if the decorated name is ?a@@YAHD@Z, when you give the command
    Code:
    undname -f ?a@@YAHD@Z
    the result shows:
    Code:
    D:\>undname -f ?a@@YAHD@Z
    Microsoft« Windows« Operating System
    UNDNAME Version 5.1.2600.0Copyright (c) Microsoft Corporation. All rights reserv
    ed.
    
    >> ?a@@YAHD@Z == int __cdecl a(char)
    
    D:\>
    undname is normally found in your Program Files\Microsoft Visual Studio\Common\Tools folder.

    Hope that helps.
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  10. #10
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537

    Re: Viewing DLL Functions and parameters

    And in code it would be UnDecorateSymbolName(...)

  11. #11
    Join Date
    Jun 2002
    Location
    Latvia, Riga
    Posts
    35

    Re: Viewing DLL Functions and parameters

    Wow that's great, thanks... I wonder if any of the normal programs that analyze PEs can give me the decorated name of a function?

    EDIT: Ahh, Dumpbin does do that, on OBJ files at least... I hope it works for DLLs too.
    Last edited by ACS_Solver; October 25th, 2004 at 12:09 PM.

  12. #12
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Viewing DLL Functions and parameters

    Does name decoration depend on the complier or is it standardised ?

  13. #13
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: Viewing DLL Functions and parameters

    Guess I'm not sure if it's standard or not. Good question.

    Since undname is from Microsoft and this is the Visual C++ forum, I just assumed (bad idea, I know), that we're dealing with MS code.
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  14. #14
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Viewing DLL Functions and parameters

    Another thing is.. if it is extern "C"ed function, the param info is not there in the function name, right ? So, undecorate wouldn't help..

    Anyways, I get the feeling this method can be used in restricted cases..
    But, it's a good question though.. probably that's the reason, there ain't any tools that do that

  15. #15
    Join Date
    Mar 2004
    Posts
    137

    Re: Viewing DLL Functions and parameters

    Hey,

    That's a good tool, but you need decorated name .

    bashish

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured