Solved Fleep's Pattern Scanner Tutorial error's

Hexui Undetected CSGO Cheats PUBG Accounts

Nucleus

Newbie
Full Member
Jan 13, 2014
13
134
0
Hey guys, Nucleus here!

I just completed the tutorial and was surprised when i tried to build the program i got a couple different errors.

1>------ Build started: Project: ptscan, Configuration: Debug Win32 ------
1>Source.obj : error LNK2019: unresolved external symbol _GetModuleInformation@16 referenced in function "struct _MODULEINFO __cdecl GetModuleInfo(char *)" (?GetModuleInfo@@YA?AU_MODULEINFO@@PAD@Z)
1>C:\Users\Ryan\Documents\Visual Studio 2010\Projects\ptscan\Debug\ptscan.dll : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

so i figured i would download fleep's source code to check whats wrong with mine.
i threw his files in visual studio 2010 and tried to compile again, and even with his files it spits the same errors.
i am confused and i have put effort into trying to solve these errors with no results.
does anyone here know how to solve these? if so i thank you in advanced for helping!:eek:
 

NTvalk

Hacker
Meme Tier VIP
Jul 6, 2013
499
3,108
8
You can also try to add this line to the top
#include <Psapi.h>
#pragma comment (lib,"psapi.lib")
 
Last edited by a moderator:

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
first of all that are LNK errors as you can see, mostly that means that you forgot to include extern files hmm to see what you missed to include its at least for me needed to see your project
 

zoratz

Jr.Coder
Dank Tier Donator
Nobleman
Jul 22, 2013
81
908
2
im not sure, but i think that on that tutorial you had to use:

C++:
#include <Psapi.h>
If so, try including papi library to you project:
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
Write this on the BOX that will come up:
psapi.lib
And mark the checkbox:
[X] Inherit from parent or project defaults

I got that error when I followed that tutorial as well.. I had some trouble finding it on the web haha
 
Last edited:

Nucleus

Newbie
Full Member
Jan 13, 2014
13
134
0
im not sure, but i think that on that tutorial you had to use:

C++:
#include <Psapi.h>
If so, try including papi library to you project:

Write this on the BOX that will come up:

And mark the checkbox:



I got that error when I followed that tutorial as well.. I had some trouble finding it on the web haha
thank you mang you da baist!
 

Nucleus

Newbie
Full Member
Jan 13, 2014
13
134
0
Well, if you guys are still here i got a quick question as well..
C++:
DWORD FindPattern(char *module, char *pattern, char *mask) //pass in the module("ac_client.exe") and the pattern + mask.
{
	//Get all module related information
	MODULEINFO mInfo = GetModuleInfo(module); //fill MODULEINFO stucture with important data that we need.

	//Assign our base and module size
	//Having the values right is ESSENTIAL, this makes sure
	//that we don't scan unwanted memory and leading our game to crash
	DWORD base = (DWORD)mInfo.lpBaseOfDll;
	DWORD size =  (DWORD)mInfo.SizeOfImage;

	//Get length for our mask, this will allow us to loop through our array
	DWORD patternLength = (DWORD)strlen(mask); //Get mask from parameter in function call

	for(DWORD i = 0; i < size - patternLength; i++)  
	{
		bool found = true;
		for(DWORD j = 0; j < patternLength; j++)
		{
			//if we have a ? in our mask then we have true by default,
			//or if the bytes match then we keep searching until finding it or not
			found &= mask[j] == '?' || pattern[j] == *(char*)(base + i + j);
		}

		//found = true, our entire pattern was found
		//return the memory addy so we can write to it
		if(found)
		{
			return base + i;
		}
	}

	return NULL;
}
im trying to understand this more in depth.. so does a pattern scanner work by scanning the whole module? can anyone explain to me why for(DWORD i = 0; i < size - patternLength; i++) you minus pattern length from size? cant wrap my brain around it
 

TastyHorror

Coder
Dank Tier Donator
Nobleman
Oct 11, 2012
179
2,268
8
Whole module as far as I can tell. You cut of the pattern length, for the tail, if you do not do the minus pattern length, you may encounter an error/crash.

So what do I mean? You only have lets say 100 BYTES, your looping thru the 100 BYTES, but you also have another LOOP inside which does lets say 10 LOOP.
ex. loop1 0 to 100 { loop2 0 to 10 ( base + loop1.value + loop2.value ) } // would crah
ex2. loop1 0 to 90 { loop2 0 to 10 ( base + loop1.value + loop2.value )} // most likely will not crash

So you do, 100 - 10, something like that anyways. So that when you are at the 90 or something, at the end of the LOOP inside it would reach 100. Does that make sense?

Someone correct me if I am wrong.
 

Nucleus

Newbie
Full Member
Jan 13, 2014
13
134
0
i am also confused about FindPattern(); is that a function we declare or are we using it from another library? im still confused how this for loop scans through memory matching patterns, this is my first time making a dll so i guess dll might be different than exe.
 

Similar threads

Community Mods