Подведи собственные итоги года совместно с YOUGAME и забери ценные призы! Перейти

Вопрос Raw data injector

  • Автор темы Автор темы RedStar
  • Дата начала Дата начала
Пользователь
Пользователь
Статус
Оффлайн
Регистрация
26 Авг 2017
Сообщения
387
Реакции
33
У кого есть исходник инжектора, в который просто в отдельном файле лежит переведенная в байты длл (подкл к проекту), а сам инжектор эту память инжектит?
 
C++:
Expand Collapse Copy
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;
}

This is everything you may need.
 
C++:
Expand Collapse Copy
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;
}

This is everything you may need.
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 game
 
Назад
Сверху Снизу