char* p1;
char** p2;
char*** p3;
char**** p4;
char***** p5;
char****** p6;
char******* p7;
char c =*p1;
mov eax,dword ptr[ebp-4]
mov cl,byte ptr[eax]
mov byte ptr[ebp-20h],cl
cdcall stdcall fastcall
cacall :外平栈,参数反过来
printf("%d %d\n",*(p1+0),p1[0]) //三个参数
mov ecx,dword ptr[ebp-4]
movsx edx,byte ptr[ecx] p1[0]生成
push edx
mov eax,dword ptr[ebp-4]
movsx ecx,byte ptr[eax] //*(p1+0)生成
push
ecx
push offset string "%d %d \n"
call printf
add esp,0ch//平栈0c=12 =3*4
//*p==*(p+0)==p[0]==*(p+i)==p[i]
printf("%d %d\n",*(p1+0),p1[0])
printf("%d %d\n",*(*(p1+2)),p1[2])//无法编译,char* *p为char char前面不可以加*了
printf("%d\n",*p2);
printf("%d\n",*(*p2));
mov eax,dword ptr[ebp-8]
mov ecx,dword ptr[eax]
movsx dex,byte ptr[ecx]
push edx;
printf("%d %d\n",*(*(p2+0)),*(*(p2+0)+0));
mov eax,dword ptr[ebp-8]
mov ecx,dword ptr[eax]
movsx edx,byte ptr[ecx]
push edx
mov eax,dword ptr[ebp-8]
mov ecx,dword ptr[eax]
mov edx,byte ptr[edx]
push edx
printf("%d\n",*(p2+1));
mov eax,dword ptr[ebp-8]
mov ecx,dword ptr[eax+4]
movsx edx,byte ptr[ecx]
push edx
printf("%d\n",*(*(p2+1)+1));
//猜测汇编
mov eax,dword ptr[ebp-8]//初值赋值忘记了
mov ecx,dword ptr[eax+4]
mov edx,dword ptr[ecx+1]
mov ecx,byte ptr[edx]
push ecx
printf("%d\n",*(*(p2+2)+3));
//copy
mov eax,dword ptr[ebp-8]
mov ecx,dword ptr[eax+8]
mov edx,dword ptr[ecx+3]
mov ecx,byte ptr[edx]
push ecx
printf("%d %d\n",*(*(p2+2)+3),p2[2][3]);
//在编译器眼中,可以用*去值可以用[]取值,编译器完全一样
printf("%d\n",*p3);
//猜测汇编
mov eax,dword ptr[ebp-8]
mov ecx,dword ptr[eax]
push ecx
printf("%d\n",*(*p3));//*(*p3) char* 类型
mov eax,dword ptr[ebp-0ch]
mov ecx, dword ptr[eax]
mov edx, dword ptr[ecx]
push edx
printf("%d\n",*(*(*p3)));
mov eax,dword ptr[ebp-0ch]
mov ecx, dword ptr[eax]
mov edx, dword ptr[ecx]
movsx eax,byte ptr[edx]
push eax
printf("%d\n",*(*(*(p3+1)+2)+3));
printf("%d %d\n",*(*(*(p3+1)+2)+3),p3[1][2][3]);
//如果是int,+4+8+0ch
int i=100;
int* p1=&i;
printf("%d\n",*(p1+0));
printf("%d\n",p1[0]);
int i =100;
int* p1;
int** p2;
p1=&i; //i的地址赋值给p1 汇编指令:lea取地址
p2=&p1; //取p1的地址给p2 lea
printf("%d\n",*(*(p2)));
mov edx,dword ptr[ebp-0ch]
mov eax,dword ptr[edx]
mov ecx,dword ptr[eax]
push ecx
int main(int argc,char* argv[]){
int arr[16]={
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
}
int (*p2)[2];
px=(int (*)[2])arr;
printf("%d\n",*px);//数组地址
printf("%d\n",*(*px));//1
printf("%d\n",*(*(px+1)+1));//结果是4
printf("%d\n",*(*(px+3)+3));//10
printf("%d\n",px[3][3]));//10
}
int (*p2)[2];
printf("% %d\n",px,*px);//都是地址 px和*px存的值一样 px与*px宽度不同