Closed JayFoxRox closed 3 years ago
There is likely a bug. P-Code injection is automatic.
Looking at it again, the decompilation is actually correct.
It appears to do a 3x4 matrix multiplication, so the w
components are never written (as indicated by the .xyz
writemask).
They might get filled with garbage, but it shouldn't matter.
It actually seems to keep some flags in matrix[0][3]
, which is also why there's this weird write to param_1[3]
.
Closed.
I'm using the version from #65 with Ghidra 9.2.4 (although I don't think that's causing the issue).
C code generated for Renderware matrix multiplication:
(Let's ignore the weird stuff in
param_1[3]
for now, and focus on `in_vf`)*Relevant disassembly:
As you can see, this writes
vf9
,vf10
,vf11
andvf12
fromvmaddz.xyz
and friends, but the decompiler claims that this write never happens. Therefore it depends onin_vf*
, which is incorrect.Initially I thought P-Code was simply not implemented, but it looks like it should happen here:
https://github.com/beardypig/ghidra-emotionengine/blob/9e55ddaf47377b1fc5e0cea4f4abb4fb246cfda3/src/main/java/ghidra/emotionengine/InjectPayloadVu.java#L441
Do I manually have to trigger P-Code injection or is there a bug?