Activating External Console

Posts 1–15 of 19 · Page 1 of 2
Activating External Console
Here is an easy code to activate the external console. For some reason the game doesn't write anything to it, but it works just fine for executing commands, setting dvars etc.

Code:
void (__cdecl* Sys_ShowConsole)() { reinterpret_cast<decltype(Sys_ShowConsole)>(0x005CB490) };

//somewhere in your hook
static bool showConsole { true };

if (showConsole) {
   Sys_ShowConsole();
   showConsole = false;
}
Note: You should only call this once. If you don't have a hook where you can call it, create a new thread with a message queue and call it there. The cool thing about that approach is that the game won't exit if you close the console.

Greetings!
I've been struggling with that sub. Called it but the window just flashed by. Your method seems to work, thanks! Can I use it in my tool?
Quote Originally Posted by xxLogicaLxx View Post
Someone make a .DLL for this.
I've implemented this in my MW2 Lobby Tools, just need to update it
Quote Originally Posted by Scoudem View Post
I've implemented this in my MW2 Lobby Tools, just need to update it
Well hurry up then mate.
Let me know when it's updated
So does this allow you to put in certain DVARS and not others? Since apparently things like "map mp_afghan" won't work or w/e.
Hey, I can't get this to work, debugged it in win32project dll. No errors on build or on injection, just does nothing.

// ConsoleApplication5.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
#include "Windows.h"
int Sys_ShowConsole()
{
void (__cdecl* Sys_ShowConsole)(); { reinterpret_cast<decltype(Sys_ShowConsole)>(0x005C B490) ;}
Sys_ShowConsole();
};
Quote Originally Posted by KujoDrinksPussy View Post
Hey, I can't get this to work, debugged it in win32project dll. No errors on build or on injection, just does nothing.

// ConsoleApplication5.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
#include "Windows.h"
int Sys_ShowConsole()
{
void (__cdecl* Sys_ShowConsole)(); { reinterpret_cast<decltype(Sys_ShowConsole)>(0x005C B490) ;}
Sys_ShowConsole();
};
(0x005C B490)

Do you see what you did wrong?
I fixed that, now their is some other errors :u
And where do you put this code please?
Quote Originally Posted by KujoDrinksPussy View Post
Hey, I can't get this to work, debugged it in win32project dll. No errors on build or on injection, just does nothing.

// ConsoleApplication5.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
#include "Windows.h"
int Sys_ShowConsole()
{
void (__cdecl* Sys_ShowConsole)(); { reinterpret_cast<decltype(Sys_ShowConsole)>(0x005C B490) ;}
Sys_ShowConsole();
};
It's not a good idea to name the pointer and your function the same. You might get into an infinite recursion. Also, the game won't magically call your function, you have to create a thread from DllMain and create a message queue or hook into the game's thread and call it the

Quote Originally Posted by KujoDrinksPussy View Post
I fixed that, now their is some other errors :u
What errors?

Quote Originally Posted by m0zey View Post
And where do you put this code please?
In a text file, rename it to IW4Console.bat, then inject that into svchost.exe.
Quote Originally Posted by gerherhtherherdhher View Post
Here is an easy code to activate the external console. For some reason the game doesn't write anything to it, but it works just fine for executing commands, setting dvars etc.

Code:
void (__cdecl* Sys_ShowConsole)() { reinterpret_cast<decltype(Sys_ShowConsole)>(0x005CB490) };

//somewhere in your hook
static bool showConsole { true };

if (showConsole) {
   Sys_ShowConsole();
   showConsole = false;
}
Note: You should only call this once. If you don't have a hook where you can call it, create a new thread with a message queue and call it there. The cool thing about that approach is that the game won't exit if you close the console.

Greetings!
hey i was wondering what code i could use to ban this guy Xen0 from my games? he keeps hacking my games
Quote Originally Posted by classynapkins View Post
hey i was wondering what code i could use to ban this guy Xen0 from my games? he keeps hacking my games
are you serious
Quote Originally Posted by classynapkins View Post
hey i was wondering what code i could use to ban this guy Xen0 from my games? he keeps hacking my games
I've heard of that guy. Never met him in a lobby though. What stuff is he doing in your lobbies? I will try to figure something out!
Posts 1–15 of 19 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?