Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
The decoder for the .sla file format. More...
#include <slaformat.hh>
Public Member Functions | |
FormatDecode (const AddrSpaceManager *spcManager) | |
Initialize the decoder. | |
virtual | ~FormatDecode (void) |
Destructor. | |
virtual void | ingestStream (istream &s) |
Prepare to decode a given stream. | |
![]() | |
PackedDecode (const AddrSpaceManager *spcManager) | |
Constructor. | |
virtual uint4 | peekElement (void) |
Peek at the next child element of the current parent, without traversing in (opening) it. | |
virtual uint4 | openElement (void) |
Open (traverse into) the next child element of the current parent. | |
virtual uint4 | openElement (const ElementId &elemId) |
Open (traverse into) the next child element, which must be of a specific type. | |
virtual void | closeElement (uint4 id) |
Close the current element. | |
virtual void | closeElementSkipping (uint4 id) |
Close the current element, skipping any child elements that have not yet been parsed. | |
virtual void | rewindAttributes (void) |
Reset attribute traversal for the current element. | |
virtual uint4 | getNextAttributeId (void) |
Get the next attribute id for the current element. | |
virtual uint4 | getIndexedAttributeId (const AttributeId &attribId) |
Get the id for the (current) attribute, assuming it is indexed. | |
virtual bool | readBool (void) |
Parse the current attribute as a boolean value. | |
virtual bool | readBool (const AttributeId &attribId) |
Find and parse a specific attribute in the current element as a boolean value. | |
virtual intb | readSignedInteger (void) |
Parse the current attribute as a signed integer value. | |
virtual intb | readSignedInteger (const AttributeId &attribId) |
Find and parse a specific attribute in the current element as a signed integer. | |
virtual intb | readSignedIntegerExpectString (const string &expect, intb expectval) |
Parse the current attribute as either a signed integer value or a string. | |
virtual intb | readSignedIntegerExpectString (const AttributeId &attribId, const string &expect, intb expectval) |
Find and parse a specific attribute in the current element as either a signed integer or a string. | |
virtual uintb | readUnsignedInteger (void) |
Parse the current attribute as an unsigned integer value. | |
virtual uintb | readUnsignedInteger (const AttributeId &attribId) |
Find and parse a specific attribute in the current element as an unsigned integer. | |
virtual string | readString (void) |
Parse the current attribute as a string. | |
virtual string | readString (const AttributeId &attribId) |
Find the specific attribute in the current element and return it as a string. | |
virtual AddrSpace * | readSpace (void) |
Parse the current attribute as an address space. | |
virtual AddrSpace * | readSpace (const AttributeId &attribId) |
Find the specific attribute in the current element and return it as an address space. | |
virtual OpCode | readOpcode (void) |
Parse the current attribute as a p-code OpCode. | |
virtual OpCode | readOpcode (AttributeId &attribId) |
Find the specific attribute in the current element and return it as an OpCode. | |
![]() | |
Decoder (const AddrSpaceManager *spc) | |
Base constructor. | |
const AddrSpaceManager * | getAddrSpaceManager (void) const |
Get the manager used for address space decoding. | |
virtual | ~Decoder (void) |
Destructor. | |
void | skipElement (void) |
Skip parsing of the next element. | |
Private Attributes | |
uint1 * | inBuffer |
The input buffer. | |
Static Private Attributes | |
static const int4 | IN_BUFFER_SIZE = 4096 |
The size of the input buffer. | |
Additional Inherited Members | |
![]() | |
static const int4 | BUFFER_SIZE = 1024 |
The size, in bytes, of a single cached chunk of the input stream. | |
![]() | |
uint1 * | allocateNextInputBuffer (int4 pad) |
Allocate the next chunk of space in the input stream. | |
void | endIngest (int4 bufPos) |
Finish set up for reading input stream. | |
![]() | |
const AddrSpaceManager * | spcManager |
Manager for decoding address space attributes. | |
The decoder for the .sla file format.
This verifies the .sla file header, does decompression, and decodes the raw data elements/attributes.
ghidra::sla::FormatDecode::FormatDecode | ( | const AddrSpaceManager * | spcManager | ) |
Initialize the decoder.
spcManager | is the (uninitialized) manager that will hold decoded address spaces |
References IN_BUFFER_SIZE, and inBuffer.
|
virtual |
Prepare to decode a given stream.
Called once before any decoding. Currently this is assumed to make an internal copy of the stream data, i.e. the input stream is cleared before any decoding takes place.
s | is the given input stream to be decode |
Reimplemented from ghidra::PackedDecode.
References ghidra::PackedDecode::allocateNextInputBuffer(), ghidra::PackedDecode::BUFFER_SIZE, ghidra::PackedDecode::endIngest(), IN_BUFFER_SIZE, inBuffer, ghidra::Decompress::inflate(), ghidra::Decompress::input(), and ghidra::Decompress::isFinished().
Referenced by ghidra::Sleigh::initialize().