00001 #include <Base.h> 00002 #include <AOutHeader.h> 00003 #include <BinaryFile.h> 00004 00005 void AOutHeader::print() { 00006 PRINT_INFOR("AUXHEADER"); 00007 PRINT_INFOR("\tFlags : %#x",GET(o_mflag)); 00008 PRINT_INFOR("\t#text : %lld (%#llx) in Section %d align %d",GET(o_tsize),GET(o_text_start),GET(o_sntext),GET(o_algntext)); 00009 PRINT_INFOR("\t#data : %lld (%#llx) in Section %d align %d",GET(o_dsize),GET(o_data_start),GET(o_sndata),GET(o_algndata)); 00010 PRINT_INFOR("\t#bss : %lld in Section %d",GET(o_bsize),GET(o_snbss)); 00011 PRINT_INFOR("\tTOC : %#llx in Section %d",GET(o_toc),GET(o_sntoc)); 00012 PRINT_INFOR("\tEntry : %#llx in Section %d",GET(o_entry),GET(o_snentry)); 00013 PRINT_INFOR("\tLoade : in Section %d",GET(o_snloader)); 00014 PRINT_INFOR("\tStack : %#llx",GET(o_maxstack)); 00015 PRINT_INFOR("\tMaxda : %#llx",GET(o_maxdata)); 00016 } 00017 00018 uint32_t AOutHeader32::read(BinaryInputFile* binaryInputFile){ 00019 setFileOffset(binaryInputFile->currentOffset()); 00020 00021 if(!binaryInputFile->copyBytesIterate(&entry,Size__32_bit_Auxilary_Header)){ 00022 PRINT_ERROR("Auxilary header (32) can not be read"); 00023 } 00024 return Size__32_bit_Auxilary_Header; 00025 } 00026 00027 uint32_t AOutHeader64::read(BinaryInputFile* binaryInputFile){ 00028 setFileOffset(binaryInputFile->currentOffset()); 00029 00030 if(!binaryInputFile->copyBytesIterate(&entry,Size__64_bit_Auxilary_Header)){ 00031 PRINT_ERROR("Auxilary header (64) can not be read"); 00032 } 00033 return Size__64_bit_Auxilary_Header; 00034 }