Results 1 to 9 of 9
  1. #1
    Tekkn0logik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    37
    Reputation
    12
    Thanks
    52
    My Mood
    Amused

    What's the point of...

    ... this hackery?

    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 above code interprets integers as pointers which is never good.

    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.

    Code:
    blah blah the code I had wasn't quite right
    Not saying everyone else is wrong, just that I think my way is more independent of any compiler/architecture.

    Edit: Use this
    Quote Originally Posted by markoj View Post
    Code:
    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
    }
    Last edited by Tekkn0logik; 09-05-2010 at 06:22 PM.

  2. The Following User Says Thank You to Tekkn0logik For This Useful Post:

    markoj (09-05-2010)

  3. #2
    mmbob's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    ja
    Posts
    653
    Reputation
    70
    Thanks
    1,157
    My Mood
    Bitchy
    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);

  4. The Following User Says Thank You to mmbob For This Useful Post:

    J (09-06-2010)

  5. #3
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,064
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    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

  6. #4
    Tekkn0logik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    37
    Reputation
    12
    Thanks
    52
    My Mood
    Amused
    Quote Originally Posted by mmbob View Post
    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);
    Bleh, I knew something was fishy about what I had.

    Quote Originally Posted by Tekkn0logik
    Not saying everyone else is wrong, just that I think my way is more independent of any compiler/architecture.
    And, adding to a void pointer does the exact opposite of what I hoped to achieve, since afaik only gcc lets you do it :P

    markoj is right, I shall shut up now

  7. The Following User Says Thank You to Tekkn0logik For This Useful Post:

    markoj (09-05-2010)

  8. #5
    Gordon`'s Avatar
    Join Date
    Dec 2007
    Gender
    male
    Posts
    283
    Reputation
    24
    Thanks
    325
    The above code interprets integers as pointers which is never good.
    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.

    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.


  9. #6
    Tekkn0logik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    37
    Reputation
    12
    Thanks
    52
    My Mood
    Amused
    Quote Originally Posted by Gordon` View Post
    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.

    But I'm with you with the ASM part. I don't know why people only want to use inline asm.
    Yeah, I kinda realized what I said about the DWORD * stuff was dumb. Whatever, my point still stands that there are better ways to do it than the inline ASM hackery and through this thread we have developed one. markoj's solution works perfectly and is good, solid code.

  10. The Following User Says Thank You to Tekkn0logik For This Useful Post:

    markoj (09-06-2010)

  11. #7
    Gordon`'s Avatar
    Join Date
    Dec 2007
    Gender
    male
    Posts
    283
    Reputation
    24
    Thanks
    325
    They are ignorant. I've posted how to do without inline asm, but no one wants to use it.


  12. #8
    5donotenter's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    3
    You just edited the LTC client to the update, the first code you posted is not up to date.

  13. #9
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    Quote Originally Posted by 5donotenter View Post
    You just edited the LTC client to the update, the first code you posted is not up to date.
    Did you read anything

  14. The Following User Says Thank You to Crash For This Useful Post:

    J (09-06-2010)

Similar Threads

  1. What's the point of Console applications?
    By 258456 in forum C++/C Programming
    Replies: 2
    Last Post: 06-05-2010, 03:22 PM
  2. What is the point of moonwalk
    By chargers1all in forum Combat Arms Discussions
    Replies: 49
    Last Post: 11-16-2009, 03:45 AM
  3. [Help] What is the point of premium on hacks??
    By bretton619 in forum WarRock Discussions
    Replies: 30
    Last Post: 10-29-2009, 05:32 PM
  4. what's the point???
    By DeathScourge in forum General
    Replies: 19
    Last Post: 07-03-2009, 12:08 AM
  5. What's the point
    By BARON in forum Combat Arms Hacks & Cheats
    Replies: 3
    Last Post: 03-29-2009, 09:28 AM