Solved[C++]ForceHost

Posts 1–11 of 11 · Page 1 of 1
[C++]ForceHost
Hey =)

So, i´m trying to make a simple force host "Hack" but something seems to be wrong with my code.


Code:
....
	if(ProcHandle != 0){

		int ADDR1, ADDR2;
		int setValue = 1;
	        DWORD dwFh1 = 0x140C124 ;
                DWORD dwFh2 = 0x140C148;
    
                ReadProcessMemory (ProcHandle,(LPCVOID)dwFh1,&ADDR1,sizeof(ADDR1),NULL);
		ReadProcessMemory (ProcHandle,(LPCVOID)dwFh2,&ADDR2,sizeof(ADDR2),NULL);
			   
		ADDR1 +=  0xC;
		ADDR2 +=  0xC;    

		while(1){
	                   WriteProcessMemory(ProcHandle,(LPVOID)ADDR1,&setValue,sizeof(setValue),NULL);
			   WriteProcessMemory(ProcHandle,(LPVOID)ADDR2,&setValue,sizeof(setValue),NULL);

			   Sleep(1000);
		}

...

Thanks =)


Edit: Sorry, the code tags make it look a little bit crappy

cheers
Assuming the offsets are correct, the code seems right... try to change the casting from LPCVOID to DWORD on the RPM and on the WPM

Code:
....
	if(ProcHandle != 0){

		int ADDR1, ADDR2;
		int setValue = 1;
	        DWORD dwFh1 = 0x140C124 ;
                DWORD dwFh2 = 0x140C148;
    
                ReadProcessMemory (ProcHandle,(DWORD)dwFh1,&ADDR1,sizeof(ADDR1),NULL);
		ReadProcessMemory (ProcHandle,(DWORD)dwFh2,&ADDR2,sizeof(ADDR2),NULL);
			   
		ADDR1 +=  0xC;
		ADDR2 +=  0xC;    

		while(1){
	                   WriteProcessMemory(ProcHandle,(DWORD)ADDR1,&setValue,sizeof(setValue),NULL);
			   WriteProcessMemory(ProcHandle,(DWORD)ADDR2,&setValue,sizeof(setValue),NULL);

			   Sleep(1000);
		}

...
Hmm thats crazy, thats also dont work :O But i think too, that the code is correct. Very mysteries

cheers
Addies are wrong
They change every time u restart ur game, and its not always those 2.
Use this
Code:
WriteInteger(ReadInteger(0x0140C124) + 0xC, 1);
Im pretty sure that the Addies are correct ;D, Jorndel use them too and its works perfect in his server control cheat, he released the source in C# here.

And my code is C++ not C# or vb.net, the code that you post it from Jorndels Module which is written in vb.net and C# :P.

cheers
Quote Originally Posted by Horror View Post
Addies are wrong
They change every time u restart ur game, and its not always those 2.
Use this
Code:
WriteInteger(ReadInteger(0x0140C124) + 0xC, 1);
I think you need glasses Just kidding. He is using that address already

Back on topic, verify the value read from 0x0140C124 + 0xC on CE to see if points to the right address...
addresse is not correct . 05AB6BA0 (value=0) try this .
Quote Originally Posted by [NooB] Mentor View Post
addresse is not correct . 05AB6BA0 (value=0) try this .
if you using VB then you can use (ofc) Jorndels class and this
Code:
 Dim mw3 As New trainer
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        mw3.Hack("iw5mp")
        mw3.SetInt(&H5AB6BA0, 0)

    End Sub
He's using a pointer to find the address. The address you have might change upon game restart or don't work at all for other people. The pointer (0x0140C124) holds the address of the right offset every time, read it, add 0xC (cause its a pointer) and you'll have the right one
Not all pointers are the same I have tested this with a number of users through tv


&H5AB6B48 + &HC
&H5AB6B48 + &HC
&H5AB6B94 + &HC
&H5AB6B48 + &H58

I use cheat engine at the mo and I am trying to find the true static, however the game crashes out when I do a "what accesses this address", anybody got another prog that may not crash out ?
Your code looks fine to me, but try changing sizeof(blah) to 4 instead. Also make sure your process handle from OpenProcess has the PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION access flags too.
Thank you all guys, now its working perfect


cheers =)
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us