#include <windows.h>
#include <stdio.h>
LPCWSTR StringW=L"error!";/* 失败 */
LPCWSTR StringW1=L"successful!";/* 成功 */
void __declspec(naked) func(void)
{
__asm
{
push MB_OK /* 按钮 */
push NULL /* 标题 */
push StringW /* 信息 */
push NULL /* 窗口句柄 */
push ExitProcess/* 返回地址 */
push MessageBoxW
retn
}
}
void __declspec(naked) function(void)
{
__asm
{
push MB_OK /* 按钮 */
push NULL /* 标题 */
push StringW1 /* 信息 */
push NULL /* 窗口句柄 */
push ExitProcess/* 返回地址 */
push MessageBoxW
retn
}
}
int main(void)
{
FILE *File;
char Key[5];
INT Int;
File=fopen("key.key","r");
if(!File)
__asm int 3
fread(Key,1,sizeof(Key),File);
Int=atoi(Key);
if(Int==12345)
{
fclose(File);
printf("%d\n",Int);
__asm jmp function
}
fclose(File);
__asm jmp func
return 0;
}