mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
LibELF: Add Image::Section::wrapping_byte_buffer
This can be used to get a ByteBuffer that wrapps the section's data.
This commit is contained in:
parent
dca0483e9a
commit
42b61cfe2c
1 changed files with 2 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/String.h>
|
||||
|
@ -131,6 +132,7 @@ public:
|
|||
unsigned entry_count() const { return !entry_size() ? 0 : size() / entry_size(); }
|
||||
u32 address() const { return m_section_header.sh_addr; }
|
||||
const char* raw_data() const { return m_image.raw_data(m_section_header.sh_offset); }
|
||||
ByteBuffer wrapping_byte_buffer() { return ByteBuffer::wrap(reinterpret_cast<const u8*>(raw_data()), size()); }
|
||||
bool is_undefined() const { return m_section_index == SHN_UNDEF; }
|
||||
const RelocationSection relocations() const;
|
||||
u32 flags() const { return m_section_header.sh_flags; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue