2026-01-11 16:08:46 -05:00
|
|
|
type rawfile ui("Raw File")
|
2026-01-01 22:18:40 -05:00
|
|
|
{
|
2026-01-11 12:09:57 -05:00
|
|
|
const PTR_INLINE = -1;
|
2026-01-01 22:18:40 -05:00
|
|
|
|
2026-01-11 16:08:46 -05:00
|
|
|
i32 name_ptr ui("Name Ptr");
|
|
|
|
|
i32 len ui("Length");
|
|
|
|
|
i32 buffer_ptr ui("Buffer Ptr");
|
2026-01-11 12:09:57 -05:00
|
|
|
|
|
|
|
|
// Inline data
|
2026-01-11 16:08:46 -05:00
|
|
|
if (name_ptr == PTR_INLINE) {
|
|
|
|
|
name = cstring() ui("Name");
|
|
|
|
|
set_name(name);
|
|
|
|
|
}
|
2026-01-01 22:18:40 -05:00
|
|
|
|
2026-01-07 16:36:40 -05:00
|
|
|
// Data buffer (if inline) - read len + 1 bytes for null terminator
|
2026-01-11 12:09:57 -05:00
|
|
|
if (buffer_ptr == PTR_INLINE && len > 0) {
|
2026-01-11 16:08:46 -05:00
|
|
|
raw_data = read(len + 1) ui("Raw Data");
|
2026-01-11 12:09:57 -05:00
|
|
|
|
|
|
|
|
set_viewer("text");
|
|
|
|
|
set_text(ascii(raw_data));
|
2026-01-01 22:18:40 -05:00
|
|
|
}
|
|
|
|
|
}
|