Teleport function [Help please]

Posts 1–3 of 3 · Page 1 of 1
Teleport function [Help please]
Hi all i'm trying to make a teleport function in my hack (realy d3d...)

this is the my code, where is the error?? because when i click pageup for teleport i go to the cordinate 0 0 0, i think the readpointerfloat function don't work

this is the code of functions:

Code:
void WritePointerFloat(long addy, short offset, float value) //////this work 
{
	long maddy;
	long saddy;
	memory();
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
	saddy = maddy + offset;
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}

void ReadPointerFloat(long addy, short offset, float &buffer) ////// this i think no
{
	long faddy;
	long raddy;
	memory();
	ReadProcessMemory(hProcess,(LPVOID*)(DWORD)addy, &faddy, sizeof(faddy),NULL);
	raddy = faddy + offset;
	ReadProcessMemory(hProcess,(LPVOID*)(DWORD)raddy, &buffer, sizeof(buffer),NULL);
}
this is the code of teleport:
Code:
void teleport() 
{ 
float  x, y, z;
if (GetAsyncKeyState(VK_NEXT) &1<< 0xF)
{
ReadPointerFloat(pointer_Addie, 0x174, y); 
ReadPointerFloat(pointer_Addie, 0x17C, x); 
ReadPointerFloat(pointer_Addie, 0x178, z); 
}
if (GetAsyncKeyState(VK_PRIOR) &1<< 0xF)
{
WritePointerFloat(pointer_Addie, 0x174, y); 
WritePointerFloat(pointer_Addie, 0x17C, x); 
WritePointerFloat(pointer_Addie, 0x178, z); 
}
}
where is the error ??

thx for helping!
why using a Reference ?

Code:
long curx, cury, curz, x2, y2, z2;
void GetCurTele(long playerpointer)
{
	long bla, bla2, bla3;
	memory();
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)playerpointer, &bla, sizeof(bla), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)playerpointer, &bla2, sizeof(bla2), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)playerpointer, &bla3, sizeof(bla3), NULL);
	x2 = bla + OFS_X;
	y2 = bla2 + OFS_Y;
	z2 = bla3 + OFS_Z;
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)x2, &curx, sizeof(curx), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)y2, &cury, sizeof(cury), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)z2, &curz, sizeof(curz), NULL);
	
}
void TelePort()
{
        memory();
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD)x2, &curx, sizeof(curx), NULL);
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD)y2, &cury, sizeof(cury), NULL);
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD)z2, &curz, sizeof(curz), NULL);
}
as example if you want to use Write/Read - ProcessMemory
Quote Originally Posted by ZeaS View Post
why using a Reference ?

Code:
long curx, cury, curz, x2, y2, z2;
void GetCurTele(long playerpointer)
{
	long bla, bla2, bla3;
	memory();
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)playerpointer, &bla, sizeof(bla), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)playerpointer, &bla2, sizeof(bla2), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)playerpointer, &bla3, sizeof(bla3), NULL);
	x2 = bla + OFS_X;
	y2 = bla2 + OFS_Y;
	z2 = bla3 + OFS_Z;
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)x2, &curx, sizeof(curx), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)y2, &cury, sizeof(cury), NULL);
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD)z2, &curz, sizeof(curz), NULL);
	
}
void TelePort()
{
        memory();
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD)x2, &curx, sizeof(curx), NULL);
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD)y2, &cury, sizeof(cury), NULL);
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD)z2, &curz, sizeof(curz), NULL);
}
as example if you want to use Write/Read - ProcessMemory
Nice,I needed help with this too
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Talk with us