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

feat: implement sym_hash() function for mach-o module #248

Merged
merged 6 commits into from
Nov 21, 2024

Conversation

latonis
Copy link
Contributor

@latonis latonis commented Nov 19, 2024

Implement the sym_hash() function for the mach-o module to hash all of the symbol table entries, if the binary has not been stripped. This did not include new parsing, only utiIizing the entries we already parsed

  • tests included

lib/src/modules/macho/mod.rs Outdated Show resolved Hide resolved
lib/src/modules/macho/mod.rs Outdated Show resolved Hide resolved
@plusvic
Copy link
Member

plusvic commented Nov 20, 2024

Clippy says...

error: this `.filter_map` can be written more simply using `.map`
   --> lib/src/modules/macho/mod.rs:467:35
    |
467 |       let symtab_hash_str: String = symtab_to_hash
    |  ___________________________________^
468 | |         .iter()
469 | |         .filter_map(|e| {
470 | |             Some(String::from_utf8(e.to_vec()).unwrap().trim().to_lowercase())
471 | |         })
    | |__________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
    = note: `-D clippy::unnecessary-filter-map` implied by `-D clippy::all`
    = help: to override `-D clippy::all` add `#[allow(clippy::unnecessary_filter_map)]`

@latonis
Copy link
Contributor Author

latonis commented Nov 21, 2024

Addressed the review and comments @plusvic 😸 , thanks for the quick review!

@plusvic plusvic enabled auto-merge (squash) November 21, 2024 08:10
@plusvic plusvic merged commit 260a2c4 into VirusTotal:main Nov 21, 2024
16 checks passed
@latonis latonis deleted the macho-symhash branch November 22, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants