Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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 // This transform redirects the '__report_gsfailure' function to | |
| 16 // the following assembly stub: 'mov [deadbeef], 0'. | |
| 17 // The function __report_gsfailure raises an exception that an EH | |
| 18 // cannot intercept (for security reasons); this transform allows | |
| 19 // an EH to catch the GS failures. | |
| 20 | |
| 21 #ifndef SYZYGY_INSTRUMENT_TRANSFORMS_SECURITY_COOKIE_CHECK_HOOK_TRANSFORM_H_ | |
| 22 #define SYZYGY_INSTRUMENT_TRANSFORMS_SECURITY_COOKIE_CHECK_HOOK_TRANSFORM_H_ | |
| 23 | |
| 24 #include "base/logging.h" | |
| 25 #include "syzygy/block_graph/basic_block_assembler.h" | |
| 26 #include "syzygy/block_graph/basic_block_subgraph.h" | |
| 27 #include "syzygy/block_graph/block_builder.h" | |
| 28 #include "syzygy/block_graph/transform_policy.h" | |
| 29 #include "syzygy/block_graph/transforms/named_transform.h" | |
| 30 | |
| 31 namespace instrument { | |
| 32 namespace transforms { | |
| 33 | |
| 34 typedef block_graph::BlockGraph BlockGraph; | |
| 35 typedef block_graph::BasicBlockSubGraph BasicBlockSubGraph; | |
| 36 typedef block_graph::TransformPolicyInterface TransformPolicyInterface; | |
| 37 typedef block_graph::BasicCodeBlock BasicCodeBlock; | |
| 38 typedef block_graph::BasicBlockAssembler BasicBlockAssembler; | |
| 39 typedef block_graph::BlockBuilder BlockBuilder; | |
|
chrisha
2017/05/09 19:18:40
nit: We have a tendency to keep such typedefs in a
| |
| 40 | |
| 41 class SecurityCookieCheckHookTransform : | |
| 42 public block_graph::transforms::NamedBlockGraphTransformImpl< | |
|
chrisha
2017/05/09 19:18:40
Bring the : to the next line and indent +4:
class
| |
| 43 SecurityCookieCheckHookTransform> { | |
| 44 | |
| 45 public: | |
|
chrisha
2017/05/09 19:18:40
Indent +1
| |
| 46 SecurityCookieCheckHookTransform() { } | |
|
chrisha
2017/05/09 19:18:40
No spaces in curly braces: {}
| |
| 47 | |
| 48 static const char kTransformName[]; | |
| 49 | |
| 50 // BlockGraphTransformInterface Implementation | |
|
chrisha
2017/05/09 19:18:40
ubernit: s/Implementation/implementation./
| |
| 51 bool TransformBlockGraph(const TransformPolicyInterface* policy, | |
| 52 BlockGraph* block_graph, | |
|
chrisha
2017/05/09 19:18:40
Align these two lines with 'const'.
| |
| 53 BlockGraph::Block* header_block) final; | |
| 54 | |
| 55 }; | |
| 56 | |
| 57 } // namespace transforms | |
| 58 } // namespace instrument | |
| 59 | |
| 60 #endif // SYZYGY_INSTRUMENT_TRANSFORMS_SECURITY_COOKIE_CHECK_HOOK_TRANSFORM_H_ | |
| OLD | NEW |