paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Recovering Variable Names for Minified Code with Usage Contexts

利用使用上下文恢复压缩代码中的变量名
ICSE 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)2019匹配度 2/10 · 该论文聚焦压缩JS代码的变量名恢复,属于代码理解/反混淆与开发者工具,未涉及LLM/Agent、ML系统或Agentic程序的静态分析、浮点程序分析、贝叶斯程序分析等核心方向,因此与研究画像仅存在较弱的程序分析/工具关联。引用 19 inbox
Hieu Tran, Ngoc Tran, Son Nguyen, Hoan Nguyen, Tien N. Nguyen
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:JSNeat 利用信息检索和三类使用上下文,从开源 JS 语料中恢复压缩代码的变量名,准确率显著优于现有方法。

为保护原始源码,部署在 Web 中的 JavaScript 常将变量名替换为短而无意义的名称,导致代码难以理解和分析。本文提出 JSNeat,一种基于信息检索的变量名恢复方法,通过在大型开源 JS 代码库中搜索候选名称来实现数据驱动的恢复。该方法使用三类上下文匹配压缩代码中的变量:变量属性与角色的上下文、变量及其与其他待恢复变量关系的上下文,以及变量所在函数任务的上下文。作者在超过 32.2 万个 JS 文件、100 万个函数、350 万个变量和 17.6 万个唯一变量名的数据集上进行了实验。JSNeat 达到 69.1% 的准确率,相较 JSNice 和 JSNaughty 分别相对提升 66.1% 和 43%,且恢复一个文件或变量的速度分别是 JSNice 的 2 倍和 JSNaughty 的 4 倍。

问题
部署在 Web 中的 JavaScript 变量名常被压缩成短且无意义的名称,使代码难以人工理解和分析。
方法
提出 JSNeat,基于信息检索在大型开源 JS 语料库中搜索变量名,并利用变量属性与角色、变量间关系以及函数任务三类使用上下文进行匹配。
评估
在包含 32.2 万多个 JS 文件、100 万函数、350 万变量和 17.6 万唯一变量名的数据集上实验,准确率达 69.1%,相对 JSNice 和 JSNaughty 分别提升 66.1% 和 43%,速度也更快。
原文摘要(Abstract)

To avoid the exposure of original source code in a Web application, 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 the 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 a variable with JSNeat is twice as fast as with JSNice and 4x as fast as with JNaughty, respectively.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{TranTNNN19,
  title = {Recovering Variable Names for Minified Code with Usage Contexts},
  author = {Hieu Tran and Ngoc Tran and Son Nguyen and Hoan Nguyen and Tien N. Nguyen},
  booktitle = {ICSE},
  year = {2019},
  doi = {10.1109/icse.2019.00119}
}