OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Implementation of PreamblePatcher | 5 // Implementation of PreamblePatcher |
6 | 6 |
7 #include "sandbox/win/src/sidestep/preamble_patcher.h" | 7 #include "sandbox/win/src/sidestep/preamble_patcher.h" |
8 | 8 |
| 9 #include <stddef.h> |
| 10 |
9 #include "sandbox/win/src/sandbox_nt_util.h" | 11 #include "sandbox/win/src/sandbox_nt_util.h" |
10 #include "sandbox/win/src/sidestep/mini_disassembler.h" | 12 #include "sandbox/win/src/sidestep/mini_disassembler.h" |
11 | 13 |
12 // Definitions of assembly statements we need | 14 // Definitions of assembly statements we need |
13 #define ASM_JMP32REL 0xE9 | 15 #define ASM_JMP32REL 0xE9 |
14 #define ASM_INT3 0xCC | 16 #define ASM_INT3 0xCC |
15 | 17 |
16 namespace { | 18 namespace { |
17 | 19 |
18 // Very basic memcpy. We are copying 4 to 12 bytes most of the time, so there | 20 // Very basic memcpy. We are copying 4 to 12 bytes most of the time, so there |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // stub contains the first stub_size bytes of the original target | 172 // stub contains the first stub_size bytes of the original target |
171 // function's preamble code, followed by a relative jump back to the next | 173 // function's preamble code, followed by a relative jump back to the next |
172 // instruction after the first cbPreamble bytes. | 174 // instruction after the first cbPreamble bytes. |
173 | 175 |
174 return SIDESTEP_SUCCESS; | 176 return SIDESTEP_SUCCESS; |
175 } | 177 } |
176 | 178 |
177 }; // namespace sidestep | 179 }; // namespace sidestep |
178 | 180 |
179 #undef ASSERT | 181 #undef ASSERT |
OLD | NEW |