I have come across the following instructions:
mov ecx, [ebp + var_4]
imul ecx, 4
call dword_1423d4[ecx]
Can someone explain to me what it possibly means or point me in the right direction? Why is the call made to a variable?
I have come across the following instructions:
mov ecx, [ebp + var_4]
imul ecx, 4
call dword_1423d4[ecx]
Can someone explain to me what it possibly means or point me in the right direction? Why is the call made to a variable?
dword_1423d4 is a pointer to a global array of 32-bit function pointers.
var_4 is an index into this array.
The call instruction calls the function at index var_4 in the dword_1423d4 function array.
switch statements are typically compiled to use jmp, not call, but I suppose a compiler might choose the latter in some circumstances.
– Jason Geffner
Jun 25 '13 at 21:53
switch statement (or anything aside from a real function call, for that matter) on x86 implemented with a call instruction.
– Jonathon Reinhart
Jun 28 '13 at 05:41
What immediately comes to mind is some type of virtualization layer accessing an IAT or IVT. I absolutely agree with the previous answer that this is a call to a function vector in an array of function pointers. I also agree that it does not look like a switch statement. That's what takes me down the interrupt vector table/address table.