You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

#include <iostream>
#include <fstream>
#include <filesystem>
#include "amlegit.hpp"
#include "hooked_functions.hpp"
using namespace std;
/*
Warning! This will get you banned, do not use this!
*/
int main()
{
//--- hook DeviceIoControl
hook::install(&DeviceIoControl, &shithook::h_device_io_control);
//--- get driver buffer
auto [driver_ptr, driver_size] = amlegit::get_driver();
cout << hex << showbase << "[+] driver_ptr: " << driver_ptr << endl;
cout << hex << showbase << "[+] driver_size: " << driver_size << endl;
//--- writes driver to file
ofstream driver(filesystem::path("driver.sys"), std::ofstream::out | std::ofstream::binary);
driver.write(reinterpret_cast<char*>(driver_ptr), driver_size);
driver.close();
cout << "[+] wrote driver to disk" << endl;
//--- load driver
amlegit::load_driver();
cout << "[+] loaded intel lan driver" << endl;
amlegit::map_driver("driver.sys");
cout << "[+] mapped unsigned driver" << endl;
amlegit::connect_driver();
cout << "[+] connected to driver" << endl;
//--- inject dll into process with window name
amlegit::inject("Rainbow Six", "hello_world.dll");
cout << "[+] injected dll" << endl;
cin.get();
}