h&Kw=o      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 1Exception that keeps the stack of error locations(c) Aleksey Makarov, 2021BSD 3-Clause Licensealeksey.makarov@gmail.com experimentalportableNone#$Tmelf-Exception that keeps track of error locationsmelfdescription of the errormelflocationmelfstack of locationsmelf String -> m a'. It throws ( with its argument as error description. melf$chainedError' is the same as $  ""melf $addContext! results in a function of type '2addContext :: MonadCatch m => String -> m a -> m a)'. It runs the second argument and adds  with its first argument to the exceptions thrown from that monad.melf $addContext' is the same as $addContext ""melf$maybeAddContext! results in a function of type ';maybeAddContext :: MonadThrow m => String -> Maybe a -> m a'. If its second argument is  , it throws 8 with its first argument, else it returns the value of .melf$maybeAddContext' is the same as $maybeAddContext ""melf$eitherAddContext'! results in a function of type ';eitherAddContext' :: MonadThrow m => Either String a -> m a'. If its argument is  e , it throws  with e5 as error description, else it returns the value of .   None*Newtypes for little- and big-endian values(c) Aleksey Makarov, 2021BSD 3-Clause Licensealeksey.makarov@gmail.com experimentalportable Safe-Inferred>melfLe a is an instance of  such that a is serialized as little-endianmelfBe a is an instance of  such that a is serialized as big-endianNone> #melf9Operating system and ABI for which the object is prepared6melfObject file type>melfTarget architecturemelf Section typemelf Segment typemelfAttributes of the sectionmelfAttributes of the segmentmelf Symbol typemelfSymbol bindingmelf Section indexmelfAARCH64 relocation type#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~*Definitions of constants used in ELF files(c) Aleksey Makarov, 2021BSD 3-Clause Licensealeksey.makarov@gmail.com experimentalportableNonep#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Safe-Inferred5>?,Parse headers and table entries of ELF files(c) Aleksey Makarov, 2021BSD 3-Clause Licensealeksey.makarov@gmail.com experimentalportableNone#$(+/02>?'+melf6ELF class. Tells if ELF defines 32- or 64-bit objectsmelfThe type that helps to make the sigma type of the result of the  functionmelfParsed relocation table entry ( ElfXX_Rela)melfAddress of referencemelfSymbol table indexmelfRelocation typemelfConstant part of expressionmelfParsed ELF symbol table entrymelf Symbol namemelfType and Binding attributesmelfReservedmelfSection table indexmelf Symbol valuemelfSize of objectmelfParsed ELF segment table entrymelfType of segmentmelfSegment attributesmelfOffset in filemelfVirtual address in memorymelfPhysical addressmelfSize of segment in filemelfSize of segment in memorymelfAlignment of segmentmelfParsed ELF section table entrymelf Section namemelf Section typemelfSection attributesmelfVirtual address in memorymelfOffset in filemelfSize of sectionmelfLink to other sectionmelfMiscellaneous informationmelfAddress alignment boundarymelf%Size of entries, if section has tablemelfSigma type where  defines the type of melfParsed ELF headermelf%Data encoding (big- or little-endian)melfOS/ABI identificationmelf ABI versionmelfObject file typemelf Machine typemelfEntry point addressmelfProgram header offsetmelfSection header offsetmelfProcessor-specific flagsmelfSize of program header entrymelf Number of program header entriesmelfSize of section header entrymelf Number of section header entriesmelfSection name string table indexmelf IsElfClass a$ is defined for each constructor of . It defines WordXX a , which is  for  and  for .melf2ELF data. Specifies the endianness of the ELF datamelfLittle-endian ELF formatmelfBig-endian ELF formatmelf!The first 4 bytes of the ELF filemelfSize of ELF header.melfSize of section table entry.melfSize of segment table entry.melfSize of symbol table entry.melfSize of WordXX a in bytes.melfConvenience function for creating a context with an implicit ElfClass available.melfTest if the section with such integer value of section type field () contains symbol tablemelfSize of RelaXX a in bytes.melfParse an arraymelfSerialize an arraymelfParse ELF file and produce header and section and segment tablesmelf7Tells if parser should expect big or little endian datamelfData for parsingmelfTells if serializer should tread the data as bit or little endianmelfThe array to serialize  Safe-Inferred( None#$(+/02>?65melf;Parsed ELF symbol table entry. NB: This is work in progressmelf*Symbol name (NB: String, not string index)melfSymbol binding attributesmelf Symbol TypemelfSection table indexmelf Symbol valuemelfSize of objectmelf,The type of node that defines Elf structure.melfSome ELF files (some executables) don't bother to define sections for linking and have just raw data in segments.melfAlign the next data in the ELF file. The offset of the next data in the ELF file will be the minimal x such that &x mod eaAlign == eaOffset mod eaAlign melf%Data encoding (big- or little-endian)melfOS/ABI identificationmelf ABI versionmelfObject file typemelf Machine typemelfEntry point addressmelfProcessor-specific flagsmelf9Section name (NB: string, not offset in the string table)melf Section typemelfSection attributesmelfVirtual address in memorymelfAddress alignment boundarymelf%Size of entries, if section has tablemelfSection numbermelfMiscellaneous informationmelfLink to other sectionmelfThe content of the sectionmelfType of segmentmelfSegment attributesmelfVirtual address in memorymelfPhysical addressmelfAdd this amount of memory after the section when the section is loaded to memory by execution system. Or, in other words this is how much  is bigger than melfAlignment of segmentmelfContent of the segmentmelfRaw data in ELF filemelf Align valuemelf Align modulemelfSection data may contain a string table. If a section contains a string table with section names, the data for such a section is generated and  should contain melfRegular section datamelf1Section data will be generated from section namesmelfElf is a sigma type where  defines the type of melf is a forrest of trees of type . Trees are composed of  nodes,  can contain subtreesmelfRBuilder is an intermediate internal data type that is used by parser. It contains information about layout of the ELF file that can be used by  melf Find section with a given numbermelfFind section with a given namemelfFind ELF headermelfGet string from string tablemelfGet section datamelfParse ELF file and produce []melfParse ELF filemelfSerialze ELF filemelfParse symbol tablemelfSerialize symbol tablemelfStructured ELF datamelfNumber of the sectionmelfThe section in questionmelfStructured ELF datamelf Section namemelfThe section in questionmelfStructured ELF datamelf ELF headermelf&Section data of a string table sectionmelf.Offset to the start of the string in that datamelfELF filemelfParsed section entrymelf Section Datamelf ELF headermelf Section tablemelf Segment tablemelfELF filemelfEndianness of the ELF filemelfParsed section such that  .  is true.melfStructured ELF datamelf Symbol tablemelfEndianness of the ELF filemelf Symbol tablemelf?Pair of symbol table section data and string table section data9 .Parse/serialize ELF files into structured data(c) Aleksey Makarov, 2021BSD 3-Clause Licensealeksey.makarov@gmail.com experimentalportableNone8-::+Pretty printing the data parsed by Data.Elf(c) Aleksey Makarov, 2021BSD 3-Clause Licensealeksey.makarov@gmail.com experimentalportableNone #$+/?=C melfSplits an integer into list of integers such that its sum equals to the argument, and each element of the list is of the form (1 << x) for some x.  splitBits 5 produces [ 1, 4 ]melf,Print ELF header. It's used in golden testsmelfPrint parsed header, section table and segment table. It's used in golden testsmelf(Print ELF layout. First parse ELF with 1, then use this function to format the layout.melfSame as  FalsemelfPrint ELF. If first argument is False, don't dump all the data, print just the first two and the last lines.melf.Print string table. It's used in golden testsmelf1Read the file strictly but return lazy bytestringmelfRead ELF from one file,  it into another.melfRead ELF from one file,  it into another.    !!"##$%&'()*+,--./0123456789:;<=>??@ABCDEFFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(%)&*'                                                                                                                                       melf-1.0.2-inplaceData.Elf.Headers"Control.Exception.ChainedException Data.EndianData.Elf.ConstantsData.ElfData.Elf.PrettyPrintData.Elf.Constants.THData.Elf.Constants.Data Data.BList Data.IntervalData.Internal.Elf printLayoutElfClass ELFCLASS32 ELFCLASS64ChainedExceptionerrlocstackChainedExceptionNextNullNext NextChained chainedError chainedError' addContext addContext'maybeAddContextmaybeAddContext'eitherAddContext'$fExceptionChainedException$fShowChainedExceptionLefromLeBefromBe $fBinaryBe $fBinaryBe0 $fBinaryBe1 $fBinaryLe $fBinaryLe0 $fBinaryLe1$fEqLe$fEqBeElfOSABI ELFOSABI_EXTELFOSABI_STANDALONE ELFOSABI_ARM ELFOSABI_AROS ELFOSABI_NSKELFOSABI_OPENVMSELFOSABI_OPENBSDELFOSABI_MODESTOELFOSABI_TRU64ELFOSABI_FREEBSD ELFOSABI_IRIX ELFOSABI_AIXELFOSABI_SOLARISELFOSABI_LINUXELFOSABI_NETBSD ELFOSABI_HPUX ELFOSABI_SYSVElfTypeET_EXTET_COREET_DYNET_EXECET_RELET_NONE ElfMachineEM_EXT EM_AARCH64 EM_UNICOREEM_ARCAEM_SEP EM_SE_C33 EM_BLACKFIN EM_MSP430 EM_F2MC16EM_CREM_MAXEM_IP2KEM_ST200EM_SNP1KEM_TPCEM_NS32K EM_TMM_GPP EM_VIDEOCORE EM_XTENSA EM_ARC_A5 EM_OPENRISCEM_PJ EM_MN10200 EM_MN10300EM_M32REM_V850EM_D30VEM_D10VEM_FR30EM_AVREM_PRISMEM_HUANYEM_MMIXEM_ZSP EM_FIREPATH EM_JAVELINEM_CRISEM_VAXEM_ST19EM_SVX EM_68HC05 EM_68HC08 EM_68HC11 EM_68HC16EM_ST7 EM_ST9PLUSEM_FX66EM_PDSP EM_X86_64EM_TINYJEM_ST100EM_ME16 EM_STARCOREEM_NDR1EM_NCPUEM_PCPEM_MMA EM_68HC12 EM_COLDFIRE EM_MIPS_XEM_IA_64 EM_H8_500EM_H8S EM_H8_300H EM_H8_300EM_ARC EM_TRICORE EM_SPARCV9EM_SHEM_ALPHAEM_ARMEM_RCEEM_RH32EM_FR20EM_V800EM_SPUEM_S390EM_PPC64EM_PPCEM_960EM_SPARC32PLUS EM_VPP500 EM_PARISC EM_SPARC64EM_MIPS_RS3_LEEM_S370EM_MIPSEM_860EM_486EM_88KEM_68KEM_386EM_SPARCEM_M32EM_NONEElfSectionTypeSHT_EXT SHT_DYNSYM SHT_SHLIBSHT_REL SHT_NOBITSSHT_NOTE SHT_DYNAMICSHT_HASHSHT_RELA SHT_STRTAB SHT_SYMTAB SHT_PROGBITSSHT_NULLElfSegmentTypePT_EXTPT_PHDRPT_SHLIBPT_NOTE PT_INTERP PT_DYNAMICPT_LOADPT_NULLElfSectionFlagSHF_EXT SHF_EXECINSTR SHF_ALLOC SHF_WRITEElfSegmentFlagPF_EXTPF_RPF_WPF_X ElfSymbolTypeSTT_EXT STT_HiProc STT_LoProcSTT_HiOSSTT_LoOSSTT_TLS STT_CommonSTT_File STT_SectionSTT_Func STT_Object STT_NoTypeElfSymbolBindingSTB_EXT STB_HiProc STB_LoProcSTB_HiOSSTB_LoOSSTB_Weak STB_Global STB_LocalElfSectionIndexSHN_EXT SHN_CommonSHN_AbsSHN_HiOSSHN_LoOS SHN_HiProc SHN_LoProc SHN_UndefElfRelocationType_AARCH64 R_AARCH64_EXTR_AARCH64_IRELATIVER_AARCH64_TLSDESCR_AARCH64_TLS_TPRELR_AARCH64_TLS_DTPRELR_AARCH64_TLS_DTPMODR_AARCH64_RELATIVER_AARCH64_JUMP_SLOTR_AARCH64_GLOB_DATR_AARCH64_COPYR_AARCH64_TLSDESC_CALLR_AARCH64_TLSDESC_ADDR_AARCH64_TLSDESC_LDRR_AARCH64_TLSDESC_OFF_G0_NCR_AARCH64_TLSDESC_OFF_G1R_AARCH64_TLSDESC_ADD_LO12R_AARCH64_TLSDESC_LD64_LO12R_AARCH64_TLSDESC_ADR_PAGE21R_AARCH64_TLSDESC_ADR_PREL21R_AARCH64_TLSDESC_LD_PREL19%R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC"R_AARCH64_TLSLE_LDST128_TPREL_LO12$R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC!R_AARCH64_TLSLE_LDST64_TPREL_LO12$R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC!R_AARCH64_TLSLE_LDST32_TPREL_LO12$R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC!R_AARCH64_TLSLE_LDST16_TPREL_LO12#R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC R_AARCH64_TLSLE_LDST8_TPREL_LO12!R_AARCH64_TLSLE_ADD_TPREL_LO12_NCR_AARCH64_TLSLE_ADD_TPREL_LO12R_AARCH64_TLSLE_ADD_TPREL_HI12 R_AARCH64_TLSLE_MOVW_TPREL_G0_NCR_AARCH64_TLSLE_MOVW_TPREL_G0 R_AARCH64_TLSLE_MOVW_TPREL_G1_NCR_AARCH64_TLSLE_MOVW_TPREL_G1R_AARCH64_TLSLE_MOVW_TPREL_G2"R_AARCH64_TLSIE_LD_GOTTPREL_PREL19%R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC#R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21#R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC R_AARCH64_TLSIE_MOVW_GOTTPREL_G1&R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC#R_AARCH64_TLSLD_LDST128_DTPREL_LO12%R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC"R_AARCH64_TLSLD_LDST64_DTPREL_LO12%R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC"R_AARCH64_TLSLD_LDST32_DTPREL_LO12%R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC"R_AARCH64_TLSLD_LDST16_DTPREL_LO12$R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC!R_AARCH64_TLSLD_LDST8_DTPREL_LO12"R_AARCH64_TLSLD_ADD_DTPREL_LO12_NCR_AARCH64_TLSLD_ADD_DTPREL_LO12R_AARCH64_TLSLD_ADD_DTPREL_HI12!R_AARCH64_TLSLD_MOVW_DTPREL_G0_NCR_AARCH64_TLSLD_MOVW_DTPREL_G0!R_AARCH64_TLSLD_MOVW_DTPREL_G1_NCR_AARCH64_TLSLD_MOVW_DTPREL_G1R_AARCH64_TLSLD_MOVW_DTPREL_G2R_AARCH64_TLSLD_LD_PREL19R_AARCH64_TLSLD_MOVW_G0_NCR_AARCH64_TLSLD_MOVW_G1R_AARCH64_TLSLD_ADD_LO12_NCR_AARCH64_TLSLD_ADR_PAGE21R_AARCH64_TLSLD_ADR_PREL21R_AARCH64_LD64_GOTPAGE_LO15R_AARCH64_LD64_GOT_LO12_NCR_AARCH64_ADR_GOT_PAGER_AARCH64_LD64_GOTOFF_LO15R_AARCH64_GOT_LD_PREL19R_AARCH64_GOTREL32R_AARCH64_GOTREL64R_AARCH64_MOVW_GOTOFF_G3R_AARCH64_MOVW_GOTOFF_G2_NCR_AARCH64_MOVW_GOTOFF_G2R_AARCH64_MOVW_GOTOFF_G1_NCR_AARCH64_MOVW_GOTOFF_G1R_AARCH64_MOVW_GOTOFF_G0_NCR_AARCH64_MOVW_GOTOFF_G0R_AARCH64_MOVW_PREL_G3R_AARCH64_MOVW_PREL_G2_NCR_AARCH64_MOVW_PREL_G2R_AARCH64_MOVW_PREL_G1_NCR_AARCH64_MOVW_PREL_G1R_AARCH64_MOVW_PREL_G0_NCR_AARCH64_MOVW_PREL_G0R_AARCH64_CALL26R_AARCH64_JUMP26R_AARCH64_CONDBR19R_AARCH64_TSTBR14R_AARCH64_LDST128_ABS_LO12_NCR_AARCH64_LDST64_ABS_LO12_NCR_AARCH64_LDST32_ABS_LO12_NCR_AARCH64_LDST16_ABS_LO12_NCR_AARCH64_LDST8_ABS_LO12_NCR_AARCH64_ADD_ABS_LO12_NCR_AARCH64_ADR_PREL_PG_HI21_NCR_AARCH64_ADR_PREL_PG_HI21R_AARCH64_ADR_PREL_LO21R_AARCH64_LD_PREL_LO19R_AARCH64_MOVW_SABS_G2R_AARCH64_MOVW_SABS_G1R_AARCH64_MOVW_SABS_G0R_AARCH64_MOVW_UABS_G3R_AARCH64_MOVW_UABS_G2_NCR_AARCH64_MOVW_UABS_G2R_AARCH64_MOVW_UABS_G1_NCR_AARCH64_MOVW_UABS_G1R_AARCH64_MOVW_UABS_G0_NCR_AARCH64_MOVW_UABS_G0R_AARCH64_PLT32R_AARCH64_PREL16R_AARCH64_PREL32R_AARCH64_PREL64R_AARCH64_ABS16R_AARCH64_ABS32R_AARCH64_ABS64R_AARCH64_NONE_R_AARCH64_NONE HeadersXXRelaXX relaOffsetrelaSymrelaType relaAddendSymbolXXstNamestInfostOtherstShNdxstValuestSize SegmentXXpTypepFlagspOffset pVirtAddr pPhysAddr pFileSizepMemSizepAlign SectionXXsNamesTypesFlagssAddrsOffsetsSizesLinksInfo sAddrAlignsEntSizeHeaderHeaderXXhDatahOSABI hABIVersionhTypehMachinehEntryhPhOffhShOffhFlags hPhEntSizehPhNum hShEntSizehShNum hShStrNdx IsElfClassWordXXElfData ELFDATA2LSB ELFDATA2MSB SElfClass SELFCLASS32 SELFCLASS64elfMagic headerSizesectionTableEntrySizesegmentTableEntrySizesymbolTableEntrySizewordSize withElfClasssectionIsSymbolTablerelocationTableAEntrySize parseBListserializeBList parseHeaders$fBinaryElfClass;$fSuppressUnusedWarnings->ShowsPrec_6989586621679262740Sym2;$fSuppressUnusedWarnings->ShowsPrec_6989586621679262740Sym1$fPShowElfClass;$fSuppressUnusedWarnings->ShowsPrec_6989586621679262740Sym0 $fPEqElfClass$fSingIElfClassELFCLASS64$fSingIElfClassELFCLASS32$fShowSElfClass$fTestCoercionElfClassSElfClass$fTestEqualityElfClassSElfClass$fSDecideElfClass $fSEqElfClass$fSShowElfClass$fSingKindElfClass$fBinaryElfData$fIsElfClassELFCLASS64$fIsElfClassELFCLASS32 $fBinarySigma $fBinaryLe2 $fBinaryBe2 $fEqElfData $fShowElfData $fEqElfClass$fShowElfClass ElfSymbolXXsteNamesteBindsteTypesteShNdxsteValuesteSizeElfXX ElfHeaderElfSectionTableElfSegmentTable ElfSection ElfSegment ElfRawData ElfRawAlignehDataehOSABI ehABIVersionehType ehMachineehEntryehFlagsesNameesTypeesFlagsesAddr esAddrAlign esEntSizeesNesInfoesLinkesDataepTypeepFlags epVirtAddr epPhysAddr epAddMemSizeepAlignepDataedDataeaOffseteaAlignElfSectionDataElfSectionDataStringTableElfElfListelfFindSectionelfFindSectionByName elfFindHeader getStringgetSectionDataparseElf serializeElfparseSymbolTableserializeSymbolTable splitBits printHeader printHeadersprintElf printElf_printStringTable readFileLazy writeElfDumpwriteElfLayoutbaseGHC.Exception.Type SomeException GHC.MaybeNothingJust Data.EitherLeftRightBaseWord BaseWord8 BaseWord16 BaseWord32 BaseWord64mkDeclarationsbinary-0.8.8.0Data.Binary.ClassBinaryBList fromBListGHC.WordWord32Word64IntervalIsizeoffsetemptymembercontainsRBuilder parseRBuilder WBuilderStatewbsNameIndexes wbsShStrNdxwbsShOffwbsPhOff wbsOffsetwbsDataReversedwbsSegmentsReversed wbsSections WBuilderDataWBuilderDataSegmentTableWBuilderDataSectionTableWBuilderDataByteStreamWBuilderDataHeaderwbdDataLZipRBuilderRawAlignRBuilderRawDataRBuilderSegmentRBuilderSectionRBuilderSegmentTableRBuilderSectionTableRBuilderHeader rbraAlign rbraOffset rbrdIntervalrbpDatarbpN rbpHeaderrbsNamerbsN rbsHeader rbptHeader rbstHeader rbhHeaderheaderIntervalsectionTableIntervalsegmentTableIntervalsectionIntervalsegmentIntervalrBuilderInterval findInterval showRBuilder' showRBuilderintersectMessage addRBuilders foldMapElffoldMapElfListcuttail' nextOffset addRawData!!? parseElf' wbStateInit zeroSection neighbours mkStringTable serializeElf'getStringFromDatamkElfSymbolTableEntrymkSymbolTableEntry