java.lang.Object
com.pnfsoftware.jeb.core.units.code.wincommon.Winunp

public class Winunp extends Object
Bytes unpacking and primitives reading routines with quirks and specificities related to Microsoft file formats. All provided buffers are assumed to be set little-endian.
  • Constructor Details

    • Winunp

      public Winunp()
  • Method Details

    • getSINT8

      public static final int getSINT8(ByteBuffer b)
      Read a signed 8-bit integer.
      Parameters:
      b - buffer
      Returns:
      signed value
    • getSINT16

      public static final int getSINT16(ByteBuffer b)
      Read a signed 16-bit integer.
      Parameters:
      b - buffer
      Returns:
      signed value
    • getSINT32

      public static final long getSINT32(ByteBuffer b)
      Read a signed 32-bit integer.
      Parameters:
      b - buffer
      Returns:
      signed value
    • getUINT8

      public static final int getUINT8(ByteBuffer b)
      Read an unsigned 8-bit integer. The value -1 is sign-extended.
      Parameters:
      b - buffer
      Returns:
      unsigned value, or -1
    • getUINT16

      public static final int getUINT16(ByteBuffer b)
      Read an unsigned 16-bit integer. The value -1 is sign-extended.
      Parameters:
      b - buffer
      Returns:
      unsigned value, or -1
    • getUINT32

      public static final long getUINT32(ByteBuffer b)
      Read an unsigned 32-bit integer. The value -1 is sign-extended.
      Parameters:
      b - buffer
      Returns:
      unsigned value, or -1
    • parseCString

      public static byte[] parseCString(ByteBuffer b)
      Read until a 0-byte is encountered. Will throw if EOS is reached before a 0 is encountered.
      Parameters:
      b - buffer
      Returns:
      the bytes read, excluding the trailing zero