Let us start here, from square one. No, from Zero!

This commit is contained in:
smpn2
2022-09-30 22:45:51 +09:00
parent 14215af0d1
commit b7a60638a4
1005 changed files with 303069 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#include "sde.h"
#include <thread>
#include "hooks/sleephook.h"
#include "util/logging.h"
void sde_init(std::string sde_path) {
// check trailing slash
if (sde_path.length() > 0 && sde_path.back() == '\\') {
sde_path.pop_back();
}
// get PID
auto pid = GetCurrentProcessId();
// try attach
log_info("sde", "Attaching SDE ({}) to PID {}", sde_path, pid);
std::string cmd = "sde.exe -attach-pid " + to_string(pid);
std::thread t([sde_path, cmd]() {
system((sde_path + "\\" + cmd).c_str());
});
t.detach();
// wait to make sure it went through
Sleep(500);
}