cutter icon indicating copy to clipboard operation
cutter copied to clipboard

Incorrect assembly of nops when newlines present.

Open Semnodime opened this issue 2 years ago • 0 comments

Environment information

  • Operating System: linuxmint 20.2
  • Cutter version: 2.0.3
  • File format: elf64
  • Arch: x86
  • Type:

Describe the bug Assembly of nops with trailing newlines produces incorrect result (single nop only).

To Reproduce Steps to reproduce the behavior:

  1. Assemble the following instruction(s). Note: pay attention to the newlines in the instruction.
nop;nop;nop;nop;

In hex view the string to paste would be stored as

00000000: 6e6f 703b 6e6f 703b 6e6f 703b 6e6f 703b  nop;nop;nop;nop;
00000010: 0a0a 0a    

Expected behavior Assembly of four nops.

Screenshots image

Additional context Removing the last newline will lead to correct assembly, so it has to do with two trailing newlines. Stripping whitespace won't fix this issue, as this bug still occurs, when there are instructions after the newlines. I stumbled arcoss this when I was modifying some assebly and pasted the instructions after modified them in my text editor.

Semnodime avatar Dec 18 '21 08:12 Semnodime