library/src/ELF/ELF32/BP-ELFExtraction_mem.cc
// Extract actual sections from the full headers section list (no types)
Extract actual sections from the full headers section list (no types)
Extract actual sections from the full headers section list ( no types )
int ELF32_ExtractSections_Mem(P_ELF_32BIT_LOOKUP_TABLE fullHeader, P_DEBUG_HANDLE dbgHandle, P_MEMORY_MAP memMap){
	if(fullHeader == NULL)
		return ERR_FAILURE;
	if(fullHeader->sections == NULL)
		return ERR_FAILURE;
	size_t runtimeOffset = 0;
	P_ELF_SECTION_LIST_32BIT firstPtr = fullHeader->sections->first;
	for(fullHeader->sections = fullHeader->sections->first; \
		fullHeader->sections != NULL; \
		fullHeader->sections = fullHeader->sections->next){
			runtimeOffset = (size_t) fullHeader->sections->section->offset + (size_t) memMap->lowAddr;
			fullHeader->sections->data = (unsigned char *) DebugReadMemory(dbgHandle, (void *) runtimeOffset, fullHeader->sections->section->size);
			fullHeader->sections->dataSize = fullHeader->sections->section->size;
	}
	fullHeader->sections = 	firstPtr;
	return ERR_SUCCESS;
}
int ELF32_ExtractSections_Mem ( P_ELF_32BIT_LOOKUP_TABLE fullHeader , P_DEBUG_HANDLE dbgHandle , P_MEMORY_MAP memMap ) { if ( fullHeader == NULL ) return ERR_FAILURE ; if ( fullHeader -> sections == NULL ) return ERR_FAILURE ; size_t runtimeOffset = 0 ; P_ELF_SECTION_LIST_32BIT firstPtr = fullHeader -> sections -> first ; for ( fullHeader -> sections = fullHeader -> sections -> first ; fullHeader -> sections != NULL ; fullHeader -> sections = fullHeader -> sections -> next ) { runtimeOffset = ( size_t ) fullHeader -> sections -> section -> offset + ( size_t ) memMap -> lowAddr ; fullHeader -> sections -> data = ( unsigned char * ) DebugReadMemory ( dbgHandle , ( void * ) runtimeOffset , fullHeader -> sections -> section -> size ) ; fullHeader -> sections -> dataSize = fullHeader -> sections -> section -> size ; } fullHeader -> sections = firstPtr ; return ERR_SUCCESS ; }
Extract actual sections from the full headers section list (no types)
Extract actual sections from the full headers section list ( no types )
// fseek(elfFile, fullHeader->sections->section->offset, SEEK_SET); // fullHeader->sections->section->size // Save Size // Reset pointer