public class

RegisterUtil

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.processor.arch.RegisterUtil

Class Overview

Utility methods for IRegisterBank and IRegisterData, including methods to create standard register ids.

Summary

Public Constructors
RegisterUtil()
Public Methods
static String byteArrayToHex(Endianness endianness, byte[] data, int pos, int end)
static String byteArrayToHex(Endianness endianness, byte[] data)
static long createPureRegisterId(int index, int grp)
Create a pure register id, i.e.
static long createRegisterId(int index, int grp, int bitsize, int bitstart)
Create a standard register id (full or slice).
static long createRegisterId(int index, int grp, int bitsize)
Create a standard register id (full or slice).
static long createRegisterIdFromPureId(long pure, int bitsize, int bitstart)
static IRegisterBank getBank(ProcessorType proctype)
Convenience method to retrieve a register bank used by a well-known processor type.
static RegisterDescriptionEntry getEntryByName(IRegisterBank bank, String name)
static RegisterDescriptionEntry getEntryByName(IRegisterData bank, String name)
static RegisterDescriptionEntry getEntryByType(IRegisterBank bank, RegisterType type)
static RegisterDescriptionEntry getEntryByType(IRegisterData bank, RegisterType type)
static long getPureId(long id)
static int getRegisterBitsize(long id)
static int getRegisterBitstart(long id)
static int getRegisterGroup(long id)
static int getRegisterIndex(long id)
static byte[] getValueByName(IRegisterData bank, String name)
static Long getValueByNameAsLong(IRegisterData bank, String name)
static boolean isPureId(long id)
static boolean setValueByName(IRegisterData bank, String name, byte[] bytes)
static boolean setValueByNameAsLong(IRegisterData bank, String name, long value)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RegisterUtil ()

Public Methods

public static String byteArrayToHex (Endianness endianness, byte[] data, int pos, int end)

public static String byteArrayToHex (Endianness endianness, byte[] data)

public static long createPureRegisterId (int index, int grp)

Create a pure register id, i.e. an id always representing a full register, without indicators such as bit size or bit start.

public static long createRegisterId (int index, int grp, int bitsize, int bitstart)

Create a standard register id (full or slice).

public static long createRegisterId (int index, int grp, int bitsize)

Create a standard register id (full or slice).

public static long createRegisterIdFromPureId (long pure, int bitsize, int bitstart)

public static IRegisterBank getBank (ProcessorType proctype)

Convenience method to retrieve a register bank used by a well-known processor type.

It is recommended to use RegisterBankService directly.

Parameters
proctype a processor type
Returns
  • null if not found

public static RegisterDescriptionEntry getEntryByName (IRegisterBank bank, String name)

public static RegisterDescriptionEntry getEntryByName (IRegisterData bank, String name)

public static RegisterDescriptionEntry getEntryByType (IRegisterBank bank, RegisterType type)

public static RegisterDescriptionEntry getEntryByType (IRegisterData bank, RegisterType type)

public static long getPureId (long id)

public static int getRegisterBitsize (long id)

public static int getRegisterBitstart (long id)

public static int getRegisterGroup (long id)

public static int getRegisterIndex (long id)

public static byte[] getValueByName (IRegisterData bank, String name)

public static Long getValueByNameAsLong (IRegisterData bank, String name)

public static boolean isPureId (long id)

public static boolean setValueByName (IRegisterData bank, String name, byte[] bytes)

public static boolean setValueByNameAsLong (IRegisterData bank, String name, long value)