chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


[C++] [Release/Source] My Signature/AOB Scanner filter_list
Author
Message
[C++] [Release/Source] My Signature/AOB Scanner #1
SigScanner.cpp:

Code:
#include "SigScanner.h"

int sigScan::scanNoAlign(char *toFind, int bCount, int reachSize, int start, int end, int align)
{
    MEMORY_BASIC_INFORMATION mbi;

    int mbiSize = sizeof(mbi);
    char* reach = (char*)new char[reachSize];

    for (char *i = (char*)start;;)
    {
        VirtualQueryEx((HANDLE)-1, i, &mbi, mbiSize);

        if ((mbi.AllocationProtect & 238) && !(mbi.Protect & 257) && (mbi.State & 4096))
        {
            char* end = (char*)mbi.BaseAddress + mbi.RegionSize;

            for (char* x = (char*)mbi.BaseAddress; x < end;)
            {
                SIZE_T size;

                ReadProcessMemory((HANDLE)-1, x, reach, reachSize, &size);

                for (int ii = 0; ii < size; ii += align)
                {
                    if (*(int*)(reach + ii) == *(int*)toFind)
                    {
                        if (bCount == 4)
                        {
                            return (int)x + ii;
                        }

                        bool isMatch = true;

                        for (int b = 4; b < bCount; b++)
                        {
                            if (*(unsigned char*)(reach + ii + b) != *(unsigned char*)(toFind + b))
                            {
                                isMatch = false;
                            }
                        }

                        if (isMatch)
                        {
                            return (int)x + ii;
                        }
                    }
                }

                x += size;
            }
        }

        int oldI = (int)i;

        i += mbi.RegionSize;

        if (((int)i > end - mbi.RegionSize) || (oldI > (int)i))
        {
            break;
        }
    }

    return -1;
}

#define WRITABLE (PAGE_READWRITE | PAGE_WRITECOPY |PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY)

int sigScan::scanNoAlignW(char *toFind, int bCount, int reachSize, int start, int end, int align)
{
      MEMORY_BASIC_INFORMATION mbi;

    int mbiSize = sizeof(mbi);
    char* reach = (char*)new char[reachSize];

    for (char *i = (char*)start;;)
    {
        VirtualQueryEx((HANDLE)-1, i, &mbi, mbiSize);

        if ((mbi.AllocationProtect & 238) && !(mbi.Protect & 257) && (mbi.State & 4096))
        {
            char* end = (char*)mbi.BaseAddress + mbi.RegionSize;

            for (char* x = (char*)mbi.BaseAddress; x < end;)
            {
                SIZE_T size;

                ReadProcessMemory((HANDLE)-1, x, reach, reachSize, &size);

                for (int ii = 0; ii < size; ii += align)
                {
                    if (*(int*)(reach + ii) == *(int*)toFind)
                    {
                        if (bCount == 4)
                        {
                            return (int)x + ii;
                        }

                        bool isMatch = true;

                        for (int b = 4; b < bCount; b++)
                        {
                            if (*(unsigned char*)(reach + ii + b) != *(unsigned char*)(toFind + b))
                            {
                                isMatch = false;
                            }
                        }

                        if (isMatch)
                        {
                            return (int)x + ii;
                        }
                    }
                }

                x += size;
            }
        }

        int oldI = (int)i;

        i += mbi.RegionSize;

        if (((int)i > end - mbi.RegionSize) || (oldI > (int)i))
        {
            break;
        }
    }

    return -1;
}



SigScanner.h:

Code:
#include <windows.h>
#include <stdio.h>

class sigScan
{
    public:
        int scanNoAlign(char *toFind, int bCount, int reachSize = 1024, int start = 0, int end = 0x50000000, int align = 1);
        int scanNoAlignW(char* toFind, int bCount, int reachSize = 1024, int start = 0, int end = 0x50000000, int align = 1);
};
(This post was last modified: 05-08-2019, 09:59 PM by IcyJake.)

Reply

RE: [C++] [Release/Source] My Signature/AOB Scanner #2
havent done any game hacking since d2 lol

Reply

RE: [C++] [Release/Source] My Signature/AOB Scanner #3
(05-08-2019, 10:11 PM)sunjester Wrote: havent done any game hacking since d2 lol

What's D2? Also, you should get back into the scene. It's hella fun these days.

Reply

RE: [C++] [Release/Source] My Signature/AOB Scanner #4
(05-08-2019, 10:25 PM)IcyJake Wrote:
(05-08-2019, 10:11 PM)sunjester Wrote: havent done any game hacking since d2 lol

What's D2? Also, you should get back into the scene. It's hella fun these days.

diablo 2

Reply






Users browsing this thread: 1 Guest(s)