Show console in window mode

This commit is contained in:
momo5502 2022-05-11 20:21:25 +02:00
parent 7a9c19e0fd
commit b09cf1130e
2 changed files with 23 additions and 14 deletions

View File

@ -35,8 +35,8 @@ html_frame::html_frame()
if (needs_restart)
{
//utils::nt::relaunch_self();
//utils::nt::terminate(0);
utils::nt::relaunch_self();
utils::nt::terminate(0);
}
}

View File

@ -78,7 +78,8 @@ std::filesystem::path extract_driver()
void unsafe_main(const int /*argc*/, char* /*argv*/[])
{
launcher().run();
//launcher().run();
//return;
const auto driver_file = extract_driver();
@ -110,16 +111,16 @@ void unsafe_main(const int /*argc*/, char* /*argv*/[])
patch_data(driver_device, pid, 0x443A2A, data3, sizeof(data3));
patch_data(driver_device, pid, 0x443978, data3, sizeof(data3));
/*
insert_nop(driver_device, pid, 0x441D5A, 6);
insert_nop(driver_device, pid, 0x525104, 2);
insert_nop(driver_device, pid, 0x525121, 2);
/*
insert_nop(driver_device, pid, 0x441D5A, 6);
insert_nop(driver_device, pid, 0x525104, 2);
insert_nop(driver_device, pid, 0x525121, 2);
constexpr uint8_t data3[] = {0xEB};
patch_data(driver_device, pid, 0x525087, data3, sizeof(data3));
patch_data(driver_device, pid, 0x524E7F, data3, sizeof(data3));
patch_data(driver_device, pid, 0x52512C, data3, sizeof(data3));
*/
constexpr uint8_t data3[] = {0xEB};
patch_data(driver_device, pid, 0x525087, data3, sizeof(data3));
patch_data(driver_device, pid, 0x524E7F, data3, sizeof(data3));
patch_data(driver_device, pid, 0x52512C, data3, sizeof(data3));
*/
printf("Press any key to disable all hooks!\n");
(void)_getch();
@ -150,5 +151,13 @@ int main(const int argc, char* argv[])
int __stdcall WinMain(HINSTANCE, HINSTANCE, char*, int)
{
AllocConsole();
AttachConsole(GetCurrentProcessId());
FILE* fp;
freopen_s(&fp, "conin$", "r", stdin);
freopen_s(&fp, "conout$", "w", stdout);
freopen_s(&fp, "conout$", "w", stderr);
return main(__argc, __argv);
}