[Bug 2608] Might and Magic VI wont run until "DeShrinker" program is run on mss32.dll

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Sep 7 12:00:01 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=2608





--- Comment #25 from Anastasius Focht <focht at gmx.net>  2008-09-07 12:00:00 ---
Hello,

no need to confirm/test this bug over and over again for each wine release.
As long as there is no patch sent to wine-patches nothing will change.

In previous comments I already gave detailed analysis and provided a
proof-of-concept patch which works.
So again I outline the required steps for *any* takers to write a proper patch
which might please AJ.
Just give it a try, it's not that hard... this bug exists for such long time
and the solution is here ;-)

Take ntdll LdrAccessResource() as example how an asm wrapper is used.
The asm wrapper for kernel32 ExitProcess() needs to resemble in following
manner:

--- snip ---
55         pushl %ebp
8B EC      movl %esp,%ebp
6A <imm8>  pushl <imm8>
68 <imm32> pushl <imm32>
           pushl 8(%ebp)
           call <real_wine_exitprocess_fn_impl>
           leave
           ret $4
--- snip ---

For the API entry point opcodes which need to be exactly matched I gave the
byte values on left side (Shrinker looks for signatures).

Hints:

"movl %esp,%ebp":

You need to force the assembler to emit the opcode bytes given on left side
directly (by using ".byte 0x8b, 0xec" instead of writing "movl %esp,%ebp").
This is because there exist two encoding forms and gas will most likely emit
the wrong one 0x89,0xe5 but Shrinker looks for 0x8b,0xec.

"pushl <imm8>" and "pushl <imm32>":

Make sure gas really emits the 8 bit (0x6A + 1 byte operand) and 32 bit (0x68 +
4 byte operand) immediate pushl forms (by using ".byte ..." as above to be
really sure the opcodes emitted or by choosing proper constants).
Choose your own constants, they serve no particular purpose in Wine.
Shrinker 3.x will later overwrite the "pushl <imm32>" instruction with a long
jump to it's own code.

Regards


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list