Compare commits
3 Commits
1275adb5fd
...
4c55f7c123
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c55f7c123 | |||
| 0eb7af76d4 | |||
| de76e89ed0 |
@@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 4.1.0)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_FLAGS "/EHsc /D_AMD64_ /DWIN32_LEAN_AND_MEAN") # Set C++ exception handler, define platform and ignore some unused headers
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") # Release debug flags
|
||||
|
||||
project(dbd-unlocker LANGUAGES CXX CSharp)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
||||
#include <processthreadsapi.h>
|
||||
|
||||
std::string randomizeString(size_t length)
|
||||
{
|
||||
const char charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
@@ -131,7 +133,15 @@ bool CertManager::GenerateCA()
|
||||
|
||||
Log::info("Generated new CA key and certificate files. Installing to Windows Root CA store automatically...");
|
||||
|
||||
system("certutil.exe -user -addstore root ca_cert.pem");
|
||||
STARTUPINFOA si = {sizeof(si)};
|
||||
PROCESS_INFORMATION pi;
|
||||
char cmd[] = "certutil.exe -user -addstore root ca_cert.pem";
|
||||
if (CreateProcessA(NULL, cmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
|
||||
{
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user