Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] How would I make a internal signature scan?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
are
How do I cheat?
Reputation: 0

Joined: 26 Sep 2015
Posts: 3

PostPosted: Sat Oct 10, 2015 10:35 pm    Post subject: [C++] How would I make a internal signature scan? Reply with quote

I'm trying to edit memory internally (C++), aka inject a .dll and scan for the signature, but I don't know where to actually start. Any tips, links, or code to help me out? Thanks, in advance.
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Sun Oct 11, 2015 6:23 am    Post subject: Reply with quote

https://www.youtube.com/watch?v=mKUSLJjlajg
Afaik in the same series there is one that treats dll injection combined with pattern scanning.
I guess it's video 2 or 3.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Oct 11, 2015 12:14 pm    Post subject: Reply with quote

The most common and used method is the old FindPattern from d0m1n1k and Patrick from GameDeception:
Code:

/**
 * @brief Compares a pattern against a given memory pointer.
 *
 * @param lpDataPtr     The live data to compare with.
 * @param lpPattern     The pattern of bytes to compare with.
 * @param pszMask       The mask to compare against.
 *
 * @return True if pattern was found, false otherwise.
 */
bool MaskCompare(const unsigned char* lpDataPtr, const unsigned char* lpPattern, const char* pszMask)
{
    for (; *pszMask; ++pszMask, ++lpDataPtr, ++lpPattern)
    {
        if (*pszMask == 'x' && *lpDataPtr != *lpPattern)
            return false;
    }
    return (*pszMask) == NULL;
}

/**
 * @brief Locates a signature of bytes using the given mask within the given module.
 *
 * @param lpData        The data to scan for the pattern within.
 * @param size          The size of the data to scan within.
 * @param lpPattern     The pattern of bytes to compare with.
 * @param pszMask       The mask to compare against.
 *
 * @return Start address of where the pattern was found, NULL otherwise.
 */
unsigned int FindPattern(const unsigned char* lpData, unsigned int size, const unsigned char* lpPattern, const char* pszMask)
{
    for (size_t x = 0; x < size; x++)
    {
        if (MaskCompare(lpData + x, lpPattern, pszMask))
            return ((unsigned int)lpData + x);
    }
    return 0;
}

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
are
How do I cheat?
Reputation: 0

Joined: 26 Sep 2015
Posts: 3

PostPosted: Mon Oct 12, 2015 8:00 am    Post subject: Reply with quote

How would I implement virtualquery into the FindPattern function?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Oct 12, 2015 12:20 pm    Post subject: Reply with quote

I've already given you one chunk of code, if you are unsure how to continue forward with it, then perhaps you should learn what you are doing. I'm not going to spoon feed you more then that.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Mon Oct 12, 2015 1:13 pm    Post subject: Reply with quote

are wrote:
How would I implement virtualquery into the FindPattern function?


Seriously ? You can't still do this after watching the video ?.

If you're this lazy, just google for signature scanning tutorials or sigscan code c++ and you can probably find code you can leech without understand a word of it.

I don't understand why are people so interested in taking shortcuts these days, i used to enjoy learning new things and learning c++ for the first time was kind of a high, now all the languages seems the same and the novelty isn't there nor the fun. Maybe thats just me and i am not even nerdy to begin with

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites