Cannot Find Static Address / LPCSTR Error

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

RandomOne

Newbie
Full Member
Jun 7, 2014
10
132
0
Title's bit vague.

Alright, so I've looked at Fleep's pointer tutorials, and for the multiplayer horror "Slendytubbies II" I could not find a green address.
I've gotten some data on base pointers on the time limit for the night vision of the camera using the pointer scan.
However, the pointer works half the time. I have two sets of saved pointer scans, both with about 14 base pointers. I usually use the first one of each set.
Half the time, the trainer I created from the generator doesn't work. The pointer is not working. I decided to investigate, and it seems to me that when my first pointers don't work, a second set of pointers do. So I'm curious why this happens. I get the impression that the creator or whatnot is trying to throw CE users off or something by switching the "correct" pointers.

Anyhow, I tried using the method in Fleep's pointer tutorial, and I couldn't find a correct green address, so that's why I used the pointer scan.
I'm also looking at his C++ training guide, and somewhere in the 5/6th video, I get a LPCSTR and LPCWSTR conversion error. I'm using VS 2013, so i'm not sure if that has an effect.
This is for the FindWindow function. Could someone help me out? I'm willing to post the project (are virus scans needed for that too?).

And in the very near beginning of the VS tutorial for external hacks, it asks for the base address. The base address I got using the pointer scan was "Slendytubbies II.exe" + some hex number. So it wasn't just the hex number, it was the process plus the hex number. How do I figure out or input the base address then?


EDIT:
As for the pointer scans, the pointers I get do work. But when they don't, they switch to another pointer. Sometimes I cross-scan the "different sets of pointers" and get 0 results. This game is made via Terror Engine (Zeoworks).
 
Last edited:

NebulaGrey

Newbie
Full Member
Jun 8, 2014
30
218
1
For the pointer scanning part, I'm not completely sure why some sometimes work. But what you need is one that doesn't change ever. which means you need to keep re-scanning your list of pointers.

As for the error in LPCSTR for FindWindow. you want to use FindWindow(NULL, T("WindowNameHere")); your header is #include <tchar.h>

goodluck!
 

RandomOne

Newbie
Full Member
Jun 7, 2014
10
132
0
This is what I have so far before adding tchar.h

C++:
#include <iostream>
#include <windows.h>
#include <string>
#include <ctime>

DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress);
void WriteToMemory(HANDLE hProcHandle);


std::string Gamename = "Slendytubbies II";
LPCSTR LGameWindow = "Slendytubbies II";
std::string GameStatus;

bool IsGameAvail;
bool UpdateOnNextRun;

//TIMER VARS
bool TimerStatus;
BYTE TimerValue[] = {0xA3, 0x1C, 0x0, 0x0};
DWORD TimerBaseAddress = {0x00C1CED0};
DWORD TimerOffsets[] = {0xD0, 0x0, 0x138, 0x20, 0x5C};


int main()
{
	HWND hGameWindow = NULL;
	int timeSinceLastUpdate = clock();
	int GameAvailTMR = clock();
	int onePressTMR = clock();
	DWORD dwProcID = NULL;
	HANDLE hProcHandle = NULL;
	UpdateOnNextRun = true;
	std::string sTimerStatus = "OFF";
	
	while  (!GetAsyncKeyState(VK_INSERT))
	{
		if (clock() - GameAvailTMR > 100)
		{
			GameAvailTMR = clock();
			IsGameAvail = false;

			hGameWindow = FindWindowA( NULL, LGameWindow);
			if (hGameWindow)
			{
				GetWindowThreadProcessId(hGameWindow, &dwProcID);
				if (dwProcID != 0)
				{
					hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcID);
					if (hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
					{
						GameStatus = "Failed to open process for valid handle";
					}
					else
					{
						GameStatus = "Slendytubbies II READY TO HACK";
						IsGameAvail = true;
					}
				}
				else
				{
					GameStatus = "Failed get Process ID";
				}
			}
			else
			{
				GameStatus = "Slendytubbies II not found";
			}
			
			if (UpdateOnNextRun || clock() - timeSinceLastUpdate > 5000)
			{
				system("cls");
				std::cout << "--------------------------------------" << std::endl;
				std::cout << "    Slendytubbies II memory hacker    " << std::endl;
				std::cout << "--------------------------------------" << std::endl << std::endl;
				std::cout << "GAME STATUS:" << GameStatus << std::endl << std::endl;
				std::cout << "[F1] Freeze Timer ->" << sTimerStatus << " <- " << std::endl << std::endl;
				std::cout << "[INSERT] Exit" << std::endl;
				UpdateOnNextRun = false;
				timeSinceLastUpdate = clock();
			}
		
			if (IsGameAvail)
			{
				//WRITE TO MEMORY
				WriteToMemory(hProcHandle);
			}
		}

		if (clock() - onePressTMR > 400)
		{
			if (IsGameAvail)
			{
				if (GetAsyncKeyState(VK_F1))
				{
					onePressTMR = clock();
					TimerStatus = !TimerStatus;
					UpdateOnNextRun = true;
					if (TimerStatus)sTimerStatus = "ON";
					else sTimerStatus = "OFF";


				}


			}

		}


	}
	CloseHandle(hProcHandle);
	CloseHandle(hGameWindow);

	return ERROR_SUCCESS;

}

DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress)
{
	DWORD pointer = BaseAddress;
	DWORD pTemp;

	DWORD pointerAddr;
	for (int c = 0; c < PointerLevel; c++)
	{
		if (c == 0)
		{
			ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
		}

		pointerAddr = pTemp + Offsets[c];
		ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, sizeof(pTemp), NULL);
	}
	return pointerAddr;
}


void WriteToMemory(HANDLE hProcHandle)
{
	DWORD AddressToWrite;
	if (TimerStatus)
	{
		AddressToWrite = FindDmaAddy(5, hProcHandle, TimerOffsets, TimerBaseAddress);
		WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &TimerValue, sizeof(TimerValue), NULL);
	}
}

EDIT: I fixed it after replacing "FindWindow" with "FindWindowA" (plus some other mistake). Apparently the parameters are both LPCSTR so it works without any conversion. I also noticed when Fleep hovered over the FindWindow function the hover had an "A".

Now the bigger problem is finding the green address. I found the "green address" and with the correct pointers and all, but I'm getting a 9 digit hex code, and VS doesn't allow me to use that.
 
Last edited:

NebulaGrey

Newbie
Full Member
Jun 8, 2014
30
218
1
For the green address. When it says you have "Module" + offset there are two things you can do. What I do is take that ID and go into memorymap>data structures. the address will be the offset 0000 the first in the list.
the other way is to copy the value of the "Module" + offset and do a hex scan search (4Bytes). There should be a green address somewhere in the list if you do it that way.

I suggest doing it via data struct though since it is always the right base address.

Have fun hacking! :)
 

zoratz

Jr.Coder
Dank Tier Donator
Nobleman
Jul 22, 2013
81
838
2
To solve the "FindWindow" problem you'll have set the project to "Use Multi-Byte Character Set". To do that:
Project -> "Project" Properties... (Last option of the list)
It'll open a new window, on the left-column, goto:
Configuration Properties -> General
Now on the rigth-column, goto:
Project Defaults -> Character Set
And set it to "Use Multi-Byte Character Set".
 

RandomOne

Newbie
Full Member
Jun 7, 2014
10
132
0
This is what I get using the 2nd method. I'm not quite sure where the Memory Map option is on CE.

K5QdG2I.png
 

NebulaGrey

Newbie
Full Member
Jun 8, 2014
30
218
1
This is what I get using the 2nd method. I'm not quite sure where the Memory Map option is on CE.
Memory View is just below the list of scan outputs. on the left. You can also right click a result and say "Browse in memory region"
 
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