Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 17:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Video Tutorial] Internal Signature Scanning

Discussion on [Video Tutorial] Internal Signature Scanning within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
Black_and_White's Avatar
 
elite*gold: 650
Join Date: Sep 2013
Posts: 224
Received Thanks: 15
Smile [Video Tutorial] Internal Signature Scanning

Hello everyone

I recently made a video on Internal Signature (aob) scanning. Hope you enjoy.



If you are only interested in the code here u go:

Code:
DWORD GetAddressFromSignature(std::vector<int> signature, DWORD startaddress=0, DWORD endaddress=0) {
	SYSTEM_INFO si;
	GetSystemInfo(&si);
	if (startaddress == 0) {
		startaddress = (DWORD)(si.lpMinimumApplicationAddress);
	}
	if (endaddress == 0) {
		endaddress = (DWORD)(si.lpMaximumApplicationAddress);
	}

	MEMORY_BASIC_INFORMATION mbi{ 0 };
	DWORD protectflags = (PAGE_GUARD | PAGE_NOCACHE | PAGE_NOACCESS);

	for (DWORD i = startaddress; i < endaddress -signature.size(); i++) {
		//std::cout << "scanning: " << std::hex << i << std::endl;
		if (VirtualQuery((LPCVOID)i, &mbi, sizeof(mbi))) {
			if (mbi.Protect & protectflags || !(mbi.State & MEM_COMMIT)) {
				std::cout << "Bad Region! Region Base Address: " << mbi.BaseAddress << " | Region end address: " << std::hex << (int)((DWORD)mbi.BaseAddress + mbi.RegionSize) << std::endl;
				i += mbi.RegionSize;
				continue; // if bad adress then dont read from it
			}
			std::cout << "Good Region! Region Base Address: " << mbi.BaseAddress << " | Region end address: " << std::hex << (int)((DWORD)mbi.BaseAddress + mbi.RegionSize) << std::endl;
			for (DWORD k = (DWORD)mbi.BaseAddress; k < (DWORD)mbi.BaseAddress + mbi.RegionSize - signature.size(); k++) {
				for (DWORD j = 0; j < signature.size(); j++) {
					if (signature.at(j) != -1 && signature.at(j) != *(byte*)(k + j))
						break;
					if (j + 1 == signature.size())
						return k;
				}
			}
			i = (DWORD)mbi.BaseAddress + mbi.RegionSize;
		}
	}
	return NULL;
}
PS: Yes I did sub elitepvpers channel and I will link back to this thread
Black_and_White is offline  
Thanks
4 Users
Old 05/28/2020, 02:23   #2
 
elite*gold: 0
Join Date: Jul 2010
Posts: 1
Received Thanks: 0
you're the best !
Crossfire2000 is offline  
Old 05/28/2020, 19:57   #3
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Quote:
Originally Posted by Black_and_White View Post
Hello everyone

I recently made a video on Internal Signature (aob) scanning. Hope you enjoy.



If you are only interested in the code here u go:

Code:
DWORD GetAddressFromSignature(std::vector<int> signature, DWORD startaddress=0, DWORD endaddress=0) {
	SYSTEM_INFO si;
	GetSystemInfo(&si);
	if (startaddress == 0) {
		startaddress = (DWORD)(si.lpMinimumApplicationAddress);
	}
	if (endaddress == 0) {
		endaddress = (DWORD)(si.lpMaximumApplicationAddress);
	}

	MEMORY_BASIC_INFORMATION mbi{ 0 };
	DWORD protectflags = (PAGE_GUARD | PAGE_NOCACHE | PAGE_NOACCESS);

	for (DWORD i = startaddress; i < endaddress -signature.size(); i++) {
		//std::cout << "scanning: " << std::hex << i << std::endl;
		if (VirtualQuery((LPCVOID)i, &mbi, sizeof(mbi))) {
			if (mbi.Protect & protectflags || !(mbi.State & MEM_COMMIT)) {
				std::cout << "Bad Region! Region Base Address: " << mbi.BaseAddress << " | Region end address: " << std::hex << (int)((DWORD)mbi.BaseAddress + mbi.RegionSize) << std::endl;
				i += mbi.RegionSize;
				continue; // if bad adress then dont read from it
			}
			std::cout << "Good Region! Region Base Address: " << mbi.BaseAddress << " | Region end address: " << std::hex << (int)((DWORD)mbi.BaseAddress + mbi.RegionSize) << std::endl;
			for (DWORD k = (DWORD)mbi.BaseAddress; k < (DWORD)mbi.BaseAddress + mbi.RegionSize - signature.size(); k++) {
				for (DWORD j = 0; j < signature.size(); j++) {
					if (signature.at(j) != -1 && signature.at(j) != *(byte*)(k + j))
						break;
					if (j + 1 == signature.size())
						return k;
				}
			}
			i = (DWORD)mbi.BaseAddress + mbi.RegionSize;
		}
	}
	return NULL;
}
PS: Yes I did sub elitepvpers channel and I will link back to this thread
You can even speed up the process if your pattern can be contained in an ASM register:
For 32bit processors: register size = 4bytes
For 64bit processors: register size = 8bytes

This code is fast for aligned memory, meaning your pattern is aligned between 16bytes (4 bytes aligned for 32 bits processors, 8 bytes aligned for 64bits)

If non aligned memory in pattern, then offset step should be 1, meaning it will be more slow.

Aligned pattern

Aligned 32bits pattern
64bits step size is 8bytes meaning it will skip those bytes, but 32bit will work fine.

Code

The way this code works is supper simple:

You have a pattern lets say: 0x01 ?? 0x03 ?? 0x05 ?? 0x7 0x8
You build a mask for that pattern that replaces ?? for 0x00 and anything else for 0xFF

So mask: 0xFF 0x00 0xFF 0x00 0xFF 0x00 0xFF 0xFF

You go save your first value in a register -> EAX
You perform an and operation to EAX with mask, to filter ?? values
then you apply a xor between eax and your pattern, to check if they are equal. if cero means they are equal, then you have a match. Repeat until end

Edit:
Didn't saw that bump lol my bad
elmarcia is offline  
Reply

Tags
dll injection, signature scan


Similar Threads Similar Threads
[Help]Signature/Pattern Scanning for Co Loader
02/12/2018 - CO2 Programming - 0 Replies
Hello Epvp Member, i'm trying to get Pattern to Edit Co Loader i see many guide to Scan Signature/Pattern But all of Them for Healthing Moving Etc i want to get Pattern Of login IP so my question here i must scan while i login?... and if i must Do that there is Unique Key to search by it like IP or Something else to get right Pattern? sorry i just beginner in that so i want little steps to help me Thanks :handsdown:
RLS: Zoomhack with signature scanning, 1 byte patch. Written in python
01/09/2012 - League of Legends - 0 Replies
from struct import * def bytes_from_file(filename, chunksize=8192): with open(filename, "rb") as f: while True: chunk = f.read(chunksize) if chunk: for b in chunk: yield b else:
pointer scanning tutorial request
04/22/2011 - General Gaming Discussion - 0 Replies
does any1 knw an easy way to scan for pointer(base adress) of for example hp value ingame?



All times are GMT +1. The time now is 17:29.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.