21 wchar_t buf[MAX_PATH];
22 GetModuleFileNameW(NULL, buf, MAX_PATH);
23 return std::filesystem::path(buf).remove_filename();
24#elif defined (__APPLE__)
26 _NSGetExecutablePath(
nullptr, &size);
27 std::string tmp(size,
'\0');
28 _NSGetExecutablePath(tmp.data(), &size);
29 return std::filesystem::weakly_canonical(std::filesystem::path(tmp)).remove_filename();
30#elif defined (__linux__)
31 return std::filesystem::weakly_canonical(std::filesystem::read_symlink(
"/proc/self/exe")).remove_filename();
33 return std::filesystem::current_path();
51 std::ifstream file(path, std::ios::binary | std::ios::ate);
57 auto size = file.tellg();
60 std::vector<char> buffer(size);
62 if (!file.read(buffer.data(), size))