Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: syzygy/core/disassembler_util_unittest_vex_utils.h

Issue 2841863003: Improve the decoding of the VEX encoded instructions. (Closed)
Patch Set: nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « syzygy/core/disassembler_util_unittest.cc ('k') | syzygy/core/disassembler_util_unittest_vex_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4442edac7d1b28fef1eb1b9b4122facd84697c5b
--- /dev/null
+++ b/syzygy/core/disassembler_util_unittest_vex_utils.h
@@ -0,0 +1,40 @@
+// 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_
+
+#include <stdint.h>
+
+#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_
« no previous file with comments | « syzygy/core/disassembler_util_unittest.cc ('k') | syzygy/core/disassembler_util_unittest_vex_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698