3 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/ByteOrder.h>
17 rose_addr_t offset{header->get_offset()};
20 size_t count = header->read_content(offset, &length,
sizeof(length));
21 if (count !=
sizeof(length)) {
23 ROSE_ASSERT(
false &&
"Error reading JVM bytes array length");
25 length = Rose::BinaryAnalysis::ByteOrder::beToHost(length);
27 header->set_offset(offset);
30 bytes =
new char[length];
33 count = header->read_content(offset, bytes, length);
34 if (count != length) {
36 ROSE_ASSERT(
false &&
"Error reading JVM bytes array");
39 header->set_offset(offset);
48 rose_addr_t offset{header->get_offset()};
50 size_t count = header->read_content(offset, &value,
sizeof(T));
51 if (count !=
sizeof(T)) {
53 ROSE_ASSERT(
false &&
"Error reading JVM value");
55 value = Rose::BinaryAnalysis::ByteOrder::beToHost(value);
56 if (advanceOffset) header->set_offset(offset + count);
61 void writeValue(std::ostream& os, T value)
63 Rose::BinaryAnalysis::ByteOrder::hostToBe(value, &value);
64 os.write(reinterpret_cast<const char*>(&value),
sizeof value);
Represents an JVM constant pool.
SgAsmGenericHeader *const & get_header() const
Property: File header that owns this section.