library/src/ELF/ELF32/BP-ELFExtraction.cc
// Prints the ELF32 Header, use ELF32_PrintAll for all headers
Prints the ELF32 Header, use ELF32_PrintAll for all headers
Prints the ELF32 Header use ELF32_PrintAll for all headers
int ELF32_PrintHeader(P_ELF_HDR_32BIT header){
	if(header == NULL)
		return ERR_FAILURE;
	printf("\n[+] ELF Header Information: ");
	printf("\n  [+] Ident Fields:");
	printf("\n\t Magic: %.02x %c %c %c", header->elfMagicString[0], header->elfMagicString[1], header->elfMagicString[2], header->elfMagicString[3]);
	printf("\n\t Class: %u", header->elfClass);
	printf("\n\t Data Encoding:   %.02x", header->elfData);
	printf("\n\t ELF Version:     %.02x", header->elfVersion);
	printf("\n\t ELF OS ABI:      %.02x", header->elfOSAbi);
	printf("\n\t ELF ABI Version: %.02x", header->elfABIVersion);
	printf("\n\t ELF Pad:         %.02x", header->elfPad);
	printf("\n  [+] ELF Header Fields:");
	printf("\n\t ELF Type: %u", header->elfType);
	printf("\n\t ELF Machine Type: %u", header->elfMachine);
	printf("\n\t ELF Version: %u", header->elfVer);
	printf("\n\t ELF Entry Pointer: %p", (void *) header->elfEntry);
	printf("\n\t ELF Program Header Offset: %u", header->elfProgramHeaderOffset);
	printf("\n\t ELF Section Header Offset: %u", header->elfSectionHeaderOffset);
	printf("\n\t ELF Flags: %.08x", header->elfFlags);
	printf("\n\t ELF Header Size: %u", header->elfHeaderSize);
	printf("\n\t ELF Program Header Size: %u", header->elfProgramHeaderSize);
	printf("\n\t Number of entries in program header: %u", header->elfNumberPHeaderEntries);
	printf("\n\t ELF Section Header Size: %u", header->elfSectionHeaderSize);
	printf("\n\t Number of Section Header Entries: %u", header->elfNumberSHeaderEntries);
	printf("\n\t Index of Section Header String Table: %u", header->elfSHeaderStringTableIndex);
	return ERR_SUCCESS;
}
int ELF32_PrintHeader ( P_ELF_HDR_32BIT header ) { if ( header == NULL ) return ERR_FAILURE ; printf ( " \n " ) ; printf ( " \n " ) ; printf ( " \n \t " , header -> elfMagicString [ 0 ] , header -> elfMagicString [ 1 ] , header -> elfMagicString [ 2 ] , header -> elfMagicString [ 3 ] ) ; printf ( " \n \t " , header -> elfClass ) ; printf ( " \n \t " , header -> elfData ) ; printf ( " \n \t " , header -> elfVersion ) ; printf ( " \n \t " , header -> elfOSAbi ) ; printf ( " \n \t " , header -> elfABIVersion ) ; printf ( " \n \t " , header -> elfPad ) ; printf ( " \n " ) ; printf ( " \n \t " , header -> elfType ) ; printf ( " \n \t " , header -> elfMachine ) ; printf ( " \n \t " , header -> elfVer ) ; printf ( " \n \t " , ( void * ) header -> elfEntry ) ; printf ( " \n \t " , header -> elfProgramHeaderOffset ) ; printf ( " \n \t " , header -> elfSectionHeaderOffset ) ; printf ( " \n \t " , header -> elfFlags ) ; printf ( " \n \t " , header -> elfHeaderSize ) ; printf ( " \n \t " , header -> elfProgramHeaderSize ) ; printf ( " \n \t " , header -> elfNumberPHeaderEntries ) ; printf ( " \n \t " , header -> elfSectionHeaderSize ) ; printf ( " \n \t " , header -> elfNumberSHeaderEntries ) ; printf ( " \n \t " , header -> elfSHeaderStringTableIndex ) ; return ERR_SUCCESS ; }
Prints the ELF32 Header, use ELF32_PrintAll for all headers
Prints the ELF32 Header use ELF32_PrintAll for all headers