rizin icon indicating copy to clipboard operation
rizin copied to clipboard

Unify assignment command code

Open thestr4ng3r opened this issue 3 years ago • 4 comments

There are multiple commands that handle assignments like e asm.arch=6502. Right now, they all use their own logic and syntax to parse this from argc/argv, but it will be better to have only one behavior and reuse it everywhere to be consistent.

Affected commands:

  • e
  • ar/dr
  • aezv
  • $

thestr4ng3r avatar Dec 21 '21 18:12 thestr4ng3r

What do you have in mind? In e i'm just doing a split on =.

ret2libc avatar Dec 22 '21 15:12 ret2libc

Doesn't really matter what the syntax exactly is, but the current state is:

  • e supports k=v but explicitly not k = v in favor of multiple assignments in one call
  • ar/dr support both k=v and k = v, but no multiple assignments
  • aezv does not handle = at all and only supports aezv k v

I would be ok with using either the e one or ar/dr one everywhere.

thestr4ng3r avatar Dec 22 '21 17:12 thestr4ng3r

I think $ is a special case (no multiple assignments), since whitespace by itself can't be used to separate or delimit between multiple assignments there.

kazarmy avatar Mar 24 '24 03:03 kazarmy

I've been looking at this, but I cannot seem to find the rz_analysis_regs_handler and the rz_debug_regs_handler definitions for ar and dr respectively, although they are both declared in rzlib/core/cmd_descs/cmd_descs.h. It would be appreciated if someone could point me to the right place, as I seem to be missing something related to the project structure here.

edit: found librz/core/cmd/cmd_regs_meta.inc, working on PR

treseco avatar Apr 18 '24 17:04 treseco