14 if (
reg->big_endian) {
31 if (item->offset % 8) {
33 if (item->size == 1) {
38 RZ_LOG_ERROR(
"rz_reg_set_bv() for non-byte-aligned regs not supported yet.\n");
42 int boff = item->offset / 8;
43 if (
reg->big_endian) {
75 eprintf(
"rz_reg_get_value: null or oob arena for current regset\n");
84 eprintf(
"rz_reg_get_value: null or oob arena for current regset\n");
93 eprintf(
"rz_reg_get_value: null or oob arena for current regset\n");
104 eprintf(
"rz_reg_get_value: null or oob arena for current regset\n");
106 ret =
val->v256.Low.Low;
116 if (!
reg || !item || item->
offset == -1) {
121 if (!regset->
arena) {
124 switch (item->
size) {
131 (1 << (item->
offset % 8)))
159 eprintf(
"rz_reg_get_value: 32bit oob read %d\n",
off);
189 bool unset_src =
false;
202 switch (item->
size) {
209 if (
reg->big_endian) {
216 if (
reg->big_endian) {
223 if (
reg->big_endian) {
259 if (!unset_src && fits_in_arena) {
316 eprintf(
"Does not support pack bits > 64\n");
320 const int packbytes = packbits / 8;
321 const int packmod = packbits % 8;
323 eprintf(
"Invalid bit size for packet register\n");
326 if ((packidx + 1) * packbits > item->
size) {
327 eprintf(
"Packed index is beyond the register size\n");
331 if (!regset->
arena) {
335 off += (packidx * packbytes);
338 for (
i = packbytes - 1;
i >= 0;
i--) {
354 eprintf(
"Does not support pack bits > 64\n");
357 int packbytes = packbits / 8;
358 if ((packidx + 1) * packbits > item->
size) {
359 eprintf(
"Packed index is beyond the register size\n");
363 off += (packidx * packbytes);
367 for (
i = 0; i < packbytes; i++, val >>= 8) {
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API bool rz_reg_set_longdouble(RzReg *reg, RzRegItem *item, long double value)
RZ_API long double rz_reg_get_longdouble(RzReg *reg, RzRegItem *item)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
RZ_API const char * rz_reg_get_name(RzReg *reg, int role)
RZ_API bool rz_reg_is_readonly(RzReg *reg, RzRegItem *item)
RZ_API bool rz_reg_set_value_by_role(RzReg *reg, RzRegisterId role, ut64 val)
RZ_API bool rz_reg_set_bv(RZ_NONNULL RzReg *reg, RZ_NONNULL RzRegItem *item, RZ_NONNULL const RzBitVector *bv)
RZ_API ut64 rz_reg_get_value_big(RzReg *reg, RzRegItem *item, utX *val)
RZ_API ut64 rz_reg_set_bvalue(RzReg *reg, RzRegItem *item, const char *str)
RZ_API int rz_reg_set_pack(RzReg *reg, RzRegItem *item, int packidx, int packbits, ut64 val)
RZ_API ut64 rz_reg_get_pack(RzReg *reg, RzRegItem *item, int packidx, int packbits)
RZ_API RzBitVector * rz_reg_get_bv(RZ_NONNULL RzReg *reg, RZ_NONNULL RzRegItem *item)
RZ_API ut64 rz_reg_get_value_by_role(RzReg *reg, RzRegisterId role)
RZ_API RZ_HEAP char * rz_reg_get_bvalue(RzReg *reg, RzRegItem *item)
RZ_API bool rz_reg_set_value(RzReg *reg, RzRegItem *item, ut64 value)
static ut27 rz_read_me27(const ut8 *buf, int boff)
RZ_API ut64 rz_reg_get_value(RzReg *reg, RzRegItem *item)
#define rz_return_val_if_fail(expr, val)
RZ_API void rz_bv_set_to_bytes_le(RZ_NONNULL const RzBitVector *bv, RZ_OUT RZ_NONNULL ut8 *buf)
Set the buffer contents from the given bitvector's bits in little endian format.
RZ_API ut64 rz_bv_to_ut64(RZ_NONNULL const RzBitVector *x)
RZ_API ut32 rz_bv_len(RZ_NONNULL const RzBitVector *bv)
RZ_API RZ_OWN RzBitVector * rz_bv_new_from_bytes_be(RZ_IN RZ_NONNULL const ut8 *buf, ut32 bit_offset, ut32 size)
RZ_API RZ_OWN RzBitVector * rz_bv_new_from_bytes_le(RZ_IN RZ_NONNULL const ut8 *buf, ut32 bit_offset, ut32 size)
RZ_API void rz_bv_set_to_bytes_be(RZ_NONNULL const RzBitVector *bv, RZ_OUT RZ_NONNULL ut8 *buf)
Set the buffer contents from the given bitvector's bits in big endian format.
static void rz_write_le32(void *dest, ut32 val)
static ut64 rz_read_ble64(const void *src, bool big_endian)
static void rz_write_le16(void *dest, ut16 val)
static void rz_write_be16(void *dest, ut16 val)
static void rz_write_ble8(void *dest, ut8 val)
static void rz_write_be64(void *dest, ut64 val)
static ut32 rz_read_ble32(const void *src, bool big_endian)
static ut16 rz_read_ble16(const void *src, bool big_endian)
static ut8 rz_read_at_ble8(const void *src, size_t offset)
static void rz_write_le64(void *dest, ut64 val)
static void rz_write_be32(void *dest, ut32 val)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API void rz_mem_copybits_delta(ut8 *dst, int doff, const ut8 *src, int soff, int bits)
RZ_API void rz_mem_copybits(ut8 *dst, const ut8 *src, int bits)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API ut64 rz_str_bits_from_string(const char *buf, const char *bitz)
RZ_API int rz_str_bits(char *strout, const ut8 *buf, int len, const char *bitz)
int size
in bits> 8,16,32,64 ... 128/256
int arena
In which arena is this reg living. Usually equals type.
int packed_size
0 means no packed register, 1byte pack, 2b pack...
int offset
Offset into register profile in bits.
ut64(WINAPI *w32_GetEnabledXStateFeatures)()