From 768cdde0aaaaff2015385777d5d2d4afe096744f Mon Sep 17 00:00:00 2001 From: yellows111 Date: Sat, 8 Jun 2024 20:57:28 +0100 Subject: [PATCH] add PPE (disabled)/INT urls, fix null deref turns out windows messenger 6.1 can do that, fine. add int domains for patching betas, but leave PPE ones out because theres VERY FEW builds that actually connect to PPE, i know one ships with the alerts sdk but that's probably it --- MSNRedirector/dllmain.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/MSNRedirector/dllmain.cpp b/MSNRedirector/dllmain.cpp index c0415b6..375d99d 100644 --- a/MSNRedirector/dllmain.cpp +++ b/MSNRedirector/dllmain.cpp @@ -17,10 +17,20 @@ INT(WSAAPI * Real_getaddrinfo) (PCSTR pNodeName, PCSTR pServiceName, const ADDRI BOOL ServerNeedsPatching(const char* server) { return ( + /* msn live domains, commonly used */ strcmp(server, "nexus.passport.com") == 0 || strcmp(server, "messenger.hotmail.com") == 0 || strcmp(server, "loginnet.passport.com") == 0 || - strcmp(server, "config.messenger.msn.com") == 0 + strcmp(server, "config.messenger.msn.com") == 0 || + /* msn internal domains, rarely used, common in betas */ + strcmp(server, "nexus.passport-int.com") == 0 || + strcmp(server, "messenger.hotmail-int.com") == 0 || + strcmp(server, "config.messenger.msn-int.com") == 0 /* || */ + /* msn pre-production environment domains, very rarely used */ + /*strcmp(server, "nexus.passport-ppe.com") == 0 || + strcmp(server, "nexus.passporttest.com") == 0 || + strcmp(server, "messenger.hotmail-ppe.com") == 0 || + strcmp(server, "config.messenger.msn-ppe.com") == 0*/ ); } @@ -39,7 +49,8 @@ HINTERNET WINAPI Patched_InternetConnectW(HINTERNET hInternet, LPCWSTR lpszServe } hostent *WSAAPI Patched_gethostbyname(const char* name) { - if (ServerNeedsPatching(name)) { + // somehow things (winmsgr6) can call this with a null pointer and ws2 is fine with it + if (name != NULL && ServerNeedsPatching(name)) { name = MESSENGERSERVICE; } return Real_gethostbyname(name);