Solved

Question for ARK!

Posted on 2000-05-18
12
167 Views
Last Modified: 2010-05-02
I hope i got your attention. I was reading one of the questions in April and saw one of your answers. It was about the dll file of msvbvm50.dll. My question is how did you know the functions within that file? How did you know the parameters to use?
I have been searching and looking to figure out how to look at a dll file and know exactly what is in it and the parameters. I got half way but still stuck on the parameters.
0
Comment
Question by:Spngbob_SqPnts
  • 7
  • 2
  • 2
  • +1
12 Comments
 
LVL 2

Expert Comment

by:orbitaltech
ID: 2821582
Ahhh.. Sorry ARK but the answer lies within your Visual Studio Tools. Use the dependancy walker to view the functions within a dll or exe or ocx. I use a combination of Dependancy Walker and MSDN to make my queries complete..


Hope this helps
0
 

Author Comment

by:Spngbob_SqPnts
ID: 2821603
orbitaltech,

yes, I got that part and it only gives me the functions, but no parameters to use. I need to know what variables to pass and the optionals.
0
 
LVL 2

Expert Comment

by:orbitaltech
ID: 2821701
Wish I could help out there... I would be happy to know what ARK says

0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:Spngbob_SqPnts
ID: 2821704
same here. thanks for trying....
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2822070
arent they in your object browser?
0
 

Author Comment

by:Spngbob_SqPnts
ID: 2822104
They are not in the object browser. meaning: the functions that were noted by ARK are not listed. I did look in the dependancies program and it is there. When I look in the view-reference in "visual basic runtime objects and procedures" I notice that under location, it adds a "\3" to the filename. I dont know if that value limits the functions and subs to the object browser.
I notice in the registry I found the reference to the file and the "\3" was there. I try to remove the "\3" but I guess I need a little more practice on how to modify and save the registry properly.
0
 
LVL 27

Expert Comment

by:Ark
ID: 2835936
Hi
Sorry, I was absent for a while and missed your question.
About working with dlls: it's very flexible work.
First, I view this dll with QuickView.
Then I use some disassemble program (I use dasm). Dasm show full list of export functions, including ordinals (while QuickView show only functions which have name). Some functions have names like SomeFunction@16. It means that this function receives 16 bytes. As most of functions received long values, so this functions receives 4 long values. Some info you can get from function name (for example GetMem1 - Get Value of one byte from memory). If nothing help, I try to understend asm code (looking for push and pop). Then experiment with info which I have, get many GPF, but, finally, sucesses.

PS. Dependancy walker, Object browser etc works with tlbs, but some functions from dll may not be included in .tlb file.
What functions do you interesting in? May be I can help?

Cheers
0
 

Author Comment

by:Spngbob_SqPnts
ID: 2836924
Ark,

This is splendid! What I was really looking for was the ability to look at any DLL files and see what the functions and parameters are. Bingo! you gave me an answer for the parameter. Using disassemble program to find the parameters. I have been doing a little study of assembly and now I know it will be worth learning and applying the knowledge.

It seems that assembly will never go away for a lot of things.

I notice there are a lot of functions in many of the DLL and not many people know it is out there in our computers. I wanted to be able to look at any dll files and find their parameters. Looks like from your experience it will take quite some experimenting to get the functions to work properly without the documentations.

There is no function that I was looking at specifically because I already found what I was looking for from your answer to another question about the Getmem4 and such.

This is great! thanks for the response.
0
 

Author Comment

by:Spngbob_SqPnts
ID: 2837020
Ark,

In your experience, were you able to tell if the parameter has a flag or handle? much like the globalalloc funcitons. Also whether it is more as a sub or function that returns value from the calling procedure.

I assume the best way to know the info is through the disassembler.
0
 
LVL 27

Accepted Solution

by:
Ark earned 20 total points
ID: 2839751
Hello
As far as I know, API (or other) dll functions always return long variable. Sometimes it's some value, sometimes pointer. Disassembler give answer almost in all cases, but this is hard work. Sometimes I try to do it without disassembling. For example, GetMem4 - from function's name I understand, that this function get value of 4 byte (long) from some memory address. So, input parameter should be memory address and return is value of long var. I wrote declaration:
Declare function GetMem4 Lib "msvbvm50" (ByVal MemAddress As Long) As Long. To get MemAddress I used udocumented VarPtr Vb function (BTW, there are VarPtr function in msvbvm.dll, and sometimes this two functions return different result - for strings and objects). I tested this function and understand how it and other same functions (getmem - putmem) functions works.

Cheers
0
 

Author Comment

by:Spngbob_SqPnts
ID: 2842379
Adjusted points from 10 to 20
0
 

Author Comment

by:Spngbob_SqPnts
ID: 2842380
Thanks Ark.

This is great! This really helps. Even though we as programmers have to do the hard work of figuring out the dll functions when they are undocumented. Thank you very much.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How does CurrentUser work? 10 37
How to measure sizes and angles in scanned images ? 3 63
TT Auto Dashboard 13 92
Formula problem with Excel attachment 6 27
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question