input
stringlengths
26
172k
output
stringlengths
18
318k
repo_name
stringclasses
23 values
decompiler
stringclasses
5 values
static void builtin_error_prolog() { char *name; name = get_name_for_error(); fprintf(stderr, "%s: ", name); if (interactive_shell == 0) fprintf(stderr, gettext("line %d: "), executing_line_number()); if (this_command_name && *this_command_name) fprintf(stderr, "%s: ", this_command_name); }
void builtin_error_prolog() { unsigned long v0; unsigned long long v2; char *v3; unsigned long long v4; unsigned long long v5; v0 = get_name_for_error(); fprintf(stderr, "%s: ", v0); if (!interactive_shell) { v2 = executing_line_number(); fprintf(stderr, gettext("line %d: ")); } v3 = this_command_name; if (this_command_name) { v4 = *(this_command_name); if (*(this_command_name)) v5 = fprintf(stderr, "%s: ", this_command_name); } return; }
bash
angr_sailr
static char *limfield(struct line const *line, struct keyfield const *key) { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; if (echar == 0) eword++; if (tab != TAB_DEFAULT) while (ptr < lim && eword--) { while (ptr < lim && *ptr != tab) ++ptr; if (ptr < lim && (eword || echar)) ++ptr; } else while (ptr < lim && eword--) { while (ptr < lim && blanks[to_uchar(*ptr)]) ++ptr; while (ptr < lim && !blanks[to_uchar(*ptr)]) ++ptr; } if (echar != 0) { if (key->skipeblanks) while (ptr < lim && blanks[to_uchar(*ptr)]) ++ptr; ptr = (((lim) < (ptr + echar)) ? (lim) : (ptr + echar)); } return ptr; }
int limfield(unsigned long long a0[2], struct_0 *a1) { char *v0; unsigned long long v1; unsigned long long v2; unsigned long v3; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; v0 = a0[0]; v2 = &v0[1 + a0[1]]; v1 = a1->field_10; v3 = a1->field_18; if (!v3) v1 += 1; if (tab == 128) { while (true) { if (v0 >= v2) break; v5 = v1; v1 -= 1; if (!v5) break; while (true) { if (v0 >= v2) break; *(&v5) = *(to_uchar(*(v0)) + &blanks); if (!v5) break; v0 += 1; } while (true) { if (v0 >= v2) break; *(&v5) = *(to_uchar(*(v0)) + &blanks) ^ 1; if (!v5) break; v0 += 1; } } } else { while (true) { if (v0 >= v2) break; v6 = v1; v1 -= 1; if (!v6) break; while (true) { if (v0 >= v2) break; if (*(v0) == tab) break; v0 += 1; } if (!(v0 < v2)) continue; if (!v1 && !v3) continue; v0 += 1; } } if (v3) { if (a1->field_31) { while (true) { if (v0 >= v2) break; v7 = to_uchar(*(v0)); *(&v7) = *(v7 + &blanks); if (!v7) break; v0 += 1; } } v8 = &v0[v3]; if (v2 <= &v0[v3]) v8 = v2; v0 = v8; } return v0; }
coreutils
angr_phoenix
struct localvar_list *pushlocalvars(int push) { struct localvar_list *ll; struct localvar_list *top; top = localvar_stack; if (!push) goto out; ({ suppressint++; ({ __asm__ __volatile__("" : : : "memory"); }); 0; }); ll = ckmalloc(sizeof(*ll)); ll->lv = ((void *)0); ll->next = top; localvar_stack = ll; ({ ({ __asm__ __volatile__("" : : : "memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); out: return top; }
long long pushlocalvars(unsigned long a0) { unsigned long long v0; unsigned long long v1[2]; v0 = 137503841313750085; if (a0) { suppressint = suppressint + 1; v1[0] = ckmalloc(0x10); v1[1] = 0; v1[0] = v0; localvar_stack[0] = v1; suppressint = suppressint - 1; onint(); } return v0; }
dash-0.5.11+git20210903+057cd650a4ed
angr_phoenix
static int hostkeys_find_by_key_cb(struct hostkey_foreach_line *l, void *_ctx) { struct find_by_key_ctx *ctx = (struct find_by_key_ctx *)_ctx; char *path; if ((l->match & (1)) != 0) return 0; if (l->marker != MRK_NONE) return 0; if (l->key == ((void *)0) || !sshkey_equal(ctx->key, l->key)) return 0; path = try_tilde_unexpand(l->path); sshlog("sshconnect.c", __func__, 729, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0), "found matching key in %s:%lu", path, l->linenum); ctx->names = xrecallocarray(ctx->names, ctx->nnames, ctx->nnames + 1, sizeof(*ctx->names)); xasprintf(&ctx->names[ctx->nnames], "%s:%lu: %s", path, l->linenum, strncmp(l->hosts, "|1|", strlen("|1|")) == 0 ? "[hashed name]" : l->hosts); ctx->nnames++; free(path); return 0; }
long long hostkeys_find_by_key_cb(struct_0 *a0, struct_1 *a1) { unsigned long v0; unsigned long v1; void *v2; if (!(a0->field_14 & 1) && a0->field_20 == 1) { if (!a0->field_40) { LABEL_401daf: } else { if (!sshkey_equal(a1->field_10, a0->field_40, a0->field_40)) goto LABEL_401daf; v2 = try_tilde_unexpand(a0->field_0); v1 = a0->field_8; v0 = v2; sshlog("sshconnect.c", "hostkeys_find_by_key_cb", 0x2d9, 0x1, 0x5, 0x0, "found matching key in %s:%lu"); a1->field_18 = xrecallocarray(a1->field_18, a1->field_20, a1->field_20 + 1, 0x8); xasprintf(a1->field_18 + a1->field_20 * 8, "%s:%lu: %s", v2); a1->field_20 = a1->field_20 + 1; free(v2); } } return 0; }
openssh-portable
angr_phoenix
static void linkpath_coder(struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, void const *data __attribute__((unused))) { code_string(st->link_name, keyword, xhdr); }
long long linkpath_coder(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long a3) { unsigned long v0; v0 = a3; return code_string(a0->field_18, a1, a2); }
tar
angr_phoenix
_Bool excluded_name (char const *name, struct tar_stat_info *st) { struct exclist *ep; const char *rname = ((void *)0); char *bname = ((void *)0); _Bool result; int nr = 0; name += ((void)(name), 0); if (excluded_file_name(excluded, name)) return 1; if (!st) return 0; for (result = 0; st && !result; st = st->parent, nr = 0x02) { for (ep = st->exclude_list; ep; ep = ep->next) { if (ep->flags & nr) continue; if ((result = excluded_file_name(ep->excluded, name))) break; if (!rname) { rname = name; while (*rname == '.' && ((rname[1]) == '/')) rname += 2; } if ((result = excluded_file_name(ep->excluded, rname))) break; if (!bname) bname = base_name(name); if ((result = excluded_file_name(ep->excluded, bname))) break; } } free(bname); return result; }
long long excluded_name(unsigned long long a0, unsigned long a1) { unsigned long long v0[55]; char v1; unsigned int v2; struct_0 *v3; void *v4; void *v5; unsigned long long v7; v0[0] = a1; v4 = 0; v5 = 0; v2 = 0; if (excluded_file_name(excluded, a0, a0)) { v7 = 1; return v7; } else if (v0) { for (v1 = 0; v0 && (v1 ^ 1); v2 = 2) { v3 = v0[54]; while (true) { if (!v3) break; if (!(v3->field_10 & v2)) { v1 = excluded_file_name(v3->field_18, a0, a0); if (v1) break; if (!v4) { for (v4 = a0; *(v4) == 46 && v4[1] == 47; v4 += 2) ; } v1 = excluded_file_name(v3->field_18, v4, v4); if (v1) break; if (!v5) v5 = base_name(a0); v1 = excluded_file_name(v3->field_18, v5, v5); if (v1) break; } v3 = v3->field_0; } v0[0] = v0[51]; } free(v5); v7 = v1; return v7; } else { v7 = 0; return v7; } }
tar
angr_sailr
static int batadv_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { while (argc > 0) { if (matches(*argv, "ra") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while (0); addattrstrz(n, 1024, IFLA_BATADV_ALGO_NAME, *argv); } else if (matches(*argv, "help") == 0) { explain(); return -1; } else { fprintf(stderr, "batadv: unknown command \"%s\"?\n", *argv); explain(); return -1; } argc--, argv++; } return 0; }
undefined8 batadv_parse_opt(undefined8 param_1, int param_2, undefined8 *param_3, undefined8 param_4) { char cVar1; undefined8 *local_20; int local_14; local_20 = param_3; local_14 = param_2; while (true) { if (local_14 < 1) { return 0; } cVar1 = matches(*local_20, &DAT_001001ae); if (cVar1 == '\x01') break; if (local_14 + -1 < 1) { incomplete_command(); } addattrstrz(param_4, 0x400, 1, local_20[1]); local_14 = local_14 + -2; local_20 = local_20 + 2; } cVar1 = matches(*local_20, &DAT_001001b1); if (cVar1 != '\x01') { explain(); return 0xffffffff; } fprintf(stderr, "batadv: unknown command \"%s\"?\n", *local_20); explain(); return 0xffffffff; }
iproute2-6.0.0
ghidra
static block_state deflate_fast(s, flush) deflate_state *s; int flush; { IPos hash_head; int bflush; for (;;) { if (s->lookahead < (258 + 3 + 1)) { fill_window(s); if (s->lookahead < (258 + 3 + 1) && flush == 0) { return need_more; } if (s->lookahead == 0) break; } hash_head = 0; if (s->lookahead >= 3) { ((s->ins_h = (((s->ins_h) << s->hash_shift) ^ (s->window[(s->strstart) + (3 - 1)])) & s->hash_mask), hash_head = s->prev[(s->strstart) & s->w_mask] = s->head[s->ins_h], s->head[s->ins_h] = (Pos)(s->strstart)); } if (hash_head != 0 && s->strstart - hash_head <= ((s)->w_size - (258 + 3 + 1))) { s->match_length = longest_match(s, hash_head); } if (s->match_length >= 3) { ; { uch len = (uch)(s->match_length - 3); ush dist = (ush)(s->strstart - s->match_start); s->sym_buf[s->sym_next++] = (uch)dist; s->sym_buf[s->sym_next++] = (uch)(dist >> 8); s->sym_buf[s->sym_next++] = len; dist--; s->dyn_ltree[_length_code[len] + 256 + 1].fc.freq++; s->dyn_dtree[((dist) < 256 ? _dist_code[dist] : _dist_code[256 + ((dist) >> 7)])] .fc.freq++; bflush = (s->sym_next == s->sym_end); }; s->lookahead -= s->match_length; if (s->match_length <= s->max_lazy_match && s->lookahead >= 3) { s->match_length--; do { s->strstart++; ((s->ins_h = (((s->ins_h) << s->hash_shift) ^ (s->window[(s->strstart) + (3 - 1)])) & s->hash_mask), hash_head = s->prev[(s->strstart) & s->w_mask] = s->head[s->ins_h], s->head[s->ins_h] = (Pos)(s->strstart)); } while (--s->match_length != 0); s->strstart++; } else { s->strstart += s->match_length; s->match_length = 0; s->ins_h = s->window[s->strstart]; (s->ins_h = (((s->ins_h) << s->hash_shift) ^ (s->window[s->strstart + 1])) & s->hash_mask); } } else { ; { uch cc = (s->window[s->strstart]); s->sym_buf[s->sym_next++] = 0; s->sym_buf[s->sym_next++] = 0; s->sym_buf[s->sym_next++] = cc; s->dyn_ltree[cc].fc.freq++; bflush = (s->sym_next == s->sym_end); }; s->lookahead--; s->strstart++; } if (bflush) { { _tr_flush_block(s, (s->block_start >= 0L ? (charf *)&s->window[(unsigned)s->block_start] : (charf *)0), (ulg)((long)s->strstart - s->block_start), (0)); s->block_start = s->strstart; flush_pending(s->strm); ; }; if (s->strm->avail_out == 0) return (0) ? finish_started : need_more; }; } s->insert = s->strstart < 3 - 1 ? s->strstart : 3 - 1; if (flush == 4) { { { _tr_flush_block(s, (s->block_start >= 0L ? (charf *)&s->window[(unsigned)s->block_start] : (charf *)0), (ulg)((long)s->strstart - s->block_start), (1)); s->block_start = s->strstart; flush_pending(s->strm); ; }; if (s->strm->avail_out == 0) return (1) ? finish_started : need_more; }; return finish_done; } if (s->sym_next) { { _tr_flush_block(s, (s->block_start >= 0L ? (charf *)&s->window[(unsigned)s->block_start] : (charf *)0), (ulg)((long)s->strstart - s->block_start), (0)); s->block_start = s->strstart; flush_pending(s->strm); ; }; if (s->strm->avail_out == 0) return (0) ? finish_started : need_more; }; return block_done; }
long long deflate_fast(struct_0 *a0, unsigned long long a1) { unsigned long long v0; int tmp_54; int tmp_131; int tmp_137; int tmp_183; int tmp_189; int tmp_220; int tmp_59; int tmp_99; int tmp_105; int tmp_126; int tmp_132; int tmp_159; struct_4 *v1; char v2; char v3; unsigned short v4; unsigned int v5; unsigned int v6; char *v9; unsigned long long v10; unsigned int v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; v1 = &a0->field_0; *(&v0) = a1; while (true) { if (a0->field_b4 <= 261) { fill_window(a0); if (a0->field_b4 <= 261 && !v0) { v13 = 0; break; } if ((v0 || a0->field_b4 > 261) && !a0->field_b4) { if (a0->field_ac <= 2) v11 = a0->field_ac; else v11 = 2; a0->field_172c = v11; if (v0 == 4) { _tr_flush_block(a0); v14 = a0->field_ac; a0->field_98 = a0->field_ac; flush_pending(a0->field_0, v0, v14, v12); if (!a0->field_0->field_20) { v13 = 2; break; } else { v13 = 3; break; } } else { if (a0->field_170c) { _tr_flush_block(a0); v15 = a0->field_ac; a0->field_98 = a0->field_ac; flush_pending(a0->field_0, v0, v15, v12); if (!a0->field_0->field_20) { v13 = 0; break; } } if (!a0->field_170c || a0->field_0->field_20) { v13 = 1; break; } } } } if (a0->field_b4 > 261 || v0 && a0->field_b4 || a0->field_b4 && a0->field_b4 > 261) { v5 = 0; if (a0->field_b4 > 2) { a0->field_80 = ((a0->field_80 << (a0->field_90 & 31)) ^ *((a0->field_ac + 2 + a0->field_60))) & a0->field_8c; tmp_54 = (a0->field_58 & a0->field_ac) * 2 + a0->field_70; *(((a0->field_58 & a0->field_ac) * 2 + a0->field_70)) = *((a0->field_78 + a0->field_80 * 2)); v5 = *(tmp_54); *((a0->field_80 * 2 + a0->field_78)) = a0->field_ac; } if (v5 && a0->field_ac - v5 <= a0->field_50 - 262) a0->field_a0 = longest_match(a0, v5); if (a0->field_a0 > 2) { v3 = a0->field_a0 - 3; v4 = a0->field_ac - a0->field_b0; tmp_131 = a0->field_1700; tmp_137 = a0->field_170c; a0->field_170c = a0->field_170c + 1; *((tmp_137 + tmp_131)) = v4; tmp_183 = a0->field_1700; tmp_189 = a0->field_170c; a0->field_170c = a0->field_170c + 1; *((tmp_189 + tmp_183)) = v4 >> 8; v9 = a0->field_1700; tmp_220 = a0->field_170c; a0->field_170c = a0->field_170c + 1; v9[tmp_220] = v3; v4 -= 1; *(&a0->padding_c4[1044 + 4 * *(v3 + &_length_code)]) = *(&a0->padding_c4[1044 + 4 * *(v3 + &_length_code)]) + 1; if (v4 <= 255) v10 = *(v4 + &_dist_code); else v10 = *(((v4 >> 7) + 5243232)); *(&a0->padding_c4[2308 + 4 * v10]) = *(&a0->padding_c4[2308 + 4 * v10]) + 1; v6 = a0->field_170c == a0->field_1710; a0->field_b4 = a0->field_b4 - a0->field_a0; if (a0->field_a0 <= a0->field_c0 && a0->field_b4 > 2) { a0->field_a0 = a0->field_a0 - 1; do { a0->field_ac = a0->field_ac + 1; a0->field_80 = ((a0->field_80 << (a0->field_90 & 31)) ^ *((a0->field_ac + 2 + a0->field_60))) & a0->field_8c; tmp_59 = (a0->field_58 & a0->field_ac) * 2 + a0->field_70; *(((a0->field_58 & a0->field_ac) * 2 + a0->field_70)) = *((a0->field_78 + a0->field_80 * 2)); *(&v10) = *(tmp_59); v5 = v10; *((a0->field_80 * 2 + a0->field_78)) = a0->field_ac; a0->field_a0 = a0->field_a0 - 1; } while (a0->field_a0); a0->field_ac = a0->field_ac + 1; } if (a0->field_b4 <= 2 || a0->field_a0 > a0->field_c0) { a0->field_ac = a0->field_ac + a0->field_a0; a0->field_a0 = 0; a0->field_80 = *((a0->field_ac + a0->field_60)); a0->field_80 = ((a0->field_80 << (a0->field_90 & 31)) ^ *((a0->field_ac + 1 + a0->field_60))) & a0->field_8c; } } else { v2 = *((a0->field_ac + a0->field_60)); tmp_99 = a0->field_1700; tmp_105 = a0->field_170c; a0->field_170c = a0->field_170c + 1; *((tmp_105 + tmp_99)) = 0; tmp_126 = a0->field_1700; tmp_132 = a0->field_170c; a0->field_170c = a0->field_170c + 1; *((tmp_132 + tmp_126)) = 0; v9 = a0->field_1700; tmp_159 = a0->field_170c; a0->field_170c = a0->field_170c + 1; v9[tmp_159] = v2; *(&a0->padding_c4[16 + 4 * v2]) = *(&a0->padding_c4[16 + 4 * v2]) + 1; v6 = a0->field_170c == a0->field_1710; a0->field_b4 = a0->field_b4 - 1; a0->field_ac = a0->field_ac + 1; } if (!v6) continue; _tr_flush_block(a0); v11 = a0->field_ac; a0->field_98 = a0->field_ac; flush_pending(a0->field_0, v9, v11, v12); if (a0->field_0->field_20) continue; v13 = 0; break; } } return v13; }
zlib
angr_dream
static void sigintterm_handler(int x __attribute__((__unused__))) { got_sigintterm = 1; }
long long sigintterm_handler(unsigned long a0) { unsigned int v0; unsigned long v2; v0 = a0; got_sigintterm = 1; return v2; }
cronie
angr_phoenix
static void mainSort(UInt32 *ptr, UChar *block, UInt16 *quadrant, UInt32 *ftab, Int32 nblock, Int32 verb, Int32 *budget) { Int32 i, j, k, ss, sb; Int32 runningOrder[256]; Bool bigDone[256]; Int32 copyStart[256]; Int32 copyEnd[256]; UChar c1; Int32 numQSorted; UInt16 s; if (verb >= 4) fprintf(stderr, " main sort initialise ...\n"); for (i = 65536; i >= 0; i--) ftab[i] = 0; j = block[0] << 8; i = nblock - 1; for (; i >= 3; i -= 4) { quadrant[i] = 0; j = (j >> 8) | (((UInt16)block[i]) << 8); ftab[j]++; quadrant[i - 1] = 0; j = (j >> 8) | (((UInt16)block[i - 1]) << 8); ftab[j]++; quadrant[i - 2] = 0; j = (j >> 8) | (((UInt16)block[i - 2]) << 8); ftab[j]++; quadrant[i - 3] = 0; j = (j >> 8) | (((UInt16)block[i - 3]) << 8); ftab[j]++; } for (; i >= 0; i--) { quadrant[i] = 0; j = (j >> 8) | (((UInt16)block[i]) << 8); ftab[j]++; } for (i = 0; i < (2 + 12 + 18 + 2); i++) { block[nblock + i] = block[i]; quadrant[nblock + i] = 0; } if (verb >= 4) fprintf(stderr, " bucket sorting ...\n"); for (i = 1; i <= 65536; i++) ftab[i] += ftab[i - 1]; s = block[0] << 8; i = nblock - 1; for (; i >= 3; i -= 4) { s = (s >> 8) | (block[i] << 8); j = ftab[s] - 1; ftab[s] = j; ptr[j] = i; s = (s >> 8) | (block[i - 1] << 8); j = ftab[s] - 1; ftab[s] = j; ptr[j] = i - 1; s = (s >> 8) | (block[i - 2] << 8); j = ftab[s] - 1; ftab[s] = j; ptr[j] = i - 2; s = (s >> 8) | (block[i - 3] << 8); j = ftab[s] - 1; ftab[s] = j; ptr[j] = i - 3; } for (; i >= 0; i--) { s = (s >> 8) | (block[i] << 8); j = ftab[s] - 1; ftab[s] = j; ptr[j] = i; } for (i = 0; i <= 255; i++) { bigDone[i] = ((Bool)0); runningOrder[i] = i; } { Int32 vv; Int32 h = 1; do h = 3 * h + 1; while (h <= 256); do { h = h / 3; for (i = h; i <= 255; i++) { vv = runningOrder[i]; j = i; while ((ftab[((runningOrder[j - h]) + 1) << 8] - ftab[(runningOrder[j - h]) << 8]) > (ftab[((vv) + 1) << 8] - ftab[(vv) << 8])) { runningOrder[j] = runningOrder[j - h]; j = j - h; if (j <= (h - 1)) goto zero; } zero: runningOrder[j] = vv; } } while (h != 1); } numQSorted = 0; for (i = 0; i <= 255; i++) { ss = runningOrder[i]; for (j = 0; j <= 255; j++) { if (j != ss) { sb = (ss << 8) + j; if (!(ftab[sb] & (1 << 21))) { Int32 lo = ftab[sb] & (~((1 << 21))); Int32 hi = (ftab[sb + 1] & (~((1 << 21)))) - 1; if (hi > lo) { if (verb >= 4) fprintf(stderr, " qsort [0x%x, 0x%x] " "done %d this %d\n", ss, j, numQSorted, hi - lo + 1) ; mainQSort3(ptr, block, quadrant, nblock, lo, hi, 2, budget); numQSorted += (hi - lo + 1); if (*budget < 0) return; } } ftab[sb] |= (1 << 21); } } { if (!(!bigDone[ss])) BZ2_bz__AssertH__fail(1006); }; { for (j = 0; j <= 255; j++) { copyStart[j] = ftab[(j << 8) + ss] & (~((1 << 21))); copyEnd[j] = (ftab[(j << 8) + ss + 1] & (~((1 << 21)))) - 1; } for (j = ftab[ss << 8] & (~((1 << 21))); j < copyStart[ss]; j++) { k = ptr[j] - 1; if (k < 0) k += nblock; c1 = block[k]; if (!bigDone[c1]) ptr[copyStart[c1]++] = k; } for (j = (ftab[(ss + 1) << 8] & (~((1 << 21)))) - 1; j > copyEnd[ss]; j--) { k = ptr[j] - 1; if (k < 0) k += nblock; c1 = block[k]; if (!bigDone[c1]) ptr[copyEnd[c1]--] = k; } } { if (!((copyStart[ss] - 1 == copyEnd[ss]) || (copyStart[ss] == 0 && copyEnd[ss] == nblock - 1))) BZ2_bz__AssertH__fail(1007); } for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= (1 << 21); bigDone[ss] = ((Bool)1); if (i < 255) { Int32 bbStart = ftab[ss << 8] & (~((1 << 21))); Int32 bbSize = (ftab[(ss + 1) << 8] & (~((1 << 21)))) - bbStart; Int32 shifts = 0; while ((bbSize >> shifts) > 65534) shifts++; for (j = bbSize - 1; j >= 0; j--) { Int32 a2update = ptr[bbStart + j]; UInt16 qVal = (UInt16)(j >> shifts); quadrant[a2update] = qVal; if (a2update < (2 + 12 + 18 + 2)) quadrant[a2update + nblock] = qVal; } { if (!(((bbSize - 1) >> shifts) <= 65535)) BZ2_bz__AssertH__fail(1002); }; } } if (verb >= 4) fprintf(stderr, " %d pointers, %d sorted, %d scanned\n", nblock, numQSorted, nblock - numQSorted); }
unsigned long mainSort(long a1, unsigned char *a2, long a3, long a4, unsigned int a5, int a6, int *a7) { int v7; int v8; unsigned char v14; unsigned char v15; unsigned short v16; unsigned short v17; unsigned short v18; unsigned short v19; short v20; int i; int j; int k; int m; int n; int ii; int kk; int mm; int v29; int v30; int v31; int v32; int v33; int v34; int v35; int v36; int v37; int v38; int nn; int i1; signed int i2; signed int i3; int i4; int i6; int v45; int v46; unsigned int v47; int jj; char i5; int v50; unsigned int v51; int v52; int v53; int v54; int v55; int v56; int v57; int v58[834]; unsigned long v59; v59 = __readfsqword(0x28u); if (a6 > 3) fprintf(stderr, " main sort initialise ...\n"); for (i = 0x10000; i >= 0; --i) *(_DWORD *)(4LL * i + a4) = 0; v29 = *a2 << 8; for (j = a5 - 1; j > 2; j -= 4) { *(_WORD *)(2LL * j + a3) = 0; v30 = (v29 >> 8) | (a2[j] << 8); ++*(_DWORD *)(4LL * v30 + a4); *(_WORD *)(2LL * j - 2 + a3) = 0; v31 = (v30 >> 8) | (a2[j - 1] << 8); ++*(_DWORD *)(4LL * v31 + a4); *(_WORD *)(2LL * j - 4 + a3) = 0; v32 = (v31 >> 8) | (a2[j - 2] << 8); ++*(_DWORD *)(4LL * v32 + a4); *(_WORD *)(2LL * j - 6 + a3) = 0; v29 = (v32 >> 8) | (a2[j - 3] << 8); ++*(_DWORD *)(4LL * v29 + a4); } while (j >= 0) { *(_WORD *)(2LL * j + a3) = 0; v29 = (v29 >> 8) | (a2[j] << 8); ++*(_DWORD *)(4LL * v29 + a4); --j; } for (k = 0; k <= 33; ++k) { a2[a5 + k] = a2[k]; *(_WORD *)(2LL * (int)(a5 + k) + a3) = 0; } if (a6 > 3) fprintf(stderr, " bucket sorting ...\n"); for (m = 1; m <= 0x10000; ++m) *(_DWORD *)(4LL * m + a4) += *(_DWORD *)(4LL * m - 4 + a4); v16 = *a2 << 8; for (n = a5 - 1; n > 2; n -= 4) { v17 = HIBYTE(v16) | (a2[n] << 8); v33 = *(_DWORD *)(4LL * v17 + a4) - 1; *(_DWORD *)(a4 + 4LL * v17) = v33; *(_DWORD *)(a1 + 4LL * v33) = n; v18 = HIBYTE(v17) | (a2[n - 1] << 8); v34 = *(_DWORD *)(4LL * v18 + a4) - 1; *(_DWORD *)(a4 + 4LL * v18) = v34; *(_DWORD *)(4LL * v34 + a1) = n - 1; v19 = HIBYTE(v18) | (a2[n - 2] << 8); v35 = *(_DWORD *)(4LL * v19 + a4) - 1; *(_DWORD *)(a4 + 4LL * v19) = v35; *(_DWORD *)(4LL * v35 + a1) = n - 2; v16 = HIBYTE(v19) | (a2[n - 3] << 8); v36 = *(_DWORD *)(4LL * v16 + a4) - 1; *(_DWORD *)(a4 + 4LL * v16) = v36; *(_DWORD *)(4LL * v36 + a1) = n - 3; } while (n >= 0) { v16 = HIBYTE(v16) | (a2[n] << 8); v37 = *(_DWORD *)(4LL * v16 + a4) - 1; *(_DWORD *)(a4 + 4LL * v16) = v37; *(_DWORD *)(a1 + 4LL * v37) = n--; } for (ii = 0; ii <= 255; ++ii) { *((_BYTE *)&v58[768] + ii) = 0; v58[ii] = ii; } for (jj = 1; jj <= 256; jj = 3 * jj + 1) ; do { jj /= 3; for (kk = jj; kk <= 255; ++kk) { v57 = v58[kk]; v38 = kk; do { if (*(_DWORD *)(4LL * ((v58[v38 - jj] + 1) << 8) + a4) - *(_DWORD *)(4LL * (v58[v38 - jj] << 8) + a4) <= (unsigned int)(*(_DWORD *)(4LL * ((v57 + 1) << 8) + a4) - *(_DWORD *)(4LL * (v57 << 8) + a4))) break; v58[v38] = v58[v38 - jj]; v38 -= jj; } while (jj <= v38); v58[v38] = v57; } } while (jj != 1); v47 = 0; for (mm = 0; mm <= 255; ++mm) { v50 = v58[mm]; for (nn = 0; nn <= 255; ++nn) { if (nn != v50) { v54 = (v50 << 8) + nn; if ((*(_DWORD *)(4LL * v54 + a4) & 0x200000) == 0) { v55 = *(_DWORD *)(4LL * v54 + a4) & 0xFFDFFFFF; v56 = (*(_DWORD *)(4 * (v54 + 1LL) + a4) & 0xFFDFFFFF) - 1; if (v56 > v55) { if (a6 > 3) fprintf(stderr, " qsort [0x%x, 0x%x] done %d this %d\n", (unsigned int)v50, (unsigned int)nn, v47, (*(_DWORD *)(4 * (v54 + 1LL) + a4) & 0xFFDFFFFF) - v55); mainQSort3(a1, (long)a2, a3, a5, v55, v56, 2, a7); v47 += v56 - v55 + 1; if (*a7 < 0) return v59 - __readfsqword(0x28u); } } *(_DWORD *)(4LL * v54 + a4) |= 0x200000u; } } if (*((_BYTE *)&v58[768] + v50)) BZ2_bz__AssertH__fail(1006LL); for (i1 = 0; i1 <= 255; ++i1) { v58[i1 + 256] = *(_DWORD *)(4LL * ((i1 << 8) + v50) + a4) & 0xFFDFFFFF; v58[i1 + 512] = (*(_DWORD *)(4 * ((i1 << 8) + v50 + 1LL) + a4) & 0xFFDFFFFF) - 1; } for (i2 = *(_DWORD *)(4LL * (v50 << 8) + a4) & 0xFFDFFFFF; i2 < v58[v50 + 256]; ++i2) { v45 = *(_DWORD *)(4LL * i2 + a1) - 1; if (v45 < 0) v45 += a5; v14 = a2[v45]; if (!*((_BYTE *)&v58[768] + v14)) { v7 = v58[v14 + 256]; v58[v14 + 256] = v7 + 1; *(_DWORD *)(a1 + 4LL * v7) = v45; } } for (i3 = (*(_DWORD *)(4LL * ((v50 + 1) << 8) + a4) & 0xFFDFFFFF) - 1; i3 > v58[v50 + 512]; --i3) { v46 = *(_DWORD *)(4LL * i3 + a1) - 1; if (v46 < 0) v46 += a5; v15 = a2[v46]; if (!*((_BYTE *)&v58[768] + v15)) { v8 = v58[v15 + 512]; v58[v15 + 512] = v8 - 1; *(_DWORD *)(a1 + 4LL * v8) = v46; } } if (v58[v50 + 256] - 1 != v58[v50 + 512] && (v58[v50 + 256] || v58[v50 + 512] != a5 - 1)) BZ2_bz__AssertH__fail(1007LL); for (i4 = 0; i4 <= 255; ++i4) *(_DWORD *)(4LL * ((i4 << 8) + v50) + a4) |= 0x200000u; *((_BYTE *)&v58[768] + v50) = 1; if (mm <= 254) { v51 = *(_DWORD *)(4LL * (v50 << 8) + a4) & 0xFFDFFFFF; v52 = (*(_DWORD *)(4LL * ((v50 + 1) << 8) + a4) & 0xFFDFFFFF) - v51; for (i5 = 0; v52 >> i5 > 65534; ++i5) ; for (i6 = v52 - 1; i6 >= 0; --i6) { v53 = *(_DWORD *)(4LL * (int)(v51 + i6) + a1); v20 = i6 >> i5; *(_WORD *)(a3 + 2LL * v53) = v20; if (v53 <= 33) *(_WORD *)(a3 + 2LL * (int)(v53 + a5)) = v20; } if ((v52 - 1) >> i5 > 0xFFFF) BZ2_bz__AssertH__fail(1002LL); } } if (a6 > 3) fprintf(stderr, " %d pointers, %d sorted, %d scanned\n", a5, v47, a5 - v47); return v59 - __readfsqword(0x28u); }
bzip2
ida
int print_color_bool(enum output_type t, enum color_attr color, const char *key, const char *fmt, _Bool value); static inline int print_bool(enum output_type t, const char *key, const char *fmt, _Bool value) { return print_color_bool(t, COLOR_NONE, key, fmt, value); }
void print_color_bool(void) { halt_baddata(); }
iproute2-6.0.0
ghidra
static void _ignore_completion_names(names, name_func) char **names; sh_ignore_func_t *name_func; { char **newnames; int idx, nidx; char **oldnames; int oidx; if (names[1] == (char *)0) { if (force_fignore) if ((*name_func)(names[0]) == 0) { sh_xfree((names[0]), "bashline.c", 3002); names[0] = (char *)((void *)0); } return; } for (nidx = 1; names[nidx]; nidx++) ; newnames = strvec_create(nidx + 1); if (force_fignore == 0) { oldnames = strvec_create(nidx - 1); oidx = 0; } newnames[0] = names[0]; for (idx = nidx = 1; names[idx]; idx++) { if ((*name_func)(names[idx])) newnames[nidx++] = names[idx]; else if (force_fignore == 0) oldnames[oidx++] = names[idx]; else sh_xfree((names[idx]), "bashline.c", 3029); } newnames[nidx] = (char *)((void *)0); if (nidx == 1) { if (force_fignore) { sh_xfree((names[0]), "bashline.c", 3039); names[0] = (char *)((void *)0); } else sh_xfree((oldnames), "bashline.c", 3043); sh_xfree((newnames), "bashline.c", 3045); return; } if (force_fignore == 0) { while (oidx) sh_xfree((oldnames[--oidx]), "bashline.c", 3052); sh_xfree((oldnames), "bashline.c", 3053); } if (nidx == 2) { sh_xfree((names[0]), "bashline.c", 3059); names[0] = newnames[1]; names[1] = (char *)((void *)0); sh_xfree((newnames), "bashline.c", 3062); return; } for (nidx = 1; newnames[nidx]; nidx++) names[nidx] = newnames[nidx]; names[nidx] = (char *)((void *)0); sh_xfree((newnames), "bashline.c", 3071); }
void _ignore_completion_names(unsigned long long a0[2], unsigned long a1) { unsigned long v0; int tmp_33; unsigned int v1; unsigned int v2; unsigned int v3; unsigned long long *v4; unsigned long long v5[2]; unsigned long long v7; unsigned long long v9[2]; unsigned long long v11; unsigned long long v12; unsigned long long v13; v0 = a1; if (!a0[1]) { v7 = *(&force_fignore); if (*(&force_fignore) && !(stack_base)[56](a0[0])) { sh_xfree(a0[0], "bashline.c", 0xbba); v9 = a0; a0[0] = 0; } } else { for (v2 = 1; a0[v2]; v2 += 1) ; v5[0] = strvec_create(v2 + 1); if (!*(&force_fignore)) { v4 = strvec_create(v2 - 1); v3 = 0; } v5[0] = a0[0]; v2 = 1; for (v1 = v2; a0[v1]; v1 += 1) { if ((stack_base)[56](a0[v1])) { tmp_33 = v2; v2 += 1; v5[tmp_33] = a0[v1]; } else if (!*(&force_fignore)) { tmp_33 = v3; v3 += 1; v4[tmp_33] = a0[v1]; } else { sh_xfree(a0[v1], "bashline.c", 0xbd5); } } v5[v2] = 0; if (v2 == 1) { if (*(&force_fignore)) { sh_xfree(a0[0], "bashline.c", 0xbdf); a0[0] = 0; } else { sh_xfree(v4, "bashline.c", 0xbe3); } v11 = sh_xfree(v5, "bashline.c", 0xbe5); } else { if (!*(&force_fignore)) { while (v3) { v3 -= 1; sh_xfree(v4[v3], "bashline.c", 0xbec); } sh_xfree(v4, "bashline.c", 0xbed); } if (v2 == 2) { sh_xfree(a0[0], "bashline.c", 0xbf3); a0[0] = v5[1]; a0[1] = 0; v12 = sh_xfree(v5, "bashline.c", 0xbf6); } else { for (v2 = 1; v5[v2]; v2 += 1) { a0[v2] = v5[v2]; } a0[v2] = 0; v13 = sh_xfree(v5, "bashline.c", 0xbff); } } } return; }
bash
angr_dream
static void close_group_files(void) { if (do_grp_update) { if (gr_close() == 0) { fprintf(stderr, gettext("%s: failure while writing changes to %s\n"), Prog, gr_dbname()); do { char *old_locale = setlocale(6, ((void *)0)); char *saved_locale = ((void *)0); if (((void *)0) != old_locale) { saved_locale = strdup(old_locale); } if (((void *)0) != saved_locale) { (void)setlocale(6, "C"); } syslog(3, "failure while writing changes to %s", gr_dbname()); if (((void *)0) != saved_locale) { (void)setlocale(6, saved_locale); free(saved_locale); } } while (0); fail_exit(10); } if (is_shadow_grp && (sgr_close() == 0)) { fprintf(stderr, gettext("%s: failure while writing changes to %s\n"), Prog, sgr_dbname()); do { char *old_locale = setlocale(6, ((void *)0)); char *saved_locale = ((void *)0); if (((void *)0) != old_locale) { saved_locale = strdup(old_locale); } if (((void *)0) != saved_locale) { (void)setlocale(6, "C"); } syslog(3, "failure while writing changes to %s", sgr_dbname()); if (((void *)0) != saved_locale) { (void)setlocale(6, saved_locale); free(saved_locale); } } while (0); fail_exit(10); } } }
long close_group_files() { long result; long v1; long v2; char *v3; const char *v4; const char *v5; long v6; long v7; char *v8; const char *v9; const char *v10; char *locale; char *v12; const char *s; const char *v14; result = (unsigned char)do_grp_update; if (do_grp_update) { if (!(unsigned int)gr_close()) { v1 = gr_dbname(); v2 = Prog; v3 = gettext("%s: failure while writing changes to %s\n"); fprintf(stderr, v3, v2, v1); s = setlocale(6, 0LL); locale = 0LL; if (s) locale = strdup(s); if (locale) setlocale(6, "C"); v4 = (const char *)gr_dbname(); v5 = "failure while writing changes to %s"; syslog(3, "failure while writing changes to %s", v4); if (locale) { v5 = locale; setlocale(6, locale); free(locale); } fail_exit((char *)&loc_A, v5); } result = (unsigned char)is_shadow_grp; if (is_shadow_grp) { result = sgr_close(); if (!(_DWORD)result) { v6 = sgr_dbname(); v7 = Prog; v8 = gettext("%s: failure while writing changes to %s\n"); fprintf(stderr, v8, v7, v6); v14 = setlocale(6, 0LL); v12 = 0LL; if (v14) v12 = strdup(v14); if (v12) setlocale(6, "C"); v9 = (const char *)sgr_dbname(); v10 = "failure while writing changes to %s"; syslog(3, "failure while writing changes to %s", v9); if (v12) { v10 = v12; setlocale(6, v12); free(v12); } fail_exit((char *)&loc_A, v10); } } } return result; }
shadow
ida
static void print_tunnel(const void *t) { const struct ip6_tnl_parm2 *p = t; char b1[64]; open_json_object(((void *)0)); print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s: ", p->name); snprintf(b1, sizeof(b1), "%s/ipv6", tnl_strproto(p->proto)); print_string(PRINT_ANY, "mode", "%s ", b1); print_string(PRINT_FP, ((void *)0), "%s", "remote "); print_color_string(PRINT_ANY, COLOR_INET6, "remote", "%s ", format_host_r(10, 16, &p->raddr, b1, sizeof(b1))); print_string(PRINT_FP, ((void *)0), "%s", "local "); print_color_string(PRINT_ANY, COLOR_INET6, "local", "%s", rt_addr_n2a_r(10, 16, &p->laddr, b1, sizeof(b1))); if (p->link) { const char *n = ll_index_to_name(p->link); if (n) print_string(PRINT_ANY, "link", " dev %s", n); } if (p->flags & 0x1) print_null(PRINT_ANY, "ip6_tnl_f_ign_encap_limit", " encaplimit none", ((void *)0)); else print_uint(PRINT_ANY, "encap_limit", " encaplimit %u", p->encap_limit); if (p->hop_limit) print_uint(PRINT_ANY, "hoplimit", " hoplimit %u", p->hop_limit); else print_string(PRINT_FP, "hoplimit", " hoplimit %s", "inherit"); if (p->flags & 0x2) { print_null(PRINT_ANY, "ip6_tnl_f_use_orig_tclass", " tclass inherit", ((void *)0)); } else { __u32 val = ntohl(p->flowinfo & htonl(0x0FF00000)); snprintf(b1, sizeof(b1), "0x%02x", (__u8)(val >> 20)); print_string(PRINT_ANY, "tclass", " tclass %s", b1); } if (p->flags & 0x4) { print_null(PRINT_ANY, "ip6_tnl_f_use_orig_flowlabel", " flowlabel inherit", ((void *)0)); } else { __u32 val = ntohl(p->flowinfo & htonl(0x000FFFFF)); snprintf(b1, sizeof(b1), "0x%05x", val); print_string(PRINT_ANY, "flowlabel", " flowlabel %s", b1); } snprintf(b1, sizeof(b1), "0x%08x", ntohl(p->flowinfo)); print_string(PRINT_ANY, "flowinfo", " (flowinfo %s)", b1); if (p->flags & 0x10) print_null(PRINT_ANY, "ip6_tnl_f_rcv_dscp_copy", " dscp inherit", ((void *)0)); if (p->flags & 0x40) print_null(PRINT_ANY, "ip6_tnl_f_allow_local_remote", " allow-localremote", ((void *)0)); tnl_print_gre_flags(p->proto, p->i_flags, p->o_flags, p->i_key, p->o_key); close_json_object(); }
unsigned long print_tunnel(long a1) { const char *v1; const char *v2; const char *v3; int v4; uint32_t v5; int v6; uint32_t v7; uint32_t v8; uint32_t v10; uint32_t v11; long v12; char s[72]; unsigned long v14; v14 = __readfsqword(0x28u); open_json_object(0LL); print_color_string(4LL, 0LL, "ifname", "%s: ", (const char *)a1); v1 = (const char *)tnl_strproto(*(unsigned char *)(a1 + 20)); snprintf(s, 0x40uLL, "%s/ipv6", v1); print_string(4u, (long)"mode", "%s ", (long)s); print_string(1u, 0LL, "%s", (long)"remote "); v2 = (const char *)format_host_r(10LL, 16LL, a1 + 48, s, 64LL); print_color_string(4LL, 3LL, "remote", "%s ", v2); print_string(1u, 0LL, "%s", (long)"local "); v3 = (const char *)rt_addr_n2a_r(10LL, 16LL, a1 + 32, s, 64LL); print_color_string(4LL, 3LL, "local", "%s", v3); if (*(_DWORD *)(a1 + 16)) { v12 = ll_index_to_name(*(unsigned int *)(a1 + 16)); if (v12) print_string(4u, (long)"link", " dev %s", v12); } if ((*(_DWORD *)(a1 + 28) & 1) != 0) print_null(4u, (long)"ip6_tnl_f_ign_encap_limit", (long)" encaplimit none", 0LL); else print_uint(4u, (long)"encap_limit", (long)" encaplimit %u", *(unsigned char *)(a1 + 21)); if (*(_BYTE *)(a1 + 22)) print_uint(4u, (long)"hoplimit", (long)" hoplimit %u", *(unsigned char *)(a1 + 22)); else print_string(1u, (long)"hoplimit", " hoplimit %s", (long)"inherit"); if ((*(_DWORD *)(a1 + 28) & 2) != 0) { print_null(4u, (long)"ip6_tnl_f_use_orig_tclass", (long)" tclass inherit", 0LL); } else { v4 = *(_DWORD *)(a1 + 24); v5 = htonl(0xFF00000u); v10 = ntohl(v4 & v5); snprintf(s, 0x40uLL, "0x%02x", (unsigned char)(v10 >> 20)); print_string(4u, (long)"tclass", " tclass %s", (long)s); } if ((*(_DWORD *)(a1 + 28) & 4) != 0) { print_null(4u, (long)"ip6_tnl_f_use_orig_flowlabel", (long)" flowlabel inherit", 0LL); } else { v6 = *(_DWORD *)(a1 + 24); v7 = htonl(0xFFFFFu); v11 = ntohl(v6 & v7); snprintf(s, 0x40uLL, "0x%05x", v11); print_string(4u, (long)"flowlabel", " flowlabel %s", (long)s); } v8 = ntohl(*(_DWORD *)(a1 + 24)); snprintf(s, 0x40uLL, "0x%08x", v8); print_string(4u, (long)"flowinfo", " (flowinfo %s)", (long)s); if ((*(_DWORD *)(a1 + 28) & 0x10) != 0) print_null(4u, (long)"ip6_tnl_f_rcv_dscp_copy", (long)" dscp inherit", 0LL); if ((*(_DWORD *)(a1 + 28) & 0x40) != 0) print_null(4u, (long)"ip6_tnl_f_allow_local_remote", (long)" allow-localremote", 0LL); tnl_print_gre_flags(*(unsigned char *)(a1 + 20), *(unsigned short *)(a1 + 64), *(unsigned short *)(a1 + 66), *(unsigned int *)(a1 + 68), *(unsigned int *)(a1 + 72)); close_json_object(); return __readfsqword(0x28u) ^ v14; }
iproute2-6.0.0
ida
static void initialize_shell_signals() { if (interactive) initialize_terminating_signals(); sigemptyset(&top_level_mask); sigprocmask(0, (sigset_t *)((void *)0), &top_level_mask); if (sigismember(&top_level_mask, 17)) { sigdelset(&top_level_mask, 17); sigprocmask(2, &top_level_mask, (sigset_t *)((void *)0)); } set_signal_handler(3, ((__sighandler_t)1)); if (interactive) { set_signal_handler(2, sigint_sighandler); get_original_signal(15); set_signal_handler(15, ((__sighandler_t)1)); set_sigwinch_handler(); } }
void initialize_shell_signals() { unsigned long long v1; unsigned long long v2; if (interactive) initialize_terminating_signals(); sigemptyset(&top_level_mask); sigprocmask(0x0, NULL, &top_level_mask); if (sigismember(&top_level_mask, 0x11)) { sigdelset(&top_level_mask, 0x11); sigprocmask(0x2, &top_level_mask, NULL); } set_signal_handler(0x3, 0x1); v1 = interactive; if (interactive) { set_signal_handler(0x2, sigint_sighandler); get_original_signal(0xf); set_signal_handler(0xf, 0x1); v2 = set_sigwinch_handler(); return; } return; }
bash
angr_sailr
static void fillbuf(n) int n; { bitbuf <<= n; while (n > bitcount) { bitbuf |= subbitbuf << (n -= bitcount); subbitbuf = (unsigned)(inptr < insize ? inbuf[inptr++] : fill_inbuf(1)); if ((int)subbitbuf == (-1)) subbitbuf = 0; bitcount = 8; } bitbuf |= subbitbuf >> (bitcount -= n); }
void fillbuf(unsigned long a0) { unsigned int v0; unsigned long v2; unsigned long long v3; v0 = a0; for (bitbuf = bitbuf << (v0 & 31); v0 > bitcount; bitcount = 8) { v0 -= bitcount; bitbuf = bitbuf | (subbitbuf << (v0 & 31)); if (inptr < insize) { inptr = inptr + 1; v2 = *(inptr + &inbuf); } else { v2 = fill_inbuf(0x1); } subbitbuf = v2; if (subbitbuf == -1) subbitbuf = 0; } bitcount = bitcount - v0; v3 = bitbuf | (subbitbuf >> (bitcount & 31)); bitbuf = bitbuf | (subbitbuf >> (bitcount & 31)); return; }
gzip-1.12
angr_dream
char *user_from_uid(uid_t uid, int nouser) { static struct ncache { uid_t uid; char *name; } c_uid[64]; static int pwopen; static char nbuf[15]; struct passwd *pw; struct ncache *cp; cp = c_uid + (uid & (64 - 1)); if (cp->uid != uid || cp->name == ((void *)0)) { if (pwopen == 0) { pwopen = 1; } if ((pw = getpwuid(uid)) == ((void *)0)) { if (nouser) return (((void *)0)); (void)snprintf(nbuf, sizeof(nbuf), "%lu", (u_long)uid); } cp->uid = uid; if (cp->name != ((void *)0)) free(cp->name); cp->name = strdup(pw ? pw->pw_name : nbuf); } return (cp->name); }
undefined8 user_from_uid(uint param_1, int param_2) { long lVar1; passwd *ppVar2; undefined1 *__s; char *pcVar3; lVar1 = (ulong)(param_1 & 0x3f) * 0x10; if ((param_1 != *(uint *)(c_uid_6366 + lVar1)) || (*(long *)(c_uid_6366 + lVar1 + 8) == 0)) { if (pwopen_6367 == 0) { pwopen_6367 = 1; } ppVar2 = getpwuid(param_1); if (ppVar2 == (passwd *)0x0) { if (param_2 != 0) { return 0; } snprintf(nbuf_6368, 0xf, "%lu", (ulong)param_1); } *(uint *)(c_uid_6366 + lVar1) = param_1; if (*(long *)(c_uid_6366 + lVar1 + 8) != 0) { free(*(void **)(c_uid_6366 + lVar1 + 8)); } if (ppVar2 == (passwd *)0x0) { __s = nbuf_6368; } else { __s = ppVar2->pw_name; } pcVar3 = strdup(__s); *(char **)(c_uid_6366 + lVar1 + 8) = pcVar3; } return *(undefined8 *)(c_uid_6366 + lVar1 + 8); }
openssh-portable
ghidra
cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; size_t size; size = (size_t)(el->el_line.lastchar - el->el_line.buffer); vu->len = (ssize_t)size; vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer); (void)memcpy(vu->buf, el->el_line.buffer, size * sizeof(*vu->buf)); r->count = el->el_state.doingarg ? el->el_state.argument : 0; r->action = el->el_chared.c_vcmd.action; r->pos = r->buf; r->cmd = el->el_state.thiscmd; r->ch = el->el_state.thisch; }
void cv_undo(struct_0 *a0) { struct_1 *v0; struct_2 *v1; unsigned long long v2; unsigned int v4; struct_2 *v5; v0 = &a0->padding_88[736]; v1 = &a0->padding_88[784]; v2 = a0->field_60 - a0->field_50 >> 2; v0->field_0 = v2; v0->field_8 = a0->field_58 - a0->field_50 >> 2; memcpy(v0->field_10, a0->field_50, v2 * 4); if (a0->field_74) v4 = a0->field_78; else v4 = 0; v1->field_20 = v4; v1->field_24 = a0->field_3c0; v1->field_8 = v1->field_0; v1->field_18 = a0->field_81; v5 = v1; v1->field_1c = a0->field_84; return; }
libedit
angr_dream
static void print_rxsa_stats(const char *prefix, struct rtattr *attr) { struct rtattr *stats[MACSEC_SA_STATS_ATTR_MAX + 1]; if (!attr || show_stats == 0) return; (parse_rtattr_flags( (stats), (MACSEC_SA_STATS_ATTR_MAX), ((void *)(((char *)(attr)) + ((((sizeof(struct rtattr)) + 4U - 1) & ~(4U - 1)) + (0)))), ((int)((attr)->rta_len) - ((((sizeof(struct rtattr)) + 4U - 1) & ~(4U - 1)) + (0))), (1 << 15))); print_stats(prefix, rxsa_stats_names, NUM_MACSEC_SA_STATS_ATTR, stats); }
void print_rxsa_stats(unsigned int a0, unsigned short *a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) { char v0; char v1; unsigned long long *v3; unsigned long long v4; if (a1 && show_stats) { parse_rtattr_flags(&v0, 0x7, a1 + 2, *(a1)-4, 0x8000); print_stats(a0, &rxsa_stats_names, 0x8, &v0, 0x8000, a5); } v4 = *(&v1) ^ v3[5]; return; }
iproute2-6.0.0
angr_phoenix
void rl_display_match_list(char **matches, int len, int max) { fn_display_match_list(e, matches, (size_t)len, (size_t)max, _rl_completion_append_character_function); }
void rl_display_match_list(undefined8 param_1, int param_2, int param_3) { fn_display_match_list(e, param_1, (long)param_2, (long)param_3, _rl_completion_append_character_function); return; }
libedit
ghidra
void ssh_packet_set_server(struct ssh *ssh) { ssh->state->server_side = 1; ssh->kex->server = 1; }
void ssh_packet_set_server(long *param_1) { *(undefined4 *)(*param_1 + 0x144) = 1; *(undefined4 *)(param_1[1] + 0x18) = 1; return; }
openssh-portable
ghidra
static void cfg_file_free(struct cfg_file *f) { free(f); }
void cfg_file_free(void *a1) { free(a1); }
kmod
ida
static void usage(void) { print_usage(stderr); }
void usage() { unsigned long long v1; v1 = print_usage(stderr); return; }
iproute2-6.0.0
angr_phoenix
void issue_warn(int mins) { char buf[256 + sizeof(newstate) + 1]; int len; buf[0] = 0; strncpy(buf, message, 256); len = strlen(buf); if (mins == 0) snprintf(buf + len, sizeof(buf) - len, "\rThe system is going down %s NOW!\r\n", newstate); else snprintf(buf + len, sizeof(buf) - len, "\rThe system is going DOWN %s in %d minute%s!\r\n", newstate, mins, mins == 1 ? "" : "s"); wall(buf, 0); }
void issue_warn(unsigned long a0) { unsigned int v0; char v1; char v2; unsigned int v4; unsigned long long *v5; unsigned long long v6; v1 = 0; strncpy(&v1, &newstate, 0x100); v0 = strlen(&v1); if (!a0) { snprintf(&(&v1)[v0], 321 - v0, "\rThe system is going down %s NOW!\r\n", &newstate); } else { if (a0 == 1) v4 = &g_402054; else v4 = &g_402055; snprintf(&(&v1)[v0], 321 - v0, "\rThe system is going DOWN %s in %d minute%s!\r\n", &newstate, a0, v4); } wall(&v1, 0x0); v6 = *(&v2) ^ v5[5]; return; }
sysvinit
angr_dream
void set_exit_status(int val) { if (val > exit_status) exit_status = val; }
void set_exit_status(unsigned long a0) { unsigned int v0; unsigned long long v2; unsigned long v3; v0 = a0; v2 = exit_status; if (a0 > exit_status) { v3 = a0; exit_status = a0; } return; }
tar
angr_dream
static WORD_LIST *expand_string_for_pat(string, quoted, dollar_at_p, expanded_p) char *string; int quoted, *dollar_at_p, *expanded_p; { WORD_DESC td; WORD_LIST *tresult; int oexp; if (string == 0 || *string == '\0') return (WORD_LIST *)((void *)0); oexp = expand_no_split_dollar_star; expand_no_split_dollar_star = 1; td.flags = (1 << 6); td.word = (char *)strcpy(sh_xmalloc((1 + strlen(string)), "subst.c", 4561), (string)); tresult = call_expand_word_internal(&td, quoted, 1, dollar_at_p, expanded_p); expand_no_split_dollar_star = oexp; sh_xfree((td.word), "subst.c", 4564); return (tresult); }
long **expand_string_for_pat(const char *a1, unsigned int a2, _DWORD *a3, _DWORD *a4) { size_t v5; char *v6; int v9; long **v10; char *v11; int v12; unsigned long v13; v13 = __readfsqword(0x28u); if (!a1 || !*a1) return 0LL; v9 = expand_no_split_dollar_star; expand_no_split_dollar_star = 1; v12 = 64; v5 = strlen(a1); v6 = (char *)sh_xmalloc(v5 + 1, "subst.c", 4561LL); v11 = strcpy(v6, a1); v10 = call_expand_word_internal(&v11, a2, 1, a3, a4); expand_no_split_dollar_star = v9; sh_xfree(v11, "subst.c", 4564LL); return v10; }
bash
ida
static void index_write(const struct index_node *node, FILE *out) { long initial_offset, final_offset; uint32_t u; u = htonl(0xB007F457); fwrite(&u, sizeof(u), 1, out); u = htonl(((0x0002 << 16) | 0x0001)); fwrite(&u, sizeof(u), 1, out); initial_offset = ftell(out); ((void)sizeof((initial_offset >= 0) ? 1 : 0), __extension__({ if (initial_offset >= 0) ; else __assert_fail("initial_offset >= 0", "tools/depmod.c", 417, __extension__ __PRETTY_FUNCTION__); })); u = 0; fwrite(&u, sizeof(uint32_t), 1, out); u = htonl(index_write__node(node, out)); final_offset = ftell(out); ((void)sizeof((final_offset >= 0) ? 1 : 0), __extension__({ if (final_offset >= 0) ; else __assert_fail("final_offset >= 0", "tools/depmod.c", 426, __extension__ __PRETTY_FUNCTION__); })); (void)fseek(out, initial_offset, 0); fwrite(&u, sizeof(uint32_t), 1, out); (void)fseek(out, final_offset, 0); }
unsigned long index_write(long a1, FILE *a2) { uint32_t v2; uint32_t ptr; long off; long v6; unsigned long v7; v7 = __readfsqword(0x28u); ptr = htonl(0xB007F457); fwrite(&ptr, 4uLL, 1uLL, a2); ptr = htonl(0x20001u); fwrite(&ptr, 4uLL, 1uLL, a2); off = ftell(a2); if (off < 0) _assert_fail("initial_offset >= 0", "tools/depmod.c", 0x1A1u, "index_write"); ptr = 0; fwrite(&ptr, 4uLL, 1uLL, a2); v2 = index_write__node(a1, a2); ptr = htonl(v2); v6 = ftell(a2); if (v6 < 0) _assert_fail("final_offset >= 0", "tools/depmod.c", 0x1AAu, "index_write"); fseek(a2, off, 0); fwrite(&ptr, 4uLL, 1uLL, a2); fseek(a2, v6, 0); return __readfsqword(0x28u) ^ v7; }
kmod
ida
static VALUE *eval4(_Bool evaluate) { VALUE *l; VALUE *r; enum { multiply, divide, mod } fxn; l = eval5(evaluate); while (1) { if (nextarg("*")) fxn = multiply; else if (nextarg("/")) fxn = divide; else if (nextarg("%")) fxn = mod; else return l; r = eval5(evaluate); if (evaluate) { if (!toarith(l) || !toarith(r)) ((!!sizeof(struct { _Static_assert(EXPR_INVALID, "verify_expr (" "EXPR_INVALID" ", " "(error (EXPR_INVALID, 0, gettext (\"non-integer " "argument\")), assume (false))" ")"); int _gl_dummy; })) ? ((error(EXPR_INVALID, 0, gettext("non-integer argument")), ((0) ? (void)0 : __builtin_unreachable()))) : ((error(EXPR_INVALID, 0, gettext("non-integer argument")), ((0) ? (void)0 : __builtin_unreachable())))); if (fxn != multiply && ((r->u.i)->_mp_size < 0 ? -1 : (r->u.i)->_mp_size > 0) == 0) ((!!sizeof(struct { _Static_assert(EXPR_INVALID, "verify_expr (" "EXPR_INVALID" ", " "(error (EXPR_INVALID, 0, gettext (\"division by " "zero\")), assume (false))" ")"); int _gl_dummy; })) ? ((error(EXPR_INVALID, 0, gettext("division by zero")), ((0) ? (void)0 : __builtin_unreachable()))) : ((error(EXPR_INVALID, 0, gettext("division by zero")), ((0) ? (void)0 : __builtin_unreachable())))); ((fxn == multiply ? __gmpz_mul : fxn == divide ? __gmpz_tdiv_q : __gmpz_tdiv_r)(l->u.i, l->u.i, r->u.i)); } freev(r); } }
int eval4(unsigned long a0) { unsigned int v0; void *v1; struct_0 *v2; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; v1 = eval5(a0); while (true) { v4 = nextarg("*"); if (v4) { v0 = 0; } else { v4 = nextarg("/"); if (v4) { v0 = 1; } else { v4 = nextarg("%"); if (v4) v0 = 2; else return v1; } } if (v4 || v4 || v4) { v2 = eval5(a0); if (a0) { *(&v4) = toarith(v1) ^ 1; if (v4) break; if (!v4) { *(&v4) = toarith(v2) ^ 1; if (v4) break; } if (!v4) { if (v0 && v2->field_c >= 0 && v2->field_c <= 0) error(0x2, 0x0, gettext("division by zero")); if (v2->field_c < 0 || !v0 || v2->field_c > 0) { if (!v0) { v5 = got.__gmpz_mul; } else if (v0 == 1) { v6 = got.__gmpz_tdiv_q; } else { v7 = got.__gmpz_tdiv_r; } reg_16(v1 + 8, v1 + 8, &v2->padding_0[8], v1 + 8); } } } if (!v4 || v2->field_c > 0) freev(v2); } } error(0x2, 0x0, gettext("non-integer argument")); }
coreutils
angr_dream
printversion(const struct cmdinfo *ci, const char *value) { if (f_robot) { printf("%s", "1.20.12"); } else { printf(gettext("Debian '%s' package management program version %s.\n"), "dpkg", "1.20.12" " (" "amd64" ")"); printf(gettext("This is free software; see the GNU General Public License " "version 2 or\n" "later for copying conditions. There is NO warranty.\n") ); } m_output(stdout, gettext("<standard output>")); exit(0); }
long long printversion() { unsigned long v0; unsigned long v1; unsigned long v3; unsigned long v4; unsigned long long v5; v1 = v3; v0 = v4; if (f_robot) { printf("%s", &g_401340); } else { printf(gettext("Debian '%s' package management program version %s.\n")); printf(gettext( "This is free software; see the GNU General Public License version 2 " "or\nlater for copying conditions. There is NO warranty.\n")); } v5 = gettext("<standard output>"); m_output(stdout, v5, v5); exit(0x0); }
dpkg
angr_sailr
do { v = bind_variable("BASH_COMMAND", ((char *)((void *)0)), 0); v->dynamic_value = get_bash_command; v->assign_func = (sh_var_assign_func_t *)((void *)0); } while (0);
long bind_variable(const char *a1, char *a2, int a3) { const char *v4; char *v5; long v7; const char **v8; long i; long variable_nameref_context; unsigned long v11; v11 = __readfsqword(0x28u); if (!shell_variables) create_variable_tables(); if (temporary_env && a2) bind_tempenv_variable((long)a1, a2); for (i = shell_variables;; i = *(_QWORD *)(i + 24)) { if (!i) return bind_variable_internal(a1, a2, *(_QWORD *)(global_variables + 32), 0, a3); if ((*(_DWORD *)(i + 12) & 4) != 0 || (*(_DWORD *)(i + 12) & 8) != 0) break; LABEL_26:; } v8 = (const char **)hash_lookup((long)a1, *(_QWORD *)(i + 32)); v7 = i; if (!v8 || ((_DWORD)v8[5] & 0x800) == 0) { LABEL_24: if (v8) return bind_variable_internal(*v8, a2, *(_QWORD *)(v7 + 32), 0, a3); goto LABEL_26; } variable_nameref_context = (long)find_variable_nameref_context(v8, i, &v7); if (variable_nameref_context) { if ((_UNKNOWN *)variable_nameref_context == &nameref_maxloop_value) { LABEL_20: v4 = *v8; v5 = gettext("%s: circular name reference"); internal_warning(v5, v4); return bind_global_variable(*v8, a2, a3); } v8 = (const char **)variable_nameref_context; goto LABEL_24; } variable_nameref_context = find_variable_last_nameref_context(v8, i, &v7); if (!variable_nameref_context || (*(_DWORD *)(variable_nameref_context + 40) & 0x800) == 0) { if ((_UNKNOWN *)variable_nameref_context == &nameref_maxloop_value) goto LABEL_20; v8 = (const char **)variable_nameref_context; goto LABEL_24; } if (!*(_QWORD *)(variable_nameref_context + 8)) return bind_variable_internal(*(const char **)variable_nameref_context, a2, *(_QWORD *)(v7 + 32), 0, a3); if ((unsigned int)valid_array_reference( *(_QWORD *)(variable_nameref_context + 8), 0LL)) return assign_array_element(*(_QWORD *)(variable_nameref_context + 8), a2, (unsigned int)a3, 0LL); return bind_variable_internal(*(const char **)(variable_nameref_context + 8), a2, *(_QWORD *)(v7 + 32), 0, a3); }
bash
ida
static speed_t string_to_baud(char const *arg) { for (int i = 0; speeds[i].string != ((void *)0); ++i) if ((strcmp(arg, speeds[i].string) == 0)) return speeds[i].speed; return (speed_t)-1; }
int string_to_baud(char *a0) { unsigned int v0; unsigned int v2; for (v0 = 0; speeds[2 * v0 + v0]; v0 += 1) { if (!strcmp(a0, speeds[2 * v0 + v0])) { v2 = (&g_407288)[3 * v0]; return v2; } } v2 = -1; return v2; }
coreutils
angr_sailr
static void skip_comment(struct parser_st *parser) { int c; c = parser_getc(parser); if (c == (-1)) { return; } if (c == '#') { for (;;) { c = parser_getc(parser); if (c == (-1)) { return; } if (c == '\n') { break; } } } parser_ungetc(parser, c); }
void skip_comment(void *a0) { unsigned int v0; unsigned long long v4; v0 = parser_getc(a0); if (v0 == -1) return; if (v0 == 35) { do { v0 = parser_getc(a0); if (v0 == -1) return; } while (v0 != 10); } v4 = parser_ungetc(a0, v0); return; }
gnutls
angr_sailr
ext2fs_file_acl_block(fs, EXT2_INODE(&inode))) { blk64_t blk = ext2fs_file_acl_block(fs, EXT2_INODE(&inode)); process_pass1b_block(fs, &blk, (-5), 0, 0, &pb); ext2fs_file_acl_block_set(fs, EXT2_INODE(&inode), blk); }
void ext2fs_file_acl_block(void) { halt_baddata(); }
e2fsprogs-1.46.5
ghidra
static inline void emit_ancillary_info(char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { {"[", "test invocation"}, {"coreutils", "Multi-call invocation"}, {"sha224sum", "sha2 utilities"}, {"sha256sum", "sha2 utilities"}, {"sha384sum", "sha2 utilities"}, {"sha512sum", "sha2 utilities"}, {((void *)0), ((void *)0)}}; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && !(strcmp(program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *a0) { unsigned long v0; unsigned long long v1[2]; char *v2; unsigned long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; void *v16; void *v17; char v18; unsigned long long *v21; unsigned long long v22; v4 = "["; v5 = "test invocation"; v6 = "coreutils"; v7 = "Multi-call invocation"; v8 = "sha224sum"; v9 = "sha2 utilities"; v10 = "sha256sum"; v11 = "sha2 utilities"; v12 = "sha384sum"; v13 = "sha2 utilities"; v14 = "sha512sum"; v15 = "sha2 utilities"; v16 = 0; v17 = 0; v0 = a0; for (v1[0] = &v4; v1[0] && strcmp(a0, v1[0]); v1[0] = v1 + 1) ; if (v1[1]) v0 = v1[1]; printf(gettext("\n%s online help: <%s>\n")); v2 = setlocale(0x5, NULL); if (v2 && strncmp(v2, "en_", 0x3)) fputs_unlocked(gettext("Report any translation bugs to <https: *(&v3) = (!strcmp(a0, "[") ? a0 : "test"); printf(gettext("Full documentation <%s%s>\n")); printf(gettext("or available locally via: info '(coreutils) %s%s'\n")); v22 = *(&v18) ^ v21[5]; return; }
coreutils
angr_sailr
static int iptoken_set(int argc, char **argv, _Bool delete) { struct { struct nlmsghdr n; struct ifinfomsg ifi; char buf[512]; } req = { .n.nlmsg_len = ((sizeof(struct ifinfomsg)) + ((int)(((sizeof(struct nlmsghdr)) + 4U - 1) & ~(4U - 1)))), .n.nlmsg_flags = 0x01, .n.nlmsg_type = RTM_SETLINK, .ifi.ifi_family = 10, }; struct rtattr *afs, *afs6; _Bool have_token = delete, have_dev = 0; inet_prefix addr = { .bytelen = 16, }; while (argc > 0) { if (strcmp(*argv, "dev") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while (0); if (!have_dev) { if ((req.ifi.ifi_index = ll_name_to_index(*argv)) == 0) invarg("dev is invalid\n", *argv); have_dev = 1; } } else { if (matches(*argv, "help") == 0) usage(); if (!have_token) { get_prefix(&addr, *argv, req.ifi.ifi_family); have_token = 1; } } argc--; argv++; } if (!have_token) { fprintf(stderr, "Not enough information: token is required.\n"); return -1; } if (!have_dev) { fprintf(stderr, "Not enough information: \"dev\" argument is required.\n"); return -1; } afs = addattr_nest(&req.n, sizeof(req), IFLA_AF_SPEC); afs6 = addattr_nest(&req.n, sizeof(req), 10); addattr_l(&req.n, sizeof(req), IFLA_INET6_TOKEN, &addr.data, addr.bytelen); addattr_nest_end(&req.n, afs6); addattr_nest_end(&req.n, afs); if (rtnl_talk(&rth, &req.n, ((void *)0)) < 0) return -2; return 0; }
void iptoken_set(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned long long *v0; unsigned int v1; char v2; char v3; unsigned long long v4; unsigned long long v5; char v6; unsigned short v7; char v8; void *v9; unsigned short v10; unsigned short v11; char v12; unsigned int v13; unsigned long long v15; unsigned long long *v16; unsigned long v17; unsigned long long *v18; unsigned long long v19; unsigned long long v20; unsigned long long v21; unsigned long long v22; unsigned long long v24; void *v25; v1 = a0; v0 = a1; v15 = 68; for (v16 = &v9; v15; v16 = &v16[v17]) { v15 -= 1; v9 = 0; } v9 = 32; v10 = 19; v11 = 1; v12 = 10; v2 = a2; v3 = 0; v19 = 33; for (v18 = &v6; v19; v18 = &v18[v17]) { v19 -= 1; v6 = 0; } for (v7 = 16; v1 > 0; v0 += 1) { v20 = strcmp(*(v0), "dev"); if (!v20) { v0 += 1; v1 -= 1; if (v1 <= 0) incomplete_command(); if ((v3 ^ 1)) { v13 = ll_name_to_index(*(v0)); if (!v13) invarg("dev is invalid\n", *(v0)); v3 = 1; } } else { *(&v20) = matches(*(v0), "help") ^ 1; if (v20) { usage(); } else if ((v2 ^ 1)) { get_prefix(&v6, *(v0), v12, *(v0)); v2 = 1; } } if (!v20 || !v20) v1 -= 1; } if ((v2 ^ 1)) { fprintf(*(&stderr), "Not enough information: token is required.\n"); v21 = 4294967295; } else if ((v3 ^ 1)) { fprintf(*(&stderr), "Not enough information: \"dev\" argument is required.\n"); v22 = 4294967295; } else { v4 = addattr_nest(&v9, 0x220, 0x1a); v5 = addattr_nest(&v9, 0x220, 0xa); addattr_l(&v9, 0x220, 0x7, &v8, v7); addattr_nest_end(&v9, v5, v5); addattr_nest_end(&v9, v4, v4); if (rtnl_talk(0x500090, &v9, 0x0) < 0) v24 = 4294967294; else v25 = 0; } return; }
iproute2-6.0.0
angr_dream
static void mergelines(struct line *__restrict__ t, size_t nlines, struct line const *__restrict__ lo) { size_t nlo = nlines / 2; size_t nhi = nlines - nlo; struct line *hi = t - nlo; while (1) if (compare(lo - 1, hi - 1) <= 0) { *--t = *--lo; if (!--nlo) { return; } } else { *--t = *--hi; if (!--nhi) { do *--t = *--lo; while (--nlo); return; } } }
unsigned char *mergelines(unsigned char **a1, unsigned long a2, unsigned char **a3) { unsigned char *v3; unsigned char *result; unsigned char *v5; unsigned char *v6; unsigned char *v7; unsigned char *v8; unsigned char *v9; unsigned char **v11; unsigned long v12; long v13; unsigned char **v14; v11 = a1; v12 = a2 >> 1; v13 = a2 - (a2 >> 1); v14 = &a1[-4 * (a2 >> 1)]; do { while ((int)compare(a3 - 4, v14 - 4) <= 0) { a3 -= 4; v11 -= 4; v3 = a3[1]; *v11 = *a3; v11[1] = v3; result = a3[2]; v5 = a3[3]; v11[2] = result; v11[3] = v5; if (!--v12) return result; } v14 -= 4; v11 -= 4; v6 = v14[1]; *v11 = *v14; v11[1] = v6; v7 = v14[3]; v11[2] = v14[2]; v11[3] = v7; --v13; } while (v13); do { a3 -= 4; v11 -= 4; v8 = a3[1]; *v11 = *a3; v11[1] = v8; result = a3[2]; v9 = a3[3]; v11[2] = result; v11[3] = v9; --v12; } while (v12); return result; }
coreutils
ida
static void uname_coder(struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, void const *data __attribute__((unused))) { code_string(st->uname, keyword, xhdr); }
long long uname_coder(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long a3) { unsigned long v0; v0 = a3; return code_string(a0->field_20, a1, a2); }
tar
angr_sailr
int _rl_null_function(int count, int key) { return 0; }
long long _rl_null_function(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; v1 = a0; v0 = a1; return 0; }
bash
angr_dream
static inline void emit_ancillary_info(char const *program) { struct infomap { char const *program; char const *node; } const infomap[] = { {"[", "test invocation"}, {"coreutils", "Multi-call invocation"}, {"sha224sum", "sha2 utilities"}, {"sha256sum", "sha2 utilities"}, {"sha384sum", "sha2 utilities"}, {"sha512sum", "sha2 utilities"}, {((void *)0), ((void *)0)}}; char const *node = program; struct infomap const *map_prog = infomap; while (map_prog->program && !(strcmp(program, map_prog->program) == 0)) map_prog++; if (map_prog->node) node = map_prog->node; printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https: char const *lc_messages = setlocale ( 5 , ((void *)0) ); if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1)) { fputs_unlocked (gettext ("Report any translation bugs to " "<https: stdout ) ; } char const *url_program = (strcmp (program, "[") == 0) ? "test" : program; printf (gettext ("Full documentation <%s%s>\n"), "https: printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"), node, node == program ? " invocation" : ""); }
void emit_ancillary_info(char *a0) { unsigned long v0; unsigned long long v1[2]; char *v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; void *v16; void *v17; char v18; unsigned long long v23; unsigned long long *v24; unsigned long long v25; v4 = "["; v5 = "test invocation"; v6 = "coreutils"; v7 = "Multi-call invocation"; v8 = "sha224sum"; v9 = "sha2 utilities"; v10 = "sha256sum"; v11 = "sha2 utilities"; v12 = "sha384sum"; v13 = "sha2 utilities"; v14 = "sha512sum"; v15 = "sha2 utilities"; v16 = 0; v17 = 0; v0 = a0; for (v1[0] = &v4; v1[0]; v1[0] = v1 + 1) { if (!strcmp(a0, v1[0])) break; } if (v1[1]) v0 = v1[1]; printf(gettext("\n%s online help: <%s>\n")); v2 = setlocale(0x5, NULL); if (v2 && strncmp(v2, "en_", 0x3)) fputs_unlocked(gettext("Report any translation bugs to <https: if (strcmp(a0, "[")) v23 = a0; else v23 = "test"; v3 = v23; printf(gettext("Full documentation <%s%s>\n")); printf(gettext("or available locally via: info '(coreutils) %s%s'\n")); v25 = *(&v18) ^ v24[5]; return; }
coreutils
angr_dream
int main(argc, argv) int argc; char **argv; { int opt, oflags; char dv[128], *rv; if (progname = strrchr(argv[0], '/')) progname++; else progname = argv[0]; oflags = 0; while ((opt = getopt(argc, argv, "hrvmpslx")) != (-1)) { switch (opt) { case 'h': usage(); exit(0); case 'r': oflags |= 0x0001; break; case 'v': oflags |= 0x0002; break; case 'm': oflags |= 0x0004; break; case 'p': oflags |= 0x0008; break; case 's': oflags |= 0x0010; break; case 'l': oflags |= 0x0020; break; case 'x': oflags |= 0x0040; break; default: usage(); exit(2); } } argc -= optind; argv += optind; if (argc > 0) { usage(); exit(2); } if (oflags == 0) oflags = 0x0010; if (oflags & (0x0001 | 0x0002)) { strcpy(dv, dist_version); rv = strchr(dv, '.'); if (rv) *rv++ = '\0'; else rv = "00"; } if (oflags & 0x0001) printf("%s\n", dv); else if (oflags & 0x0002) printf("%s\n", rv); else if (oflags & 0x0004) printf("%s\n", "x86_64-pc-linux-gnu"); else if (oflags & 0x0008) printf("%d\n", patch_level); else if (oflags & 0x0010) printf("%s\n", shell_version_string()); else if (oflags & 0x0020) show_shell_version(0); else if (oflags & 0x0040) show_shell_version(1); exit(0); }
int main(unsigned long a0) { unsigned long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned long long v4; char v5; unsigned long v6; char **v8; unsigned long long *v9; char *v10; v1 = a0; v0 = v8; v6 = v9[5]; progname = strrchr(*(v0), 0x2f); progname = 5260204364652186441; if (false) progname = *(v0); v2 = 0; while (true) { v3 = getopt(v1, v0, "hrvmpslx"); if (v3 == -1) break; switch (v3) { case 104: usage(); exit(0x0); case 108: v2 |= 32; break; case 109: v2 |= 4; break; case 112: v2 |= 8; break; case 114: v2 |= 1; break; case 115: v2 |= 16; break; case 118: v2 |= 2; break; case 120: v2 |= 64; break; default: usage(); exit(0x2); } } v1 -= optind; v0 = &v0[optind]; if (v1 > 0) { usage(); exit(0x2); } if (!v2) v2 = 16; if ((v2 & 3)) { strcpy(&v5, dist_version); v4 = strchr(&v5, 0x2e); if (v4) { v10 = v4; v4 += 1; *(v10) = 0; } else { v4 = "00"; } } if ((v2 & 1)) { printf("%s\n", &v5); } else if ((v2 & 2)) { printf("%s\n", v4); } else if ((v2 & 4)) { printf("%s\n", &g_400384); } else if ((v2 & 8)) { printf("%d\n", patch_level); } else if ((v2 & 16)) { printf("%s\n", shell_version_string()); } else if ((v2 & 32)) { show_shell_version(0x0); } else if ((v2 & 64)) { show_shell_version(0x1); } exit(0x0); }
bash
angr_dream
static char *limfield(struct line const *line, struct keyfield const *key) { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; if (echar == 0) eword++; if (tab != TAB_DEFAULT) while (ptr < lim && eword--) { while (ptr < lim && *ptr != tab) ++ptr; if (ptr < lim && (eword || echar)) ++ptr; } else while (ptr < lim && eword--) { while (ptr < lim && blanks[to_uchar(*ptr)]) ++ptr; while (ptr < lim && !blanks[to_uchar(*ptr)]) ++ptr; } if (echar != 0) { if (key->skipeblanks) while (ptr < lim && blanks[to_uchar(*ptr)]) ++ptr; ptr = (((lim) < (ptr + echar)) ? (lim) : (ptr + echar)); } return ptr; }
unsigned char *limfield(long a1, long a2) { unsigned char *v4; unsigned char *v6; long v7; unsigned long v8; long v9; v6 = *(unsigned char **)a1; v8 = *(_QWORD *)(a1 + 8) - 1LL + *(_QWORD *)a1; v7 = *(_QWORD *)(a2 + 16); v9 = *(_QWORD *)(a2 + 24); if (!v9) ++v7; if (tab == 128) { while ((unsigned long)v6 < v8) { if (!v7--) break; while ((unsigned long)v6 < v8 && blanks[(unsigned char)to_uchar(*v6)]) ++v6; while ((unsigned long)v6 < v8 && blanks[(unsigned char)to_uchar(*v6)] != 1) ++v6; } } else { while ((unsigned long)v6 < v8) { if (!v7--) break; while ((unsigned long)v6 < v8 && (char)*v6 != tab) ++v6; if ((unsigned long)v6 < v8 && (v7 || v9)) ++v6; } } if (v9) { if (*(_BYTE *)(a2 + 49)) { while ((unsigned long)v6 < v8 && blanks[(unsigned char)to_uchar(*v6)]) ++v6; } v4 = &v6[v9]; if (v8 <= (unsigned long)&v6[v9]) return (unsigned char *)v8; return v4; } return v6; }
coreutils
ida
int hddown(void) { unsigned int flags; char *disk; DIR *blk; if ((blk = opendir("/sys/block")) == (DIR *)0) return -1; while ((disk = list_disks(blk, &flags))) do_standby_disk(disk, flags); return closedir(blk); }
int hddown() { int v1; DIR *dirp; char *v3; unsigned long v4; v4 = __readfsqword(0x28u); dirp = opendir("/sys/block"); if (!dirp) return -1; while (1) { v3 = list_disks(dirp, &v1); if (!v3) break; do_standby_disk(v3, v1); } return closedir(dirp); }
sysvinit
ida
static inline void emit_stdin_note(void) { fputs_unlocked( gettext("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout) ; }
void emit_stdin_note() { unsigned long long v1; v1 = fputs_unlocked( gettext("\nWith no FILE, or when FILE is -, read standard input.\n"), stdout); return; }
coreutils
angr_phoenix
test_code_t test_rsa_pms(gnutls_session_t session) { int ret; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":+RSA:%s", protocol_str, rest); { int _ret; if ((_ret = __gnutls_priority_set_direct(session, prio_str, 1307)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); ret = test_do_handshake(session); if (ret == TEST_FAILED) return TEST_FAILED; if (gnutls_protocol_get_version(session) == GNUTLS_TLS1) return TEST_SUCCEED; return TEST_UNSURE; }
long test_rsa_pms(long a1) { unsigned int v2; sprintf(prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-" "NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:%s", protocol_str, rest); v2 = _gnutls_priority_set_direct(a1, prio_str, 0x51Bu); if (v2) return v2; gnutls_credentials_set(a1, 1LL, xcred); if ((unsigned int)test_do_handshake(a1) == 1) return 1LL; if ((unsigned int)gnutls_protocol_get_version(a1) == 2) return 0LL; return 2LL; }
gnutls
ida
int sshkey_to_certified(struct sshkey *k) { int newtype; switch (k->type) { case KEY_RSA: newtype = KEY_RSA_CERT; break; case KEY_DSA: newtype = KEY_DSA_CERT; break; case KEY_ECDSA: newtype = KEY_ECDSA_CERT; break; case KEY_ECDSA_SK: newtype = KEY_ECDSA_SK_CERT; break; case KEY_ED25519_SK: newtype = KEY_ED25519_SK_CERT; break; case KEY_ED25519: newtype = KEY_ED25519_CERT; break; default: return -10; } if ((k->cert = cert_new()) == ((void *)0)) return -2; k->type = newtype; return 0; }
long long sshkey_to_certified(struct_0 *a0) { unsigned int v0; unsigned long long v2; switch (a0->field_0) { case 0: v0 = 4; break; a0->field_80 = cert_new(); if (!a0->field_80) { v2 = 4294967294; } else { a0->field_0 = v0; v2 = 0; } case 1: v0 = 5; break; case 2: v0 = 6; break; case 3: v0 = 7; break; case 10: v0 = 11; break; case 12: v0 = 13; break; default: v2 = 4294967286; } return v2; }
openssh-portable
angr_dream
int print_color_bool(enum output_type t, enum color_attr color, const char *key, const char *fmt, _Bool value); static inline int print_bool(enum output_type t, const char *key, const char *fmt, _Bool value) { return print_color_bool(t, COLOR_NONE, key, fmt, value); }
void print_color_bool(void) { halt_baddata(); }
iproute2-6.0.0
ghidra
static void simple_flush_write(size_t level __attribute__((unused))) { ssize_t status; status = _flush_write(); if (status != record_size) archive_write_error(status); else { records_written++; bytes_written += status; } }
double simple_flush_write(long long a0) { unsigned long v0; unsigned long long v1; unsigned long long v4; unsigned long long v6; v0 = a0; *(&v1) = _flush_write(); if (v1 != record_size) archive_write_error(v1); continued_file_offset = 16752697132039570249; v4 = v1; xmm0lq<8> = Conv(128->64, (Conv(64->128, Load(addr = 0x404ae8 < 64 >, size = 8, endness = Iend_LE)) + xmm1<16>)) bytes_written = L Conv(128->64, (Conv(64->128, Load(addr = 0x404ae8 < 64 >, size = 8, endness = Iend_LE)) + xmm1<16>))<8> return v6; }
tar
angr_sailr
void internal_debug (const char *format, ...) { return; }
char internal_debug(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long v3; unsigned long v4; unsigned long v5; int v6; int v7; int v8; int v9; int v10; int v11; int v12; int v13; char v15; int v16; int v17; int v18; int v19; int v20; int v21; int v22; int v23; v0 = a0; v1 = a1; v2 = a2; v3 = a3; v4 = a4; v5 = a5; if (v15) { v6 = v16; v7 = v17; v8 = v18; v9 = v19; v10 = v20; v11 = v21; v12 = v22; v13 = v23; } return v15; }
bash
angr_sailr
int ssh_input_append(struct ssh *ssh, const u_char *data, size_t len) { return sshbuf_put(ssh_packet_get_input(ssh), data, len); }
void ssh_input_append(undefined8 param_1, undefined8 param_2, undefined8 param_3) { undefined8 uVar1; uVar1 = ssh_packet_get_input(param_1); sshbuf_put(uVar1, param_2, param_3); return; }
openssh-portable
ghidra
int optionl_stat(const char *name, struct stat *p) { int rv; if (-100 != state.cwd_dir_fd) ((void)sizeof((state.cwd_dir_fd >= 0) ? 1 : 0), __extension__({ if (state.cwd_dir_fd >= 0) ; else __assert_fail("state.cwd_dir_fd >= 0", "util.c", 636, __extension__ __PRETTY_FUNCTION__); })); set_stat_placeholders(p); rv = fstatat(state.cwd_dir_fd, name, p, 0); if (0 == rv) return 0; else return fallback_stat(name, p, rv); }
undefined8 optionl_stat(char *param_1, stat *param_2) { int iVar1; undefined8 uVar2; if ((_error != -100) && (_error < 0)) { __assert_fail("state.cwd_dir_fd >= 0", "util.c", 0x27c, "optionl_stat"); } set_stat_placeholders(); iVar1 = fstatat(_error, param_1, param_2, 0); if (iVar1 == 0) { uVar2 = 0; } else { uVar2 = fallback_stat(param_1, param_2, iVar1); } return uVar2; }
findutils
ghidra
static int parse_link_flags(const char *cmd, char **argv, int argc, int *sflag) { int ch; BSDoptind = BSDoptreset = 1; BSDopterr = 0; *sflag = 0; while ((ch = BSDgetopt(argc, argv, "s")) != -1) { switch (ch) { case 's': *sflag = 1; break; default: sshlog("sftp.c", __func__, 450, 0, SYSLOG_LEVEL_ERROR, ((void *)0), "%s: Invalid flag -%c", cmd, BSDoptopt); return -1; } } return BSDoptind; }
long parse_link_flags(const char *a1, long a2, unsigned int a3, _DWORD *a4) { int i; BSDoptreset = 1; BSDoptind = 1; BSDopterr = 0; *a4 = 0; for (i = BSDgetopt(a3, a2, &unk_98A8); i != -1; i = BSDgetopt(a3, a2, &unk_98A8)) { if (i != 115) { sshlog("sftp.c", "parse_link_flags", 450LL, 0LL, 2LL, 0LL, "%s: Invalid flag -%c", a1, BSDoptopt); return 0xFFFFFFFFLL; } *a4 = 1; } return BSDoptind; }
openssh-portable
ida
static table const *lookup_word(parser_control const *pc, char *word) { char *p; char *q; idx_t wordlen; table const *tp; _Bool period_found; _Bool abbrev; for (p = word; *p; p++) *p = c_toupper(to_uchar(*p)); for (tp = meridian_table; tp->name; tp++) if (strcmp(word, tp->name) == 0) return tp; wordlen = strlen(word); abbrev = wordlen == 3 || (wordlen == 4 && word[3] == '.'); for (tp = month_and_day_table; tp->name; tp++) if ((abbrev ? strncmp(word, tp->name, 3) : strcmp(word, tp->name)) == 0) return tp; if ((tp = lookup_zone(pc, word))) return tp; if (strcmp(word, dst_table[0].name) == 0) return dst_table; for (tp = time_units_table; tp->name; tp++) if (strcmp(word, tp->name) == 0) return tp; if (word[wordlen - 1] == 'S') { word[wordlen - 1] = '\0'; for (tp = time_units_table; tp->name; tp++) if (strcmp(word, tp->name) == 0) return tp; word[wordlen - 1] = 'S'; } for (tp = relative_time_table; tp->name; tp++) if (strcmp(word, tp->name) == 0) return tp; if (wordlen == 1) for (tp = military_table; tp->name; tp++) if (word[0] == tp->name[0]) return tp; for (period_found = 0, p = q = word; (*p = *q); q++) if (*q == '.') period_found = 1; else p++; if (period_found && (tp = lookup_zone(pc, word))) return tp; return ((void *)0); }
int lookup_word(unsigned int a0, char a1[4]) { char v0; char v1; char v2[4]; char v3[4]; unsigned long long v4; unsigned long v5; unsigned int v7; char v8; char v9; for (*(&v2) = a1; v2[0]; *(&v2) = &v2[1]) { v2[0] = c_toupper(to_uchar(v2[0])); } v4 = &meridian_table; while (*(v4)) { if (strcmp(a1, *(v4))) { v4 += 16; } else { v7 = v4; goto LABEL_403f8c; } } v5 = strlen(a1); if (v5 != 3) { if (v5 != 4) { LABEL_403d0d: v8 = 0; v1 = v8; v1 &= 1; v4 = &month_and_day_table; while (true) { if (!*(v4)) { v4 = lookup_zone(a0, a1); if (v4) { v7 = v4; break; } else { if (!strcmp(a1, "DST")) { v7 = &dst_table; break; } else { v4 = &time_units_table; while (true) { if (*(v4)) { if (strcmp(a1, *(v4))) { v4 += 16; } else { v7 = v4; break; } } else { if (a1[1 + v5] == 83) { a1[1 + v5] = 0; v4 = &time_units_table; while (true) { if (!*(v4)) { a1[1 + v5] = 83; break; } else { if (strcmp(a1, *(v4))) { v4 += 16; } else { v7 = v4; goto LABEL_403f8c; } } } } v4 = &relative_time_table; while (true) { if (*(v4)) { if (strcmp(a1, *(v4))) { v4 += 16; } else { v7 = v4; break; } } else { if (v5 == 1) { v4 = &military_table; while (true) { if (!*(v4)) break; if (a1[0] == *(*(v4))) { v7 = v4; goto LABEL_403f8c; } else { v4 += 16; } } } v0 = 0; *(&v3) = a1; *(&v2) = v3; while (true) { v2[0] = v3[0]; if (!v2[0]) break; if (v3[0] == 46) v0 = 1; else v2 = &v2[1]; *(&v3) = &v3[1]; } if (v0) { v4 = lookup_zone(a0, a1); if (v4) { v7 = v4; break; } } v7 = 0; break; } } } } } } } else { if (!v1) v9 = !strcmp(a1, *(v4)); else v9 = !strncmp(a1, *(v4), 0x3); if (!v9) { v4 += 16; } else { v7 = v4; break; } } } } else if (!(a1[3] == 46)) { goto LABEL_403d0d; } } v8 = 1; LABEL_403f8c: return v7; }
gnutls
angr_phoenix
static int start_lines(char const *pretty_filename, int fd, uintmax_t n_lines, uintmax_t *read_pos) { if (n_lines == 0) return 0; while (1) { char buffer[8192]; size_t bytes_read = safe_read(fd, buffer, 8192); if (bytes_read == 0) return -1; if (bytes_read == ((size_t)-1)) { error(0, (*__errno_location()), gettext("error reading %s"), quotearg_style(shell_escape_always_quoting_style, pretty_filename)); return 1; } char *buffer_end = buffer + bytes_read; *read_pos += bytes_read; char *p = buffer; while ((p = memchr(p, line_end, buffer_end - p))) { ++p; if (--n_lines == 0) { if (p < buffer_end) xwrite_stdout(p, buffer_end - p); return 0; } } } }
long start_lines(long a1, unsigned int a2, long a3, _QWORD *a4) { long v5; char *v6; int *v7; char *i; long v10; char *s; long v12; char *v13; char v14[16]; unsigned long v15; v10 = a3; v15 = __readfsqword(0x28u); if (!a3) return 0LL; while (1) { v12 = safe_read(a2, v14, 0x2000LL); if (!v12) return 0xFFFFFFFFLL; if (v12 == -1) break; v13 = &v14[v12]; *a4 += v12; for (i = (char *)memchr(v14, line_end, v13 - v14); i; i = (char *)memchr(s, line_end, v13 - s)) { s = i + 1; if (!--v10) { if (s < v13) xwrite_stdout(s, v13 - s); return 0LL; } } } v5 = quotearg_style(4LL, a1); v6 = gettext("error reading %s"); v7 = _errno_location(); error(0, *v7, v6, v5); return 1LL; }
coreutils
ida
_Bool impl_pred_exec (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { struct exec_val *execp = &pred_ptr->args.exec_vec; char *buf = ((void *)0); const char *target; _Bool result; const _Bool local = is_exec_in_local_dir(pred_ptr->pred_func); const char *prefix; size_t pfxlen; (void)stat_buf; if (local) { if (!record_exec_dir(execp)) { ((!!sizeof(struct { _Static_assert( 1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"Failed to save " "working directory in order to \" \"run a command on %s\"), " "safely_quote_err_filename (0, pathname)), assume (false))" ")"); int _gl_dummy; })) ? ((error(1, (*__errno_location()), gettext("Failed to save working directory in order to " "run a command on %s"), safely_quote_err_filename(0, pathname)), ((0) ? (void)0 : __builtin_unreachable()))) : ((error(1, (*__errno_location()), gettext("Failed to save working directory in order to " "run a command on %s"), safely_quote_err_filename(0, pathname)), ((0) ? (void)0 : __builtin_unreachable())))) ; } target = buf = base_name(state.rel_pathname); if ('/' == target[0]) { prefix = ((void *)0); pfxlen = 0; } else { prefix = "./"; pfxlen = 2u; } } else { ((void)sizeof((execp->wd_for_exec == initial_wd) ? 1 : 0), __extension__({ if (execp->wd_for_exec == initial_wd) ; else __assert_fail("execp->wd_for_exec == initial_wd", "exec.c", 148, __extension__ __PRETTY_FUNCTION__); })); target = pathname; prefix = ((void *)0); pfxlen = 0u; } if (execp->multiple) { bc_push_arg(&execp->ctl, &execp->state, target, strlen(target) + 1, prefix, pfxlen, 0); if (execp->state.todo) state.execdirs_outstanding = 1; result = 1; } else { int i; for (i = 0; i < execp->num_args; ++i) { bc_do_insert(&execp->ctl, &execp->state, execp->replace_vec[i], strlen(execp->replace_vec[i]), prefix, pfxlen, target, strlen(target), 0); } bc_do_exec(&execp->ctl, &execp->state); if ((((execp->last_child_status) & 0x7f) == 0)) { if (0 == (((execp->last_child_status) & 0xff00) >> 8)) result = 1; else result = 0; } else { result = 0; } if (local) free_cwd(execp->wd_for_exec); } if (buf) { ((void)sizeof((local) ? 1 : 0), __extension__({ if (local) ; else __assert_fail("local", "exec.c", 208, __extension__ __PRETTY_FUNCTION__); })); free(buf); } return result; }
long long impl_pred_exec(char *a0, unsigned long a1, unsigned long long *a2) { void *v0; unsigned long v1; char v2; char v3; unsigned int v4; void *v5; void *v6; unsigned long long v7; unsigned long long v8; struct_0 *v9; char v11; unsigned long long v12; v1 = a1; v9 = &a2[7]; v5 = 0; v3 = is_exec_in_local_dir(*(a2)); if (v3) { v11 = record_exec_dir(v9) ^ 1; if (v11) { v12 = safely_quote_err_filename(0x0, a0); error(0x1, *(__errno_location()), gettext("Failed to save working directory in order to run a " "command on %s")); } v5 = base_name(mdir_name); v6 = v5; if (*(v6) == 47) { v7 = 0; v8 = 0; } else { v7 = "./"; v8 = 2; } } else if (v9->field_c0 != initial_wd) { __assert_fail(); } else { v6 = a0; v7 = 0; v8 = 0; } if (!v3 && v9->field_c0 == initial_wd || !v11 && v3) { if (v9->field_0) { v0 = 0; bc_push_arg(&v9->padding_1[7], &v9->padding_1[95], v6, strlen(v6) + 1, v7, v8); if (v9->field_98) safely_quote_err_filename = 1; v2 = 1; } else { for (v4 = 0; v4 < v9->field_b8; v4 += 1) { v0 = 0; bc_do_insert( &v9->padding_1[7], &v9->padding_1[95], *((v9->field_b0 + v4 * 8)), strlen(*((v9->field_b0 + v4 * 8))), v7, v8, v6, strlen(v6)); } bc_do_exec(&v9->padding_1[7], &v9->padding_1[95], &v9->padding_1[95]); if ((v9->field_c8 & 127)) { v2 = 0; } else if (!(v9->field_c8 >> 8)) { v2 = 1; } else { v2 = 0; } if (v3) free_cwd(v9->field_c0); } if (v5) { if (!v3) __assert_fail(); free(v5); } if (!v5 || v3) return v2; } }
findutils
angr_dream
gl_linked_first_node(gl_list_t list) { if (list->count > 0) return list->root.next; else return ((void *)0); }
undefined8 gl_linked_first_node(long param_1) { undefined8 uVar1; if (*(long *)(param_1 + 0x40) == 0) { uVar1 = 0; } else { uVar1 = *(undefined8 *)(param_1 + 0x28); } return uVar1; }
gnutls
ghidra
static void sparse_minor_coder(struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, void const *data) { code_num(st->sparse_minor, keyword, xhdr); }
void sparse_minor_coder(long param_1, undefined8 param_2, undefined8 param_3) { code_num(*(undefined4 *)(param_1 + 0x128), param_2, param_3); return; }
tar
ghidra
static char *stralloc(int len) { char *new = malloc((len + 1) * sizeof(char)); if (!new) { fprintf(stderr, "man2html: out of memory"); exit(1); } return new; }
void *stralloc(int param_1) { void *pvVar1; pvVar1 = malloc((long)(param_1 + 1)); if (pvVar1 == (void *)0x0) { fprintf(stderr, "man2html: out of memory"); exit(1); } return pvVar1; }
bash
ghidra
static void code_time(struct timespec t, char const *keyword, struct xheader *xhdr) { char buf[TIMESPEC_STRSIZE_BOUND]; xheader_print(xhdr, keyword, code_timespec(t, buf)); }
void code_time(undefined8 param_1, undefined8 param_2, undefined8 param_3, undefined8 param_4) { undefined8 uVar1; long in_FS_OFFSET; undefined local_38[40]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); uVar1 = code_timespec(param_1, param_2, local_38); xheader_print(param_4, param_3, uVar1); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
tar
ghidra
static void check_order(struct linebuffer const *prev, struct linebuffer const *current, int whatfile) { if (check_input_order != CHECK_ORDER_DISABLED && ((check_input_order == CHECK_ORDER_ENABLED) || seen_unpairable)) { if (!issued_disorder_warning[whatfile - 1]) { int order; if (hard_LC_COLLATE) order = xmemcoll(prev->buffer, prev->length - 1, current->buffer, current->length - 1); else order = memcmp2(prev->buffer, prev->length - 1, current->buffer, current->length - 1); if (0 < order) { error((check_input_order == CHECK_ORDER_ENABLED ? 1 : 0), 0, gettext("file %d is not in sorted order"), whatfile); issued_disorder_warning[whatfile - 1] = 1; } } } }
void check_order(unsigned long long a0[3], unsigned long long a1[3], unsigned long a2) { unsigned int v0; unsigned long long v2; unsigned long long v3; unsigned long long v4; unsigned long long v7; v2 = check_input_order; switch (check_input_order) { case 2: break; case 1: LABEL_4005ec: v4 = *(a2 + &seen_unpairable) ^ 1; if ((*(a2 + &seen_unpairable) ^ 1)) { if (!hard_LC_COLLATE) v0 = memcmp2(a0[2], a0[1] - 1, a1[2], a1[1] - 1); else v0 = xmemcoll(a0[2], a0[1] - 1, a1[2], a1[1] - 1); if (v0 > 0) { error(check_input_order == 1, 0x0, gettext("file %d is not in sorted order")); v7 = a2 - 1; *(a2 + &seen_unpairable) = 1; break; } } default: v3 = seen_unpairable; if (!seen_unpairable) goto LABEL_4006d9; else goto LABEL_4005ec; } LABEL_4006d9: return; }
coreutils
angr_sailr
static void new_table_block(e2fsck_t ctx, blk64_t first_block, dgrp_t group, const char *name, int num, blk64_t *new_block) { ext2_filsys fs = ctx->fs; dgrp_t last_grp; blk64_t old_block = *new_block; blk64_t last_block; dgrp_t flexbg; unsigned flexbg_size; int i, is_flexbg; char *buf; struct problem_context pctx; clear_problem_context(&pctx); pctx.group = group; pctx.blk = old_block; pctx.str = name; is_flexbg = ext2fs_has_feature_flex_bg(fs->super); if (is_flexbg) { flexbg_size = 1 << fs->super->s_log_groups_per_flex; flexbg = group / flexbg_size; first_block = ext2fs_group_first_block2(fs, flexbg_size * flexbg); last_grp = group | (flexbg_size - 1); if (last_grp >= fs->group_desc_count) last_grp = fs->group_desc_count - 1; last_block = ext2fs_group_last_block2(fs, last_grp); } else last_block = ext2fs_group_last_block2(fs, group); pctx.errcode = ext2fs_get_free_blocks2(fs, first_block, last_block, num, ctx->block_found_map, new_block); if (is_flexbg && (pctx.errcode == (2133571400L))) pctx.errcode = ext2fs_get_free_blocks2(fs, fs->super->s_first_data_block, ext2fs_blocks_count(fs->super), num, ctx->block_found_map, new_block); if (pctx.errcode) { pctx.num = num; fix_problem(ctx, 0x01001E, &pctx); ext2fs_unmark_valid(fs); ctx->flags |= 0x0001; return; } pctx.errcode = ext2fs_get_mem(fs->blocksize, &buf); if (pctx.errcode) { fix_problem(ctx, 0x01001F, &pctx); ext2fs_unmark_valid(fs); ctx->flags |= 0x0001; return; } ext2fs_mark_super_dirty(fs); fs->flags &= ~0x200; pctx.blk2 = *new_block; fix_problem(ctx, (old_block ? 0x010020 : 0x010021), &pctx); pctx.blk2 = 0; for (i = 0; i < num; i++) { pctx.blk = i; ext2fs_mark_block_bitmap2(ctx->block_found_map, (*new_block) + i); if (old_block) { pctx.errcode = io_channel_read_blk64(fs->io, old_block + i, 1, buf); if (pctx.errcode) fix_problem(ctx, 0x010022, &pctx); pctx.blk = (*new_block) + i; pctx.errcode = io_channel_write_blk64(fs->io, pctx.blk, 1, buf); } else { pctx.blk = (*new_block) + i; pctx.errcode = ext2fs_zero_blocks2(fs, pctx.blk, 1, ((void *)0), ((void *)0)); } if (pctx.errcode) fix_problem(ctx, 0x010023, &pctx); } ext2fs_free_mem(&buf); }
void new_table_block(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long *a5) { unsigned long v0; int tmp_24; unsigned long long v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; char v7; unsigned long long v8; struct_1 *v9; unsigned long v10; unsigned long v11; unsigned long v12; void *v13; unsigned int v14; unsigned long v15; unsigned long v16; char v17; unsigned long long v19; unsigned long long v20; unsigned long long *v21; unsigned long long v22; v1 = a1; v0 = a3; v9 = a0->field_0; v10 = *(a5); clear_problem_context(&v11); v14 = a2; v12 = v10; v16 = v0; v4 = ext2fs_has_feature_flex_bg(v9->field_20); if (!v4) { v8 = ext2fs_group_last_block2(v9, a2, a2); } else { v5 = 1 << (v9->field_20->field_174 & 31); v6 = (0 CONCAT a2) / m v5; v1 = ext2fs_group_first_block2(v9, v6 * v5, v6 * v5, v9->field_20->field_174); v2 = v5 - 1 | a2; if (v2 >= v9->field_30) v2 = v9->field_30 - 1; v8 = ext2fs_group_last_block2(v9, v2, v2); } v11 = ext2fs_get_free_blocks2(v9, v1, v8, a4, a0->field_1a0, a5); if (v4 && v11 == 2133571400) v11 = ext2fs_get_free_blocks2(v9, v9->field_20->field_14, ext2fs_blocks_count(v9->field_20), a4, a0->field_1a0, a5); if (v11) { v15 = a4; fix_problem(a0, 0x1001e, &v11); ext2fs_unmark_valid(v9); a0->field_48 = a0->field_48 | 1; } else { v11 = ext2fs_get_mem(v9->field_28, &v7, v9->field_28); if (v11) { fix_problem(a0, 0x1001f, &v11); ext2fs_unmark_valid(v9); a0->field_48 = a0->field_48 | 1; } else { ext2fs_mark_super_dirty(v9); v19 = v9->field_10; *(&v19) = (v9->field_10 >> 8) & 253; tmp_24 = v19; v9->field_10 = tmp_24; v13 = *(a5); if (v10) v20 = 65568; else v20 = 65569; fix_problem(a0, v20, &v11); v13 = 0; for (v3 = 0; v3 < a4; v3 += 1) { v12 = v3; ext2fs_mark_block_bitmap2(a0->field_1a0, *(a5) + v3, *(a5) + v3); if (!v10) { v12 = v3 + *(a5); v11 = ext2fs_zero_blocks2(v9, v12, 0x1, 0x0, 0x0); } else { v11 = io_channel_read_blk64(v9->field_8, v3 + v10, 0x1, *(&v7)); if (v11) fix_problem(a0, 0x10022, &v11); v12 = v3 + *(a5); v11 = io_channel_write_blk64(v9->field_8, v12, 0x1, *(&v7)); } if (v11) fix_problem(a0, 0x10023, &v11); } ext2fs_free_mem(&v7); } } v22 = *(&v17) ^ v21[5]; return; }
e2fsprogs-1.46.5
angr_phoenix
static char *fmt_time(time_t seconds) { int day, hr, min; static char buf[128]; min = (seconds / 60) % 60; hr = (seconds / 60 / 60) % 24; day = seconds / 60 / 60 / 24; if (day > 0) snprintf(buf, sizeof buf, "%dd %d:%02d", day, hr, min); else snprintf(buf, sizeof buf, "%d:%02d", hr, min); return buf; }
int fmt_time(unsigned long long a0) { unsigned int v0; unsigned int v1; unsigned int v2; v0 = ((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) - __mulvdi3( (((((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63)) * 9838263505978427529 >> 64) + ((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 5) - (((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 63), 0x3c, (((((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63)) * 9838263505978427529 >> 64) + ((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 5) - (((a0 * 9838263505978427529 >> 64) + a0 >> 5) - (a0 >> 63) >> 63), a0); v1 = (a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63) - __mulvdi3((((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63)) * 3074457345618258603 >> 64 >> 2) - ((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63) >> 63), 0x18, (((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63)) * 3074457345618258603 >> 64 >> 2) - ((a0 * 5247073869855161349 >> 64 >> 10) - (a0 >> 63) >> 63), a0); v2 = (a0 * 1749024623285053783 >> 64 >> 13) - (a0 >> 63); if (v2 <= 0) snprintf(&buf.17754, 0x80, "%d:%02d", v1, v0); else snprintf(&buf.17754, 0x80, "%dd %d:%02d", v2, v1, v0); return &buf.17754; }
openssh-portable
angr_phoenix
static char *strdelim_internal(char **s, int split_equals) { char *old; int wspace = 0; if (*s == ((void *)0)) return ((void *)0); old = *s; *s = strpbrk(*s, split_equals ? " \t\r\n" "\"" "=" : " \t\r\n" "\""); if (*s == ((void *)0)) return (old); if (*s[0] == '\"') { memmove(*s, *s + 1, strlen(*s)); if ((*s = strpbrk(*s, "\"")) == ((void *)0)) { return (((void *)0)); } else { *s[0] = '\0'; *s += strspn(*s + 1, " \t\r\n") + 1; return (old); } } if (split_equals && *s[0] == '=') wspace = 1; *s[0] = '\0'; *s += strspn(*s + 1, " \t\r\n") + 1; if (split_equals && *s[0] == '=' && !wspace) *s += strspn(*s + 1, " \t\r\n") + 1; return (old); }
const char *strdelim_internal(char **a1, int a2) { const char *v3; size_t v4; const char *v5; const char *v6; const char *v7; int v8; const char *v9; v8 = 0; if (!*a1) return 0LL; v9 = *a1; if (a2) v3 = " \t\r\n\"="; else v3 = " \t\r\n\""; *a1 = strpbrk(*a1, v3); if (!*a1) return v9; if (**a1 == 34) { v4 = strlen(*a1); memmove(*a1, *a1 + 1, v4); *a1 = strpbrk(*a1, "\""); if (*a1) { **a1 = 0; v5 = *a1; *a1 = (char *)&v5[strspn(*a1 + 1, " \t\r\n") + 1]; return v9; } else { return 0LL; } } else { if (a2 && **a1 == 61) v8 = 1; **a1 = 0; v6 = *a1; *a1 = (char *)&v6[strspn(*a1 + 1, " \t\r\n") + 1]; if (a2 && **a1 == 61 && !v8) { v7 = *a1; *a1 = (char *)&v7[strspn(*a1 + 1, " \t\r\n") + 1]; } return v9; } }
openssh-portable
ida
static _Bool parse_delete(const struct parser_table *entry, char *argv[], int *arg_ptr) { struct predicate *our_pred; (void)argv; (void)arg_ptr; our_pred = insert_primary_noarg(entry); our_pred->side_effects = our_pred->no_default_print = 1; options.do_dir_first = 0; our_pred->need_stat = our_pred->need_type = 0; our_pred->est_success_rate = 1.0f; return 1; }
long long parse_delete(unsigned long long a0, unsigned long a1, unsigned long a2) { unsigned long v0; unsigned long v1; struct_0 *v2; v1 = a1; v0 = a2; v2 = insert_primary_noarg(a0); v2->field_19 = 1; v2->field_18 = v2->field_19; options = 0; v2->field_1b = 0; v2->field_1a = v2->field_1b; v2->field_24 = 0x3e99999a3f800000; return 1; }
findutils
angr_phoenix
static char const *human_fstype(struct statfs const *statfsbuf) { switch (statfsbuf->f_type) { case 0x5A3C69F0: return "aafs"; case 0x61636673: return "acfs"; case 0xADF5: return "adfs"; case 0xADFF: return "affs"; case 0x5346414F: return "afs"; case 0x09041934: return "anon-inode FS"; case 0x61756673: return "aufs"; case 0x0187: return "autofs"; case 0x13661366: return "balloon-kvm-fs"; case 0x42465331: return "befs"; case 0x62646576: return "bdevfs"; case 0x1BADFACE: return "bfs"; case 0x6C6F6F70: return "binderfs"; case 0xCAFE4A11: return "bpf_fs"; case 0x42494E4D: return "binfmt_misc"; case 0x9123683E: return "btrfs"; case 0x73727279: return "btrfs_test"; case 0x00C36400: return "ceph"; case 0x0027E0EB: return "cgroupfs"; case 0x63677270: return "cgroup2fs"; case 0xFF534D42: return "cifs"; case 0x73757245: return "coda"; case 0x012FF7B7: return "coh"; case 0x62656570: return "configfs"; case 0x28CD3D45: return "cramfs"; case 0x453DCD28: return "cramfs-wend"; case 0x64646178: return "daxfs"; case 0x64626720: return "debugfs"; case 0x1373: return "devfs"; case 0x454D444D: return "devmem"; case 0x1CD1: return "devpts"; case 0x444D4142: return "dma-buf-fs"; case 0xF15F: return "ecryptfs"; case 0xDE5E81E4: return "efivarfs"; case 0x00414A53: return "efs"; case 0xE0F5E1E2: return "erofs"; case 0x2011BAB0: return "exfat"; case 0x45584653: return "exfs"; case 0x5DF5: return "exofs"; case 0x137D: return "ext"; case 0xEF53: return "ext2/ext3"; case 0xEF51: return "ext2"; case 0xF2F52010: return "f2fs"; case 0x4006: return "fat"; case 0x19830326: return "fhgfs"; case 0x65735546: return "fuseblk"; case 0x65735543: return "fusectl"; case 0x0BAD1DEA: return "futexfs"; case 0x01161970: return "gfs/gfs2"; case 0x47504653: return "gpfs"; case 0x4244: return "hfs"; case 0x482B: return "hfs+"; case 0x4858: return "hfsx"; case 0x00C0FFEE: return "hostfs"; case 0xF995E849: return "hpfs"; case 0x958458F6: return "hugetlbfs"; case 0x11307854: return "inodefs"; case 0x013111A8: return "ibrix"; case 0x2BAD1DEA: return "inotifyfs"; case 0x9660: return "isofs"; case 0x4004: return "isofs"; case 0x4000: return "isofs"; case 0x07C0: return "jffs"; case 0x72B6: return "jffs2"; case 0x3153464A: return "jfs"; case 0x6B414653: return "k-afs"; case 0xC97E8168: return "logfs"; case 0x0BD00BD0: return "lustre"; case 0x5346314D: return "m1fs"; case 0x137F: return "minix"; case 0x138F: return "minix (30 char.)"; case 0x2468: return "minix v2"; case 0x2478: return "minix v2 (30 char.)"; case 0x4D5A: return "minix3"; case 0x19800202: return "mqueue"; case 0x4D44: return "msdos"; case 0x564C: return "novell"; case 0x6969: return "nfs"; case 0x6E667364: return "nfsd"; case 0x3434: return "nilfs"; case 0x6E736673: return "nsfs"; case 0x5346544E: return "ntfs"; case 0x9FA1: return "openprom"; case 0x7461636F: return "ocfs2"; case 0x794C7630: return "overlayfs"; case 0xAAD7AAEA: return "panfs"; case 0x50495045: return "pipefs"; case 0xC7571590: return "ppc-cmm-fs"; case 0x7C7C6673: return "prl_fs"; case 0x9FA0: return "proc"; case 0x6165676C: return "pstorefs"; case 0x002F: return "qnx4"; case 0x68191122: return "qnx6"; case 0x858458F6: return "ramfs"; case 0x07655821: return "rdt"; case 0x52654973: return "reiserfs"; case 0x7275: return "romfs"; case 0x67596969: return "rpc_pipefs"; case 0x5DCA2DF5: return "sdcardfs"; case 0x5345434D: return "secretmem"; case 0x73636673: return "securityfs"; case 0xF97CFF8C: return "selinux"; case 0x43415D53: return "smackfs"; case 0x517B: return "smb"; case 0xFE534D42: return "smb2"; case 0xBEEFDEAD: return "snfs"; case 0x534F434B: return "sockfs"; case 0x73717368: return "squashfs"; case 0x62656572: return "sysfs"; case 0x012FF7B6: return "sysv2"; case 0x012FF7B5: return "sysv4"; case 0x01021994: return "tmpfs"; case 0x74726163: return "tracefs"; case 0x24051905: return "ubifs"; case 0x15013346: return "udf"; case 0x00011954: return "ufs"; case 0x54190100: return "ufs"; case 0x9FA2: return "usbdevfs"; case 0x01021997: return "v9fs"; case 0x786F4256: return "vboxsf"; case 0xBACBACBC: return "vmhgfs"; case 0xA501FCF5: return "vxfs"; case 0x565A4653: return "vzfs"; case 0x53464846: return "wslfs"; case 0xABBA1974: return "xenfs"; case 0x012FF7B4: return "xenix"; case 0x58465342: return "xfs"; case 0x012FD16D: return "xia"; case 0x0033: return "z3fold"; case 0x2FC12FC1: return "zfs"; case 0x5A4F4653: return "zonefs"; case 0x58295829: return "zsmallocfs"; default: { unsigned long int type = statfsbuf->f_type; static char buf[sizeof "UNKNOWN (0x%lx)" - 3 + (sizeof type * 8 + 3) / 4]; sprintf(buf, "UNKNOWN (0x%lx)", type); return buf; } } }
int human_fstype(unsigned long long *a0) { unsigned long v0; unsigned int v2; v2 = *(a0); if (*(a0) == 4283649346) { v2 = &g_404712; } else { if (*(a0) <= 4283649346) { if (*(a0) == 4266872130) { v2 = &g_404955; goto LABEL_40174b; } if (*(a0) <= 4266872130) { if (*(a0) == 4187351113) { v2 = &g_4047f3; goto LABEL_40174b; } if (*(a0) <= 4187351113) { if (*(a0) == 4185718668) { v2 = &g_404941; goto LABEL_40174b; } if (*(a0) <= 4185718668) { if (*(a0) == 4076150800) { v2 = &g_4047a9; goto LABEL_40174b; } if (*(a0) <= 4076150800) { if (*(a0) == 3774210530) { v2 = &g_40477f; goto LABEL_40174b; } if (*(a0) <= 3774210530) { if (*(a0) == 3730735588) { v2 = &g_404772; goto LABEL_40174b; } if (*(a0) <= 3730735588) { if (*(a0) == 3405662737) { v2 = &g_4046d6; goto LABEL_40174b; } if (*(a0) <= 3405662737) { if (*(a0) == 3380511080) { v2 = &g_404835; goto LABEL_40174b; } if (*(a0) <= 3380511080) { if (*(a0) == 3344373136) { v2 = &g_4048d5; goto LABEL_40174b; } if (*(a0) <= 3344373136) { if (*(a0) == 3203391149) { v2 = &g_40495a; goto LABEL_40174b; } if (*(a0) <= 3203391149) { if (*(a0) == 3133910204) { v2 = &g_4049b2; goto LABEL_40174b; } if (*(a0) <= 3133910204) { if (v2 == 2881100148) { v2 = &g_4049c9; goto LABEL_40174b; } if (v2 <= 2881100148) { if (v2 == 2866260714) { v2 = &g_4048c8; goto LABEL_40174b; } if (v2 <= 2866260714) { if (v2 == 2768370933) { v2 = &g_4049b9; goto LABEL_40174b; } if (v2 <= 2768370933) { if (v2 == 2508478710) { v2 = &g_4047f8; goto LABEL_40174b; } if (v2 <= 2508478710) { if (v2 == 2435016766) { v2 = &g_4046e9; goto LABEL_40174b; } if (v2 <= 2435016766) { if (v2 == 2240043254) { v2 = &g_4048ff; goto LABEL_40174b; } if (v2 <= 2240043254) { if (v2 == 2088527475) { v2 = &g_4048e0; goto LABEL_40174b; } if (v2 <= 2088527475) { if (v2 == 2035054128) { v2 = &g_4048be; goto LABEL_40174b; } if (v2 <= 2035054128) { if (v2 == 2020557398) { v2 = &g_4049ab; goto LABEL_40174b; } if (v2 <= 2020557398) { if (v2 == 1953653091) { v2 = &g_404987; goto LABEL_40174b; } if (v2 <= 1953653091) { if (v2 == 1952539503) { v2 = &g_4048b8; goto LABEL_40174b; } if (v2 <= 1952539503) { if (v2 == 1937076805) { v2 = &g_404717; goto LABEL_40174b; } if (v2 <= 1937076805) { if (v2 == 1936880249) { v2 = &g_4046ef; goto LABEL_40174b; } if (v2 <= 1936880249) { if (v2 == 1936814952) { v2 = &g_404966; goto LABEL_40174b; } if (v2 <= 1936814952) { if (v2 == 1935894131) { v2 = &g_404936; goto LABEL_40174b; } if (v2 <= 1935894131) { if (v2 == 1853056627) { v2 = &g_4048a5; goto LABEL_40174b; } if (v2 <= 1853056627) { if (v2 == 1852207972) { v2 = &g_40489a; goto LABEL_40174b; } if (v2 <= 1852207972) { if (v2 == 1819242352) { v2 = &g_4046cd; goto LABEL_40174b; } if (v2 <= 1819242352) { if (v2 == 1799439955) { v2 = &g_40482f; goto LABEL_40174b; } if (v2 <= 1799439955) { if (v2 == 1746473250) { v2 = &g_4048fa; goto LABEL_40174b; } if (v2 <= 1746473250) { if (v2 == 1733912937) { v2 = &g_404918; goto LABEL_40174b; } if (v2 <= 1733912937) { if (v2 == 1702057286) { v2 = &g_4047b8; goto LABEL_40174b; } if (v2 <= 1702057286) { if (v2 == 1702057283) { v2 = &g_4047c0; goto LABEL_40174b; } if (v2 <= 1702057283) { if (v2 == 1684300152) { v2 = &g_40473c; goto LABEL_40174b; } if (v2 <= 1684300152) { if (v2 == 1684170528) { v2 = &g_404742; goto LABEL_40174b; } if (v2 <= 1684170528) { if (v2 == 1667723888) { v2 = &g_404708; goto LABEL_40174b; } if (v2 <= 1667723888) { if (v2 == 1650812274) { v2 = &g_40496f; goto LABEL_40174b; } if (v2 <= 1650812274) { if (v2 == 1650812272) { v2 = &g_404720; goto LABEL_40174b; } if (v2 <= 1650812272) { if (v2 == 1650746742) { v2 = &g_4046c2; goto LABEL_40174b; } if (v2 <= 1650746742) { if (v2 == 1635083891) { v2 = &g_4046a2; goto LABEL_40174b; } if (v2 <= 1635083891) { if (v2 == 1634035564) { v2 = &g_4048ec; goto LABEL_40174b; } if (v2 <= 1634035564) { if (v2 == 1633904243) { v2 = &g_404681; goto LABEL_40174b; } if (v2 <= 1633904243) { if (v2 == 1573531125) { v2 = &g_404923; goto LABEL_40174b; } if (v2 <= 1573531125) { if (v2 == 1515144787) { v2 = &g_4049e8; goto LABEL_40174b; } if (v2 <= 1515144787) { if (v2 == 1513908720) { v2 = &g_40467c; goto LABEL_40174b; } if (v2 <= 1513908720) { if (v2 == 1481003842) { v2 = &g_4049d5; goto LABEL_40174b; } if (v2 <= 1481003842) { if (v2 == 1479104553) { v2 = &g_4049ef; goto LABEL_40174b; } else if ( v2 <= 1479104553) { if (v2 == 1448756819) { v2 = &g_4049be; goto LABEL_40174b; } if (v2 <= 1448756819) { if (v2 == 0x54190100) { v2 = &g_404999; goto LABEL_40174b; } if (v2 <= 0x54190100) { if (v2 == 1397703499) { v2 = &g_40495f; goto LABEL_40174b; } if (v2 <= 1397703499) { if (v2 == 1397118030) { v2 = &g_4048aa; goto LABEL_40174b; } if (v2 <= 1397118030) { if (v2 == 1397114950) { v2 = &g_4049c3; goto LABEL_40174b; } if (v2 <= 1397114950) { if (v2 == 1397113167) { v2 = &g_404690; goto LABEL_40174b; } if (v2 <= 1397113167) { if (v2 == 1397109069) { v2 = &g_404842; goto LABEL_40174b; } if (v2 <= 1397109069) { if (v2 == 1397048141) { v2 = &g_40492c; goto LABEL_40174b; } if (v2 <= 1397048141) { if (v2 == 1382369651) { v2 = &g_404909; goto LABEL_40174b; } if (v2 <= 1382369651) { if (v2 == 1346981957) { v2 = &g_4048ce; goto LABEL_40174b; } if (v2 <= 1346981957) { if (v2 == 1196443219) { v2 = &g_4047d9; goto LABEL_40174b; } if (v2 <= 1196443219) { if (v2 == 1163413075) { v2 = &g_40478b; goto LABEL_40174b; } if (v2 <= 1163413075) { if (v2 == 1162691661) { v2 = &g_404750; goto LABEL_40174b; } if (v2 <= 1162691661) { if (v2 == 1161678120) { v2 = &g_404730; goto LABEL_40174b; } if (v2 <= 1161678120) { if (v2 == 1145913666) { v2 = &g_40475e; goto LABEL_40174b; } if (v2 <= 1145913666) { if (v2 == 1128357203) { v2 = &g_404949; goto LABEL_40174b; } if (v2 <= 1128357203) { if (v2 == 1112100429) { v2 = &g_4046dd; goto LABEL_40174b; } if (v2 <= 1112100429) { if (v2 == 1111905073) { v2 = &g_4046bd; goto LABEL_40174b; } if (v2 <= 1111905073) { if (v2 == 827541066) { v2 = &g_40482b; goto LABEL_40174b; } if (v2 <= 827541066) { if (v2 == 801189825) { v2 = &g_4049e4; goto LABEL_40174b; } else if ( v2 <= 801189825) { if (v2 == 732765674) { v2 = &g_404810; goto LABEL_40174b; } if (v2 <= 732765674) { if (v2 == 684539205) { v2 = &g_404729; goto LABEL_40174b; } if (v2 <= 684539205) { if (v2 == 604313861) { v2 = &g_40498f; goto LABEL_40174b; } if (v2 <= 604313861) { if (v2 == 538032816) { v2 = &g_404785; goto LABEL_40174b; } if (v2 <= 538032816) { if (v2 == 464386766) { v2 = &g_4046c9; goto LABEL_40174b; } if (v2 <= 464386766) { if (v2 == 428016422) { v2 = &g_4047b2; goto LABEL_40174b; } if (v2 <= 428016422) { if (v2 == 427819522) { v2 = &g_404882; goto LABEL_40174b; } if (v2 <= 427819522) { if (v2 == 352400198) { v2 = &g_404995; goto LABEL_40174b; } if (v2 <= 352400198) { if (v2 == 325456742) { v2 = &g_4046ae; goto LABEL_40174b; } if (v2 <= 325456742) { if (v2 == 288389204) { v2 = &g_404802; goto LABEL_40174b; } if (v2 <= 288389204) { if (v2 == 198183888) { v2 = &g_40483b; goto LABEL_40174b; } if (v2 <= 198183888) { if (v2 == 195894762) { v2 = &g_4047c8; goto LABEL_40174b; } if (v2 <= 195894762) { if (v2 == 151263540) { v2 = &g_404694; goto LABEL_40174b; } if (v2 <= 151263540) { if (v2 == 124082209) { v2 = &g_404905; goto LABEL_40174b; } if (v2 <= 124082209) { if (v2 == 19993000) { v2 = &g_40480a; goto LABEL_40174b; } if (v2 <= 19993000) { if (v2 == 19920823) { v2 = &g_40471c; goto LABEL_40174b; } if (v2 <= 19920823) { if (v2 == 19920822) { v2 = &g_404975; goto LABEL_40174b; } if (v2 <= 19920822) { if (v2 == 19920821) { v2 = &g_40497b; goto LABEL_40174b; } if (v2 <= 19920821) { if (v2 == 19920820) { v2 = &g_4049cf; goto LABEL_40174b; } if (v2 <= 19920820) { if (v2 == 19911021) { v2 = &g_4049d9; goto LABEL_40174b; } if (v2 <= 19911021) { if (v2 == 18225520) { v2 = &g_4047d0; goto LABEL_40174b; } if (v2 <= 18225520) { if (v2 == 16914839) { v2 = &g_4049a6; goto LABEL_40174b; } if (v2 <= 16914839) { if (v2 == 16914836) { v2 = &g_404981; goto LABEL_40174b; } if (v2 <= 16914836) { if (v2 == 0xc36400) { v2 = &g_4046fa; goto LABEL_40174b; } if (v2 <= 0xc36400) { if (v2 == 12648430) { v2 = &g_4047ec; goto LABEL_40174b; } if (v2 <= 12648430) { if (v2 == 4278867) { v2 = &g_40477b; goto LABEL_40174b; } if (v2 <= 4278867) { if (v2 == 2613483) { v2 = &g_4046ff; goto LABEL_40174b; } if (v2 <= 2613483) { if (v2 == 72020) { v2 = &g_404999; goto LABEL_40174b; } if (v2 <= 72020) { if (v2 == 61791) { v2 = &g_404769; goto LABEL_40174b; } if (v2 <= 61791) { if (v2 == 61267) { v2 = &g_40479a; goto LABEL_40174b; } if (v2 <= 61267) { if (v2 == 61265) { v2 = &g_4047a4; goto LABEL_40174b; } if (v2 <= 61265) { if (v2 == 44543) { v2 = &g_40468b; goto LABEL_40174b; } if (v2 <= 44543) { if (v2 == 44533) { v2 = &g_404686; goto LABEL_40174b; } if (v2 <= 44533) { if (v2 == 40866) { v2 = &g_40499d; goto LABEL_40174b; } if (v2 <= 40866) { if (v2 == 40865) { v2 = &g_4048af; goto LABEL_40174b; } if (v2 <= 40865) { if (v2 == 40864) { v2 = &g_4048e7; goto LABEL_40174b; } if (v2 <= 40864) { if (v2 == 38496) { v2 = &g_40481a; goto LABEL_40174b; } if (v2 <= 38496) { if (v2 == 29366) { v2 = &g_404825; goto LABEL_40174b; } if (v2 <= 29366) { if (v2 == 29301) { v2 = &g_404912; goto LABEL_40174b; } if (v2 <= 29301) { if (v2 == 26985) { v2 = &g_404896; goto LABEL_40174b; } if (v2 <= 26985) { if (v2 == 24053) { v2 = &g_404790; goto LABEL_40174b; } if (v2 <= 24053) { if (v2 == 22092) { v2 = &g_40488f; goto LABEL_40174b; } if (v2 <= 22092) { if (v2 == 20859) { v2 = &g_404951; goto LABEL_40174b; } if (v2 <= 20859) { if (v2 == 19802) { v2 = &g_40487b; goto LABEL_40174b; } if (v2 <= 19802) { if (v2 == 19780) { v2 = &g_404889; goto LABEL_40174b; } if (v2 <= 19780) { if (v2 == 18520) { v2 = &g_4047e7; goto LABEL_40174b; } if (v2 <= 18520) { if (v2 == 18475) { v2 = &g_4047e2; goto LABEL_40174b; } if (v2 <= 18475) { if (v2 == 16964) { v2 = &g_4047de; goto LABEL_40174b; } if (v2 <= 16964) { if (v2 == 16390) { v2 = &g_4047ae; goto LABEL_40174b; } if (v2 <= 16390) { if (v2 == 16388) { v2 = &g_40481a; goto LABEL_40174b; } if (v2 <= 16388) { if (v2 == 0x4000) { v2 = &g_40481a; goto LABEL_40174b; } if (v2 <= 0x4000) { if (v2 == 13364) { v2 = &g_40489f; goto LABEL_40174b; } if (v2 <= 13364) { if (v2 == 9336) { v2 = &g_404867; goto LABEL_40174b; } if (v2 <= 9336) { if (v2 == 9320) { v2 = &g_40485e; goto LABEL_40174b; } if (v2 <= 9320) { if (v2 == 7377) { v2 = &g_404757; goto LABEL_40174b; } if (v2 <= 7377) { if (v2 == 5007) { v2 = &g_40484d; goto LABEL_40174b; } if (v2 <= 5007) { if (v2 == 4991) { v2 = &g_404847; goto LABEL_40174b; } if (v2 <= 4991) { if (v2 == 4989) { v2 = &g_404796; goto LABEL_40174b; } if (v2 <= 4989) { if (v2 == 4979) { v2 = &g_40474a; goto LABEL_40174b; } if (v2 <= 4979) { if (v2 == 1984) { v2 = &g_404820; goto LABEL_40174b; } if (v2 <= 1984) { if (v2 == 391) { v2 = &g_4046a7; goto LABEL_40174b; } if (v2 <= 391) { if (v2 == 47) { v2 = &g_4048f5; goto LABEL_40174b; } if (v2 == 51) { v2 = &g_4049dd; goto LABEL_40174b; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } v0 = *(a0); sprintf(&buf.6644, "UNKNOWN (0x%lx)", v0); v2 = &buf.6644; } LABEL_40174b: return v2; }
coreutils
angr_phoenix
static tcflag_t tty_update_flag(EditLine *el, tcflag_t f, int mode, int kind) { f &= ~el->el_tty.t_t[mode][kind].t_clrmask; f |= el->el_tty.t_t[mode][kind].t_setmask; return f; }
int tty_update_flag(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3) { unsigned int v0; v0 = a1; v0 &= !(*(((a2 * 5 + a3 + 13) * 16 + a0 + 12))); v0 |= *(((a2 * 5 + a3 + 13) * 16 + a0 + 8)); return v0; }
libedit
angr_phoenix
, "%s: entering hostname %s, requested key %s %s, %u keys avail", tag, hostname, sshkey_type(key), fp, dch->nkeys) ; free(fp); for (i = 0; i < dch->nkeys; i++) { if (dch->keys[i] == ((void *)0)) return -1; if ((fp = sshkey_fingerprint(dch->keys[i], 2, SSH_FP_DEFAULT)) == ((void *)0)) sshfatal("ssh-agent.c", __func__, 285, 1, SYSLOG_LEVEL_FATAL, ((void *)0), "fingerprint failed"); sshlog("ssh-agent.c", __func__, 286, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0), "%s: key %u: %s%s %s", tag, i, dch->key_is_ca[i] ? "CA " : "", sshkey_type(dch->keys[i]), fp) ; free(fp); if (!sshkey_is_cert(key)) { if (dch->key_is_ca[i] || !sshkey_equal(key, dch->keys[i])) continue; return 0; } if (!dch->key_is_ca[i]) continue; if (key->cert == ((void *)0) || key->cert->signature_key == ((void *)0)) return -1; if (!sshkey_equal(key->cert->signature_key, dch->keys[i])) continue; if (sshkey_cert_check_host(key, hostname, 1, "ssh-ed25519," "ecdsa-sha2-nistp256," "ecdsa-sha2-nistp384," "ecdsa-sha2-nistp521," "sk-ssh-ed25519@openssh.com," "sk-ecdsa-sha2-nistp256@openssh.com," "rsa-sha2-512," "rsa-sha2-256", &reason) != 0) { sshlog("ssh-agent.c", __func__, 306, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0), "cert %s / hostname %s rejected: %s", key->cert->key_id, hostname, reason); continue; } return 0; }
void sshkey_type(void) { halt_baddata(); }
openssh-portable
ghidra
void bitmap_zero(struct bitmap *b) { memset(b->d, 0, b->len * (sizeof(u_int))); b->top = 0; }
void bitmap_zero(unsigned long long a0[3]) { unsigned long long v1[3]; memset(a0[0], 0x0, a0[1] * 4); v1 = a0; a0[2] = 0; return; }
openssh-portable
angr_phoenix
static int history_def_init(void **p, HistEventW *ev __attribute__((__unused__)), int n) { history_t *h = (history_t *)malloc(sizeof(*h)); if (h == ((void *)0)) return -1; if (n <= 0) n = 0; h->eventid = 0; h->cur = 0; h->max = n; h->list.next = h->list.prev = &h->list; h->list.ev.str = ((void *)0); h->list.ev.num = 0; h->cursor = &h->list; h->flags = 0; *p = h; return 0; }
int history_def_init(unsigned long long *a0, unsigned long a1, unsigned long a2) { unsigned int v0; unsigned long v1; struct_0 *v2; unsigned int v4; v1 = a1; v0 = a2; v2 = malloc(0x40); if (!v2) { v4 = -1; } else { if (v0 <= 0) v0 = 0; v2->field_38 = 0; v2->field_34 = 0; v2->field_30 = v0; v2->field_20 = v2; v2->field_18 = v2->field_20; v2->field_8 = 0; v2->field_0 = 0; v2->field_28 = v2; v2->field_3c = 0; *(a0) = v2; v4 = 0; } return v4; }
libedit
angr_dream
void pidof_usage(void) { printf("pidof usage: [options] <program-name>\n\n"); printf(" -c Return PIDs with the same root directory\n"); printf(" -d <sep> Use the provided character as output separator\n"); printf(" -h Display this help text\n"); printf(" -n Avoid using stat system function on network shares\n"); printf(" -o <pid> Omit results with a given PID\n"); printf(" -q Quiet mode. Do not display output\n"); printf(" -s Only return one PID\n"); printf(" -x Return PIDs of shells running scripts with a matching " "name\n"); printf(" -z List zombie and I/O waiting processes. May cause pidof " "to hang.\n"); printf("\n"); }
void pidof_usage() { unsigned long long v1; printf("pidof usage: [options] <program-name>\n\n"); printf(" -c Return PIDs with the same root directory\n"); printf(" -d <sep> Use the provided character as output separator\n"); printf(" -h Display this help text\n"); printf(" -n Avoid using stat system function on network shares\n"); printf(" -o <pid> Omit results with a given PID\n"); printf(" -q Quiet mode. Do not display output\n"); printf(" -s Only return one PID\n"); printf(" -x Return PIDs of shells running scripts with a matching " "name\n"); printf(" -z List zombie and I/O waiting processes. May cause pidof " "to hang.\n"); v1 = printf("\n"); return; }
sysvinit
angr_phoenix
ARRAY *array_from_argv(a, vec, count) ARRAY *a; char **vec; int count; { arrayind_t i; ARRAY_ELEMENT *ae; char *t; if (a == 0 || ((a)->num_elements) == 0) { for (i = 0; i < count; i++) array_insert(a, i, t); return a; } if (((a)->num_elements) == count && count == 1) { ae = ((a->head)->next); t = vec[0] ? (char *)strcpy( sh_xmalloc((1 + strlen(vec[0])), "array.c", 878), (vec[0])) : 0; do { sh_xfree(((ae)->value), "array.c", 879); (ae)->value = (t); } while (0); } else if (((a)->num_elements) <= count) { ae = a->head; for (i = 0; i < ((a)->num_elements); i++) { ae = ((ae)->next); t = vec[0] ? (char *)strcpy(sh_xmalloc((1 + strlen(vec[0])), "array.c", 888), (vec[0])) : 0; do { sh_xfree(((ae)->value), "array.c", 889); (ae)->value = (t); } while (0); } for (; i < count; i++) array_insert(a, i, vec[i]); } else { array_flush(a); for (i = 0; i < count; i++) array_insert(a, i, vec[i]); } return a; }
long long array_from_argv(struct_0 *a0, unsigned long long *a1, unsigned long a2) { void *v0; unsigned long long v1[3]; void *v2; unsigned long long v4[3]; void *v5; void *v6; if (!a0) { LABEL_4019de: for (v0 = 0; v0 < a2; v0 += 1) { array_insert(a0, v0, *(&v2)); } v4 = a0; } else { if (!a0->field_8) goto LABEL_4019de; if (a0->field_8 == a2 && a2 == 1) { v1 = a0->field_10->field_10; if (!*(a1)) v5 = 0; else v5 = strcpy(sh_xmalloc(strlen(*(a1)) + 1, "array.c", 0x36e), *(a1)); v2 = v5; sh_xfree(v1->field_8, "array.c", 0x36f); v1->field_8 = v2; goto LABEL_401c1b; } if (a0->field_8 > a2) { array_flush(a0); for (v0 = 0; v0 < a2; v0 += 1) { array_insert(a0, v0, *((a1 + 0x8 * v0))); } } else { v1[0] = a0->field_10; for (v0 = 0; v0 < a0->field_8; v0 += 1) { v1[0] = v1[2]; if (*(a1)) v6 = strcpy(sh_xmalloc(strlen(*(a1)) + 1, "array.c", 0x378), *(a1)); else v6 = 0; v2 = v6; sh_xfree(v1[1], "array.c", 0x379); v1->field_8 = v2; } for (; v0 < a2; v0 += 1) { array_insert(a0, v0, *((a1 + 0x8 * v0))); } } LABEL_401c1b: v4 = a0; } return v4; }
bash
angr_phoenix
static void init_buffer(void) { if (!record_buffer_aligned[record_index]) record_buffer_aligned[record_index] = page_aligned_alloc(&record_buffer[record_index], record_size); record_start = record_buffer_aligned[record_index]; current_block = record_start; record_end = record_start + blocking_factor; }
void init_buffer() { unsigned long long v1; if (!record_buffer_aligned[record_index]) record_buffer_aligned[record_index] = page_aligned_alloc(&(&record_buffer)[record_index], record_size, &(&record_buffer)[record_index], record_index * 8); continued_file_offset = record_buffer_aligned[record_index]; continued_file_offset = 16752697132039570248; v1 = 16752697132039570248 + blocking_factor * 0x200; continued_file_offset = 16752697132039570248 + blocking_factor * 0x200; return; }
tar
angr_sailr
static void print_horizontal(void) { size_t filesno; size_t pos = 0; size_t cols = calculate_columns(0); struct column_info const *line_fmt = &column_info[cols - 1]; struct fileinfo const *f = sorted_file[0]; size_t name_length = length_of_file_name_and_frills(f); size_t max_name_length = line_fmt->col_arr[0]; print_file_name_and_frills(f, 0); for (filesno = 1; filesno < cwd_n_used; ++filesno) { size_t col = filesno % cols; if (col == 0) { putchar_unlocked(eolbyte); pos = 0; } else { indent(pos + name_length, pos + max_name_length); pos += max_name_length; } f = sorted_file[filesno]; print_file_name_and_frills(f, pos); name_length = length_of_file_name_and_frills(f); max_name_length = line_fmt->col_arr[col]; } putchar_unlocked(eolbyte); }
void print_horizontal() { unsigned long long v0; void *v1; unsigned long v2; unsigned long v3; unsigned long v4; struct_0 *v5; void *v6; unsigned long long *v7; unsigned long long v9; v1 = 0; v4 = calculate_columns(0x0); v5 = v4 * 24 - 24 + column_info; v6 = *(sorted_file); v2 = length_of_file_name_and_frills(v6); v3 = v5->field_10->field_0; print_file_name_and_frills(v6, 0x0); for (v0 = 1; v0 < cwd_n_used; v0 += 1) { v7 = (0 CONCAT v0) / m v4 >> 64; if (v7) { indent(v2 + v1, v1 + v3); v1 += v3; } else { putchar_unlocked(eolbyte); v1 = 0; } v6 = *((sorted_file + v0 * 8)); print_file_name_and_frills(v6, v1); v2 = length_of_file_name_and_frills(v6); v3 = *((&v5->field_10->field_0 + 0x8 * v7)); } v9 = putchar_unlocked(eolbyte); return; }
coreutils
angr_phoenix
static int bash_backward_shellword(count, key) int count, key; { size_t slen; int c, p, prev_p; mbstate_t state; memset(&state, '\0', sizeof(mbstate_t)); if (count < 0) return (bash_forward_shellword(-count, key)); p = rl_point; slen = rl_end; while (count) { if (p == 0) { rl_point = 0; return 0; } do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _x, _p; _x = _p = 0; while (_x < (p)) { state_bak = state; mblength = mbrlen((rl_line_buffer) + (_x), (slen) - (_x), &state); if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; _x++; } else if (mblength == 0) _x++; else { _p = _x; _x += mblength; } } (p) = _p; } else (p)--; } while (0); while (p > 0) { c = rl_line_buffer[p]; if (((sh_syntaxtab[(unsigned char)(c)] & 0x0001) || (sh_syntaxtab[(unsigned char)(c)] & 0x2000)) == 0 || char_is_quoted(rl_line_buffer, p)) break; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _x, _p; _x = _p = 0; while (_x < (p)) { state_bak = state; mblength = mbrlen((rl_line_buffer) + (_x), (slen) - (_x), &state); if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; _x++; } else if (mblength == 0) _x++; else { _p = _x; _x += mblength; } } (p) = _p; } else (p)--; } while (0); } if (p == 0) { rl_point = 0; return 0; } prev_p = p; while (p > 0) { c = rl_line_buffer[p]; if (((sh_syntaxtab[(unsigned char)(c)] & 0x0001) || (sh_syntaxtab[(unsigned char)(c)] & 0x2000)) && char_is_quoted(rl_line_buffer, p) == 0) { p = prev_p; break; } prev_p = p; do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _x, _p; _x = _p = 0; while (_x < (p)) { state_bak = state; mblength = mbrlen((rl_line_buffer) + (_x), (slen) - (_x), &state); if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; _x++; } else if (mblength == 0) _x++; else { _p = _x; _x += mblength; } } (p) = _p; } else (p)--; } while (0); } count--; } rl_point = p; return 0; }
long long bash_backward_shellword(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v13; unsigned long long v14; unsigned long long v15; void *v17; unsigned int v18; v0 = a0; memset(&v14, 0x0, 0x8); if (v0 < 0) { v17 = bash_forward_shellword(-(v0), a1); return v17; } v1 = rl_point; for (v10 = rl_end; v0; v0 -= 1) { if (v1) { if (locale_mb_cur_max <= 1) { v1 -= 1; } else { v4 = 0; v3 = v4; while (v3 < v1) { v15 = v14; v11 = mbrlen(rl_line_buffer + v3, v10 - v3, &v14, rl_line_buffer + v3); if (v11 == -2 || v11 == -1) { v14 = v15; v3 += 1; } else if (v11) { v4 = v3; v3 += v11; } else { v3 += 1; } } v1 = v4; } while (true) { if (v1 <= 0) break; v9 = *((v1 + rl_line_buffer)); if ((sh_syntaxtab[v9] & 1) || (sh_syntaxtab[v9] & 0x2000)) v18 = 1; else v18 = 0; if (!(v18) || !(!char_is_quoted(rl_line_buffer, v1, v1))) break; if (locale_mb_cur_max <= 1) { v1 -= 1; } else { v6 = 0; v5 = v6; while (v5 < v1) { v15 = v14; v12 = mbrlen(rl_line_buffer + v5, v10 - v5, &v14, rl_line_buffer + v5); if (v12 == -2 || v12 == -1) { v14 = v15; v5 += 1; } else if (!v12) { v5 += 1; } else { v6 = v5; v5 += v12; } } v1 = v6; } } if (!v1) { rl_point = 0; v17 = 0; return v17; } v2 = v1; while (true) { if (v1 <= 0) break; v9 = *((v1 + rl_line_buffer)); if (!(sh_syntaxtab[v9] & 1) && !(sh_syntaxtab[v9] & 0x2000) || char_is_quoted(rl_line_buffer, v1, v1)) { v2 = v1; if (locale_mb_cur_max <= 1) { v1 -= 1; } else { v8 = 0; v7 = v8; while (v7 < v1) { v15 = v14; v13 = mbrlen(rl_line_buffer + v7, v10 - v7, &v14, rl_line_buffer + v7); if (v13 == -2 || v13 == -1) { v14 = v15; v7 += 1; } else if (!v13) { v7 += 1; } else { v8 = v7; v7 += v13; } } v1 = v8; } } else { v1 = v2; break; } } } else { rl_point = 0; v17 = 0; return v17; } } rl_point = v1; v17 = 0; return v17; }
bash
angr_sailr
static void tls_log_func(int level, const char *str) { fprintf(stderr, "|<%d>| %s", level, str); }
int tls_log_func(unsigned int a1, const char *a2) { return fprintf(stderr, "|<%d>| %s", a1, a2); }
gnutls
ida
static void malloc_debug_dummy() { write(1, "malloc_debug_dummy\n", 19); }
long long malloc_debug_dummy() { return write(0x1, "malloc_debug_dummy\n", 0x13); }
bash
angr_dream
static void cleanup(int signo __attribute__((unused))) { if (0 < diffpid) kill(diffpid, 13); if (tmpname) unlink(tmpname); }
void cleanup(unsigned long a0) { unsigned int v0; unsigned long long v2; unsigned long long v3; v0 = a0; if (diffpid > 0) kill(diffpid, 0xd); v2 = tmpname; if (tmpname) v3 = unlink(tmpname); return; }
diffutils
angr_dream
void rl_restore_prompt(void) { if (local_prompt) free(local_prompt); if (local_prompt_prefix) free(local_prompt_prefix); if (local_prompt_newlines) free(local_prompt_newlines); local_prompt = saved_local_prompt; local_prompt_prefix = saved_local_prefix; local_prompt_len = saved_local_length; local_prompt_newlines = saved_local_prompt_newlines; prompt_prefix_length = saved_prefix_length; prompt_last_invisible = saved_last_invisible; prompt_visible_length = saved_visible_length; prompt_invis_chars_first_line = saved_invis_chars_first_line; prompt_physical_chars = saved_physical_chars; saved_local_prompt = saved_local_prefix = (char *)0; saved_local_length = 0; saved_last_invisible = saved_visible_length = saved_prefix_length = 0; saved_invis_chars_first_line = saved_physical_chars = 0; saved_local_prompt_newlines = 0; }
long rl_restore_prompt() { long result; if (local_prompt) free(local_prompt); if (local_prompt_prefix) free(local_prompt_prefix); if (local_prompt_newlines) free(local_prompt_newlines); local_prompt = (char *)saved_local_prompt; local_prompt_prefix = (char *)saved_local_prefix; local_prompt_len = saved_local_length; local_prompt_newlines = (void *)saved_local_prompt_newlines; prompt_prefix_length = saved_prefix_length; prompt_last_invisible = saved_last_invisible; prompt_visible_length = saved_visible_length; prompt_invis_chars_first_line = saved_invis_chars_first_line; prompt_physical_chars = saved_physical_chars; saved_local_prefix = 0LL; saved_local_prompt = 0LL; saved_local_length = 0; saved_prefix_length = 0; saved_visible_length = 0; saved_last_invisible = 0; saved_physical_chars = 0; result = 0LL; saved_invis_chars_first_line = 0; saved_local_prompt_newlines = 0LL; return result; }
bash
ida
void savedir_diag(char const *name) { if (ignore_failed_read_option) { if ((warning_option & (0x00800000))) savedir_warn(name); } else savedir_error(name); }
long long savedir_diag(unsigned long long a0) { unsigned long long v1; if (!ignore_failed_read_option) { v1 = savedir_error(a0); } else { v1 = warning_option & &g_800000; if ((warning_option & 0x800000)) v1 = savedir_warn(a0); } return v1; }
tar
angr_phoenix
void ssh_packet_set_authenticated(struct ssh *ssh) { ssh->state->after_authentication = 1; }
long long ssh_packet_set_authenticated(struct struct_0 **a0) { struct_0 *v1; v1 = *(a0); *(a0)->field_148 = 1; return v1; }
openssh-portable
angr_sailr
void env_free(char **envp) { char **p; for (p = envp; *p != ((void *)0); p++) free(*p); free(envp); }
long long env_free(void *a0) { unsigned long long *v0; for (v0 = a0; *(v0); v0 += 1) { free(*(v0)); } return free(a0); }
cronie
angr_sailr
static void sshsk_free(struct sshsk_provider *p) { if (p == ((void *)0)) return; free(p->path); if (p->dlhandle != ((void *)0)) dlclose(p->dlhandle); free(p); }
void sshsk_free(void **a1) { if (a1) { free(*a1); if (a1[1]) dlclose(a1[1]); free(a1); } }
openssh-portable
ida
long inflateMark(strm) z_streamp strm; { struct inflate_state *state; if (inflateStateCheck(strm)) return -(1L << 16); state = (struct inflate_state *)strm->state; return (long)(((unsigned long)((long)state->back)) << 16) + (state->mode == COPY ? state->length : (state->mode == MATCH ? state->was - state->length : 0)); }
long long inflateMark(struct_0 *a0) { unsigned int v0[1789]; unsigned long long v3; void *v4; if (inflateStateCheck(a0)) { v3 = -0x10000; } else { *(&v0[0]) = a0->field_38; if (v0[2] == 16195) { v4 = v0[23]; } else if (v0[2] == 16204) { v4 = v0[1788] - v0[23]; } else { v4 = 0; } v3 = v4 + v0[1787] * 0x10000; } return v3; }
zlib
angr_dream
int sshsk_enroll(int type, const char *provider_path, const char *device, const char *application, const char *userid, uint8_t flags, const char *pin, struct sshbuf *challenge_buf, struct sshkey **keyp, struct sshbuf *attest) { struct sshsk_provider *skp = ((void *)0); struct sshkey *key = ((void *)0); u_char randchall[32]; const u_char *challenge; size_t challenge_len; struct sk_enroll_response *resp = ((void *)0); struct sk_option **opts = ((void *)0); int r = -1; int alg; sshlog("ssh-sk.c", __func__, 476, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0), "provider \"%s\", device \"%s\", application \"%s\", " "userid \"%s\", flags 0x%02x, challenge len %zu%s", provider_path, device, application, userid, flags, challenge_buf == ((void *)0) ? 0 : sshbuf_len(challenge_buf), (pin != ((void *)0) && *pin != '\0') ? " with-pin" : "") ; *keyp = ((void *)0); if (attest) sshbuf_reset(attest); if ((r = make_options(device, userid, &opts)) != 0) goto out; switch (type) { case KEY_ECDSA_SK: alg = 0x00; break; case KEY_ED25519_SK: alg = 0x01; break; default: sshlog("ssh-sk.c", __func__, 499, 1, SYSLOG_LEVEL_ERROR, ((void *)0), "unsupported key type"); r = -10; goto out; } if (provider_path == ((void *)0)) { sshlog("ssh-sk.c", __func__, 504, 1, SYSLOG_LEVEL_ERROR, ((void *)0), "missing provider"); r = -10; goto out; } if (application == ((void *)0) || *application == '\0') { sshlog("ssh-sk.c", __func__, 509, 1, SYSLOG_LEVEL_ERROR, ((void *)0), "missing application"); r = -10; goto out; } if (challenge_buf == ((void *)0)) { sshlog("ssh-sk.c", __func__, 514, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0), "using random challenge"); arc4random_buf(randchall, sizeof(randchall)); challenge = randchall; challenge_len = sizeof(randchall); } else if (sshbuf_len(challenge_buf) == 0) { sshlog("ssh-sk.c", __func__, 519, 0, SYSLOG_LEVEL_ERROR, ((void *)0), "Missing enrollment challenge"); r = -10; goto out; } else { challenge = sshbuf_ptr(challenge_buf); challenge_len = sshbuf_len(challenge_buf); sshlog("ssh-sk.c", __func__, 525, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0), "using explicit challenge len=%zd", challenge_len); } if ((skp = sshsk_open(provider_path)) == ((void *)0)) { r = -4; goto out; } if ((r = skp->sk_enroll(alg, challenge, challenge_len, application, flags, pin, opts, &resp)) != 0) { sshlog("ssh-sk.c", __func__, 535, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0), "provider \"%s\" failure %d", provider_path, r); r = skerr_to_ssherr(r); goto out; } if ((r = sshsk_key_from_response(alg, application, resp->flags, resp, &key)) != 0) goto out; if ((r = fill_attestation_blob(resp, attest)) != 0) goto out; *keyp = key; key = ((void *)0); r = 0; out: sshsk_free_options(opts); sshsk_free(skp); sshkey_free(key); sshsk_free_enroll_response(resp); explicit_bzero(randchall, sizeof(randchall)); return r; }
long long sshsk_enroll(unsigned long a0, char *a1, char *a2, char *a3, char *a4, unsigned long a5, unsigned long long v20, unsigned long long a6, unsigned long a7, unsigned long long a8) { unsigned long long v0; unsigned long v1; unsigned long v2; char *v3; unsigned long v4; unsigned long v5; unsigned long long v6; unsigned long long v7; unsigned long long *v8; unsigned long long v9; char *v10; unsigned int v11; unsigned int v12; void *v13; void *v14; void *v15; void *v16; unsigned long long v17; unsigned long long v18; char v19; unsigned long long v21; v10 = v20; v9 = a6; v8 = a7; v7 = a8; v16 = 0; v13 = 0; v14 = 0; v15 = 0; v11 = -1; if (v10 && *(v10)) { v21 = " with-pin"; goto LABEL_40140b; } v21 = &g_402c4e; LABEL_40140b: if (v9) sshbuf_len(v9); v6 = v21; v5 = a5; v4 = a4; v3 = a3; v2 = a2; v1 = a1; v0 = "provider \"%s\", device \"%s\", application \"%s\", userid \"%s\", " "flags 0x%02x, challenge len %zu%s"; sshlog("ssh-sk.c", "sshsk_enroll", 0x1dc, 0x1, 0x5, 0x0); *(v8) = 0; if (v7) sshbuf_reset(v7); v11 = make_options(a2, a4, &v15); if (!v11) { if (a0 == 10) { v12 = 0; } else if (a0 == 12) { v12 = 1; } else { sshlog("ssh-sk.c", "sshsk_enroll", 0x1f3, 0x1, 0x2, 0x0); v11 = -10; goto LABEL_401867; } if (!a1) { sshlog("ssh-sk.c", "sshsk_enroll", 0x1f8, 0x1, 0x2, 0x0); v11 = -10; } else if (!a3) { LABEL_4015b4: sshlog("ssh-sk.c", "sshsk_enroll", 0x1fd, 0x1, 0x2, 0x0); v11 = -10; } else { if (!*(a3)) goto LABEL_4015b4; if (!v9) { sshlog("ssh-sk.c", "sshsk_enroll", 0x202, 0x1, 0x5, 0x0); arc4random_buf(&v19, 0x20); v17 = &v19; v18 = 32; } else if (!sshbuf_len(v9)) { sshlog("ssh-sk.c", "sshsk_enroll", 0x207, 0x0, 0x2, 0x0); v11 = -10; goto LABEL_401867; } else { v17 = sshbuf_ptr(v9); v18 = sshbuf_len(v9); v6 = v18; sshlog("ssh-sk.c", "sshsk_enroll", 0x20d, 0x1, 0x7, 0x0); } v16 = sshsk_open(a1); if (!v16) { v11 = -0x4; } else { v6 = &v14; v11 = *(((stack_base)[96] + 24))(v12, v17, v18, a3, a5, v10, v15); if (v11) { v5 = a1; v4 = "provider \"%s\" failure %d"; sshlog("ssh-sk.c", "sshsk_enroll", 0x217, 0x1, 0x5, 0x0); v11 = skerr_to_ssherr(v11); } else { v11 = sshsk_key_from_response(v12, a3, *(v14), v14, &v13); if (!v11) { v11 = fill_attestation_blob(v14, v7); if (!v11) { *(v8) = v13; v13 = 0; v11 = 0; } } } } } } LABEL_401867: sshsk_free_options(v15); sshsk_free(v16); sshkey_free(v13); sshsk_free_enroll_response(v14); explicit_bzero(&v19, 0x20); return v11; }
openssh-portable
angr_phoenix
void put_u32_le(void *, u_int32_t) __attribute__(()); struct bwlimit { size_t buflen; u_int64_t rate; u_int64_t thresh; u_int64_t lamt; struct timeval bwstart, bwend; };
long put_u32_le(long a1, unsigned int a2) { long result; *(_BYTE *)a1 = a2; *(_WORD *)(a1 + 1) = a2 >> 8; result = a1 + 3; *(_BYTE *)(a1 + 3) = HIBYTE(a2); return result; }
openssh-portable
ida
static FILE *ck_fopen(char const *fname, char const *type) { FILE *r = fopen(fname, type); if (!r) perror_fatal(fname); return r; }
int ck_fopen(unsigned long a0, char *a1) { unsigned long v0; v0 = fopen(a0, a1); if (!v0) perror_fatal(a0); return v0; }
diffutils
angr_dream
static void sshbuf_maybe_pack(struct sshbuf *buf, int force) { ; ; if (buf->off == 0 || buf->readonly || buf->refcount > 1) return; if (force || (buf->off >= 8192 && buf->off >= buf->size / 2)) { memmove(buf->d, buf->d + buf->off, buf->size - buf->off); buf->size -= buf->off; buf->off = 0; ; } }
void sshbuf_maybe_pack(void **param_1, int param_2) { if ((((param_1[2] != (void *)0x0) && (*(int *)(param_1 + 6) == 0)) && (*(uint *)(param_1 + 7) < 2)) && ((param_2 != 0 || (((void *)0x1fff < param_1[2] && ((void *)((ulong)param_1[3] >> 1) <= param_1[2])))))) { memmove(*param_1, (void *)((long)*param_1 + (long)param_1[2]), (long)param_1[3] - (long)param_1[2]); param_1[3] = (void *)((long)param_1[3] - (long)param_1[2]); param_1[2] = (void *)0x0; } return; }
openssh-portable
ghidra
static int get_method(in) int in; { uch flags; uch magic[10]; int imagic0; int imagic1; ulg stamp; if (force && to_stdout) { imagic0 = (inptr < insize ? inbuf[inptr++] : fill_inbuf(1)); magic[0] = imagic0; imagic1 = (inptr < insize ? inbuf[inptr++] : fill_inbuf(1)); magic[1] = imagic1; } else { magic[0] = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); imagic0 = 0; if (magic[0]) { magic[1] = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); imagic1 = 0; } else { imagic1 = (inptr < insize ? inbuf[inptr++] : fill_inbuf(1)); magic[1] = imagic1; } } method = -1; part_nb++; header_bytes = 0; last_member = 0; if (memcmp(magic, "\037\213", 2) == 0 || memcmp(magic, "\037\236", 2) == 0) { method = (int)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); if (method != 8) { fprintf(stderr, "%s: %s: unknown method %d -- not supported\n", program_name, ifname, method); exit_code = 1; return -1; } work = unzip; flags = (uch)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); if ((flags & 0x20) != 0) { fprintf(stderr, "%s: %s is encrypted -- not supported\n", program_name, ifname); exit_code = 1; return -1; } if ((flags & 0xC0) != 0) { fprintf(stderr, "%s: %s has flags 0x%x -- not supported\n", program_name, ifname, flags); exit_code = 1; if (force <= 1) return -1; } stamp = (ulg)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); stamp |= ((ulg)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0))) << 8; stamp |= ((ulg)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0))) << 16; stamp |= ((ulg)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0))) << 24; if (stamp != 0 && !no_time) { if (stamp <= ((time_t)(!(!((time_t)0 < (time_t)-1)) ? (time_t)-1 : ((((time_t)1 << ((sizeof(time_t) * 8) - 2)) - 1) * 2 + 1)))) { time_stamp.tv_sec = stamp; time_stamp.tv_nsec = 0; } else { { if (!quiet) fprintf(stderr, "%s: %s: MTIME %lu out of range for this platform\n", program_name, ifname, stamp); if (exit_code == 0) exit_code = 2; } ; time_stamp.tv_sec = (( time_t)(!(!((time_t)0 < (time_t)-1)) ? (time_t)-1 : ((((time_t)1 << ((sizeof(time_t) * 8) - 2)) - 1) * 2 + 1))); time_stamp.tv_nsec = TIMESPEC_RESOLUTION - 1; } } magic[8] = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); magic[9] = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); if (flags & 0x02) { magic[2] = 8; magic[3] = flags; magic[4] = stamp & 0xff; magic[5] = (stamp >> 8) & 0xff; magic[6] = (stamp >> 16) & 0xff; magic[7] = stamp >> 24; updcrc(((void *)0), 0); updcrc(magic, 10); } if ((flags & 0x04) != 0) { uch lenbuf[2]; unsigned int len = lenbuf[0] = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); len |= (lenbuf[1] = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0))) << 8; if (verbose) { fprintf(stderr, "%s: %s: extra field of %u bytes ignored\n", program_name, ifname, len); } if (flags & 0x02) updcrc(lenbuf, 2); discard_input_bytes(len, flags); } if ((flags & 0x08) != 0) { if (no_name || (to_stdout && !list) || part_nb > 1) { discard_input_bytes(-1, flags); } else { char *p = gzip_base_name(ofname); char *base = p; for (;;) { *p = (char)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); if (*p++ == '\0') break; if (p >= ofname + sizeof(ofname)) { gzip_error("corrupted input -- file name too large"); } } if (flags & 0x02) updcrc((uch *)base, p - base); p = gzip_base_name(base); memmove(base, p, strlen(p) + 1); if (!list) { ; if (base) list = 0; } } } if ((flags & 0x10) != 0) { discard_input_bytes(-1, flags); } if (flags & 0x02) { unsigned int crc16 = updcrc(magic, 0) & 0xffff; unsigned int header16 = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); header16 |= ((unsigned int)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0))) << 8; if (header16 != crc16) { fprintf(stderr, "%s: %s: header checksum 0x%04x != computed checksum 0x%04x\n", program_name, ifname, header16, crc16); exit_code = 1; if (force <= 1) return -1; } } if (part_nb == 1) { header_bytes = inptr + 2 * 4; } } else if (memcmp(magic, "\120\113\003\004", 2) == 0 && inptr == 2 && memcmp((char *)inbuf, "\120\113\003\004", 4) == 0) { inptr = 0; work = unzip; if (check_zipfile(in) != 0) return -1; last_member = 1; } else if (memcmp(magic, "\037\036", 2) == 0) { work = unpack; method = 2; } else if (memcmp(magic, "\037\235", 2) == 0) { work = unlzw; method = 1; last_member = 1; } else if (memcmp(magic, "\037\240", 2) == 0) { work = unlzh; method = 3; last_member = 1; } else if (force && to_stdout && !list) { method = 0; work = copy; if (imagic1 != (-1)) inptr--; last_member = 1; if (imagic0 != (-1)) { write_buf(1, magic, 1); } } if (method >= 0) return method; if (part_nb == 1) { fprintf(stderr, "\n%s: %s: not in gzip format\n", program_name, ifname); exit_code = 1; return -1; } else { if (magic[0] == 0) { int inbyte; for (inbyte = imagic1; inbyte == 0; inbyte = (inptr < insize ? inbuf[inptr++] : fill_inbuf(1))) continue; if (inbyte == (-1)) { if (verbose) { if (!quiet) fprintf(stderr, "\n%s: %s: decompression OK, trailing zero bytes ignored\n", program_name, ifname); if (exit_code == 0) exit_code = 2; }; return -3; } } { if (!quiet) fprintf(stderr, "\n%s: %s: decompression OK, trailing garbage ignored\n", program_name, ifname); if (exit_code == 0) exit_code = 2; }; return -2; } }
long get_method(unsigned int a1) { int v1; int v2; int v3; int v4; int v5; char v6; int v7; char v8; int v9; int v10; unsigned long v11; int v12; int v13; int v15; unsigned char v16; int v17; long v18; int v19; long v20; int v21; long v22; int v23; long v24; int v25; char v26; unsigned int v27; long v28; char v29; int v30; unsigned char v31; int v32; unsigned char v33; int v34; char v35; char *v36; char *v37; size_t v38; int v39; int v40; int v41; int v42; int v43; int v44; unsigned char v45; int v46; int v47; int i; int v49; unsigned int v50; unsigned int v51; int v52; unsigned int v53; char *s; char *sa; long v56; long v57; long v58; long v59; char *dest; char v61[2]; char s1; char v63; char v64; unsigned char v65; int v66; char v67; char v68; unsigned long v69; v69 = __readfsqword(0x28u); if (force && to_stdout) { if (inptr >= (unsigned int)insize) { v2 = fill_inbuf(1LL); } else { v1 = inptr++; v2 = (unsigned char)inbuf[v1]; } v46 = v2; s1 = v2; if (inptr >= (unsigned int)insize) { v4 = fill_inbuf(1LL); } else { v3 = inptr++; v4 = (unsigned char)inbuf[v3]; } v47 = v4; v63 = v4; } else { if (inptr >= (unsigned int)insize) { v6 = fill_inbuf(0LL); } else { v5 = inptr++; v6 = inbuf[v5]; } s1 = v6; v46 = 0; if (v6) { if (inptr >= (unsigned int)insize) { v8 = fill_inbuf(0LL); } else { v7 = inptr++; v8 = inbuf[v7]; } v63 = v8; v47 = 0; } else { if (inptr >= (unsigned int)insize) { v10 = fill_inbuf(1LL); } else { v9 = inptr++; v10 = (unsigned char)inbuf[v9]; } v47 = v10; v63 = v10; } } method = -1; ++part_nb; header_bytes = 0LL; last_member = 0; v11 = (unsigned long)&unk_5203; if (!memcmp(&s1, &unk_5203, 2uLL) || (v11 = (unsigned long)&unk_5206, !memcmp(&s1, &unk_5206, 2uLL))) { if (inptr >= (unsigned int)insize) { v13 = fill_inbuf(0LL); } else { v12 = inptr++; v13 = (unsigned char)inbuf[v12]; } method = v13; if (v13 != 8) { fprintf(stderr, "%s: %s: unknown method %d -- not supported\n", program_name, &ifname, (unsigned int)method); exit_code = 1; return 0xFFFFFFFFLL; } work = (long (*)(_QWORD, _QWORD))&unzip; if (inptr >= (unsigned int)insize) { v16 = fill_inbuf(0LL); } else { v15 = inptr++; v16 = inbuf[v15]; } v45 = v16; if ((v16 & 0x20) != 0) { fprintf(stderr, "%s: %s is encrypted -- not supported\n", program_name, &ifname); exit_code = 1; return 0xFFFFFFFFLL; } if ((v16 & 0xC0) != 0) { v11 = (unsigned long)"%s: %s has flags 0x%x -- not supported\n"; fprintf(stderr, "%s: %s has flags 0x%x -- not supported\n", program_name, &ifname, v16); exit_code = 1; if (force <= 1) return 0xFFFFFFFFLL; } if (inptr >= (unsigned int)insize) { v18 = (int)fill_inbuf(0LL); } else { v17 = inptr++; v18 = (unsigned char)inbuf[v17]; } v56 = v18; if (inptr >= (unsigned int)insize) { v20 = (long)(int)fill_inbuf(0LL) << 8; } else { v19 = inptr++; v20 = (unsigned long)(unsigned char)inbuf[v19] << 8; } v57 = v20 | v56; if (inptr >= (unsigned int)insize) { v22 = (long)(int)fill_inbuf(0LL) << 16; } else { v21 = inptr++; v22 = (unsigned long)(unsigned char)inbuf[v21] << 16; } v58 = v22 | v57; if (inptr >= (unsigned int)insize) { v24 = (long)(int)fill_inbuf(0LL) << 24; } else { v23 = inptr++; v24 = (unsigned long)(unsigned char)inbuf[v23] << 24; } v59 = v24 | v58; if (v59 && !no_time) { if (v59 < 0) { if (!quiet) { v11 = (unsigned long)"%s: %s: MTIME %lu out of range for this " "platform\n"; fprintf(stderr, "%s: %s: MTIME %lu out of range for this platform\n", program_name, &ifname, v59); } if (!exit_code) exit_code = 2; time_stamp[0] = 0x7FFFFFFFFFFFFFFFLL; time_stamp[1] = 999999999LL; } else { time_stamp[0] = v59; time_stamp[1] = 0LL; } } if (inptr >= (unsigned int)insize) { v26 = fill_inbuf(0LL); } else { v25 = inptr++; v26 = inbuf[v25]; } v67 = v26; if (inptr >= (unsigned int)insize) { v29 = fill_inbuf(0LL); } else { v27 = inptr++; v28 = v27; v29 = inbuf[v27]; } v68 = v29; if ((v45 & 2) != 0) { v64 = 8; v65 = v45; v66 = v59; updcrc(0LL, 0LL); v11 = 10LL; updcrc(&s1, 10LL); } if ((v45 & 4) != 0) { if (inptr >= (unsigned int)insize) { v31 = fill_inbuf(0LL); } else { v30 = inptr++; v31 = inbuf[v30]; } v61[0] = v31; v49 = v31; if (inptr >= (unsigned int)insize) { v33 = fill_inbuf(0LL); } else { v32 = inptr++; v33 = inbuf[v32]; } v61[1] = v33; v50 = (v33 << 8) | v49; if (verbose) fprintf(stderr, "%s: %s: extra field of %u bytes ignored\n", program_name, &ifname, v50); if ((v45 & 2) != 0) updcrc(v61, 2LL); v11 = v45; discard_input_bytes(v50, v45); } if ((v45 & 8) != 0) { if (no_name || to_stdout && !list || part_nb > 1) { discard_input_bytes(-1LL, v45); } else { s = (char *)gzip_base_name(ofname, v11, v28); dest = s; while (1) { if (inptr >= (unsigned int)insize) { v35 = fill_inbuf(0LL); } else { v34 = inptr++; v35 = inbuf[v34]; } *s = v35; v36 = s; v37 = ++s; if (!*v36) break; if (s >= &ofname[1024]) { gzip_error("corrupted input -- file name too large"); break; } } if ((v45 & 2) != 0) { v11 = (unsigned int)((_DWORD)s - (_DWORD)dest); updcrc(dest, v11); } sa = (char *)gzip_base_name(dest, v11, v37); v38 = strlen(sa); memmove(dest, sa, v38 + 1); if (!list && dest) list = 0; } } if ((v45 & 0x10) != 0) discard_input_bytes(-1LL, v45); if ((v45 & 2) != 0) { v51 = (unsigned short)updcrc(&s1, 0LL); if (inptr >= (unsigned int)insize) { v40 = fill_inbuf(0LL); } else { v39 = inptr++; v40 = (unsigned char)inbuf[v39]; } v52 = v40; if (inptr >= (unsigned int)insize) { v42 = (unsigned int)fill_inbuf(0LL) << 8; } else { v41 = inptr++; v42 = (unsigned char)inbuf[v41] << 8; } v53 = v42 | v52; if (v53 != v51) { fprintf(stderr, "%s: %s: header checksum 0x%04x != computed checksum 0x%04x\n", program_name, &ifname, v53, v51); exit_code = 1; if (force <= 1) return 0xFFFFFFFFLL; } } if (part_nb == 1) header_bytes = (unsigned int)(inptr + 8); } else if (!memcmp(&s1, &unk_535C, 2uLL) && inptr == 2 && !memcmp(inbuf, &unk_535C, 4uLL)) { inptr = 0; work = (long (*)(_QWORD, _QWORD))&unzip; if ((unsigned int)check_zipfile(a1)) return 0xFFFFFFFFLL; last_member = 1; } else if (!memcmp(&s1, &unk_5361, 2uLL)) { work = (long (*)(_QWORD, _QWORD))&unpack; method = 2; } else if (!memcmp(&s1, &unk_5364, 2uLL)) { work = (long (*)(_QWORD, _QWORD))&unlzw; method = 1; last_member = 1; } else if (!memcmp(&s1, &unk_5367, 2uLL)) { work = (long (*)(_QWORD, _QWORD))&unlzh; method = 3; last_member = 1; } else if (force && to_stdout && !list) { method = 0; work = (long (*)(_QWORD, _QWORD))&copy; if (v47 != -1) --inptr; last_member = 1; if (v46 != -1) write_buf(1LL, &s1, 1LL); } if (method >= 0) return (unsigned int)method; if (part_nb == 1) { fprintf(stderr, "\n%s: %s: not in gzip format\n", program_name, &ifname); exit_code = 1; return 0xFFFFFFFFLL; } else { if (s1) goto LABEL_147; for (i = v47; !i; i = v44) { if (inptr >= (unsigned int)insize) { v44 = fill_inbuf(1LL); } else { v43 = inptr++; v44 = (unsigned char)inbuf[v43]; } } if (i != -1) { LABEL_147: if (!quiet) fprintf(stderr, "\n%s: %s: decompression OK, trailing garbage ignored\n", program_name, &ifname); if (!exit_code) exit_code = 2; return 4294967294LL; } else { if (verbose) { if (!quiet) fprintf(stderr, "\n%s: %s: decompression OK, trailing zero bytes ignored\n", program_name, &ifname); if (!exit_code) exit_code = 2; } return 4294967293LL; } } }
gzip-1.12
ida
void mm_log_handler(LogLevel level, int forced, const char *msg, void *ctx) { struct sshbuf *log_msg; struct monitor *mon = (struct monitor *)ctx; int r; size_t len; if (mon->m_log_sendfd == -1) sshfatal("monitor_wrap.c", __func__, 93, 1, SYSLOG_LEVEL_FATAL, ((void *)0), "no log channel"); if ((log_msg = sshbuf_new()) == ((void *)0)) sshfatal("monitor_wrap.c", __func__, 96, 1, SYSLOG_LEVEL_FATAL, ((void *)0), "sshbuf_new failed"); if ((r = sshbuf_put_u32(log_msg, 0)) != 0 || (r = sshbuf_put_u32(log_msg, level)) != 0 || (r = sshbuf_put_u32(log_msg, forced)) != 0 || (r = sshbuf_put_cstring(log_msg, msg)) != 0) sshfatal("monitor_wrap.c", __func__, 102, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble"); if ((len = sshbuf_len(log_msg)) < 4 || len > 0xffffffff) sshfatal("monitor_wrap.c", __func__, 104, 1, SYSLOG_LEVEL_FATAL, ((void *)0), "bad length %zu", len); do { const u_int32_t __v = (len - 4); ((u_char *)(sshbuf_mutable_ptr(log_msg)))[0] = (__v >> 24) & 0xff; ((u_char *)(sshbuf_mutable_ptr(log_msg)))[1] = (__v >> 16) & 0xff; ((u_char *)(sshbuf_mutable_ptr(log_msg)))[2] = (__v >> 8) & 0xff; ((u_char *)(sshbuf_mutable_ptr(log_msg)))[3] = __v & 0xff; } while (0); if (atomicio((ssize_t (*)(int, void *, size_t))write, mon->m_log_sendfd, sshbuf_mutable_ptr(log_msg), len) != len) sshfatal("monitor_wrap.c", __func__, 108, 1, SYSLOG_LEVEL_FATAL, ((void *)0), "write: %s", strerror((*__errno_location()))); sshbuf_free(log_msg); }
long long mm_log_handler(unsigned long a0, unsigned long a1, unsigned long long a2, struct_0 *a3) { unsigned long long v0; unsigned int v1; unsigned int v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long v6; if (a3->field_c == -1) { v0 = "no log channel"; sshfatal("monitor_wrap.c", "mm_log_handler", 0x5d, 0x1, 0x1, 0x0); } v3 = sshbuf_new(); if (!v3) { v5 = "sshbuf_new failed"; sshfatal("monitor_wrap.c", "mm_log_handler", 0x60, 0x1, 0x1, 0x0); } v1 = sshbuf_put_u32(v3, 0x0); if (!v1) { v1 = sshbuf_put_u32(v3, a0); if (!v1) { v1 = sshbuf_put_u32(v3, a1); if (!v1) v1 = sshbuf_put_cstring(v3, a2, a2); } } if (v1 || v1 || v1 || v1) { v5 = "assemble"; sshfatal("monitor_wrap.c", "mm_log_handler", 0x66, 0x1, 0x1, ssh_err(v1)); } v4 = sshbuf_len(v3); if (v4 <= 3 || v4 > 4294967295) { v6 = v4; v5 = "bad length %zu"; sshfatal("monitor_wrap.c", "mm_log_handler", 0x68, 0x1, 0x1, 0x0); } v2 = v4 - 4; *(sshbuf_mutable_ptr(v3)) = v2 >> 24; *((sshbuf_mutable_ptr(v3) + 1)) = v2 >> 16; *((sshbuf_mutable_ptr(v3) + 2)) = v2 >> 8; *((sshbuf_mutable_ptr(v3) + 3)) = v2; if (v4 != atomicio(got.write, a3->field_c, sshbuf_mutable_ptr(v3), v4)) { v6 = strerror(*(__errno_location())); v5 = "write: %s"; sshfatal("monitor_wrap.c", "mm_log_handler", 0x6c, 0x1, 0x1, 0x0); } return sshbuf_free(v3); }
openssh-portable
angr_dream
int rl_vi_yank_arg(int count, int key) { if (rl_explicit_arg) rl_yank_nth_arg(count - 1, key); else rl_yank_nth_arg('$', key); return (0); }
long long rl_vi_yank_arg(unsigned long a0, unsigned long a1, unsigned long long a2) { if (!rl_explicit_arg) { rl_yank_nth_arg(0x24, a1, a2); return 0; } rl_yank_nth_arg(a0 - 1, a1, a0 - 1); return 0; }
bash
angr_sailr
static char *blank_rtrim(const char *str, char *buf) { int i; if (str == ((void *)0)) return (((void *)0)); strcpy(buf, str); i = strlen(buf) - 1; while ((i >= 0) && ((buf[i] == ' ') || buf[i] == '\t')) i--; buf[++i] = '\0'; return buf; }
char *blank_rtrim(char *param_1, char *param_2) { int iVar1; size_t sVar2; int local_c; if (param_1 == (char *)0x0) { param_2 = (char *)0x0; } else { strcpy(param_2, param_1); sVar2 = strlen(param_2); local_c = (int)sVar2; do { iVar1 = local_c; local_c = iVar1 + -1; if (local_c < 0) break; } while ((param_2[local_c] == ' ') || (param_2[local_c] == '\t')); param_2[iVar1] = '\0'; } return param_2; }
findutils
ghidra
static void channel_pre_dynamic(struct ssh *ssh, Channel *c) { const u_char *p; u_int have; int ret; c->io_want = 0; have = sshbuf_len(c->input); sshlog("channels.c", __func__, 1552, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0), "channel %d: pre_dynamic: have %d", c->self, have); if (have < 3) { c->io_want |= 0x01; return; } p = sshbuf_ptr(c->input); switch (p[0]) { case 0x04: ret = channel_decode_socks4(c, c->input, c->output); break; case 0x05: ret = channel_decode_socks5(c, c->input, c->output); break; default: ret = -1; break; } if (ret < 0) { chan_mark_dead(ssh, c); } else if (ret == 0) { sshlog("channels.c", __func__, 1577, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0), "channel %d: pre_dynamic: need more", c->self); c->io_want |= 0x01; if (sshbuf_len(c->output)) c->io_want |= 0x02; } else { c->type = 3; port_open_helper(ssh, c, "direct-tcpip"); } }
void channel_pre_dynamic(long a1, long a2) { int v2; int v3; unsigned int v4; *(_DWORD *)(a2 + 44) = 0; v4 = sshbuf_len(*(_QWORD *)(a2 + 104)); sshlog("channels.c", "channel_pre_dynamic", 1552LL, 0LL, 6LL, 0LL, "channel %d: pre_dynamic: have %d", *(unsigned int *)(a2 + 4), v4); if (v4 > 2) { v2 = *(unsigned char *)sshbuf_ptr(*(_QWORD *)(a2 + 104)); if (v2 == 4) { v3 = channel_decode_socks4(a2, *(_QWORD *)(a2 + 104), *(_QWORD *)(a2 + 112)); } else if (v2 == 5) { v3 = channel_decode_socks5(a2, *(_QWORD *)(a2 + 104), *(_QWORD *)(a2 + 112)); } else { v3 = -1; } if (v3 >= 0) { if (v3) { *(_DWORD *)a2 = 3; port_open_helper(a1, a2, "direct-tcpip"); } else { sshlog("channels.c", "channel_pre_dynamic", 1577LL, 0LL, 6LL, 0LL, "channel %d: pre_dynamic: need more", *(unsigned int *)(a2 + 4)); *(_DWORD *)(a2 + 44) |= 1u; if (sshbuf_len(*(_QWORD *)(a2 + 112))) *(_DWORD *)(a2 + 44) |= 2u; } } else { chan_mark_dead(a1, a2); } } else { *(_DWORD *)(a2 + 44) |= 1u; } }
openssh-portable
ida
static inline __u16 rta_getattr_u16(const struct rtattr *rta) { return *(__u16 *)(( void *)(((char *)(rta)) + ((((sizeof(struct rtattr)) + 4U - 1) & ~(4U - 1)) + (0)))); }
int rta_getattr_u16(struct_0 *a0) { return a0->field_4; }
iproute2-6.0.0
angr_sailr
static void ipstats_stat_desc_pack_afstats(struct ipstats_stat_dump_filters *filters, const struct ipstats_stat_desc *desc) { ipstats_stat_desc_enable_bit(filters, IFLA_STATS_AF_SPEC, 0); }
long long ipstats_stat_desc_pack_afstats(unsigned int *a0, unsigned long a1) { unsigned long v0; v0 = a1; return ipstats_stat_desc_enable_bit(a0, 0x5, 0x0); }
iproute2-6.0.0
angr_sailr
struct predicate *get_new_pred(const struct parser_table *entry) { register struct predicate *new_pred; (void)entry; ((void)sizeof((entry->type != ARG_OPTION) ? 1 : 0), __extension__({ if (entry->type != ARG_OPTION) ; else __assert_fail("entry->type != ARG_OPTION", "tree.c", 1485, __extension__ __PRETTY_FUNCTION__); })); ((void)sizeof((entry->type != ARG_POSITIONAL_OPTION) ? 1 : 0), __extension__({ if (entry->type != ARG_POSITIONAL_OPTION) ; else __assert_fail("entry->type != ARG_POSITIONAL_OPTION", "tree.c", 1486, __extension__ __PRETTY_FUNCTION__); })); new_pred = xzalloc(sizeof(struct predicate)); if (predicates == ((void *)0)) { last_pred = predicates = new_pred; } else { last_pred->pred_next = new_pred; last_pred = new_pred; } last_pred->parser_entry = entry; last_pred->p_type = NO_TYPE; last_pred->p_prec = NO_PREC; last_pred->need_stat = 1; last_pred->need_type = 1; last_pred->p_cost = NeedsUnknown; last_pred->arg_text = "ThisShouldBeSetToSomethingElse"; last_pred->literal_control_chars = options.literal_control_chars; last_pred->est_success_rate = 1.0; init_pred_perf(last_pred); return last_pred; }
int get_new_pred(unsigned int *a0) { unsigned long long v1; unsigned long long v2; if (!*(a0)) { __assert_fail(); } else if (*(a0) == 2) { __assert_fail(); } else { v1 = xzalloc(0x138); v2 = v1; if (!predicates) { predicates = v1; last_pred = predicates; } else { last_pred->field_108 = v2; last_pred = v2; } last_pred->field_130 = a0; last_pred->field_10 = 0; last_pred->field_14 = 0; last_pred->field_1a = 1; last_pred->field_1b = 1; last_pred->field_20 = 10; last_pred->field_30 = "ThisShouldBeSetToSomethingElse"; last_pred->field_28 = g_500067; last_pred->field_24 = g_403c34; init_pred_perf(last_pred); return last_pred; } }
findutils
angr_dream
static void sortlines(struct line *__restrict__ lines, size_t nthreads, size_t total_lines, struct merge_node *node, struct merge_node_queue *queue, FILE *tfp, char const *temp_output) { size_t nlines = node->nlo + node->nhi; size_t lo_threads = nthreads / 2; size_t hi_threads = nthreads - lo_threads; pthread_t thread; struct thread_args args = {lines, lo_threads, total_lines, node->lo_child, queue, tfp, temp_output}; if (nthreads > 1 && SUBTHREAD_LINES_HEURISTIC <= nlines && pthread_create(&thread, ((void *)0), sortlines_thread, &args) == 0) { sortlines(lines - node->nlo, hi_threads, total_lines, node->hi_child, queue, tfp, temp_output); pthread_join(thread, ((void *)0)); } else { size_t nlo = node->nlo; size_t nhi = node->nhi; struct line *temp = lines - total_lines; if (1 < nhi) sequential_sort(lines - nlo, nhi, temp - nlo / 2, 0); if (1 < nlo) sequential_sort(lines, nlo, temp, 0); node->lo = lines; node->hi = lines - nlo; node->end_lo = lines - nlo; node->end_hi = lines - nlo - nhi; queue_insert(queue, node); merge_loop(queue, total_lines, tfp, temp_output); } }
void sortlines(void *a0, unsigned long a1, unsigned long long a2, unsigned long long a3[10], unsigned long long *a4, void *a5, unsigned long long v16) { unsigned long long v0; char v1; unsigned long v2; unsigned long v3; unsigned long long v4; unsigned long v5; unsigned long v6; unsigned int v7; unsigned long v8; unsigned long v9; unsigned long v10; unsigned long v11; unsigned long v12; unsigned long v13; unsigned long v14; char v15; unsigned long long *v17; unsigned long long v18; v0 = v16; v2 = a3[6] + a3[5]; v3 = a1 / 2; v4 = a1 - v3; v8 = a0; v9 = v3; v10 = a2; v11 = a3[8]; v12 = a4; v13 = a5; v14 = v0; if (a1 > 1 && v2 > 131071 && !pthread_create(&v1, 0x0, sortlines_thread, &v8)) { sortlines(-(a3[5] << 5) + a0, v4, a2, a3[9], a4, a5, v0); pthread_join(*(&v1), 0x0); goto LABEL_4086b9; } v5 = a3[5]; v6 = a3[6]; *(&v7) = a0 + -(a2 << 5); if (v6 > 1) sequential_sort(-(v5 << 5) + a0, v6, -(v5 >> 1 << 5) + *(&v7), 0x0); if (v5 > 1) sequential_sort(a0, v5, *(&v7), 0x0); a3[0] = a0; a3[1] = -(v5 << 5) + a0; a3[2] = -(v5 << 5) + a0; a3[3] = -(v5 << 5) - v6 * 32 + a0; queue_insert(a4, a3); merge_loop(a4, a2, a5, v0); LABEL_4086b9: v18 = *(&v15) ^ v17[5]; return; }
coreutils
angr_phoenix
static void run_override_list(struct keyword_list *kp, struct tar_stat_info *st) { for (; kp; kp = kp->next) { struct xhdr_tab const *t = locate_handler(kp->pattern); if (t) t->decoder(st, t->keyword, kp->value, strlen(kp->value)); } }
void run_override_list(undefined8 *param_1, undefined8 param_2) { code *pcVar1; undefined8 *puVar2; size_t sVar3; undefined8 *local_30; for (local_30 = param_1; local_30 != (undefined8 *)0x0; local_30 = (undefined8 *)*local_30) { puVar2 = (undefined8 *)locate_handler(local_30[1]); if (puVar2 != (undefined8 *)0x0) { pcVar1 = (code *)puVar2[2]; sVar3 = strlen((char *)local_30[2]); (*pcVar1)(param_2, *puVar2, local_30[2], sVar3); } } return; }
tar
ghidra
int template_parse(const char *template) { unsigned int i; int ret; cfg_option_t pov; cfg_option_t val; char tmpstr[256]; pov = cfg_load(template); if (pov == ((void *)0)) { perror("configFileLoad"); fprintf(stderr, "Error loading template: %s\n", template); exit(1); } for (val = pov; val->name; val++) { if (handle_option(val) == 0) { fprintf(stderr, "Warning: skipping unknown option '%s'\n", val->name); } } val = cfg_next(pov, "unit"); if (val != ((void *)0)) { if (cfg.unit == ((void *)0)) { i = 0; cfg.unit = malloc(sizeof(char *) * 128); if (cfg.unit == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "unit") != 0) continue; cfg.unit[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.unit[i] = ((void *)0); } }; if (cfg.unit == ((void *)0)) { val = cfg_next(pov, "ou"); if (val != ((void *)0)) { if (cfg.unit == ((void *)0)) { i = 0; cfg.unit = malloc(sizeof(char *) * 128); if (cfg.unit == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ou") != 0) continue; cfg.unit[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.unit[i] = ((void *)0); } }; } val = cfg_next(pov, "organization"); if (val != ((void *)0)) { if (cfg.organization == ((void *)0)) { i = 0; cfg.organization = malloc(sizeof(char *) * 128); if (cfg.organization == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "organization") != 0) continue; cfg.organization[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.organization[i] = ((void *)0); } }; if (cfg.organization == ((void *)0)) { val = cfg_next(pov, "o"); if (val != ((void *)0)) { if (cfg.organization == ((void *)0)) { i = 0; cfg.organization = malloc(sizeof(char *) * 128); if (cfg.organization == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "o") != 0) continue; cfg.organization[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.organization[i] = ((void *)0); } }; } val = cfg_next(pov, "locality"); if (val != ((void *)0)) cfg.locality = strdup(val->value); val = cfg_next(pov, "state"); if (val != ((void *)0)) cfg.state = strdup(val->value); val = cfg_next(pov, "dn"); if (val != ((void *)0)) cfg.dn = strdup(val->value); val = cfg_next(pov, "cn"); if (val != ((void *)0)) cfg.cn = strdup(val->value); val = cfg_next(pov, "uid"); if (val != ((void *)0)) cfg.uid = strdup(val->value); val = cfg_next(pov, "issuer_unique_id"); if (val != ((void *)0)) { gnutls_datum_t _input = {(void *)val->value, strlen(val->value)}; gnutls_datum_t _output; ret = gnutls_hex_decode2(&_input, &_output); if (ret < 0) { fprintf(stderr, "error in hex ID: %s\n", val->value); exit(1); } cfg.issuer_unique_id = _output.data; cfg.issuer_unique_id_size = _output.size; }; val = cfg_next(pov, "subject_unique_id"); if (val != ((void *)0)) { gnutls_datum_t _input = {(void *)val->value, strlen(val->value)}; gnutls_datum_t _output; ret = gnutls_hex_decode2(&_input, &_output); if (ret < 0) { fprintf(stderr, "error in hex ID: %s\n", val->value); exit(1); } cfg.subject_unique_id = _output.data; cfg.subject_unique_id_size = _output.size; }; val = cfg_next(pov, "challenge_password"); if (val != ((void *)0)) cfg.challenge_password = strdup(val->value); val = cfg_next(pov, "password"); if (val != ((void *)0)) cfg.password = strdup(val->value); val = cfg_next(pov, "pkcs9_email"); if (val != ((void *)0)) cfg.pkcs9_email = strdup(val->value); val = cfg_next(pov, "country"); if (val != ((void *)0)) cfg.country = strdup(val->value); val = cfg_next(pov, "expiration_date"); if (val != ((void *)0)) cfg.expiration_date = strdup(val->value); val = cfg_next(pov, "activation_date"); if (val != ((void *)0)) cfg.activation_date = strdup(val->value); val = cfg_next(pov, "crl_revocation_date"); if (val != ((void *)0)) cfg.revocation_date = strdup(val->value); val = cfg_next(pov, "crl_this_update_date"); if (val != ((void *)0)) cfg.this_update_date = strdup(val->value); val = cfg_next(pov, "crl_next_update_date"); if (val != ((void *)0)) cfg.next_update_date = strdup(val->value); val = cfg_next(pov, "inhibit_anypolicy_skip_certs"); if (val != ((void *)0)) { cfg.skip_certs = strtol(val->value, ((void *)0), 10); }; for (i = 0; i < 8; i++) { snprintf(tmpstr, sizeof(tmpstr), "policy%d", i + 1); val = cfg_next(pov, tmpstr); if (val != ((void *)0)) cfg.policy_oid[i] = strdup(val->value); if (cfg.policy_oid[i] != ((void *)0)) { snprintf(tmpstr, sizeof(tmpstr), "policy%d_url", i + 1); val = cfg_next(pov, tmpstr); if (val != ((void *)0)) cfg.policy_url[i] = strdup(val->value); snprintf(tmpstr, sizeof(tmpstr), "policy%d_txt", i + 1); val = cfg_next(pov, tmpstr); if (val != ((void *)0)) { cfg.policy_txt[i] = strdup(val->value); } } } val = cfg_next(pov, "dc"); if (val != ((void *)0)) { if (cfg.dc == ((void *)0)) { i = 0; cfg.dc = malloc(sizeof(char *) * 128); if (cfg.dc == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "dc") != 0) continue; cfg.dc[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.dc[i] = ((void *)0); } }; val = cfg_next(pov, "dns_name"); if (val != ((void *)0)) { if (cfg.dns_name == ((void *)0)) { i = 0; cfg.dns_name = malloc(sizeof(char *) * 128); if (cfg.dns_name == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "dns_name") != 0) continue; cfg.dns_name[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.dns_name[i] = ((void *)0); } }; val = cfg_next(pov, "uri"); if (val != ((void *)0)) { if (cfg.uri == ((void *)0)) { i = 0; cfg.uri = malloc(sizeof(char *) * 128); if (cfg.uri == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "uri") != 0) continue; cfg.uri[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.uri[i] = ((void *)0); } }; val = cfg_next(pov, "krb5_principal"); if (val != ((void *)0)) { if (cfg.krb5_principal == ((void *)0)) { i = 0; cfg.krb5_principal = malloc(sizeof(char *) * 128); if (cfg.krb5_principal == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "krb5_principal") != 0) continue; cfg.krb5_principal[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.krb5_principal[i] = ((void *)0); } }; val = cfg_next(pov, "other_name"); if (val != ((void *)0)) { char *str; char *p; if (cfg.other_name == ((void *)0)) { i = 0; cfg.other_name = malloc(sizeof(char *) * 128); if (cfg.other_name == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "other_name") != 0) continue; str = strdup(val->value); if (str == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; if ((p = strchr(str, ' ')) == ((void *)0) && (p = strchr(str, '\t')) == ((void *)0)) { fprintf(stderr, "Error parsing %s\n", "other_name"); exit(1); } p[0] = 0; p++; cfg.other_name[i] = strdup(str); while (*p == ' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(stderr, "Error (2) parsing %s\n", "other_name"); exit(1); } cfg.other_name[i + 1] = strdup(p); i += 2; free(str); if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.other_name[i] = ((void *)0); } }; val = cfg_next(pov, "other_name_octet"); if (val != ((void *)0)) { char *str; char *p; if (cfg.other_name_octet == ((void *)0)) { i = 0; cfg.other_name_octet = malloc(sizeof(char *) * 128); if (cfg.other_name_octet == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "other_name_octet") != 0) continue; str = strdup(val->value); if (str == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; if ((p = strchr(str, ' ')) == ((void *)0) && (p = strchr(str, '\t')) == ((void *)0)) { fprintf(stderr, "Error parsing %s\n", "other_name_octet"); exit(1); } p[0] = 0; p++; cfg.other_name_octet[i] = strdup(str); while (*p == ' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(stderr, "Error (2) parsing %s\n", "other_name_octet"); exit(1); } cfg.other_name_octet[i + 1] = strdup(p); i += 2; free(str); if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.other_name_octet[i] = ((void *)0); } }; val = cfg_next(pov, "other_name_utf8"); if (val != ((void *)0)) { char *str; char *p; if (cfg.other_name_utf8 == ((void *)0)) { i = 0; cfg.other_name_utf8 = malloc(sizeof(char *) * 128); if (cfg.other_name_utf8 == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "other_name_utf8") != 0) continue; str = strdup(val->value); if (str == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; if ((p = strchr(str, ' ')) == ((void *)0) && (p = strchr(str, '\t')) == ((void *)0)) { fprintf(stderr, "Error parsing %s\n", "other_name_utf8"); exit(1); } p[0] = 0; p++; cfg.other_name_utf8[i] = strdup(str); while (*p == ' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(stderr, "Error (2) parsing %s\n", "other_name_utf8"); exit(1); } cfg.other_name_utf8[i + 1] = strdup(p); i += 2; free(str); if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.other_name_utf8[i] = ((void *)0); } }; val = cfg_next(pov, "xmpp_name"); if (val != ((void *)0)) { if (cfg.xmpp_name == ((void *)0)) { i = 0; cfg.xmpp_name = malloc(sizeof(char *) * 128); if (cfg.xmpp_name == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "xmpp_name") != 0) continue; cfg.xmpp_name[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.xmpp_name[i] = ((void *)0); } }; val = cfg_next(pov, "ip_address"); if (val != ((void *)0)) { if (cfg.ip_addr == ((void *)0)) { i = 0; cfg.ip_addr = malloc(sizeof(char *) * 128); if (cfg.ip_addr == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ip_address") != 0) continue; cfg.ip_addr[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.ip_addr[i] = ((void *)0); } }; val = cfg_next(pov, "email"); if (val != ((void *)0)) { if (cfg.email == ((void *)0)) { i = 0; cfg.email = malloc(sizeof(char *) * 128); if (cfg.email == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "email") != 0) continue; cfg.email[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.email[i] = ((void *)0); } }; val = cfg_next(pov, "key_purpose_oid"); if (val != ((void *)0)) { if (cfg.key_purpose_oids == ((void *)0)) { i = 0; cfg.key_purpose_oids = malloc(sizeof(char *) * 128); if (cfg.key_purpose_oids == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "key_purpose_oid") != 0) continue; cfg.key_purpose_oids[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.key_purpose_oids[i] = ((void *)0); } }; val = cfg_next(pov, "nc_exclude_ip"); if (val != ((void *)0)) { if (cfg.excluded_nc_ip == ((void *)0)) { i = 0; cfg.excluded_nc_ip = malloc(sizeof(char *) * 128); if (cfg.excluded_nc_ip == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_exclude_ip") != 0) continue; cfg.excluded_nc_ip[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.excluded_nc_ip[i] = ((void *)0); } }; val = cfg_next(pov, "nc_exclude_dns"); if (val != ((void *)0)) { if (cfg.excluded_nc_dns == ((void *)0)) { i = 0; cfg.excluded_nc_dns = malloc(sizeof(char *) * 128); if (cfg.excluded_nc_dns == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_exclude_dns") != 0) continue; cfg.excluded_nc_dns[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.excluded_nc_dns[i] = ((void *)0); } }; val = cfg_next(pov, "nc_exclude_email"); if (val != ((void *)0)) { if (cfg.excluded_nc_email == ((void *)0)) { i = 0; cfg.excluded_nc_email = malloc(sizeof(char *) * 128); if (cfg.excluded_nc_email == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_exclude_email") != 0) continue; cfg.excluded_nc_email[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.excluded_nc_email[i] = ((void *)0); } }; val = cfg_next(pov, "nc_permit_ip"); if (val != ((void *)0)) { if (cfg.permitted_nc_ip == ((void *)0)) { i = 0; cfg.permitted_nc_ip = malloc(sizeof(char *) * 128); if (cfg.permitted_nc_ip == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_permit_ip") != 0) continue; cfg.permitted_nc_ip[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.permitted_nc_ip[i] = ((void *)0); } }; val = cfg_next(pov, "nc_permit_dns"); if (val != ((void *)0)) { if (cfg.permitted_nc_dns == ((void *)0)) { i = 0; cfg.permitted_nc_dns = malloc(sizeof(char *) * 128); if (cfg.permitted_nc_dns == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_permit_dns") != 0) continue; cfg.permitted_nc_dns[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.permitted_nc_dns[i] = ((void *)0); } }; val = cfg_next(pov, "nc_permit_email"); if (val != ((void *)0)) { if (cfg.permitted_nc_email == ((void *)0)) { i = 0; cfg.permitted_nc_email = malloc(sizeof(char *) * 128); if (cfg.permitted_nc_email == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "nc_permit_email") != 0) continue; cfg.permitted_nc_email[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.permitted_nc_email[i] = ((void *)0); } }; val = cfg_next(pov, "dn_oid"); if (val != ((void *)0)) { char *str; char *p; if (cfg.dn_oid == ((void *)0)) { i = 0; cfg.dn_oid = malloc(sizeof(char *) * 128); if (cfg.dn_oid == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "dn_oid") != 0) continue; str = strdup(val->value); if (str == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; if ((p = strchr(str, ' ')) == ((void *)0) && (p = strchr(str, '\t')) == ((void *)0)) { fprintf(stderr, "Error parsing %s\n", "dn_oid"); exit(1); } p[0] = 0; p++; cfg.dn_oid[i] = strdup(str); while (*p == ' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(stderr, "Error (2) parsing %s\n", "dn_oid"); exit(1); } cfg.dn_oid[i + 1] = strdup(p); i += 2; free(str); if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.dn_oid[i] = ((void *)0); } }; val = cfg_next(pov, "add_extension"); if (val != ((void *)0)) { char *str; char *p; if (cfg.extensions == ((void *)0)) { i = 0; cfg.extensions = malloc(sizeof(char *) * 128); if (cfg.extensions == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "add_extension") != 0) continue; str = strdup(val->value); if (str == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; if ((p = strchr(str, ' ')) == ((void *)0) && (p = strchr(str, '\t')) == ((void *)0)) { fprintf(stderr, "Error parsing %s\n", "add_extension"); exit(1); } p[0] = 0; p++; cfg.extensions[i] = strdup(str); while (*p == ' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(stderr, "Error (2) parsing %s\n", "add_extension"); exit(1); } cfg.extensions[i + 1] = strdup(p); i += 2; free(str); if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.extensions[i] = ((void *)0); } }; val = cfg_next(pov, "add_critical_extension"); if (val != ((void *)0)) { char *str; char *p; if (cfg.crit_extensions == ((void *)0)) { i = 0; cfg.crit_extensions = malloc(sizeof(char *) * 128); if (cfg.crit_extensions == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "add_critical_extension") != 0) continue; str = strdup(val->value); if (str == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; if ((p = strchr(str, ' ')) == ((void *)0) && (p = strchr(str, '\t')) == ((void *)0)) { fprintf(stderr, "Error parsing %s\n", "add_critical_extension"); exit(1); } p[0] = 0; p++; cfg.crit_extensions[i] = strdup(str); while (*p == ' ' || *p == '\t') p++; if (p[0] == 0) { fprintf(stderr, "Error (2) parsing %s\n", "add_critical_extension"); exit(1); } cfg.crit_extensions[i + 1] = strdup(p); i += 2; free(str); if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.crit_extensions[i] = ((void *)0); } }; val = cfg_next(pov, "crl_dist_points"); if (val != ((void *)0)) { if (cfg.crl_dist_points == ((void *)0)) { i = 0; cfg.crl_dist_points = malloc(sizeof(char *) * 128); if (cfg.crl_dist_points == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "crl_dist_points") != 0) continue; cfg.crl_dist_points[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.crl_dist_points[i] = ((void *)0); } }; val = cfg_next(pov, "pkcs12_key_name"); if (val != ((void *)0)) cfg.pkcs12_key_name = strdup(val->value); val = cfg_next(pov, "serial"); if (val != ((void *)0)) { gnutls_datum_t _output; ret = serial_decode(val->value, &_output); if (ret < 0) { fprintf(stderr, "error parsing number: %s\n", val->value); exit(1); } cfg.serial = _output.data; cfg.serial_size = _output.size; }; val = cfg_next(pov, "expiration_days"); if (val != ((void *)0)) { cfg.expiration_days = strtol(val->value, ((void *)0), 10); }; val = cfg_next(pov, "crl_next_update"); if (val != ((void *)0)) { cfg.crl_next_update = strtol(val->value, ((void *)0), 10); }; val = cfg_next(pov, "crl_number"); if (val != ((void *)0)) { gnutls_datum_t _output; ret = serial_decode(val->value, &_output); if (ret < 0) { fprintf(stderr, "error parsing number: %s\n", val->value); exit(1); } cfg.crl_number = _output.data; cfg.crl_number_size = _output.size; }; val = cfg_next(pov, "path_len"); if (val != ((void *)0)) { cfg.path_len = strtol(val->value, ((void *)0), 10); }; val = cfg_next(pov, "proxy_policy_language"); if (val != ((void *)0)) cfg.proxy_policy_language = strdup(val->value); val = cfg_next(pov, "ocsp_uri"); if (val != ((void *)0)) { if (cfg.ocsp_uris == ((void *)0)) { i = 0; cfg.ocsp_uris = malloc(sizeof(char *) * 128); if (cfg.ocsp_uris == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ocsp_uri") != 0) continue; cfg.ocsp_uris[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.ocsp_uris[i] = ((void *)0); } }; val = cfg_next(pov, "ca_issuers_uri"); if (val != ((void *)0)) { if (cfg.ca_issuers_uris == ((void *)0)) { i = 0; cfg.ca_issuers_uris = malloc(sizeof(char *) * 128); if (cfg.ca_issuers_uris == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "ca_issuers_uri") != 0) continue; cfg.ca_issuers_uris[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.ca_issuers_uris[i] = ((void *)0); } }; val = cfg_next(pov, "ca"); if (val != ((void *)0)) { cfg.ca = 1; }; val = cfg_next(pov, "honor_crq_extensions"); if (val != ((void *)0)) { cfg.honor_crq_extensions = 1; }; val = cfg_next(pov, "honor_crq_ext"); if (val != ((void *)0)) { if (cfg.exts_to_honor == ((void *)0)) { i = 0; cfg.exts_to_honor = malloc(sizeof(char *) * 128); if (cfg.exts_to_honor == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "honor_crq_ext") != 0) continue; cfg.exts_to_honor[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.exts_to_honor[i] = ((void *)0); } }; val = cfg_next(pov, "tls_www_client"); if (val != ((void *)0)) { cfg.tls_www_client = 1; }; val = cfg_next(pov, "tls_www_server"); if (val != ((void *)0)) { cfg.tls_www_server = 1; }; val = cfg_next(pov, "signing_key"); if (val != ((void *)0)) { cfg.signing_key = 1; }; val = cfg_next(pov, "encryption_key"); if (val != ((void *)0)) { cfg.encryption_key = 1; }; val = cfg_next(pov, "cert_signing_key"); if (val != ((void *)0)) { cfg.cert_sign_key = 1; }; val = cfg_next(pov, "crl_signing_key"); if (val != ((void *)0)) { cfg.crl_sign_key = 1; }; val = cfg_next(pov, "code_signing_key"); if (val != ((void *)0)) { cfg.code_sign_key = 1; }; val = cfg_next(pov, "ocsp_signing_key"); if (val != ((void *)0)) { cfg.ocsp_sign_key = 1; }; val = cfg_next(pov, "time_stamping_key"); if (val != ((void *)0)) { cfg.time_stamping_key = 1; }; val = cfg_next(pov, "email_protection_key"); if (val != ((void *)0)) { cfg.email_protection_key = 1; }; val = cfg_next(pov, "ipsec_ike_key"); if (val != ((void *)0)) { cfg.ipsec_ike_key = 1; }; val = cfg_next(pov, "data_encipherment"); if (val != ((void *)0)) { cfg.data_encipherment = 1; }; val = cfg_next(pov, "key_agreement"); if (val != ((void *)0)) { cfg.key_agreement = 1; }; val = cfg_next(pov, "non_repudiation"); if (val != ((void *)0)) { cfg.non_repudiation = 1; }; val = cfg_next(pov, "tls_feature"); if (val != ((void *)0)) { if (cfg.tls_features == ((void *)0)) { i = 0; cfg.tls_features = malloc(sizeof(char *) * 128); if (cfg.tls_features == ((void *)0)) { fprintf(stderr, "memory error\n"); exit(1); }; do { if (val && strcmp(val->name, "tls_feature") != 0) continue; cfg.tls_features[i] = strdup(val->value); i++; if (i >= 128) break; } while ((val = cfg_next(val + 1, val->name)) != ((void *)0)); cfg.tls_features[i] = ((void *)0); } }; cfg_free(pov); return 0; }
long template_parse(const char *a1) { char **v1; char **v2; char **v3; char **v4; char **v5; char **v6; char **v7; char **v8; char **v9; char **v10; char **v11; char **v12; char **v13; char **v14; char **v15; char **v16; char **v17; char **v18; char **v19; char **v20; char **v21; char **v22; char **v23; char **v24; char **v25; char **v26; char **v27; char **v28; char **v29; char **v30; char **v31; char **v32; char **v33; char **v34; char **v35; unsigned int v37; unsigned int v38; unsigned int v39; unsigned int v40; unsigned int j; unsigned int v42; unsigned int v43; unsigned int v44; unsigned int v45; unsigned int v46; unsigned int v47; unsigned int v48; unsigned int v49; unsigned int v50; unsigned int v51; unsigned int v52; unsigned int v53; unsigned int v54; unsigned int v55; unsigned int v56; unsigned int v57; unsigned int v58; unsigned int v59; unsigned int v60; unsigned int v61; unsigned int v62; unsigned int v63; unsigned int v64; unsigned int v65; unsigned int v66; const char **i; const char **v68; const char **v69; const char **v70; const char **v71; long v72; long v73; long v74; long v75; long v76; long v77; long v78; long v79; long v80; long v81; long v82; long v83; long v84; long v85; long v86; long v87; long v88; long v89; long v90; long v91; const char **v92; const char **v93; const char **v94; const char **v95; const char **v96; const char **v97; const char **v98; const char **v99; const char **v100; const char **v101; const char **v102; const char **v103; const char **v104; const char **v105; const char **v106; const char **v107; const char **v108; const char **v109; const char **v110; const char **v111; const char **v112; long v113; long v114; long v115; long v116; long v117; long v118; long v119; const char **v120; const char **v121; const char **v122; const char **v123; char *v124; char *v125; char *v126; char *v127; char *v128; char *v129; char *v130; char *v131; char *v132; char *v133; char *v134; char *v135; long v136; char *v137; char *v138; char *v139; char *v140; char *v141; char *v142; long v143; int v144; long v145; int v146; char s[264]; unsigned long v148; v148 = __readfsqword(0x28u); v136 = cfg_load(a1); if (!v136) { perror("configFileLoad"); fprintf(stderr, "Error loading template: %s\n", a1); exit(1); } for (i = (const char **)v136; *i; i += 2) { if (!(unsigned int)handle_option(i)) fprintf(stderr, "Warning: skipping unknown option '%s'\n", *i); } v68 = (const char **)cfg_next(v136, "unit"); if (v68 && !*(_QWORD *)&cfg[2]) { v37 = 0; *(_QWORD *)&cfg[2] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[2]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v68, "unit")) { v1 = (char **)(*(_QWORD *)&cfg[2] + 8LL * v37); *v1 = strdup(v68[1]); if (++v37 > 0x7F) break; } v68 = (const char **)cfg_next(v68 + 2, *v68); } while (v68); *(_QWORD *)(8LL * v37 + *(_QWORD *)&cfg[2]) = 0LL; } if (!*(_QWORD *)&cfg[2]) { v69 = (const char **)cfg_next(v136, "ou"); if (v69) { if (!*(_QWORD *)&cfg[2]) { v38 = 0; *(_QWORD *)&cfg[2] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[2]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v69, "ou")) { v2 = (char **)(*(_QWORD *)&cfg[2] + 8LL * v38); *v2 = strdup(v69[1]); if (++v38 > 0x7F) break; } v69 = (const char **)cfg_next(v69 + 2, *v69); } while (v69); *(_QWORD *)(8LL * v38 + *(_QWORD *)&cfg[2]) = 0LL; } } } v70 = (const char **)cfg_next(v136, "organization"); if (v70 && !*(_QWORD *)cfg) { v39 = 0; *(_QWORD *)cfg = malloc(0x400uLL); if (!*(_QWORD *)cfg) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v70, "organization")) { v3 = (char **)(*(_QWORD *)cfg + 8LL * v39); *v3 = strdup(v70[1]); if (++v39 > 0x7F) break; } v70 = (const char **)cfg_next(v70 + 2, *v70); } while (v70); *(_QWORD *)(8LL * v39 + *(_QWORD *)cfg) = 0LL; } if (!*(_QWORD *)cfg) { v71 = (const char **)cfg_next(v136, "o"); if (v71) { if (!*(_QWORD *)cfg) { v40 = 0; *(_QWORD *)cfg = malloc(0x400uLL); if (!*(_QWORD *)cfg) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v71, "o")) { v4 = (char **)(*(_QWORD *)cfg + 8LL * v40); *v4 = strdup(v71[1]); if (++v40 > 0x7F) break; } v71 = (const char **)cfg_next(v71 + 2, *v71); } while (v71); *(_QWORD *)(8LL * v40 + *(_QWORD *)cfg) = 0LL; } } } v72 = cfg_next(v136, "locality"); if (v72) *(_QWORD *)&cfg[4] = strdup(*(const char **)(v72 + 8)); v73 = cfg_next(v136, "state"); if (v73) *(_QWORD *)&cfg[6] = strdup(*(const char **)(v73 + 8)); v74 = cfg_next(v136, "dn"); if (v74) *(_QWORD *)&cfg[8] = strdup(*(const char **)(v74 + 8)); v75 = cfg_next(v136, "cn"); if (v75) *(_QWORD *)&cfg[10] = strdup(*(const char **)(v75 + 8)); v76 = cfg_next(v136, "uid"); if (v76) *(_QWORD *)&cfg[12] = strdup(*(const char **)(v76 + 8)); v77 = cfg_next(v136, "issuer_unique_id"); if (v77) { v143 = *(_QWORD *)(v77 + 8); v144 = strlen(*(const char **)(v77 + 8)); if ((int)gnutls_hex_decode2(&v143, &v145) < 0) { fprintf(stderr, "error in hex ID: %s\n", *(const char **)(v77 + 8)); exit(1); } *(_QWORD *)&cfg[18] = v145; cfg[20] = v146; } v78 = cfg_next(v136, "subject_unique_id"); if (v78) { v143 = *(_QWORD *)(v78 + 8); v144 = strlen(*(const char **)(v78 + 8)); if ((int)gnutls_hex_decode2(&v143, &v145) < 0) { fprintf(stderr, "error in hex ID: %s\n", *(const char **)(v78 + 8)); exit(1); } *(_QWORD *)&cfg[14] = v145; cfg[16] = v146; } v79 = cfg_next(v136, "challenge_password"); if (v79) *(_QWORD *)&cfg[22] = strdup(*(const char **)(v79 + 8)); v80 = cfg_next(v136, "password"); if (v80) *(_QWORD *)&cfg[116] = strdup(*(const char **)(v80 + 8)); v81 = cfg_next(v136, "pkcs9_email"); if (v81) *(_QWORD *)&cfg[24] = strdup(*(const char **)(v81 + 8)); v82 = cfg_next(v136, "country"); if (v82) *(_QWORD *)&cfg[26] = strdup(*(const char **)(v82 + 8)); v83 = cfg_next(v136, "expiration_date"); if (v83) *(_QWORD *)&cfg[120] = strdup(*(const char **)(v83 + 8)); v84 = cfg_next(v136, "activation_date"); if (v84) *(_QWORD *)&cfg[122] = strdup(*(const char **)(v84 + 8)); v85 = cfg_next(v136, "crl_revocation_date"); if (v85) *(_QWORD *)&cfg[124] = strdup(*(const char **)(v85 + 8)); v86 = cfg_next(v136, "crl_this_update_date"); if (v86) *(_QWORD *)&cfg[126] = strdup(*(const char **)(v86 + 8)); v87 = cfg_next(v136, "crl_next_update_date"); if (v87) *(_QWORD *)&cfg[128] = strdup(*(const char **)(v87 + 8)); v88 = cfg_next(v136, "inhibit_anypolicy_skip_certs"); if (v88) cfg[134] = strtol(*(const char **)(v88 + 8), 0LL, 10); for (j = 0; j <= 7; ++j) { snprintf(s, 0x100uLL, "policy%d", j + 1); v89 = cfg_next(v136, s); if (v89) *(_QWORD *)&cfg[2 * j + 28] = strdup(*(const char **)(v89 + 8)); if (*(_QWORD *)&cfg[2 * j + 28]) { snprintf(s, 0x100uLL, "policy%d_url", j + 1); v90 = cfg_next(v136, s); if (v90) *(_QWORD *)&cfg[2 * j + 60] = strdup(*(const char **)(v90 + 8)); snprintf(s, 0x100uLL, "policy%d_txt", j + 1); v91 = cfg_next(v136, s); if (v91) *(_QWORD *)&cfg[2 * j + 44] = strdup(*(const char **)(v91 + 8)); } } v92 = (const char **)cfg_next(v136, "dc"); if (v92 && !*(_QWORD *)&cfg[76]) { v42 = 0; *(_QWORD *)&cfg[76] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[76]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v92, "dc")) { v5 = (char **)(*(_QWORD *)&cfg[76] + 8LL * v42); *v5 = strdup(v92[1]); if (++v42 > 0x7F) break; } v92 = (const char **)cfg_next(v92 + 2, *v92); } while (v92); *(_QWORD *)(8LL * v42 + *(_QWORD *)&cfg[76]) = 0LL; } v93 = (const char **)cfg_next(v136, "dns_name"); if (v93 && !*(_QWORD *)&cfg[78]) { v43 = 0; *(_QWORD *)&cfg[78] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[78]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v93, "dns_name")) { v6 = (char **)(*(_QWORD *)&cfg[78] + 8LL * v43); *v6 = strdup(v93[1]); if (++v43 > 0x7F) break; } v93 = (const char **)cfg_next(v93 + 2, *v93); } while (v93); *(_QWORD *)(8LL * v43 + *(_QWORD *)&cfg[78]) = 0LL; } v94 = (const char **)cfg_next(v136, "uri"); if (v94 && !*(_QWORD *)&cfg[80]) { v44 = 0; *(_QWORD *)&cfg[80] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[80]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v94, "uri")) { v7 = (char **)(*(_QWORD *)&cfg[80] + 8LL * v44); *v7 = strdup(v94[1]); if (++v44 > 0x7F) break; } v94 = (const char **)cfg_next(v94 + 2, *v94); } while (v94); *(_QWORD *)(8LL * v44 + *(_QWORD *)&cfg[80]) = 0LL; } v95 = (const char **)cfg_next(v136, "krb5_principal"); if (v95 && !*(_QWORD *)&cfg[86]) { v45 = 0; *(_QWORD *)&cfg[86] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[86]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v95, "krb5_principal")) { v8 = (char **)(*(_QWORD *)&cfg[86] + 8LL * v45); *v8 = strdup(v95[1]); if (++v45 > 0x7F) break; } v95 = (const char **)cfg_next(v95 + 2, *v95); } while (v95); *(_QWORD *)(8LL * v45 + *(_QWORD *)&cfg[86]) = 0LL; } v96 = (const char **)cfg_next(v136, "other_name"); if (v96 && !*(_QWORD *)&cfg[88]) { v46 = 0; *(_QWORD *)&cfg[88] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[88]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v96, "other_name")) { v137 = strdup(v96[1]); if (!v137) { fprintf(stderr, "memory error\n"); exit(1); } v124 = strchr(v137, 32); if (!v124) { v124 = strchr(v137, 9); if (!v124) { fprintf(stderr, "Error parsing %s\n", "other_name"); exit(1); } } *v124 = 0; v125 = v124 + 1; v9 = (char **)(*(_QWORD *)&cfg[88] + 8LL * v46); *v9 = strdup(v137); while (*v125 == 32 || *v125 == 9) ++v125; if (!*v125) { fprintf(stderr, "Error (2) parsing %s\n", "other_name"); exit(1); } v10 = (char **)(*(_QWORD *)&cfg[88] + 8LL * (v46 + 1)); *v10 = strdup(v125); v46 += 2; free(v137); if (v46 > 0x7F) break; } v96 = (const char **)cfg_next(v96 + 2, *v96); } while (v96); *(_QWORD *)(8LL * v46 + *(_QWORD *)&cfg[88]) = 0LL; } v97 = (const char **)cfg_next(v136, "other_name_octet"); if (v97 && !*(_QWORD *)&cfg[92]) { v47 = 0; *(_QWORD *)&cfg[92] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[92]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v97, "other_name_octet")) { v138 = strdup(v97[1]); if (!v138) { fprintf(stderr, "memory error\n"); exit(1); } v126 = strchr(v138, 32); if (!v126) { v126 = strchr(v138, 9); if (!v126) { fprintf(stderr, "Error parsing %s\n", "other_name_octet"); exit(1); } } *v126 = 0; v127 = v126 + 1; v11 = (char **)(*(_QWORD *)&cfg[92] + 8LL * v47); *v11 = strdup(v138); while (*v127 == 32 || *v127 == 9) ++v127; if (!*v127) { fprintf(stderr, "Error (2) parsing %s\n", "other_name_octet"); exit(1); } v12 = (char **)(*(_QWORD *)&cfg[92] + 8LL * (v47 + 1)); *v12 = strdup(v127); v47 += 2; free(v138); if (v47 > 0x7F) break; } v97 = (const char **)cfg_next(v97 + 2, *v97); } while (v97); *(_QWORD *)(8LL * v47 + *(_QWORD *)&cfg[92]) = 0LL; } v98 = (const char **)cfg_next(v136, "other_name_utf8"); if (v98 && !*(_QWORD *)&cfg[90]) { v48 = 0; *(_QWORD *)&cfg[90] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[90]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v98, "other_name_utf8")) { v139 = strdup(v98[1]); if (!v139) { fprintf(stderr, "memory error\n"); exit(1); } v128 = strchr(v139, 32); if (!v128) { v128 = strchr(v139, 9); if (!v128) { fprintf(stderr, "Error parsing %s\n", "other_name_utf8"); exit(1); } } *v128 = 0; v129 = v128 + 1; v13 = (char **)(*(_QWORD *)&cfg[90] + 8LL * v48); *v13 = strdup(v139); while (*v129 == 32 || *v129 == 9) ++v129; if (!*v129) { fprintf(stderr, "Error (2) parsing %s\n", "other_name_utf8"); exit(1); } v14 = (char **)(*(_QWORD *)&cfg[90] + 8LL * (v48 + 1)); *v14 = strdup(v129); v48 += 2; free(v139); if (v48 > 0x7F) break; } v98 = (const char **)cfg_next(v98 + 2, *v98); } while (v98); *(_QWORD *)(8LL * v48 + *(_QWORD *)&cfg[90]) = 0LL; } v99 = (const char **)cfg_next(v136, "xmpp_name"); if (v99 && !*(_QWORD *)&cfg[94]) { v49 = 0; *(_QWORD *)&cfg[94] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[94]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v99, "xmpp_name")) { v15 = (char **)(*(_QWORD *)&cfg[94] + 8LL * v49); *v15 = strdup(v99[1]); if (++v49 > 0x7F) break; } v99 = (const char **)cfg_next(v99 + 2, *v99); } while (v99); *(_QWORD *)(8LL * v49 + *(_QWORD *)&cfg[94]) = 0LL; } v100 = (const char **)cfg_next(v136, "ip_address"); if (v100 && !*(_QWORD *)&cfg[82]) { v50 = 0; *(_QWORD *)&cfg[82] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[82]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v100, "ip_address")) { v16 = (char **)(*(_QWORD *)&cfg[82] + 8LL * v50); *v16 = strdup(v100[1]); if (++v50 > 0x7F) break; } v100 = (const char **)cfg_next(v100 + 2, *v100); } while (v100); *(_QWORD *)(8LL * v50 + *(_QWORD *)&cfg[82]) = 0LL; } v101 = (const char **)cfg_next(v136, "email"); if (v101 && !*(_QWORD *)&cfg[84]) { v51 = 0; *(_QWORD *)&cfg[84] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[84]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v101, "email")) { v17 = (char **)(*(_QWORD *)&cfg[84] + 8LL * v51); *v17 = strdup(v101[1]); if (++v51 > 0x7F) break; } v101 = (const char **)cfg_next(v101 + 2, *v101); } while (v101); *(_QWORD *)(8LL * v51 + *(_QWORD *)&cfg[84]) = 0LL; } v102 = (const char **)cfg_next(v136, "key_purpose_oid"); if (v102 && !*(_QWORD *)&cfg[152]) { v52 = 0; *(_QWORD *)&cfg[152] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[152]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v102, "key_purpose_oid")) { v18 = (char **)(*(_QWORD *)&cfg[152] + 8LL * v52); *v18 = strdup(v102[1]); if (++v52 > 0x7F) break; } v102 = (const char **)cfg_next(v102 + 2, *v102); } while (v102); *(_QWORD *)(8LL * v52 + *(_QWORD *)&cfg[152]) = 0LL; } v103 = (const char **)cfg_next(v136, "nc_exclude_ip"); if (v103 && !*(_QWORD *)&cfg[104]) { v53 = 0; *(_QWORD *)&cfg[104] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[104]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v103, "nc_exclude_ip")) { v19 = (char **)(*(_QWORD *)&cfg[104] + 8LL * v53); *v19 = strdup(v103[1]); if (++v53 > 0x7F) break; } v103 = (const char **)cfg_next(v103 + 2, *v103); } while (v103); *(_QWORD *)(8LL * v53 + *(_QWORD *)&cfg[104]) = 0LL; } v104 = (const char **)cfg_next(v136, "nc_exclude_dns"); if (v104 && !*(_QWORD *)&cfg[108]) { v54 = 0; *(_QWORD *)&cfg[108] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[108]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v104, "nc_exclude_dns")) { v20 = (char **)(*(_QWORD *)&cfg[108] + 8LL * v54); *v20 = strdup(v104[1]); if (++v54 > 0x7F) break; } v104 = (const char **)cfg_next(v104 + 2, *v104); } while (v104); *(_QWORD *)(8LL * v54 + *(_QWORD *)&cfg[108]) = 0LL; } v105 = (const char **)cfg_next(v136, "nc_exclude_email"); if (v105 && !*(_QWORD *)&cfg[112]) { v55 = 0; *(_QWORD *)&cfg[112] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[112]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v105, "nc_exclude_email")) { v21 = (char **)(*(_QWORD *)&cfg[112] + 8LL * v55); *v21 = strdup(v105[1]); if (++v55 > 0x7F) break; } v105 = (const char **)cfg_next(v105 + 2, *v105); } while (v105); *(_QWORD *)(8LL * v55 + *(_QWORD *)&cfg[112]) = 0LL; } v106 = (const char **)cfg_next(v136, "nc_permit_ip"); if (v106 && !*(_QWORD *)&cfg[102]) { v56 = 0; *(_QWORD *)&cfg[102] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[102]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v106, "nc_permit_ip")) { v22 = (char **)(*(_QWORD *)&cfg[102] + 8LL * v56); *v22 = strdup(v106[1]); if (++v56 > 0x7F) break; } v106 = (const char **)cfg_next(v106 + 2, *v106); } while (v106); *(_QWORD *)(8LL * v56 + *(_QWORD *)&cfg[102]) = 0LL; } v107 = (const char **)cfg_next(v136, "nc_permit_dns"); if (v107 && !*(_QWORD *)&cfg[106]) { v57 = 0; *(_QWORD *)&cfg[106] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[106]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v107, "nc_permit_dns")) { v23 = (char **)(*(_QWORD *)&cfg[106] + 8LL * v57); *v23 = strdup(v107[1]); if (++v57 > 0x7F) break; } v107 = (const char **)cfg_next(v107 + 2, *v107); } while (v107); *(_QWORD *)(8LL * v57 + *(_QWORD *)&cfg[106]) = 0LL; } v108 = (const char **)cfg_next(v136, "nc_permit_email"); if (v108 && !*(_QWORD *)&cfg[110]) { v58 = 0; *(_QWORD *)&cfg[110] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[110]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v108, "nc_permit_email")) { v24 = (char **)(*(_QWORD *)&cfg[110] + 8LL * v58); *v24 = strdup(v108[1]); if (++v58 > 0x7F) break; } v108 = (const char **)cfg_next(v108 + 2, *v108); } while (v108); *(_QWORD *)(8LL * v58 + *(_QWORD *)&cfg[110]) = 0LL; } v109 = (const char **)cfg_next(v136, "dn_oid"); if (v109 && !*(_QWORD *)&cfg[96]) { v59 = 0; *(_QWORD *)&cfg[96] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[96]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v109, "dn_oid")) { v140 = strdup(v109[1]); if (!v140) { fprintf(stderr, "memory error\n"); exit(1); } v130 = strchr(v140, 32); if (!v130) { v130 = strchr(v140, 9); if (!v130) { fprintf(stderr, "Error parsing %s\n", "dn_oid"); exit(1); } } *v130 = 0; v131 = v130 + 1; v25 = (char **)(*(_QWORD *)&cfg[96] + 8LL * v59); *v25 = strdup(v140); while (*v131 == 32 || *v131 == 9) ++v131; if (!*v131) { fprintf(stderr, "Error (2) parsing %s\n", "dn_oid"); exit(1); } v26 = (char **)(*(_QWORD *)&cfg[96] + 8LL * (v59 + 1)); *v26 = strdup(v131); v59 += 2; free(v140); if (v59 > 0x7F) break; } v109 = (const char **)cfg_next(v109 + 2, *v109); } while (v109); *(_QWORD *)(8LL * v59 + *(_QWORD *)&cfg[96]) = 0LL; } v110 = (const char **)cfg_next(v136, "add_extension"); if (v110 && !*(_QWORD *)&cfg[98]) { v60 = 0; *(_QWORD *)&cfg[98] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[98]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v110, "add_extension")) { v141 = strdup(v110[1]); if (!v141) { fprintf(stderr, "memory error\n"); exit(1); } v132 = strchr(v141, 32); if (!v132) { v132 = strchr(v141, 9); if (!v132) { fprintf(stderr, "Error parsing %s\n", "add_extension"); exit(1); } } *v132 = 0; v133 = v132 + 1; v27 = (char **)(*(_QWORD *)&cfg[98] + 8LL * v60); *v27 = strdup(v141); while (*v133 == 32 || *v133 == 9) ++v133; if (!*v133) { fprintf(stderr, "Error (2) parsing %s\n", "add_extension"); exit(1); } v28 = (char **)(*(_QWORD *)&cfg[98] + 8LL * (v60 + 1)); *v28 = strdup(v133); v60 += 2; free(v141); if (v60 > 0x7F) break; } v110 = (const char **)cfg_next(v110 + 2, *v110); } while (v110); *(_QWORD *)(8LL * v60 + *(_QWORD *)&cfg[98]) = 0LL; } v111 = (const char **)cfg_next(v136, "add_critical_extension"); if (v111 && !*(_QWORD *)&cfg[100]) { v61 = 0; *(_QWORD *)&cfg[100] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[100]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v111, "add_critical_extension")) { v142 = strdup(v111[1]); if (!v142) { fprintf(stderr, "memory error\n"); exit(1); } v134 = strchr(v142, 32); if (!v134) { v134 = strchr(v142, 9); if (!v134) { fprintf(stderr, "Error parsing %s\n", "add_critical_extension"); exit(1); } } *v134 = 0; v135 = v134 + 1; v29 = (char **)(*(_QWORD *)&cfg[100] + 8LL * v61); *v29 = strdup(v142); while (*v135 == 32 || *v135 == 9) ++v135; if (!*v135) { fprintf(stderr, "Error (2) parsing %s\n", "add_critical_extension"); exit(1); } v30 = (char **)(*(_QWORD *)&cfg[100] + 8LL * (v61 + 1)); *v30 = strdup(v135); v61 += 2; free(v142); if (v61 > 0x7F) break; } v111 = (const char **)cfg_next(v111 + 2, *v111); } while (v111); *(_QWORD *)(8LL * v61 + *(_QWORD *)&cfg[100]) = 0LL; } v112 = (const char **)cfg_next(v136, "crl_dist_points"); if (v112 && !*(_QWORD *)&cfg[114]) { v62 = 0; *(_QWORD *)&cfg[114] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[114]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v112, "crl_dist_points")) { v31 = (char **)(*(_QWORD *)&cfg[114] + 8LL * v62); *v31 = strdup(v112[1]); if (++v62 > 0x7F) break; } v112 = (const char **)cfg_next(v112 + 2, *v112); } while (v112); *(_QWORD *)(8LL * v62 + *(_QWORD *)&cfg[114]) = 0LL; } v113 = cfg_next(v136, "pkcs12_key_name"); if (v113) *(_QWORD *)&cfg[118] = strdup(*(const char **)(v113 + 8)); v114 = cfg_next(v136, "serial"); if (v114) { if ((int)serial_decode(*(_QWORD *)(v114 + 8), (long)&v145) < 0) { fprintf(stderr, "error parsing number: %s\n", *(const char **)(v114 + 8)); exit(1); } *(_QWORD *)&cfg[130] = v145; cfg[132] = v146; } v115 = cfg_next(v136, "expiration_days"); if (v115) cfg[133] = strtol(*(const char **)(v115 + 8), 0LL, 10); v116 = cfg_next(v136, "crl_next_update"); if (v116) cfg[154] = strtol(*(const char **)(v116 + 8), 0LL, 10); v117 = cfg_next(v136, "crl_number"); if (v117) { if ((int)serial_decode(*(_QWORD *)(v117 + 8), (long)&v145) < 0) { fprintf(stderr, "error parsing number: %s\n", *(const char **)(v117 + 8)); exit(1); } *(_QWORD *)&cfg[156] = v145; cfg[158] = v146; } v118 = cfg_next(v136, "path_len"); if (v118) cfg[136] = strtol(*(const char **)(v118 + 8), 0LL, 10); v119 = cfg_next(v136, "proxy_policy_language"); if (v119) *(_QWORD *)&cfg[160] = strdup(*(const char **)(v119 + 8)); v120 = (const char **)cfg_next(v136, "ocsp_uri"); if (v120 && !*(_QWORD *)&cfg[164]) { v63 = 0; *(_QWORD *)&cfg[164] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[164]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v120, "ocsp_uri")) { v32 = (char **)(*(_QWORD *)&cfg[164] + 8LL * v63); *v32 = strdup(v120[1]); if (++v63 > 0x7F) break; } v120 = (const char **)cfg_next(v120 + 2, *v120); } while (v120); *(_QWORD *)(8LL * v63 + *(_QWORD *)&cfg[164]) = 0LL; } v121 = (const char **)cfg_next(v136, "ca_issuers_uri"); if (v121 && !*(_QWORD *)&cfg[166]) { v64 = 0; *(_QWORD *)&cfg[166] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[166]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v121, "ca_issuers_uri")) { v33 = (char **)(*(_QWORD *)&cfg[166] + 8LL * v64); *v33 = strdup(v121[1]); if (++v64 > 0x7F) break; } v121 = (const char **)cfg_next(v121 + 2, *v121); } while (v121); *(_QWORD *)(8LL * v64 + *(_QWORD *)&cfg[166]) = 0LL; } if (cfg_next(v136, "ca")) cfg[135] = 1; if (cfg_next(v136, "honor_crq_extensions")) cfg[159] = 1; v122 = (const char **)cfg_next(v136, "honor_crq_ext"); if (v122 && !*(_QWORD *)&cfg[162]) { v65 = 0; *(_QWORD *)&cfg[162] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[162]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v122, "honor_crq_ext")) { v34 = (char **)(*(_QWORD *)&cfg[162] + 8LL * v65); *v34 = strdup(v122[1]); if (++v65 > 0x7F) break; } v122 = (const char **)cfg_next(v122 + 2, *v122); } while (v122); *(_QWORD *)(8LL * v65 + *(_QWORD *)&cfg[162]) = 0LL; } if (cfg_next(v136, "tls_www_client")) cfg[137] = 1; if (cfg_next(v136, "tls_www_server")) cfg[138] = 1; if (cfg_next(v136, "signing_key")) cfg[139] = 1; if (cfg_next(v136, "encryption_key")) cfg[140] = 1; if (cfg_next(v136, "cert_signing_key")) cfg[141] = 1; if (cfg_next(v136, "crl_signing_key")) cfg[142] = 1; if (cfg_next(v136, "code_signing_key")) cfg[146] = 1; if (cfg_next(v136, "ocsp_signing_key")) cfg[147] = 1; if (cfg_next(v136, "time_stamping_key")) cfg[148] = 1; if (cfg_next(v136, "email_protection_key")) cfg[149] = 1; if (cfg_next(v136, "ipsec_ike_key")) cfg[150] = 1; if (cfg_next(v136, "data_encipherment")) cfg[144] = 1; if (cfg_next(v136, "key_agreement")) cfg[145] = 1; if (cfg_next(v136, "non_repudiation")) cfg[143] = 1; v123 = (const char **)cfg_next(v136, "tls_feature"); if (v123 && !*(_QWORD *)&cfg[168]) { v66 = 0; *(_QWORD *)&cfg[168] = malloc(0x400uLL); if (!*(_QWORD *)&cfg[168]) { fprintf(stderr, "memory error\n"); exit(1); } do { if (!strcmp(*v123, "tls_feature")) { v35 = (char **)(*(_QWORD *)&cfg[168] + 8LL * v66); *v35 = strdup(v123[1]); if (++v66 > 0x7F) break; } v123 = (const char **)cfg_next(v123 + 2, *v123); } while (v123); *(_QWORD *)(8LL * v66 + *(_QWORD *)&cfg[168]) = 0LL; } cfg_free(v136); return 0LL; }
gnutls
ida
static void print_boottime(const STRUCT_UTMP *utmp_ent) { print_line(-1, "", ' ', -1, gettext("system boot"), time_string(utmp_ent), "", "", "", ""); }
unsigned long print_boottime(long a1) { char *v1; char *v2; v1 = time_string(a1); v2 = gettext("system boot"); return print_line(-1, locale, 32, -1, v2, v1, locale, locale, locale, locale); }
coreutils
ida
char **bash_directory_completion_matches(text) const char *text; { char **m1; char *dfn; int qc; qc = rl_dispatching ? rl_completion_quote_character : 0; if (rl_dispatching && rl_completion_found_quote == 0) dfn = bash_dequote_filename((char *)text, qc); else dfn = (char *)text; m1 = rl_completion_matches(dfn, rl_filename_completion_function); if (dfn != text) sh_xfree((dfn), "bashline.c", 4761); if (m1 == 0 || m1[0] == 0) return m1; (void)bash_progcomp_ignore_filenames(m1); return m1; }
long long bash_directory_completion_matches(char *a0) { unsigned int v0; unsigned long long v1; unsigned long long *v2; unsigned long long *v5; v0 = (!rl_dispatching ? rl_completion_quote_character : 0); if (!rl_dispatching || rl_completion_found_quote) v1 = a0; else v1 = bash_dequote_filename(a0, v0); v2 = rl_completion_matches(v1, got.rl_filename_completion_function); if (v1 != a0) sh_xfree(v1, "bashline.c", 0x1299); if (v2 && *(v2)) { bash_progcomp_ignore_filenames(v2); v5 = v2; return v5; } v5 = v2; return v5; }
bash
angr_sailr
static void alloc_ibuf(void) { if (ibuf) return; _Bool extra_byte_for_swab = !!(conversions_mask & C_SWAB); ibuf = alignalloc(page_size, input_blocksize + extra_byte_for_swab); if (!ibuf) { char hbuf[((2 * sizeof(uintmax_t) * 8 * 146 / 485 + 1) * (16 + 1) - 16 + 1 + 3) + 1]; ((!!sizeof(struct { _Static_assert(1, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"memory exhausted by input " "buffer of size %td bytes (%s)\"), input_blocksize, " "human_readable (input_blocksize, hbuf, human_opts | " "human_base_1024, 1, 1)), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error( 1, 0, gettext( "memory exhausted by input buffer of size %td bytes (%s)"), input_blocksize, human_readable(input_blocksize, hbuf, human_opts | human_base_1024, 1, 1)), ((0) ? (void)0 : __builtin_unreachable()))) : ((nl_error( 1, 0, gettext( "memory exhausted by input buffer of size %td bytes (%s)"), input_blocksize, human_readable(input_blocksize, hbuf, human_opts | human_base_1024, 1, 1)), ((0) ? (void)0 : __builtin_unreachable())))) ; } }
void alloc_ibuf(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned int a5) { char v0; char v1; char v2; unsigned long long *v4; unsigned long long v5; if (!ibuf) { v0 = (conversions_mask & 128); ibuf = alignalloc(page_size, v0 + input_blocksize, v0 + input_blocksize); if (!ibuf) nl_error( 0x1, 0x0, gettext("memory exhausted by input buffer of size %td bytes (%s)"), input_blocksize, human_readable(input_blocksize, &v1, 0x1f1, 0x1, 0x1), a5); } v5 = *(&v2) ^ v4[5]; return; }
coreutils
angr_sailr