Log in

View Full Version : A question about COM...


Hero
April 3rd, 2006, 14:04
Hi all
Is there anybody who know an article about structure of a COM(I mean "Component Object Model" file?
I want to know how they store name of routines that belongs to that COM.
I didn't see name of any routine of it in a COM file...
Is there anybody here to help?

sincerely yours

naides
April 3rd, 2006, 15:51
There is Nobody here to help

I ran into this article when I was cracking a COM module.
See:
http://www.woodmann.com/forum/showthread.php?t=7695

I am not sure if it answers your question, but it is pretty illustrative about naming conventions

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncomg/html/msdn_components.asp

Hero
April 3rd, 2006, 22:45
Quote:
[Originally Posted by naides]There is Nobody here to help

Thanks...
At least I Know I should think about another thing now.
But I think it is possible,because when you import a COM in an application
in VS(I test this C# 2003) you will see all of its objects in object browser.
How they can obtain this information???

sincerely yours

Japheth
April 4th, 2006, 00:27
the objects are described in a TYPELIB resource. Usually the MS midl compiler translates a .IDL file to a .TLB file, which then is included as binary object in a .RC file ...

IIRC the TYPELIB resource format is not described, but some interfaces (ITypeLib, ITypeInfo,...) are supplied to access the information.

babar0ga
April 4th, 2006, 00:48
Hello!

I'am pretty much sure you will find everything you need here:

http://www.microsoft.com/msj/0399/hood/hood0399.aspx ("http://www.microsoft.com/msj/0399/hood/hood0399.aspx")

Silver
April 4th, 2006, 05:27
I found this site to have an excellent reference including source.

http://ript.net/~spec/

I wrote some C++ code to extract all the methods from a COM interface a while ago. I might be able to dig it up if you need it.

*edit* To clarify a bit, what you're looking for is something that emulates the functionality of the MS COM/OLE Object Viewer, right?

Hero
April 4th, 2006, 15:00
Quote:
[Originally Posted by Silver]I found this site to have an excellent reference including source.

http://ript.net/~spec/

I wrote some C++ code to extract all the methods from a COM interface a while ago. I might be able to dig it up if you need it.

*edit* To clarify a bit, what you're looking for is something that emulates the functionality of the MS COM/OLE Object Viewer, right?

Thanks for it...
It was a great help.

sincerely yours

Hero
April 16th, 2006, 07:07
After reading these I learned a lot about COM.
but there a question that I still can't find in those articles.
According to these articles there are to ways for calling methods:
1-IDispath.Invoke that uses memberid(DISPID) for calling some routines.
2-Some other will use virtual function table(VTBL) for calling.
But there is a question:
How IDispatch.Invoke convert DISPID to real offset(or RVA) in file?
What is structure of VTBL?

I need these answers for completely figuring out the the real offset of COM methods...

Is there any article for these?

sincerely yours

babar0ga
April 16th, 2006, 14:40
Quote:
[Originally Posted by Hero]
What is structure of VTBL?

No structure, just array.

Please read this: http://www.microsoft.com/msj/0399/hood/hood0399.aspx ("http://www.microsoft.com/msj/0399/hood/hood0399.aspx")
It's an article by Matt Pietrek with full source code included.

There is an sample prog wich can create .map file for COM objects, so that is what you really need.

Regards.