-
-
[原创]栈溢出笔记(1)
-
发表于:
2015-6-27 12:57
6170
-
#include <stdio.h>
#include <windows.h>
const char * FileName = "reg.txt";
const char * trueCode = "1245";
#define Msg(STR)( MessageBoxA(NULL,STR,NULL,MB_OK))
int _stdcall RegGo()
{
char FileBuf[8];
char cNow;
int nIndex = 0;
FILE *fp;
memset(FileBuf,0,sizeof(FileBuf));
fp=fopen(FileName,"r");
if(fp==NULL)
{
Msg("导入注册文件失败\n");
ExitProcess(-1);
}
fscanf(fp,"%s",FileBuf);
if(!strcmp(trueCode,FileBuf))
{
Msg("你的注册文件输入正确! 恭喜");
return 0;
}
Msg("你的注册文件好像有些问题!");
return 0;
}
int _stdcall WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
RegGo();
MessageBoxA(NULL,"Hello world!\n",NULL,MB_OK);
}
0012FEFC 33DB xor ebx,ebx
0012FEFE 53 push ebx
0012FEFF 68 656C6C6F push 0x6F6C6C65
0012FF04 4C dec esp
0012FF05 C60424 68 mov byte ptr ss:[esp],0x68
0012FF09 8BC4 mov eax,esp
0012FF0B 53 push ebx
0012FF0C 53 push ebx
0012FF0D 50 push eax
0012FF0E 53 push ebx
0012FF0F B8 11EA4077 mov eax,user32.MessageBoxA
0012FF14 FFD0 call eax
0012FF16 B8 7E42FA75 mov eax,KernelBa.ExitProcess
0012FF1B 53 push ebx
0012FF1C FFD0 call eax
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课