Solved

Question for ARK!

Posted on 2000-05-18
12
171 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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