diff --git a/.gitignore b/.gitignore index 614b6a7..cca08d2 100644 --- a/.gitignore +++ b/.gitignore @@ -266,3 +266,5 @@ paket-files/ *.wixobj /OCAT-Installer/redist +/GameOverlay/vulkan/src/vk.xml +/GameOverlay/vulkan/src/vk_dispatch_defs.h \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e637da7..92a482f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ variables: PLATFORM_TOOLSET: v141 - OCAT_VERSION: 1.6.1 + OCAT_VERSION: 1.6.2 stages: - build diff --git a/.mailmap b/.mailmap deleted file mode 100644 index 42b9f15..0000000 --- a/.mailmap +++ /dev/null @@ -1 +0,0 @@ -dbaumeister amddb \ No newline at end of file diff --git a/COPYING b/COPYING deleted file mode 100644 index b734541..0000000 --- a/COPYING +++ /dev/null @@ -1 +0,0 @@ -See docs/source/license.rst for license information. \ No newline at end of file diff --git a/Commons/Commons.vcxproj b/Commons/Commons.vcxproj index fb89500..bcbd07b 100644 --- a/Commons/Commons.vcxproj +++ b/Commons/Commons.vcxproj @@ -19,7 +19,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -77,20 +77,20 @@ 15.0 {62089454-A7BA-4416-9E4B-EB0085797582} Commons - 10.0.17134.0 + 10.0.19041.0 StaticLibrary true - v141 + v142 Unicode false StaticLibrary false - v141 + v142 true Unicode false @@ -98,14 +98,14 @@ StaticLibrary true - v141 + v142 Unicode false StaticLibrary false - v141 + v142 true Unicode false diff --git a/Commons/Commons.vcxproj.filters b/Commons/Commons.vcxproj.filters index cb3140b..ca6c1ba 100644 --- a/Commons/Commons.vcxproj.filters +++ b/Commons/Commons.vcxproj.filters @@ -63,7 +63,7 @@ Utility - + Config @@ -140,7 +140,7 @@ Utility - + Config diff --git a/Commons/Config/BlackList.cpp b/Commons/Config/DenyList.cpp similarity index 69% rename from Commons/Config/BlackList.cpp rename to Commons/Config/DenyList.cpp index 0015db5..8c7d236 100644 --- a/Commons/Config/BlackList.cpp +++ b/Commons/Config/DenyList.cpp @@ -20,7 +20,7 @@ // SOFTWARE. // -#include "BlackList.h" +#include "DenyList.h" #include "../Utility/ProcessHelper.h" #include "../Utility/FileDirectory.h" #include "../Logging/MessageLog.h" @@ -28,66 +28,66 @@ #include -void BlackList::Load() +void DenyList::Load() { if (loaded_) return; - const std::wstring defaultBlackList = - g_fileDirectory.GetDirectory(DirectoryType::Config) + L"defaultBlackList.txt"; + const std::wstring defaultDenyList = + g_fileDirectory.GetDirectory(DirectoryType::Config) + L"defaultDenyList.txt"; - std::wifstream file(defaultBlackList); + std::wifstream file(defaultDenyList); if (file.is_open()) { // check for version number - // if we know app version and it differs from default blacklist version -> update + // if we know app version and it differs from default denylist version -> update std::wstring version; std::getline(file, version); if (version_.empty() || ConvertUTF16StringToUTF8String(version).compare(version_) == 0) { - // at this point the correct version number should be the one parsed from the blackList file + // at this point the correct version number should be the one parsed from the denyList file version_ = ConvertUTF16StringToUTF8String(version); for (std::wstring line; std::getline(file, line);) { - blackList_.push_back(line); + denyList_.push_back(line); } - g_messageLog.LogInfo("BlackList", "Blacklist file loaded"); + g_messageLog.LogInfo("DenyList", "Denylist file loaded"); } else { file.close(); - CreateDefault(defaultBlackList); + CreateDefault(defaultDenyList); } } else { - CreateDefault(defaultBlackList); + CreateDefault(defaultDenyList); } - const std::wstring userBlackList = - g_fileDirectory.GetDirectory(DirectoryType::Config) + L"userBlackList.txt"; - std::wifstream userfile(userBlackList); + const std::wstring userDenyList = + g_fileDirectory.GetDirectory(DirectoryType::Config) + L"userDenyList.txt"; + std::wifstream userfile(userDenyList); if (userfile.is_open()) { for (std::wstring line; std::getline(userfile, line);) { - blackList_.push_back(line); + denyList_.push_back(line); } - g_messageLog.LogInfo("BlackList", "Blacklist file loaded"); + g_messageLog.LogInfo("DenyList", "Denylist file loaded"); } else { - CreateUserBlackList(userBlackList); + CreateUserDenyList(userDenyList); } loaded_ = true; } -bool BlackList::Contains(const std::wstring& value) const +bool DenyList::Contains(const std::wstring& value) const { // ignore system processes without names if (value.empty()) { return true; } - for (auto& entry : blackList_) { + for (auto& entry : denyList_) { if (_wcsicmp(entry.c_str(), value.c_str()) == 0) { return true; } @@ -95,23 +95,23 @@ bool BlackList::Contains(const std::wstring& value) const return false; } -std::vector BlackList::GetBlackList() +std::vector DenyList::GetDenyList() { - std::vector blackList; - blackList.reserve(blackList_.size()); - for (const auto& item : blackList_) + std::vector denyList; + denyList.reserve(denyList_.size()); + for (const auto& item : denyList_) { - blackList.push_back(ConvertUTF16StringToUTF8String(item)); + denyList.push_back(ConvertUTF16StringToUTF8String(item)); } - return blackList; + return denyList; } -void BlackList::CreateDefault(const std::wstring& fileName) +void DenyList::CreateDefault(const std::wstring& fileName) { - g_messageLog.LogInfo("BlackList", "Create default blackList file"); + g_messageLog.LogInfo("DenyList", "Create default denyList file"); /* TODO: properly separate and document this list */ - blackList_ = {ConvertUTF8StringToUTF16String(version_), + denyList_ = {ConvertUTF8StringToUTF16String(version_), L"dwm.exe", L"explorer.exe", L"firefox.exe", L"chrome.exe", L"taskhostw.exe", L"notepad.exe", L"RadeonSettings.exe", L"Nvidia Share.exe", L"devenv.exe", L"Outlook.exe", L"Excel.exe", @@ -123,26 +123,26 @@ void BlackList::CreateDefault(const std::wstring& fileName) L"OculusClient.exe", L"IAStorIcon.exe", L"conhost.exe", L"Agent.exe", L"Slack.exe", L"Code.exe", L"powershell.exe", L"python.exe", L"conda.exe", L"wmic.exe", L"onenote.exe", L"SearchProtocolHost.exe", L"lync.exe", L"taskmgr.exe", L"teams.exe", L"SpeechRuntime.exe", - L"ApplicationFrameHost.exe", L"LogonUI.exe", L"winword.exe" , L"powerpnt.exe" + L"ApplicationFrameHost.exe", L"LogonUI.exe", L"winword.exe" , L"powerpnt.exe", L"Launcher.exe" }; std::wofstream file(fileName); if (file.is_open()) { - for (auto& value : blackList_) + for (auto& value : denyList_) { file << value << std::endl; } } else { - g_messageLog.LogError("BlackList", "Unable to create default blackList file"); + g_messageLog.LogError("DenyList", "Unable to create default denyList file"); } } -void BlackList::CreateUserBlackList(const std::wstring& fileName) +void DenyList::CreateUserDenyList(const std::wstring& fileName) { - g_messageLog.LogInfo("BlackList", "Create user blackList file"); + g_messageLog.LogInfo("DenyList", "Create user denyList file"); std::wofstream file(fileName); if (file.is_open()) { @@ -150,6 +150,6 @@ void BlackList::CreateUserBlackList(const std::wstring& fileName) } else { - g_messageLog.LogError("BlackList", "Unable to create user blackList file"); + g_messageLog.LogError("DenyList", "Unable to create user denyList file"); } } diff --git a/Commons/Config/BlackList.h b/Commons/Config/DenyList.h similarity index 86% rename from Commons/Config/BlackList.h rename to Commons/Config/DenyList.h index 03d9933..74cf1b8 100644 --- a/Commons/Config/BlackList.h +++ b/Commons/Config/DenyList.h @@ -26,20 +26,20 @@ #include #include -class BlackList +class DenyList { public: - // Tries to load the black list, creates a default file if none is found + // Tries to load the deny list, creates a default file if none is found void Load(); bool Contains(const std::wstring& value) const; - std::vector GetBlackList(); + std::vector GetDenyList(); void SetVersion(std::string version) { version_ = version; } std::string GetVersion() { return version_; } private: void CreateDefault(const std::wstring& fileName); - void CreateUserBlackList(const std::wstring& fileName); + void CreateUserDenyList(const std::wstring& fileName); bool loaded_ = false; - std::vector blackList_; + std::vector denyList_; std::string version_; }; \ No newline at end of file diff --git a/Commons/Overlay/Overlay.cpp b/Commons/Overlay/Overlay.cpp index f9a2263..3b2cba9 100644 --- a/Commons/Overlay/Overlay.cpp +++ b/Commons/Overlay/Overlay.cpp @@ -43,9 +43,10 @@ Overlay::Overlay() typedef LONG(*PStartUWPProcessWithOverlay) (const wchar_t*); -bool Overlay::StartProcess(const std::wstring& path, std::wstring& cmdArgs, bool enableOverlay) +bool Overlay::StartProcess(const std::wstring& path, const std::wstring& workingDirectory, std::wstring& cmdArgs, bool enableOverlay) { - const auto processStartedStatus = CreateDesktopProcess(path, cmdArgs, enableOverlay); + const auto processStartedStatus = + CreateDesktopProcess(path, workingDirectory, cmdArgs, enableOverlay); // UWP app detected if (processStartedStatus == ERROR_APPCONTAINER_REQUIRED) { @@ -107,11 +108,19 @@ const DWORD Overlay::GetProcessID() const return processID_; } -DWORD Overlay::CreateDesktopProcess(const std::wstring& path, std::wstring& cmdArgs, bool enableOverlay) +DWORD Overlay::CreateDesktopProcess(const std::wstring& path, const std::wstring& workingDirectory, std::wstring& cmdArgs, bool enableOverlay) { g_messageLog.LogInfo("Overlay", L"Trying to start executable " + path + L" cmdArgs " + cmdArgs); - const auto directory = GetDirFromPathSlashes(path); + std::wstring directory; + if (workingDirectory.empty()) { + // if user did not set a working directory manual, try the one in which the executable lives + directory = GetDirFromPathSlashes(path); + } + else { + directory = workingDirectory; + } + if (directory.empty()) return ERROR_PATH_NOT_FOUND; VK_Environment environment; diff --git a/Commons/Overlay/Overlay.h b/Commons/Overlay/Overlay.h index fbf0fbe..5a06c0d 100644 --- a/Commons/Overlay/Overlay.h +++ b/Commons/Overlay/Overlay.h @@ -33,7 +33,8 @@ class Overlay { // Starts the given executable and suspends the process to load the overlay dll // if failed the process will be resumed without overlay - bool StartProcess(const std::wstring& path, std::wstring& cmdArgs, bool enableOverlay); + bool StartProcess(const std::wstring& path, + const std::wstring& workingDirectory, std::wstring& cmdArgs, bool enableOverlay); void Stop(); // returns the process name, empty if no process is attached @@ -43,7 +44,9 @@ class Overlay { private: // Returns ERROR_SUCCES if a normal process was started, ERROR_APPCONTAINER_REQUIRED if tried to // start uwp app - DWORD CreateDesktopProcess(const std::wstring& path, std::wstring& cmdArgs, bool enableOverlay); + DWORD CreateDesktopProcess(const std::wstring& path, + const std::wstring& workingDirectory, std::wstring& cmdArgs, + bool enableOverlay); void SetProcessInfo(DWORD id); PROCESS_INFORMATION processInfo_{}; diff --git a/Commons/Overlay/OverlayInterface.cpp b/Commons/Overlay/OverlayInterface.cpp index 2d6c093..8be1b89 100644 --- a/Commons/Overlay/OverlayInterface.cpp +++ b/Commons/Overlay/OverlayInterface.cpp @@ -57,12 +57,12 @@ bool OverlayInterface::Init(HWND hwnd) return true; } -void OverlayInterface::StartProcess(const std::wstring& executable, std::wstring& cmdArgs) +void OverlayInterface::StartProcess(const std::wstring& executable, const std::wstring& workingDirectory, std::wstring& cmdArgs) { g_messageLog.LogInfo("OverlayInterface", "Start single process"); g_ProcessFinished = false; g_CaptureAll = false; - if (overlay_.StartProcess(executable, cmdArgs, true)) + if (overlay_.StartProcess(executable, workingDirectory, cmdArgs, true)) { processTermination_.Register(overlay_.GetProcessID()); } diff --git a/Commons/Overlay/OverlayInterface.h b/Commons/Overlay/OverlayInterface.h index 9c39ea3..d2c3078 100644 --- a/Commons/Overlay/OverlayInterface.h +++ b/Commons/Overlay/OverlayInterface.h @@ -36,7 +36,7 @@ class OverlayInterface bool Init(HWND hwnd); - void StartProcess(const std::wstring& executable, std::wstring& cmdArgs); + void StartProcess(const std::wstring& executable, const std::wstring& workingDirectory, std::wstring& cmdArgs); void StartGlobal(); void StopCapture(std::vector overlayThreads); void FreeInjectedDlls(std::vector injectedProcesses); diff --git a/DLLInjector/DLLInjector.vcxproj b/DLLInjector/DLLInjector.vcxproj index cd27611..773f6ab 100644 --- a/DLLInjector/DLLInjector.vcxproj +++ b/DLLInjector/DLLInjector.vcxproj @@ -22,34 +22,34 @@ {2CB4EFA8-1B5D-4BF8-AE28-8F42B99A740E} Win32Proj DLLInjector - 10.0.17134.0 + 10.0.19041.0 Application true Unicode - v141 + v142 Application false true Unicode - v141 + v142 Application true Unicode - v141 + v142 Application false true Unicode - v141 + v142 diff --git a/Frontend/Frontend.csproj b/Frontend/Frontend.csproj index 28b46ef..c3935f3 100644 --- a/Frontend/Frontend.csproj +++ b/Frontend/Frontend.csproj @@ -60,12 +60,6 @@ ocat.ico - - 1.1.3.3 - - - 1.1.3.3 - @@ -187,6 +181,10 @@ xcopy /y /d "$(SolutionDir)$(Platform)\$(Configuration)\OxyPlot*.dll" "$(SolutionDir)$(Platform)\$(Configuration)\Bin" xcopy /y /d "$(SolutionDir)$(Platform)\$(Configuration)\Microsoft.WindowsAPICodePack*.dll" "$(SolutionDir)$(Platform)\$(Configuration)\Bin" + + + xcopy /y /d "$(VK_SDK_PATH)\share\vulkan\registry\vk.xml" "$(SolutionDir)\GameOverlay\vulkan\src" +"python.exe" "$(SolutionDir)\GameOverlay\vulkan\src\gen_dispatch_table.py" diff --git a/Frontend/MainWindow.xaml b/Frontend/MainWindow.xaml index ffadf45..273c203 100644 --- a/Frontend/MainWindow.xaml +++ b/Frontend/MainWindow.xaml @@ -545,6 +545,7 @@ + @@ -552,10 +553,13 @@ - - + + + + - +