Split out of #17. With the len() crash fixed, RelView creates its segment but still ends up with 0 functions:
Analysis error: Attempting to add function not backed by file: 0x37
init() calls add_auto_segment(addr, size, 0, 0, ...) — data length 0, so the segment is not backed by the file and Binary Ninja will not place functions in it.
The .rel format is textual, so the code bytes come from T records rather than a contiguous file region. Backing the segment with the file directly (add_auto_segment(addr, size, 0, size, ...)) is not a fix: self.write() then modifies the parent view, and the next load attempt dies with UnicodeDecodeError when re-parsing what is supposed to be text.
Split out of #17. With the
len()crash fixed,RelViewcreates its segment but still ends up with 0 functions:init()callsadd_auto_segment(addr, size, 0, 0, ...)— data length 0, so the segment is not backed by the file and Binary Ninja will not place functions in it.The
.relformat is textual, so the code bytes come fromTrecords rather than a contiguous file region. Backing the segment with the file directly (add_auto_segment(addr, size, 0, size, ...)) is not a fix:self.write()then modifies the parent view, and the next load attempt dies withUnicodeDecodeErrorwhen re-parsing what is supposed to be text.