Package ghidra.util
Interface GhidraDataConverter
- All Superinterfaces:
DataConverter
,Serializable
- All Known Implementing Classes:
GhidraBigEndianDataConverter
,GhidraLittleEndianDataConverter
-
Method Summary
Modifier and TypeMethodDescriptiongetBigInteger
(MemBuffer buf, int offset, int size, boolean signed) Generate a BigInteger value by invoking buf.getBytes at the specified offset.static GhidraDataConverter
getInstance
(boolean isBigEndian) Returns the correct GhidraDataConverter static instance for the requested endian-ness.int
Generate a int value by invoking buf.getBytes at the specified offset.long
Generate a long value by invoking buf.getBytes at the specified offset.short
Generate a short value by invoking buf.getBytes at the specified offset.Methods inherited from interface ghidra.util.DataConverter
getBigInteger, getBigInteger, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getInt, getInt, getLong, getLong, getShort, getShort, getSignedValue, getSignedValue, getValue, getValue, isBigEndian, putBigInteger, putBigInteger, putInt, putInt, putLong, putLong, putShort, putShort, putValue
-
Method Details
-
getInstance
Returns the correct GhidraDataConverter static instance for the requested endian-ness.- Parameters:
isBigEndian
- boolean flag, true means big endian- Returns:
- static GhidraDataConverter instance
-
getShort
Generate a short value by invoking buf.getBytes at the specified offset.- Parameters:
buf
- MemBuffer source of bytesoffset
- offset in mem buffer to read- Returns:
- short value
- Throws:
MemoryAccessException
- if failed to read 2-bytes at the specified offset
-
getInt
Generate a int value by invoking buf.getBytes at the specified offset.- Parameters:
buf
- MemBuffer source of bytesoffset
- offset in mem buffer to read- Returns:
- int value
- Throws:
MemoryAccessException
- if failed to read 4-bytes at the specified offset
-
getLong
Generate a long value by invoking buf.getBytes at the specified offset.- Parameters:
buf
- MemBuffer source of bytesoffset
- offset in mem buffer to read- Returns:
- long value
- Throws:
MemoryAccessException
- if failed to read 8-bytes at the specified offset
-
getBigInteger
BigInteger getBigInteger(MemBuffer buf, int offset, int size, boolean signed) throws MemoryAccessException Generate a BigInteger value by invoking buf.getBytes at the specified offset.- Parameters:
buf
- MemBuffer source of bytesoffset
- offset in mem buffer to readsize
- number of bytessigned
- boolean flag- Returns:
- BigInteger value
- Throws:
MemoryAccessException
- if failed to read specified number of bytes at the specified offset
-