Skip to content

Phase 3: Multi-Format Resource Extraction - PE Dialogs, Mach-O Plists, ELF Build Metadata #71

Description

@unclesp1d3r

Overview

This issue tracks Phase 3 of resource extraction capabilities in StringyMcStringFace, expanding beyond the current PE VERSIONINFO/STRINGTABLE/MANIFEST support to cover additional resource types across all three binary formats (PE, Mach-O, ELF).

Background

Phase 1 (Complete): PE resource enumeration and metadata extraction
Phase 2 (Complete): PE string extraction (VERSIONINFO, STRINGTABLE, MANIFEST)
Phase 3 (This Issue): Extended resource support across all formats

Binary formats embed rich metadata and resources that contain high-signal strings useful for security analysis, reverse engineering, and binary intelligence gathering. Current implementation covers basic PE resources but misses:

  • PE: Dialog resources (UI strings, control labels), icon metadata/descriptions, accelerator tables
  • Mach-O: Embedded plist files (Info.plist, entitlements), framework bundle metadata
  • ELF: Note sections (.note.gnu.build-id, .note.ABI-tag), build IDs, GNU attributes

These resources often contain developer comments, internal paths, debug information, and user-facing strings that are highly valuable for analysis.

Proposed Implementation

PE Format Extensions

Target Resources: RT_DIALOG (5), RT_ICON (3), RT_GROUP_ICON (14), RT_ACCELERATOR (9)

  • Dialog Resources: Parse dialog templates to extract window titles, button labels, static text controls

    • Use pelite's resource enumeration with RT_DIALOG type
    • Parse DLGTEMPLATE/DLGTEMPLATEEX structures
    • Extract UTF-16LE strings from control definitions
    • Tag with Tag::Resource and potentially Tag::UiString
  • Icon Metadata: Extract icon group names and descriptions

    • Enumerate RT_GROUP_ICON resources
    • Parse ICONDIR structures for metadata
    • Extract any embedded string data

Dependencies: Already using pelite, may need manual structure parsing for DLGTEMPLATE

Mach-O Format Extensions

Target Sections: __TEXT,__info_plist, __PLIST segments, embedded frameworks

  • Embedded Plists: Parse Info.plist and entitlements XML

    • Locate plist sections in Mach-O segments
    • Parse XML/binary plist formats
    • Extract key-value string pairs (bundle ID, display name, permissions)
    • Tag with Tag::Plist or Tag::Metadata
  • Framework Bundles: Process framework metadata

    • Parse framework directory structures within bundles
    • Extract framework names, version strings
    • Process LC_ID_DYLIB load commands for identification

Dependencies: Consider adding plist crate for XML/binary plist parsing

ELF Format Extensions

Target Sections: .note.gnu.build-id, .note.ABI-tag, .note.GNU-stack, GNU attributes

  • Note Sections: Parse ELF note entries

    • Iterate through PT_NOTE program headers
    • Parse note section structures (namesz, descsz, type)
    • Extract build IDs, ABI tags, vendor notes
    • Tag with Tag::BuildMetadata
  • Build IDs: Extract unique build identifiers

    • Parse NT_GNU_BUILD_ID note type
    • Convert to hex string representation
    • Useful for binary tracking and debugging
  • GNU Attributes: Parse .gnu.attributes section

    • Extract compiler version strings
    • Parse attribute tags and values
    • Tag with Tag::CompilerInfo

Dependencies: goblin already provides note section parsing primitives

Implementation Strategy

  1. Create extraction modules for each format in src/extraction/

    • src/extraction/pe_dialogs.rs - Dialog and icon resource parsing
    • src/extraction/macho_resources.rs - Plist and framework bundle extraction
    • src/extraction/elf_notes.rs - Note section and build metadata parsing
  2. Extend Tag enum in src/types.rs with new semantic tags:

    • Tag::UiString - Dialog and UI element strings
    • Tag::Plist - Property list entries
    • Tag::BuildMetadata - Build IDs, ABI tags
    • Tag::CompilerInfo - Compiler and toolchain metadata
  3. Wire into extraction pipeline in src/lib.rs

    • Call format-specific extractors after existing resource extraction
    • Merge results with existing string collections
    • Ensure proper deduplication
  4. Add comprehensive tests

    • Unit tests for each resource parser
    • Integration tests with real binary fixtures containing target resources
    • Snapshot tests for expected output formats

Success Criteria

  • PE: Successfully extract strings from dialog resources with proper UTF-16LE decoding
  • PE: Extract icon group names and metadata
  • Mach-O: Parse embedded Info.plist and extract key-value pairs
  • Mach-O: Extract framework bundle metadata
  • ELF: Parse note sections and extract build IDs
  • ELF: Extract GNU attribute strings
  • All: Comprehensive test coverage with fixtures
  • All: Proper tagging and scoring in output

References

Priority

Medium-High - Expands core string extraction capabilities with high-signal data sources

Estimated Effort

2-3 weeks - Requires format-specific parsing logic and comprehensive testing across all three binary formats

Activity

  1. added theissue type on Nov 11, 2025
  2. changed the issue type fromtoon Nov 11, 2025
  3. unclesp1d3r commented on Nov 11, 2025

    @unclesp1d3r
    MemberAuthor

    @coderabbitai Enhance this issue body with additional context and a proposed solution. Improve the issue title and assign the proper labels and other metadata.

  4. traycerai commented on Nov 11, 2025

    @traycerai

    Plan

    Observations

    The codebase provides solid foundations: PE resource extraction in pe_resources.rs handles VERSIONINFO, STRINGTABLE, and MANIFEST via pelite; container parsers classify sections and extract imports/exports using goblin; types define extensible enums for tags and resources. ELF notes are classified as StringData but not parsed; Mach-O lacks resource extraction. Architecture supports modular extensions with graceful error handling and consistent FoundString output.

    Approach

    Extend existing PE extraction in pe_resources.rs for dialogs and icons using pelite enumeration and manual DLGTEMPLATE parsing. Create macho_resources.rs for plist (via new plist dependency) and framework extraction from load commands. Create elf_notes.rs for build ID, notes, and GNU attributes using goblin APIs. Update types with new tags; integrate extractors into container parsers; add tests and documentation following established patterns.

    Reasoning

    I examined the repository structure, reviewed the PE resource extraction implementation, analyzed type definitions, inspected container parsers for ELF and Mach-O, and researched parsing requirements for dialogs, plists, and ELF notes using available libraries.

    Proposed File Changes

    📄 src/types.rs (MODIFY) 🔗

    References

    Extend the Tag enum to include new variants for the enhanced resource types: UiString for dialog and UI element strings, Plist for Mach-O property list entries, BuildMetadata for ELF build IDs and ABI tags, and CompilerInfo for GNU attribute data. This maintains consistency with existing tags like Version, Manifest, and Resource while supporting serde serialization.

    Extend the ResourceType enum to add variants for the new PE resource types: Dialog for RT_DIALOG resources and Icon for RT_ICON/RT_GROUP_ICON resources, following the pattern of VersionInfo, StringTable, and Manifest.

    📄 src/extraction/pe_resources.rs (MODIFY) 🔗

    References

    Add constants for new resource types: RT_DIALOG (5) and RT_ICON (3), RT_GROUP_ICON (14) following existing RT_STRING and RT_MANIFEST.

    Implement detect_dialog_resources() to traverse the resource tree for RT_DIALOG entries, returning Vec<ResourceMetadata> with Dialog variant, similar to detect_version_info().

    Implement detect_icon_resources() to find RT_ICON and RT_GROUP_ICON, collecting metadata.

    Create extract_dialog_strings() to parse DLGTEMPLATE/DLGTEMPLATEEX: check for extended format signature, extract window title and control texts as UTF-16LE strings with alignment handling, return Vec<FoundString> tagged Tag::Resource and Tag::UiString with scores 8.0-9.0.

    Create extract_icon_metadata() to parse ICONDIR for group names and descriptions, returning tagged FoundString entries.

    Update enumerate_resources() to include calls to new detection functions.

    Update extract_resource_strings() to invoke new extraction functions and aggregate results.

    Add unit tests for dialog/icon parsing, malformed data, and multi-language support, mirroring existing tests.

    📄 src/extraction/macho_resources.rs (NEW) 🔗

    References

    Create new module following pe_resources.rs pattern.

    Implement extract_plist_strings(): use goblin to locate __TEXT,__info_plist section, parse with plist crate (handles XML/binary), extract string values from keys like CFBundleIdentifier, CFBundleName, return Vec<FoundString> with Tag::Plist and Tag::Resource, UTF-8 encoding, scores 8.5-9.5.

    Implement extract_framework_metadata(): parse load commands (LC_LOAD_DYLIB etc.) via goblin, extract framework paths/names/versions, preserve @rpath etc., return tagged FoundString with Tag::Resource and scores 7.0-8.0.

    Create extract_macho_resources() orchestrator combining both, returning aggregated Vec<FoundString>.

    Add module docs and unit tests for plist parsing (various formats), framework extraction, error cases.

    📄 src/extraction/elf_notes.rs (NEW) 🔗

    References

    Create new module following pe_resources.rs pattern.

    Implement extract_build_id(): scan .note.gnu.build-id section or PT_NOTE headers via goblin, parse NT_GNU_BUILD_ID note, format descriptor as hex string, return single FoundString with Tag::BuildMetadata, ASCII encoding, score 9.5.

    Implement extract_elf_notes(): enumerate .note* sections, parse note headers (namesz/descsz/type), extract strings from known types (ABI-tag etc.), return Vec<FoundString> with Tag::BuildMetadata and scores 7.0-8.0.

    Implement extract_gnu_attributes(): parse .gnu.attributes section, extract compiler flags/ABI info as strings, return tagged FoundString with Tag::CompilerInfo, scores 6.5-7.5.

    Create extract_elf_metadata() orchestrator aggregating all, returning Vec<FoundString>.

    Add module docs and unit tests for build ID extraction, note parsing, attributes, malformed sections.

    📄 src/extraction/mod.rs (MODIFY) 🔗

    References

    Declare new modules: pub mod macho_resources; and pub mod elf_notes;.

    Re-export orchestrator functions: pub use macho_resources::extract_macho_resources; and pub use elf_notes::extract_elf_metadata;.

    Update module docs to describe Phase 3 enhancements, including PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs, with usage examples for all formats.

    📄 src/container/macho.rs (MODIFY) 🔗

    References

    In MachoParser::parse(), after section/imports/exports extraction, call extraction::extract_macho_resources(data) to get resource strings. Since ContainerInfo has PE-specific resources, note that Mach-O resources are string-focused and integrated via the main pipeline; add comment on this design choice for format-agnostic string extraction.

    📄 src/container/elf.rs (MODIFY) 🔗

    References

    In ElfParser::parse(), maintain .note* classification as StringData (weight 9.0). Add comment noting ELF metadata extraction via extraction::extract_elf_metadata() for the pipeline. No structural changes needed, as extraction is modular.

    📄 src/lib.rs (MODIFY) 🔗

    References

    In the extraction pipeline integration (if present) or via public API, ensure calls to format-specific extractors post-container parsing. Update crate docs to highlight Phase 3: multi-format resource extraction with examples combining PE/Mach-O/ELF strings.

    📄 Cargo.toml (MODIFY) 🔗

    Add plist = "1.7" to [dependencies] for Mach-O plist parsing, compatible with existing crates like goblin and pelite.

    📄 README.md (MODIFY) 🔗

    References

    Update 'Current Implementation Status' to include Phase 3 features: PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs. Add usage example for multi-format extraction. Expand 'PE Resource String Extraction' to mention new types.

    📄 docs/src/binary-formats.md (MODIFY) 🔗

    References

    Add sections for Mach-O and ELF resource extraction: describe plist/framework parsing, note/build ID extraction. Update PE section to include dialogs/icons. Remove from 'Future Enhancements' now-implemented items. Include examples and references.

    📄 tests/integration_pe.rs (MODIFY) 🔗

    References

    Add tests: test_pe_dialog_extraction() verifying DLGTEMPLATE strings from fixture, test_pe_icon_extraction() for metadata. Use existing fixture or note new ones; assert tags, scores, UTF-16LE decoding.

    📄 tests/integration_macho.rs (MODIFY) 🔗

    References

    Add test_macho_plist_extraction(): load fixture, verify key-value strings, tags. Add test_macho_framework_extraction(): check paths/versions from load commands. Follow existing Mach-O test patterns.

    📄 tests/integration_elf.rs (MODIFY) 🔗

    References

    Add test_elf_build_id_extraction(): verify hex string from note, high score. Add test_elf_notes_extraction(): parse various notes. Add test_gnu_attributes_extraction(): check compiler info. Use ELF fixtures with notes.

    Import In IDE

    VSCode Icon Cursor Icon Windsurf Icon

    🤖 Prompt for AI Agents
    I have created the following plan after thorough exploration and analysis of the codebase. Follow the below plan verbatim. Trust the files and references. Do not re-verify what's written in the plan. Explore only when absolutely necessary. First implement all the proposed file changes and then I'll review all the changes together at the end.
    
    ### Observations
    
    The codebase provides solid foundations: PE resource extraction in `pe_resources.rs` handles VERSIONINFO, STRINGTABLE, and MANIFEST via pelite; container parsers classify sections and extract imports/exports using goblin; types define extensible enums for tags and resources. ELF notes are classified as StringData but not parsed; Mach-O lacks resource extraction. Architecture supports modular extensions with graceful error handling and consistent `FoundString` output.
    
    ### Approach
    
    Extend existing PE extraction in `pe_resources.rs` for dialogs and icons using pelite enumeration and manual DLGTEMPLATE parsing. Create `macho_resources.rs` for plist (via new `plist` dependency) and framework extraction from load commands. Create `elf_notes.rs` for build ID, notes, and GNU attributes using goblin APIs. Update types with new tags; integrate extractors into container parsers; add tests and documentation following established patterns.
    
    ### Reasoning
    
    I examined the repository structure, reviewed the PE resource extraction implementation, analyzed type definitions, inspected container parsers for ELF and Mach-O, and researched parsing requirements for dialogs, plists, and ELF notes using available libraries.
    
    ## Proposed File Changes
    
    ### src/types.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    
    Extend the `Tag` enum to include new variants for the enhanced resource types: `UiString` for dialog and UI element strings, `Plist` for Mach-O property list entries, `BuildMetadata` for ELF build IDs and ABI tags, and `CompilerInfo` for GNU attribute data. This maintains consistency with existing tags like `Version`, `Manifest`, and `Resource` while supporting serde serialization.
    
    Extend the `ResourceType` enum to add variants for the new PE resource types: `Dialog` for RT_DIALOG resources and `Icon` for RT_ICON/RT_GROUP_ICON resources, following the pattern of `VersionInfo`, `StringTable`, and `Manifest`.
    
    ### src/extraction/pe_resources.rs(MODIFY)
    
    References: 
    
    - src/types.rs(MODIFY)
    
    Add constants for new resource types: `RT_DIALOG` (5) and `RT_ICON` (3), `RT_GROUP_ICON` (14) following existing `RT_STRING` and `RT_MANIFEST`.
    
    Implement `detect_dialog_resources()` to traverse the resource tree for RT_DIALOG entries, returning `Vec<ResourceMetadata>` with `Dialog` variant, similar to `detect_version_info()`.
    
    Implement `detect_icon_resources()` to find RT_ICON and RT_GROUP_ICON, collecting metadata.
    
    Create `extract_dialog_strings()` to parse DLGTEMPLATE/DLGTEMPLATEEX: check for extended format signature, extract window title and control texts as UTF-16LE strings with alignment handling, return `Vec<FoundString>` tagged `Tag::Resource` and `Tag::UiString` with scores 8.0-9.0.
    
    Create `extract_icon_metadata()` to parse ICONDIR for group names and descriptions, returning tagged `FoundString` entries.
    
    Update `enumerate_resources()` to include calls to new detection functions.
    
    Update `extract_resource_strings()` to invoke new extraction functions and aggregate results.
    
    Add unit tests for dialog/icon parsing, malformed data, and multi-language support, mirroring existing tests.
    
    ### src/extraction/macho_resources.rs(NEW)
    
    References: 
    
    - src/container/macho.rs(MODIFY)
    - src/types.rs(MODIFY)
    
    Create new module following `pe_resources.rs` pattern.
    
    Implement `extract_plist_strings()`: use goblin to locate `__TEXT,__info_plist` section, parse with `plist` crate (handles XML/binary), extract string values from keys like CFBundleIdentifier, CFBundleName, return `Vec<FoundString>` with `Tag::Plist` and `Tag::Resource`, UTF-8 encoding, scores 8.5-9.5.
    
    Implement `extract_framework_metadata()`: parse load commands (LC_LOAD_DYLIB etc.) via goblin, extract framework paths/names/versions, preserve @rpath etc., return tagged `FoundString` with `Tag::Resource` and scores 7.0-8.0.
    
    Create `extract_macho_resources()` orchestrator combining both, returning aggregated `Vec<FoundString>`.
    
    Add module docs and unit tests for plist parsing (various formats), framework extraction, error cases.
    
    ### src/extraction/elf_notes.rs(NEW)
    
    References: 
    
    - src/container/elf.rs(MODIFY)
    - src/types.rs(MODIFY)
    
    Create new module following `pe_resources.rs` pattern.
    
    Implement `extract_build_id()`: scan `.note.gnu.build-id` section or PT_NOTE headers via goblin, parse NT_GNU_BUILD_ID note, format descriptor as hex string, return single `FoundString` with `Tag::BuildMetadata`, ASCII encoding, score 9.5.
    
    Implement `extract_elf_notes()`: enumerate `.note*` sections, parse note headers (namesz/descsz/type), extract strings from known types (ABI-tag etc.), return `Vec<FoundString>` with `Tag::BuildMetadata` and scores 7.0-8.0.
    
    Implement `extract_gnu_attributes()`: parse `.gnu.attributes` section, extract compiler flags/ABI info as strings, return tagged `FoundString` with `Tag::CompilerInfo`, scores 6.5-7.5.
    
    Create `extract_elf_metadata()` orchestrator aggregating all, returning `Vec<FoundString>`.
    
    Add module docs and unit tests for build ID extraction, note parsing, attributes, malformed sections.
    
    ### src/extraction/mod.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Declare new modules: `pub mod macho_resources;` and `pub mod elf_notes;`.
    
    Re-export orchestrator functions: `pub use macho_resources::extract_macho_resources;` and `pub use elf_notes::extract_elf_metadata;`.
    
    Update module docs to describe Phase 3 enhancements, including PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs, with usage examples for all formats.
    
    ### src/container/macho.rs(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    - src/lib.rs(MODIFY)
    
    In `MachoParser::parse()`, after section/imports/exports extraction, call `extraction::extract_macho_resources(data)` to get resource strings. Since `ContainerInfo` has PE-specific `resources`, note that Mach-O resources are string-focused and integrated via the main pipeline; add comment on this design choice for format-agnostic string extraction.
    
    ### src/container/elf.rs(MODIFY)
    
    References: 
    
    - src/extraction/elf_notes.rs(NEW)
    
    In `ElfParser::parse()`, maintain `.note*` classification as `StringData` (weight 9.0). Add comment noting ELF metadata extraction via `extraction::extract_elf_metadata()` for the pipeline. No structural changes needed, as extraction is modular.
    
    ### src/lib.rs(MODIFY)
    
    References: 
    
    - src/extraction/mod.rs(MODIFY)
    
    In the extraction pipeline integration (if present) or via public API, ensure calls to format-specific extractors post-container parsing. Update crate docs to highlight Phase 3: multi-format resource extraction with examples combining PE/Mach-O/ELF strings.
    
    ### Cargo.toml(MODIFY)
    
    Add `plist = "1.7"` to `[dependencies]` for Mach-O plist parsing, compatible with existing crates like goblin and pelite.
    
    ### README.md(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    
    Update 'Current Implementation Status' to include Phase 3 features: PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs. Add usage example for multi-format extraction. Expand 'PE Resource String Extraction' to mention new types.
    
    ### docs/src/binary-formats.md(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Add sections for Mach-O and ELF resource extraction: describe plist/framework parsing, note/build ID extraction. Update PE section to include dialogs/icons. Remove from 'Future Enhancements' now-implemented items. Include examples and references.
    
    ### tests/integration_pe.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    
    Add tests: `test_pe_dialog_extraction()` verifying DLGTEMPLATE strings from fixture, `test_pe_icon_extraction()` for metadata. Use existing fixture or note new ones; assert tags, scores, UTF-16LE decoding.
    
    ### tests/integration_macho.rs(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    
    Add `test_macho_plist_extraction()`: load fixture, verify key-value strings, tags. Add `test_macho_framework_extraction()`: check paths/versions from load commands. Follow existing Mach-O test patterns.
    
    ### tests/integration_elf.rs(MODIFY)
    
    References: 
    
    - src/extraction/elf_notes.rs(NEW)
    
    Add `test_elf_build_id_extraction()`: verify hex string from note, high score. Add `test_elf_notes_extraction()`: parse various notes. Add `test_gnu_attributes_extraction()`: check compiler info. Use ELF fixtures with notes.

    Developer Humor

    Why did the binary go to therapy?\n> It had too many unresolved resources!\n> Now with Phase 3, PE dialogs, Mach-O plists,\n> and ELF notes are all unpacked. 🎉\n> No more string anxiety! 🔍


    Execution Information

    Branch: main
    Commit: 08cd31b


    💡 Tips

    Supported Commands (Inside Comments)

    • Use @traycerai generate to iterate on the previous version of the implementation plan.

    Supported Commands (Inside Description)

    • Add @traycerai ignore anywhere in the ticket description to prevent this ticket from being processed.
    • Add @traycerai branch:<branch-name> anywhere in the ticket description to specify the target branch for the implementation plan.

    Community

    • Join our Discord Community to get help, request features, and share feedback.
    • Follow us on X/Twitter for updates and announcements.
  5. changed the title [-]Enhanced Resource Support[/-] [+]Phase 3: Multi-Format Resource Extraction - PE Dialogs, Mach-O Plists, ELF Build Metadata[/+] on Nov 11, 2025
  6. added
    area:analyzerBinary analyzer functionality
    lang:rustRust implementation
    epicLarge feature or initiative spanning multiple tasks
    on Nov 11, 2025
  7. coderabbitai commented on Nov 11, 2025

    @coderabbitai
    Contributor

    Tip

    For best results, initiate chat on the files or code changes.

    🧩 Analysis chain

    🏁 Script executed:

    #!/bin/bash
    # Fetch the details of issue #71
    gh issue view 71 --json title,body,labels,assignees,milestone,state,author,number,url
    

    Length of output: 432


    🏁 Script executed:

    #!/bin/bash
    # Get repository information and README
    cat README.md
    
    # Check the project structure to understand implementation
    fd -t f -e rs -e go -e py -e js -e java --max-depth 2 | head -20
    
    # Look for existing resource handling code
    rg -l "resource" -i --type-add 'code:*.{rs,go,py,js,java,cpp,c}' -t code | head -10
    

    Length of output: 7887


    🏁 Script executed:

    #!/bin/bash
    # Check existing PE resource implementation
    cat src/extraction/pe_resources.rs | head -150
    
    # Check container structure to understand architecture
    fd -t f "container" -e rs | xargs ls -la
    
    # Check if there's an implementation spec or task list
    cat .kiro/specs/stringy-binary-analyzer/tasks.md 2>/dev/null || echo "No tasks.md found"
    

    Length of output: 19118


    🏁 Script executed:

    #!/bin/bash
    # Update the issue with enhanced title, body, labels, and metadata
    gh issue edit 71 \
      --title "Phase 3: Multi-Format Resource Extraction - PE Dialogs, Mach-O Plists, ELF Build Metadata" \
      --body "## Overview
    
    This issue tracks Phase 3 of resource extraction capabilities in StringyMcStringFace, expanding beyond the current PE VERSIONINFO/STRINGTABLE/MANIFEST support to cover additional resource types across all three binary formats (PE, Mach-O, ELF).
    
    ## Background
    
    **Phase 1 (Complete)**: PE resource enumeration and metadata extraction
    **Phase 2 (Complete)**: PE string extraction (VERSIONINFO, STRINGTABLE, MANIFEST)
    **Phase 3 (This Issue)**: Extended resource support across all formats
    
    Binary formats embed rich metadata and resources that contain high-signal strings useful for security analysis, reverse engineering, and binary intelligence gathering. Current implementation covers basic PE resources but misses:
    - **PE**: Dialog resources (UI strings, control labels), icon metadata/descriptions, accelerator tables
    - **Mach-O**: Embedded plist files (Info.plist, entitlements), framework bundle metadata
    - **ELF**: Note sections (.note.gnu.build-id, .note.ABI-tag), build IDs, GNU attributes
    
    These resources often contain developer comments, internal paths, debug information, and user-facing strings that are highly valuable for analysis.
    
    ## Proposed Implementation
    
    ### PE Format Extensions
    **Target Resources**: RT_DIALOG (5), RT_ICON (3), RT_GROUP_ICON (14), RT_ACCELERATOR (9)
    
    - **Dialog Resources**: Parse dialog templates to extract window titles, button labels, static text controls
      - Use pelite's resource enumeration with RT_DIALOG type
      - Parse DLGTEMPLATE/DLGTEMPLATEEX structures
      - Extract UTF-16LE strings from control definitions
      - Tag with \`Tag::Resource\` and potentially \`Tag::UiString\`
      
    - **Icon Metadata**: Extract icon group names and descriptions
      - Enumerate RT_GROUP_ICON resources
      - Parse ICONDIR structures for metadata
      - Extract any embedded string data
    
    **Dependencies**: Already using pelite, may need manual structure parsing for DLGTEMPLATE
    
    ### Mach-O Format Extensions
    **Target Sections**: \`__TEXT,__info_plist\`, \`__PLIST\` segments, embedded frameworks
    
    - **Embedded Plists**: Parse Info.plist and entitlements XML
      - Locate plist sections in Mach-O segments
      - Parse XML/binary plist formats
      - Extract key-value string pairs (bundle ID, display name, permissions)
      - Tag with \`Tag::Plist\` or \`Tag::Metadata\`
    
    - **Framework Bundles**: Process framework metadata
      - Parse framework directory structures within bundles
      - Extract framework names, version strings
      - Process LC_ID_DYLIB load commands for identification
    
    **Dependencies**: Consider adding \`plist\` crate for XML/binary plist parsing
    
    ### ELF Format Extensions
    **Target Sections**: \`.note.gnu.build-id\`, \`.note.ABI-tag\`, \`.note.GNU-stack\`, GNU attributes
    
    - **Note Sections**: Parse ELF note entries
      - Iterate through PT_NOTE program headers
      - Parse note section structures (namesz, descsz, type)
      - Extract build IDs, ABI tags, vendor notes
      - Tag with \`Tag::BuildMetadata\`
    
    - **Build IDs**: Extract unique build identifiers
      - Parse NT_GNU_BUILD_ID note type
      - Convert to hex string representation
      - Useful for binary tracking and debugging
    
    - **GNU Attributes**: Parse .gnu.attributes section
      - Extract compiler version strings
      - Parse attribute tags and values
      - Tag with \`Tag::CompilerInfo\`
    
    **Dependencies**: goblin already provides note section parsing primitives
    
    ## Implementation Strategy
    
    1. **Create extraction modules** for each format in \`src/extraction/\`
       - \`src/extraction/pe_dialogs.rs\` - Dialog and icon resource parsing
       - \`src/extraction/macho_resources.rs\` - Plist and framework bundle extraction
       - \`src/extraction/elf_notes.rs\` - Note section and build metadata parsing
    
    2. **Extend Tag enum** in \`src/types.rs\` with new semantic tags:
       - \`Tag::UiString\` - Dialog and UI element strings
       - \`Tag::Plist\` - Property list entries
       - \`Tag::BuildMetadata\` - Build IDs, ABI tags
       - \`Tag::CompilerInfo\` - Compiler and toolchain metadata
    
    3. **Wire into extraction pipeline** in \`src/lib.rs\`
       - Call format-specific extractors after existing resource extraction
       - Merge results with existing string collections
       - Ensure proper deduplication
    
    4. **Add comprehensive tests**
       - Unit tests for each resource parser
       - Integration tests with real binary fixtures containing target resources
       - Snapshot tests for expected output formats
    
    ## Success Criteria
    
    - [ ] PE: Successfully extract strings from dialog resources with proper UTF-16LE decoding
    - [ ] PE: Extract icon group names and metadata
    - [ ] Mach-O: Parse embedded Info.plist and extract key-value pairs
    - [ ] Mach-O: Extract framework bundle metadata
    - [ ] ELF: Parse note sections and extract build IDs
    - [ ] ELF: Extract GNU attribute strings
    - [ ] All: Comprehensive test coverage with fixtures
    - [ ] All: Proper tagging and scoring in output
    
    ## References
    
    - **PE Resources**: [PE Format Specification - Microsoft](https://learn.microsoft.com/en-us/windows/win32/menurc/resource-types)
    - **Mach-O Plists**: [Apple Developer - Information Property Lists](https://developer.apple.com/documentation/bundleresources/information_property_list)
    - **ELF Notes**: [ELF Format - Tool Interface Standard](https://refspecs.linuxfoundation.org/elf/elf.pdf)
    - **Current Implementation**: \`src/extraction/pe_resources.rs\` (Phase 2 reference)
    
    ## Priority
    
    Medium-High - Expands core string extraction capabilities with high-signal data sources
    
    ## Estimated Effort
    
    2-3 weeks - Requires format-specific parsing logic and comprehensive testing across all three binary formats" \
      --add-label "enhancement" \
      --add-label "feature" \
      --add-assignee "unclesp1d3r"
    

    Length of output: 124


    🏁 Script executed:

    #!/bin/bash
    # Check what labels are available in the repository
    gh label list
    
    # Try updating the issue without the feature label first
    gh issue edit 71 \
      --title "Phase 3: Multi-Format Resource Extraction - PE Dialogs, Mach-O Plists, ELF Build Metadata" \
      --body "## Overview
    
    This issue tracks Phase 3 of resource extraction capabilities in StringyMcStringFace, expanding beyond the current PE VERSIONINFO/STRINGTABLE/MANIFEST support to cover additional resource types across all three binary formats (PE, Mach-O, ELF).
    
    ## Background
    
    **Phase 1 (Complete)**: PE resource enumeration and metadata extraction
    **Phase 2 (Complete)**: PE string extraction (VERSIONINFO, STRINGTABLE, MANIFEST)
    **Phase 3 (This Issue)**: Extended resource support across all formats
    
    Binary formats embed rich metadata and resources that contain high-signal strings useful for security analysis, reverse engineering, and binary intelligence gathering. Current implementation covers basic PE resources but misses:
    - **PE**: Dialog resources (UI strings, control labels), icon metadata/descriptions, accelerator tables
    - **Mach-O**: Embedded plist files (Info.plist, entitlements), framework bundle metadata
    - **ELF**: Note sections (.note.gnu.build-id, .note.ABI-tag), build IDs, GNU attributes
    
    These resources often contain developer comments, internal paths, debug information, and user-facing strings that are highly valuable for analysis.
    
    ## Proposed Implementation
    
    ### PE Format Extensions
    **Target Resources**: RT_DIALOG (5), RT_ICON (3), RT_GROUP_ICON (14), RT_ACCELERATOR (9)
    
    - **Dialog Resources**: Parse dialog templates to extract window titles, button labels, static text controls
      - Use pelite's resource enumeration with RT_DIALOG type
      - Parse DLGTEMPLATE/DLGTEMPLATEEX structures
      - Extract UTF-16LE strings from control definitions
      - Tag with \`Tag::Resource\` and potentially \`Tag::UiString\`
      
    - **Icon Metadata**: Extract icon group names and descriptions
      - Enumerate RT_GROUP_ICON resources
      - Parse ICONDIR structures for metadata
      - Extract any embedded string data
    
    **Dependencies**: Already using pelite, may need manual structure parsing for DLGTEMPLATE
    
    ### Mach-O Format Extensions
    **Target Sections**: \`__TEXT,__info_plist\`, \`__PLIST\` segments, embedded frameworks
    
    - **Embedded Plists**: Parse Info.plist and entitlements XML
      - Locate plist sections in Mach-O segments
      - Parse XML/binary plist formats
      - Extract key-value string pairs (bundle ID, display name, permissions)
      - Tag with \`Tag::Plist\` or \`Tag::Metadata\`
    
    - **Framework Bundles**: Process framework metadata
      - Parse framework directory structures within bundles
      - Extract framework names, version strings
      - Process LC_ID_DYLIB load commands for identification
    
    **Dependencies**: Consider adding \`plist\` crate for XML/binary plist parsing
    
    ### ELF Format Extensions
    **Target Sections**: \`.note.gnu.build-id\`, \`.note.ABI-tag\`, \`.note.GNU-stack\`, GNU attributes
    
    - **Note Sections**: Parse ELF note entries
      - Iterate through PT_NOTE program headers
      - Parse note section structures (namesz, descsz, type)
      - Extract build IDs, ABI tags, vendor notes
      - Tag with \`Tag::BuildMetadata\`
    
    - **Build IDs**: Extract unique build identifiers
      - Parse NT_GNU_BUILD_ID note type
      - Convert to hex string representation
      - Useful for binary tracking and debugging
    
    - **GNU Attributes**: Parse .gnu.attributes section
      - Extract compiler version strings
      - Parse attribute tags and values
      - Tag with \`Tag::CompilerInfo\`
    
    **Dependencies**: goblin already provides note section parsing primitives
    
    ## Implementation Strategy
    
    1. **Create extraction modules** for each format in \`src/extraction/\`
       - \`src/extraction/pe_dialogs.rs\` - Dialog and icon resource parsing
       - \`src/extraction/macho_resources.rs\` - Plist and framework bundle extraction
       - \`src/extraction/elf_notes.rs\` - Note section and build metadata parsing
    
    2. **Extend Tag enum** in \`src/types.rs\` with new semantic tags:
       - \`Tag::UiString\` - Dialog and UI element strings
       - \`Tag::Plist\` - Property list entries
       - \`Tag::BuildMetadata\` - Build IDs, ABI tags
       - \`Tag::CompilerInfo\` - Compiler and toolchain metadata
    
    3. **Wire into extraction pipeline** in \`src/lib.rs\`
       - Call format-specific extractors after existing resource extraction
       - Merge results with existing string collections
       - Ensure proper deduplication
    
    4. **Add comprehensive tests**
       - Unit tests for each resource parser
       - Integration tests with real binary fixtures containing target resources
       - Snapshot tests for expected output formats
    
    ## Success Criteria
    
    - [ ] PE: Successfully extract strings from dialog resources with proper UTF-16LE decoding
    - [ ] PE: Extract icon group names and metadata
    - [ ] Mach-O: Parse embedded Info.plist and extract key-value pairs
    - [ ] Mach-O: Extract framework bundle metadata
    - [ ] ELF: Parse note sections and extract build IDs
    - [ ] ELF: Extract GNU attribute strings
    - [ ] All: Comprehensive test coverage with fixtures
    - [ ] All: Proper tagging and scoring in output
    
    ## References
    
    - **PE Resources**: [PE Format Specification - Microsoft](https://learn.microsoft.com/en-us/windows/win32/menurc/resource-types)
    - **Mach-O Plists**: [Apple Developer - Information Property Lists](https://developer.apple.com/documentation/bundleresources/information_property_list)
    - **ELF Notes**: [ELF Format - Tool Interface Standard](https://refspecs.linuxfoundation.org/elf/elf.pdf)
    - **Current Implementation**: \`src/extraction/pe_resources.rs\` (Phase 2 reference)
    
    ## Priority
    
    Medium-High - Expands core string extraction capabilities with high-signal data sources
    
    ## Estimated Effort
    
    2-3 weeks - Requires format-specific parsing logic and comprehensive testing across all three binary formats" \
      --add-label "enhancement" \
      --add-assignee "unclesp1d3r"
    

    Length of output: 1647


    🏁 Script executed:

    #!/bin/bash
    # Add more relevant labels to better categorize the issue
    gh issue edit 71 \
      --add-label "area:analyzer" \
      --add-label "lang:rust" \
      --add-label "epic" \
      --add-label "priority:medium"
    
    # Verify the final state of the issue
    gh issue view 71 --json title,body,labels,assignees,url | jq '{title, labels: [.labels[].name], assignees: [.assignees[].login], url}'
    

    Length of output: 392


    @unclesp1d3r I've successfully enhanced issue #71 with the following improvements:

    ✅ Enhanced Title

    "Phase 3: Multi-Format Resource Extraction - PE Dialogs, Mach-O Plists, ELF Build Metadata"

    The new title clearly indicates this is Phase 3 of resource extraction and specifies the scope across all three binary formats.

    ✅ Comprehensive Issue Body

    Added detailed sections including:

    • Overview & Background: Contextualizes this as Phase 3 after completed PE VERSIONINFO/STRINGTABLE/MANIFEST work
    • Technical Context: Explains why these resources matter for security analysis and reverse engineering
    • Proposed Implementation: Detailed approach for each format:
      • PE: Dialog resources (RT_DIALOG), icon metadata (RT_GROUP_ICON), with DLGTEMPLATE parsing
      • Mach-O: Embedded plists (Info.plist, entitlements), framework bundles, with plist crate recommendation
      • ELF: Note sections (.note.gnu.build-id), build IDs, GNU attributes using goblin primitives
    • Implementation Strategy: Module structure, new Tag enum values, pipeline integration, testing approach
    • Success Criteria: Checklist with 8 concrete deliverables
    • References: Links to PE format spec, Apple plist docs, ELF format standard
    • Priority & Effort: Medium-High priority, 2-3 week estimate

    ✅ Labels Applied

    • enhancement - New feature request
    • area:analyzer - Binary analyzer functionality
    • lang:rust - Rust implementation
    • epic - Large initiative spanning multiple formats
    • priority:medium - Appropriate priority level

    ✅ Metadata

    • Assigned to: unclesp1d3r

    The issue is now ready for development with clear technical guidance, success criteria, and proper categorization! 🎯

  8. traycerai commented on Nov 11, 2025

    @traycerai

    I have updated the Implementation Plan to reflect the recent changes in the ticket.

    Previous Plan

    Observations

    The codebase has a well-established foundation for resource extraction. PE resources already have VERSIONINFO, STRINGTABLE, and MANIFEST extraction complete via pelite. ELF currently classifies .note sections as StringData but doesn't parse them. Mach-O has no resource extraction yet. The architecture uses a modular approach with separate extraction modules per format, all returning FoundString objects with consistent tagging.

    Approach

    Implement three parallel enhancements: (1) Extend PE resource extraction in pe_resources.rs to add RT_DIALOG and RT_ICON parsing following existing patterns, (2) Create new macho_resources.rs module for plist and framework extraction using the plist crate, (3) Create new elf_notes.rs module for note section, build ID, and GNU attribute parsing using goblin's note APIs. Each follows the established pattern of graceful error handling and returning Vec<FoundString>.

    Reasoning

    I explored the repository structure, examined existing PE resource extraction implementation in src/extraction/pe_resources.rs, reviewed the type definitions in src/types.rs, checked container parsers for ELF and Mach-O, and researched external library capabilities (pelite for dialogs, plist crate for plists, goblin for ELF notes).

    Proposed File Changes

    📄 src/types.rs (MODIFY) 🔗

    References

    Extend the ResourceType enum to add new variants for dialog and icon resources. Add variants: Dialog for RT_DIALOG resources and Icon for RT_ICON/RT_GROUP_ICON resources. This follows the existing pattern where VersionInfo, StringTable, and Manifest are already defined.

    Extend the Tag enum to add new semantic tags for the new resource types:

    • PlistMetadata for Mach-O Info.plist key-value pairs
    • Framework for Mach-O framework bundle information
    • BuildId for ELF GNU build IDs
    • GnuAttribute for ELF GNU attribute data
    • ElfNote for general ELF note section data

    These additions maintain consistency with existing tag naming conventions (e.g., Version, Manifest, Resource) and support serde serialization.

    📄 src/extraction/pe_resources.rs (MODIFY) 🔗

    References

    Add RT_DIALOG (type 5) and RT_ICON (type 3) resource type constants following the existing pattern of RT_STRING and RT_MANIFEST.

    Implement detect_dialogs() function following the same pattern as detect_version_info(), detect_string_tables(), and detect_manifests(). This function should traverse the resource directory tree to find RT_DIALOG resources and return Vec<ResourceMetadata> with the Dialog variant.

    Implement detect_icons() function to enumerate RT_ICON and RT_GROUP_ICON resources, extracting metadata about icon resources.

    Implement extract_dialog_strings() function to parse DLGTEMPLATE and DLGTEMPLATEEX structures:

    • Discriminate between standard and extended formats by checking for 0xFFFF signature
    • Parse dialog header to extract window title (UTF-16LE string)
    • Iterate through dialog items (cdit/cDlgItems count) with proper DWORD alignment
    • Extract control text from each DLGITEMTEMPLATE/DLGITEMTEMPLATEEX
    • Handle variable-length arrays (menu, class, title) with proper alignment
    • Return Vec<FoundString> with Tag::Resource and appropriate scoring

    Implement extract_icon_strings() function to extract icon metadata strings (icon names, group names) from RT_ICON and RT_GROUP_ICON resources.

    Update enumerate_resources() to call the new detect_dialogs() and detect_icons() functions, extending the metadata collection.

    Update extract_resource_strings() orchestrator to call extract_dialog_strings() and extract_icon_strings(), combining results with existing VERSIONINFO, STRINGTABLE, and MANIFEST extraction.

    Add comprehensive unit tests following the existing test patterns for dialog and icon parsing, including edge cases for malformed data, missing resources, and multiple languages.

    📄 src/extraction/macho_resources.rs (NEW) 🔗

    References

    Create a new module for Mach-O resource extraction following the pattern established in src/extraction/pe_resources.rs.

    Implement extract_plist_strings() function:

    • Locate the __TEXT,__info_plist section from the Mach-O binary using goblin's section enumeration
    • Use the plist crate to parse both XML and binary plist formats transparently
    • Extract key-value pairs from the plist dictionary, focusing on string values
    • Target common Info.plist keys: CFBundleIdentifier, CFBundleName, CFBundleDisplayName, CFBundleVersion, CFBundleShortVersionString, NSHumanReadableCopyright, etc.
    • Return Vec<FoundString> with Tag::PlistMetadata and Tag::Resource
    • Set encoding to Encoding::Utf8 (plists use UTF-8)
    • Assign high scores (8.0-9.0) as plist metadata is high-confidence
    • Handle errors gracefully by returning empty Vec

    Implement extract_framework_strings() function:

    • Parse Mach-O load commands using goblin's APIs
    • Extract framework paths from LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, and LC_REEXPORT_DYLIB commands
    • Extract framework names from the dylib paths (e.g., "Foundation" from "/System/Library/Frameworks/Foundation.framework/Foundation")
    • Extract version information from dylib structures
    • Return Vec<FoundString> with Tag::Framework and Tag::FilePath tags
    • Preserve @rpath, @executable_path, and @loader_path variables verbatim
    • Assign medium-high scores (7.0-8.0)

    Implement extract_macho_resource_strings() orchestrator function that combines plist and framework extraction, similar to extract_resource_strings() in src/extraction/pe_resources.rs.

    Add comprehensive unit tests for plist parsing (XML and binary formats), framework path extraction, and error handling.

    Add module-level documentation explaining Mach-O resource extraction strategy and usage examples.

    📄 src/extraction/elf_notes.rs (NEW) 🔗

    References

    Create a new module for ELF note section and attribute extraction following the pattern established in src/extraction/pe_resources.rs.

    Implement extract_build_id() function:

    • Parse ELF using goblin to access section headers and program headers
    • Search for .note.gnu.build-id section first (most common location)
    • Fall back to scanning PT_NOTE program headers if section not found
    • Use goblin's NoteIterator to parse note entries
    • Look for NT_GNU_BUILD_ID (type 3) with name "GNU"
    • Extract descriptor bytes and format as lowercase hex string
    • Return Vec<FoundString> with single entry containing the build ID
    • Tag with Tag::BuildId and assign very high score (9.5) as it's a unique identifier
    • Set encoding to Encoding::Ascii
    • Handle missing build IDs gracefully by returning empty Vec

    Implement extract_note_sections() function:

    • Enumerate all .note* sections (.note, .note.ABI-tag, .note.gnu.build-id, etc.)
    • Parse note headers (nhdr: namesz, descsz, type) with proper 4-byte alignment
    • Extract note name and descriptor data
    • For known note types (NT_GNU_ABI_TAG, NT_GNU_BUILD_ID, etc.), extract meaningful strings
    • Return Vec<FoundString> with Tag::ElfNote and Tag::Resource
    • Assign medium scores (6.0-7.0) for general note data

    Implement extract_gnu_attributes() function:

    • Locate .gnu.attributes or .ARM.attributes sections
    • Parse attribute section format (vendor name, tag-value pairs)
    • Extract human-readable attribute values (compiler flags, ABI details)
    • Return Vec<FoundString> with Tag::GnuAttribute
    • Assign medium scores (6.0-7.0)
    • Handle architecture-specific attributes gracefully

    Implement extract_elf_metadata_strings() orchestrator function that combines build ID, note section, and GNU attribute extraction.

    Add comprehensive unit tests for note parsing, build ID extraction, attribute parsing, and error handling with malformed data.

    Add module-level documentation explaining ELF metadata extraction and the significance of build IDs for binary identification.

    📄 src/extraction/mod.rs (MODIFY) 🔗

    References

    Add module declarations for the new extraction modules:

    • pub mod macho_resources; for Mach-O plist and framework extraction
    • pub mod elf_notes; for ELF note section and build ID extraction

    Export the main orchestrator functions from each module:

    • pub use macho_resources::extract_macho_resource_strings;
    • pub use elf_notes::extract_elf_metadata_strings;

    Update the module-level documentation to describe the new extraction capabilities for Mach-O and ELF formats, following the existing pattern that documents PE resource extraction (Phase 1 and Phase 2).

    Add usage examples showing how to extract resources from all three binary formats.

    📄 src/container/macho.rs (MODIFY) 🔗

    References

    Integrate Mach-O resource extraction into the container parser's parse() method.

    In the parse() method of MachoParser, after extracting sections, imports, and exports, call the new extract_macho_resource_strings() function from src/extraction/macho_resources.rs to get plist and framework strings.

    Store the extracted resource strings in a new field or integrate them into the existing flow. Since ContainerInfo currently has a resources field that's Option<Vec<ResourceMetadata>> (PE-specific), consider whether to:

    1. Add resource string extraction at a higher level in the pipeline, OR
    2. Store Mach-O resource metadata in a format-agnostic way

    For consistency with PE implementation, the resource extraction should be called but the strings should be surfaced through the main extraction pipeline rather than stored in ContainerInfo.

    Add comments documenting the integration point and noting that Mach-O resource extraction includes plist and framework data.

    📄 src/container/elf.rs (MODIFY) 🔗

    References

    Integrate ELF note section and build ID extraction into the container parser.

    Update the classify_section() method to maintain the existing classification of .note* sections as SectionType::StringData with high weight (9.0), which is already correctly implemented.

    Add a comment in the parse() method noting that note section parsing and build ID extraction is available via src/extraction/elf_notes.rs and should be called by the main extraction pipeline.

    No structural changes needed to the parser itself, as the integration point for note extraction should be at the pipeline level, similar to how PE resource extraction works. The container parser's job is to identify and classify sections; the extraction module handles the actual string extraction.

    Optionally add a helper method to identify note sections for easy access by the extraction pipeline.

    📄 Cargo.toml (MODIFY) 🔗

    Add the plist crate dependency for Mach-O Info.plist parsing. Add version 1.7 or latest stable version with default features. This crate handles both XML and binary plist formats transparently.

    The dependency should be added to the [dependencies] section alongside existing dependencies like goblin, pelite, serde, etc.

    No other dependencies are needed as goblin already provides ELF note parsing capabilities, and pelite can handle dialog resource access (though we need to implement the DLGTEMPLATE parsing ourselves).

    📄 docs/src/binary-formats.md (MODIFY) 🔗

    References

    Update the "Enhanced Resource Support" section (lines 419-424) to reflect the newly implemented capabilities.

    For PE format section:

    • Move Dialog resources and Icon strings from "Future Enhancements" to implemented features
    • Update the limitations section (lines 305-320) to mark RT_DIALOG and RT_ICON as implemented
    • Add documentation explaining dialog resource extraction (window titles, control text)
    • Add documentation for icon metadata extraction

    For Mach-O format section:

    • Add a new "Resource Extraction" subsection documenting plist and framework extraction
    • Explain Info.plist key-value pair extraction with examples (CFBundleIdentifier, CFBundleName, etc.)
    • Document framework bundle extraction from load commands
    • Provide usage examples showing how to extract Mach-O resources

    For ELF format section:

    • Add a new "Metadata Extraction" subsection documenting note sections, build IDs, and GNU attributes
    • Explain build ID extraction and its significance for binary identification
    • Document note section parsing for ABI tags and vendor-specific data
    • Explain GNU attribute extraction for compiler flags and ABI details
    • Provide examples of extracted build IDs and note data

    Update the "Future Enhancements" section to remove the now-implemented features.

    📄 tests/integration_pe.rs (MODIFY) 🔗

    References

    Add integration tests for the new PE dialog and icon resource extraction.

    Create test_pe_dialog_resource_extraction() test function:

    • Load a PE fixture that contains RT_DIALOG resources (may need to create new fixture)
    • Call extract_resources() and verify Dialog resource metadata is detected
    • Call extract_resource_strings() and verify dialog strings are extracted
    • Validate that extracted strings have Tag::Resource tag
    • Check that window titles and control text are properly decoded from UTF-16LE

    Create test_pe_icon_resource_extraction() test function:

    • Load a PE fixture with icon resources
    • Verify icon metadata is detected and extracted
    • Validate proper tagging and scoring

    Follow the existing test patterns in this file, particularly the test_pe_resource_extraction_with_fixture() test which validates VERSIONINFO and STRINGTABLE extraction.

    📄 tests/integration_macho.rs (MODIFY) 🔗

    References

    Add integration tests for Mach-O resource extraction.

    Create test_macho_plist_extraction() test function:

    • Load a Mach-O fixture that contains an Info.plist section (may need to create new fixture)
    • Call extract_macho_resource_strings() from the new module
    • Verify that plist key-value pairs are extracted as FoundString objects
    • Validate that common keys like CFBundleIdentifier are found
    • Check proper tagging with Tag::PlistMetadata
    • Verify UTF-8 encoding is set correctly

    Create test_macho_framework_extraction() test function:

    • Load a Mach-O binary with framework dependencies
    • Verify framework names and paths are extracted
    • Check that @rpath variables are preserved
    • Validate Tag::Framework and Tag::FilePath tags are applied

    Follow the existing test structure in this file, using the pattern from test_macho_detection() and other tests.

    📄 tests/integration_elf.rs (MODIFY) 🔗

    References

    Add integration tests for ELF note section and build ID extraction.

    Create test_elf_build_id_extraction() test function:

    • Load an ELF fixture with a build ID (most modern Linux binaries have this)
    • Call extract_elf_metadata_strings() from the new module
    • Verify that the build ID is extracted as a hex string
    • Validate Tag::BuildId tag is applied
    • Check that the build ID format is correct (typically 20 or 16 hex characters)
    • Verify high score assignment (9.0+)

    Create test_elf_note_section_extraction() test function:

    • Load an ELF binary with various note sections
    • Verify note data is extracted from .note.ABI-tag and other note sections
    • Check proper tagging with Tag::ElfNote
    • Validate graceful handling of missing note sections

    Create test_elf_gnu_attributes_extraction() test function:

    • Load an ELF binary with GNU attributes (if available in fixtures)
    • Verify attribute data is extracted
    • Check Tag::GnuAttribute tagging

    Follow the existing test patterns in this file, particularly test_elf_symbol_extraction() which validates import/export extraction.

    📄 README.md (MODIFY) 🔗

    References

    Update the "Development Status" section (lines 166-209) to reflect the newly implemented resource extraction capabilities.

    In the "Current Capabilities" subsection:

    • Update the PE Resource Extraction bullet to include Dialog and Icon resources
    • Add a new bullet for Mach-O Resource Extraction listing plist and framework extraction
    • Add a new bullet for ELF Metadata Extraction listing note sections, build IDs, and GNU attributes

    Update the feature list (lines 52-67) to mention the enhanced resource support:

    • Add "PE dialog and icon resources" to the format-aware parsing features
    • Add "Mach-O plist and framework extraction"
    • Add "ELF build IDs and note sections"

    In the "Runtime-Specific" feature description (line 44), add examples of the new resource types that are now supported.

    📄 tests/fixtures/README.md (MODIFY) 🔗

    Update the fixture documentation to describe the new test binaries needed for dialog, icon, plist, and note section testing.

    Add documentation for PE fixtures:

    • Describe how to create a PE binary with RT_DIALOG resources (using resource compiler with .rc file containing DIALOG definitions)
    • Describe how to create a PE binary with RT_ICON resources
    • Document expected dialog strings and icon metadata in the fixtures

    Add documentation for Mach-O fixtures:

    • Describe how to create a Mach-O binary with Info.plist embedded
    • Document expected plist keys and values
    • Describe framework dependencies that should be present

    Add documentation for ELF fixtures:

    • Note that most modern ELF binaries already have build IDs
    • Document how to verify build ID presence using readelf -n
    • Describe expected note sections in test binaries

    Provide build instructions or references for regenerating fixtures if needed.

    Import In IDE

    VSCode Icon Cursor Icon Windsurf Icon

    🤖 Prompt for AI Agents
    I have created the following plan after thorough exploration and analysis of the codebase. Follow the below plan verbatim. Trust the files and references. Do not re-verify what's written in the plan. Explore only when absolutely necessary. First implement all the proposed file changes and then I'll review all the changes together at the end.
    
    ### Observations
    
    The codebase has a well-established foundation for resource extraction. PE resources already have VERSIONINFO, STRINGTABLE, and MANIFEST extraction complete via `pelite`. ELF currently classifies `.note` sections as StringData but doesn't parse them. Mach-O has no resource extraction yet. The architecture uses a modular approach with separate extraction modules per format, all returning `FoundString` objects with consistent tagging.
    
    ### Approach
    
    Implement three parallel enhancements: (1) Extend PE resource extraction in `pe_resources.rs` to add RT_DIALOG and RT_ICON parsing following existing patterns, (2) Create new `macho_resources.rs` module for plist and framework extraction using the `plist` crate, (3) Create new `elf_notes.rs` module for note section, build ID, and GNU attribute parsing using `goblin`'s note APIs. Each follows the established pattern of graceful error handling and returning `Vec<FoundString>`.
    
    ### Reasoning
    
    I explored the repository structure, examined existing PE resource extraction implementation in `src/extraction/pe_resources.rs`, reviewed the type definitions in `src/types.rs`, checked container parsers for ELF and Mach-O, and researched external library capabilities (pelite for dialogs, plist crate for plists, goblin for ELF notes).
    
    ## Proposed File Changes
    
    ### src/types.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Extend the `ResourceType` enum to add new variants for dialog and icon resources. Add variants: `Dialog` for RT_DIALOG resources and `Icon` for RT_ICON/RT_GROUP_ICON resources. This follows the existing pattern where `VersionInfo`, `StringTable`, and `Manifest` are already defined.
    
    Extend the `Tag` enum to add new semantic tags for the new resource types:
    - `PlistMetadata` for Mach-O Info.plist key-value pairs
    - `Framework` for Mach-O framework bundle information
    - `BuildId` for ELF GNU build IDs
    - `GnuAttribute` for ELF GNU attribute data
    - `ElfNote` for general ELF note section data
    
    These additions maintain consistency with existing tag naming conventions (e.g., `Version`, `Manifest`, `Resource`) and support serde serialization.
    
    ### src/extraction/pe_resources.rs(MODIFY)
    
    References: 
    
    - src/types.rs(MODIFY)
    
    Add RT_DIALOG (type 5) and RT_ICON (type 3) resource type constants following the existing pattern of `RT_STRING` and `RT_MANIFEST`.
    
    Implement `detect_dialogs()` function following the same pattern as `detect_version_info()`, `detect_string_tables()`, and `detect_manifests()`. This function should traverse the resource directory tree to find RT_DIALOG resources and return `Vec<ResourceMetadata>` with the Dialog variant.
    
    Implement `detect_icons()` function to enumerate RT_ICON and RT_GROUP_ICON resources, extracting metadata about icon resources.
    
    Implement `extract_dialog_strings()` function to parse DLGTEMPLATE and DLGTEMPLATEEX structures:
    - Discriminate between standard and extended formats by checking for 0xFFFF signature
    - Parse dialog header to extract window title (UTF-16LE string)
    - Iterate through dialog items (cdit/cDlgItems count) with proper DWORD alignment
    - Extract control text from each DLGITEMTEMPLATE/DLGITEMTEMPLATEEX
    - Handle variable-length arrays (menu, class, title) with proper alignment
    - Return `Vec<FoundString>` with `Tag::Resource` and appropriate scoring
    
    Implement `extract_icon_strings()` function to extract icon metadata strings (icon names, group names) from RT_ICON and RT_GROUP_ICON resources.
    
    Update `enumerate_resources()` to call the new `detect_dialogs()` and `detect_icons()` functions, extending the metadata collection.
    
    Update `extract_resource_strings()` orchestrator to call `extract_dialog_strings()` and `extract_icon_strings()`, combining results with existing VERSIONINFO, STRINGTABLE, and MANIFEST extraction.
    
    Add comprehensive unit tests following the existing test patterns for dialog and icon parsing, including edge cases for malformed data, missing resources, and multiple languages.
    
    ### src/extraction/macho_resources.rs(NEW)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/container/macho.rs(MODIFY)
    - src/types.rs(MODIFY)
    
    Create a new module for Mach-O resource extraction following the pattern established in `src/extraction/pe_resources.rs`.
    
    Implement `extract_plist_strings()` function:
    - Locate the `__TEXT,__info_plist` section from the Mach-O binary using goblin's section enumeration
    - Use the `plist` crate to parse both XML and binary plist formats transparently
    - Extract key-value pairs from the plist dictionary, focusing on string values
    - Target common Info.plist keys: CFBundleIdentifier, CFBundleName, CFBundleDisplayName, CFBundleVersion, CFBundleShortVersionString, NSHumanReadableCopyright, etc.
    - Return `Vec<FoundString>` with `Tag::PlistMetadata` and `Tag::Resource`
    - Set encoding to `Encoding::Utf8` (plists use UTF-8)
    - Assign high scores (8.0-9.0) as plist metadata is high-confidence
    - Handle errors gracefully by returning empty Vec
    
    Implement `extract_framework_strings()` function:
    - Parse Mach-O load commands using goblin's APIs
    - Extract framework paths from LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, and LC_REEXPORT_DYLIB commands
    - Extract framework names from the dylib paths (e.g., "Foundation" from "/System/Library/Frameworks/Foundation.framework/Foundation")
    - Extract version information from dylib structures
    - Return `Vec<FoundString>` with `Tag::Framework` and `Tag::FilePath` tags
    - Preserve @rpath, @executable_path, and @loader_path variables verbatim
    - Assign medium-high scores (7.0-8.0)
    
    Implement `extract_macho_resource_strings()` orchestrator function that combines plist and framework extraction, similar to `extract_resource_strings()` in `src/extraction/pe_resources.rs`.
    
    Add comprehensive unit tests for plist parsing (XML and binary formats), framework path extraction, and error handling.
    
    Add module-level documentation explaining Mach-O resource extraction strategy and usage examples.
    
    ### src/extraction/elf_notes.rs(NEW)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/container/elf.rs(MODIFY)
    - src/types.rs(MODIFY)
    
    Create a new module for ELF note section and attribute extraction following the pattern established in `src/extraction/pe_resources.rs`.
    
    Implement `extract_build_id()` function:
    - Parse ELF using goblin to access section headers and program headers
    - Search for `.note.gnu.build-id` section first (most common location)
    - Fall back to scanning PT_NOTE program headers if section not found
    - Use goblin's `NoteIterator` to parse note entries
    - Look for NT_GNU_BUILD_ID (type 3) with name "GNU"
    - Extract descriptor bytes and format as lowercase hex string
    - Return `Vec<FoundString>` with single entry containing the build ID
    - Tag with `Tag::BuildId` and assign very high score (9.5) as it's a unique identifier
    - Set encoding to `Encoding::Ascii`
    - Handle missing build IDs gracefully by returning empty Vec
    
    Implement `extract_note_sections()` function:
    - Enumerate all `.note*` sections (`.note`, `.note.ABI-tag`, `.note.gnu.build-id`, etc.)
    - Parse note headers (nhdr: namesz, descsz, type) with proper 4-byte alignment
    - Extract note name and descriptor data
    - For known note types (NT_GNU_ABI_TAG, NT_GNU_BUILD_ID, etc.), extract meaningful strings
    - Return `Vec<FoundString>` with `Tag::ElfNote` and `Tag::Resource`
    - Assign medium scores (6.0-7.0) for general note data
    
    Implement `extract_gnu_attributes()` function:
    - Locate `.gnu.attributes` or `.ARM.attributes` sections
    - Parse attribute section format (vendor name, tag-value pairs)
    - Extract human-readable attribute values (compiler flags, ABI details)
    - Return `Vec<FoundString>` with `Tag::GnuAttribute`
    - Assign medium scores (6.0-7.0)
    - Handle architecture-specific attributes gracefully
    
    Implement `extract_elf_metadata_strings()` orchestrator function that combines build ID, note section, and GNU attribute extraction.
    
    Add comprehensive unit tests for note parsing, build ID extraction, attribute parsing, and error handling with malformed data.
    
    Add module-level documentation explaining ELF metadata extraction and the significance of build IDs for binary identification.
    
    ### src/extraction/mod.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Add module declarations for the new extraction modules:
    - `pub mod macho_resources;` for Mach-O plist and framework extraction
    - `pub mod elf_notes;` for ELF note section and build ID extraction
    
    Export the main orchestrator functions from each module:
    - `pub use macho_resources::extract_macho_resource_strings;`
    - `pub use elf_notes::extract_elf_metadata_strings;`
    
    Update the module-level documentation to describe the new extraction capabilities for Mach-O and ELF formats, following the existing pattern that documents PE resource extraction (Phase 1 and Phase 2).
    
    Add usage examples showing how to extract resources from all three binary formats.
    
    ### src/container/macho.rs(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    - src/container/pe.rs
    - src/types.rs(MODIFY)
    
    Integrate Mach-O resource extraction into the container parser's `parse()` method.
    
    In the `parse()` method of `MachoParser`, after extracting sections, imports, and exports, call the new `extract_macho_resource_strings()` function from `src/extraction/macho_resources.rs` to get plist and framework strings.
    
    Store the extracted resource strings in a new field or integrate them into the existing flow. Since `ContainerInfo` currently has a `resources` field that's `Option<Vec<ResourceMetadata>>` (PE-specific), consider whether to:
    1. Add resource string extraction at a higher level in the pipeline, OR
    2. Store Mach-O resource metadata in a format-agnostic way
    
    For consistency with PE implementation, the resource extraction should be called but the strings should be surfaced through the main extraction pipeline rather than stored in ContainerInfo.
    
    Add comments documenting the integration point and noting that Mach-O resource extraction includes plist and framework data.
    
    ### src/container/elf.rs(MODIFY)
    
    References: 
    
    - src/extraction/elf_notes.rs(NEW)
    - src/container/pe.rs
    - src/types.rs(MODIFY)
    
    Integrate ELF note section and build ID extraction into the container parser.
    
    Update the `classify_section()` method to maintain the existing classification of `.note*` sections as `SectionType::StringData` with high weight (9.0), which is already correctly implemented.
    
    Add a comment in the `parse()` method noting that note section parsing and build ID extraction is available via `src/extraction/elf_notes.rs` and should be called by the main extraction pipeline.
    
    No structural changes needed to the parser itself, as the integration point for note extraction should be at the pipeline level, similar to how PE resource extraction works. The container parser's job is to identify and classify sections; the extraction module handles the actual string extraction.
    
    Optionally add a helper method to identify note sections for easy access by the extraction pipeline.
    
    ### Cargo.toml(MODIFY)
    
    Add the `plist` crate dependency for Mach-O Info.plist parsing. Add version `1.7` or latest stable version with default features. This crate handles both XML and binary plist formats transparently.
    
    The dependency should be added to the `[dependencies]` section alongside existing dependencies like `goblin`, `pelite`, `serde`, etc.
    
    No other dependencies are needed as `goblin` already provides ELF note parsing capabilities, and `pelite` can handle dialog resource access (though we need to implement the DLGTEMPLATE parsing ourselves).
    
    ### docs/src/binary-formats.md(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Update the "Enhanced Resource Support" section (lines 419-424) to reflect the newly implemented capabilities.
    
    For PE format section:
    - Move Dialog resources and Icon strings from "Future Enhancements" to implemented features
    - Update the limitations section (lines 305-320) to mark RT_DIALOG and RT_ICON as implemented
    - Add documentation explaining dialog resource extraction (window titles, control text)
    - Add documentation for icon metadata extraction
    
    For Mach-O format section:
    - Add a new "Resource Extraction" subsection documenting plist and framework extraction
    - Explain Info.plist key-value pair extraction with examples (CFBundleIdentifier, CFBundleName, etc.)
    - Document framework bundle extraction from load commands
    - Provide usage examples showing how to extract Mach-O resources
    
    For ELF format section:
    - Add a new "Metadata Extraction" subsection documenting note sections, build IDs, and GNU attributes
    - Explain build ID extraction and its significance for binary identification
    - Document note section parsing for ABI tags and vendor-specific data
    - Explain GNU attribute extraction for compiler flags and ABI details
    - Provide examples of extracted build IDs and note data
    
    Update the "Future Enhancements" section to remove the now-implemented features.
    
    ### tests/integration_pe.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - tests/fixtures/test_binary_with_resources.exe
    
    Add integration tests for the new PE dialog and icon resource extraction.
    
    Create `test_pe_dialog_resource_extraction()` test function:
    - Load a PE fixture that contains RT_DIALOG resources (may need to create new fixture)
    - Call `extract_resources()` and verify Dialog resource metadata is detected
    - Call `extract_resource_strings()` and verify dialog strings are extracted
    - Validate that extracted strings have `Tag::Resource` tag
    - Check that window titles and control text are properly decoded from UTF-16LE
    
    Create `test_pe_icon_resource_extraction()` test function:
    - Load a PE fixture with icon resources
    - Verify icon metadata is detected and extracted
    - Validate proper tagging and scoring
    
    Follow the existing test patterns in this file, particularly the `test_pe_resource_extraction_with_fixture()` test which validates VERSIONINFO and STRINGTABLE extraction.
    
    ### tests/integration_macho.rs(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    - src/container/macho.rs(MODIFY)
    
    Add integration tests for Mach-O resource extraction.
    
    Create `test_macho_plist_extraction()` test function:
    - Load a Mach-O fixture that contains an Info.plist section (may need to create new fixture)
    - Call `extract_macho_resource_strings()` from the new module
    - Verify that plist key-value pairs are extracted as FoundString objects
    - Validate that common keys like CFBundleIdentifier are found
    - Check proper tagging with `Tag::PlistMetadata`
    - Verify UTF-8 encoding is set correctly
    
    Create `test_macho_framework_extraction()` test function:
    - Load a Mach-O binary with framework dependencies
    - Verify framework names and paths are extracted
    - Check that @rpath variables are preserved
    - Validate `Tag::Framework` and `Tag::FilePath` tags are applied
    
    Follow the existing test structure in this file, using the pattern from `test_macho_detection()` and other tests.
    
    ### tests/integration_elf.rs(MODIFY)
    
    References: 
    
    - src/extraction/elf_notes.rs(NEW)
    - src/container/elf.rs(MODIFY)
    - tests/fixtures/test_binary_elf
    
    Add integration tests for ELF note section and build ID extraction.
    
    Create `test_elf_build_id_extraction()` test function:
    - Load an ELF fixture with a build ID (most modern Linux binaries have this)
    - Call `extract_elf_metadata_strings()` from the new module
    - Verify that the build ID is extracted as a hex string
    - Validate `Tag::BuildId` tag is applied
    - Check that the build ID format is correct (typically 20 or 16 hex characters)
    - Verify high score assignment (9.0+)
    
    Create `test_elf_note_section_extraction()` test function:
    - Load an ELF binary with various note sections
    - Verify note data is extracted from `.note.ABI-tag` and other note sections
    - Check proper tagging with `Tag::ElfNote`
    - Validate graceful handling of missing note sections
    
    Create `test_elf_gnu_attributes_extraction()` test function:
    - Load an ELF binary with GNU attributes (if available in fixtures)
    - Verify attribute data is extracted
    - Check `Tag::GnuAttribute` tagging
    
    Follow the existing test patterns in this file, particularly `test_elf_symbol_extraction()` which validates import/export extraction.
    
    ### README.md(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Update the "Development Status" section (lines 166-209) to reflect the newly implemented resource extraction capabilities.
    
    In the "Current Capabilities" subsection:
    - Update the PE Resource Extraction bullet to include Dialog and Icon resources
    - Add a new bullet for Mach-O Resource Extraction listing plist and framework extraction
    - Add a new bullet for ELF Metadata Extraction listing note sections, build IDs, and GNU attributes
    
    Update the feature list (lines 52-67) to mention the enhanced resource support:
    - Add "PE dialog and icon resources" to the format-aware parsing features
    - Add "Mach-O plist and framework extraction" 
    - Add "ELF build IDs and note sections"
    
    In the "Runtime-Specific" feature description (line 44), add examples of the new resource types that are now supported.
    
    ### tests/fixtures/README.md(MODIFY)
    
    Update the fixture documentation to describe the new test binaries needed for dialog, icon, plist, and note section testing.
    
    Add documentation for PE fixtures:
    - Describe how to create a PE binary with RT_DIALOG resources (using resource compiler with .rc file containing DIALOG definitions)
    - Describe how to create a PE binary with RT_ICON resources
    - Document expected dialog strings and icon metadata in the fixtures
    
    Add documentation for Mach-O fixtures:
    - Describe how to create a Mach-O binary with Info.plist embedded
    - Document expected plist keys and values
    - Describe framework dependencies that should be present
    
    Add documentation for ELF fixtures:
    - Note that most modern ELF binaries already have build IDs
    - Document how to verify build ID presence using `readelf -n`
    - Describe expected note sections in test binaries
    
    Provide build instructions or references for regenerating fixtures if needed.

    Developer Humor

    🎭 Three formats walked into a bar...\n> PE said \I've got dialogs!\n> Mach-O said \I've got plists!\n> ELF said \I've got notes!\n> The bartender replied:\n> \Sounds like you all need better\n> resource management! 📦✨\


    Execution Information

    Branch: main
    Commit: 08cd31b

    New Plan

    Observations

    The codebase provides solid foundations: PE resource extraction in pe_resources.rs handles VERSIONINFO, STRINGTABLE, and MANIFEST via pelite; container parsers classify sections and extract imports/exports using goblin; types define extensible enums for tags and resources. ELF notes are classified as StringData but not parsed; Mach-O lacks resource extraction. Architecture supports modular extensions with graceful error handling and consistent FoundString output.

    Approach

    Extend existing PE extraction in pe_resources.rs for dialogs and icons using pelite enumeration and manual DLGTEMPLATE parsing. Create macho_resources.rs for plist (via new plist dependency) and framework extraction from load commands. Create elf_notes.rs for build ID, notes, and GNU attributes using goblin APIs. Update types with new tags; integrate extractors into container parsers; add tests and documentation following established patterns.

    Reasoning

    I examined the repository structure, reviewed the PE resource extraction implementation, analyzed type definitions, inspected container parsers for ELF and Mach-O, and researched parsing requirements for dialogs, plists, and ELF notes using available libraries.

    Proposed File Changes

    📄 src/types.rs (MODIFY) 🔗

    References

    Extend the Tag enum to include new variants for the enhanced resource types: UiString for dialog and UI element strings, Plist for Mach-O property list entries, BuildMetadata for ELF build IDs and ABI tags, and CompilerInfo for GNU attribute data. This maintains consistency with existing tags like Version, Manifest, and Resource while supporting serde serialization.

    Extend the ResourceType enum to add variants for the new PE resource types: Dialog for RT_DIALOG resources and Icon for RT_ICON/RT_GROUP_ICON resources, following the pattern of VersionInfo, StringTable, and Manifest.

    📄 src/extraction/pe_resources.rs (MODIFY) 🔗

    References

    Add constants for new resource types: RT_DIALOG (5) and RT_ICON (3), RT_GROUP_ICON (14) following existing RT_STRING and RT_MANIFEST.

    Implement detect_dialog_resources() to traverse the resource tree for RT_DIALOG entries, returning Vec<ResourceMetadata> with Dialog variant, similar to detect_version_info().

    Implement detect_icon_resources() to find RT_ICON and RT_GROUP_ICON, collecting metadata.

    Create extract_dialog_strings() to parse DLGTEMPLATE/DLGTEMPLATEEX: check for extended format signature, extract window title and control texts as UTF-16LE strings with alignment handling, return Vec<FoundString> tagged Tag::Resource and Tag::UiString with scores 8.0-9.0.

    Create extract_icon_metadata() to parse ICONDIR for group names and descriptions, returning tagged FoundString entries.

    Update enumerate_resources() to include calls to new detection functions.

    Update extract_resource_strings() to invoke new extraction functions and aggregate results.

    Add unit tests for dialog/icon parsing, malformed data, and multi-language support, mirroring existing tests.

    📄 src/extraction/macho_resources.rs (NEW) 🔗

    References

    Create new module following pe_resources.rs pattern.

    Implement extract_plist_strings(): use goblin to locate __TEXT,__info_plist section, parse with plist crate (handles XML/binary), extract string values from keys like CFBundleIdentifier, CFBundleName, return Vec<FoundString> with Tag::Plist and Tag::Resource, UTF-8 encoding, scores 8.5-9.5.

    Implement extract_framework_metadata(): parse load commands (LC_LOAD_DYLIB etc.) via goblin, extract framework paths/names/versions, preserve @rpath etc., return tagged FoundString with Tag::Resource and scores 7.0-8.0.

    Create extract_macho_resources() orchestrator combining both, returning aggregated Vec<FoundString>.

    Add module docs and unit tests for plist parsing (various formats), framework extraction, error cases.

    📄 src/extraction/elf_notes.rs (NEW) 🔗

    References

    Create new module following pe_resources.rs pattern.

    Implement extract_build_id(): scan .note.gnu.build-id section or PT_NOTE headers via goblin, parse NT_GNU_BUILD_ID note, format descriptor as hex string, return single FoundString with Tag::BuildMetadata, ASCII encoding, score 9.5.

    Implement extract_elf_notes(): enumerate .note* sections, parse note headers (namesz/descsz/type), extract strings from known types (ABI-tag etc.), return Vec<FoundString> with Tag::BuildMetadata and scores 7.0-8.0.

    Implement extract_gnu_attributes(): parse .gnu.attributes section, extract compiler flags/ABI info as strings, return tagged FoundString with Tag::CompilerInfo, scores 6.5-7.5.

    Create extract_elf_metadata() orchestrator aggregating all, returning Vec<FoundString>.

    Add module docs and unit tests for build ID extraction, note parsing, attributes, malformed sections.

    📄 src/extraction/mod.rs (MODIFY) 🔗

    References

    Declare new modules: pub mod macho_resources; and pub mod elf_notes;.

    Re-export orchestrator functions: pub use macho_resources::extract_macho_resources; and pub use elf_notes::extract_elf_metadata;.

    Update module docs to describe Phase 3 enhancements, including PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs, with usage examples for all formats.

    📄 src/container/macho.rs (MODIFY) 🔗

    References

    In MachoParser::parse(), after section/imports/exports extraction, call extraction::extract_macho_resources(data) to get resource strings. Since ContainerInfo has PE-specific resources, note that Mach-O resources are string-focused and integrated via the main pipeline; add comment on this design choice for format-agnostic string extraction.

    📄 src/container/elf.rs (MODIFY) 🔗

    References

    In ElfParser::parse(), maintain .note* classification as StringData (weight 9.0). Add comment noting ELF metadata extraction via extraction::extract_elf_metadata() for the pipeline. No structural changes needed, as extraction is modular.

    📄 src/lib.rs (MODIFY) 🔗

    References

    In the extraction pipeline integration (if present) or via public API, ensure calls to format-specific extractors post-container parsing. Update crate docs to highlight Phase 3: multi-format resource extraction with examples combining PE/Mach-O/ELF strings.

    📄 Cargo.toml (MODIFY) 🔗

    Add plist = "1.7" to [dependencies] for Mach-O plist parsing, compatible with existing crates like goblin and pelite.

    📄 README.md (MODIFY) 🔗

    References

    Update 'Current Implementation Status' to include Phase 3 features: PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs. Add usage example for multi-format extraction. Expand 'PE Resource String Extraction' to mention new types.

    📄 docs/src/binary-formats.md (MODIFY) 🔗

    References

    Add sections for Mach-O and ELF resource extraction: describe plist/framework parsing, note/build ID extraction. Update PE section to include dialogs/icons. Remove from 'Future Enhancements' now-implemented items. Include examples and references.

    📄 tests/integration_pe.rs (MODIFY) 🔗

    References

    Add tests: test_pe_dialog_extraction() verifying DLGTEMPLATE strings from fixture, test_pe_icon_extraction() for metadata. Use existing fixture or note new ones; assert tags, scores, UTF-16LE decoding.

    📄 tests/integration_macho.rs (MODIFY) 🔗

    References

    Add test_macho_plist_extraction(): load fixture, verify key-value strings, tags. Add test_macho_framework_extraction(): check paths/versions from load commands. Follow existing Mach-O test patterns.

    📄 tests/integration_elf.rs (MODIFY) 🔗

    References

    Add test_elf_build_id_extraction(): verify hex string from note, high score. Add test_elf_notes_extraction(): parse various notes. Add test_gnu_attributes_extraction(): check compiler info. Use ELF fixtures with notes.

    Import In IDE

    VSCode Icon Cursor Icon Windsurf Icon

    🤖 Prompt for AI Agents
    I have created the following plan after thorough exploration and analysis of the codebase. Follow the below plan verbatim. Trust the files and references. Do not re-verify what's written in the plan. Explore only when absolutely necessary. First implement all the proposed file changes and then I'll review all the changes together at the end.
    
    ### Observations
    
    The codebase provides solid foundations: PE resource extraction in `pe_resources.rs` handles VERSIONINFO, STRINGTABLE, and MANIFEST via pelite; container parsers classify sections and extract imports/exports using goblin; types define extensible enums for tags and resources. ELF notes are classified as StringData but not parsed; Mach-O lacks resource extraction. Architecture supports modular extensions with graceful error handling and consistent `FoundString` output.
    
    ### Approach
    
    Extend existing PE extraction in `pe_resources.rs` for dialogs and icons using pelite enumeration and manual DLGTEMPLATE parsing. Create `macho_resources.rs` for plist (via new `plist` dependency) and framework extraction from load commands. Create `elf_notes.rs` for build ID, notes, and GNU attributes using goblin APIs. Update types with new tags; integrate extractors into container parsers; add tests and documentation following established patterns.
    
    ### Reasoning
    
    I examined the repository structure, reviewed the PE resource extraction implementation, analyzed type definitions, inspected container parsers for ELF and Mach-O, and researched parsing requirements for dialogs, plists, and ELF notes using available libraries.
    
    ## Proposed File Changes
    
    ### src/types.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    
    Extend the `Tag` enum to include new variants for the enhanced resource types: `UiString` for dialog and UI element strings, `Plist` for Mach-O property list entries, `BuildMetadata` for ELF build IDs and ABI tags, and `CompilerInfo` for GNU attribute data. This maintains consistency with existing tags like `Version`, `Manifest`, and `Resource` while supporting serde serialization.
    
    Extend the `ResourceType` enum to add variants for the new PE resource types: `Dialog` for RT_DIALOG resources and `Icon` for RT_ICON/RT_GROUP_ICON resources, following the pattern of `VersionInfo`, `StringTable`, and `Manifest`.
    
    ### src/extraction/pe_resources.rs(MODIFY)
    
    References: 
    
    - src/types.rs(MODIFY)
    
    Add constants for new resource types: `RT_DIALOG` (5) and `RT_ICON` (3), `RT_GROUP_ICON` (14) following existing `RT_STRING` and `RT_MANIFEST`.
    
    Implement `detect_dialog_resources()` to traverse the resource tree for RT_DIALOG entries, returning `Vec<ResourceMetadata>` with `Dialog` variant, similar to `detect_version_info()`.
    
    Implement `detect_icon_resources()` to find RT_ICON and RT_GROUP_ICON, collecting metadata.
    
    Create `extract_dialog_strings()` to parse DLGTEMPLATE/DLGTEMPLATEEX: check for extended format signature, extract window title and control texts as UTF-16LE strings with alignment handling, return `Vec<FoundString>` tagged `Tag::Resource` and `Tag::UiString` with scores 8.0-9.0.
    
    Create `extract_icon_metadata()` to parse ICONDIR for group names and descriptions, returning tagged `FoundString` entries.
    
    Update `enumerate_resources()` to include calls to new detection functions.
    
    Update `extract_resource_strings()` to invoke new extraction functions and aggregate results.
    
    Add unit tests for dialog/icon parsing, malformed data, and multi-language support, mirroring existing tests.
    
    ### src/extraction/macho_resources.rs(NEW)
    
    References: 
    
    - src/container/macho.rs(MODIFY)
    - src/types.rs(MODIFY)
    
    Create new module following `pe_resources.rs` pattern.
    
    Implement `extract_plist_strings()`: use goblin to locate `__TEXT,__info_plist` section, parse with `plist` crate (handles XML/binary), extract string values from keys like CFBundleIdentifier, CFBundleName, return `Vec<FoundString>` with `Tag::Plist` and `Tag::Resource`, UTF-8 encoding, scores 8.5-9.5.
    
    Implement `extract_framework_metadata()`: parse load commands (LC_LOAD_DYLIB etc.) via goblin, extract framework paths/names/versions, preserve @rpath etc., return tagged `FoundString` with `Tag::Resource` and scores 7.0-8.0.
    
    Create `extract_macho_resources()` orchestrator combining both, returning aggregated `Vec<FoundString>`.
    
    Add module docs and unit tests for plist parsing (various formats), framework extraction, error cases.
    
    ### src/extraction/elf_notes.rs(NEW)
    
    References: 
    
    - src/container/elf.rs(MODIFY)
    - src/types.rs(MODIFY)
    
    Create new module following `pe_resources.rs` pattern.
    
    Implement `extract_build_id()`: scan `.note.gnu.build-id` section or PT_NOTE headers via goblin, parse NT_GNU_BUILD_ID note, format descriptor as hex string, return single `FoundString` with `Tag::BuildMetadata`, ASCII encoding, score 9.5.
    
    Implement `extract_elf_notes()`: enumerate `.note*` sections, parse note headers (namesz/descsz/type), extract strings from known types (ABI-tag etc.), return `Vec<FoundString>` with `Tag::BuildMetadata` and scores 7.0-8.0.
    
    Implement `extract_gnu_attributes()`: parse `.gnu.attributes` section, extract compiler flags/ABI info as strings, return tagged `FoundString` with `Tag::CompilerInfo`, scores 6.5-7.5.
    
    Create `extract_elf_metadata()` orchestrator aggregating all, returning `Vec<FoundString>`.
    
    Add module docs and unit tests for build ID extraction, note parsing, attributes, malformed sections.
    
    ### src/extraction/mod.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Declare new modules: `pub mod macho_resources;` and `pub mod elf_notes;`.
    
    Re-export orchestrator functions: `pub use macho_resources::extract_macho_resources;` and `pub use elf_notes::extract_elf_metadata;`.
    
    Update module docs to describe Phase 3 enhancements, including PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs, with usage examples for all formats.
    
    ### src/container/macho.rs(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    - src/lib.rs(MODIFY)
    
    In `MachoParser::parse()`, after section/imports/exports extraction, call `extraction::extract_macho_resources(data)` to get resource strings. Since `ContainerInfo` has PE-specific `resources`, note that Mach-O resources are string-focused and integrated via the main pipeline; add comment on this design choice for format-agnostic string extraction.
    
    ### src/container/elf.rs(MODIFY)
    
    References: 
    
    - src/extraction/elf_notes.rs(NEW)
    
    In `ElfParser::parse()`, maintain `.note*` classification as `StringData` (weight 9.0). Add comment noting ELF metadata extraction via `extraction::extract_elf_metadata()` for the pipeline. No structural changes needed, as extraction is modular.
    
    ### src/lib.rs(MODIFY)
    
    References: 
    
    - src/extraction/mod.rs(MODIFY)
    
    In the extraction pipeline integration (if present) or via public API, ensure calls to format-specific extractors post-container parsing. Update crate docs to highlight Phase 3: multi-format resource extraction with examples combining PE/Mach-O/ELF strings.
    
    ### Cargo.toml(MODIFY)
    
    Add `plist = "1.7"` to `[dependencies]` for Mach-O plist parsing, compatible with existing crates like goblin and pelite.
    
    ### README.md(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    
    Update 'Current Implementation Status' to include Phase 3 features: PE dialogs/icons, Mach-O plists/frameworks, ELF notes/build IDs. Add usage example for multi-format extraction. Expand 'PE Resource String Extraction' to mention new types.
    
    ### docs/src/binary-formats.md(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    - src/extraction/elf_notes.rs(NEW)
    
    Add sections for Mach-O and ELF resource extraction: describe plist/framework parsing, note/build ID extraction. Update PE section to include dialogs/icons. Remove from 'Future Enhancements' now-implemented items. Include examples and references.
    
    ### tests/integration_pe.rs(MODIFY)
    
    References: 
    
    - src/extraction/pe_resources.rs(MODIFY)
    
    Add tests: `test_pe_dialog_extraction()` verifying DLGTEMPLATE strings from fixture, `test_pe_icon_extraction()` for metadata. Use existing fixture or note new ones; assert tags, scores, UTF-16LE decoding.
    
    ### tests/integration_macho.rs(MODIFY)
    
    References: 
    
    - src/extraction/macho_resources.rs(NEW)
    
    Add `test_macho_plist_extraction()`: load fixture, verify key-value strings, tags. Add `test_macho_framework_extraction()`: check paths/versions from load commands. Follow existing Mach-O test patterns.
    
    ### tests/integration_elf.rs(MODIFY)
    
    References: 
    
    - src/extraction/elf_notes.rs(NEW)
    
    Add `test_elf_build_id_extraction()`: verify hex string from note, high score. Add `test_elf_notes_extraction()`: parse various notes. Add `test_gnu_attributes_extraction()`: check compiler info. Use ELF fixtures with notes.

    Developer Humor

    Why did the binary go to therapy?\n> It had too many unresolved resources!\n> Now with Phase 3, PE dialogs, Mach-O plists,\n> and ELF notes are all unpacked. 🎉\n> No more string anxiety! 🔍


    Execution Information

    Branch: main
    Commit: 08cd31b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:analyzerBinary analyzer functionalityenhancementNew feature or requestepicLarge feature or initiative spanning multiple taskslang:rustRust implementationpriority:mediumMedium priority task

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions