rizinorg / cutter

Free and Open Source Reverse Engineering Platform powered by rizin
https://cutter.re
GNU General Public License v3.0
15.79k stars 1.15k forks source link

Emu setting tracking bug #1694

Open karliss opened 5 years ago

karliss commented 5 years ago

Environment information

Describe the bug

Disabling emu.str keeps asm.emu enabled.

To Reproduce Test 1

  1. open Preferences/DIsassembly/Metadata
  2. Enable and then disable "asm.emu" option and observe the difference
  3. Enable "emu.str"
  4. Disable "emu.str"
  5. Observe that asm output looks as if "asm.emu" was enabled. BUG
  6. Toggle "asmu.emu" twice to disable it.

Test 2

  1. Open Preferences/DIsassembly/Metadata
  2. Make sure "asm.emu" is disabled and enable "emu.str"
  3. Click ok
  4. Reopen Preferences/DIsassembly/Metadata
  5. Observe that "asm.emu" is enabled but "emu.str" is disabled. BUG

Expected behavior

After disabling "emu.str" output returns to previous state.

ITAYC0HEN commented 5 years ago

In r2, when you enable "emu.str" it will enable "asm.emu" because, iirc, "emu.str" can't work when "asm.emu" is disabled.

ITAYC0HEN commented 5 years ago

Should this be handled from r2?

# both variables are set to false
[0x00005ae0]> e asm.emu
false
[0x00005ae0]> e emu.str
false

# enable emu.str
[0x00005ae0]> e emu.str=true
[0x00005ae0]> e emu.str
true

# show that asm.emu became true
[0x00005ae0]> e asm.emu
true

# set emu.str to false again
[0x00005ae0]> e emu.str=false
[0x00005ae0]> e emu.str
false

# this does not affect asm.emu that previously became true and still is
[0x00005ae0]> e asm.emu
true
karliss commented 5 years ago

Expected behavior in issue description is only one of the options. I am fine with preserving r2 behavior if Cutter GUI matches it. Third option is disabling emu.str option in cutter when asm.emu isn't enabled.