Image Has Safe Exception Handlers is no supported

c++ / delphi package - dll injection and api hooking
Post Reply
TCS
Posts: 33
Joined: Tue Aug 19, 2014 8:58 pm

Image Has Safe Exception Handlers is no supported

Post by TCS »

Hey,

When linking to MadCodeHook binaries with VS2013 (I guess it also happens in earlier versions), the linker fails because safe exception Handling is no supported in the MadCodeHook lib (/SAFESEH option http://msdn.microsoft.com/en-us/library/9a89h429.aspx).
It is possible to add this feature quite easily by recompiling MadCodeHook with a newer version of CRT (or newer visual studio...)
choochy2003
Posts: 88
Joined: Fri Mar 21, 2008 4:52 am
Location: Adelaide, South Australia
Contact:

Re: Image Has Safe Exception Handlers is no supported

Post by choochy2003 »

I spoke with Mathias a while back about this and he mentioned that this can not be enabled for the 32bit static lib, because the 32bit static lib is still based on the Delphi source code. Delphi still does not support enabling of SafeSEH for 32 bit binaries. Although, I do have information from EMBT that they are looking into its support in future compiler releases.
TCS
Posts: 33
Joined: Tue Aug 19, 2014 8:58 pm

Re: Image Has Safe Exception Handlers is no supported

Post by TCS »

Okay, thanks!
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: Image Has Safe Exception Handlers is no supported

Post by _NN_ »

Is there any improvement since 2014 here ?
Currently I get:
1>madCHook32.lib(madCHook.obj) : error LNK2026: module unsafe for SAFESEH image.
SafeSEH is something that is mandatory by several clients same way as ASLR.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Image Has Safe Exception Handlers is no supported

Post by madshi »

The Delphi based static lib doesn't support SafeSEH, but I suppose compiling the C++ code base to create a 32bit static lib should work. No complaints with 64bit, right?
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: Image Has Safe Exception Handlers is no supported

Post by _NN_ »

SafeSEH flag is irrelevant for 64-bit since SEH in 64-bit is already table based.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Image Has Safe Exception Handlers is no supported

Post by madshi »

Ah yes. Hmmmm... So anyway, I think using the C++ sources it should probably be possible to create a SafeSEH compatible 32bit static lib.
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: Image Has Safe Exception Handlers is no supported

Post by _NN_ »

Can you compile lib using C++ and add it to madchook package?
Thanks
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Image Has Safe Exception Handlers is no supported

Post by madshi »

Yes, that should be possible.
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: Image Has Safe Exception Handlers is no supported

Post by _NN_ »

That would be great ! :greenBalloon:
Waiting for an update.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Image Has Safe Exception Handlers is no supported

Post by madshi »

C++ based static libs in the latest test build now:

http://madshi.net/madCollectionBeta.exe
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: Image Has Safe Exception Handlers is no supported

Post by _NN_ »

Not Found
The requested URL /madCollectionBeta.exe was not found on this server.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Image Has Safe Exception Handlers is no supported

Post by madshi »

Ooops, sorry. Should work now.
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: Image Has Safe Exception Handlers is no supported

Post by _NN_ »

Thanks.
C++ library compiles with SafeSEH.
Post Reply