llvm-project/compiler-rt/lib/interception
Etienne Bergeron 3ac879f9a6 Add missing decoding patterns toRoundUpToInstrBoundary
Summary:
The RoundUpToInstrBoundary determines intructions boundary and it's used to determine how to patch (intercept) functions.

The current x64-bit implementation is incomplete. This patch is adding patterns observed when trying to sanitize a 64-bit executable on my computer.

Thw two current functions not intercepted are:
```
RaiseExceptionStub:
000000007720C3B0 EB 06                jmp         RaiseException (07720C3B8h)  
000000007720C3B2 90                   nop  
000000007720C3B3 90                   nop  
000000007720C3B4 90                   nop  
000000007720C3B5 90                   nop  
000000007720C3B6 90                   nop  
000000007720C3B7 90                   nop  
RaiseException:
000000007720C3B8 FF 25 3A 18 09 00    jmp         qword ptr [__imp_RaiseException (07729DBF8h)]  
000000007720C3BE 8B 44 24 54          mov         eax,dword ptr [rsp+54h]  
000000007720C3C2 85 C0                test        eax,eax  
000000007720C3C4 0F 84 F5 05 00 00    je          Wow64NtCreateKey+12Fh (07720C9BFh)  
```

```
CreateThreadStub:
0000000077215A10 48 83 EC 48          sub         rsp,48h  
0000000077215A14 48 8B 44 24 78       mov         rax,qword ptr [rsp+78h]  
0000000077215A19 48 89 44 24 38       mov         qword ptr [rsp+38h],rax  
0000000077215A1E 8B 44 24 70          mov         eax,dword ptr [rsp+70h]  
```

Reviewers: rnk

Subscribers: wang0109, chrisha

Differential Revision: http://reviews.llvm.org/D21519

llvm-svn: 273176
2016-06-20 18:00:03 +00:00
..
.clang-format Tell clang-format that (most) sanitizers are written using Google style guide. 2015-11-19 22:11:10 +00:00
CMakeLists.txt [cmake] Address Samsonov's post-commit review of r262723 2016-03-05 10:01:04 +00:00
interception.h [ASan] NFC: Factor out platform-specific interceptors 2015-03-16 14:22:53 +00:00
interception_linux.cc [sanitizer] Interception macros for sanitizers on FreeBSD; patch by Viktor Kutuzov 2014-02-24 08:37:41 +00:00
interception_linux.h [asan] Versioned interceptor for pthread_create. 2015-09-22 21:34:44 +00:00
interception_mac.cc [ASan] Delete the code related to static runtime on OS X. 2013-02-05 15:57:12 +00:00
interception_mac.h Make some pthread_mutex_* and pthread_cond_* interceptors common. 2013-10-16 08:20:31 +00:00
interception_type_test.cc PR16532: work around old GCC bug in interception_type_test.cc 2013-12-05 13:29:46 +00:00
interception_win.cc Add missing decoding patterns toRoundUpToInstrBoundary 2016-06-20 18:00:03 +00:00
interception_win.h [asan] Intercept all Heap* related imports from ucrtbase.dll 2016-03-24 20:19:48 +00:00