Exemplo n.º 1
0
        public IMemoryBreakpoint SetMemoryBreakpoint(IntPtr address)
        {
            IntPtr pageAddress = GetPageAddress(address);

            if (!_pageGuards.TryGetValue(pageAddress, out var pageGuard))
            {
                pageGuard = new PageGuard(_processHandle, pageAddress);
                _pageGuards[pageAddress] = pageGuard;
            }

            if (!pageGuard.Breakpoints.TryGetValue(address, out var breakpoint))
            {
                breakpoint = new PageGuardBreakpoint(pageGuard, address, true);
                pageGuard.Breakpoints[address] = breakpoint;
            }

            pageGuard.Enabled = true;

            return(breakpoint);
        }
Exemplo n.º 2
0
 internal PageGuardBreakpoint(PageGuard guard, IntPtr address, bool enabled)
 {
     Guard   = guard ?? throw new ArgumentNullException(nameof(guard));
     Address = address;
     Enabled = enabled;
 }