14 return idx <
stream->header.TypeIndexBegin;
45 return strdup(
"__fastcall");
48 return strdup(
"__stdcall");
51 return strdup(
"__syscall");
53 return strdup(
"__thiscall");
55 return strdup(
"__vectorcall");
69 return (
type & 0x0000000000F00) >> 8;
79 return (
type & 0x00000000000FF);
158 type->type_data = simple_type;
163 simple_type->
size = 0;
167 simple_type->
size = 0;
172 simple_type->
size = 1;
176 simple_type->
size = 1;
180 simple_type->
size = 4;
184 simple_type->
size = 2;
188 simple_type->
size = 4;
192 simple_type->
size = 1;
196 simple_type->
size = 1;
201 simple_type->
size = 2;
206 simple_type->
size = 2;
211 simple_type->
size = 4;
216 simple_type->
size = 4;
221 simple_type->
size = 8;
226 simple_type->
size = 8;
231 simple_type->
size = 16;
236 simple_type->
size = 16;
240 simple_type->
size = 2;
245 simple_type->
size = 4;
249 simple_type->
size = 6;
253 simple_type->
size = 8;
257 simple_type->
size = 10;
261 simple_type->
size = 16;
265 simple_type->
size = 2;
270 simple_type->
size = 4;
274 simple_type->
size = 6;
278 simple_type->
size = 8;
282 simple_type->
size = 10;
286 simple_type->
size = 16;
290 simple_type->
size = 1;
294 simple_type->
size = 2;
298 simple_type->
size = 4;
302 simple_type->
size = 8;
306 simple_type->
size = 16;
310 simple_type->
size = 0;
320 simple_type->
size = 2;
326 simple_type->
size = 4;
329 simple_type->
size = 8;
332 simple_type->
size = 16;
346 return *(
st8 *)(numeric->
data);
374 switch (t->leaf_type) {
449 switch (
type->leaf_type) {
509 switch (
type->leaf_type) {
542 return lf_index->
index;
562 eprintf(
"%s::not supproted type\n", __FUNCTION__);
572 switch (
type->leaf_type) {
715 while (*read_len <
len) {
720 if (has_length && ((byt & 0xf0) == 0xf0 || byt == 0)) {
722 }
else if ((byt & 0xf0) == 0xf0) {
732 while (*read_len <
len) {
738 if ((byt & 0xf0) != 0xf0) {
752 *read_len +=
sizeof(
ut16);
760 *read_len +=
sizeof(
st8);
768 *read_len +=
sizeof(
st16);
776 *read_len +=
sizeof(
ut16);
784 *read_len +=
sizeof(
st32);
792 *read_len +=
sizeof(
ut32);
800 *read_len +=
sizeof(
st64);
808 *read_len +=
sizeof(
ut64);
813 RZ_LOG_ERROR(
"%s: Skipping unsupported type (%d)\n", __FUNCTION__,
826 while (*read_len <
len) {
860 *read_len +=
sizeof(
ut16);
888 *read_len +=
sizeof(
ut16);
893 *read_len +=
sizeof(
ut32);
908 *read_len +=
sizeof(
ut16);
913 *read_len +=
sizeof(
ut32);
929 *read_len +=
sizeof(
ut16);
934 *read_len +=
sizeof(
ut32);
948 *read_len +=
sizeof(
ut16);
953 *read_len +=
sizeof(
ut32);
971 *read_len +=
sizeof(
ut16);
976 *read_len +=
sizeof(
ut32);
1004 *read_len +=
sizeof(
ut16);
1009 *read_len +=
sizeof(
ut32);
1027 *read_len +=
sizeof(
ut16);
1032 *read_len +=
sizeof(
ut32);
1039 *read_len +=
sizeof(
ut32);
1058 *read_len +=
sizeof(
ut16);
1063 *read_len +=
sizeof(
ut32);
1090 *read_len +=
sizeof(
ut16);
1095 *read_len +=
sizeof(
ut32);
1100 *read_len +=
sizeof(
ut32);
1131 while (read_len <
len) {
1138 type->type_index = 0;
1144 read_len +=
sizeof(
ut16);
1145 switch (
type->leaf_type) {
1184 if (!
type->type_data) {
1208 read_bytes +=
sizeof(
ut16);
1215 read_bytes +=
sizeof(
ut16);
1220 read_bytes +=
sizeof(
ut32);
1225 read_bytes +=
sizeof(
ut32);
1245 read_bytes +=
sizeof(
ut16);
1252 read_bytes +=
sizeof(
ut16);
1257 read_bytes +=
sizeof(
ut32);
1262 read_bytes +=
sizeof(
ut32);
1267 read_bytes +=
sizeof(
ut32);
1299 read_bytes +=
sizeof(
ut16);
1304 read_bytes +=
sizeof(
ut16);
1309 read_bytes +=
sizeof(
ut32);
1314 read_bytes +=
sizeof(
ut32);
1319 read_bytes +=
sizeof(
ut32);
1353 read_bytes +=
sizeof(
ut32);
1360 read_bytes +=
sizeof(
ut32);
1363 read_bytes +=
sizeof(
ut32);
1368 read_bytes +=
sizeof(
ut16);
1374 read_bytes +=
sizeof(
ut32);
1395 read_bytes +=
sizeof(
ut32);
1400 read_bytes +=
sizeof(
ut32);
1427 read_bytes +=
sizeof(
ut32);
1434 read_bytes +=
sizeof(
ut16);
1450 read_bytes +=
sizeof(
ut32);
1457 for (
size_t i = 0;
i < arglist->
count;
i++) {
1463 read_bytes +=
sizeof(
ut32);
1481 read_bytes +=
sizeof(
ut32);
1486 read_bytes +=
sizeof(
ut32);
1491 read_bytes +=
sizeof(
ut32);
1496 read_bytes +=
sizeof(
ut8);
1503 read_bytes +=
sizeof(
ut8);
1508 read_bytes +=
sizeof(
ut16);
1513 read_bytes +=
sizeof(
ut32);
1518 read_bytes +=
sizeof(
ut32);
1535 while (read_bytes <
len) {
1548 read_bytes +=
sizeof(
ut16);
1555 read_bytes +=
sizeof(
ut16);
1562 read_bytes +=
sizeof(
ut32);
1572 read_bytes +=
sizeof(
ut32);
1595 read_bytes +=
sizeof(
ut32);
1600 read_bytes +=
sizeof(
ut8);
1607 read_bytes +=
sizeof(
ut8);
1612 read_bytes +=
sizeof(
ut16);
1617 read_bytes +=
sizeof(
ut32);
1633 read_bytes +=
sizeof(
ut16);
1640 read_bytes +=
sizeof(
ut16);
1645 read_bytes +=
sizeof(
ut32);
1675 read_bytes +=
sizeof(
ut32);
1680 read_bytes +=
sizeof(
ut8);
1685 read_bytes +=
sizeof(
ut8);
1701 read_bytes +=
sizeof(
ut16);
1725 switch (
type->leaf_type) {
1823 for (
ut32 i =
s->header.TypeIndexBegin; i < s->
header.TypeIndexEnd;
i++) {
1828 type->type_index =
i;
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define header(is_bt, len_min, ret_op)
#define rz_warn_if_reached()
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
RZ_API st64 rz_buf_seek(RZ_NONNULL RzBuffer *b, st64 addr, int whence)
Modify the current cursor position in the buffer.
RZ_API bool rz_buf_read8(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut8 *result)
Read a byte at the cursor in the buffer.
#define rz_buf_read_le16(b, result)
Read a big endian or little endian (ut16, ut32, ut64) at the specified offset in the buffer and shift...
#define rz_buf_read_le32(b, result)
#define rz_buf_read_le64(b, result)
RZ_API st64 rz_buf_read(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
void(* RzListFree)(void *ptr)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API void * rz_mem_alloc(int sz)
RzPdbTpiCallingConvention
#define GET_BF(value, start, len)
RZ_API RBNode * rz_rbtree_find(RBNode *root, void *data, RBComparator cmp, void *user)
RZ_API void rz_rbtree_free(RZ_NULLABLE RBNode *root, RBNodeFree freefn, void *user)
RZ_API bool rz_rbtree_insert(RBNode **root, void *data, RBNode *node, RBComparator cmp, void *user)
Returns true if the node was inserted successfully.
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
#define container_of(ptr, type, member)
Tpi_Type_String mangled_name
Tpi_Type_Numeric enum_value
RzPdbTpiCallingConvention call_conv
TpiCVPointerAttr ptr_attr
struct Tpi_LF_Pointer::@212::@215 pbase
struct Tpi_LF_Pointer::@212::@214 pmember
Tpi_Type_String mangled_name
Tpi_Type_Numeric unknown1
Tpi_Type_String mangled_name
Tpi_Type_String mangled_name
Tpi_Type_Numeric vb_pointer_offset
Tpi_Type_Numeric vb_offset_from_vbtable
static Tpi_LF_Bitfield * parse_type_bitfield(RzBuffer *buf, ut16 len)
static Tpi_LF_VBClass * parse_type_vbclass(RzBuffer *buf, ut16 len, ut16 *read_len)
RZ_API ut64 rz_bin_pdb_get_type_val(RZ_NONNULL RzPdbTpiType *type)
Get the numeric value inside the type.
static void free_tpi_type(void *type_info)
static bool is_simple_type(RzPdbTpiStream *stream, ut32 idx)
static void parse_codeview_modifier(TpiCVModifier *m, ut16 value)
static Tpi_LF_Arglist * parse_type_arglist(RzBuffer *buf, ut16 len)
RZ_API RZ_BORROW RzList * rz_bin_pdb_get_type_members(RZ_NONNULL RzPdbTpiStream *stream, RzPdbTpiType *t)
Get the RzPdbTpiType member list.
static Tpi_LF_Enum * parse_type_enum(RzBuffer *buf, ut16 len)
static void free_tpi_rbtree(RBNode *node, void *user)
static Tpi_LF_BClass * parse_type_bclass(RzBuffer *buf, ut16 len, ut16 *read_len)
static Tpi_LF_Union * parse_type_union(RzBuffer *buf, ut16 len)
RZ_IPI bool parse_tpi_stream(RzPdb *pdb, RzPdbMsfStream *stream)
static void parse_codeview_pointer_attribute(TpiCVPointerAttr *p, ut32 value)
static Tpi_LF_NestType * parse_type_nesttype(RzBuffer *buf, ut16 len, ut16 *read_len)
static bool parse_type_numeric(RzBuffer *buf, Tpi_Type_Numeric *numeric, ut16 *read_len)
static Tpi_LF_FieldList * parse_type_fieldlist(RzBuffer *buf, ut16 len)
static Tpi_LF_OneMethod * parse_type_onemethod(RzBuffer *buf, ut16 len, ut16 *read_len)
RZ_API RZ_BORROW RzPdbTpiType * rz_bin_pdb_get_type_by_index(RZ_NONNULL RzPdbTpiStream *stream, ut32 index)
Get RzPdbTpiType that matches tpi stream index.
static Tpi_LF_Structure * parse_type_struct(RzBuffer *buf, ut16 len)
static Tpi_LF_Structure_19 * parse_type_struct_19(RzBuffer *buf, ut16 len)
static Tpi_LF_Modifier * parse_type_modifier(RzBuffer *buf, ut16 len)
static bool parse_tpi_types(RzBuffer *buf, RzPdbTpiType *type)
RZ_API RZ_OWN char * rz_bin_pdb_calling_convention_as_string(RZ_NONNULL RzPdbTpiCallingConvention idx)
Parses calling convention type as string.
static Tpi_LF_MFcuntion * parse_type_mfunction(RzBuffer *buf, ut16 len)
RZ_IPI void free_tpi_stream(RzPdbTpiStream *stream)
static Tpi_LF_Vtshape * parse_type_vtshape(RzBuffer *buf, ut16 len)
RZ_API RZ_BORROW char * rz_bin_pdb_get_type_name(RZ_NONNULL RzPdbTpiType *type)
Get the name of the type.
static Tpi_LF_Method * parse_type_method(RzBuffer *buf, ut16 len, ut16 *read_len)
static bool parse_tpi_stream_header(RzPdbTpiStream *s, RzBuffer *buf)
static Tpi_LF_Enumerate * parse_type_enumerate(RzBuffer *buf, ut16 len, ut16 *read_len)
static void skip_padding(RzBuffer *buf, ut16 len, ut16 *read_len, bool has_length)
static Tpi_LF_MethodList * parse_type_methodlist(RzBuffer *buf, ut16 len)
static ut64 get_numeric_val(Tpi_Type_Numeric *numeric)
static TpiSimpleTypeKind get_simple_type_kind(ut32 type)
static Tpi_LF_StaticMember * parse_type_staticmember(RzBuffer *buf, ut16 len, ut16 *read_len)
static Tpi_LF_Procedure * parse_type_procedure(RzBuffer *buf, ut16 len)
static Tpi_LF_Member * parse_type_member(RzBuffer *buf, ut16 len, ut16 *read_len)
static TpiSimpleTypeMode get_simple_type_mode(ut32 type)
static void parse_codeview_func_attribute(TpiCVFuncattr *f, ut8 value)
int tpi_type_node_cmp(const void *incoming, const RBNode *in_tree, void *user)
static Tpi_LF_Pointer * parse_type_pointer(RzBuffer *buf, ut16 len)
static Tpi_LF_VFuncTab * parse_type_vfunctab(RzBuffer *buf, ut16 len, ut16 *read_len)
static Tpi_LF_Index * parse_type_index(RzBuffer *buf, ut16 len, ut16 *read_len)
RZ_API bool rz_bin_pdb_type_is_fwdref(RZ_NONNULL RzPdbTpiType *t)
Return true if type is forward definition.
static bool has_non_padding(RzBuffer *buf, ut16 len, ut16 *read_len)
static Tpi_LF_Array * parse_type_array(RzBuffer *buf, ut16 len)
static void free_snumeric(Tpi_Type_Numeric *numeric)
static void parse_type_string(RzBuffer *buf, Tpi_Type_String *str, ut16 len, ut16 *read_len)
static void parse_codeview_fld_attribute(TpiCVFldattr *f, ut16 value)
RZ_IPI RzPdbTpiType * parse_simple_type(RzPdbTpiStream *stream, ut32 idx)
Parses simple type if the idx represents one.
static void parse_codeview_property(TpiCVProperty *p, ut16 value)
struct TpiCVFldattr::@209 bits
struct TpiCVPointerAttr::@211 bits
struct TpiCVProperty::@208 bits
void error(const char *msg)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()