Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    lilneo's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Canada
    Posts
    217
    Reputation
    8
    Thanks
    28

    [Help] Fix not working

    Okay well, you closed my last thread that said solved. You gave me the fix for my address's changing on me, because it was relative to engine.dll. Well I am using the GetModuleHandle("engine.dll")+<address> to get the addies now, but if I change them the game just crashes... Here's some of my code:
    Code:
    DWORD* Cheats = (DWORD*)(GetModuleHandle("engine.dll")+0x544810);
    bool Hack;
    
    //other stuff
    
    void HackFunction()
    {
    	while(1)
    	{
    		if(GetAsyncKeyState(VK_INSERT)&1)
    		{
    			Hack=!Hack;
    			if(Hack)
    			{
    				MessageBoxA(NULL, "Hack turned on.", "Manipulator", NULL);
    				*Cheats = 1;
    			}
    			if(!Hack)
    			{
    				MessageBoxA(NULL, "Hack turned off.", "Manipulator", NULL);
    				*Cheats = 0;
    			}
    		}
    
    // more stuff
    BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved){
    
    if( ul_reason_for_call == DLL_PROCESS_ATTACH)
    	{
    		CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&HackFunction, NULL, 0, NULL );
    		if(GetLastError()==0)
    		{
    			MessageBoxA(NULL, "DLL injected and thread created successfully.", "Manipulator", NULL);
    		}
    	}
    return TRUE;
    }
    That's only a portion of the code, I'm not getting any compile errors so don't worry about syntax errors or things like that.

    When I push insert it says "Hack turned on" then a second after I push okay, the game just closes.

    ~lilneo

  2. #2
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    Check the return on GetModuleHandle. You need to give your target some time to load dynamically linked libraries. If it fails to get the base of the module, you need to go again until it is finally loaded.

    GetModuleHandle will return null if it has encountered an error.



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  3. The Following 2 Users Say Thank You to radnomguywfq3 For This Useful Post:

    Hell_Demon (08-21-2010),why06 (08-21-2010)

  4. #3
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    If you got the offset using ollydbg, I think olly shows the base of the DLL with the added RVA. Not the actual base.

    Someone correct me, I'm not good with the PE crap..

  5. #4
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    Quote Originally Posted by Void View Post
    If you got the offset using ollydbg, I think olly shows the base of the DLL with the added RVA. Not the actual base.

    Someone correct me, I'm not good with the PE crap..
    You're correct. If the the address your adding to the base address of engine.dll isn't an RVA, you need to go back and reload the executable and it's modules. Then locate the target address, and subtract the base address of it's parent module and you will get the RVA.



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  6. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    When a game crashes un expectedly its usually due to one of two reasons:

    1. Memory Access:
    - u tried to write over mem that was read only
    - accessing memory out of bonds

    2. Hack prevention program

    I think this is ur problem here:
    *Cheats = 1;

    I think when u try to change the value of the addy the memory at that location may be read only. So u might need to us VirtualProtect API to change the access privileges to this memory location.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

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

    NextGen1 (08-21-2010)

  8. #6
    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
    He got it with cheat engine, I assume his problem is that engine.dll isn't loaded when he injects.
    Ah we-a blaze the fyah, make it bun dem!

  9. #7
    lilneo's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Canada
    Posts
    217
    Reputation
    8
    Thanks
    28
    How does sv_cheats exist if engine.dll isn't loaded...

    And Why06, I am injected... I have access to it all, and I can change it if I use the address straight up. Except it changes.

    Okay so, I have ensured that GetModuleHandle("engine.dll") is not NULL for when I set the pointers. Now, even when I read from them. I use MessageBox to display *Cheats and it just crashes the game.

    ~lilneo

  10. #8
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by lilneo View Post
    How does sv_cheats exist if engine.dll isn't loaded...
    It doesn't. Which might be a problem. But since u said it wasn't null ill assume that's not it.

    And Why06, I am injected... I have access to it all, and I can change it if I use the address straight up. Except it changes.

    ~lilneo
    Since the program crashes as soon as u try to change the value I assumed u didn't have proper privileges to change that memory, ur accesing memory out of bonds(module isn't loaded), or some hack prevention mechanism is closing the game.

    Ps: I'm typing this on my Droid phone sry if I can't be more detailed. Speaking og details... what game is this?

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  11. #9
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Log the address you obtained in a text file or something. Before activating the hack, attach your debugger to the game and get the address manually, compare the one you got and the one you logged.

    -Make sure the module is found before you add the offset to the base.

    -Make sure the page you're writing to has the proper access rights for writing. If you try writing to it and the pages rights only allow execution or reading, it could cause problems.

  12. #10
    lilneo's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Canada
    Posts
    217
    Reputation
    8
    Thanks
    28
    Alright, Well I did some research and I think I have to use GetModuleInformation to get the entry point address of the dll. From that I can add the address. But it's still not working, I am so sick of this here is my entire code:
    Code:
    #include <windows.h>
    #include <Psapi.h>
    #include <string.h>
    #include <stdio.h>
    
    DWORD Cheats = NULL;
    DWORD Consistency = NULL;
    DWORD Timescale = NULL;
    DWORD Wallhack = NULL;
    bool Hack = false;
    
    void HackFunction()
    {
    	while(1)
    	{
    		POINT pos;
    		GetCursorPos(&pos);
    		double mouse_x = pos.x;
    		double mouse_y = pos.y;
    
    		if(GetAsyncKeyState(VK_INSERT)&1)
    		{
    			Hack=!Hack;
    			if(Hack)
    			{
    				MessageBoxA(NULL,"Hack turned on.", "Manipulator", NULL);
    				Cheats = 1;
    				Consistency = 0;
    				Timescale = 4;
    				Wallhack = 2;
    			}
    			if(!Hack)
    			{
    				MessageBoxA(NULL, "Hack turned off.", "Manipulator", NULL);
    				Cheats = 0;
    				Consistency = 1;
    				Timescale = 1;
    				Wallhack = 1;
    			}
    		}
    		if(GetAsyncKeyState(VK_LBUTTON) && Hack)
    		{
    			SetCursorPos((int)mouse_x,(int)mouse_y+3);
    			Sleep(23);
    		}
    		if(GetAsyncKeyState(VK_HOME))
    		{
    			break;
    		}
    		Sleep(10);
    	}
    }
    BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved){
    
    if( ul_reason_for_call == DLL_PROCESS_ATTACH)
    	{
    		while(GetModuleHandle("engine.dll")==NULL)
    		{
    			Sleep(1);
    		}
    		if(GetModuleHandle("engine.dll")!=NULL)
    		{
    			HMODULE ModHandle=NULL;
    			MODULEINFO info = {0};
    
    			while(ModHandle==NULL)
    			{
    				ModHandle = GetModuleHandle("engine.dll");
    			}
    			
    			GetModuleInformation(GetCurrentProcess(),ModHandle,&info,sizeof(info));
    
    			DWORD Cheats = (DWORD)((DWORD)(info.EntryPoint)+0x544810);
    			DWORD Consistency = (DWORD)((DWORD)(info.EntryPoint)+0x544A50);
    			DWORD Timescale = (DWORD)((DWORD)(info.EntryPoint)+0x393D94);
    			DWORD Wallhack = (DWORD)((DWORD)(info.EntryPoint)+0x4C89A8);
    
    			CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&HackFunction, NULL, 0, NULL );
    			
    			if(GetLastError()==0)
    			{
    				MessageBoxA(NULL, "DLL injected and thread created successfully.", "Manipulator", MB_OK);
    			}
    			else
    			if(GetLastError!=0)
    			{
    				char lasterr[128];
    				sprintf(lasterr, "%x", GetLastError());
    				MessageBox(0, lasterr, "ERROR", 0);
    			}
    		}
    	}
    return TRUE;
    }
    (edit3) Alright, I've finally fixed it enough so that the game no longer crashes, unfortunately it's not changing Cheats or anything...

    ~lilneo

  13. #11
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    The RVA is relative to the base address of a module(where the module was loaded), not it's entry-point.



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  14. #12
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy
    Quote Originally Posted by Jetamay View Post
    The RVA is relative to the base address of a module(where the module was loaded), not it's entry-point.
    so ur sayin that he cant start his hacks upon the dlls entry point cuz it may not have loaded engine.dll?

  15. #13
    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
    lilneo how about you learn how to code first?

    Code:
    				Cheats = 1;
    				Consistency = 0;
    				Timescale = 4;
    				Wallhack = 2;
    I facepalmed at that >.> of course it's not changing sv_cheats...
    Ah we-a blaze the fyah, make it bun dem!

  16. #14
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    114
    My Mood
    Twisted
    Quote Originally Posted by Hell_Demon View Post
    lilneo how about you learn how to code first?

    Code:
    				Cheats = 1;
    				Consistency = 0;
    				Timescale = 4;
    				Wallhack = 2;
    I facepalmed at that >.> of course it's not changing sv_cheats...
    Note H_D, there are actually hacks that do change sv_cheats localy, wich allows you to use non-serverside commands, for some reason VAC allows the server and the client to have different values for sv_cheats

  17. #15
    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 schim View Post
    Note H_D, there are actually hacks that do change sv_cheats localy, wich allows you to use non-serverside commands, for some reason VAC allows the server and the client to have different values for sv_cheats
    Yeah I know but he isn't using pointers

    He sets the value of a local variable to the addy of sv_cheats, then replaces that value with 1 and 0 in his keycheck >.>
    Ah we-a blaze the fyah, make it bun dem!

Page 1 of 2 12 LastLast

Similar Threads

  1. [Help Request] =HELP= Injector/machidamia hack not working
    By omfgs in forum CrossFire Help
    Replies: 24
    Last Post: 06-26-2011, 08:35 AM
  2. Fun H4x v2.0 (LAG FIXED) Not working for me
    By Icøn in forum Combat Arms Help
    Replies: 2
    Last Post: 08-22-2010, 05:01 AM
  3. Help hax not working
    By scarfacedst in forum Combat Arms Help
    Replies: 10
    Last Post: 05-03-2010, 07:43 PM
  4. [Help]Uploads not working[/closed]
    By ~J8y~ in forum Visual Basic Programming
    Replies: 4
    Last Post: 05-01-2010, 11:17 AM
  5. [HELP]DTXconverter not working
    By KUPKAKE in forum Combat Arms Mod Discussion
    Replies: 2
    Last Post: 01-22-2010, 05:00 PM