I've been a bit stumped recently on my decomp work. I've not dealt with C in depth nor have I dealt with IDA's pseudocode system very much at all. I understand asm, but because of how IDA merges instructions together in its pseudocode system, I'm having some trouble finding out how this translates.
In my pseudocode I have the following line:
// v1 is a pointer to RDI (stored as a single in pseudocode)
// v7 is a pointer to R8 (stored as a single in pseudocode)
// v10 is XMM1 (single)
v1[1818] = (float)(v10 * (float)(*v7 - v7[1])) + v7[1];
I'm having trouble understanding what the square brackets do. I was thinking that it was an offset (e.g. "set the data at the location of v1 in memory + 1818i64 bytes to...") but the asm doesn't match up with that addr. What's the difference between setting v1 =
vs setting v1[1818] =
?
movss dword ptr [rdi+1C68h], xmm1
--rdi+1C68h
is indeed the right location after doing RDI+(4*1818i16). – Xan the Dragon Sep 26 '19 at 3:29