Closed lizardo closed 11 months ago
Using "on" (disabling r_bin) solves the issue, but I did not expect "o" to have any effect in this case as the binary in question is a plain memory dump (not e.g. an ELF), so no way can r_bin discover anything about it. Well, maybe it detected as some random format by accident.
By the way, replace main.bin with e.g. "o /etc/passwd" to have the same effect (asm.bits changed to 64).
opening a file implies changing the bits acording to the info provided by rbin.
in this case. the bin shuoldnt report any specific bitsize because its an unknown filetype, so it shouldnt change.
On 18 Jan 2016, at 14:32, lizardo notifications@github.com wrote:
By the way, replace main.bin with e.g. "o /etc/passwd" to have the same effect (asm.bits changed to 64).
— Reply to this email directly or view it on GitHub https://github.com/radare/radare2/issues/3971#issuecomment-172527800.
oh, this thing again
This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.
Problem persists even on latest version:
$ r2 -v
radare2 4.3.1 0 @ linux-x86-64 git.4.3.1
commit: HEAD build: 2020-03-06__15:05:41
$ r2 --
-- Press 'c' in visual mode to toggle the cursor mode
[0x00000000]> e asm.arch = arm; e asm.bits = 16
[0x00000000]> e asm.arch; e asm.bits
arm
16
[0x00000000]> o /etc/passwd
[0x00000000]> e asm.arch; e asm.bits
arm
64
[0x00000000]>
As of 5.8.8, it has been fixed:
$ r2 -v
radare2 5.8.8 1 @ linux-x86-64
birth: git.5.8.8 2023-06-08__14:00:41
commit: ea7f0356519884715cf1d5fba16042bac72b2df5
options: gpl -O1 cs:5 cl:0 make
$ r2 --
-- License server overloaded (ETOOMUCHCASH)
[0x00000000]> e asm.arch; e asm.bits
x86
64
[0x00000000]> e asm.arch = arm; e asm.bits = 16
[0x00000000]> e asm.arch; e asm.bits
arm
16
[0x00000000]> o /etc/passwd
[0x00000000]> e asm.arch; e asm.bits
arm
16
[0x00000000]>
Steps to reproduce:
Not a big issue as I can reset it back, but I don't expect the "o" command to affect any configuration...