#include "stdafx.h"
#include <string.h>
#define PASSWORD "1234567"
int verify_password(char* password)
{
int authenticated;
char buffer[8];
authenticated =strcmp(password,PASSWORD);
strcpy_s(buffer,password);
return authenticated;
}
int main()
{
int valid_flag = 0;
char password[1024];
while (1)
{
printf("please input password: ");
scanf_s("%s",password);
valid_flag = verify_password(password);
if (valid_flag)
{
printf("incorrect password");
}
else
{
printf("successful!");
break;
}
}
return 0;
}
逆向知识的一些补充:
vs2015中寻找main函数步骤:
mainCRTStartup()->(入口点)
__scrt_common_main()->
__scrt_common_main_seh->
invoke_main()->
main(参数个数,参数数组,环境数组);