RISC-V lifting issues

Đang mở
#8,616 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
reverse-engineering

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
C++
Star
1.3k
Fork
304
Merge trung bình
2 ngày 20 giờ
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Vector35/binaryninja-api

Tất cả issue của Vector35/binaryninja-api

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.