MSP430 lifting issues

Aberta
#8,619 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
rust

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
C++
Estrelas
1.3k
Forks
304
Merge médio
2d 20h
PRs com merge (30d)
10

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Vector35/binaryninja-api

Todas as issues de Vector35/binaryninja-api

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.