Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: multiple changes in macho module #76

Merged
merged 13 commits into from
Jan 31, 2024
Merged

refactor: multiple changes in macho module #76

merged 13 commits into from
Jan 31, 2024

Commits on Jan 31, 2024

  1. refactor: multiple changes in macho module

    This is a large refactoring of the `macho` with the intention of simplifying the existing code and fix some issues. The more important changes are:
    
    * all `swap_xxxxx` functions are removed. Instead of swapping integers after being read from the file, endianness of the file is taken into account while reading individual integers. This is more efficient and easier to maintain.
    
    * some portions of the parsing code is simplified by making use of more advanced features of the `nom` crate.
    
    * the `cmd` and `cmdsize` fields were removed from the some structures. These fields are not very useful, and they don't appear in the original implementation in YARA. The `cmd` field for example, has always the same value (1) in `Segment` structures, because command segments are always defined by the same type of command.
    
    * `rpath` is now a list of string instead of a list of structures.
    
    * magic numbers look exactly as they appear in the original file, if the magic is `CA FE BA BE`, it will translated into a `0xcafebabe` value.
    plusvic committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    9150fc8 View commit details
    Browse the repository at this point in the history
  2. style: fix clippy warnings

    plusvic committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    81ca16f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2d35d94 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b6631c8 View commit details
    Browse the repository at this point in the history
  5. fix: broken test case

    plusvic committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    a225e4e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c4867e9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    936e189 View commit details
    Browse the repository at this point in the history
  8. fix: always read integers using the endianness that corresponds to th…

    …e file
    
    Also fix an issue in `m68k_thread_state` and add more test cases.
    plusvic committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    d74e7db View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    abc234c View commit details
    Browse the repository at this point in the history
  10. tests: fix broken test case

    plusvic committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    032fca4 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    de2d9a9 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3a6045c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    2a2ad8e View commit details
    Browse the repository at this point in the history