radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.67k stars 3k forks source link

mips|mips.gnu plugin assembler error in branch labels? #8389

Open Goyo2600 opened 7 years ago

Goyo2600 commented 7 years ago

rep: beq t0,zero,rep bne t0,zero,rep

Assembling with rasm2 -a mips|mips.gnu -b 32 the assembled is erroneous. Label 'rep' is not referenced correctly in both cases. Loading this source code with r2, the result is not the same code. I think 'rep' label is not well referenced.

Maijin commented 7 years ago

Greetings, You can also try keystone(http://keystone-engine.org) within radare2/rasm2 by installing the radare2 plugin via r2pm :

    r2pm -i keystone-lib
    r2pm -i keystone
then
    rasm2 -a mips.ks…
or in radare2 session
    e asm.assembler = mips.ks
radare commented 7 years ago

I doubt keystone can fix this. Its an issue about replacing labels. Unlogic will chk it asap

On 31 Aug 2017, at 13:30, Maijin notifications@github.com wrote:

Greetings, You can also try keystone(http://keystone-engine.org) within radare2/rasm2 by installing the radare2 plugin via r2pm :

r2pm -i keystone-lib r2pm -i keystone then rasm2 -a mips.ks… or in radare2 session e asm.assembler = mips.ks — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Goyo2600 commented 7 years ago

using mips.ks don't fix the problem. I've checked it. When you load in r2 the code assembled with mips.ks plugin the result is the same