From 043b3d936ee87847ef7c75e1f83274066996cf0d Mon Sep 17 00:00:00 2001 From: Riccardo Mori Date: Mon, 29 Apr 2024 17:50:09 +0200 Subject: [PATCH] [IDA] Export the header segment. Fix #29 --- src/Segment.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Segment.cpp b/src/Segment.cpp index 4ca2abd8..75b58387 100644 --- a/src/Segment.cpp +++ b/src/Segment.cpp @@ -85,7 +85,10 @@ int ExportSegments(quokka::Quokka* proto) { segment_t* seg = get_first_seg(); while (seg != nullptr) { - if (is_visible_segm(seg) && not is_ephemeral_segm(seg->start_ea)) { + // A HEADER segment is considered ephemeral even though instructions might + // reference it. See https://github.com/quarkslab/quokka/issues/29 + if (seg->is_header_segm() || + (is_visible_segm(seg) && !is_ephemeral_segm(seg->start_ea))) { segments.emplace_back(seg); }