[ Root System Explorer ]
Location:
Root
/
lib
/
python3.9
/
site-packages
/
elftools
/
elf
/
__pycache__
+ Folder
+ File
Upload
Editing: hash.cpython-39.opt-1.pyc
a �#�_B � @ sh d dl Z ddlmZ ddlmZ G dd� de�ZG dd � d ee�ZG d d� de�ZG dd � d ee�Z dS )� N� )�struct_parse� )�Sectionc @ s4 e Zd ZdZdd� Zdd� Zdd� Zedd � �Zd S )�ELFHashTablea� Representation of an ELF hash table to find symbols in the symbol table - useful for super-stripped binaries without section headers where only the start of the symbol table is known from the dynamic segment. The layout and contents are nicely described at https://flapenguin.me/2017/04/24/elf-lookup-dt-hash/. The symboltable argument needs to implement a get_symbol() method - in a regular ELF file, this will be the linked symbol table section as indicated by the sh_link attribute. For super-stripped binaries, one should use the DynamicSegment object as the symboltable as it supports symbol lookup without access to a symbol table section. c C s( || _ || _t| j jj| j j|�| _d S )N)�elffile�_symboltabler �structsZElf_Hash�stream�params��selfr Zstart_offset�symboltable� r �5/usr/lib/python3.9/site-packages/elftools/elf/hash.py�__init__ s �zELFHashTable.__init__c C s | j d S )zC Get the number of symbols from the hash table parameters. Znchains)r )r r r r �get_number_of_symbols% s z"ELFHashTable.get_number_of_symbolsc C sj | j d dkrdS | �|�| j d }| j d | }|dkrf| j�|�}|j|krV|S | j d | }q4dS )�D Look up a symbol from this hash table with the given name. �nbucketsr N�bucketsZchains)r �elf_hashr � get_symbol�name)r r ZhvalZsymndxZsymr r r r * s zELFHashTable.get_symbolc C s` t | t�s| �d�} d}d}t| �D ]6}|d>