int array[] = {2,3,4,5};
00A3355E mov dword ptr [array],2
00A33565 mov dword ptr [ebp-10h],3
00A3356C mov dword ptr [ebp-0Ch],4
00A33573 mov dword ptr [ebp-8],5
int *p =array;
00A3357A lea eax,[array]
00A3357D mov dword ptr [p],eax
printf("%d\t",array[2]);
00A33580 mov esi,esp
00A33582 mov eax,dword ptr [ebp-0Ch]
00A33585 push eax
00A33586 push offset string "%d/t" (0A357A0h)
00A3358B call dword ptr [__imp__printf (0A382C0h)]
00A33591 add esp,8
00A33594 cmp esi,esp
00A33596 call @ILT+315(__RTC_CheckEsp) (0A31140h)
printf("%d\t",p[2]);
00A3359B mov esi,esp
00A3359D mov eax,dword ptr [p]
00A335A0 mov ecx,dword ptr [eax+8]
00A335A3 push ecx
00A335A4 push offset string "%d/t" (0A357A0h)
00A335A9 call dword ptr [__imp__printf (0A382C0h)]
00A335AF add esp,8
00A335B2 cmp esi,esp
00A335B4 call @ILT+315(__RTC_CheckEsp) (0A31140h)
printf("%d\t",*(p+2));
00A335B9 mov esi,esp
00A335BB mov eax,dword ptr [p]
00A335BE mov ecx,dword ptr [eax+8]
00A335C1 push ecx
00A335C2 push offset string "%d/t" (0A357A0h)
00A335C7 call dword ptr [__imp__printf (0A382C0h)]
00A335CD add esp,8
00A335D0 cmp esi,esp
00A335D2 call @ILT+315(__RTC_CheckEsp) (0A31140h)
return 0;
00A335D7 xor eax,eax
数组名本身是一个地址常量
下表寻址是通过(首地址+偏移量)实现
指针本身是个变量,其值才是数组首地址
指针寻址要先取其值,再加偏移