freax
06-29-2010, 08:43 AM
Just found out. Have fun:
void Msg( const tchar* pMsg, ... );
Another thing I'm on is to find the pointer to CConsolePanel since it supports the following methods:
virtual void ColorPrint( const Color& clr, const char *pMessage );
virtual void Print( const char *pMessage );
virtual void DPrint( const char *pMessage );
This is located in public/vgui_controls/consoledialog.h. Plus, there is the source in vgui2/vgui_controls/consoledialog.cpp with a lot of strings.
Here is my current code:
//CConsolePanel
//gameui Base 16bb0000 Size 1d4000 \x56\x8B\xC8\xE8\x00\x00\x00\x00\xEB\x02\x33\xC0\x53\x8B\xC8\x89\x86\x 00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x8E\x00\x00\x00\x00 xxxx????xxxxxxxxx????x????xx????
pDebug->ToConsole("Searching CConsolePanel pointer...");
// 16C18626 56 PUSH ESI -> so add +0x1 to get the ESI pointer
pConsole = (vgui::CConsolePanel*)*(unsigned long*)(pTools->ScanSignature((unsigned long)GetModuleHandle("gameui.dll"), 0x1d4000, (unsigned char*)"\x56\x8B\xC8\xE8\x00\x00\x00\x00\xEB\x02\x33\xC0\x53\x8B\xC8\x89\x86\x 00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x8E\x00\x00\x00\x00", "xxxx????xxxxxxxxx????x????xx????") + 0x1);
pDebug->ToConsole("Found @ 0x%x", pConsole);
// Testing
Color red(255, 0, 0);
// CRASH!
pConsole->ColorPrint(red, "This should appear in red\n");
This is the place where I want to get the pointer (just one of thousand possible places):
CConsolePanel::CConsolePanel( vgui::Panel *pParent, const char *pName, bool bStatusVersion ) :
BaseClass( pParent, pName ), m_bStatusVersion( bStatusVersion )
{
SetKeyBoardInputEnabled( true );
if ( !m_bStatusVersion )
{
SetMinimumSize(100,100);
}
// create controls
m_pHistory = new RichText(this, "ConsoleHistory");
ASM Dump (with olly):
16C18610 68 C0010000 PUSH 1C0
16C18615 E8 F669FAFF CALL gameui.16BBF010
16C1861A 83C4 04 ADD ESP,4
16C1861D 3BC3 CMP EAX,EBX
16C1861F 74 0F JE SHORT gameui.16C18630
16C18621 68 4C1ECD16 PUSH gameui.16CD1E4C ; ASCII "ConsoleHistory"
16C18626 56 PUSH ESI
16C18627 8BC8 MOV ECX,EAX
16C18629 E8 C2AF0100 CALL gameui.16C335F0
16C1862E EB 02 JMP SHORT gameui.16C18632
I'm just new to disassembling, so may I'm wrong, but isn't this line:
m_pHistory = new RichText(this, "ConsoleHistory");
this one:
16C18621 68 4C1ECD16 PUSH gameui.16CD1E4C ; ASCII "ConsoleHistory"
16C18626 56 PUSH ESI
16C18627 8BC8 MOV ECX,EAX
16C18629 E8 C2AF0100 CALL gameui.16C335F0
?
If yes, PUSH ESI should be the this-pointer of CConsolePanel.
This are my current ideas, maybe others can help.
Thanks!
void Msg( const tchar* pMsg, ... );
Another thing I'm on is to find the pointer to CConsolePanel since it supports the following methods:
virtual void ColorPrint( const Color& clr, const char *pMessage );
virtual void Print( const char *pMessage );
virtual void DPrint( const char *pMessage );
This is located in public/vgui_controls/consoledialog.h. Plus, there is the source in vgui2/vgui_controls/consoledialog.cpp with a lot of strings.
Here is my current code:
//CConsolePanel
//gameui Base 16bb0000 Size 1d4000 \x56\x8B\xC8\xE8\x00\x00\x00\x00\xEB\x02\x33\xC0\x53\x8B\xC8\x89\x86\x 00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x8E\x00\x00\x00\x00 xxxx????xxxxxxxxx????x????xx????
pDebug->ToConsole("Searching CConsolePanel pointer...");
// 16C18626 56 PUSH ESI -> so add +0x1 to get the ESI pointer
pConsole = (vgui::CConsolePanel*)*(unsigned long*)(pTools->ScanSignature((unsigned long)GetModuleHandle("gameui.dll"), 0x1d4000, (unsigned char*)"\x56\x8B\xC8\xE8\x00\x00\x00\x00\xEB\x02\x33\xC0\x53\x8B\xC8\x89\x86\x 00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x8E\x00\x00\x00\x00", "xxxx????xxxxxxxxx????x????xx????") + 0x1);
pDebug->ToConsole("Found @ 0x%x", pConsole);
// Testing
Color red(255, 0, 0);
// CRASH!
pConsole->ColorPrint(red, "This should appear in red\n");
This is the place where I want to get the pointer (just one of thousand possible places):
CConsolePanel::CConsolePanel( vgui::Panel *pParent, const char *pName, bool bStatusVersion ) :
BaseClass( pParent, pName ), m_bStatusVersion( bStatusVersion )
{
SetKeyBoardInputEnabled( true );
if ( !m_bStatusVersion )
{
SetMinimumSize(100,100);
}
// create controls
m_pHistory = new RichText(this, "ConsoleHistory");
ASM Dump (with olly):
16C18610 68 C0010000 PUSH 1C0
16C18615 E8 F669FAFF CALL gameui.16BBF010
16C1861A 83C4 04 ADD ESP,4
16C1861D 3BC3 CMP EAX,EBX
16C1861F 74 0F JE SHORT gameui.16C18630
16C18621 68 4C1ECD16 PUSH gameui.16CD1E4C ; ASCII "ConsoleHistory"
16C18626 56 PUSH ESI
16C18627 8BC8 MOV ECX,EAX
16C18629 E8 C2AF0100 CALL gameui.16C335F0
16C1862E EB 02 JMP SHORT gameui.16C18632
I'm just new to disassembling, so may I'm wrong, but isn't this line:
m_pHistory = new RichText(this, "ConsoleHistory");
this one:
16C18621 68 4C1ECD16 PUSH gameui.16CD1E4C ; ASCII "ConsoleHistory"
16C18626 56 PUSH ESI
16C18627 8BC8 MOV ECX,EAX
16C18629 E8 C2AF0100 CALL gameui.16C335F0
?
If yes, PUSH ESI should be the this-pointer of CConsolePanel.
This are my current ideas, maybe others can help.
Thanks!