forked from ZEROWyt/Patchguard-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Except.h
90 lines (79 loc) · 2.29 KB
/
Except.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
*
* Copyright (c) 2015 - 2021 by blindtiger. All rights reserved.
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. SEe the License
* for the specific language governing rights and limitations under the
* License.
*
* The Initial Developer of the Original Code is blindtiger.
*
*/
#ifndef _EXCEPT_H_
#define _EXCEPT_H_
#include "Reload.h"
#ifdef __cplusplus
/* Assume byte packing throughout */
extern "C" {
#endif /* __cplusplus */
void
NTAPI
CaptureImageExceptionValues(
__in ptr Base,
__out ptr * FunctionTable,
__out u32ptr TableSize
);
void
NTAPI
InitializeExcept(
__inout PRTB Block
);
#ifndef _WIN64
typedef struct _DISPATCHER_CONTEXT {
PEXCEPTION_REGISTRATION_RECORD RegistrationPointer;
} DISPATCHER_CONTEXT;
#else
void
NTAPI
InsertInvertedFunctionTable(
__in ptr ImageBase,
__in u32 SizeOfImage
);
void
NTAPI
RemoveInvertedFunctionTable(
__in ptr ImageBase
);
PRUNTIME_FUNCTION
NTAPI
UnwindPrologue(
__in u64 ImageBase,
__in u64 ControlPc,
__in u64 FrameBase,
__in PRUNTIME_FUNCTION FunctionEntry,
__inout PCONTEXT ContextRecord,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers
);
PEXCEPTION_ROUTINE
NTAPI
VirtualUnwind(
__in u32 HandlerType,
__in u64 ImageBase,
__in u64 ControlPc,
__in PRUNTIME_FUNCTION FunctionEntry,
__inout PCONTEXT ContextRecord,
__out ptr * HandlerData,
__out u64ptr EstablisherFrame,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers
);
#endif // !_WIN64
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // !_EXCEPT_H_