1 : // Copyright 2015 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : //
15 : // Defines the Asan Hot Patching CRT interceptors.
16 : //
17 : // Hot Patching Asan transformed links modules against these functions
18 : // instead of the CRT ones. When hot patching is inactive, these functions
19 : // call the respective system functions.
20 : // TODO(cseri): When hot patching Asan mode is activated, the import entries
21 : // of these functions must be overwritten to call the respective functions
22 : // from the SyzyAsan runtime library.
23 : #ifndef SYZYGY_AGENT_ASAN_HP_CRT_INTERCEPTORS_H_
24 : #define SYZYGY_AGENT_ASAN_HP_CRT_INTERCEPTORS_H_
25 :
26 : // Exposes the CRT interceptors.
27 m : extern "C" {
28 :
29 m : const void* __cdecl hp_asan_memchr(const unsigned char* ptr,
30 m : int value,
31 m : size_t num);
32 :
33 m : void* __cdecl hp_asan_memcpy(unsigned char* destination,
34 m : const unsigned char* source,
35 m : size_t num);
36 :
37 m : void* __cdecl hp_asan_memmove(unsigned char* destination,
38 m : const unsigned char* source,
39 m : size_t num);
40 :
41 m : void* __cdecl hp_asan_memset(unsigned char* ptr, int value, size_t num);
42 :
43 m : int __cdecl hp_asan_strcmp(const char* str1, const char* str2);
44 :
45 m : size_t __cdecl hp_asan_strcspn(const char* str1, const char* str2);
46 :
47 m : size_t __cdecl hp_asan_strlen(const char* str);
48 :
49 m : char* __cdecl hp_asan_strncat(char* destination,
50 m : const char* source,
51 m : size_t num);
52 :
53 m : char* __cdecl hp_asan_strncpy(char* destination,
54 m : const char* source,
55 m : size_t num);
56 :
57 m : const char* __cdecl hp_asan_strpbrk(const char* str1, const char* str2);
58 :
59 m : const char* __cdecl hp_asan_strrchr(const char* str, int character);
60 :
61 m : size_t __cdecl hp_asan_strspn(const char* str1, const char* str2);
62 :
63 m : const char* __cdecl hp_asan_strstr(const char* str1, const char* str2);
64 :
65 m : const wchar_t* hp_asan_wcschr(const wchar_t* str, wchar_t character);
66 :
67 m : const wchar_t* hp_asan_wcsrchr(const wchar_t* str, wchar_t character);
68 :
69 m : const wchar_t* hp_asan_wcsstr(const wchar_t* str, const wchar_t* keys);
70 :
71 m : } // extern "C"
72 :
73 : #endif // SYZYGY_AGENT_ASAN_HP_CRT_INTERCEPTORS_H_
|