In this work, we evolve Assembly code for the CodeGuru competition. The goal is to create a survivor -- an Assembly program that runs the longest in shared memory, by resisting attacks from adversary survivors and finding their weaknesses. For evolving top-notch solvers, we specify a Backus Normal Form (BNF) for the Assembly language and synthesize the code from scratch using Genetic Programming (GP). We evaluate the survivors by running CodeGuru games against human-written winning survivors. Our evolved programs found weaknesses in the programs they were trained against and utilized them. To push evolution further, we implemented memetic operators that utilize machine learning to explore the solution space effectively. This work has important applications for cyber-security as we utilize evolution to detect weaknesses in survivors. The Assembly BNF is domain-independent; thus, by modifying the fitness function, it can detect code weaknesses and help fix them. Finally, the CodeGuru competition offers a novel platform for analyzing GP and code evolution in adversarial environments. To support further research in this direction, we provide a thorough qualitative analysis of the evolved survivors and the weaknesses found.
翻译:本文针对CodeGuru竞赛中的汇编代码进行演化研究。我们的目标是创建生存者——一种能在共享内存中运行最久的汇编程序,通过抵御对手生存者的攻击并发现其弱点。为演化出顶尖求解器,我们为汇编语言定义了巴科斯范式(BNF),并使用遗传编程(GP)从零开始合成代码。通过让演化程序与人类编写的获胜生存者进行CodeGuru对战来评估其性能。我们演化的程序成功发现了训练对手程序中的弱点并加以利用。为进一步推动演化进程,我们实现了利用机器学习有效探索解空间的模因算子。该研究对网络安全具有重要应用价值,因为我们利用演化来检测生存者中的弱点。所提出的汇编BNF是领域无关的,因此通过调整适应度函数,既能检测代码弱点,也能辅助修复。最后,CodeGuru竞赛为分析对抗环境下的遗传编程与代码演化提供了新型平台。为支持该方向的后续研究,我们对演化生存者及其发现的弱点进行了详尽的定性分析。