library/src/ELF/ELF32/BP-ELFExtraction_mem.cc
// extract a section and return a section list element; all pointers are
// NULL.  Offset describes the distance to the next header.
extract a section and return a section list element; all pointers are
NULL.  Offset describes the distance to the next header.
extract a section and return a section list element ; all pointers are NULL . Offset describes the distance to the next header .
P_ELF_SECTION_HDR_32BIT ELF32_ExtractSectionHeader_Mem(P_ELF_32BIT_LOOKUP_TABLE fullHeader, size_t sOffset,  P_DEBUG_HANDLE dbgHandle, P_MEMORY_MAP memMap){
	if(fullHeader == NULL)
		return NULL;
	if(fullHeader->header == NULL)
		return NULL;
	if(dbgHandle == NULL)
		return NULL;
	if(memMap == NULL)
		return NULL;
	if( (sOffset < (size_t)memMap->lowAddr) ||
		(sOffset > (size_t) memMap->highAddr) ){
		return NULL;
	}
	P_ELF_SECTION_HDR_32BIT header = NULL;
	header = (P_ELF_SECTION_HDR_32BIT) DebugReadMemory(dbgHandle, (void *) sOffset, sizeof(ELF_SECTION_HDR_32BIT));
	if(header == NULL)
		return NULL;
	return header;
}
P_ELF_SECTION_HDR_32BIT ELF32_ExtractSectionHeader_Mem ( P_ELF_32BIT_LOOKUP_TABLE fullHeader , size_t sOffset , P_DEBUG_HANDLE dbgHandle , P_MEMORY_MAP memMap ) { if ( fullHeader == NULL ) return NULL ; if ( fullHeader -> header == NULL ) return NULL ; if ( dbgHandle == NULL ) return NULL ; if ( memMap == NULL ) return NULL ; if ( ( sOffset < ( size_t ) memMap -> lowAddr ) || ( sOffset > ( size_t ) memMap -> highAddr ) ) { return NULL ; } P_ELF_SECTION_HDR_32BIT header = NULL ; header = ( P_ELF_SECTION_HDR_32BIT ) DebugReadMemory ( dbgHandle , ( void * ) sOffset , sizeof ( ELF_SECTION_HDR_32BIT ) ) ; if ( header == NULL ) return NULL ; return header ; }
extract a section and return a section list element; all pointers are
NULL.
extract a section and return a section list element ; all pointers are NULL .
// default checks // Return null // return NULL if we cannot read out of the file //if( fread((void *) header, 1, sizeof(ELF_SECTION_HDR_32BIT), elfFile) == 0) //	return NULL;