arXiv:2601.20679cs.CL2026-01中稿 · ICLR被引 8

用AI学习虚拟机保护代码的鲁棒表示,提升软件反逆向能力。

ShieldedCode: Learning Robust Representations for Virtual Machine Protected Code

  • 构建源码与虚拟机实现的成对数据集,分层级建模指令依赖关系。
  • 生成代码通过率26.95%(优于GPT-4o的22.58%),检测召回率提升10%。
  • 适合安全研究者和代码保护开发者,推动基于学习的防御新方向。

大型语言模型在代码生成上取得显著进展,但其在软件保护中的潜力尚未被充分挖掘。逆向工程持续威胁软件安全,而传统虚拟机保护(VMP)依赖僵化的规则变换,设计成本高且易被自动化分析破解。本文提出首个面向保护的框架ShieldedCode,学习VMP保护代码的鲁棒表示。方法构建大规模源码与标准化虚拟机实现的配对数据集,引入指令内、前后及跨指令层级的层次化依赖建模。联合优化语言建模与功能感知、保护感知的对比目标,捕捉语义等价性与保护强度。为进一步评估抗性,提出保护有效性优化任务,量化并排序同源的不同虚拟机变体。结合两阶段持续预训练与微调流程,使模型可生成、比较与推理保护代码。大量实验表明,该框架在多种保护级别下显著提升鲁棒性,开辟了基于学习的软件防御新方向。在L0虚拟机代码生成任务中,Pass@1达26.95%,优于GPT-4o的22.58%;二进制相似性检测的Recall@1比jTrans等先进方法提升10%。

原文摘要 · Abstract (English)

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.

代码保护虚拟机LLM安全对抗防御

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。