ReactOS 0.4.16-dev-91-g764881a
gcc_ssp.c
Go to the documentation of this file.
1
2#ifdef _GCC_SSP_MSVCRT_
3
4#include <windef.h>
5#include <winbase.h>
6#include <stdio.h>
7
8#define print_caller() do { \
9 char buffer[64]; \
10 _snprintf(buffer, sizeof(buffer), "STACK PROTECTOR FAULT AT %p\n", __builtin_extract_return_addr(__builtin_return_address (0))); \
11 OutputDebugStringA(buffer); \
12} while(0)
13
14#elif defined(_GCC_SSP_WIN32K_)
15
16#include <windef.h>
17#include <wingdi.h>
18#include <winddi.h>
19#include <stdarg.h>
20
21static inline
22void
23print_caller_helper(char* fmt, ...)
24{
26
29 va_end(args);
30}
31
32#define print_caller() print_caller_helper("STACK PROTECTOR FAULT AT %p\n", __builtin_extract_return_addr(__builtin_return_address(0)))
33
34#elif defined(_GCC_SSP_SCSIPORT_)
35
36#include <ntddk.h>
37#include <srb.h>
38
39#define print_caller() ScsiDebugPrint(0, "STACK PROTECTOR FAULT AT %p\n", __builtin_extract_return_addr(__builtin_return_address(0)))
40
41#elif defined(_GCC_SSP_VIDEOPRT_)
42
43#include <ntdef.h>
44#include <miniport.h>
45#include <video.h>
46
47#define print_caller() VideoPortDebugPrint(0, "STACK PROTECTOR FAULT AT %p\n", __builtin_extract_return_addr(__builtin_return_address(0)))
48
49#else
50
51#include <ntdef.h>
52#include <debug.h>
53
54#define print_caller() DbgPrint("STACK PROTECTOR FAULT AT %p\n", __builtin_extract_return_addr(__builtin_return_address(0)))
55
56#endif
57
58/* Should be random :-/ */
59void * __stack_chk_guard = (void*)0xb00fbeefbaafb00f;
60
62{
64 __asm__("int $3");
65}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
void * __stack_chk_guard
Definition: gcc_ssp.c:59
#define print_caller()
Definition: gcc_ssp.c:54
void __stack_chk_fail()
Definition: gcc_ssp.c:61
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
#define args
Definition: format.c:66
Definition: match.c:390
Definition: dsound.c:943
ENGAPI VOID APIENTRY EngDebugPrint(_In_z_ PCHAR StandardPrefix, _In_z_ PCHAR DebugMessage, _In_ va_list ap)
Definition: debug.c:19