Beispiel #1
0
static void set_sw_breakpoint(struct context *ctx,
			      const struct dbg_request* req)
{
	struct breakpoint* bp = sys_malloc_zero(sizeof(*bp));
	byte* orig_data_ptr;

	assert(sizeof(int_3_insn) == req->mem.len);

	bp->addr = req->mem.addr;

	orig_data_ptr = read_child_data(ctx, 1, bp->addr);
	bp->overwritten_data = *orig_data_ptr;
	sys_free((void**)&orig_data_ptr);

	write_child_data_n(ctx->child_tid,
			   sizeof(int_3_insn), bp->addr, &int_3_insn);

	add_breakpoint(bp);
}
Beispiel #2
0
void memcpy_child(struct context *ctx, void *dest, void *src, int size)
{
	void *tmp = read_child_data(ctx, size, src);
	write_child_data(ctx, size, dest, tmp);
	free(tmp);
}