Re: windows .dll files and linux



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

.



Relevant Pages

  • Re: .Net packaging/wrapper application?
    ... it just didn't work well in reality due to DLL ... Windows works is to look in the executable's directory for a needed DLL ... the way apps used to work when they developed Windows. ... Looks to me like Jim is looking for the .NET equivalent of compiling ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Unnown process... 5eplorer.exe
    ... do not remove the cause (a "super"-hidden .dll program) but only remove ... symptom files and registry settings. ... It has all permissions but 'copy' denied to everyone, ... then by using the Windows XP Recovery Console. ...
    (microsoft.public.win2000.general)
  • Re: WinSxS, functional under 2k ?
    ... The newSide-by-Side Assembly technology was introduced with Windows XP to help reduce or eliminate DLL Hell. ... If you recall earlier Windows versions, like Windows 95, when you installed an application you were warned if the installer tried to replace a DLL from the system folder with an older version and you were asked if you wanted to accept the change. ... Until Windows XP it wasn't so easy to use different versions of shared system DLLs, that is what the new Side-by-Side assemblies attempts to resolve. ...
    (microsoft.public.win2000.general)
  • Re: Determine name and path of dropped object?
    ... MDE I would really suggest the use of external DLL to hold the subclassing ... windows after loading the Microsoft Office Visual Basic Editor, ... Public Declare Sub DragAcceptFiles Lib "shell32.dll" _ ...
    (microsoft.public.access.modulesdaovba)
  • Re: .Net packaging/wrapper application?
    ... the simple answer to DLL Hell for Visual Basic apps was simply to place a copy of the needed DLLs in the same directory as your executable. ... The way Windows works is to look in the executable's directory for a needed DLL BEFORE using the registry to find one EVEN IF THE REFERENCED DLL IS REGISTERED ON THE PC RUNNING THE APPLICATION THAT NEED IT. ... Perhaps I'm getting old and but what really bothers me is nobody seems to notice this--maybe the 80s was before they got into programming. ... Looks to me like Jim is looking for the .NET equivalent of compiling with static libraries to produce a single executable. ...
    (microsoft.public.dotnet.framework.aspnet)