ДоговорилисьПродам за 50рублей)
LONEL#2243Договорились
bool utils::ReadFileToMemory(const std::string& file_path, std::vector<uint8_t>* out_buffer)
{
std::ifstream file_ifstream(file_path, std::ios::binary);
if (!file_ifstream)
return false;
out_buffer->assign((std::istreambuf_iterator<char>(file_ifstream)), std::istreambuf_iterator<char>());
file_ifstream.close();
return true;
}
bool utils::CreateFileFromMemory(const std::string& desired_file_path, const char* address, size_t size)
{
std::ofstream file_ofstream(desired_file_path.c_str(), std::ios_base::out | std::ios_base::binary);
if (!file_ofstream.write(address, size))
{
file_ofstream.close();
return false;
}
file_ofstream.close();
return true;
}
I have got injection by file path. But I don't want to save file on computer, I want to have my hack in memory of me injector, and load it to the gameThis is everything you may need.C++:bool utils::ReadFileToMemory(const std::string& file_path, std::vector<uint8_t>* out_buffer) { std::ifstream file_ifstream(file_path, std::ios::binary); if (!file_ifstream) return false; out_buffer->assign((std::istreambuf_iterator<char>(file_ifstream)), std::istreambuf_iterator<char>()); file_ifstream.close(); return true; } bool utils::CreateFileFromMemory(const std::string& desired_file_path, const char* address, size_t size) { std::ofstream file_ofstream(desired_file_path.c_str(), std::ios_base::out | std::ios_base::binary); if (!file_ofstream.write(address, size)) { file_ofstream.close(); return false; } file_ofstream.close(); return true; }
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz