#pattern scan size of image?

20 messages · Page 1 of 1 (latest)

abstract crater
#

I have a question

when i do this

    inline uintptr_t get_pattern(LPCSTR lpModuleName, LPCSTR lpPattern)
    {
        uintptr_t moduleAdress = get_module(lpModuleName);

        if (!moduleAdress)
            return 0;

        static auto patternToByte = [](const char* pattern)
            {
                auto       bytes = std::vector<int>{};
                const auto start = const_cast<char*>(pattern);
                const auto end = const_cast<char*>(pattern) + strlen(pattern);

                for (auto current = start; current < end; ++current)
                {
                    if (*current == '?')
                    {
                        ++current;
                        if (*current == '?')
                            ++current;
                        bytes.push_back(-1);
                    }
                    else { bytes.push_back(strtoul(current, &current, 16)); }
                }
                return bytes;
            };

        const auto dosHeader = (PIMAGE_DOS_HEADER)moduleAdress;
        const auto ntHeaders = (PIMAGE_NT_HEADERS)((std::uint8_t*)moduleAdress + dosHeader->e_lfanew);

        const auto sizeOfImage = ntHeaders->OptionalHeader.SizeOfImage;
        auto       patternBytes = patternToByte(lpPattern);
        const auto scanBytes = reinterpret_cast<std::uint8_t*>(moduleAdress);

        const auto s = patternBytes.size();
        const auto d = patternBytes.data();

        for (auto i = 0ul; i < sizeOfImage - s; ++i)
        {
            bool found = true;
            for (auto j = 0ul; j < s; ++j)
            {
                if (scanBytes[i + j] != d[j] && d[j] != -1)
                {
                    found = false;
                    break;
                }
            }
            if (found) { return reinterpret_cast<uintptr_t>(&scanBytes[i]); }
        }
        return 0;
    }

and i use this to get a pattern my game crash but when i use it without anticheat it will work? and i even tryed to bypass the anticheat pointer thats block the ntHeaders->OptionalHeader.SizeOfImage;

kind token
abstract crater
kind token
#

I also make cheats

abstract crater
kind token
#

Add logs

#

There are some options to debug it

#

Verify before you do stuff

abstract crater
#

O m g that’s not the problem this pattern scan works whiteout the anti cheat but if a add the anti cheat it will not work

kind token
abstract crater
#

To get the memory address instead of a offset

kind token
#

I could take a look tomorrow if u want

#

Or like today it’s 1 am

abstract crater
abstract crater
kind token
#

I Ping u as soon Iam on my pc