# Linux

```C++
enum ENUM_ELFCLASS{
    ELFCLASSNONE = 0,
    ELFCLASS32,
    ELFCLASS64
};//数值约束
enum ENUM_DATADIR{
    ELFDATANONE = 0,
    ELFDATALSB,
    ELFDATAMSB
};//数值约束
T16 ELF_Ident{
    T4 name "ELF\0";//字符约束
    T1 elf enum ENUM_ELFCLASS;
    T1 dir enum ENUM_DATADIR;
    ...;
};
T64 Elf64_Ehdr{
    ELF_Ident e_ident;
    T2	e_type;
    T2  e_machine;
    T4  e_version;
    T8  e_entry;
    T8  e_phoff;
    T8  e_shoff;
    T4  e_flags;
    T2  e_ehsize;
    T2  e_phentsize;
    T2  e_phnum;
    T2  e_shentsize;
    T2  e_shnum;
    T2  e_shstrndx;
};
T64 Elf64_Shdr{
    T4  sh_name;
    T4  sh_type;
    T8  sh_flags;
    T8  sh_addr;
    T8  sh_offset;
    T8  sh_size;
    T4  sh_link;
    T4  sh_info;
    T8  sh_addralign;
    T8  sh_entsize;
};
void parse(Archive ar){
    ar >> ELF_Ident ident >> 0;
    ident.elf ENUM_ELFCLASS{
        ELFCLASS32: ar >> Elf32_Ehdr hdr;
        ELFCLASS64: ar >> Elf64_Ehdr hdr;
    }
    ar >> hdr.e_shoff >> Elf64_Shdr[hdr.e_shnum] sh_list;
    {
        section = sh_list >> hdr.e_shstrndx;
        ar >> section.sh_offset >> 
    }
}
```

