The binary executable format is the standard method for distributing and executing software. Yet, it is also as opaque a representation of software as can be. If the binary format were augmented with metadata that provides security-relevant information, such as which data is intended by the compiler to be executable instructions, or how memory regions are expected to be bounded, that would dramatically improve the safety and maintainability of software. In this paper, we propose a binary format that is a middle ground between a stripped black-box binary and open source. We provide a tool that generates metadata capturing the compiler's intent and inserts it into the binary. This metadata enables lifting to a correct and recompilable higher-level representation and makes analysis and instrumentation more reliable. Our evaluation shows that adding metadata does not affect runtime behavior or performance. Compared to DWARF, our metadata is roughly 17% of its size. We validate correctness by compiling a comprehensive set of real-world C and C++ binaries and demonstrating that they can be lifted, instrumented, and recompiled without altering their behavior.
翻译:二进制可执行文件格式是分发和执行软件的标准方式。然而,它同时也是软件尽可能不透明的表示形式。如果二进制格式能增加提供安全相关信息的元数据——例如编译器意图将哪些数据用作可执行指令,或内存区域的预期边界如何界定——这将极大地提升软件的安全性和可维护性。本文提出了一种介于剥离黑盒二进制与开源之间的中间地带的二进制格式。我们提供了一个工具,用于生成捕捉编译器意图的元数据并将其插入二进制文件中。这些元数据使得能够将二进制文件提升为正确且可重新编译的高级表示,从而使分析和插桩更加可靠。我们的评估表明,添加元数据不会影响运行时行为或性能。与DWARF相比,我们的元数据大小约为其17%。我们通过编译一组全面的真实世界C和C++二进制文件,并证明它们可以在不改变行为的情况下被提升、插桩和重新编译,从而验证了其正确性。