// Copyright (c) StellaOps. All rights reserved.
// Licensed under BUSL-1.1. See LICENSE in the project root.
namespace StellaOps.Scanner.ChangeTrace.ByteDiff;
///
/// Analyzes binary format sections (ELF, PE, Mach-O).
///
public interface ISectionAnalyzer
{
///
/// Extract section information from binary.
///
Task> AnalyzeAsync(byte[] binary, CancellationToken ct = default);
}
///
/// Information about a binary section.
///
/// Section name (e.g., ".text", ".data").
/// Offset in bytes from start of file.
/// Size in bytes.
/// Type of section.
public sealed record SectionInfo(
string Name,
long Offset,
long Size,
SectionType Type);
///
/// Type of binary section.
///
public enum SectionType
{
///
/// Code section (.text).
///
Code,
///
/// Data section (.data, .rodata).
///
Data,
///
/// Uninitialized data section (.bss).
///
Bss,
///
/// Debug information (.debug_*).
///
Debug,
///
/// Other section type.
///
Other
}