Binary rewriting is a widely adopted technique in software analysis. WebAssembly (Wasm), as an emerging bytecode format, has attracted great attention from our community. Unfortunately, there is no general-purpose binary rewriting framework for Wasm, and existing effort on Wasm binary modification is error-prone and tedious. In this paper, we present BREWasm, the first general purpose static binary rewriting framework for Wasm, which has addressed inherent challenges of Wasm rewriting including high complicated binary structure, strict static syntax verification, and coupling among sections. We perform extensive evaluation on diverse Wasm applications to show the efficiency, correctness and effectiveness of BREWasm. We further show the promising direction of implementing a diverse set of binary rewriting tasks based on BREWasm in an effortless and user-friendly manner.
翻译:二进制重写是软件分析中广泛采用的技术。WebAssembly(Wasm)作为一种新兴的字节码格式,已引起学术界的广泛关注。然而,目前尚不存在通用的Wasm二进制重写框架,现有的Wasm二进制修改工作既易出错又繁琐。本文提出BREWasm——首个面向Wasm的通用静态二进制重写框架。该框架解决了Wasm重写固有的挑战,包括高度复杂的二进制结构、严格的静态语法验证以及节区间的耦合问题。我们通过在多种Wasm应用上进行全面评估,验证了BREWasm的高效性、正确性与有效性。进一步研究表明,基于BREWasm能够以轻松且用户友好的方式实现多种二进制重写任务,展现了极具前景的研究方向。