QuestionWhat is wrong with this code?

Posts 1–3 of 3 · Page 1 of 1
What is wrong with this code?
Hey.

I have the following pointer in CE:


Base: "metin2client.bin"+00C008EC
Offset 1: 0x510
Offset 2: 0x682

Now my code in c++:

Code:
//////////////SPEEDHACK//////////////
#define BasePointer1 0xC008EC
#define Points6 0x00000510
#define Points7 0x00000682


void SetSpeedhack(){
	 DWORD wert1 = *(DWORD*)BasePointer1; 
     if(wert1 > 0){
       wert1 = *(DWORD*)(wert1 + Points6); 
       wert1 += Points7;

      *(WORD*)wert1 = 16666 ;
    }
				
}
But when i call the function, the game crashes.
What is wrong with the code?
Thank you
Best regards,
3a8ca54e58.png9 KB · 8 downloads
Base: "metin2client.bin"+00C008EC
#define BasePointer1 0xC008EC;

DWORD wert1 = *(DWORD*)BasePointer1;
You contradict yourself. Why did you go from "metin2client.bin" +offset to simply an offset for the base addr ??

The image says the base of the module is your first pointer. Where did you get 0xC008EC from?

You should be calling some Windows function to know where the module begins in ram..

-------------------------------------------------------------------------------------------------

edit: No code, but this is how to follow that pointer list

Imaginary view of RAM


1. Read the first 4 bytes of 'metin2client.bin' (A in the picture)

2. Add +510h to the value from step one, = B in the picture

3. Read 4 bytes starting at B

4. Add +682h to the value from step 3

5. You're at your final address.


Read memory once, add offset, read memory again, add second offset. done.

Code:
//pseudocode

addr1 = Read4Bytes(metin2client.baseAddr) // baseAddr = beginning of module in ram
addr1 += 0x510

addr2 = Read4Bytes(addr1)
addr2 += 0x682
addr2 is final addr
Hey, i allready fixxed it


Code:
#define BasePointer1 0x400000
#define dwSpeedAddress 0x00C008EC
#define Points6 0x00000510
#define Points7 0x00000682


void SetSpeedhack(){
	DWORD wert1 = *(DWORD*)(BasePointer1 + dwSpeedAddress);
	if (wert1 > 0){
		wert1 = *(DWORD*)(wert1 + Points6);
		wert1 += Points7;

		*(WORD*)wert1 = 16666;
	}

}

But now another problem (Probably the same) with my string pointer.

My code to read it:

Code:
private: System::Void Ausleser_Tick(System::Object^  sender, System::EventArgs^  e) {
				 //Name
				 try{
					 char buf2[512];
					 int val2 = 0;
					 DWORD Metin = (DWORD)(GetModuleHandleA("metin2client.bin"));
					 DWORD cArray = *(DWORD*)(Metin + 0xBFE7A4);
					 DWORD Point = *(DWORD*)(*(DWORD*)(cArray + 0x370) + 0x1f0);
					 char* Text = (char*)(Point + 0x64);
					 String^ s2 = gcnew String(Text);

					 if (s2 == "") {
						 return;
					 }
					 else {
						 //Name
						 label5->Text = s2;
						 //ID
						 char buf[1024];
						 GetCharID(buf);
						 label4->Text = gcnew String(buf);


					 }
				 }
				 catch (...) {


				 }

				 }
And again a crash of the game.
Whats wrong?

My offsets:



The base:
"metin2client.bin"+00BFE7A4

EDIT: FIXXED AGAIN
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?