Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Question for ARK!

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
Spngbob_SqPnts
Asked:
Spngbob_SqPnts
  • 7
  • 2
  • 2
  • +1
1 Solution
 
orbitaltechCommented:
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
 
Spngbob_SqPntsAuthor Commented:
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
 
orbitaltechCommented:
Wish I could help out there... I would be happy to know what ARK says

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Spngbob_SqPntsAuthor Commented:
same here. thanks for trying....
0
 
AzraSoundCommented:
arent they in your object browser?
0
 
Spngbob_SqPntsAuthor Commented:
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
 
ArkCommented:
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
 
Spngbob_SqPntsAuthor Commented:
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
 
Spngbob_SqPntsAuthor Commented:
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
 
ArkCommented:
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
 
Spngbob_SqPntsAuthor Commented:
Adjusted points from 10 to 20
0
 
Spngbob_SqPntsAuthor Commented:
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 7
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now