一句话:提出一种静态过程内后向切片方法,可在 WebAssembly 二进制上做依赖分析并保持栈合法性。
WebAssembly 作为可移植编译目标,在逆向工程、代码理解和安全等场景中需要二进制级切片;但二进制层依赖分析困难,且切片必须满足 WebAssembly 的栈验证要求。本文提出一种静态、过程内、后向切片方法,针对 WebAssembly 特有依赖识别切片指令,并保证输出切片保持栈行为从而可执行。作者在 8,386 个真实 WebAssembly 二进制上评估,计算了 495,204,868 个切片,平均大小为原代码的 53%,优于相关 ARM 二进制切片工作的 60%。此外,他们将切片与 1,956 个 C 程序源级切片对比,以定性分析该方法的优势与改进空间。
The recently introduced WebAssembly standard aims to be a portable compilation target, enabling the cross-platform distribution of programs written in a variety of languages. We propose an approach to slice WebAssembly programs in order to enable applications in reverse engineering, code comprehension, and security among others. Given a program and a location in that program, program slicing produces a minimal version of the program that preserves the behavior at the given location. Specifically, our approach is a static, intra-procedural, backward slicing approach that takes into account WebAssembly-specific dependences to identify the instructions of the slice. To do so it must correctly overcome the considerable challenges of performing dependence analysis at the binary level. Furthermore, for the slice to be executable, the approach needs to ensure that the stack behavior of its output complies with WebAssembly's validation requirements. We implemented and evaluated our approach on a suite of 8 386 real-world WebAssembly binaries, finding that the average size of the 495 204 868 slices computed is 53% of the original code, an improvement over the 60% attained by related work slicing ARM binaries. To gain a more qualitative understanding of the slices produced by our approach, we compared them to 1 956 source-level slices of benchmark C programs. This inspection helps to illustrate the slicer's strengths and to uncover potential future improvements.