Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 07-03-2020, 14:26
jonwil jonwil is offline
VIP
 
Join Date: Feb 2004
Posts: 387
Rept. Given: 2
Rept. Rcvd 21 Times in 9 Posts
Thanks Given: 2
Thanks Rcvd at 65 Times in 34 Posts
jonwil Reputation: 21
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.
Reply With Quote
  #2  
Old 07-03-2020, 19:06
ian ian is offline
Friend
 
Join Date: Jul 2019
Posts: 46
Rept. Given: 1
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 52
Thanks Rcvd at 41 Times in 19 Posts
ian Reputation: 1
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
Reply With Quote
  #3  
Old 09-05-2020, 02:00
floaters floaters is offline
Friend
 
Join Date: Apr 2018
Posts: 9
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 10
Thanks Rcvd at 6 Times in 3 Posts
floaters Reputation: 1
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


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


All times are GMT +8. The time now is 16:21.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )