Network Encryption

If you want to add network access to your homebrew application, you have to bypass the network encryption by creating an unencrypted socket. Thanks to Jefff from Team XeDEV!

Code
DWORD dwStatus = XNetGetEthernetLinkStatus; int m_bIsOnline = ( dwStatus & XNET_ETHERNET_LINK_ACTIVE ) != 0; if( !m_bIsOnline ) printf("NO ETHERNET LINK ACTIVE\n"); XNetStartupParams xnsp; memset(&xnsp, 0, sizeof(xnsp)); xnsp.cfgSizeOfStruct = sizeof(XNetStartupParams); xnsp.cfgFlags = XNET_STARTUP_BYPASS_SECURITY; INT iResult = XNetStartup( &xnsp ); if( iResult != NO_ERROR ) printf("XNETSTARTUP ERROR\n"); WSADATA WsaData; iResult = WSAStartup( MAKEWORD( 2, 2 ), &WsaData ); if( iResult != NO_ERROR ) printf("WSASTARTUP ERROR\n"); SOCKET server; sockaddr_in local; local.sin_family=AF_INET; local.sin_addr.s_addr=INADDR_ANY; local.sin_port=htons((u_short)1337); server=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); if(server==INVALID_SOCKET) {  printf( "INVALID SOCKET!\n"); } // after setting these undocumented flags on a socket they should then run unencrypted BOOL bBroadcast = TRUE; if( setsockopt(server, SOL_SOCKET, 0x5802, (PCSTR)&bBroadcast, sizeof(BOOL) ) != 0 )//PATCHED! {  printf( "Failed to set socket to 5802, error\n"); } if( setsockopt(server, SOL_SOCKET, 0x5801, (PCSTR)&bBroadcast, sizeof(BOOL) ) != 0 )//PATCHED! {  printf( "Failed to set socket to 5801, error\n"); } //Socket is now unencrypted, use it as you usually would. // encryption setup run .bat**