DynamoRIO API
dr_defines.h File Reference

Basic defines and type definitions. More...

#include <windows.h>
#include <winbase.h>
#include <stdarg.h>

Data Structures

struct  opnd_t
 
struct  instr_t
 
union  _dr_xmm_t
 
union  _dr_ymm_t
 
struct  _dr_mcontext_t
 
struct  dr_time_t
 

Macros

#define MAXIMUM_PATH   260
 
#define INVALID_FILE   INVALID_HANDLE_VALUE
 
#define STDOUT   (dr_get_stdout_file())
 
#define STDERR   (dr_get_stderr_file())
 
#define STDIN   (dr_get_stdin_file())
 
#define INVALID_FILE   -1
 
#define STDOUT   our_stdout
 
#define STDERR   our_stderr
 
#define STDIN   our_stdin
 
#define PFX   "0x" PFMT
 
#define PIFX   "0x" PIFMT
 
#define PIDFMT   SZFMT
 
#define TIDFMT   SZFMT
 
#define NUM_SIMD_SLOTS   6
 
#define PRE_XMM_PADDING   16
 
#define DR_NOTE_FIRST_RESERVED   0xfffffffffffffff0ULL
 

Typedefs

typedef size_t app_rva_t
 
typedef uint client_id_t
 
typedef union _dr_xmm_t dr_xmm_t
 
typedef union _dr_ymm_t dr_ymm_t
 
typedef struct _dr_mcontext_t dr_mcontext_t
 

Enumerations

enum  dr_mcontext_flags_t {
  DR_MC_INTEGER = 0x01,
  DR_MC_CONTROL = 0x02,
  DR_MC_MULTIMEDIA = 0x04,
  DR_MC_ALL = (DR_MC_INTEGER | DR_MC_CONTROL | DR_MC_MULTIMEDIA)
}
 

Variables

file_t our_stdout
 
file_t our_stderr
 
file_t our_stdin
 

Detailed Description

Basic defines and type definitions.

Macro Definition Documentation

#define DR_NOTE_FIRST_RESERVED   0xfffffffffffffff0ULL

Upper note values are reserved for core DR.

#define INVALID_FILE   INVALID_HANDLE_VALUE

The sentinel value for an invalid file_t.

#define INVALID_FILE   -1

The sentinel value for an invalid file_t.

#define MAXIMUM_PATH   260

Maximum file path length define meant to replace platform-specific defines such as MAX_PATH and PATH_MAX. Currently, internal stack size limits prevent this from being much larger on UNIX.

#define NUM_SIMD_SLOTS   6

Number of [xy]mm reg slots in dr_mcontext_t

#define PFX   "0x" PFMT

printf format code for pointers

#define PIDFMT   SZFMT

printf format code for process_id_t

#define PIFX   "0x" PIFMT

printf format code for pointer-sized integers

#define PRE_XMM_PADDING   16

Bytes of padding before xmm/ymm dr_mcontext_t slots

#define STDERR   (dr_get_stderr_file())

The file_t value for standard error.

#define STDERR   our_stderr

The file_t value for standard error.

#define STDIN   (dr_get_stdin_file())

The file_t value for standard input.

The file_t value for standard error.

#define STDIN   our_stdin

The file_t value for standard input.

The file_t value for standard error.

#define STDOUT   (dr_get_stdout_file())

The file_t value for standard output.

#define STDOUT   our_stdout

The file_t value for standard output.

#define TIDFMT   SZFMT

printf format code for thread_id_t

Typedef Documentation

typedef size_t app_rva_t

Application offset from module base. PE32+ modules are limited to 2GB, but not ELF x64 med/large code model.

typedef uint client_id_t

ID used to uniquely identify a client. This value is set at client registration and passed to the client in dr_client_main().

typedef struct _dr_mcontext_t dr_mcontext_t

Machine context structure.

typedef union _dr_xmm_t dr_xmm_t

128-bit XMM register.

typedef union _dr_ymm_t dr_ymm_t

256-bit YMM register.

Enumeration Type Documentation

Values for the flags field of dr_mcontext_t

Enumerator
DR_MC_INTEGER 

Selects the xdi, xsi, xbp, xbx, xdx, xcx, xax, and r8-r15 fields (i.e., all of the general-purpose registers excluding xsp, xip, and xflags).

DR_MC_CONTROL 

Selects the xsp, xflags, and xip fields.

Note
: The xip field is only honored as an input for dr_redirect_execution(), and as an output for system call events.
DR_MC_MULTIMEDIA 

Selects the ymm (and xmm) fields. This flag is ignored unless dr_mcontext_xmm_fields_valid() returns true. If dr_mcontext_xmm_fields_valid() returns false, the application values of the multimedia registers remain in the registers themselves.

DR_MC_ALL 

Selects all fields

Variable Documentation

file_t our_stderr

Allow use of stderr after the application closes it.

file_t our_stdin

Allow use of stdin after the application closes it.

file_t our_stdout

Allow use of stdout after the application closes it.