Re: windows .dll files and linux
- From: Wolfgang Draxinger <wdraxinger@xxxxxxxxxxxxxxxx>
- Date: Mon, 26 Mar 2007 19:21:07 +0200
juicymixx@xxxxxxxxxxxxxx wrote:
hey everyone,
I'm currently using a program on windows which is really
irritating me. It consistes of an .exe file and several .dll
files which apparently do 'all the work'.
This is not uncommon, as it makes it easier to replace a module
of the program without having to replace all the other parts.
The executable is then merely a loader, that sticks the
libraries together.
Most bigger applications are organized that way.
I wanted to take the .dll files and, using them, code up a
version of this app for linux.
You seem not to understand, that a DLL is practically the same
like an executable, but without an entry point. This means, that
a DLL like a .EXE has dependencies on the system and chances are
high, that the DLL references parts of the Windows API which are
not avaliable in Linux - except you're having WINE installed,
which provides a Win32 like API.
If you're sure, that the DLLs are not making use of any OS
function (very unlikely) you could write some wrapper, that
loads the DLL and links it into your program. Either you may use
code of the WINE project, or you make your own PE loader/linker,
which is not such a hard task as it may sound like. However if
the DLL references anything not avaliable from the other DLLs or
stuff you're providing you're out of luck. Also be aware that
most DLLs exposed functions use the WINAPI aka Pascal calling
convention, i.e. the parameters are passed in order on the stack
(which means that they come out in reverse order in memory),
whereas the C calling convention is other way round.
Is there a way to figure out the inputs and params of the
functions in the .dll files?
No. A DLL is just executable code, together with some table
mapping identifiers/ordinal numbers to addresses in the
executable.
However some DLLs (mainly OCX/ActiveX components, but also some
propritary plugin DLLs) provide a special identifier that gives
access to structures describing the DLL's interface. For
OCX/ActiveX this is specified in the COM standard, with
propritary models you've to figure it out.
I should note, that none of the widespread shared library formats
has been designed to bring such information by default, but on
most *nix like systems the debug versions of .so contain DWARF
data which is practically such a information. But Windows DLLs
don't have this, sorry.
Wolfgang Draxinger
--
E-Mail address works, Jabber: hexarith@xxxxxxxxxx, ICQ: 134682867
.
- References:
- windows .dll files and linux
- From: juicymixx@xxxxxxxxxxxxxx
- windows .dll files and linux
- Prev by Date: How to get rid of 'cd' before %prep in spec file
- Next by Date: static class members, shared libs and other vegetables
- Previous by thread: Re: windows .dll files and linux
- Next by thread: how to query huge page size?
- Index(es):
Relevant Pages
|