+13
-12
@@ -13,6 +13,9 @@
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <consoleapi.h>
|
||||
|
||||
// from: WinBase.h
|
||||
#define CREATE_NO_WINDOW 0x08000000
|
||||
#endif
|
||||
|
||||
#include <processenv.h>
|
||||
@@ -20,9 +23,6 @@
|
||||
#include <processthreadsapi.h>
|
||||
#include <handleapi.h>
|
||||
|
||||
// from: WinBase.h
|
||||
#define CREATE_NO_WINDOW 0x08000000
|
||||
|
||||
bool running = true;
|
||||
TinyMITMProxy* proxy = nullptr;
|
||||
ProxyConfigurator* conf = nullptr;
|
||||
@@ -58,10 +58,11 @@ void StartWatchdog()
|
||||
"rundll32.exe user32.dll,UpdatePerUserSystemParameters;\"",
|
||||
pid);
|
||||
|
||||
STARTUPINFOA si = {sizeof(si)};
|
||||
STARTUPINFOA si;
|
||||
PROCESS_INFORMATION pi;
|
||||
RtlZeroMemory(&si, sizeof(si));
|
||||
RtlZeroMemory(&pi, sizeof(pi));
|
||||
si.cb = sizeof(si);
|
||||
|
||||
CreateProcessA(NULL, const_cast<char*>(psCommand.c_str()), NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si,
|
||||
&pi);
|
||||
@@ -130,14 +131,14 @@ int main()
|
||||
SetConsoleCtrlHandler(consoleHandler, TRUE);
|
||||
StartWatchdog();
|
||||
|
||||
__try
|
||||
{
|
||||
if (!run()) return 1;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
if (conf) conf->clearProxy();
|
||||
}
|
||||
// __try
|
||||
// {
|
||||
if (!run()) return 1;
|
||||
// }
|
||||
// __except (EXCEPTION_EXECUTE_HANDLER)
|
||||
// {
|
||||
// if (conf) conf->clearProxy();
|
||||
// }
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user