INNER CODE UNIT · Python

parse_entropy_output

FuzzingLabs/mcp-security-hub · binary-analysis/binwalk-mcp/server.py:127

def parse_entropy_output(output: str) -> list[EntropyBlock]:
    """Parse binwalk entropy analysis output."""
    entropy_data = []

    for line in output.strip().split("\n"):
        if "Rising entropy edge" in line or "Falling entropy edge" in line:
            parts = line.split()
            try:
                offset = int(parts[0])
                entropy_data.append(EntropyBlock(
                    offset=offset,
                    entropy=0.0,
                    description=line,
                ))
            except (ValueError, IndexError):
                continue

    return entropy_data

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…