Questions tagged [seh]

Microsoft Structured Exception Handling (SEH) is the native exception handling mechanism for Windows.

Microsoft Structured Exception Handling (SEH) is the native exception handling mechanism for Windows.

177 questions
1
vote
1 answer

How do I modify the instruction pointer from a handler function in Windows/MASM?

I want to use an exception/trap handler from assembly, but I don't know how to actually modify the context of the offending frame. My code: _TEXT segment para 'CODE' MyHandler proc call printout ret MyHandler endp public…
Badasahog
  • 579
  • 2
  • 19
1
vote
2 answers

Does SEH make stores/writes more expensive?

I'm comparing two different methods of buffer checking. The first method is to check on every iteration if the end of the buffer has been reached, and the second method is to use a guard page to detect the end. While the guard page method should in…
Badasahog
  • 579
  • 2
  • 19
1
vote
0 answers

Is it possible to wrap both for regular exception and SEH exceptions

I have a native C++ library and a SWIG-generated wrapper for C#. the .i file contains an %exception that wraps all the $actions inside regular try/catchblocks to convert exceptions to our desired target C# exceptions using…
Armen Tsirunyan
  • 130,161
  • 59
  • 324
  • 434
1
vote
0 answers

COMGLB_EXCEPTION_DONOT_HANDLE_ANY does not always work for unhandled C++ exceptions

TL;DR (Visual Studio 2019, Windows 10 (so far tested on 1809LTSC, because this is my dev machine) We have an out-of-process COM server We set COMGLB_EXCEPTION_DONOT_HANDLE_ANY "Fatal" SEH exceptions are handled OK. "Non-Fatal" SEH exceptions, among…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
1
vote
0 answers

How to debug dotnet core program terminating with uncaught exception of type PAL_SEHException

I'm testing how my dotnet core application behaves on no internet connection. The program always crash with libc++abi.dylib: terminating with uncaught exception of type PAL_SEHException I tried to find what command is triggering it but could not…
Mugen
  • 8,301
  • 10
  • 62
  • 140
1
vote
0 answers

Is it possible to view the seh chain for a particular process using C#

Is it possible to get the SEH chain for a particular process using C# and if so can you point me to an explanation of how to do so?
BobHaginab
  • 43
  • 6
1
vote
1 answer

Golang CGO Exception 0x40010006

Im trying to run a function from a dll using cgo. The library is in c++ so I created a C header here are the functions defined and a .cpp file where is the implementation. lib.h: #ifdef __cplusplus extern "C" { #endif void*…
microo8
  • 3,568
  • 5
  • 37
  • 67
1
vote
1 answer

Overwriting stack exception handler (SEH) in buffer overflow / Assembly MOV

I am trying to follow along an explanation of bypassing stack cookies by overwriting the stack exception handler (SEH) located here:…
ansonl
  • 786
  • 1
  • 13
  • 34
1
vote
2 answers

How can I catch an invalid fgetpos call as a C++ exception on Windows?

In Visual C++ 2008, I want to "catch" an exception generated as shown here: try { int foo = 20; ::fgetpos(0, (fpos_t*)&foo); } //... Here are adjustments I've made to attempt a successful catch: SEH is activated (/eha) I've added a…
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
1
vote
2 answers

How do I interpret GetExceptionCode results when using SEH?

I have been trying to write some error-protection clauses for identifying problems in a dll which is provided to us by an third party. There may be problems in this dll (memory exceptions, floating point errors, etc), and it is advantageous to be…
Mike Sadler
  • 1,750
  • 1
  • 20
  • 37
1
vote
1 answer

C++ SEH - correlation between EXCEPTION_DISPOSITION enum and __except() filter expressions

I'm currently reading about the Structured Exception Handling (SEH) mechanism and doing some exercises in C++. One of the things which I don't understand is - In excpt.h file there are two important definitions "groups": The definition of…
golosovsky
  • 638
  • 1
  • 6
  • 19
1
vote
0 answers

Why are the SEH versions of libstdc++ needed by the SJLJ version of SFML?

I am cross-compiling an SFML application from a Linux host to a Windows guest. I downloaded the SJLJ 64-bit version of SFML and compiled/linked with x86_64-w64-mingw32-g++ and the -static, -static-libgcc, and -static-libstdc++ options. I still…
John P
  • 1,463
  • 3
  • 19
  • 39
1
vote
0 answers

For mixed unmanaged and managed C++ code do we need to be compiling with /EHa exception handling? What is the default?

We have a process with mixed /clr (managed) code and unmanaged code and we're trying to determine what exception handling model to use. I think we (might?) need to be using /EHa. Right now we're specifying…
PerryC
  • 1,233
  • 2
  • 12
  • 28
1
vote
2 answers

Imitation of hardware exceptions

Can anyone tell me a code for next function, which raises EXCEPTION_FLT_STACK_CHECK or EXCEPTION_BREAKPOINT, for I could catch them in main func: int _tmain(int argc, _TCHAR* argv[]) { __try { FaultingStack(); // What I need to…
zabulus
  • 2,373
  • 3
  • 15
  • 27
1
vote
0 answers

SEH dump using Peach Fuzzer

How useful is Peach Fuzzer for testing SEH overwrites? Is there any option to include SEH dump in Windbg logs with peach when a crash occurs?
Vicky
  • 1,657
  • 6
  • 23
  • 33