#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    Romania
    Posts
    6
    Rep Power
    0

    functions in dll's


    is there a method to extract the functions from a compiled dll?
    for known dll's there is a lot of documentation on the internet, but what if i have an anonymous dll. how do i know what functions (and formats) does it contain

    thank you
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Depends on your DLL really and how it exports its functions. If it is an Active-X dll, then you can easily import the functions into Delphi -- Go to Project --> Import Type Library and select the library to import.

    For a non-ActiveX DLL, there are tools to view the exported functions (and you can sometimes guess the parameter types from the exported function name). I don't have delphi installed here, so I'll look it up in the morning and let you know.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    Romania
    Posts
    6
    Rep Power
    0
    thanks a lot
    hope that in the future i return the favour
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    1
    Rep Power
    0

    Export display list dll exported functions c c++ (just to better google it)


    Hi, folks, this code compiles on the Borland C++ platfrom, v 6.

    It will list retrieve the functions of any givens dll file. Hope have helped. Regards from Brazil.

    #include <imagehlp.hpp>

    void ListDLLFunctions(AnsiString sADllName, TStringList *slListOfDllFunctions){
    DWORD *dNameRVAs = (DWORD *)calloc(1048575,sizeof(DWORD));
    _IMAGE_EXPORT_DIRECTORY *ImageExportDirectory;
    _IMAGE_SECTION_HEADER *ImageSectionHeader;
    unsigned long cDirSize;
    _LOADED_IMAGE LoadedImage;
    AnsiString sName;
    slListOfDllFunctions->Clear();
    if (MapAndLoad(sADllName.c_str(), NULL, &LoadedImage, True, True)){
    try{
    ImageExportDirectory = (_IMAGE_EXPORT_DIRECTORY *)ImageDirectoryEntryToData(LoadedImage.MappedAddress,
    false, IMAGE_DIRECTORY_ENTRY_EXPORT, &cDirSize);
    if (ImageExportDirectory != NULL){
    dNameRVAs = (DWORD *)ImageRvaToVa(LoadedImage.FileHeader, LoadedImage.MappedAddress,
    DWORD(ImageExportDirectory->AddressOfNames), &ImageSectionHeader);
    for( int i = 0; i < ImageExportDirectory->NumberOfNames; i++){
    sName = (char *)ImageRvaToVa(LoadedImage.FileHeader, LoadedImage.MappedAddress,
    dNameRVAs[i], &ImageSectionHeader);
    slListOfDllFunctions->Add(sName);
    }
    }
    }__finally{
    UnMapAndLoad(&LoadedImage);
    }
    }
    }
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    5
    Rep Power
    0

    If I am not mistaken...


    Hi,

    I am using a DLL which I made for my applications. If I would distribute this DLL, the easiest way (I can see) that another person can get a glimpse of the functions in the DLL would be ckecking out the header file.

    The header file must contain a list of the functions (etc.) in the DLL.

    If I am not mistaken a DLL has to be distributed w/ the header file (filename.h), atleast the ones I make. I understand that the case can also be otherwise in which case I have no clue how its done.

    But I have only delved into this area not long ago, so excuse me if I am totally off here. Same as "Criki" I would also apreciate any additional information to the facts I have brought foreward here.

    And please, simplicity! Simplicity goes a long way. I we anser eachother by just throwing any code into the vast sea of insinuations, the point of having such an exelent forum, becomes somewhat redundant. Answering a question by raising an additional 20 questions doesn't seem to me to be the best way to contribute to a forum.

    Thanks and sorry if abyone feels insulted by some of my comments, but its not my aim to insult any one. Contributing to this excelent forum is an advantage to me and also to all the people who use it frequently.

    Once again thanks for any replies,

    Villas1k
  10. #6
  11. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    There are different types of DLLs (i.e.) Regular and ActiveX. The regular DLLs need the .h file to be distributed if another user wishes to use the DLL, whereas the header files for ActiveX DLLs can be recreated by querying the DLLs themselves.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo