In the following picture the line i want to mention is:
mov [esp+eax*4+0Ch], edx
eax is the index in the array. But, where is the address of the array to access?
what does mean this line of code ? (
Usually, when running through an array, we can find the following lines of assembly code:
mov [base_address_of_array + array_index * size_of_an_item_in_array], edx
In your case, my guess would be that the array is on the stack (that is why you find
esp as part of the base address of the array. Then, you also have an offset to
esp which is
0Ch (which is 12 in decimal). So, the array is located at
esp + 0Ch. Then,
eax is the index and
4 is the size of an item in the array (probably an integer of 4 bytes).
If we look at the whole CFG, I would translate it back to C in something like this:
int array; for (int i = 0; i < 4; ++i) array[i] = i;
Note: I supposed that the blue arc in the CFG is getting back to