bin2ml icon indicating copy to clipboard operation
bin2ml copied to clipboard

Improved resilience of function masked bytes extraction

Open valbucci opened this issue 6 months ago • 0 comments

There is a bug upstream in radare2. I registered issue 24712 on radare2's repository documenting it in more detail. In few words, the command p8fm can return a byte mask with different size compared to the function's raw bytes.

Previously, this would cause an error and abort the function's byte extraction completely. This PR detects mask size mismatches and reconstructs the mask by scanning the function at the basic block and instruction level.

Separately, an additional --keep-raw-bytes flags has been added, allowing to extract raw bytes along with the masked bytes. This takes advantage of the raw bytes provided by r2 p8fm and is a replacement for the bytes-masked and bytes extraction modes together.

valbucci avatar Oct 18 '25 00:10 valbucci