Duplicate relocations in DLL
Jonas Maebe
jonas.maebe at elis.ugent.be
Fri May 17 06:17:03 CDT 2013
On 16 May 2013, at 19:03, Alessandro Pignotti wrote:
> On 16 May 2013, at 16:47, Jonas Maebe wrote:
>> Addendum: he just realised that you may be talking about multiple
>> base
>> relocation arrays for a single page (arrays that contain the offsets
>> of the instructions that need fixing up), which would indeed be
>> strange. Still, it would be interesting to know which dll it is.
>
> I think it's actually the second case you mentioned. I'm pasting an
> excerpt
> from 'objdump -x' of the dll. The issue happens with bgm.dll from
> the game
> "Hotline Miami".
I've found a copy of the dll and gave it to my colleague. His analysis
is that the preferred load address (0x6D740000) does not overlap with
any Windows system dll, and most likely never will because the range
it's in is reserved for very small dll's and they have lots of room
left before they will reach that address. As a result, this dll never
gets relocated under Windows. He constructed a Windows test that
forced it to load the dll at a different address anyway, and then it
also crashes under Windows.
He believes that this was done on purpose to break Wine and other non-
Windows environments. It's an interface to BASS/fmod, and these
libraries supposedly have very strict licensing requirements that
require you to pay per platform you want to support. By constructing
the dll this way it will always (with the caveat mentioned above) run
on Windows, but not under Wine (unless the preferred load address is
available and Wine loads it there, but there are no guarantees for
that; I don't even know whether Wine tries to do this).
As to the best solution: not sure. Current Wine behaviour matches that
of Windows, it's the unavailable preferred load address that triggers
the "problem".
Jonas
More information about the wine-devel
mailing list