2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #ifndef incl_HPHP_UTIL_DISASM_H_
17 #define incl_HPHP_UTIL_DISASM_H_
21 #include <xed-interface.h>
33 , m_printEncoding(false)
34 , m_relativeOffset(false)
36 , m_forceAttSyntax(false)
39 Options
& indent(int i
) {
44 Options
& printEncoding(bool pe
) {
49 Options
& relativeOffset(bool re
) {
50 m_relativeOffset
= re
;
54 Options
& color(std::string c
) {
55 m_color
= std::move(c
);
59 Options
& addresses(bool b
) {
64 Options
& forceAttSyntax(bool b
) {
71 bool m_relativeOffset
;
73 bool m_forceAttSyntax
;
77 /* Create a Disasm object. indentLevel spaces will be put at the beginning of
78 * each line of disassembly. If printEncoding is true, the raw hex bytes of
79 * the instructions will also be in the output. */
80 explicit Disasm(const Options
& opts
= Options());
82 Disasm(const Disasm
&) = delete;
83 Disasm
& operator=(const Disasm
&) = delete;
85 /* Disassemble instructions. start should be the first byte of the region to
86 * disassemble and end should be the first byte past the region to
88 void disasm(std::ostream
& out
, uint8_t* start
, uint8_t* end
);
90 static void ExcludedAddressRange(void* low
, size_t len
);
93 xed_state_t m_xedState
;