#1
|
|||
|
|||
Reverse engineering compiled HLSL shaders?
Anyone got any tips (or tools or other things) for reverse engineering compiled D3D HLSL shaders (in this case shader model 5.0 shaders)
More specifically, tools that can decompile such shaders or references on how to turn the ASM back into something easier to understand... Last edited by jonwil; 07-03-2020 at 14:46. |
#2
|
|||
|
|||
FXDIS is a simple Win32 command-line tool written in C/C++ with the MIT license forked from the relatively new (and experimental) Mesa "D3D1X" module.
This tool can disassemble Shader Model 4/5 binary shaders created by Microsoft's DirectX v10/11 shader compiler. Download Link |
#3
|
|||
|
|||
I've had a look at FXDIS once but found it not working/crashing with not so trivial shaders. Also it only outputs assembly and no hlsl, so the result is not that easy to read for something more complex.
Another way is if you can manage to convert the byte code to SPIR-V somehow. There are many great tools to analyze and even decompile SPIR-V back to HLSL and GLSL: SPIRV Cross SPIRV Viewer There is a way to convert DXIL (shader model 6) to SPIRV with dxil-spirv And a way to upgrade d3d byte code to shader model 6 with DirectXShaderCompiler So a way to decompile to GLSL/HLSL is there, but a lot of intermediate steps where things could fail. Good luck |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
iOS Reverse Engineering | sope | General Discussion | 0 | 05-13-2016 13:09 |
Reverse engineering in Linux | taos | General Discussion | 1 | 08-04-2005 21:43 |