• 2
• 1K
W

#### wtlyons

Hi guys I just finished making a teleport hack that teleports you 15 feet in the direction your facing. To use it start the game then hit F2 to teleport. Feel free to change the source code to
change the key-bind or use this in your hack. It will be included in my multi hack I make later on. It works by getting your view angle and solving for the X value using the (sin of the angle) x (travelDistance) then taking that and using Pythagorean Theorem to find the Y axis value. Look through the code and you will see it more in depth! Here is an image of the view angle corresponding
to the x and y axis and might help you get a better understanding of the general concept i used.

https://prntscr.com/92qv9c

https://www.metascan-online.com/#!/results/file/29dbd0b982414dcf8deda68a35730e78/extracted

Here are 2 pictures showing teleporting through a wall
https://prntscr.com/92qjnh
https://prntscr.com/92ql0i

C++:
``````#include <iostream>
#include <Windows.h>
#include <string>
#include <ctime>
#include <cmath>

#define PI 3.14159265

//Function Declerations
void displayCoordinates(HANDLE hProcHandle);

std::string GameStatus;

bool IsGameAvail;
bool UpdateOnNextRun;

DWORD pLocalPlayer = { 0x509B74 };	//local player pointer
float xAxisValue = 0;
float yAxisValue = 0;
float zAxisValue = 0;
float rotationValue = 0;

int main()
{

HWND hGameWindow = NULL;
int timeSinceLastUpdate = clock();
int GameAvailTMR = clock();
int onePressTMR = clock();
DWORD dwProcID = NULL;
HANDLE hProcHandle = NULL;
UpdateOnNextRun = true;

while (!GetAsyncKeyState(VK_INSERT))
{

if (clock() - GameAvailTMR > 100)
{
GameAvailTMR = clock();
IsGameAvail = false;

hGameWindow = FindWindowA(NULL, "AssaultCube");
if (hGameWindow)
{
dwProcID = 0;
if (dwProcID != 0)
{
if (hProcHandle != NULL)
{
CloseHandle(hProcHandle);
}
hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcID);
if ((hProcHandle == INVALID_HANDLE_VALUE) || (hProcHandle == NULL))
{
GameStatus = "Failed To Open Process For Valid Handle";
}
else
{
GameStatus = "AssaultCube Ready To Hack";
IsGameAvail = true;
}

}
else
{
GameStatus = "Failed To Get Process ID";
}

}
else
{
GameStatus = "Failed To Get Process ID";
}

}

if ((UpdateOnNextRun) || (clock() - timeSinceLastUpdate > 5000))
{
system("cls");
std::cout << "GAME STATUS: " << GameStatus << std::endl << std::endl;
std::cout << "[F2] Teleport" << std::endl;
std::cout << "[INSERT] Exit" << std::endl;
std::cout << std::endl;
UpdateOnNextRun = false;
timeSinceLastUpdate = clock();

}

if (clock() - onePressTMR > 400)
{

if (IsGameAvail)
{

if (GetAsyncKeyState(VK_F2))
{
float xValue = 0;
float yValue = 0;
float travelDistance = 15;
onePressTMR = clock();

if (rotationValue == 0)
{
yValue = yAxisValue - travelDistance;
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x38), &yValue, sizeof(yValue), NULL);	// writes new y position to memory
}
if ((rotationValue > 0) && (rotationValue < 90))
{
xValue = travelDistance * sin(rotationValue*PI / 180);				//calculates travel distance of x
yValue = sqrt(abs(pow(travelDistance, 2.0) - pow(xValue, 2.0)));	//calculates travel distance of y

xValue = xAxisValue + xValue;	// calculate x teleport position

yValue = yAxisValue - yValue;	// calculate y teleport position

WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x34), &xValue, sizeof(xValue), NULL);	//writes new x position to memory
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x38), &yValue, sizeof(yValue), NULL);	// writes new y position to memory
}
if (rotationValue == 90)
{
xValue = xAxisValue + travelDistance;
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x34), &xValue, sizeof(xValue), NULL);	// writes new x position to memory
}
if ((rotationValue > 90) && (rotationValue < 180))
{
rotationValue = 180 - rotationValue;
xValue = travelDistance * sin(rotationValue*PI / 180);				//calculates travel distance of x
yValue = sqrt(abs(pow(travelDistance, 2.0) - pow(xValue, 2.0)));	//calculates travel distance of y

xValue = xAxisValue + xValue;	// calculate x teleport position

yValue = yAxisValue + yValue;	// calculate y teleport position

WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x34), &xValue, sizeof(xValue), NULL);	//writes new x position to memory
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x38), &yValue, sizeof(yValue), NULL);	// writes new y position to memory
}
if (rotationValue == 180)
{
yValue = yAxisValue + travelDistance;
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x38), &yValue, sizeof(yValue), NULL);	// writes new y position to memory
}
if ((rotationValue > 180) && (rotationValue < 270))
{
rotationValue = rotationValue - 180;
xValue = travelDistance * sin(rotationValue*PI / 180);				//calculates travel distance of x
yValue = sqrt(abs(pow(travelDistance, 2.0) - pow(xValue, 2.0)));	//calculates travel distance of y

xValue = xAxisValue - xValue;	// calculate x teleport position

yValue = yAxisValue + yValue;	// calculate y teleport position

WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x34), &xValue, sizeof(xValue), NULL);	//writes new x position to memory
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x38), &yValue, sizeof(yValue), NULL);	// writes new y position to memory
}
if (rotationValue == 270)
{
xValue = xAxisValue - travelDistance;
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x34), &xValue, sizeof(xValue), NULL);	// writes new x position to memory
}
if ((rotationValue > 270) && (rotationValue < 360))
{
rotationValue = 360 - rotationValue;
xValue = travelDistance * sin(rotationValue*PI / 180);				//calculates travel distance of x
yValue = sqrt(abs(pow(travelDistance, 2.0) - pow(xValue, 2.0)));	//calculates travel distance of y

xValue = xAxisValue - xValue;	// calculate x teleport position

yValue = yAxisValue - yValue;	// calculate y teleport position

WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x34), &xValue, sizeof(xValue), NULL);	//writes new x position to memory
WriteProcessMemory(hProcHandle, (LPVOID)(playerObjectAddress + 0x38), &yValue, sizeof(yValue), NULL);	// writes new y position to memory
}
}

}
}
}
return ERROR_SUCCESS;

}``````

#### Attachments

• 7.9 KB Views: 7

noice work!

• #### 0x123

##### Russians are so good at hacking ._.
Dank Tier Donator
Nobleman
Really nice Attention! Before you post:

99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

• Fill out the form correctly
• Tell us the game name & coding language 