omm works without args now

This commit is contained in:
pancake 2017-09-23 02:23:26 +02:00
parent b23a987552
commit 86d2c31c37
2 changed files with 7 additions and 3 deletions

View File

@ -80,7 +80,7 @@ static const char *help_msg_om[] = {
"om", " [fd]", "list all defined IO maps for a specific fd",
"om", "-mapid", "remove the map with corresponding id",
"om", " fd vaddr [size] [paddr] [name]", "create new io map",
"omm"," fd", "create default map for given fd. (omm `oq`)",
"omm"," [fd]", "create default map for given fd. (omm `oq`)",
"om.", "", "show map, that is mapped to current offset",
"omn", " mapid [name]", "set/delete name for map with mapid",
"omf", " [mapid] rwx", "change flags/perms for current/given map",
@ -663,8 +663,12 @@ static void cmd_open_map(RCore *core, const char *input) {
break;
case 'm': // "omm"
{
ut64 fd = r_num_math (core->num, input + 3);
ut64 fd = input[3]? r_num_math (core->num, input + 3): UT64_MAX;
RIODesc *desc = r_io_desc_get (core->io, fd);
if (!desc) {
fd = r_io_fd_get_current (core->io);
desc = r_io_desc_get (core->io, fd);
}
if (desc) {
ut64 size = r_io_desc_size (desc);
map = r_io_map_add (core->io, fd, desc->flags, 0, 0, size, true);

View File

@ -209,7 +209,7 @@ R_API bool r_io_desc_resize(RIODesc *desc, ut64 newsize) {
return false;
}
R_API bool r_io_desc_is_blockdevice (RIODesc *desc) {
R_API bool r_io_desc_is_blockdevice(RIODesc *desc) {
if (!desc || !desc->plugin || !desc->plugin->is_blockdevice) {
return false;
}