MSP430 lifting issues

Đang mở
#8,619 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ó
4/5
Thời gian dự kiến
3-5 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 with the referenced MSP430 cases in arch/msp430/src/lift.rs and flag.rs, then inspect the rlc/rrc builder in rust/src/low_level_il/lifting.rs. Reproduce the lifts from kat-msp430.elf at the listed addresses and compare them with the expected LLIL sketches. Done means rra, byte stores and autoincrement, subtract carry, rotations through carry, and rla.b produce the stated semantics.

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-msp430.elf: 0x401e, 0x40de, 0x40e0, 0x40fe, 0x4440, 0xae40; SHA-256 7161cda75990fbfe523a17677127c99b47f018f670ef98c8ada90600c02c95a2

1: MSP430 rra

Binary instruction: kat-msp430.elf / b64_encode at 0x40e0; bytes 0b11.

Disassembly: rra r11.

Current lifted LLIL (relevant lines):

r11 = ror.w{cnz}(r11, 1)
flag:v = 0

Expected LLIL (semantic sketch):

r11 = r11 s>> 1  // update C, N, Z; clear V

Rotate-right wraps the low bit into the sign position; rra copies the original sign bit.

Code: arch/msp430/src/lift.rs:198

2: MSP430 mov.b and byte autoincrement

Binary instruction: kat-msp430.elf / b64_encode at 0x40fe; bytes df497ac00300.

Disassembly: mov.b -0x3f86(r9), 0x3(r15).

Current lifted LLIL (relevant lines):

[r15 + 3].w = zx.w([r9 - 0x3f86].b)

The byte autoincrement part also appears in kat-msp430.elf / memcpy at 0xae40: mov.b @r13+, r11 (7b4d) lifts as:

r11 = zx.w([r13].b)
r13 = r13 + 2

The expected pointer update for that byte move is r13 = r13 + 1.

Expected LLIL (semantic sketch):

[r15 + 3].b = [r9 - 0x3f86].b

The current width changes adjacent memory and skips bytes in byte streams.

Code: byte store width, autoincrement width

3: MSP430 subtract/compare carry

Binary instruction: kat-msp430.elf / b64_encode at 0x401e; bytes 39900300.

Disassembly: cmp 0x3, r9.

Current lifted LLIL (relevant lines):

sub.w{*}(r9, 3)

Expected LLIL (semantic sketch):

sub.w{*}(r9, 3); flag:c uses no-borrow subtraction polarity

Inverted carry polarity reverses branches that consume C after a subtract or compare.

Code: arch/msp430/src/flag.rs:30

4: Rust LLIL rlc / rrc builder

Binary instruction: kat-msp430.elf / b64_encode at 0x40de; bytes 0b10.

Disassembly: rrc r11.

Current lifted LLIL (relevant lines):

r11 = rrc.w{*}(r11, 1, r4)

Expected LLIL (semantic sketch):

r11 = rrc.w{*}(r11, 1, flag:c)

LLIL rotation through carry is ternary; omitting C makes the expression decode with an unrelated third operand.

Code: LLIL builder, MSP430 caller

5: MSP430 rla.b

Binary instruction: kat-msp430.elf / md5 at 0x4440; bytes 4d5d.

Disassembly: rla.b r13.

Current lifted LLIL (relevant lines):

r13 = zx.w(rol.b{*}(r13.b, 1))

Expected LLIL (semantic sketch):

r13 = zx.w(r13.b << 1)  // carry out from bit 7

A rotate feeds the old high bit into bit zero; arithmetic left shift must insert zero there.

Code: arch/msp430/src/lift.rs:563

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.