Exemplo n.º 1
0
        private bool Scan(out byte *Address, byte?[] Pattern)
        {
            var Info = ModuleInfo.GetCodeInfo((byte *)Config.Default.GameBaseAddress);

            Address = null;
            long CodeAdd = (long)Info.CodeAddress;
            long CodeLen = Info.CodeSize - Pattern.Length;

            for (int i = 0; i < CodeLen; i++)
            {
                byte *pBuffer = (byte *)(Info.CodeAddress) + i;
                if (!CheckPattern(pBuffer, Pattern))
                {
                    continue;
                }
                Log.Debug($"CMVS Pattern Found At: 0x{(ulong)pBuffer:X16}");
                for (long x = (long)pBuffer; x > CodeAdd; x--)
                {
                    byte *pFunc = (byte *)x;
                    if (!CheckPattern(pFunc, Pattern))
                    {
                        continue;
                    }
                    Address = pFunc;
                    return(true);
                }
            }
            return(false);
        }