Re: C++ exceptions on 32-bit Windows

  • From: Mike Pall <mike-1409@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 3 Sep 2014 20:38:28 +0200

Daurnimator wrote:
> Can we get SEH now? :D

I don't think so. The problem is the assembler code can't rely on
a C++ compiler to do this. Which means one needs to reimplement
SEH handling, but in a way that's compatible with various versions
of Windows and various versions of MSVC.

Ok, so you'll need to dig deep inside the MSVCRT DLLs to find all
of these details and test it on lots of OS/compiler combinations.
Only to find out that AFAIK all newer versions of Windows block
any attempt at subverting SEH handling, because this has been
extensively abused by malware. I'm not sure you can even implement
this outside of a DLL signed by Microsoft nowadays. And even if
you find a way, the resulting executable might be flagged as
malware by heuristic analysis tools.

But if you still want to have a go ... good luck!

[Note we're only talking about Win32 SEH. Win64 exception handling
is data-driven, compiler-independent and documented. It has little
in common with the original meaning of 'SEH' from a technical
point of view -- it has simply inherited the name.]

--Mike

Other related posts: