[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

3/24/2012 1:24:00 AM

I have a .dll from a manufacturer.
The .dll docs seem to be missing some interfaces that I would expect to
be there.
What is the best tool to explore the .dll (free I hope).

I am currently using the .dll with what I know but need to see if there
are other interfaces.

--
Noah's Ark was built by amateurs,
The Titanic was built by professionals.
Row, row, row your boat gently down the stream ...
Life is but a dream!


41 Answers

ralph

3/24/2012 2:30:00 AM

0

On Fri, 23 Mar 2012 17:23:36 -0800, BeeJ <nospam@spamnot.com> wrote:

>I have a .dll from a manufacturer.
>The .dll docs seem to be missing some interfaces that I would expect to
>be there.
>What is the best tool to explore the .dll (free I hope).
>

"Interfaces"?

1) If an ActiveX component, register it, add a reference to a VB
Project, then examine the Type Library with the Object Browser.

View menu -> Object Browser

2) If a WinAPI DLL (aka, Standard DLL or Regular DLL), check to see if
there wasn't a header file included. Something with a ".h" extension.
Perhaps a file with a ".lib" extension (library)?

Barring those files, you can use dumpbin.exe or depends.exe to mine
export information. These tools provide the names, but for a full
signature you often have to do a bit more digging.
"An In-Depth Look into the Win32 Portable Executable File Format"
http://msdn.microsoft.com/en-us/magazine/bb9...
http://msdn.microsoft.com/en-us/magazine/cc3...

WinDbg is always useful and should already be part of your arsenal.
http://msdn.microsoft.com/en-us/windows/hardwar...

There are commercial tools that will do a good job quicker for around
$100. Handy, but probably not worth it for one or two mystery DLLs.

-ralph

BeeJ

3/24/2012 2:57:00 AM

0

Depends optionally open quikview.exe.
Where do I find that?

The .dll is a Windows .dll not an ActiveX DLL.

Depends shows the four entry points that I already know about.
Are there hidden interfaces? How do I expose those?


ralph

3/24/2012 2:08:00 PM

0

On Fri, 23 Mar 2012 19:56:53 -0700, BeeJ <nospam@spamnot.com> wrote:

>Depends optionally open quikview.exe.
>Where do I find that?
>
>The .dll is a Windows .dll not an ActiveX DLL.
>
>Depends shows the four entry points that I already know about.
>Are there hidden interfaces? How do I expose those?
>

Not quite sure what you mean by "hidden interfaces". A library exposes
items that can be linked - if they are not exposed, they can not be
externally linked. Review the article I posted on the PE File Format.

If Depends shows only four, then there are only four.

One can use dumpbin.exe to expose more details on what a given DLL
will 'export'.

Dumpbin comes with Visual C++. (I've always used Visual Studio
Enterprise which contains both VB and VC++ so I'm not sure what comes
with VB versions only.)

There is a 'free' 3rd party version here:
http://www.softpedia.com/get/System/System-Miscellaneous/dumpbi...
Haven't used it myself, but a quick test shows it does work.

The Dumpbin utility, as well as various other similar utilities, is
really just a 'shell' or 'formatter' for Link.Exe, which does ship
with all VB versions. You can uncover the same information using
Link.exe with the command line option "/dump" it is just a little
uglier. <g>

Link.exe is also shipped with all platform SDKs.

All that said. What makes you think there are "hidden interfaces"?

-ralph

ralph

3/24/2012 2:29:00 PM

0

On Fri, 23 Mar 2012 19:56:53 -0700, BeeJ <nospam@spamnot.com> wrote:

>Depends optionally open quikview.exe.
>Where do I find that?
>

QuickView was a "file viewer" that shipped with early Windows
platforms - it was sort of an "all-in-one" viewer of binary resources.
With it you could view embedded icons, images, exports, objects, ...
depending on file type - a real smorgasbord. They stopped shipping it
with Win2k, or perhaps Vista. Not sure. Kind of handy, but I guess it
got to be too much to keep updated, (a la, OLE Viewer). And most
developers tended to perfer dedicated utilities for specific
applications.

There are several updated version available on the Web, some cheap,
some amazingly pricey.

There is also an updated Depends uitlity available for free.
http://www.dependencyw...
Worth fetching if you don't have it.

-ralph

Mayayana

3/24/2012 2:52:00 PM

0

|
| The .dll is a Windows .dll not an ActiveX DLL.
|
| Depends shows the four entry points that I already know about.
| Are there hidden interfaces? How do I expose those?
|
Four entry points? You mean these:

DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer

Those are functions that indicate a COM DLL. The DLL
may or may not have other functions. What Depends
shows you is functions. It doesn't show you COM info.
For that you can use the VB object browser.

Right click on the left side list and click "Show Hidden
Members" if you think something is missing. Microsoft has
a bizarre tradition of marking some members hidden and
some restricted. The VB object browser *can* show hidden
members, and they can be used. It won't show restricted
members.

Probably the most thorough-going view is with OleView,
also in the VS tools. OleView has a funky layout. It doesn't
seem to show much. Just a list on the left. But if you select
something and right-click it you'll get the option to see more
info. What you get, however, is just a typelib dump. It's
harder to make sense of than the VB object browser.

The term interface is confusing. For VB, an interface and
an object are not really different, even though they have
to be approached differently. C++ uses interfaces. VB
uses objects.
Interface means all sorts of things. The TypeKinds in a
typelib are all interfaces. But then there is one TypeKind
that is actually called "Interface".

Typelib docs are confusing,
and to make matters worse, the object model of Matthew
Curlands's tlbinf32.dll, which is used by a lot of VB people,
is actually a distorted, discombobulated version of the
oleaut32.dll "object model" on which it's based.

Why does all this matter? Because once you get out of
VB's object browser and start reading OleView you're going
to find a big mess. The TypeKinds are listed separately.
Most COM objects have a dual interface, which means they
can be used early or late-bound. What that means is that
you'll see Interfaces with members, you'll see redundant
Dispinterfaces, and you'll see Coclasses. The first represents
the vTable, the second represents the Dispatch/late-bound
methods, and the third, Coclass just means an interface that's
a wrapper around one or more interfaces. In this case it's the
object we see that can be early or late bound. ....Then there
may also be Alias interfaces, which are simply existing interfaces
with alias names! The whole Typelib design is strange, convoluted,
poorly documented, and uses a lot of terms that don't seem to
be very well chosen. And you'll need to understand all of what
I've just written if you want to make sense out of OleView. Yet
for all the apparent nitty gritty of OleView, it's not good for much
unless you happen to be looking for a CLSID to a particular object.

If you're curious, the only really good explanation of COM that
I've ever seen (...I'ts not from Microsoft. Surprise, surprise...) is
from one Sean Baxter:

http://spec.wi...

You can find a lot in the tlbinf32.dll help file, but it does as
much harm as good. You'll end up knowing a lot about COM but
using the wrong terms for things!

In the final analysis, if you can't see it in the VB object browser
with hidden members showing then either you can't use it or you
need a typelib for it.


ralph

3/24/2012 3:00:00 PM

0

On Fri, 23 Mar 2012 19:56:53 -0700, BeeJ <nospam@spamnot.com> wrote:

>Depends optionally open quikview.exe.
>Where do I find that?
>
>The .dll is a Windows .dll not an ActiveX DLL.
>
>Depends shows the four entry points that I already know about.
>Are there hidden interfaces? How do I expose those?
>

All that said, there is always the possibliity the DLL is not strickly
a WinAPI DLL after-all, and may be some kind of hybrid, 'extended',
'emulation', 'shrouded', or 'custom' library.

If this is the case, then it wouldn't do you much good to uncover the
"interfaces", because they depend on clients that also understand the
custom scheme. While possible to reverse-engineer almost anything, I
doubt it would be possible using VB alone. Such things are best
attempted via C/C++.

For example, albeit an overly-simplified example, a MFC Extension DLL
un-useable by VB, could be wrapped in an ATL component which presents
to VB a COM Interface.

-ralph

BeeJ

3/25/2012 4:47:00 PM

0

The dll is declared in the VB source code as follows.

Public Declare Sub SetData Lib "k8062d.dll" (ByVal Channel As Long,
ByVal Data As Long)
Private Declare Sub StartDevice Lib "k8062d.dll" ()
Private Declare Sub SetChannelCount Lib "k8062d.dll" (ByVal Count As
Long)
Private Declare Sub StopDevice Lib "k8062d.dll" ()

The .dll can be found at
http://www.vellemanusa.com/support/downloads/?...
In the SDK link.

Compared to other drivers I have worked with there is usually an
interface that verifies that the hardware is attached and what the
version of the driver is. So I was hoping for some hidden interfaces
that would reveal those properties.


Mayayana

3/25/2012 5:59:00 PM

0

| The dll is declared in the VB source code as follows.
|
| Public Declare Sub SetData Lib "k8062d.dll" (ByVal Channel As Long,
| ByVal Data As Long)
| Private Declare Sub StartDevice Lib "k8062d.dll" ()
| Private Declare Sub SetChannelCount Lib "k8062d.dll" (ByVal Count As
| Long)
| Private Declare Sub StopDevice Lib "k8062d.dll" ()
|
| The .dll can be found at
| http://www.vellemanusa.com/support/downloads/?...
| In the SDK link.
|
| Compared to other drivers I have worked with there is usually an
| interface that verifies that the hardware is attached and what the
| version of the driver is. So I was hoping for some hidden interfaces
| that would reveal those properties.
|

I can't get their website to work.

Did you read anything of what Ralph and I both said
about interfaces? Do you know about COM interfaces?
Do you realize that's what we both thought you were
talking about? You seem to have your terms mixed.
Maybe by interface you mean a GUI window? Maybe you
mean "function"?


BeeJ

3/25/2012 6:04:00 PM

0

Interface: Where a hardware guy make a connection between different
ojects. ergo to me, where one app talks to the ActiveX EXE or a .dll;
function or sub (methods) or Event.
We almost speak the same language.


BeeJ

3/25/2012 6:12:00 PM

0

Oh, yes. I copied the link from where I was. Now I just tried
clicking on the link in the newsreader and got their, "where are you
calling from webpage". I do not know how to get a "universal link".
However if after you make that confesion, you enter K8062 into their
search thingy and then click on K8062 on the next page and on the
subsequent page click on Downloads(13) you will find the SDK link that
brings you that dll and other stuff.

Perhaps this migh also work
http://www.vellemanusa.com/support/downloads/?...