arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1906.03488cs.SEcs.IR
收藏

使用上下文恢复精简代码的变量名

Recovering Variable Names for Minified Code with Usage Contexts

Hieu Tran, Ngoc Tran, Son Nguyen, Hoan Nguyen, Tien Nguyen

摘要:

在现代Web技术中,JavaScript(JS)代码扮演着重要的角色。为了避免暴露原始源代码,JS代码中部署的变量名通常被简短、无意义的名称所取代,从而使代码极难手动理解和分析。本文提出了一种基于信息检索(IR)的方法来恢复压缩JS代码中的变量名。JSNeat遵循数据驱动的方法,通过在大型开源JS代码语料库中搜索来恢复名称。我们使用三种类型的上下文来匹配一个变量在给定的缩小代码对语料库,包括上下文的属性和角色的变量,该变量的上下文和与其他变量的关系下恢复,和上下文的功能的变量有助于的任务。我们进行了几个实证实验,以评估JSNeat的数据集超过322K JS文件与1M功能,和3.5M变量与176K唯一的变量名称。我们发现,JSNeat达到了69.1%的高准确率,这是两个最先进的方法JSNice和JSNAUGHTY的66.1%和43%的相对改进。使用JSNeat恢复文件或变量的时间分别是使用JSNice的两倍和使用JNaughty的4倍。

英文摘要:

In modern Web technology, JavaScript (JS) code plays an important role. To avoid the exposure of original source code, the variable names in JS code deployed in the wild are often replaced by short, meaningless names, thus making the code extremely difficult to manually understand and analysis. This paper presents JSNeat, an information retrieval (IR)-based approach to recover the variable names in minified JS code. JSNeat follows a data-driven approach to recover names by searching for them in a large corpus of open-source JS code. We use three types of contexts to match a variable in given minified code against the corpus including the context of properties and roles of the variable, the context of that variable and relations with other variables under recovery, and the context of the task of the function to which the variable contributes. We performed several empirical experiments to evaluate JSNeat on the dataset of more than 322K JS files with 1M functions, and 3.5M variables with 176K unique variable names. We found that JSNeat achieves a high accuracy of 69.1%, which is the relative improvements of 66.1% and 43% over two state-of-the-art approaches JSNice and JSNaughty, respectively. The time to recover for a file or for a variable with JSNeat is twice as fast as with JSNice and 4x as fast as with JNaughty, respectively.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑