-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Print log messages if inserting of description fails. * Port V command to RzShell * Port v (panels) commands to RzShell and drop vi. Drops the vi command for two reasons: - vi (open file in editor) is not at all related to the visual mode. Hence shouldn't be in the same group. - (Opinionated) Users can just open the file in another terminal window. Why go the extra way over Rizin? Replace old command names with something more descriptive. - v [name] -> vl name - v= -> vs * Fix return values * Add missing space before V command. * Split up V and v files to allow for definitino of Vp and Vpp commands * Restructure help for visual mode. Add VH and VHH for key list in the visual mode. Remove examples, but add a more detailed description about the key-sequence parameter.
- Loading branch information
Showing
17 changed files
with
488 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-FileCopyrightText: 2024 Rot127 <[email protected]> | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
#include <rz_cmd.h> | ||
#include <rz_type.h> | ||
#include <rz_util/rz_assert.h> | ||
#include <rz_util/rz_log.h> | ||
#include <rz_util/rz_panels.h> | ||
|
||
#include "../core_private.h" | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_visual_handler(RzCore *core, int argc, const char **argv) { | ||
if (core->http_up) { | ||
RZ_LOG_ERROR("core->http_up=false.\n"); | ||
return RZ_CMD_STATUS_ERROR; | ||
} | ||
if (!rz_cons_is_interactive()) { | ||
RZ_LOG_ERROR("Visual mode requires scr.interactive=true.\n"); | ||
return RZ_CMD_STATUS_ERROR; | ||
} | ||
const char *v_commands = argc > 1 ? argv[1] : ""; | ||
rz_core_visual(core, v_commands); | ||
return RZ_CMD_STATUS_OK; | ||
} | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_visual_disas_handler(RzCore *core, int argc, const char **argv) { | ||
rz_core_visual(core, "p"); | ||
return RZ_CMD_STATUS_OK; | ||
} | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_visual_emu_handler(RzCore *core, int argc, const char **argv) { | ||
rz_core_visual(core, "pp"); | ||
return RZ_CMD_STATUS_OK; | ||
} | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_visual_help_handler(RzCore *core, int argc, const char **argv) { | ||
rz_core_cmd_help(core, rz_core_visual_get_short_help()); | ||
return RZ_CMD_STATUS_OK; | ||
} | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_visual_help_detail_handler(RzCore *core, int argc, const char **argv) { | ||
rz_core_cmd_help(core, rz_core_visual_get_long_help()); | ||
rz_cons_printf("%s\n", "Function Keys: (See 'e key.'), defaults to"); | ||
rz_core_cmd_help(core, rz_core_visual_get_fcn_help()); | ||
return RZ_CMD_STATUS_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-FileCopyrightText: 2024 Rot127 <[email protected]> | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
#include <rz_cmd.h> | ||
#include <rz_type.h> | ||
#include <rz_util/rz_assert.h> | ||
#include <rz_util/rz_log.h> | ||
#include <rz_util/rz_panels.h> | ||
|
||
#include "../core_private.h" | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_panel_handler(RzCore *core, int argc, const char **argv) { | ||
if (core->vmode) { | ||
RZ_LOG_ERROR("core->vmode == false.\n"); | ||
return RZ_CMD_STATUS_ERROR; | ||
} | ||
if (!rz_cons_is_interactive()) { | ||
RZ_LOG_ERROR("Panel mode requires scr.interactive=true.\n"); | ||
return RZ_CMD_STATUS_ERROR; | ||
} | ||
|
||
RzCoreVisual *visual = core->visual; | ||
if (rz_core_visual_panels_root(core, visual->panels_root)) { | ||
return RZ_CMD_STATUS_OK; | ||
} | ||
RZ_LOG_ERROR("rz_core_visual_panels_root() failed\n"); | ||
return RZ_CMD_STATUS_ERROR; | ||
} | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_panel_load_handler(RzCore *core, int argc, const char **argv) { | ||
RzCoreVisual *visual = core->visual; | ||
|
||
if (visual && visual->panels_root && visual->panels_root->active_tab) { | ||
rz_load_panels_layout(core, argv[1]); | ||
} | ||
rz_config_set(core->config, "scr.layout", argv[1]); | ||
RZ_LOG_INFO("Set scr.layout = %s", argv[1]); | ||
return RZ_CMD_STATUS_OK; | ||
} | ||
|
||
RZ_IPI RzCmdStatus rz_interactive_panel_store_handler(RzCore *core, int argc, const char **argv) { | ||
rz_save_panels_layout(core, argv[1]); | ||
|
||
rz_return_val_if_fail(core->config, RZ_CMD_STATUS_ERROR); | ||
rz_config_set(core->config, "scr.layout", argv[1]); | ||
return RZ_CMD_STATUS_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.