MCPcopy Create free account
hub / github.com/0mWindyBug/GhostMapperUM / ReadFileToMemory

Method ReadFileToMemory

GhostMapperUM/GhostMapperUM/utils.cpp:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21bool utils::ReadFileToMemory(const std::wstring& file_path, std::vector<uint8_t>* out_buffer) {
22 std::ifstream file_ifstream(file_path, std::ios::binary);
23
24 if (!file_ifstream)
25 return false;
26
27 out_buffer->assign((std::istreambuf_iterator<char>(file_ifstream)), std::istreambuf_iterator<char>());
28 file_ifstream.close();
29
30 return true;
31}
32
33
34bool utils::CreateFileFromMemory(const std::wstring& desired_file_path, const char* address, size_t size) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected