473,508 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DLL Simple Question

Hello VC,

Given a non-DotNET dll from some unknown place
How do I know the classes in it, or how do I view the classes, methods,
properties etc..

Thank you
Nov 16 '05 #1
16 8628
"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Given a non-DotNET dll from some unknown place
How do I know the classes in it, or how do I view the classes, methods,
properties etc..


Short answer: you don't.

Longer answer:

You can inspect what a DLL exports (using the MS tools) with this command

dumpbin/exports randomDLL.dll

That gets you the public name of the functions that are exported by name.
Functions may be exported without names. Not all member functions in classes
need to be exported.

In many (all?) cases, it turns out that C++ member functions have names
which are decorated (mangled) by the compiler to include information about
the number and type of arguments and return value. However, C++ compilers
don't use the same decoration scheme. So, if you know the compiler used to
generate the object code you may glean some information but not a lot.

Regards.
Will
Nov 16 '05 #2
Thank Will
I will try it

"William DePalo [MVP VC++ ]" <wi***********@mvps.org> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Given a non-DotNET dll from some unknown place
How do I know the classes in it, or how do I view the classes, methods,
properties etc..
Short answer: you don't.

Longer answer:

You can inspect what a DLL exports (using the MS tools) with this command

dumpbin/exports randomDLL.dll

That gets you the public name of the functions that are exported by name.
Functions may be exported without names. Not all member functions in

classes need to be exported.

In many (all?) cases, it turns out that C++ member functions have names
which are decorated (mangled) by the compiler to include information about
the number and type of arguments and return value. However, C++ compilers
don't use the same decoration scheme. So, if you know the compiler used to
generate the object code you may glean some information but not a lot.

Regards.
Will

Nov 16 '05 #3
I have tried to use the dumpbin and all I get the following

C:\Temp>dumpbin/exports "C:\Program Files\SOYO\HW Monitor\itevio.dll"
(null) : error : cannot execute LINK.EXE

"William DePalo [MVP VC++ ]" <wi***********@mvps.org> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Given a non-DotNET dll from some unknown place
How do I know the classes in it, or how do I view the classes, methods,
properties etc..
Short answer: you don't.

Longer answer:

You can inspect what a DLL exports (using the MS tools) with this command

dumpbin/exports randomDLL.dll

That gets you the public name of the functions that are exported by name.
Functions may be exported without names. Not all member functions in

classes need to be exported.

In many (all?) cases, it turns out that C++ member functions have names
which are decorated (mangled) by the compiler to include information about
the number and type of arguments and return value. However, C++ compilers
don't use the same decoration scheme. So, if you know the compiler used to
generate the object code you may glean some information but not a lot.

Regards.
Will

Nov 16 '05 #4
News VS.NET ( MS ILM ) wrote:
I have tried to use the dumpbin and all I get the following

C:\Temp>dumpbin/exports "C:\Program Files\SOYO\HW Monitor\itevio.dll"
(null) : error : cannot execute LINK.EXE


You're not running on a properly configured command prompt. It's easiest if
you use the "Visual Studio Command Prompt" shortcut that's installed in the
start menu when you install visual studio. If you did do that and got he
above error, then your Visual Studio installation is messed up somehow.

-cd
Nov 16 '05 #5
Carl Daniel, Thank you very much

After dumpbin/exports "C:\Program Files\SOYO\HW Monitor\itevio.dll"

I get the following: How do I read this, I need to know the function names
that my code can call
I am trying to get the CPU temperature using this Soyo .dll? any ideas?
thank you

Dump of file C:\Program Files\SOYO\HW Monitor\itevio.dll

File Type: DLL

Section contains the following exports for itevio.dll

00000000 characteristics
0 time date stamp Wed Dec 31 16:00:00 1969
0.00 version
1 ordinal base
5 number of functions
5 number of names

ordinal hint RVA name

4 0 0000158D Inb
3 1 0000157C Outb
2 2 000012BF ReadReg
1 3 000012A8 WriteReg
5 4 0000A17C ___CPPdebugHook

Summary

7000 .data
1000 .edata
1000 .idata
1000 .reloc
1000 .rsrc
9000 .text
1000 .tls

"Carl Daniel [VC++ MVP]" <cp******@nospam.mvps.org> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
News VS.NET ( MS ILM ) wrote:
I have tried to use the dumpbin and all I get the following

C:\Temp>dumpbin/exports "C:\Program Files\SOYO\HW Monitor\itevio.dll"
(null) : error : cannot execute LINK.EXE
You're not running on a properly configured command prompt. It's easiest

if you use the "Visual Studio Command Prompt" shortcut that's installed in the start menu when you install visual studio. If you did do that and got he
above error, then your Visual Studio installation is messed up somehow.

-cd

Nov 16 '05 #6
"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
I get the following: How do I read this, I need to know the function names that my code can call
I am trying to get the CPU temperature using this Soyo .dll? any ideas?
...
ordinal hint RVA name

4 0 0000158D Inb
3 1 0000157C Outb
2 2 000012BF ReadReg
1 3 000012A8 WriteReg
5 4 0000A17C ___CPPdebugHook


The section above reports that Inb, Outb, ReadReg, WriteReg and
__CPPdebugHook are functions which "clients" of this DLL may call. (The last
export is a clue, I think, that Borland tools were used to link the DLL.).
That does you little good, however as it doesn't speak to calling
conventions or the requirements imposed by those functions.

Now, it may be a violation of licensing, but one thing that you can do to
further your investigation is to build set break points at those functions
to get a feel for what is being passed into, and returned from, those
functions. The column labeled RVA gives the "relative virtual address" of
the functions which is the offset from the base of the DLL.

Another hack is to build a DLL in assembly language with the same name and
with the same set of "naked exports" (one's with neither prolog nor epilog).
Those exports would do little more than load the real DLL and jump to the
corresponding export in the original DLL. Note that I said jump and not
call. That's because you don't want to muck with the stack until you
understand how parameters are passed on the stack before the call and how
they are popped off after the call. The advantage here to doing this is that
it is easier to set breakpoints in code you wrote with your development
environment than to set them in someone else's binary where all you have is
an address.

<aside>
I did this once and I can tell you that it is not fun. :-(
</aside>

Regards,
Will
Nov 16 '05 #7
"News VS.NET ( MS ILM )" wrote:

Given a non-DotNET dll from some unknown place
How do I know the classes in it, or how do I view the classes, methods,
properties etc..


Depends will give the friendliest output for straight C++, since it
will decode C++ name mangling.

The OLE/COM object viewer will do a fine job with a COM type library,
which many COM dlls will have attached.

--
Craig Powers
MVP - Visual C++
Nov 16 '05 #8
Will,

You are a person endowed with transcendent mental superiority.
You blew my mind away.
I am trying to get the cpu temperature. I was hoping that the soyo .dll will
give me the function I need as is
Thank you for your experties you defenetly tought me something
I don't know how long it will take me to figure it out or find a simpler
solution
Thanks again Will.
"William DePalo [MVP VC++ ]" <wi***********@mvps.org> wrote in message
news:eO****************@TK2MSFTNGP12.phx.gbl...
"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
I get the following: How do I read this, I need to know the function names
that my code can call
I am trying to get the CPU temperature using this Soyo .dll? any ideas?
...
ordinal hint RVA name

4 0 0000158D Inb
3 1 0000157C Outb
2 2 000012BF ReadReg
1 3 000012A8 WriteReg
5 4 0000A17C ___CPPdebugHook


The section above reports that Inb, Outb, ReadReg, WriteReg and
__CPPdebugHook are functions which "clients" of this DLL may call. (The

last export is a clue, I think, that Borland tools were used to link the DLL.).
That does you little good, however as it doesn't speak to calling
conventions or the requirements imposed by those functions.

Now, it may be a violation of licensing, but one thing that you can do to
further your investigation is to build set break points at those functions
to get a feel for what is being passed into, and returned from, those
functions. The column labeled RVA gives the "relative virtual address" of
the functions which is the offset from the base of the DLL.

Another hack is to build a DLL in assembly language with the same name and
with the same set of "naked exports" (one's with neither prolog nor epilog). Those exports would do little more than load the real DLL and jump to the
corresponding export in the original DLL. Note that I said jump and not
call. That's because you don't want to muck with the stack until you
understand how parameters are passed on the stack before the call and how
they are popped off after the call. The advantage here to doing this is that it is easier to set breakpoints in code you wrote with your development
environment than to set them in someone else's binary where all you have is an address.

<aside>
I did this once and I can tell you that it is not fun. :-(
</aside>

Regards,
Will

Nov 16 '05 #9
Craig,

Depends? Sorry I am not familiar with.
Can you please give more info
Thank you for your help

"Craig Powers" <en****@hal-pc.org> wrote in message
news:3F**************@hal-pc.org...
"News VS.NET ( MS ILM )" wrote:

Given a non-DotNET dll from some unknown place
How do I know the classes in it, or how do I view the classes, methods,
properties etc..


Depends will give the friendliest output for straight C++, since it
will decode C++ name mangling.

The OLE/COM object viewer will do a fine job with a COM type library,
which many COM dlls will have attached.

--
Craig Powers
MVP - Visual C++

Nov 16 '05 #10
"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:e#**************@TK2MSFTNGP12.phx.gbl...
You are a person endowed with transcendent mental superiority.
You blew my mind away.
<BWG>
I am trying to get the cpu temperature. I was hoping that the soyo .dll will give me the function I need as is
Thank you for your experties you defenetly tought me something
I don't know how long it will take me to figure it out or find a simpler
solution


I hope my reply didn't come off as pedantic. I didn't mean it to be. But the
problem you are trying to solve is not one that has an easy solution. It is
a lot like this problem:

Assumptions:

I am looking at a function in a source file in a DLL that I wrote. It's
name is foo(). It is used to get the outside temperature here on the east
coast.

Problem:

Guess how I call it. <g>

It could do anything in just about any way. The simple solution would be to
ask me.

But in your case, the problem is harder in that you can not in any sense
"ask" the binary how it does what it does. Your only option is to inspect
it. That's tedious, error prone and frustrating. <g>

Development environments that support "reflection" (e.g. Java, .Net, etc)
provide a way to query a method for its signature but C and C++ do not.

Regards,
Will

Nov 16 '05 #11
Will thank you again and I know you did not mean to be.
Thank you for your explaining that to me.
I will ask if I can be given a road map to some function to use.

Thanks again
"William DePalo [MVP VC++ ]" <wi***********@mvps.org> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:e#**************@TK2MSFTNGP12.phx.gbl...
You are a person endowed with transcendent mental superiority.
You blew my mind away.
<BWG>
I am trying to get the cpu temperature. I was hoping that the soyo .dll

will
give me the function I need as is
Thank you for your experties you defenetly tought me something
I don't know how long it will take me to figure it out or find a simpler
solution


I hope my reply didn't come off as pedantic. I didn't mean it to be. But

the problem you are trying to solve is not one that has an easy solution. It is a lot like this problem:

Assumptions:

I am looking at a function in a source file in a DLL that I wrote. It's name is foo(). It is used to get the outside temperature here on the east
coast.

Problem:

Guess how I call it. <g>

It could do anything in just about any way. The simple solution would be to ask me.

But in your case, the problem is harder in that you can not in any sense
"ask" the binary how it does what it does. Your only option is to inspect
it. That's tedious, error prone and frustrating. <g>

Development environments that support "reflection" (e.g. Java, .Net, etc)
provide a way to query a method for its signature but C and C++ do not.

Regards,
Will

Nov 16 '05 #12
"News VS.NET ( MS ILM )" wrote:

Craig,

Depends? Sorry I am not familiar with.


More properly, the dependency walker utility. It may be in your start
menu, under the Visual Studio tools. If it's not there, it will be
somewhere in the Visual Studio directory tree, and you should be able
to find it by searching for "depends.exe".

If you run depends.exe, it will show you a number of things about a
dll, including its dependencies, its imports, and its exports.

--
Craig Powers
MVP - Visual C++
Nov 16 '05 #13
> Dump of file C:\Program Files\SOYO\HW Monitor\itevio.dll
...
ordinal hint RVA name

4 0 0000158D Inb
3 1 0000157C Outb
2 2 000012BF ReadReg
1 3 000012A8 WriteReg
5 4 0000A17C ___CPPdebugHook What William said is true, there is not much you can find out
unless you don't spend a lot of time "spying" the calls and/or
dissasembling it. This can be illegal though.

But here is something than can save you some time (but not solve the
problem): Dump of file C:\Program Files\SOYO\HW Monitor\itevio.dll

This tells me the DLL has something to do with a "Hardware Monitor"
for some hardware produced by SOYO (http://www.soyousa.com/).
Assumption: a motherboard.

Then I look at the function names:
Inb, Outb = in and out a byte to/from a port.
Most probable signatures:
int Outb( unsigned short port, int databyte );
int Inb( unsigned short port );
ReadReg, WriteReg = read and write some registry values
No clue about signatures.

But the main point is this: the functions are pretty low level,
even if you will figure out the parameters, there is no much use.
You have to figure out how to control the hardware using such low
level access (port and registryu level).
I can assure you, without documentation it may be not only difficult,
but also risky (not for you, for the motherboard :-)

Mihai
Nov 16 '05 #14
Thank you for the info
FYI, I am looking on how to get the temperature of my CPU

Thanks again,

"Mihai N." <nm*********@yahoo.com> wrote in message
news:Xn********************@63.240.76.16...
Dump of file C:\Program Files\SOYO\HW Monitor\itevio.dll
...
ordinal hint RVA name

4 0 0000158D Inb
3 1 0000157C Outb
2 2 000012BF ReadReg
1 3 000012A8 WriteReg
5 4 0000A17C ___CPPdebugHook

What William said is true, there is not much you can find out
unless you don't spend a lot of time "spying" the calls and/or
dissasembling it. This can be illegal though.

But here is something than can save you some time (but not solve the
problem):
Dump of file C:\Program Files\SOYO\HW Monitor\itevio.dll

This tells me the DLL has something to do with a "Hardware Monitor"
for some hardware produced by SOYO (http://www.soyousa.com/).
Assumption: a motherboard.

Then I look at the function names:
Inb, Outb = in and out a byte to/from a port.
Most probable signatures:
int Outb( unsigned short port, int databyte );
int Inb( unsigned short port );
ReadReg, WriteReg = read and write some registry values
No clue about signatures.

But the main point is this: the functions are pretty low level,
even if you will figure out the parameters, there is no much use.
You have to figure out how to control the hardware using such low
level access (port and registryu level).
I can assure you, without documentation it may be not only difficult,
but also risky (not for you, for the motherboard :-)

Mihai

Nov 16 '05 #15
"News VS.NET \( MS ILM \)" <sq**********@hotmail.com> wrote in message news:<O9**************@TK2MSFTNGP09.phx.gbl>...
Craig,
Thank you
I Searched for depends.exe but could not find it anywhere.
I am using VS.NET may be that is the reason.
possibly the name has changed.


You can always get the latest from...

http://www.dependencywalker.com

- Steve
Nov 16 '05 #16
Thank you Steve

"Steve Miller" <st******@pobox.com> wrote in message
news:e6**************************@posting.google.c om...
"News VS.NET \( MS ILM \)" <sq**********@hotmail.com> wrote in message

news:<O9**************@TK2MSFTNGP09.phx.gbl>...
Craig,
Thank you
I Searched for depends.exe but could not find it anywhere.
I am using VS.NET may be that is the reason.
possibly the name has changed.


You can always get the latest from...

http://www.dependencywalker.com

- Steve

Nov 16 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3274
by: gene.ellis | last post by:
Good morning. I am racking my brains over what seems like should be a simple question. I have a string that contains text and html. Basically, I would like to grab the HTML tags from the string and...
2
1668
by: Kirk | last post by:
A very simple question for anyone who knows their HTML tags and attributes. Is there an atribute that I can use to hide the white space around a table which I have used to fill an entire page? ...
2
1800
by: Anurag | last post by:
This simple one beats me all ends up(sincerely). I have been doing DB2 UDB for some time now, reading a lot of good discussions in this forum, writing some answers, asking a lot more but this...
3
2148
by: Peter | last post by:
Hello Thanks for reviewing my question. I would like to know how can I programmatically select a node Thanks in Advanc Peter
1
1031
by: Chris | last post by:
Sorry to ask such a simple question but here it is, and I'm am new to ASP/WEB I am designing a site and I want to make it general so I can easily change the font/color/sizes of the...
3
1387
by: Brad | last post by:
I have another hopefully simple question. I am so used to writing VB .Net windows apps that there are some things in ASP .Net that just does not easily cross over. I know how to pass variables to...
7
2265
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
2
1164
by: Allain Bøge | last post by:
It is really a simple question. Visual Basic .NET (2003) I create 2 forms (Form1 and Form2) I create a checkbox in Form1 (checkbox1) I create a checkbox in Form2 (checkbox1) I go to Form1...
13
1839
by: Saber | last post by:
I did a lot of searches and read something about datagrids. But I couldn't find the answer of my simple question, how can I show only my desired columns of a table? for example I wrote this sql...
17
2415
by: AlBen | last post by:
Hello sorry I don't know about javascript but I have to finish my work and there I have some scripts on my page I have a textarea form and a select form when a user click in the select form...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.