markoj (09-05-2010)
... this hackery?
The above code interprets integers as pointers which is never good.Code:void __cdecl PushToConsole( const char* szCommand ) { DWORD *LTClient = ( DWORD* )( 0x3778BFB0 ); void* CONoff = ( void* )*( DWORD* )( *LTClient + 0x208 ); __asm { push szCommand; call CONoff; add esp, 4; } }
The following does not depend on the size of a DWORD * and makes more sense programmatically. Also, it doesn't use inline asm so it will work on any compiler, not just MSVC.
Not saying everyone else is wrong, just that I think my way is more independent of any compiler/architecture.Code:blah blah the code I had wasn't quite right
Edit: Use this
Last edited by Tekkn0logik; 09-05-2010 at 06:22 PM.
markoj (09-05-2010)
1. It's how Gellin did it in his hack base for CA, and most "coders" on this forum have no idea what it does or how to change it.
2. It's illegal to add/subtract from a void*
3. Why didn't you just use
Code:ptc_t ptc = *(ptc_t*) (*ltClientAddr + 0x208);
J (09-06-2010)
Actually neither of your ways worked, but my way did /
[php]void PushToConsole(const char* szCommand)
{
HMODULE hMod = GetModuleHandle("CShell.dll");
if(hMod == NULL)
return;
int* ltClientAddr = (int*) 0x377E7810;
typedef int (*ptc_t)(const char *);
ptc_t ptc = *(ptc_t*) (*ltClientAddr + 0x208);
ptc(Command);//edited this part so people cant c+p
}[/php]
Last edited by markoj; 09-05-2010 at 06:23 AM.
Dont ban me
markoj (09-05-2010)
Thats wrong. DWORD is unsigned long/int, that means it goes from 0x00000000 to 0xFFFFFFFF and we know that an address on 32bit systems are 4 bytes long and the address would perfectly fit into a DWORD. I would use a void pointer, but in this case I would use DWORD pointer, cause you can access the value from the pointer with *, and that's why it's for.The above code interprets integers as pointers which is never good.
But I'm with you with the ASM part. I don't know why people only want to use inline asm.
Last edited by Gordon`; 09-05-2010 at 06:03 PM.
markoj (09-06-2010)
They are ignorant. I've posted how to do without inline asm, but no one wants to use it.
You just edited the LTC client to the update, the first code you posted is not up to date.
J (09-06-2010)