Results 1 to 4 of 4
  1. #1
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,222
    Thanks Thanks Given 
    211
    Thanks Thanks Received 
    2,230
    Thanked in
    292 Posts
    Rep Power
    10

    [C++] Signature scanner

    Signature scanner


    Header with functions for searching thru the current application for a certain byte-array (signature).
     /* Syntax                                *
    * *
    * DWORD FindAddress( *
    * BYTE* bMask, *
    * int nLength, *
    * DWORD dwBaseAddress, *
    * DWORD dwLength, *
    * ); *
    * *
    * Parameters *
    * *
    * bMask *
    * Pointer to a BYTE-array holding *
    * the signature to scan for, 0x99 *
    * is wildcard-byte. *
    * *
    * nLength *
    * How many bytes the signature is. *
    * *
    * dwBaseAddress *
    * Address to start searching from. *
    * *
    * dwLength *
    * How many addresses to scan thru. *
    * *
    * *
    * Return *
    * *
    * If successfull, returns the address *
    * that was found. If unsuccessfull, *
    * returns 0. *
    * sigscan.cpp Signature searcher *
    ****************************************/

    //function which checks if current offset is the sig
    bool DataCompare(const BYTE* bData, const BYTE* bMask, int nLength)
    {
    for (int i=0;i<nLength;i++){ //search the whole length
    if((bData[i] != bMask[i]) && (bMask[i] != 0x99)) //if they don't match & the mask is not 0x99
    return false; //they are not equal, return false
    }
    return true; //they are equal, return true
    }

    //function to search for signature
    DWORD FindAddress(BYTE *bMask,int nLength,DWORD dwBaseAddress,DWORD dwLength)
    {
    for(DWORD i=0;i<(dwLength-nLength);i++) //while we're searching
    if( DataCompare( (BYTE*)( dwBaseAddress+i ),bMask,nLength) ) //compare bytes
    return (DWORD)(dwBaseAddress+i); //address found! return it
    return 0; //no address found, return nothing
    }

    Author: Mr. Novocain
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

  2. The Following User Says Thank You to Dwar For This Useful Post:


  3. #2
    ILOVEPIE
    ILOVEPIE is offline
    Guest
    Join Date
    2010 Nov
    Posts
    1
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0

    Re: [C++] Signature scanner

    How do i scan a whole process?

  4. #3
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,222
    Thanks Thanks Given 
    211
    Thanks Thanks Received 
    2,230
    Thanked in
    292 Posts
    Rep Power
    10

    Re: [C++] Signature scanner

    ILOVEPIE
    Whole process, like a Cheat Engine do? You should map process memory and then scan each memory block.
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

  5. The Following User Says Thank You to Dwar For This Useful Post:


  6. #4
    Gwinx
    Gwinx is offline
    Guest
    Join Date
    2011 Jun
    Posts
    2
    Thanks Thanks Given 
    2
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0
    Thanks will be saving this source code as my resource thanks for sharing your great work Dwar, I find your source very useful!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •