RISC-V lifting issues

Aperta
#8,616 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start in arch/riscv/src/lib.rs at lines 1348 and 1500, then inspect the RISC-V lifting cases around them. Reproduce the listed instructions from kat-riscv32.elf at 0x1021a and 0x10d90 and compare their LLIL with the expected semantic sketches. Done means register shifts use the XLEN count and multiply-high instructions preserve the required product half.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Binary files and instruction addresses (ZIP available for upload separately):

  • kat-riscv32.elf: 0x1021a, 0x10d90; SHA-256 cc6c565a1bb70b6aef563d821b4757b147f18197a701685e3848f1981f8d920a

1: RISC-V register shifts

Binary instruction: kat-riscv32.elf / md5 at 0x1021a; bytes b3137e00.

Disassembly: sll t2, t3, t2.

Current lifted LLIL (relevant lines):

t2 = t3 << t2

Expected LLIL (semantic sketch):

t2 = t3 << (t2 & 0x1f)

RISC-V defines the effective count by XLEN. An oversized count in the IL changes variable rotates and shifts.

Code: arch/riscv/src/lib.rs:1348

2: RISC-V multiply-high instructions

Binary instruction: kat-riscv32.elf / adler32 at 0x10d90; bytes 3338e602.

Disassembly: mulhu a6, a2, a4.

Current lifted LLIL (relevant lines):

a6 = (zx.q(a2) * zx.q(a4)) u>> 0x20  // IL shift result size = 4 bytes

Expected LLIL (semantic sketch):

a6 = low.d((zx.q(a2) * zx.q(a4)) u>> 0x20)  // eight-byte shift

Shifting a value by its full width loses the product half needed by mulh, mulhu, and mulhsu.

Code: arch/riscv/src/lib.rs:1500

Lingua principale
C++
Stelle
1.3k
Fork
304
Merge medio
2g 20h
PR unite (30g)
10

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Vector35/binaryninja-api

Tutte le issue di Vector35/binaryninja-api

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.