OLD | NEW |
(Empty) | |
| 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 // Declares the flummox instrumenter. |
| 16 |
| 17 #ifndef SYZYGY_INSTRUMENT_INSTRUMENTERS_FLUMMOX_INSTRUMENTER_H_ |
| 18 #define SYZYGY_INSTRUMENT_INSTRUMENTERS_FLUMMOX_INSTRUMENTER_H_ |
| 19 |
| 20 #include <set> |
| 21 #include <string> |
| 22 |
| 23 #include "base/command_line.h" |
| 24 #include "base/macros.h" |
| 25 #include "base/files/file_path.h" |
| 26 #include "base/memory/scoped_ptr.h" |
| 27 #include "syzygy/instrument/instrumenters/instrumenter_with_relinker.h" |
| 28 #include "syzygy/experimental/protect/protect_lib/integrity_check_transform.h" |
| 29 #include "syzygy/experimental/protect/protect_lib/integrity_check_layout_transfo
rm.h" |
| 30 #include "syzygy/experimental/protect/protect_lib/protect_utils.h" |
| 31 |
| 32 namespace protect { |
| 33 |
| 34 typedef instrument::instrumenters::InstrumenterWithRelinker InstrumenterWithReli
nker; |
| 35 |
| 36 class CustomFlummoxInstrumenter : public InstrumenterWithRelinker { |
| 37 public: |
| 38 typedef InstrumenterWithRelinker Super; |
| 39 |
| 40 CustomFlummoxInstrumenter() { } |
| 41 virtual ~CustomFlummoxInstrumenter() { } |
| 42 |
| 43 protected: |
| 44 bool ParseFromJSON(); |
| 45 |
| 46 // @name InstrumenterWithRelinker overrides. |
| 47 // @{ |
| 48 bool InstrumentPrepare() override; |
| 49 bool InstrumentImpl() override; |
| 50 const char* InstrumentationMode() override { return "protect_flummox"; } |
| 51 bool DoCommandLineParse(const base::CommandLine* command_line) override; |
| 52 // @} |
| 53 |
| 54 // @name Command-line parameters. |
| 55 // @{ |
| 56 base::FilePath flummox_config_path_; |
| 57 // @} |
| 58 |
| 59 FlummoxConfig config_; |
| 60 |
| 61 // The main transformer. |
| 62 scoped_ptr<protect::IntegrityCheckTransform> flummox_transform_; |
| 63 scoped_ptr<protect::IntegrityCheckLayoutTransform> layout_transform_; |
| 64 |
| 65 private: |
| 66 DISALLOW_COPY_AND_ASSIGN(CustomFlummoxInstrumenter); |
| 67 }; |
| 68 |
| 69 } // namespace protect |
| 70 |
| 71 #endif // SYZYGY_INSTRUMENT_INSTRUMENTERS_FLUMMOX_INSTRUMENTER_H_ |
OLD | NEW |