get current path

pull/1/head
qtkite 3 years ago
parent 0b363972a6
commit 35195a5e49

@ -11,8 +11,8 @@ int main()
{
if (!strstr(util::get_user().c_str(), "SYSTEM"))
{
std::cout << "Insufficient permissions" << std::endl;
system("pause");
// get current process directory
return 1;
}

@ -94,4 +94,14 @@ namespace util
GetUserNameA(username, &username_len);
return std::string(username);
}
// Get current path of process
//
std::string get_current_path()
{
char buf[256];
size_t len = sizeof(buf);
int bytes = GetModuleFileName(NULL, buf, len);
return std::string(buf);
}
}

@ -21,4 +21,8 @@ namespace util
// Get current username
//
std::string get_user();
// Get current path of process
//
std::string get_current_path();
}

Loading…
Cancel
Save