家庭作业 3.66

由题假设: CNT=A;

struct a_struct{

int idx;

int x[B];

}

c代码可得:

n=*bp+*(bp+4+4A(B+1))

ap=bp+4+4(B+1)i

ap->idx=*(bp+4+4(B+1)i)

ap->x[ap->idx]=bp+4+4(B+1)i+4+4·*(bp+4+4(B+1)i)=n

另反汇编代码可得:

5   i->eax

6   bp->ecx

7   28i->ebx

8   8i->edx

9   7i->edx

10  *(28i+bp+4)+7i->edx

11  *(bp+200)->eax

12  *bp+*(bp+200) ->eax

13  eax->*(edx·4+bp+8)

可轻易看出反汇编代码12行对应c代码第9行,反汇编代码13行对应c代码11行。

故综上可得:

4A(B+1)+4=200且4(B+1)=28

故A=7,B=6。

原文地址:https://www.cnblogs.com/huyufeng/p/4913874.html