Chromium Code Reviews| Index: syzygy/core/disassembler_util_unittest_vex_utils.h |
| diff --git a/syzygy/core/disassembler_util_unittest_vex_utils.h b/syzygy/core/disassembler_util_unittest_vex_utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d974544f4d468eb8d003c4f2c00cb92048f7711 |
| --- /dev/null |
| +++ b/syzygy/core/disassembler_util_unittest_vex_utils.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2017 Google Inc. All Rights Reserved. |
| +// |
| +// Licensed under the Apache License, Version 2.0 (the "License"); |
| +// you may not use this file except in compliance with the License. |
| +// You may obtain a copy of the License at |
| +// |
| +// http://www.apache.org/licenses/LICENSE-2.0 |
| +// |
| +// Unless required by applicable law or agreed to in writing, software |
| +// distributed under the License is distributed on an "AS IS" BASIS, |
| +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| +// See the License for the specific language governing permissions and |
| +// limitations under the License. |
| + |
| +#ifndef SYZYGY_CORE_DISASSEMBLER_UTIL_UNITTEST_VEX_UTILS_H_ |
| +#define SYZYGY_CORE_DISASSEMBLER_UTIL_UNITTEST_VEX_UTILS_H_ |
| + |
|
huangs
2017/05/01 18:54:14
#include <stdint.h> for uint8_t.
Sébastien Marchand
2017/05/01 21:19:27
Done.
|
| +#include <vector> |
| + |
| +namespace core { |
| +namespace unittests { |
| + |
| +// Examples of 3-byte VEX instructions that aren't properly handled by Distorm. |
| +extern const std::vector<std::vector<uint8_t>> kVexInstructions; |
| + |
| +// Most of the 3-byte VEX instructions end up with a Mod R/M encoded operand |
| +// and some optional extra bytes (depending on the value of the Mod R/M byte), |
| +// see the comment of core::GetOperandBytesSize. |
| +// |
| +// This is a list of all the 3-byte VEX instruction that we support and all the |
| +// possible variations of the Mod R/M byte, all these instructions have been |
| +// verified in a disassembler. |
| +extern const std::vector<std::vector<uint8_t>> kVexInstructionsModRMVariants; |
| + |
| +} // namespace unittests |
| +} // namespace core |
| + |
| +#endif // SYZYGY_CORE_DISASSEMBLER_UTIL_UNITTEST_VEX_UTILS_H_ |