MCPcopy Create free account
hub / github.com/S3N4T0R-0X0/PixelCode-Attack / wstr_to_utf8

Function wstr_to_utf8

Loader.cpp:16–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#pragma comment(lib, "shell32.lib")
15
16std::string wstr_to_utf8(const std::wstring& wstr) {
17 if (wstr.empty()) return {};
18 int size = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, nullptr, 0, nullptr, nullptr);
19 std::string str(size - 1, 0);
20 WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, &str[0], size, nullptr, nullptr);
21 return str;
22}
23
24bool download_file(const std::wstring& url, const std::wstring& filename) {
25 std::wcout << L"Started downloading -> " << filename << L'\n';

Callers 2

download_fileFunction · 0.85
run_embedded_exeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected