CACAO
Functions | Variables
patcher.cpp File Reference

Go to the source code of this file.

Functions

void patcher_patch_code (patchref_t *pr)
 
static int32_t * patch_checked_location (int32_t *p, int32_t val)
 
static void checked_icache_flush (void *addr, int nbytes, int32_t *check_loc)
 
bool patcher_is_valid_trap_instruction_at (void *pc)
 Check if the trap instruction at the given PC is valid. More...
 
static void patch_out_mfence (void *pc)
 Overwrites the MFENCE instruction at the indicated address with a 3-byte NOP. More...
 
bool patcher_resolve_classref_to_classinfo (patchref_t *pr)
 
bool patcher_resolve_classref_to_vftbl (patchref_t *pr)
 
bool patcher_resolve_classref_to_flags (patchref_t *pr)
 
bool patcher_get_putstatic (patchref_t *pr)
 
bool patcher_get_putfield (patchref_t *pr)
 
bool patcher_putfieldconst (patchref_t *pr)
 
bool patcher_invokestatic_special (patchref_t *pr)
 
bool patcher_invokevirtual (patchref_t *pr)
 
bool patcher_invokeinterface (patchref_t *pr)
 
bool patcher_checkcast_interface (patchref_t *pr)
 
bool patcher_instanceof_interface (patchref_t *pr)
 

Variables

patcher_function_list_t patcher_function_list []
 

Function Documentation

static void checked_icache_flush ( void addr,
int  nbytes,
int32_t *  check_loc 
)
static

Definition at line 69 of file patcher.cpp.

static int32_t* patch_checked_location ( int32_t *  p,
int32_t  val 
)
static

Definition at line 60 of file patcher.cpp.

static void patch_out_mfence ( void pc)
static

Overwrites the MFENCE instruction at the indicated address with a 3-byte NOP.

The MFENCE instruction is not allowed to cross a (4-byte) word boundary.

Parameters
pcProgram counter.

Definition at line 97 of file patcher.cpp.

bool patcher_checkcast_interface ( patchref_t pr)

Definition at line 479 of file patcher.cpp.

bool patcher_get_putfield ( patchref_t pr)

Definition at line 283 of file patcher.cpp.

bool patcher_get_putstatic ( patchref_t pr)

Definition at line 239 of file patcher.cpp.

bool patcher_instanceof_interface ( patchref_t pr)

Definition at line 522 of file patcher.cpp.

bool patcher_invokeinterface ( patchref_t pr)

Definition at line 434 of file patcher.cpp.

bool patcher_invokestatic_special ( patchref_t pr)

Definition at line 360 of file patcher.cpp.

bool patcher_invokevirtual ( patchref_t pr)

Definition at line 395 of file patcher.cpp.

bool patcher_is_valid_trap_instruction_at ( void pc)

Check if the trap instruction at the given PC is valid.

Parameters
pcProgram counter.
Returns
true if valid, false otherwise.

Definition at line 82 of file patcher.cpp.

void patcher_patch_code ( patchref_t pr)

Definition at line 54 of file patcher.cpp.

bool patcher_putfieldconst ( patchref_t pr)

Definition at line 321 of file patcher.cpp.

bool patcher_resolve_classref_to_classinfo ( patchref_t pr)

Definition at line 134 of file patcher.cpp.

bool patcher_resolve_classref_to_flags ( patchref_t pr)

Definition at line 199 of file patcher.cpp.

bool patcher_resolve_classref_to_vftbl ( patchref_t pr)

Definition at line 167 of file patcher.cpp.

Variable Documentation

patcher_function_list_t patcher_function_list[]
Initial value:
= {
{ PATCHER_initialize_class, "initialize_class" },
{ PATCHER_resolve_class, "resolve_class" },
{ PATCHER_resolve_classref_to_classinfo, "resolve_classref_to_classinfo"},
{ PATCHER_resolve_classref_to_vftbl, "resolve_classref_to_vftbl"},
{ PATCHER_resolve_classref_to_flags, "resolve_classref_to_flags"},
{ PATCHER_resolve_native_function, "resolve_native_function" },
{ PATCHER_invokestatic_special, "invokestatic_special" },
{ PATCHER_invokevirtual, "invokevirtual" },
{ PATCHER_invokeinterface, "invokeinterface" },
{ PATCHER_breakpoint, "breakpoint" },
{ PATCHER_checkcast_interface, "checkcast_interface" },
{ PATCHER_instanceof_interface, "instanceof_interface" },
{ PATCHER_get_putstatic, "get_putstatic" },
{ PATCHER_get_putfield, "get_putfield" },
{ PATCHER_putfieldconst, "putfieldconst" },
{ NULL, "-UNKNOWN PATCHER FUNCTION-" }
}
#define PATCHER_resolve_classref_to_flags
#define PATCHER_invokeinterface
#define PATCHER_resolve_classref_to_vftbl
#define PATCHER_get_putfield
#define PATCHER_resolve_class
#define PATCHER_putfieldconst
Definition: patcher.hpp:41
#define PATCHER_breakpoint
#define PATCHER_get_putstatic
#define PATCHER_instanceof_interface
#define PATCHER_resolve_native_function
#define PATCHER_checkcast_interface
#define PATCHER_invokestatic_special
#define PATCHER_invokevirtual
#define PATCHER_initialize_class
#define PATCHER_resolve_classref_to_classinfo

Definition at line 562 of file patcher.cpp.