Solved Basic Teleport hack issue?

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Khonnor

Newbie
Full Member
Mar 7, 2014
30
1,248
0
Hi there, I've been trying to learn a bit of C++ as of late and came up with a basic teleport hack dll that I've been using for a couple of games.
It seems to work for the most part except for example, when I press a hot key more than once, or just seemingly at random, my game will crash. Here's my source code.

C++:
#include <Windows.h>
DWORD XcoordOLD;
DWORD YcoordOLD;
DWORD ZcoordOLD;
DWORD Base1 = (DWORD)GetModuleHandle(TEXT("GAME.EXE")) + 0x00CDC5AC;


void Hack()
{
	while (1)
	{
		if (GetAsyncKeyState(VK_END))
		{
			DWORD Address1 = *(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Base1)+0x1f4) + 0x6c) + 0x4) + 0x4) + 0xC8;
			DWORD *Value1 = (DWORD*)Address1;
			XcoordOLD = *Value1;    //Stores X coordinate into Value1
			DWORD Address2 = *(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Base1)+0x1f4) + 0x6c) + 0x4) + 0x4) + 0xd0;
			DWORD *Value2 = (DWORD*)Address2;
			ZcoordOLD = *Value2;    //Stores Z coordinate into Value2
			DWORD Address3 = *(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Base1)+0x1f4) + 0x6c) + 0x4) + 0x4) + 0xCC;
			DWORD *Value3 = (DWORD*)Address3;
			YcoordOLD = *Value3;    //Stores Y Coordinate into Value3
		}
		
		if (GetAsyncKeyState(VK_DELETE))
		{
			DWORD Address1 = *(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Base1)+0x1f4) + 0x6c) + 0x4) + 0x4) + 0xC8;
			DWORD *Value1 = (DWORD*)Address1;
			*Value1 = XcoordOLD;    //Re-writes players coordinate with the value of Value1
			DWORD Address2 = *(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Base1)+0x1f4) + 0x6c) + 0x4) + 0x4) + 0xd0;
			DWORD *Value2 = (DWORD*)Address2;
			*Value2 = ZcoordOLD;    //Re-writes players coordinate with the value of Value2
			DWORD Address3 = *(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Base1)+0x1f4) + 0x6c) + 0x4) + 0x4) + 0xCC;
			DWORD *Value3 = (DWORD*)Address3;
			*Value3 = YcoordOLD;    //Re-writes players coordinate with the value of Value3
		}

	}
}
BOOL APIENTRY DllMain(HINSTANCE hDll, DWORD callReason, LPVOID lpReserved) {
	if (callReason == DLL_PROCESS_ATTACH) {
		CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Hack, 0, 0, 0);
		MessageBox(NULL, "DLL injected! Please check the Readme.txt for instructions.", "Sucess!", MB_OK);//Post a message if we injected.

	}

	return 1;
}
Is it because I'm delaring the variables each time I press the hot key?
Or is it something else.

I know my methods are pretty redundant right now, but it actually took me a little while to figure out how to use pointers in my source code. So as always, any help as well as criticism is always appreciated. :p
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,084
78,998
2,372
Use a function for calculating multi level pointers
https://guidedhacking.com/finddma

Never dereference a nullptr, check each pointer before dereferencing.

Find a pointer that is valid only when the rest of the memory you need is valid, check if it's null before continuing your haxxing. If all else fails, use IsBadReadPtr() and no I don't care what anyone says about it, if you need it, use it.
 

Ayamin

Newbie
Full Member
Apr 27, 2014
16
148
0
Try declaring the variables globally. Also, what I like to do to prevent confusion is to write out every single multi-level pointer. (Didn't look through every single parenthesis in your code, but there might be a typo.)

So, for example (for some game I was working on):

C++:
DWORD base = (DWORD)0x00690320;
DWORD ptr0 = *(DWORD*)(base); // value of the "base" address before offset applied
DWORD ptr1 = (DWORD)(ptr0 + 0x464); // address after offset applied (address of HP)
//etc...
void changeHP() {
*(DWORD*)ptr1 += 100;
}

Also, you have it so that it loops as fast as your computer can process. (Millions, billions times per second.)
You're going to want to Sleep() for a few seconds after each iteration of the call.
So, for example, going on with the previous example:

C++:
void loop() {

	while (1) {
		changeHP();
		Sleep(200);
	}
}
Also, I sent you a PM; I can help you with C++ implementation if you can help me with assembly and reversing. :)
 
Last edited:

crx123

Jr.Coder
Silenced
Nobleman
Apr 16, 2014
59
598
2
Did you figure it out?
I don't know how to do it in c++ but in CE's auto assembler i tried to get a multi pointer and i had to check if it's actually there, if i didn't i always crashed.
I asked for some help ce forum, i can't remember it was atom0s or ++METHOS who gave me my code with "cmp ecx,00010000"
it was something like this:
poppy was just pop ecx with originalcode and returnhere


As i said idk if you have to do it or how to do it in c++

C++:
push ecx
mov ecx,[esi+50]
cmp ecx,00010000
jbe poppy
mov ecx,[ecx]
cmp ecx,00010000
jbe poppy
mov ecx,[ecx+04]
//ecx = address+50 +0 +04
 

Ayamin

Newbie
Full Member
Apr 27, 2014
16
148
0
I don't know how to do it in c++ but in CE's auto assembler i tried to get a multi pointer and i had to check if it's actually there, if i didn't i always crashed.
I asked for some help ce forum, i can't remember it was atom0s or ++METHOS who gave me my code with "cmp ecx,00010000"
it was something like this:
poppy was just pop ecx with originalcode and returnhere


As i said idk if you have to do it or how to do it in c++

C++:
push ecx
mov ecx,[esi+50]
cmp ecx,00010000
jbe poppy
mov ecx,[ecx]
cmp ecx,00010000
jbe poppy
mov ecx,[ecx+04]
//ecx = address+50 +0 +04
I think OP knows what the offsets are so he doesn't need to check if the values he wants to modify are there
 

crx123

Jr.Coder
Silenced
Nobleman
Apr 16, 2014
59
598
2
I think OP knows what the offsets are so he doesn't need to check if the values he wants to modify are there
Not the values or offsets, the pointers.
If you play a game vs bots, there might be a pointer created somewhere to all the bots stats or w/e. (Like in Sauerbraten game, pointer is created near a player)
But if you play in an empty map, that pointer wouldn't be created, so when you try to access 12345678+50 +0 +04 , there might be no +50 +0 or + 04 and maybe thats why you would crash.
Just so you know i don't know what im talking about, it's just my guess. Because i had to do a check in that asm code above, or i would crash when changing a map or just by doing nothing after some time
 

Khonnor

Newbie
Full Member
Mar 7, 2014
30
1,248
0
Sorry for the lack of updates, I've been quite busy lately.
I'll definitely test out these theories soon and let you guys now.
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
You should consider opening a console and writing what you get for the pointers. If it crashes, see info and exception offset and you'll see where it crashed in your code... Such things often appear when reading from an address where is no memory...
 
Attention! Before you post:

Read the How to Ask Questions Guide
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
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods