Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    apezwijn's Avatar
    Join Date
    Feb 2007
    Gender
    male
    Location
    The Netherlands
    Posts
    1,525
    Reputation
    22
    Thanks
    682

    Quick C++ Question

    Hello, I tried to make a quick dll
    Isn't this suposed to work?

    Code:
    while(1)
       {
    	  DWORD dwPlayerPtr = *(DWORD*)0xCCB670;
    	*(float*)(dwPlayerPtr+0x2C) = 60;
    
          Sleep(500);
       }

  2. #2
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    what r u asking right now? havnt u tried it?

  3. #3
    Henry Chang's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    2
    Code:
    while(1)
    {
    Is a loop.

    Why are you doing a loop? If you are doing memory hacks, just do it in DIP.

  4. #4
    tdcoolboy's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    299
    Reputation
    8
    Thanks
    37
    My Mood
    Twisted
    this is not the right section to put this

  5. #5
    apezwijn's Avatar
    Join Date
    Feb 2007
    Gender
    male
    Location
    The Netherlands
    Posts
    1,525
    Reputation
    22
    Thanks
    682
    Quote Originally Posted by Henry Chang View Post
    Code:
    while(1)
    {
    Is a loop.

    Why are you doing a loop? If you are doing memory hacks, just do it in DIP.
    im looping cos i don't want it the adress the be written only once.

  6. #6
    Pixipixel_'s Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    VCExpress.exe || France :D
    Posts
    2,087
    Reputation
    27
    Thanks
    742
    My Mood
    Cool
    Don't loop. Just use the "if" statement, it's enough But the code is wrong
    Should be like this :

    Code:
    int hack = 1;
    
    if(hack)
    {
    DWORD dwPlayerPtr = *(DWORD*)0x00CCB670 ;
    if(dwPlayerPtr != 0) //It check if we're ingame :D
    {
    *(float*)(dwPlayerPtr+0x2C) = 60;
    }
    }



    Have fun.



    Pixi.

  7. #7
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by Henry Chang View Post
    Code:
    while(1)
    {
    Is a loop.

    Why are you doing a loop? If you are doing memory hacks, just do it in DIP.
    DrawIndexedPrimitive has NOTHING to do with memory hacks.

    A loop works just fine, but if I were him i'd move the DWORD a = (DWORD*)0xAAAAAAA outside the loop, for performance reasons.

    Quote Originally Posted by Pixipixel_ View Post
    Don't loop. Just use the "if" statement, it's enough But the code is wrong
    Should be like this :

    Code:
    int hack = 1;
    
    if(hack)
    {
    DWORD dwPlayerPtr = *(DWORD*)0x00CCB670 ;
    if(dwPlayerPtr != 0) //It check if we're ingame :D
    {
    *(float*)(dwPlayerPtr+0x2C) = 60;
    }
    }



    Have fun.



    Pixi.
    No...
    Using an if statement is not enough if he wants to constantly write it to memory...
    Also a DWORD(which is a typedef for unsigned long) is not the same as a float.
    Last edited by Hell_Demon; 11-11-2009 at 12:07 PM.
    Ah we-a blaze the fyah, make it bun dem!

  8. The Following User Says Thank You to Hell_Demon For This Useful Post:

    why06 (11-13-2009)

  9. #8
    apezwijn's Avatar
    Join Date
    Feb 2007
    Gender
    male
    Location
    The Netherlands
    Posts
    1,525
    Reputation
    22
    Thanks
    682
    Can somebody confirm the adresses and if this should work for WarRock, cos I can't think of anything i'm missing.

    Code:
    #include <windows.h>
    #include <stdio.h>
    
    
    
        //  DWORD *blah = (DWORD*)0x458468;
        //  *(int*)blah = 4;
    
     DWORD dwPlayerPtr = *(DWORD*)0xCCB670;
     
    void TheHacks() //Hack Thread
    {
       while(1)
       {
    	   *(float*)(dwPlayerPtr+0x2C) = 60;
    	 Sleep(50);
       }
    
    }
    
    
    
    
    
    BOOL WINAPI DllMain(HINSTANCE module, DWORD dwReason, LPVOID lpvReserved)
    {
       if(dwReason == DLL_PROCESS_ATTACH)
       {
          CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)TheHacks, NULL, NULL, NULL); //create the new Thread
       }
       return TRUE;
    }

  10. #9
    Henry Chang's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by apezwijn View Post
    Can somebody confirm the adresses and if this should work for WarRock, cos I can't think of anything i'm missing.

    Code:
    #include <windows.h>
    #include <stdio.h>
    
    
    
        //  DWORD *blah = (DWORD*)0x458468;
        //  *(int*)blah = 4;
    
     DWORD dwPlayerPtr = *(DWORD*)0xCCB670;
     
    void TheHacks() //Hack Thread
    {
       while(1)
       {
    	   *(float*)(dwPlayerPtr+0x2C) = 60;
    	 Sleep(50);
       }
    
    }
    
    
    
    
    
    BOOL WINAPI DllMain(HINSTANCE module, DWORD dwReason, LPVOID lpvReserved)
    {
       if(dwReason == DLL_PROCESS_ATTACH)
       {
          CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)TheHacks, NULL, NULL, NULL); //create the new Thread
       }
       return TRUE;
    }
    You aren't checking if you are in game. Which would most likely make it crash!

    Code:
    DWORD iInGame = *(DWORD*)PlayerPointer;
    if(iInGame != 0)
    {
    // stuff!
    }

  11. #10
    apezwijn's Avatar
    Join Date
    Feb 2007
    Gender
    male
    Location
    The Netherlands
    Posts
    1,525
    Reputation
    22
    Thanks
    682
    Quote Originally Posted by Henry Chang View Post
    You aren't checking if you are in game. Which would most likely make it crash!

    Code:
    DWORD iInGame = *(DWORD*)PlayerPointer;
    if(iInGame != 0)
    {
    // stuff!
    }
    I've added that and it's still not working.

    Code:
    DWORD dwPlayerPtr = *(DWORD*)0xCCB670;
     DWORD iInGame = *(DWORD*)dwPlayerPtr;
    void TheHacks() //Hack Thread
    {
       while(1)
       {
    	   if (iInGame != 0){
    	   *(float*)(dwPlayerPtr+0x2C) = 60;
    	   }
    	 Sleep(50);
       }
    
    }

  12. #11
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Try the following:

    Code:
    #include <windows.h>
    #include <stdio.h>
    DWORD dwPlayerPtr;
     
    void TheHacks() //Hack Thread
    {
       while(*dwPlayerPtr == 0)
       {
          Sleep(1000);
       }
       while(1)
       {
    	   *(int*)(dwPlayerPtr+0x2C) = 60; // 60 is an int ^^
    	 Sleep(50);
       }
    
    }
    
    
    
    
    
    BOOL WINAPI DllMain(HINSTANCE module, DWORD dwReason, LPVOID lpvReserved)
    {
       if(dwReason == DLL_PROCESS_ATTACH)
       {
           dwPlayerPtr = /***/(DWORD*)0xCCB670; // ?
          CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)TheHacks, NULL, NULL, NULL); //create the new Thread
       }
       return TRUE;
    }
    haven't checked for errors and typed in a reply.
    Ah we-a blaze the fyah, make it bun dem!

  13. #12
    ilovecookies's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    In the C++ Section
    Posts
    321
    Reputation
    10
    Thanks
    67
    My Mood
    Shocked
    Quote Originally Posted by Hell_Demon View Post
    Try the following:

    Code:
    #include <windows.h>
    #include <stdio.h>
    DWORD dwPlayerPtr;
     
    void TheHacks() //Hack Thread
    {
       while(*dwPlayerPtr == 0)
       {
          Sleep(1000);
       }
       while(1)
       {
    	   *(int*)(dwPlayerPtr+0x2C) = 60; // 60 is an int ^^
    	 Sleep(50);
       }
    
    }
    
    
    
    
    
    BOOL WINAPI DllMain(HINSTANCE module, DWORD dwReason, LPVOID lpvReserved)
    {
       if(dwReason == DLL_PROCESS_ATTACH)
       {
           dwPlayerPtr = /***/(DWORD*)0xCCB670; // ?
          CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)TheHacks, NULL, NULL, NULL); //create the new Thread
       }
       return TRUE;
    }
    haven't checked for errors and typed in a reply.

    I'm a noob and all, so I have no idea what this means, but these are the errors that Dev c++ kicked back to me.

    In function `void TheHacks()':

    invalid type argument of `unary *'

    In function `BOOL DllMain(HINSTANCE__*, DWORD, void*)':

    WarRock.cpp invalid conversion from `DWORD*' to `DWORD'

    [Warning] passing NULL used for non-pointer converting 2 of `void* CreateThread(_SECURITY_ATTRIBUTES*, DWORD, DWORD (*)(void*), void*, DWORD, DWORD*)'

    [Warning] passing NULL used for non-pointer converting 5 of `void* CreateThread(_SECURITY_ATTRIBUTES*, DWORD, DWORD (*)(void*), void*, DWORD, DWORD*)'


    This may help you guys out, or maybe i'm just getting errors because I have no clue what i'm doing and shouldn't be trying to compile someone elses code.
    Quote Originally Posted by Jules Winnfield View Post
    I am the tyranny of evil men, and you are all the weak. But i'm trying Ringo,i'm trying real hard, to become the shepherd.
    excuse me miss, would you kindly reflect some photons off the epidermis covering your sternum directly into the camera iris or vacate the proximity immediately
    [IMG]https://i882.photobucke*****m/albums/ac23/miki_d420/RealizingYoureALeecher2copy.jpg[/IMG]









  14. #13
    rwkeith's Avatar
    Join Date
    Jul 2008
    Gender
    male
    Posts
    457
    Reputation
    11
    Thanks
    79
    My Mood
    Angelic
    Did you make it into a .cpp file or a .dll file? Make a new project and select an empty project and when prompted select .dll...
    Goals In Life:
    [X] Become an Advanced Member
    [X]Release a tut on mpgh
    [0]Post 300 posts
    [X]Make a working hack
    [X] Learn c++

  15. #14
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    Quote Originally Posted by ilovecookies View Post
    I'm a noob and all, so I have no idea what this means, but these are the errors that Dev c++ kicked back to me.
    wait its not even your code lol @ copy paster.

  16. #15
    Henry Chang's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    2
    Okay, now I see the addresses and offsets you are trying to make a stamina hack?

    Here is mine.

    [php]if( g_uiStamina == 1) // Full
    {
    DWORD dwPlayerPointer = *(DWORD*)ADR_PLAYERPOINTER;
    if(dwPlayerPointer != NULL) // < -- IsInGame!
    {
    *(float*)(dwPlayerPointer+OFS_STAMINA) = 100;
    }
    }[/php]

Page 1 of 2 12 LastLast

Similar Threads

  1. Quick noob question...
    By blakjak02 in forum Combat Arms Discussions
    Replies: 6
    Last Post: 01-02-2010, 05:11 AM
  2. I've just got a quick VAC question.
    By Joerrd in forum Call of Duty Modern Warfare 2 Help
    Replies: 3
    Last Post: 12-18-2009, 11:17 PM
  3. Quick Hacking question
    By DanielINC- in forum CrossFire Hacks & Cheats
    Replies: 35
    Last Post: 05-04-2009, 09:01 AM
  4. Quick hacking question.
    By gamesguru in forum Combat Arms Hacks & Cheats
    Replies: 8
    Last Post: 04-26-2009, 04:03 PM

Tags for this Thread