hellscape icon indicating copy to clipboard operation
hellscape copied to clipboard

Junk for BCF

Open meme opened this issue 4 years ago • 6 comments

Currently the BCF "junk" is a GIMPLE NOP which is pretty ineffective at deterring reversing by itself (since it is clear which block is the opaque path)

meme avatar May 15 '20 23:05 meme

I use gcc9.3 (ubuntu20.04) without error, but use gcc7.5 (ubuntu18.04) to report junk error: /tmp/ccnxYEFu.s: Assembler messages: /tmp/ccnxYEFu.s:15: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:18: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:19: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:39: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:68: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:83: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:104: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:119: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:148: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:168: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:202: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:205: Error: junk (%rip)' after expression /tmp/ccnxYEFu.s:206: Error: junk (%rip)' after expression`

liufengwenyu avatar May 26 '20 09:05 liufengwenyu

GCC >= 9 is required to use this software. In the future, please make a new issue for reporting compiler errors.

meme avatar May 26 '20 12:05 meme

Yes, the junk block is quite a "signature" for the opaque path. We probably should not insert a new thing for it at all; we should let it jump onto some existing code and confuse the reverser. I am not sure how simple/hard it is to do in gimple though.

jeffli678 avatar Jun 13 '20 09:06 jeffli678

Also after the junk it jumps back to the beginning of the conditional block -- which makes it more obvious.

jeffli678 avatar Jun 13 '20 09:06 jeffli678

If you'd like: describe exactly what you're looking to do and I can try to help describe the IR. The current BCF is effectively a placeholder.

meme avatar Jun 13 '20 11:06 meme

I have solved this problem on GCC 7.5.0.

liufengwenyu avatar Jun 13 '20 12:06 liufengwenyu