This repository was archived by the owner on Dec 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEmailCheck.c
More file actions
72 lines (56 loc) · 1.32 KB
/
Copy pathEmailCheck.c
File metadata and controls
72 lines (56 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Email Check for GameSpy
(C) 2017 Arves100
*/
#define _CRT_SECURE_NO_WARNINGS
#include "Common.h"
#include "Socket.h"
SOCKET sock = INVALID_SOCKET;
#define GPSP_IP "gpsp.gamespy.com"
#define GPSP_PORT 29901
int main(int argc, char **argv)
{
char *email = 0, response[GAMESPY_BUFLEN] = { 0 };
char *send1 = "\\valid\\\\email\\", *send2 = "\\partnerid\\0\\gamename\\gslive\\final\\", send[110] = { 0 } ;
int RecvOut = 0;
if (argc < 2)
{
printf("Usage:\n%s <email>\n", argv[0]);
return 0;
}
email = argv[1];
printf("Checking Email: %s\n", email);
if (!socket_init())
return 1;
printf("Connecting...\n");
if (!socket_connect(GPSP_IP, GPSP_PORT, &sock))
return 1;
printf("Connected!\n");
strcpy_s(send, _countof(send), send1);
strcat(send, email);
strcat(send, send2);
printf("Sending data...\n");
if (!socket_send(sock, send, (unsigned)(strlen(send) + 1)))
return 1;
printf("Receiving data...\n");
if (!socket_recv(sock, response, &RecvOut))
return 1;
if (RecvOut <= 0)
return 1;
if (strcmp(response, "\\vr\\1\\final\\") == 0)
{
printf("Email is valid!\n");
}
else if (strcmp(response, "\\vr\\0\\final\\") == 0)
{
printf("Email is not valid!\n");
}
else
{
printf("Unknown response: %s\n", response);
}
shutdown(sock, SB_BOTH);
closesocket(sock);
socket_destroy();
return 0;
}