binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

extra minus sign before int64_t values in MLIL and up

Open bb33bb opened this issue 1 year ago • 5 comments

Version and Platform (required):

Binary Ninja Version: 3.6.4780-dev Personal (d35c49ed) OS: manjaro OS Version: Linux version 6.6.10-1-MANJARO CPU Architecture: x64

Bug Description: reversed arm64 instruction is right but when converted to c code , the address in arm64 is unsigned long long , but in c code is signed as minus 0xfffffxxxxx

Steps To Reproduce: Please provide all steps required to reproduce the behavior: 1- open the sample code 2-display reversed instruction 3-Press F5

Expected Behavior:

/* jump -> -0xffff800008f828e8 / should be / jump -> 0xffff800008f828e8 */

Screenshots: issue picture as follows image

Additional Information: no

bb33bb avatar Jan 20 '24 23:01 bb33bb

We get it correct in disassembly, and for some reason there is an extra minus sign in MLIL and up:

Screenshot 2024-01-23 at 7 24 27 PM

xusheng6 avatar Jan 23 '24 11:01 xusheng6

抱歉又来ping 方便更新下哈 如下还是64位常量会出险负数的情况:

https://github.com/Vector35/binaryninja-api/assets/5463104/6ff65afb-00a6-4d45-970d-c549eb2a42f2

bb33bb avatar Mar 13 '24 02:03 bb33bb

I really hope we can fix this. Because when reversing some code , we can almost use the c code directly without any modification. But now , We have to delete the minus symbol before uint64 numbers.

bb33bb avatar Mar 16 '24 14:03 bb33bb

here is some tips i tried

https://github.com/Vector35/binaryninja-api/assets/5463104/828aa729-d107-443b-924f-b9b44f494592

bb33bb avatar Apr 11 '24 02:04 bb33bb

is there any possible that if we treat the number as signed, then we directly add the minus symbol?

bb33bb avatar Apr 11 '24 02:04 bb33bb