Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Making a preloader for awc.dll?


  • Please log in to reply
4 replies to this topic

#1 Camthayne7

Camthayne7

    Regular Member

  • Members
  • Pip
  • 11 posts
  • Graphics Card:Nvidia Msi GT 640
  • Operating System:OS X 10.8 (Mountain Lion)
  • I like to play:Anything dark and distopian interests me.

Posted 29 June 2013 - 05:54 AM

Been trying to get a port of Alice madness returns working for a while and it has been stubborn, but not fruitless. I have managed to get the port down to just one bug holding it back. But it appears to be a tricky one.
Every time i try to start the game it begins to start, then a small popup appears that says awc.dll load failed, so i looked it up and i figured out that awc.dll is drm and has very little to do with the game itself. I figure that if it weren't failing the game would run. so i looked it up some more...and i found this.

http://bugs.winehq.o...ug.cgi?id=33159
http://www.winehq.or...rch/349562.html

Seems like a very similar problem to me and i think it may be related. It suggests a preloader as a solution. Im not very familiar with this terminology, what exactly is a preloader? and if it really is a possible solution to my problem, how might i go about setting one up?

#2 phnord

phnord

    Regular Member

  • Members
  • Pip
  • 18 posts

Posted 27 July 2013 - 04:43 PM

Summarizing from the winehq issues, and fleshing them out with a bit of background:

When DLL's load into memory, they have predefined memory addresses at which they plan to load.  In some instances, they cannot load directly to these addresses as something else is occupying it, or it is elsewise reserved.  This is fine, as the loader will then make use the DLL's relocation table and move it elsewhere in RAM.

The problem here is that awc.dll is a file that is there as an anti-piracy measure, and has had its relocation table stripped from it in order to make it more difficult to screw with.

This would not be a problem on a windows or even linux system - the DLL loads to its normal location and everything is well with the world.  However, on Mac that location is reserved for something else.  Assuming that it's the same as with the activation.dll issue in Sim City, that address - 0x40000000 - is reserved by wine on Mac for WINE_DOS, which takes up 0x00075000-0x40075000.

When the loader tries to load the DLL to that area, it finds WINE_DOS has reserved it - and then when it tries to move it somewhere else, it finds no relocation table within the file with which to do so - and it fails.

So, what's the solution then? Well, someone has mentioned using a preloader. I'm not sure what that would do, but presumably it would... establish some sort of relocation table for the DLL so that it can then be moved? I don't know.

However, someone hacked up a workaround in the aforementioned thread. They modified a line of the WINE loader's code so that there is less memory reserved for WINE_DOS. In doing so, it causes the default address for the DLL to be free upon loading, and the relocation table is never needed to move it.

Said modification - specifically to the file "a/loader/main.c" - can be found here.  I do not have the resources to build it into a custom WINE engine; perhaps someone else here could?

In fact, Camthayne7 - if you're up for it, it would be entirely awesome if you could build an engine with that modification, implement it in the wrapper you have going and share it... :3

#3 Camthayne7

Camthayne7

    Regular Member

  • Members
  • Pip
  • 11 posts
  • Graphics Card:Nvidia Msi GT 640
  • Operating System:OS X 10.8 (Mountain Lion)
  • I like to play:Anything dark and distopian interests me.

Posted 29 July 2013 - 08:24 PM

I was curious about that hack fix that was posted but i just didnt know how to go about installing it, this provides a bit more insight.

Ok, if i can figure out how to make the modification ill try at it. It might take me a while though as i'm a total newb, But ill give it a go...so the modification is a line of add on code for a certain file that makes it more memory efficient in a sense?

Guess ill start by finding the file "and where in that file" ill be putting this new code...im looking for "a/loader/main.c" ?

#4 Gdaemon31

Gdaemon31

    Rookie Porter

  • Members
  • PipPipPipPip
  • 188 posts
  • Locationkicking butt with swords in a fantasy world
  • Graphics Card:NVIDIA GeForce GTX 680MX 2048 MB (My new iMac)



    OS X 10.10.5 (Yosemite)
  • Operating System:macOS 10.12 (Sierra)
  • I like to play:RPGs/Action RPGs, Action games and sometimes FPSs

Posted 24 May 2014 - 12:53 AM

I actually read about the awc.dll load failed error in the forum for Alice the madness returns on Steam as the awc.dll  error happens even natively for PC, and  strangely the crack is supposed to fix the awc.dll load failed problem, but it does not seem to do so in Wine..

#5 gjoid

gjoid

    Professional Member

  • Members
  • PipPipPipPip
  • 153 posts
  • LocationThe Netherlands
  • Graphics Card:Intel Iris Pro 1536 MB
  • Operating System:Other OS/Not specified
  • I like to play:FPS, Racing, GTA-alike, Myst Series-alike

Posted 20 December 2015 - 04:32 PM

any progress ? I came across this topic because I'm trying to port this game as well, but I'm stuck on the AWE error too.
there appears to be a fix from skidrow that doesn't give the Awe error, but unfortunately it gives another error. It's saying that the software is altered ;(

and what gdeamon31 says is true, even to mac the game run on steam, you'll have to use the crack fix
it is the only way the game will run
--------------------------------
Ape is High (Mandrill 1972)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users