Live data from Hacker News

A static binary rewriter that does not use heuristics

github.com

11–17 of 17 posts

Re: A static binary rewriter that does not use heuristics

#11
post #8

Earlier quoted context omitted.

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.

So, what does the word “static” mean in this context, that the binary’s behavior does not change?

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

#12
post #2

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?

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

#13
post #8

Earlier quoted context omitted.

So, what does the word “static” mean in this context, that the binary’s behavior does not change?

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.

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

#14
post #2

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?

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

#16
post #14
post #2

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?

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.

I was not aware about this project. Noted!

Re: A static binary rewriter that does not use heuristics

#17
post #16
post #14

Earlier quoted context omitted.

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.

I was not aware about this project. Noted!

It came up here on HN just a week or two ago.
Post reply on HN