diff --git a/src/unlocker/utils.cpp b/src/unlocker/utils.cpp new file mode 100644 index 0000000..71c53c6 --- /dev/null +++ b/src/unlocker/utils.cpp @@ -0,0 +1,14 @@ +#include "utils.h" + +#include +#include + +std::string utils::getExePath() +{ + char buffer[MAX_PATH]; + GetModuleFileNameA(NULL, buffer, MAX_PATH); + std::string path(buffer); + size_t pos = path.find_last_of("\\/"); + if (pos != std::string::npos) return path.substr(0, pos + 1); + return ""; +} diff --git a/src/unlocker/utils.h b/src/unlocker/utils.h new file mode 100644 index 0000000..e71e638 --- /dev/null +++ b/src/unlocker/utils.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +namespace utils +{ + std::string getExePath(); +} \ No newline at end of file