ShieldedCode: 学习具有保护意识的虚拟机保护代码表示
ShieldedCode: Learning Robust Representations for Virtual Machine Protected Code
AI总结:
ShieldedCode通过学习鲁棒表示提升虚拟机保护代码的生成与分析能力,实现更高效的软件保护。
摘要:
大型语言模型(LLMs)在代码生成方面取得了显著进展,但其在软件保护方面的潜力仍 largely 未被开发。逆向工程继续威胁软件安全,而传统的虚拟机保护(VMP)依赖于刚性、基于规则的转换,设计成本高且易受自动化分析攻击。在本工作中,我们提出了第一个具有保护意识的框架,该框架学习了VMP保护代码的鲁棒表示。我们的方法构建了大规模的源代码和标准化VM实现配对数据集,并在指令内部、前序和跨指令层次上引入了依赖关系建模。我们联合优化语言建模与功能意识和保护意识的对比目标,以捕捉语义等价性和保护强度。为了进一步评估鲁棒性,我们提出了一个保护有效性优化任务,该任务量化和排名源自相同源代码的不同VM变体。结合两阶段的持续预训练和微调流程,我们的方法使模型能够生成、比较和推理受保护的代码。广泛的实验表明,我们的框架在各种保护级别上显著提高了鲁棒性,为基于学习的软件防御开辟了新的研究方向。在本工作中,我们提出了ShieldedCode,第一个具有保护意识的框架,学习VMP保护代码的鲁棒表示。我们的方法在L0 VM代码生成上实现了26.95%的Pass@1,比GPT-4o的22.58%高,且在二进制相似性检测Recall@1上比状态最先进方法如jTrans提高了10%。
英文摘要:
Large language models (LLMs) have achieved remarkable progress in code generation, yet their potential for software protection remains largely untapped. Reverse engineering continues to threaten software security, while traditional virtual machine protection (VMP) relies on rigid, rule-based transformations that are costly to design and vulnerable to automated analysis. In this work, we present the first protection-aware framework that learns robust representations of VMP-protected code. Our approach builds large-scale paired datasets of source code and normalized VM implementations, and introduces hierarchical dependency modeling at intra-, preceding-, and inter-instruction levels. We jointly optimize language modeling with functionality-aware and protection-aware contrastive objectives to capture both semantic equivalence and protection strength. To further assess resilience, we propose a protection effectiveness optimization task that quantifies and ranks different VM variants derived from the same source. Coupled with a two-stage continual pre-training and fine-tuning pipeline, our method enables models to generate, compare, and reason over protected code. Extensive experiments show that our framework significantly improves robustness across diverse protection levels, opening a new research direction for learning-based software defense. In this work, we present ShieldedCode, the first protection-aware framework that learns robust representations of VMP-protected code. Our method achieves 26.95% Pass@1 on L0 VM code generation compared to 22.58% for GPT-4o., and improves binary similarity detection Recall@1 by 10% over state of art methods like jTrans.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。