MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / ContainsAuthenticationToken

Function ContainsAuthenticationToken

src/windows/MessageEditor.cpp:35–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static BOOL ContainsAuthenticationToken(TCHAR* str)
36{
37 const DWORD LengthToken = 58;
38 const DWORD PlaceFirstSep = 23;
39 const DWORD PlaceSecondSep = 30;
40 DWORD Length = 0;
41 for (; str[Length] != 0; Length++);
42
43 if (Length < LengthToken) return FALSE;
44
45 for (DWORD i = 0; i <= Length - LengthToken; i++)
46 {
47 if (str[i + PlaceFirstSep] != L'.' || str[i + PlaceSecondSep] != L'.')
48 continue;
49
50 bool fake = false;
51 for (DWORD j = 0; j < LengthToken; j++)
52 {
53 if (j == PlaceFirstSep || j == PlaceSecondSep)
54 continue;
55
56 if (strchr("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_", (char)str[i + j]) == NULL) {
57 fake = true;
58 break;
59 }
60 }
61
62 if (!fake)
63 return TRUE;
64 }
65
66 return FALSE;
67}
68
69MessageEditor::MessageEditor()
70{

Callers 1

TryToSendMessageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected