Solved

Question for ARK!

Posted on 2000-05-18
12
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 28

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 28

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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