Example #1
0
        public bool ResolvePointerPath(HookProcess process)
        {
            IntPtr nextAddress = baseAddress;
            bool   asmStart    = false;

            foreach (var offset in PointerPath)
            {
                try {
                    baseAddress = new IntPtr(nextAddress.ToInt64() + offset);
                    if (baseAddress == IntPtr.Zero)
                    {
                        return(false);
                    }

                    if (!asmStart)
                    {
                        nextAddress = baseAddress + process.GetInt32(new IntPtr(baseAddress.ToInt64())) + 4;
                        asmStart    = true;
                    }
                    else
                    {
                        nextAddress = process.ReadPointer(baseAddress);
                    }
                } catch {
                    return(false);
                }
            }
            return(true);
        }