Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
892 stars 199 forks source link

Set enum member on instruction with constant value #1216

Closed fergofrog closed 1 year ago

fergofrog commented 5 years ago

Often when comparisons against enum members (or #define constants) are compiled they become static mov r, val where val is the constant. Currently binary ninja allows enum members to be set against data, but not when in code. Implementing this would make for a much tidier disassembly, all the way up to the MLIL.

plafosse commented 5 years ago

Thanks for the feature request.

xusheng6 commented 1 year ago

Related to https://github.com/Vector35/binaryninja-api/issues/2606

xusheng6 commented 1 year ago

Related to https://github.com/Vector35/binaryninja-api/issues/2312

xusheng6 commented 1 year ago

I tentatively suggest that we reopen issues like https://github.com/Vector35/binaryninja-api/issues/3211. That one is tracking a different issue than this one. This issue tracks the ability to manually specify an integer constant as an enum type, while #3211 seems to suggest we handle the enum better automatically. For example, we should be able to change the constant 2 to an enum name without user interaction in the following code:

100003ed8      enum foobar var_28
100003ed8      if (var_28 == 2)
100003ee8          _printf("foo3\n")
xusheng6 commented 1 year ago

Related to #1703

xusheng6 commented 1 year ago

This should be converted into several sub-tasks:

xusheng6 commented 1 year ago

The second task is blocked on #3490

0cyn commented 1 year ago

Resolved in builds >= 3.2.3974