Introduction: Decompilers are useful tools for software analysis and support in the absence of source code. They are available for many hardware architectures and programming languages. However, none of the existing decompilers support modern AMD GPU architectures such as AMD GCN and RDNA. Purpose: We aim at developing the first assembly decompiler tool for a modern AMD GPU architecture that generates code in the OpenCL language, which is widely used for programming GPGPUs. Results: We developed the algorithms for the following operations: preprocessing assembly code, searching data accesses, extracting system values, decompiling arithmetic operations and recovering data types. We also developed templates for decompilation of branching operations. Practical relevance: We implemented the presented algorithms in Python as a tool called OpenCLDecompiler, which supports a large subset of AMD GCN instructions. This tool automatically converts disassembled GPGPU code into the equivalent OpenCL code, which reduces the effort required to analyze assembly code.
翻译:在没有源代码的情况下,解压缩器是软件分析和支持的有用工具。 它们可用于许多硬件架构和编程语言。 但是,现有的解压缩器都没有支持现代AMD GCN 和 RDNA 。 目的 : 我们的目标是为现代 AMD GCN 和 RDNA 的解压缩器架构开发第一个解压缩器工具, 用于生成以 OpenCL 语言生成代码的 AMD GPU 的现代 AMD GPU 架构, 该架构被广泛用于编程 GPGPPPU 。 结果 : 我们为以下操作开发了算法: 预处理组码、 搜索数据存取、 提取系统值、 解压缩算术操作和 恢复数据类型。 我们还开发了分解分支操作的模板 。 实际相关性 : 我们实施了 Python 中提供的算法, 作为名为 OponCLDDecompil 的工具, 支持大量解构件 GPGCN 指令。 这个工具自动将 GPGPU 代码转换成等码,, 从而减少了分析组装码所需的努力 。