Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to disassemble Luigi's Mansion: Dark Moon shader code #70

Open
iliasHDZ opened this issue Jun 26, 2024 · 2 comments
Open

Failed to disassemble Luigi's Mansion: Dark Moon shader code #70

iliasHDZ opened this issue Jun 26, 2024 · 2 comments

Comments

@iliasHDZ
Copy link

The disassembler crashes here:

000000dc [--------] ComputeSkinMatrix:
000000dc [0727dc96]     dp3      r9.___w       c93.yyyy    r9.xyzw   16 addr:0;      temp_9 <- const_93, temp_9
000000e0 [3b21901b]     rcp      r9.___w        r9.wwww              1b addr:0;      temp_9 <- temp_9
000000e4 [23219ca3]     mul      r9.xyzw        r9.xyzw    r9.wwww   23 addr:0;      temp_9 <- temp_9, temp_9
000000e8 [48018004]     mova             r8.xyyy               4 addr:0;      out.pos <- temp_8
000000ec [23aaaca4]     mul     r13.xyzw  c10[a0.x].xyzw    r9.xxxx   24 addr:1;      temp_d <- (?), temp_9
000000f0 [23cabca4]     mul     r14.xyzw  c11[a0.x].xyzw    r9.xxxx   24 addr:1;      temp_e <- (?), temp_9
000000f4 [23eacca4]     mul     r15.xyzw  c12[a0.x].xyzw    r9.xxxx   24 addr:1;      temp_f <- (?), temp_9
000000f8 [fdb2aba5]     mad
000000fc [feb2afc5]     mad
00000100 [ffb2b3e5]     mad

I was able to kindof fix it but I don't think i fixed it correctly.

Here's the shader code:
shadercode.zip

@neobrain
Copy link
Owner

Could you provide more information about the crash? Where does it crash? What does the stack trace look like? What did you do to fix it?

@iliasHDZ
Copy link
Author

It crashes right here:

const SwizzlePattern& swizzle = shader_info.swizzle_info[instr.common.operand_desc_id].pattern;

The instr.common.operand_desc_id was some invalid number which is why it crashed. I fixed it by checking if it was a valid index. If not, it skips to the next instruction. There is probably alot of stuff that I'm missing but I don't know much about this code so this was the quick and dirty approach I took.

@iliasHDZ iliasHDZ changed the title Failed to disassemble Luigi's Mansion: Dark Moon shader data Failed to disassemble Luigi's Mansion: Dark Moon shader code Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants