News for hackers. Stuff that matters.
Re:A static binary rewriter that does not use heuristics by dzdt on Saturday May 12, 2018 @02:44PM (#17055403)
I read the readme. I still don't know what is "rewriting" a binary or why one would want to do it. Can someone explain?
Re:A static binary rewriter that does not use heuristics by detaro on Saturday May 12, 2018 @05:06PM (#17056003)
Take a binary and make changes to it (without breaking anything unintentionally). E.g. add hooks for performance measurements, add additional security checks, make it use/not use specific CPU instructions.
Re:A static binary rewriter that does not use heuristics by _nalply on Saturday May 12, 2018 @03:01PM (#17055483)
Have a look at the example icount.py: It rewrites binaries to count the number of instructions executed.

Therefore it seems the rewriter can modify already existing binaries corresponding to some rules in Python files by inserting additional instructions.

Re:A static binary rewriter that does not use heuristics by shadowfacts on Saturday May 12, 2018 @04:00PM (#17055730)
This is the paper referenced in the README: http://web.cse.ohio-state.edu/~lin.3021/file/NDSS18a.pdf
Re:A static binary rewriter that does not use heuristics by jitl on Saturday May 12, 2018 @02:34PM (#17055362)
Could this tool be used to produce eg a statically-linked version of `curl` that would work the same on any Linux, without needing to build curl from sources?
Re:A static binary rewriter that does not use heuristics by chx on Saturday May 12, 2018 @07:19PM (#17056524)
I think you should look at https://github.com/intoli/exodus

> Painless relocation of Linux binaries–and all of their dependencies–without containers.

> Exodus handles bundling all of the binary's dependencies, compiling a statically linked wrapper for the executable that invokes the relocated linker directly.

Re:A static binary rewriter that does not use heuristics by nadioca on Sunday May 13, 2018 @02:21AM (#17057587)
I was not aware about this project. Noted!
Re:A static binary rewriter that does not use heuristics by chx on Sunday May 13, 2018 @11:10PM (#17062396)
It came up here on HN just a week or two ago.
Re:A static binary rewriter that does not use heuristics by resoluteteeth on Saturday May 12, 2018 @03:41PM (#17055653)
It does not appear that "static binary rewriter" in this context means that it turns dynamically linked binaries into statically linked binaries, so probably not.
Re:A static binary rewriter that does not use heuristics by jitl on Saturday May 12, 2018 @04:58PM (#17055968)
So, what does the word “static” mean in this context, that the binary’s behavior does not change?
Re:A static binary rewriter that does not use heuristics by detaro on Saturday May 12, 2018 @05:11PM (#17056030)
Same meaning as in a "static analyzer" for code quality: it works without executing the target program. (whereas a dynamic rewriter could run the application under debugger control, observe its behavior, extract additional meaning from that and make changes on-the-fly)
Re:A static binary rewriter that does not use heuristics by waterhouse on Saturday May 12, 2018 @05:07PM (#17056008)
I imagine it means that it takes the binary file, generates a new binary file, and is done, as opposed to rewriting things at runtime or needing profiling information from a prior run of the binary.
Re:A static binary rewriter that does not use heuristics by moyix on Saturday May 12, 2018 @06:39PM (#17056399)
This is correct. Specifically, there's a category of tool called "dynamic binary translators" (including Pin, DynamoRIO, Valgrind, and QEMU) that translate binary code one block at a time, just before it's executed.
Re:A static binary rewriter that does not use heuristics by mdaniel on Saturday May 12, 2018 @06:27PM (#17056346)
Just in case you haven't considered it, and it's applicable for your situation, one can use docker for that purpose:

    docker run --rm -v $PWD:/something some-image-with-curl curl -o /something/destination http://example.com/something
Re:A static binary rewriter that does not use heuristics by all_blue_chucks on Saturday May 12, 2018 @10:56PM (#17057160)
Is this for antivirus signature evasion? If so, wouldn't it need to work on itself?