calls to int 3d corrupt the stack
Sylvain Petreolle
spetreolle at yahoo.fr
Sun Aug 17 03:39:09 CDT 2003
> Can you tell me the addresses in the IP register at the time of call
and
> return to the program? I must have either miscalculated the backup
or failed
> to account to movement between memory segments. Skipping the code
> works with the fwait, however, the other FPU instructions will not be
that easy
> to handle.
After doing some winedbg work, it appears that :
- my call appears at 0x36f:0xc and should return at 0x36f:0xe
Wine-dbg>disass 0x36f:0xc
0x036f:0x0000000c: int $0x3d
0x036f:0x0000000e: movw 0xfffffffc(%bp),%ax
0x036f:0x00000011: movw 0xfffffffe(%bp),%dx
0x036f:0x00000014: leave
0x036f:0x00000015: ret $0x4
after setting a breakpoint on DOSVM_Int3dHandler, I see that your
calculated code variable points to another place (if I am right ;))
192 FPU_ModifyCode(context, 0x90);
Wine-dbg>step
225 WORD *stack = CTX_SEG_OFF_TO_LIN(context, context->SegSs,
context->Esp);
Wine-dbg>
224 {
Wine-dbg>
225 WORD *stack = CTX_SEG_OFF_TO_LIN(context, context->SegSs,
context->Esp);
Wine-dbg>
226 BYTE *code = CTX_SEG_OFF_TO_LIN(context, stack[1],
stack[0]);
Wine-dbg>
232 code[-2] = 0x9b; /* The fwait instruction */
Wine-dbg>disass code-2
0x000d0b51: addb $0,%al
0x000d0b53: int $0x31
0x000d0b55: sti
0x000d0b56: lret
One things appears strange to me : you use a WORD pointer for the
stack.
Shouldnt it be a DWORD pointer, since real mode uses dword stack ?
> >
> God Bless You,
> --Robert 'Admiral' Coeyman
=====
Sylvain Petreolle (spetreolle_at_users_dot_sourceforge_dot_net)
ICQ #170597259
alias upsf='false ; while [ $? -ne 0 ] ; do cvs update -APd ; done 2>&1 |tee cvslog'
"What if tomorrow the War could be over ?" Morpheus, in "Reloaded".
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
More information about the wine-devel
mailing list