Ejemplo n.º 1
0
R_API int r_core_yank_file_all (RCore *core, const char *input) {
	ut64 adv = 0;
	if (!input) return R_FALSE;
	adv = consume_chars (input, ' ');
	IFDBG eprintf ("Filename: %s\n", input+adv);
	return perform_mapped_file_yank (core, 0, -1, input+adv);
}
Ejemplo n.º 2
0
Archivo: yank.c Proyecto: csarn/radare2
R_API int r_core_yank_file_all(RCore *core, const char *input) {
	ut64 adv = 0;
	if (!input) {
		return false;
	}
	adv = consume_chars (input, ' ');
	return perform_mapped_file_yank (core, 0, -1, input + adv);
}
Ejemplo n.º 3
0
R_API int r_core_yank_file_ex (RCore *core, const char *input) {
	ut64 len = 0, adv = 0, addr = 0;
	int res = R_FALSE;

	if (!input) return res;

	// get the number of bytes to yank
	adv = consume_chars (input, ' ');
	len = r_num_math (core->num, input+adv);
	if (len == 0) {
		eprintf ("ERROR: Number of bytes read must be > 0\n");
		return res;
	}
	// get the addr/offset from in the file we want to read
	adv += find_next_char (input+adv, ' ');
	if (adv == 0) {
		eprintf ("ERROR: Address must be specified\n");
		return res;
	}
	adv++;

	IFDBG eprintf ("Handling the input: %s\n", input+adv);
	// XXX - bug, will fail if address needs to be computed and has spaces
	addr = r_num_math (core->num, input+adv);

	adv += find_next_char (input+adv, ' ');
	if (adv == 0) {
		eprintf ("ERROR: File must be specified\n");
		return res;
	}
	adv++;

	IFDBG eprintf ("Filename: %s\n", input+adv);
	// grab the current file descriptor, so we can reset core and io state
	// after our io op is done
	return perform_mapped_file_yank (core, addr, len, input+adv);
}