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

Visual mode assembler only writes one instruction #11138

Closed
cryslith opened this issue Aug 18, 2018 · 10 comments · Fixed by #14459
Closed

Visual mode assembler only writes one instruction #11138

cryslith opened this issue Aug 18, 2018 · 10 comments · Fixed by #14459
Labels
RAsm-Assembler visual Visual console mode (NOT PANELS!)

Comments

@cryslith
Copy link
Contributor

Work environment

Questions Answers
OS/arch/bits (mandatory) Debian Linux x86_64 (inside a VM)
File format of the file you reverse (mandatory) ELF
Architecture/bits of the file (mandatory) x86/32
r2 -v full output, not truncated (mandatory) radare2 2.9.0-git 19186 @ linux-x86-64 git.2.8.0-127-g87a360f8e commit: 87a360f build: 2018-08-18__18:08:43

Expected behavior

a command in visual disassembly mode should overwrite multiple instructions

Actual behavior

a command only changes first instruction

Steps to reproduce the behavior

$ git clone https://github.com/monosource/radare2-explorations-binaries.git
$ cd radare2-explorations-binaries/tut1-patchme
$ make
$ cp patchme patchme_fix
$ r2 -Aw patchme_fix
> s main
> V

In visual mode:

  • Press p to enter disassembly view
  • Press the a key
  • Type nop;nop;nop;nop;nop

Observe that only one nop is there rather than 5. On the other hand, using "wa nop;nop;nop;nop;nop" command in non-visual mode works fine.

@XVilka XVilka added bug RAsm-Assembler visual Visual console mode (NOT PANELS!) labels Aug 19, 2018
@XVilka
Copy link
Contributor

XVilka commented Aug 19, 2018

It is probably because visual mode doesn't quote the command.

@ret2libc
Copy link
Contributor

I think it worked time ago.

@radare
Copy link
Collaborator

radare commented Aug 19, 2018 via email

@radare
Copy link
Collaborator

radare commented Sep 21, 2018

cant repro

@radare radare closed this as completed Sep 21, 2018
@cryslith
Copy link
Contributor Author

cryslith commented Sep 29, 2018

It is still certainly broken for me on master (radare2 3.0.0-git 19723 @ linux-x86-64 git.2.9.0-235-g354a40836 commit: 354a40836aa12df0ed3fb3ffa90e800e6dd49294 build: 2018-09-28__21:05:05). Can you please reopen this? @radare

@radare
Copy link
Collaborator

radare commented Sep 29, 2018 via email

@Maijin
Copy link
Contributor

Maijin commented Sep 29, 2018

Works here too, can you make an asciinema?

@cryslith
Copy link
Contributor Author

cryslith commented Oct 1, 2018

@Maijin Asciinema is here.

@cryslith
Copy link
Contributor Author

Hi, unfortunately this still doesn't work for me. I didn't point it out before but in order to reproduce you have to use lower-case a button and not upper-case A. Only the lower-case one is broken.

@XVilka already pointed out the cause: comparing https://github.com/radare/radare2/blob/da112132c8041d37773c91d7191776c07a8dafc3/libr/core/visual.c#L2445
with
https://github.com/radare/radare2/blob/da112132c8041d37773c91d7191776c07a8dafc3/libr/core/visual.c#L2734
you can see that the latter quotes the command while the former doesn't. The behavior I see is consistent with that, as everything after the semicolon gets interpreted as a separate command.

Thanks for your time & effort!

@radare
Copy link
Collaborator

radare commented Jun 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RAsm-Assembler visual Visual console mode (NOT PANELS!)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants