library/src/memory/BP-LinuxMemMapping.cc
// Returns ERR_SUCCESS if an address correlates to valid
// process memory space, ERR_FAILURE on non-valid pointer
Returns ERR_SUCCESS if an address correlates to valid
process memory space, ERR_FAILURE on non-valid pointer
Returns ERR_SUCCESS if an address correlates to valid process memory space ERR_FAILURE on non - valid pointer
int IsPointerValidForProcess(P_DEBUG_HANDLE dbgHandle, void *procAddr)
{
	if(dbgHandle == NULL)
		return ERR_FAILURE;
	if(dbgHandle->memory == NULL)
		return ERR_FAILURE;
	P_MEMORY_MAP first = dbgHandle->memory->first;
	for(dbgHandle->memory = dbgHandle->memory->first;
		dbgHandle->memory != NULL;
		dbgHandle->memory = dbgHandle->memory->next){
		if(procAddr <= dbgHandle->memory->highAddr)
		if(procAddr >= dbgHandle->memory->lowAddr){
			dbgHandle->memory = first;
			return ERR_SUCCESS;
		}
	}
	dbgHandle->memory = first;
	return ERR_FAILURE;
}
int IsPointerValidForProcess ( P_DEBUG_HANDLE dbgHandle , void * procAddr ) { if ( dbgHandle == NULL ) return ERR_FAILURE ; if ( dbgHandle -> memory == NULL ) return ERR_FAILURE ; P_MEMORY_MAP first = dbgHandle -> memory -> first ; for ( dbgHandle -> memory = dbgHandle -> memory -> first ; dbgHandle -> memory != NULL ; dbgHandle -> memory = dbgHandle -> memory -> next ) { if ( procAddr <= dbgHandle -> memory -> highAddr ) if ( procAddr >= dbgHandle -> memory -> lowAddr ) { dbgHandle -> memory = first ; return ERR_SUCCESS ; } } dbgHandle -> memory = first ; return ERR_FAILURE ; }
Returns ERR_SUCCESS if an address correlates to valid
process memory space, ERR_FAILURE on non-valid pointer
Returns ERR_SUCCESS if an address correlates to valid process memory space ERR_FAILURE on non - valid pointer