Skip to content
Free planNo credit card requiredStart writing

article · Proceedings of the AAAI Conference on Artificial Intelligence · 2025

Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation

Seyedreza Mohseni, Siamak Mohammadi, Deepa Tilwani, Yash Saxena, Gerald Ketu Ndawula, Sriram Vema, Edward Raff, Manas Gaur

Cited by 9Open access

Abstract

Malware authors often employ code obfuscations to make their malware harder to detect. Existing tools for generating obfuscated code often require access to the original source code (e.g., C++ or Java), and adding new obfuscations is a non-trivial, labor-intensive process. In this study, we ask the following question: Can Large Language Models (LLMs) potentially generate a new obfuscated assembly code? If so, this poses a risk to anti-virus engines and potentially increases the flexibility of attackers to create new obfuscation patterns. We answer this in the affirmative by developing the MetamorphASM benchmark comprising MetamorphASM Dataset (MAD) along with three code obfuscation techniques: dead code, register substitution, and control flow change. The MetamorphASM systematically evaluates the ability of LLMs to generate and analyze obfuscated code using MAD, which contains 328,200 obfuscated assembly code samples. We release this dataset and analyze the success rate of various LLMs (e.g., GPT-3.5/4, GPT-4o-mini, Starcoder, CodeGemma, CodeLlama, CodeT5, and LLaMA 3.1) in generating obfuscated assembly code. The evaluation was performed using established information-theoretic metrics and manual human review to ensure correctness and provide the foundation for researchers to study and develop remediations to this risk.

Cite this paper

APA 7

Mohseni, S., Mohammadi, S., Tilwani, D., Saxena, Y., Ndawula, G. K., Vema, S., Raff, E., & Gaur, M. (2025). Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation. Proceedings of the AAAI Conference on Artificial Intelligence, 39(23), 24893–24901. https://doi.org/10.1609/aaai.v39i23.34672

MLA 9

Mohseni, Seyedreza, et al. “Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation.” Proceedings of the AAAI Conference on Artificial Intelligence, vol. 39, no. 23, 2025, pp. 24893–901, https://doi.org/10.1609/aaai.v39i23.34672.

Chicago

Mohseni, Seyedreza, Siamak Mohammadi, Deepa Tilwani, Yash Saxena, Gerald Ketu Ndawula, Sriram Vema, Edward Raff, and Manas Gaur. 2025. “Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation.” Proceedings of the AAAI Conference on Artificial Intelligence 39 (23): 24893–901. https://doi.org/10.1609/aaai.v39i23.34672.

Harvard

Mohseni, S. et al. (2025) ‘Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation’, Proceedings of the AAAI Conference on Artificial Intelligence, 39(23), pp. 24893–24901. Available at: https://doi.org/10.1609/aaai.v39i23.34672.

BibTeX
@article{mohseni2025llms,
  title = {{Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation}},
  author = {Mohseni, Seyedreza and Mohammadi, Siamak and Tilwani, Deepa and Saxena, Yash and Ndawula, Gerald Ketu and Vema, Sriram and Raff, Edward and Gaur, Manas},
  journal = {Proceedings of the AAAI Conference on Artificial Intelligence},
  volume = {39},
  number = {23},
  pages = {24893--24901},
  year = {2025},
  doi = {10.1609/aaai.v39i23.34672}
}

Made from the index record. Check names, capitalisation and page numbers against the paper. Need another style? AI for Research has over 10,000.