Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core plugins should be registered *after* the basic commands are registered #701

Closed
ret2libc opened this issue Feb 24, 2021 · 1 comment · Fixed by #732
Closed

core plugins should be registered *after* the basic commands are registered #701

ret2libc opened this issue Feb 24, 2021 · 1 comment · Fixed by #732
Assignees
Labels

Comments

@ret2libc
Copy link
Member

Work environment

rizin 0.2.0-git @ linux-x86-64
commit: c02f79753e40d9089b8708fb33a4b5f0ab8590f6, build: 2021-02-23__15:16:15

Expected behavior

Core plugins should be registered after the basic commands are added.

Actual behavior

Core plugins have precedence over basic commands, so for example java is registered before anything else.

Steps to reproduce the behavior

Core plugins are registered in rz_cmd_new immediately after creating the root command descriptor, which means that a core plugin could register commands that are supposed to be "core" ones (e.g. w, p, etc.).

See cmd_api.c:

RZ_API RzCmd *rz_cmd_new(bool has_cons, bool add_core_plugins) {
	...
	cmd->root_cmd_desc = create_cmd_desc(cmd, NULL, RZ_CMD_DESC_TYPE_GROUP, "", &root_help, true);
	if (add_core_plugins) {
		rz_core_plugin_init(cmd);
	}
	rz_cmd_macro_init(&cmd->macro);
	rz_cmd_alias_init(cmd);
	return cmd;
}
@wargio
Copy link
Member

wargio commented Feb 24, 2021

We probably need to sort the commands once newshell is initialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants