Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eliben/pyelftools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: mefistotelis/pyelftools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 13 commits
  • 4 files changed
  • 1 contributor

Commits on Jan 11, 2023

  1. Fixed name of stringtable section

    The section name can be set only after the section itself is parsed.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    b5c6ec6 View commit details
    Browse the repository at this point in the history
  2. Added saving changes to the main header

    Introduced write_changes() function, which is able to write any changes
    to main header back into the ELF file.
    
    The write_changes() function can be further updated to allow storing more
    changes.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    947e9bb View commit details
    Browse the repository at this point in the history
  3. Added saving changes to section header

    With this patch, it is possible to modify data within section headers
    of the ELF file, and store the changes back to the ELF.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    3fc1adc View commit details
    Browse the repository at this point in the history
  4. Added saving changes to section data

    Added set_data() function which allows to replace a section data with
    a new buffer.
    
    This partially implements modification of section data, because it
    lacks higher level logic (like avoiding overlapping of sections).
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    b633fff View commit details
    Browse the repository at this point in the history
  5. Implement writing section data back to file

    Creates function to write section data, and uses it.
    While at it, also adds a function which returns whether
    the data for a section was updated.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    2539f86 View commit details
    Browse the repository at this point in the history
  6. Assume section type SHT_NOBITS has no data

    Adds conditions to make sure NOBITS sections are not using
    write as normal sections. These do not contain any data.
    
    During read (the data() function), this type of section is already
    handled properly.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    773194d View commit details
    Browse the repository at this point in the history
  7. Implement writing segments back to file

    Creates functions for writing segments array back to file
    after the segments have been modified.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    df8b568 View commit details
    Browse the repository at this point in the history
  8. Return copy of update structs

    Return a copy of local update structs instead of direct references.
    This prevents the data from being modified without the parser knowledge.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    0dab07a View commit details
    Browse the repository at this point in the history
  9. Implement replacing a section with completely new data

    This implements replacing a whole section in ELF file with a new one. It can
    correctly recompute offsets of other sections, and update segments.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    b4a32ca View commit details
    Browse the repository at this point in the history
  10. Added merging segments divided during sections update

    This patch improves update_segments_to_sections_mapping() and introduces
    _reorder_segment_headers(), which are able to merge equivalent and touching
    segments.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    a1a5ea5 View commit details
    Browse the repository at this point in the history
  11. Implemented adding new sections

    It is now possible to insert a new section, either by copying and
    changing one of existing sections, or by creating a completely new
    section object. Section name is stored in the names section, but in case
    of renaming the old name is not removed.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    6774361 View commit details
    Browse the repository at this point in the history
  12. Fixed special treating of stringtable section

    The string section is required for many operations, so its
    copy was stored within the object. That additional copy
    was not updated when neccessary, which was causing bugs.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    73589e3 View commit details
    Browse the repository at this point in the history
  13. When inserting a section, place its header correctly

    Inserting a section allowed to set any offset where the
    section header should be placed. That was silly, because
    when inserting a section we provide info about at which
    position to place it.
    
    This change sets the section header offset automatically, placing
    it after previous section provided as parameter.
    
    The offset is just previous section + 1 byte; then linearizing
    function makes sure it is shifted further so that everything fits.
    mefistotelis committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    99091d1 View commit details
    Browse the repository at this point in the history
Loading