Back to Website

Technical question about EXEs and DLLs

If it doesn't fit anywhere else, drop it in here. (not to be used as a chat/nonsense section)

Moderator: Moderator Team

Technical question about EXEs and DLLs

Postby PurpleGurl » Sat Jan 07, 2017 8:17 pm

Yes, this is off-topic, but I am very curious. I was playing Dungeon Keeper, at least the version that Electronic Arts gave away as a freebie for a limited time. It used DOSBox so it would work under x64. It was buggy in that the mouse would randomly lose control and render the game unplayable. So I wanted to see if there were any alternative implementations and found Dungeon Keeper FX. They used a unique way of building it. They had converted the main executable to a DLL and called the portions they didn't write as replacements. I found their tutorial on how to pull this off, by modifying the header data, playing with the relocation table, modifying the entry point code, etc.

Now the question is this. Why does a 32-bit program calling what is presumably 16-bit code in a DLL run under x64? I mean, DOSBox is needed for the original to run under x64, but this 32-bit program which uses much of the original proprietary code works just fine without it.
PurpleGurl
 
Posts: 1493
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Technical question about EXEs and DLLs

Postby menuhin » Sat Jan 07, 2017 8:25 pm

Dos Games for DOSBOX are 16Bit
menuhin
 
Posts: 21
Joined: Sun Dec 30, 2012 12:19 am

Re: Technical question about EXEs and DLLs

Postby middings » Sun Jan 08, 2017 12:45 pm

I am guessing that the code being called from the DLL is not 16-bit code.
middings
 
Posts: 680
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: Technical question about EXEs and DLLs

Postby EmuandCo » Sun Jan 08, 2017 1:22 pm

You can't ein 16 Bit Code. Not by DLL, Not by exe File.
Image
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.
EmuandCo
Developer
 
Posts: 3882
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld

Re: Technical question about EXEs and DLLs

Postby LuxenDM » Sun Jan 08, 2017 4:52 pm

they used a unique way of building it...

Sounds like they took the original's assets, and are ignoring the actual code of the game (which sounds like a lot of work) or are distributing their own interpretive emulator specific to that game (also sounds like a lot of work). Or maybe its something i dont know about yet.

I mean, i've come acrossed dune2 for android before (a 16bit dos game, if im not mistaken), and all it was was a specialised touch input thrown on top of some dos emulator built to autoboot and go straight to the game without letting the user know any better...
LuxenDM
 
Posts: 30
Joined: Sun Jan 01, 2017 9:29 pm

Re: Technical question about EXEs and DLLs

Postby PurpleGurl » Mon Jan 09, 2017 8:23 pm

I agree with Daniel here, and he should know, obviously, but what the author said makes no sense. They claim to have converted the original executable to a DLL, and call only portions of the internal functions. Thus their code provides some of its own functions and acts as a wrapper to the original code. I don't see how this is possible, and the story sounds a bit like something brown found on the ground behind a bull.

I wonder if the code wasn't 32-bit passing as 16-bit, or what?

As for assets, while they may have written many of their own as replacements or whatever, it still requires the original game. That's how the replacements get around the intellectual properties laws and all. While they can be called derivatives, they require the original software to work, so the original author is not impacted, and I've heard of no suits over this.
PurpleGurl
 
Posts: 1493
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Technical question about EXEs and DLLs

Postby Black_Fox » Tue Jan 10, 2017 5:23 pm

One very simple explanation to this is they could have decompiled the original executable into a source code, fixed compilation errors when compiling into 32-bit executable, and from there on it's comparably easy.
Black_Fox
 
Posts: 1584
Joined: Fri Feb 15, 2008 9:44 pm
Location: Czechia

Re: Technical question about EXEs and DLLs

Postby PurpleGurl » Thu Jan 12, 2017 12:48 am

Ah yes, disassembly, makes sense now. Then reassemble for Win32 after removing anything "illegal," playing with fixups and relocations, changing the entry point code, fixing alignment issues, etc.
PurpleGurl
 
Posts: 1493
Joined: Fri Aug 07, 2009 5:11 am
Location: USA

Re: Technical question about EXEs and DLLs

Postby MadWolf » Sun Jan 29, 2017 7:43 am

hi
if i am looking at the right page if i was you do not trust this you may need to edit the Dosbox config to fix this bug or download Dos-Box the bug may have been fixed in an newer version of Dos-Box
MadWolf
 
Posts: 489
Joined: Sat Dec 31, 2005 4:19 am

Re: Technical question about EXEs and DLLs

Postby PurpleGurl » Mon Jan 30, 2017 10:54 pm

MadWolf wrote:hi
if i am looking at the right page if i was you do not trust this you may need to edit the Dosbox config to fix this bug or download Dos-Box the bug may have been fixed in an newer version of Dos-Box


I must have left out the part about me actually using the rewrite. But that was irrelevant to the story since I was asking how they pulled it off, not soliciting help finding a working copy. Dungeon Keeper FX doesn't have the bugs nor use DOSBox.
PurpleGurl
 
Posts: 1493
Joined: Fri Aug 07, 2009 5:11 am
Location: USA


Return to Off Topic

Who is online

Users browsing this forum: No registered users and 7 guests