среда, 26 июня 2024 г.

EHsc

EH_prolog ASM

https://github.com/Chuyu-Team/VC-LTL/blob/master/src/14.21.27702/i386/ehprolog.asm


/EH msdn

https://learn.microsoft.com/ru-ru/cpp/build/reference/eh-exception-handling-model?view=msvc-170


/EHa howto

https://ru.stackoverflow.com/questions/933731/%D0%97%D0%B0%D1%87%D0%B5%D0%BC-%D0%BD%D1%83%D0%B6%D0%B5%D0%BD-%D1%84%D0%BB%D0%B0%D0%B3-ehsc-%D0%B4%D0%BB%D1%8F-msvc-%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%82%D0%BE%D1%80%D0%B0


CLang SEH bug and example

https://github.com/llvm/llvm-project/issues/62606


/guard:ehcont

The feature is supported for 64-bit processes on a 64-bit OS.

https://learn.microsoft.com/en-us/cpp/build/reference/guard-enable-eh-continuation-metadata?view=msvc-170


https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/

https://devblogs.microsoft.com/oldnewthing/20100730-00/?p=13273


Bug in /EHa

https://developercommunity.visualstudio.com/t/seh-exceptions-eha-can-break-expected-c11-noexcept/1610906


https://developercommunity.visualstudio.com/t/seh-exceptions-eha-can-break-expected-c11-noexcept/1610906


Big boook

https://www.sciencedirect.com/topics/computer-science/segment-descriptor

https://www.sciencedirect.com/book/9781597494861/a-guide-to-kernel-exploitation


x64 prolog and epilog

https://learn.microsoft.com/en-us/cpp/build/prolog-and-epilog?view=msvc-170


https://www.openrce.org/articles/full_view/21


Instead of emitting the code for setting up the stack frame in the function body, the compiler might choose to call specific prolog and epilog functions instead. There are several variants, each used for specific function type:


Name Type EH Cookie GS Cookie Catch Handlers

_SEH_prolog/_SEH_epilog SEH3 - -
_SEH_prolog4/_SEH_epilog4 S EH4 + -
_SEH_prolog4_GS/_SEH_epilog4_GS SEH4 + +
_EH_prolog C++ EH - - +/-
_EH_prolog3/_EH_epilog3 C++ EH + - -
_EH_prolog3_catch/_EH_epilog3 C++ EH + - +
_EH_prolog3_GS/_EH_epilog3_GS C++ EH + + -
_EH_prolog3_catch_GS/_EH_epilog3_catch_GS C++ EH + + +




https://m0chan.github.io/2019/08/21/Win32-Buffer-Overflow-SEH.html


https://www.corelan.be/index.php/2009/09/21/exploit-writing-tutorial-part-6-bypassing-stack-cookies-safeseh-hw-dep-and-aslr/

https://www.corelan.be/index.php/2009/07/25/writing-buffer-overflow-exploits-a-quick-and-basic-tutorial-part-3-seh/


https://stackoverflow.com/questions/14175476/exception-handler-doesnt-call-destructors-when-catching-seh-exception


https://www.codeproject.com/Articles/2126/How-a-C-compiler-implements-exception-handling


http://msdn.microsoft.com/en-us/library/1deeycx5.aspx

https://learn.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-170&redirectedfrom=MSDN


https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/windows-seh-and-c-exception-handling-r1291/


https://www.gamedev.net/reference/articles/article1272.asp


 

Комментариев нет:

Отправить комментарий