Vector35 / binaryninja-api

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

Support setting UIDF in HLIL/PseudoC #3306

Closed CouleeApps closed 1 year ago

CouleeApps commented 2 years ago

Version and Platform (required):

Bug Description: There is no open to Set User Variable Value in HLIL or Pseudo-C views-- you have to do it from MLIL. Considering how many people ignore the MLIL view, I'd bet that a number of users don't even realize this is a feature they can use. This issue is strictly less broad than #2160, and only needs to apply to HLIL_VAR_INIT statements.

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

  1. Open any binary
  2. Switch to MLIL
  3. Right click the definition site of a variable
  4. Observe the ability to Set User Variable Value
  5. Switch to HLIL
  6. Right click the definition site of a variable
  7. Observe the lack of ability to Set User Variable Value

Expected Behavior: I expected this option to be available in HLIL.

Additional Information: I'm on the fence whether this is a bug or feature

xusheng6 commented 1 year ago

Related to https://github.com/Vector35/binaryninja-api/issues/4289 and https://github.com/Vector35/binaryninja-api/issues/2160

romanholidaypancakes commented 1 year ago

This will help to analyze binaries protected by vmprotect/themida.

image

image

If the value of rdi(disassembly viwe) or rax_14(hlil/pseudo c) could be assumed to be set manually (including scripting) it would speed up binaryninja's ability to analyze the VM. A simple illustration: would it enable bj to find the next (maybe multiple) jumping basic block so that maybe bj could combine this block together into a valid function?

fuzyll commented 1 year ago

Thanks for the report! We believe this should now be fixed in builds >= 3.6.4614-dev.