||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| | 0040101D int 3 0040101E int 3 0040101F int 3 --- J:\CPP_ASM\CPP_ASM.cpp ---------------------------- 1: 2: #include <stdio.h> 3: #include <malloc.h> 4: 5: void asmFunc(int* pAddress); 6: 7: void main() 8: { 00401020 push ebp 00401021 mov ebp,esp 00401023 sub esp,44h 00401026 push ebx 00401027 push esi 00401028 push edi 00401029 lea edi,[ebp-44h] 0040102C mov ecx,11h 00401031 mov eax,0CCCCCCCCh 00401036 rep stos dword ptr [edi] 9: int *pAddress=(int*)malloc(sizeof(int)); 00401038 push 4 0040103A call malloc (00403ee0) 0040103F add esp,4 00401042 mov dword ptr [ebp-4],eax 10: 11: asmFunc(pAddress); 00401045 mov eax,dword ptr [ebp-4] 00401048 push eax 00401049 call @ILT+15(func1) (00401014) 0040104E add esp,4 12: 13: printf("%d\n",*pAddress); 00401051 mov ecx,dword ptr [ebp-4] 00401054 mov edx,dword ptr [ecx] 00401056 push edx 00401057 push offset string "%d\n" (0042210c) 0040105C call printf (0040d6e0) 00401061 add esp,8 14: } 00401064 pop edi 00401065 pop esi 00401066 pop ebx 00401067 add esp,44h 0040106A cmp ebp,esp 0040106C call __chkesp (004010d0) 00401071 mov esp,ebp 00401073 pop ebp 00401074 ret --- No source file ------------------------------ 00401075 int 3 00401076 int 3 00401077 int 3 00401078 int 3 00401079 int 3 0040107A int 3 0040107B int 3 0040107C int 3 0040107D int 3 0040107E int 3 0040107F int 3 --- J:\CPP_ASM\CPP_ASM.cpp ---------------------- 15: 16: void asmFunc(int* pAddress) 17: { 00401080 push ebp 00401081 mov ebp,esp 00401083 sub esp,40h 00401086 push ebx 00401087 push esi 00401088 push edi 00401089 lea edi,[ebp-40h] 0040108C mov ecx,10h 00401091 mov eax,0CCCCCCCCh 00401096 rep stos dword ptr [edi] 18: _asm { 19: push eax 00401098 push eax 20: push ebx 00401099 push ebx 21: push ecx 0040109A push ecx 22: mov eax, 0x0F 0040109B mov eax,0Fh 23: mov ebx, 0x10 004010A0 mov ebx,10h 24: add eax, ebx 004010A5 add eax,ebx 25: mov ecx, pAddress 004010A7 mov ecx,dword ptr [ebp+8] 26: mov [ecx], eax 004010AA mov dword ptr [ecx],eax 27: pop ecx 004010AC pop ecx 28: pop ebx 004010AD pop ebx 29: pop eax 004010AE pop eax 30: } 31: } 004010AF pop edi 004010B0 pop esi 004010B1 pop ebx 004010B2 add esp,40h 004010B5 cmp ebp,esp 004010B7 call __chkesp (004010d0) 004010BC mov esp,ebp 004010BE pop ebp 004010BF ret --- No source file ----------------- 004010C0 int 3 004010C1 int 3 004010C2 int 3 004010C3 int 3 |
汇编1 _ _ C++内嵌汇编
最新推荐文章于 2024-05-12 10:57:39 发布