Vector35 / binaryninja-api

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

`rrc,rlc(x, y, false)` should be simplified to `x>>,<<y` #5455

Open whitequark opened 1 month ago

whitequark commented 1 month ago

Version and Platform (required):

Bug Description: HLIL displays expressions of the kind rrc.q(arg1, 1, false). Also, I think rrc inhibits some downstream analyses.

Steps To Reproduce: repro2.zip

Expected Behavior: Simplification of rrc(x, y, false) to x >> y and rlc(x, y, false) to x << y

Screenshots: Screenshot_20240525_064014

Additional Information: Similar reasoning and context as https://github.com/Vector35/binaryninja-api/issues/5448. (Thanks!)

whitequark commented 1 month ago

Here's another testcase: repro.zip Screenshot_20240527_123449

Screenshot_20240527_123458

I would expect this to be just arg1 >> 3 on HLIL level.