|
Array Indexing Qurik
.text:10002D49 mov eax, [esp+arg_0]We don't find any arrays at the locations referenced on lines -D58 and -D6B (in fact we find code) which is unusual: .text:1000EF57 movzx eax, word ptr [esi+18h]Looking closer at the code, the trick lies in the fact that the arrays are not being indexed starting at zero. .text:10002D58 mov eax, dword ptr ds:(loc_1000EF5B+1)[eax*8] ; <- 0x9C40 <= eax < 0x9C90So the first array actually begins at 0x1000EF5B+1+0x9C40*8 == 0x1005D15C, and the second array begins at 0x1000D344+0x0A029*8 == 0x1005D48C. What happened here is that the pointer expression has been simplified to conform to x86's instruction encoding: [1005D15Ch + (eax - 0x9C40) * 8] => [1005D15Ch - 4E200h + eax*8] => [1000EF5Ch + eax*8]This is pretty uncommon; I've only seen it a handful of times in my reversing endeavors over the years. Comments
| ||||||