Update console

This commit is contained in:
BrentVL-1952840 2023-03-04 12:36:06 +01:00
parent 375c77fd04
commit de9e239711
2 changed files with 18 additions and 18 deletions

View File

@ -54,7 +54,7 @@ namespace console
{ {
a.push(rbx); a.push(rbx);
a.mov(eax, 0x8030); a.mov(eax, 0x8030);
a.jmp(game::select(0x142333667, 0x140597527)); a.jmp(game::select(0x142332AA7, 0x140597527));
}); });
static_cast<void(*)(const char*)>(print_func)(message); static_cast<void(*)(const char*)>(print_func)(message);
@ -105,13 +105,13 @@ namespace console
game::Cbuf_AddText(0, "quit\n"); game::Cbuf_AddText(0, "quit\n");
[[fallthrough]]; [[fallthrough]];
default: default:
return utils::hook::invoke<LRESULT>(game::select(0x142333520, 0x1405973E0), hwnd, msg, wparam, lparam); return utils::hook::invoke<LRESULT>(game::select(0x142332960, 0x1405973E0), hwnd, msg, wparam, lparam);
} }
} }
LRESULT input_line_wnd_proc(const HWND hwnd, const UINT msg, const WPARAM wparam, const LPARAM lparam) LRESULT input_line_wnd_proc(const HWND hwnd, const UINT msg, const WPARAM wparam, const LPARAM lparam)
{ {
return utils::hook::invoke<LRESULT>(game::select(0x142333820, 0x1405976E0), hwnd, msg, wparam, lparam); return utils::hook::invoke<LRESULT>(game::select(0x142332C60, 0x1405976E0), hwnd, msg, wparam, lparam);
} }
void sys_create_console_stub(const HINSTANCE h_instance) void sys_create_console_stub(const HINSTANCE h_instance)
@ -212,8 +212,8 @@ namespace console
utils::hook::set<uint8_t>(0x14133D2FE_g, 0xEB); // Always enable ingame console utils::hook::set<uint8_t>(0x14133D2FE_g, 0xEB); // Always enable ingame console
} }
utils::hook::jump(game::select(0x1423337F0, 0x1405976B0), queue_message); utils::hook::jump(game::select(0x142332C30, 0x1405976B0), queue_message);
utils::hook::nop(game::select(0x14233380A, 0x1405976CA), 2); // Print from every thread utils::hook::nop(game::select(0x142332C4A, 0x1405976CA), 2); // Print from every thread
//const auto self = utils::nt::library::get_by_address(sys_create_console_stub); //const auto self = utils::nt::library::get_by_address(sys_create_console_stub);
//logo = LoadImageA(self.get_handle(), MAKEINTRESOURCEA(IMAGE_LOGO), 0, 0, 0, LR_COPYFROMRESOURCE); //logo = LoadImageA(self.get_handle(), MAKEINTRESOURCEA(IMAGE_LOGO), 0, 0, 0, LR_COPYFROMRESOURCE);
@ -251,7 +251,7 @@ namespace console
{ {
{ {
static utils::hook::detour sys_create_console_hook; static utils::hook::detour sys_create_console_hook;
sys_create_console_hook.create(game::select(0x1423339C0, 0x140597880), sys_create_console_stub); sys_create_console_hook.create(game::select(0x142332E00, 0x140597880), sys_create_console_stub);
game::Sys_ShowConsole(); game::Sys_ShowConsole();
started = true; started = true;
@ -299,4 +299,4 @@ namespace console
}; };
} }
REGISTER_COMPONENT(console::component) REGISTER_COMPONENT_WORKING(console::component)

View File

@ -18,7 +18,7 @@ namespace game
WEAK symbol<void(const char* fmt, ...)> G_LogPrintf{0x0, 0x1402A7BB0}; WEAK symbol<void(const char* fmt, ...)> G_LogPrintf{0x0, 0x1402A7BB0};
// Com // Com
WEAK symbol<void(int channel, unsigned int label, const char* fmt, ...)> Com_Printf{0x1421499C0, 0x140505630}; WEAK symbol<void(int channel, unsigned int label, const char* fmt, ...)> Com_Printf{0x142148F60, 0x140505630};
WEAK symbol<void(const char* file, int line, int code, const char* fmt, ...)> Com_Error_{0x1420F8BD0, 0x140501470}; WEAK symbol<void(const char* file, int line, int code, const char* fmt, ...)> Com_Error_{0x1420F8BD0, 0x140501470};
WEAK symbol<bool(eModes mode)> Com_SessionMode_IsMode{0x1420F7DD0}; WEAK symbol<bool(eModes mode)> Com_SessionMode_IsMode{0x1420F7DD0};
WEAK symbol<void(eNetworkModes networkMode)> Com_SessionMode_SetNetworkMode{0x1420F8010, 0x140500B80}; WEAK symbol<void(eNetworkModes networkMode)> Com_SessionMode_SetNetworkMode{0x1420F8010, 0x140500B80};
@ -30,7 +30,7 @@ namespace game
0x14214AF30 0x14214AF30
}; };
WEAK symbol<void(int localClientNum, const char* text)> Cbuf_AddText{0x1420EC8B0, 0x1404F75B0}; WEAK symbol<void(int localClientNum, const char* text)> Cbuf_AddText{0x1420EC010, 0x1404F75B0};
WEAK symbol<void(int localClientNum, ControllerIndex_t controllerIndex, const char* buffer)> Cbuf_ExecuteBuffer{ WEAK symbol<void(int localClientNum, ControllerIndex_t controllerIndex, const char* buffer)> Cbuf_ExecuteBuffer{
0x14133BE10, 0x1404F78D0 0x14133BE10, 0x1404F78D0
}; };
@ -74,7 +74,7 @@ namespace game
// Sys // Sys
WEAK symbol<int()> Sys_Milliseconds{0x142333430}; WEAK symbol<int()> Sys_Milliseconds{0x142333430};
WEAK symbol<void()> Sys_ShowConsole{0x142333F80, 0x140597E40}; WEAK symbol<void()> Sys_ShowConsole{0x1423333C0, 0x140597E40};
WEAK symbol<TLSData*()> Sys_GetTLS{0x142184210, 0x140525EB0}; WEAK symbol<TLSData*()> Sys_GetTLS{0x142184210, 0x140525EB0};
WEAK symbol<TLSData*()> Sys_IsDatabaseReady{0x1421844C0}; WEAK symbol<TLSData*()> Sys_IsDatabaseReady{0x1421844C0};
@ -155,14 +155,14 @@ namespace game
namespace s_wcd namespace s_wcd
{ {
WEAK symbol<HWND> codLogo{0x157E77A50, 0x14A640BC0}; WEAK symbol<HWND> codLogo{0x157E75A50, 0x14A640BC0};
WEAK symbol<HFONT> hfBufferFont{0x157E77A58, 0x14A640BC8}; WEAK symbol<HFONT> hfBufferFont{0x157E75A58, 0x14A640BC8};
WEAK symbol<HWND> hWnd{0x157E77A40, 0x14A640BB0}; WEAK symbol<HWND> hWnd{0x157E75A40, 0x14A640BB0};
WEAK symbol<HWND> hwndBuffer{0x157E77A48, 0x14A640BB8}; WEAK symbol<HWND> hwndBuffer{0x157E75A48, 0x14A640BB8};
WEAK symbol<HWND> hwndInputLine{0x157E77A60, 0x14A640BD0}; WEAK symbol<HWND> hwndInputLine{0x157E75A60, 0x14A640BD0};
WEAK symbol<int> windowHeight{0x157E7806C, 0x14A6411DC}; WEAK symbol<int> windowHeight{0x157E7606C, 0x14A6411DC};
WEAK symbol<int> windowWidth{0x157E78068, 0x14A6411D8}; WEAK symbol<int> windowWidth{0x157E76068, 0x14A6411D8};
WEAK symbol<WNDPROC> SysInputLineWndProc{0x157E78070, 0x14A6411E0}; WEAK symbol<WNDPROC> SysInputLineWndProc{0x157E76070, 0x14A6411E0};
} }
// Global game definitions // Global game definitions