Lines Matching full:rh
59 PE_RichHdr *rh; in libpe_parse_rich_header() local
74 if ((rh = calloc(1, sizeof(*rh))) == NULL) { in libpe_parse_rich_header()
79 rh->rh_xor = le32dec(r + 4); /* Retrieve the "XOR mask" */ in libpe_parse_rich_header()
87 x = le32dec(p) ^ rh->rh_xor; in libpe_parse_rich_header()
94 free(rh); in libpe_parse_rich_header()
106 rh->rh_total = (r - p) / 8; in libpe_parse_rich_header()
107 if ((rh->rh_compid = malloc(rh->rh_total * sizeof(*rh->rh_compid))) == in libpe_parse_rich_header()
109 free(rh); in libpe_parse_rich_header()
113 if ((rh->rh_cnt = malloc(rh->rh_total * sizeof(*rh->rh_cnt))) == in libpe_parse_rich_header()
115 free(rh->rh_compid); in libpe_parse_rich_header()
116 free(rh); in libpe_parse_rich_header()
120 for (i = 0; (uint32_t) i < rh->rh_total; i++, p += 8) { in libpe_parse_rich_header()
121 rh->rh_compid[i] = le32dec(p) ^ rh->rh_xor; in libpe_parse_rich_header()
122 rh->rh_cnt[i] = le32dec(p + 4) ^ rh->rh_xor; in libpe_parse_rich_header()
125 pe->pe_rh = rh; in libpe_parse_rich_header()