library/src/blockclass/BP-BlockClass.cc
// gets the memory map associated with a pointer in a running process
gets the memory map associated with a pointer in a running process
gets the memory map associated with a pointer in a running process
P_MEMORY_MAP Block::DbgPointerToMemMap(size_t checkPtr)
{
	if (!dbgHandle)
		return (P_MEMORY_MAP) NULL;
	if (!dbgHandle->memory)
		return (P_MEMORY_MAP) NULL;
	if (!dbgHandle->memory->first)
		return (P_MEMORY_MAP) NULL;
	if (checkPtr == 0)
		return (P_MEMORY_MAP) NULL;
	P_MEMORY_MAP memory = dbgHandle->memory;
	for
	(
		memory = memory->first;
		memory != NULL;
		memory = memory->next)
	{
		if ((size_t ) checkPtr <= (size_t ) memory->highAddr && checkPtr >= (size_t ) memory->lowAddr)
		{
			return (P_MEMORY_MAP) memory;
		}
	}
	return (P_MEMORY_MAP) NULL;
}
P_MEMORY_MAP Block :: DbgPointerToMemMap ( size_t checkPtr ) { if ( ! dbgHandle ) return ( P_MEMORY_MAP ) NULL ; if ( ! dbgHandle -> memory ) return ( P_MEMORY_MAP ) NULL ; if ( ! dbgHandle -> memory -> first ) return ( P_MEMORY_MAP ) NULL ; if ( checkPtr == 0 ) return ( P_MEMORY_MAP ) NULL ; P_MEMORY_MAP memory = dbgHandle -> memory ; for ( memory = memory -> first ; memory != NULL ; memory = memory -> next ) { if ( ( size_t ) checkPtr <= ( size_t ) memory -> highAddr && checkPtr >= ( size_t ) memory -> lowAddr ) { return ( P_MEMORY_MAP ) memory ; } } return ( P_MEMORY_MAP ) NULL ; }
gets the memory map associated with a pointer in a running process
gets the memory map associated with a pointer in a running process
// default range check // return if we found a suitable result // return null ptr on failure