滴水c
c汇编
#include <stdio.h>int main() {__asm {mov eax,eaxmov eax,eaxmov eax, eaxmov eax, eaxmov eax, eaxmov eax, eax}return 0;}
#include <stdio.h>int main() {00681740 push ebp00681741 mov ebp,esp00681743 sub esp,0C0h00681749 push ebx0068174A push esi0068174B push edi0068174C lea edi,[ebp-0C0h]00681752 mov ecx,30h00681757 mov eax,0CCCCCCCCh0068175C rep stos dword ptr es:[edi]__asm {mov eax,eax0068175E mov eax,eaxmov eax,eax00681760 mov eax,eaxmov eax, eax00681762 mov eax,eaxmov eax, eax00681764 mov eax,eaxmov eax, eax00681766 mov eax,eaxmov eax, eax00681768 mov eax,eax}return 0;0068176A xor eax,eax}0068176C pop edi0068176D pop esi0068176E pop ebx0068176F add esp,0C0h00681775 cmp ebp,esp00681777 call __RTC_CheckEsp (0681230h)0068177C mov esp,ebp0068177E pop ebp0068177F ret
c汇编调用
#include <stdio.h>int plus(int x, int y){return 0;}int main() {__asm {mov eax,eaxmov eax,eax}//调用函数plus(1,2);return 0;}
int main() {00B21750 push ebp00B21751 mov ebp,esp00B21753 sub esp,0C0h00B21759 push ebx00B2175A push esi00B2175B push edi00B2175C lea edi,[ebp-0C0h]00B21762 mov ecx,30h00B21767 mov eax,0CCCCCCCCh00B2176C rep stos dword ptr es:[edi]__asm {mov eax,eax00B2176E mov eax,eaxmov eax,eax00B21770 mov eax,eax}//调用函数plus(1,2);00B21772 push 200B21774 push 100B21776 call _plus (0B211B3h)00B2177B add esp,8return 0;00B2177E xor eax,eax}00B21780 pop edi00B21781 pop esi00B21782 pop ebx00B21783 add esp,0C0h00B21789 cmp ebp,esp00B2178B call __RTC_CheckEsp (0B21235h)00B21790 mov esp,ebp00B21792 pop ebp00B21793 ret00B211B3 jmp plus (0B217B0h)#include <stdio.h>int plus(int x, int y){00B217B0 push ebp00B217B1 mov ebp,esp00B217B3 sub esp,0C0h00B217B9 push ebx00B217BA push esi00B217BB push edi00B217BC lea edi,[ebp-0C0h]00B217C2 mov ecx,30h00B217C7 mov eax,0CCCCCCCCh00B217CC rep stos dword ptr es:[edi]00B217CE mov ecx,offset _8392E4F9_main@c (0B2C003h)00B217D3 call @__CheckForDebuggerJustMyCode@4 (0B2130Ch)return 0;00B217D8 xor eax,eax}00B217DA pop edi00B217DB pop esi00B217DC pop ebx00B217DD add esp,0C0h00B217E3 cmp ebp,esp00B217E5 call __RTC_CheckEsp (0B21235h)00B217EA mov esp,ebp00B217EC pop ebp00B217ED ret
c参数传递与返回值
#include <stdio.h>int plus(int x, int y){002A17B0 push ebp002A17B1 mov ebp,esp002A17B3 sub esp,0C0h002A17B9 push ebx002A17BA push esi002A17BB push edi002A17BC lea edi,[ebp-0C0h]002A17C2 mov ecx,30h002A17C7 mov eax,0CCCCCCCCh002A17CC rep stos dword ptr es:[edi]002A17CE mov ecx,offset _8392E4F9_main@c (02AC003h)002A17D3 call @__CheckForDebuggerJustMyCode@4 (02A130Ch)return x+y;002A17D8 mov eax,dword ptr [x]002A17DB add eax,dword ptr [y]}002A17DE pop edi002A17DF pop esi002A17E0 pop ebx002A17E1 add esp,0C0h002A17E7 cmp ebp,esp002A17E9 call __RTC_CheckEsp (02A1235h)002A17EE mov esp,ebp002A17F0 pop ebp002A17F1 ret
c 变量
- 全局变量

#include <stdio.h>#include <Windows.h>int y;//全局变量int plus(){int x;x=1234567;return 0;}int main() {//入口函数plus();//函数瞬间执行完很难找到函数中的局部变量 1234567//想找到只能人为延长函数执行时间// int plus(){// int x;// x=1234567;// while (1)// {// Sleep(3000);// printf("%d\n", x);// }// return 0;// }while (1){Sleep(3000);printf("%d\n", x);}return 0;}
