| 33 | } |
| 34 | |
| 35 | static 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 | |
| 69 | MessageEditor::MessageEditor() |
| 70 | { |