Much software, whether beneficent or malevolent, is distributed only as binaries, sans source code. Absent source code, understanding binaries' behavior can be quite challenging, especially when compiled under higher levels of compiler optimization. These optimizations can transform comprehensible, "natural" source constructions into something entirely unrecognizable. Reverse engineering binaries, especially those suspected of being malevolent or guilty of intellectual property theft, are important and time-consuming tasks. There is a great deal of interest in tools to "decompile" binaries back into more natural source code to aid reverse engineering. Decompilation involves several desirable steps, including recreating source-language constructions, variable names, and perhaps even comments. One central step in creating binaries is optimizing function calls, using steps such as inlining. Recovering these (possibly inlined) function calls from optimized binaries is an essential task that most state-of-the-art decompiler tools try to do but do not perform very well. In this paper, we evaluate a supervised learning approach to the problem of recovering optimized function calls. We leverage open-source software and develop an automated labeling scheme to generate a reasonably large dataset of binaries labeled with actual function usages. We augment this large but limited labeled dataset with a pre-training step, which learns the decompiled code statistics from a much larger unlabeled dataset. Thus augmented, our learned labeling model can be combined with an existing decompilation tool, Ghidra, to achieve substantially improved performance in function call recovery, especially at higher levels of optimization.
Automated Inference of Software Library Usage Patterns
现代软件系统越来越依赖于第三方库。人们普遍认为,使用成熟且经过良好测试的第三方库可以提高开发人员的生产力,缩短上市时间,并生产出更可靠的软件。今天的开放源代码库提供了广泛的库,可以免费下载和使用。然而,由于软件库是单独记录的,但打算一起使用,开发人员不太可能充分利用这些重用机会。在本文中,我们提出了一种新的方法来自动识别第三方库的使用模式,即,开发人员通常一起使用的库集合。我们的方法采用层次聚类技术组在一起的软件库外部客户端使用的基础上。为了评估我们的方法,我们从Maven Central Repository中挖掘了超过6,000个流行库,并调查了Github存储库中超过38,000个客户端系统的使用情况。我们的实验表明,我们的技术是能够检测到大多数(77%)的高度一致和凝聚力的图书馆使用模式在相当数量的客户端系统。
Understanding and Mitigating Library-Related Issues in LLM-Generated Code
IReSCoMath Research Laboratory, Faculty of Sciences, University of Gabes(加贝斯大学理学院 IReSCoMath 研究实验室);National School of Engineering, Gabes(加贝斯国立工程学院);Department of Electrical & Software Engineering, University of Calgary(卡尔加里大学电气与软件工程系)