Exemplo n.º 1
0
        private IntPtr GetPointer(Process program, string asmName)
        {
            ulong rva = Decompiler.GetRVA(FullName);

            if (rva == 0)
            {
                return(IntPtr.Zero);
            }

            if (string.IsNullOrEmpty(asmName))
            {
                BasePtr = program.MainModule.BaseAddress + (int)rva + Offset;
            }
            else
            {
                Tuple <IntPtr, IntPtr> range = ProgramPointer.GetAddressRange(program, asmName);
                BasePtr = range.Item1 + (int)rva + Offset;
            }

            int offset = 0;

            if (AutoDeref != AutoDeref.None)
            {
                offset = program.Read <int>(BasePtr) + 4;
            }
            return(BasePtr + offset);
        }