Wine Error handling questions

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

Wine Error handling questions

Post by malweisse » Wed Sep 18, 2019 4:37 am

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 7
Level 7
Posts: 773
Joined: Thu Aug 14, 2014 10:10 am

Re: Wine Error handling questions

Post by jkfloris » Wed Sep 18, 2019 2:23 pm

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 » Fri Sep 20, 2019 5:53 am

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 » Fri Sep 20, 2019 8:41 am

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

Post Reply