@@ -21,7 +21,7 @@ int main(int argc, char *argv[]) {
21
21
22
22
#define BUFFER_SIZE 8000
23
23
DWORD buffer_size = BUFFER_SIZE;
24
- wchar_t buffer[BUFFER_SIZE];
24
+ // wchar_t buffer[BUFFER_SIZE];
25
25
26
26
std::wstring config_path;
27
27
std::wstring launch_path;
@@ -35,6 +35,7 @@ int main(int argc, char *argv[]) {
35
35
}*/
36
36
37
37
buffer_size = BUFFER_SIZE;
38
+ /*
38
39
auto status = RegGetValueW(HKEY_CURRENT_USER, L"SOFTWARE\\elgato\\obs", L"",
39
40
RRF_RT_REG_SZ, nullptr, buffer, &buffer_size);
40
41
// Ignore if the value is too long for our buffer. The user can suffer if OBS is installed in a path longer than 8000 characters long
@@ -77,7 +78,7 @@ int main(int argc, char *argv[]) {
77
78
78
79
connect_attempts_remaining = 6;
79
80
}
80
-
81
+ */
81
82
82
83
std::string payload = argv[1 ];
83
84
@@ -86,7 +87,7 @@ int main(int argc, char *argv[]) {
86
87
std::string base_name = " \\\\ .\\ pipe\\ " + pipe_name;
87
88
std::string attempt_name;
88
89
HANDLE pipe = INVALID_HANDLE_VALUE;
89
-
90
+ int connect_attempts_remaining = 6 ;
90
91
while (connect_attempts_remaining-- > 0 &&
91
92
pipe == INVALID_HANDLE_VALUE) {
92
93
pipe_number = 0 ;
@@ -107,13 +108,15 @@ int main(int argc, char *argv[]) {
107
108
}
108
109
if (pipe == INVALID_HANDLE_VALUE) {
109
110
printf (" Could not open named pipe!" );
111
+ while (true ) Sleep (100 );
110
112
return 1 ;
111
113
}
112
114
DWORD mode = PIPE_READMODE_MESSAGE;
113
115
auto success = SetNamedPipeHandleState (pipe, &mode, NULL , NULL );
114
116
if (!success) {
115
117
CloseHandle (pipe);
116
118
printf (" Could not configure named pipe!" );
119
+ while (true ) Sleep (100 );
117
120
return 1 ;
118
121
}
119
122
@@ -123,9 +126,10 @@ int main(int argc, char *argv[]) {
123
126
if (!success || written < payload.size ()) {
124
127
printf (" Failed to write to named pipe!" );
125
128
CloseHandle (pipe);
129
+ while (true ) Sleep (100 );
126
130
return 1 ;
127
131
}
128
-
129
132
CloseHandle (pipe);
133
+ while (true ) Sleep (100 );
130
134
return 0 ;
131
- }
135
+ }
0 commit comments