Results 1 to 15 of 15
  1. #1
    MohammaDMD18's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    39
    Reputation
    10
    Thanks
    0

    [Need Help] What am I doing wrong?

    I am trying to start hacking, and I just want to see if it works.

    Here's the code, why doesn't it work in-game, I have the recent address/byte.

    Please tell me what I am doing wrong there, and please hesitate to flame me xD

    Code:



    #include <windows.h>


    int HackOn = 0;

    int HackMax = 10;

    bool test = false;

    #define ADDR_SBULLLETS 0x3740DDB6


    void Main (void)
    {
    while(1)

    {
    if(GetAsyncKeyState(VK_NUMPAD1)&1)

    {
    test = (!test);

    }
    if(GetAsyncKeyState(VK_NUMPAD2)&1)

    {
    HackOn ++;

    if(HackOn == HackMax) HackOn = 0;

    }
    if(test)

    {
    memcpy( (PBYTE)ADDR_SBULLLETS, (PBYTE)"\x90\x90\x90", 3 );

    }else{

    memcpy( (PBYTE)ADDR_SBULLLETS, (PBYTE)"\x0F\x94\xC0", 3 );

    }
    }
    }
    DWORD WINAPI Lesson (LPVOID)

    {
    Main();

    return 1;

    }

    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )

    {
    DisableThreadLibraryCalls(hDll);

    if ( dwReason == DLL_PROCESS_ATTACH )
    {

    CreateThread(NULL, NULL, Lesson, NULL, NULL, NULL);

    }
    return TRUE;


    }




    (Of course it's not my source code, I'm just starting, when I'm done learning I will make my own and not c/p.)
    Last edited by MohammaDMD18; 10-29-2011 at 01:29 PM.

  2. #2
    MohammaDMD18's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    39
    Reputation
    10
    Thanks
    0
    No one wants to help? D:

  3. #3
    teehee15's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    329
    Reputation
    52
    Thanks
    109
    ill give u 2 questions to think about. why do i have HackMax at 10 if u have one feature... and y does it only #include windows...

  4. #4
    mountainjew's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    51
    Reputation
    10
    Thanks
    18
    My Mood
    Amused
    For the love of god use [code] tags and format your source.

    You need to make sure the client is loaded and in game. I would add

    Code:
    bool HookReady()
    {
    	if( GetModuleHandleA( "d3d9.dll" ) //Not required if just memory hacking
    		!= NULL && GetModuleHandleA("CShell.dll" ) != NULL  && 
    		GetModuleHandleA( "ClientFX.fxd" ) != NULL)
    		return true;
    	return false;
    }
    and

    Code:
    bool inGame()
    {
    	if((*(INT*)GameStatus_ADDR== 1))
    		return true;
    	else
    		return false;
    	
    }

    The in the top of your main method add a check to see if the modules are loaded and sleep for like 25ms -35ms if not AND also add the inGame() method along side your test field to make sure you are in game before memory is modified and have it normal when you are out of game.

  5. #5
    MohammaDMD18's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    39
    Reputation
    10
    Thanks
    0
    Thanks for the help, finally some help.

    Did I said please hesitate to flame me? :P

    Very new...


    More hep is appreciated.

  6. #6
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,589
    Reputation
    5180
    Thanks
    14,177
    My Mood
    Inspired
    Here you go, this should work.

    Code:
    #include <windows.h>
    
    #define SuperBullets 0x3740DDB6 /*Defining the address of SuperBullets*/
    
    void Main()
    {
    	if(GameStatus == 1)/*Checking if In game*/
    	{
    
    		if(GetAsyncKeyState (VK_NUMPAD1))/*If Key is pressed*/
    		{
    			memcpy((LPVOID)SuperBullets, "\x33\xC0\x90", 3);//ON
    		} else {
    			memcpy((LPVOID)SuperBullets, "\x0F\x94\xC0", 3);//OFF
    		}
    	}
    }
    
    bool IsGameReady(void) //Gets the handle of all of these
    {
        if( GetModuleHandleW( L"d3d9.dll"     ) != NULL 
    		&& GetModuleHandleW( L"ClientFX.fxd" ) != NULL 
    		&& GetModuleHandleW( L"CShell.dll"   ) != NULL )
    		return true;
    	
    	return false;
    }
    
    DWORD WINAPI dwMainThread(LPVOID)
    {
    	while ( !IsGameReady() )
    		Sleep(100);
    
    	Main(); 
    
    	return 0;
    }
    
    BOOL WINAPI DllMain(
    	HINSTANCE hinstDLL,  // handle to DLL module
    	DWORD fdwReason,     // reason for calling function
    	LPVOID lpReserved )  // reserved
    {
    	// Perform actions based on the reason for calling.
    	switch( fdwReason ) 
    	{ 
    	case DLL_PROCESS_ATTACH:
    		// Initialize once for each new process.
    		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)dwMainThread, NULL, NULL, NULL);
    		MessageBoxA(NULL, "Message", "Caption", MB_OK);
    		break;
    
    	case DLL_THREAD_ATTACH:
    		// Do thread-specific initialization.
    		break;
    
    	case DLL_THREAD_DETACH:
    		// Do thread-specific cleanup.
    		break;
    
    	case DLL_PROCESS_DETACH:
    		// Perform any necessary cleanup.
    		break;
    	}
    	return TRUE;  // Successful DLL_PROCESS_ATTACH.
    }
    Try learning more C++, How memory works and ASM helps too.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  7. #7
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,667
    My Mood
    Breezy
    That code wont work @comando2056. When I hit the numpad 1 button, the superbullets turns on but as soon as I let go it will turn off again.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

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

    [MPGH]Flengo (10-30-2011)

  9. #8
    mountainjew's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    51
    Reputation
    10
    Thanks
    18
    My Mood
    Amused
    Just have the keypress trigger a boolean to change and use that same variable in a loop to determine to modify the memory.

    Code:
    //At top of program
    BOOL sBullets = false; 
    
    //top of main loop
    if(GetAsyncKeyState (VK_NUMPAD1))
    			sBullets = !sBullets //Switch state to opposite
    
    
    //In loop farther down
    if(sBullets )
    	memcpy((LPVOID)SuperBullets, "\x33\xC0\x90", 3);//ON
    else
    	memcpy((LPVOID)SuperBullets, "\x0F\x94\xC0", 3);//OFF

  10. #9
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,589
    Reputation
    5180
    Thanks
    14,177
    My Mood
    Inspired
    Quote Originally Posted by master131 View Post
    That code wont work @comando2056. When I hit the numpad 1 button, the superbullets turns on but as soon as I let go it will turn off again.
    Code:
    if(GetAsyncKeyState (VK_NUMPAD1)&1)
    Woops
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  11. #10
    MohammaDMD18's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    39
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by comando2056 View Post
    Here you go, this should work.

    Code:
    #include <windows.h>
    
    #define SuperBullets 0x3740DDB6 /*Defining the address of SuperBullets*/
    
    void Main()
    {
    	if(GameStatus == 1)/*Checking if In game*/
    	{
    
    		if(GetAsyncKeyState (VK_NUMPAD1))/*If Key is pressed*/
    		{
    			memcpy((LPVOID)SuperBullets, "\x33\xC0\x90", 3);//ON
    		} else {
    			memcpy((LPVOID)SuperBullets, "\x0F\x94\xC0", 3);//OFF
    		}
    	}
    }
    
    bool IsGameReady(void) //Gets the handle of all of these
    {
        if( GetModuleHandleW( L"d3d9.dll"     ) != NULL 
    		&& GetModuleHandleW( L"ClientFX.fxd" ) != NULL 
    		&& GetModuleHandleW( L"CShell.dll"   ) != NULL )
    		return true;
    	
    	return false;
    }
    
    DWORD WINAPI dwMainThread(LPVOID)
    {
    	while ( !IsGameReady() )
    		Sleep(100);
    
    	Main(); 
    
    	return 0;
    }
    
    BOOL WINAPI DllMain(
    	HINSTANCE hinstDLL,  // handle to DLL module
    	DWORD fdwReason,     // reason for calling function
    	LPVOID lpReserved )  // reserved
    {
    	// Perform actions based on the reason for calling.
    	switch( fdwReason ) 
    	{ 
    	case DLL_PROCESS_ATTACH:
    		// Initialize once for each new process.
    		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)dwMainThread, NULL, NULL, NULL);
    		MessageBoxA(NULL, "Message", "Caption", MB_OK);
    		break;
    
    	case DLL_THREAD_ATTACH:
    		// Do thread-specific initialization.
    		break;
    
    	case DLL_THREAD_DETACH:
    		// Do thread-specific cleanup.
    		break;
    
    	case DLL_PROCESS_DETACH:
    		// Perform any necessary cleanup.
    		break;
    	}
    	return TRUE;  // Successful DLL_PROCESS_ATTACH.
    }
    Try learning more C++, How memory works and ASM helps too.
    Okay, thanks for the help.

    I have to define gamestatus, like superbullet, right?




    Eh, I really need a teacher, people usually don't like to help with these stuff...

  12. #11
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,589
    Reputation
    5180
    Thanks
    14,177
    My Mood
    Inspired
    Quote Originally Posted by MohammaDMD18 View Post
    Okay, thanks for the help.

    I have to define gamestatus, like superbullet, right?



    Eh, I really need a teacher, people usually don't like to help with these stuff...
    Oh yeah. I forgot to define GameStatus. Do the same.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  13. #12
    MohammaDMD18's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    39
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by comando2056 View Post


    Oh yeah. I forgot to define GameStatus. Do the same.
    It injects perfectly, even the pop-up comes, but in-game the superbullet doesn't work...hmm...I'm gonna keep learning C++, while trying to creat 1 working hack for CA, while being a noob and c/p-ing the source codes D:

    I've realized how hard coding is, now on I'm gonna show some real respect to the coders, thank them and all that.
    Last edited by MohammaDMD18; 10-30-2011 at 06:48 PM.

  14. #13
    teehee15's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    329
    Reputation
    52
    Thanks
    109
    Quote Originally Posted by MohammaDMD18 View Post
    It injects perfectly, even the pop-up comes, but in-game the superbullet doesn't work...hmm...I'm gonna keep learning C++, while trying to creat 1 working hack for CA, while being a noob and c/p-ing the source codes D:

    I've realized how hard coding is, now on I'm gonna show some real respect to the coders, thank them and all that.
    thats cause i bet u didnt read and figure out that u had to change it to (VK_NUMPAD1)&1)

  15. #14
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,409
    My Mood
    In Love
    The code given isn't on a while loop
    No I do not make game hacks anymore, please stop asking.

  16. #15
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,589
    Reputation
    5180
    Thanks
    14,177
    My Mood
    Inspired
    Quote Originally Posted by flameswor10 View Post
    The code given isn't on a while loop
    How do you know I'm from there?

    And just add
    Code:
    while(1){
    To the beginning of where the hacks start. Before anything, in that function.

    EDIT:

    Also, Didn't notice. Its
    Code:
    if(*(BYTE*)GameStatus == 1)
    Last edited by Flengo; 10-31-2011 at 02:05 PM.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


Similar Threads

  1. [Help Request] WHAT AM I DOING WRONG?
    By GoGrandma in forum Combat Arms Help
    Replies: 9
    Last Post: 07-19-2011, 12:21 AM
  2. [Help Request] what am i doing wrong?
    By pyrozombie in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 0
    Last Post: 05-31-2011, 03:02 AM
  3. <ASK>need help. what's wrong with :u.c.e vs midtown
    By goblox in forum Piercing Blow Discussions
    Replies: 7
    Last Post: 04-03-2011, 09:16 AM
  4. [Help] what am i doing wrong
    By Zyixc in forum C++/C Programming
    Replies: 5
    Last Post: 06-03-2010, 04:44 AM
  5. What am i doing wrong plz help
    By SethKrieg24 in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 4
    Last Post: 02-02-2009, 05:55 PM