Wine Error handling questions

Questions about Wine on Linux
Locked
malweisse
Newbie
Newbie
Posts: 3
Joined: Wed Sep 18, 2019 4:25 am

Wine Error handling questions

Post by malweisse »

Hi you all!
I'm doing Win32 DBI on Linux running Wine in a custom version of usermode QEMU
and I have several questions about error handling in Wine.

I need to disable the window (screenshot attached) that reports faults and let the program crash like any Linux binary.
There is an option that disable such window or I need to patch Wine?

Also, I want to hook functions used to report assertion errors that need user interaction without a real motivation,
like MessageBoxA, can i hook them with something similar to the ELF LD_PRELOAD?

(bonus OT question: how safe is to disable the preloader? it seems to work on Ubuntu 18.04 w/o problems).

Regards,
Andrea
Attachments
Screenshot at 2019-09-18 11-35-52.png
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Wine Error handling questions

Post by jkfloris »

I need to disable the window (screenshot attached) that reports faults and let the program crash like any Linux binary.
There is an option that disable such window or I need to patch Wine?

Code: Select all

winetricks autostart_winedbg=disable
Does this work?
malweisse
Newbie
Newbie
Posts: 3
Joined: Wed Sep 18, 2019 4:25 am

Re: Wine Error handling questions

Post by malweisse »

Yeah thank you,
this disable the debugger window but do not let the program to crash.

$ wine ./djpeg.exe /home/andrea/Desktop/jpegfuzz/www/queue/id\:000001\,src\:000000\,time\:2908\,op\:havoc\,rep\:2\,+cov
wine: Unhandled page fault on write access to 0x00001c00 at address 0x241674 (thread 0009), starting debugger...
0009:err:seh:start_debugger Couldn't start debugger ("false") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
andrea@malweisse:~/Desktop/jpegfuzz$ echo $?
5

Probably wine uses self-ptrace by default and I have to investigate in the code.
malweisse
Newbie
Newbie
Posts: 3
Joined: Wed Sep 18, 2019 4:25 am

Re: Wine Error handling questions

Post by malweisse »

Ok thank you I solved disabling sigation.
ntdll uses sigation for the excetion handling and preloading it with an empty function solves my first problem.
(https://github.com/andreafioraldi/WineAFLplusplusDEMO if you are curious).

Regards the second, my current idea is to patch the PE file to include an additional DLL with high priority that implements
and empty MessageBoxA function but this is ugly and a most viable solution (like LD_PRELOAD) is well accepted :)

Regards,
Andrea
Locked