[ Root System Explorer ]
Location:
Root
/
lib
/
python3.9
/
site-packages
/
elftools
/
elf
/
__pycache__
+ Folder
+ File
Upload
Editing: elffile.cpython-39.opt-1.pyc
a �#�_�| � @ sb d dl Z d dlZd dlZzd dlZe�� ZW n< eyh zd dlZejZW n eyb dZY n0 Y n0 ddlm Z ddl mZ ddlm Z mZ ddlmZ dd lmZmZmZmZmZmZmZmZmZ dd lmZmZ ddlmZm Z ddl!m"Z"m#Z#m$Z$ dd l%m&Z&m'Z'm(Z( ddl)m*Z*m+Z+m,Z, ddl-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3 G dd� de4�Z5dS )� Ni � )�BytesIO)�ELFError)�struct_parse� elf_assert� )� ELFStructs) �Section�StringTableSection�SymbolTableSection�SymbolTableIndexSection�SUNWSyminfoTableSection�NullSection�NoteSection�StabSection�ARMAttributesSection)�DynamicSection�DynamicSegment)�RelocationSection�RelocationHandler)�GNUVerNeedSection�GNUVerDefSection�GNUVerSymSection)�Segment� InterpSegment�NoteSegment)� DWARFInfo�DebugSectionDescriptor�DwarfConfig)� EHABIInfo)�ELFHashSection�GNUHashSection)�SHN_INDICESc @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� ZdMdd�Zdd� Z dNdd�Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*d+� Zd,d-� Zd.d/� Zd0d1� Zd2d3� Zd4d5� Zd6d7� Zd8d9� Zd:d;� Zd<d=� Z d>d?� Z!d@dA� Z"dBdC� Z#dDdE� Z$dFdG� Z%dHdI� Z&e'dJdK� �Z(dLS )O�ELFFilea= Creation: the constructor accepts a stream (file-like object) with the contents of an ELF file. Accessible attributes: stream: The stream holding the data of the file - must be a binary stream (bytes, not string). elfclass: 32 or 64 - specifies the word size of the target machine little_endian: boolean - specifies the target machine's endianness elftype: string or int, either known value of E_TYPE enum defining ELF type (e.g. executable, dynamic library or core dump) or integral unparsed value header: the complete ELF file header e_ident_raw: the raw e_ident field of the header c C s� || _ | �� t| j| jd�| _| j�� | �� | _| j� | d | d | d d � | j � d� | j �d�| _| � � | _d | _d S )N)� little_endian�elfclass�e_type� e_machineZe_identZEI_OSABIr � )�stream�_identify_filer r$ r% �structsZcreate_basic_structs�_parse_elf_header�headerZcreate_advanced_structs�seek�readZe_ident_raw�_get_section_header_stringtable�_section_header_stringtable�_section_name_map)�selfr) � r4 �8/usr/lib/python3.9/site-packages/elftools/elf/elffile.py�__init__G s$ � ��zELFFile.__init__c C s2 | d dkrdS | d dkr*| � d�d S | d S )z( Number of sections in the file �e_shoffr Ze_shnumZsh_size)�_get_section_header�r3 r4 r4 r5 �num_sections[ s zELFFile.num_sectionsc C s | � |�}| �|�S )z^ Get the section at index #n from the file (Section object or a subclass) )r8 � _make_section)r3 �n�section_headerr4 r4 r5 �get_sectionl s zELFFile.get_sectionc C sV | j du r2i | _ t| �� �D ]\}}|| j |j<