improper "add negative -> subtract" transformation with floating point

Abierto
#2,807 1 comentario 0 reacciones 1 asignado Ver en GitHub

@rssor ya está trabajando en esto.

Desde el 12/1/2022.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Component: Core Effort: Low Impact: Medium

Version and Platform (required):

  • Binary Ninja Version: 2.5.3140-dev (Build ID 532595b6)
  • OS: macOS
  • OS Version: 11.6

Steps To Reproduce:
Please provide all steps required to reproduce the behavior:

  1. Open this binary.

  2. Notice in HLIL:

00000000  uint64_t _start(float arg1 @ v0)

00000004      data_4000
0000001c      return zx.q(int.d(arg1 - 0x41666666))


00000020  uint64_t sub_20(float arg1 @ v0)

00000024      data_4000
0000003c      return zx.q(int.d(arg1 f+ 0x41666666))

Expected Behavior:
The functions are identical except for loading a different constant: one is "negative" 0x41666666, one is "positive" 0x41666666. In reality, both constants are used as 32-bit floats, not signed integers.

In the second function, Binary Ninja indicates that floating point addition is being used with f+ 0x41666666. But in the first function, Binary Ninja produces just - 0x41666666. This is wrong in two ways: it doesn't indicate that floating point is being used, and in any case arg1 f+ -0x41666666 (i.e. arg1 f+ 0xbe99999a, i.e. arg1 + -0.300000011921) is not equivalent to arg1 f- 0x41666666 (i.e. arg1 + 14.3999996185).

Lenguaje dominante
C++
Estrellas
1.3k
Forks
298
Merge medio
5 d 5 h
PR fusionados (30 d)
19

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Vector35/binaryninja-api

Todos los issues de Vector35/binaryninja-api

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.