input
stringlengths
28
169k
output
stringlengths
20
317k
static int ipaddr_link_get(int index, struct nlmsg_chain *linfo) { struct iplink_req req = { .n.nlmsg_len = ((sizeof(struct ifinfomsg)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), .n.nlmsg_flags = 0x01, .n.nlmsg_type = RTM_GETLINK, .i.ifi_family = filter.family, .i.ifi_index = index, }; __u32 filt_mask = (1 << 0); struct nlmsghdr *answer; if (!show_stats) filt_mask |= (1 << 3); addattr32(&req.n, sizeof(req), IFLA_EXT_MASK, filt_mask); if (rtnl_talk(&rth, &req.n, &answer) < 0) { perror("Cannot send link request"); return 1; } if (store_nlmsg(answer, linfo) < 0) { fprintf( stderr , "Failed to process link information\n"); free(answer); return 1; } free(answer); return 0; }
int ipaddr_link_get(unsigned long a0, void* a1) { unsigned int v0; unsigned int v1; char v2; unsigned int v3; unsigned short v4; unsigned short v5; char v6; unsigned int v7; unsigned long long v9; unsigned long long *v10; unsigned long v11; unsigned int v12; v0 = a0; v9 = 132; for (v10 = &v3; v9; v10 = &v10[v11]) { v9 -= 1; v3 = 0; } v3 = 32; v4 = 18; v5 = 1; v6 = g_408504; v7 = v0; v1 = 1; if (!show_stats) v1 |= 8; addattr32(&v3, 0x420, 0x1d, v1); v12 = rtnl_talk(0x5001d0, &v3, &v2); if (v12 < 0) { perror("Cannot send link request"); v12 = 1; } else { v12 = store_nlmsg(*(&v2), a1); if (v12 < 0) { fprintf(stderr, "Failed to process link information\n"); free(*(&v2)); v12 = 1; } else { free(*(&v2)); v12 = 0; } } return v12; }
int addr_netmatch(const struct xaddr *host, const struct xaddr *net, u_int masklen) { struct xaddr tmp_mask, tmp_result; if (host->af != net->af) return -1; if (addr_netmask(host->af, masklen, &tmp_mask) == -1) return -1; if (addr_and(&tmp_result, host, &tmp_mask) == -1) return -1; return addr_cmp(&tmp_result, net); }
long long addr_netmatch(unsigned short *a0, unsigned short *a1, unsigned long a2) { char v0; char v1; unsigned long long v3; if (*(a0) != *(a1)) { v3 = 4294967295; } else if (addr_netmask(*(a0), a2, &v0, a2) == -1) { v3 = 4294967295; } else if (addr_and(&v1, a0, &v0) == -1) { v3 = 4294967295; } else { v3 = addr_cmp(&v1, a1); } return v3; }
acl_t acl_get_fd(int fd) { const size_t size_guess = acl_ea_size(16); char *ext_acl_p = __builtin_alloca ( size_guess ) ; int retval; if (!ext_acl_p) return ((void *)0) ; retval = fgetxattr(fd, "system.posix_acl_access", ext_acl_p, size_guess); if (retval == -1 && (*__errno_location ()) == 34 ) { retval = fgetxattr(fd, "system.posix_acl_access", ((void *)0) , 0); if (retval > 0) { ext_acl_p = __builtin_alloca ( retval ) ; if (!ext_acl_p) return ((void *)0) ; retval = fgetxattr(fd, "system.posix_acl_access", ext_acl_p,retval); } } if (retval > 0) { acl_t acl = __acl_from_xattr(ext_acl_p, retval); return acl; } else if (retval == 0 || (*__errno_location ()) == 61 || (*__errno_location ()) == 61 ) { struct stat st; if (fstat(fd, &st) == 0) return acl_from_mode(st.st_mode); else return ((void *)0) ; } else return ((void *)0) ; }
long long acl_get_fd(unsigned long a0) { char v0; unsigned int v1; unsigned long long v2; unsigned long long v3; unsigned long long v4; char v5; char v6; unsigned long long v7; char v8; unsigned long v9; void* v10; unsigned int v11; unsigned int v12; unsigned int v13; for (v3 = acl_ea_size(0x10); &v8 != &(&v0)[-1 * ((0 CONCAT 15 + v3 + 8) /m 16 * 16 & -0x1000)]; v7 = v7); if ((((0 CONCAT 15 + v3 + 8) /m 16 * 16) & 4095)) *((&v7 + (((0 CONCAT 15 + v3 + 8) /m 16 * 16) & 4095))) = *((&v7 + (((0 CONCAT 15 + v3 + 8) /m 16 * 16) & 4095))); v2 = (&v9 >> 4) * 16; if (!v2) { v10 = 0; } else { v1 = fgetxattr(a0, "system.posix_acl_access", v2, v3); if (v1 == -1) { v11 = *(__errno_location()); if (v11 == 34) { if (v1 > 0) { for (v1 = fgetxattr(a0, "system.posix_acl_access", 0x0, 0x0); &v8 != &(&v8)[-1 * ((0 CONCAT 15 + v1 + 8) /m 16 * 16 & -0x1000)]; v7 = v7); if ((((0 CONCAT 15 + v1 + 8) /m 16 * 16) & 4095)) *((&v7 + (((0 CONCAT 15 + v1 + 8) /m 16 * 16) & 4095))) = *((&v7 + (((0 CONCAT 15 + v1 + 8) /m 16 * 16) & 4095))); v2 = (&v9 >> 4) * 16; if (!v2) v10 = 0; else v1 = fgetxattr(a0, "system.posix_acl_access", v2, v1); } } } if (v1 <= 0 || v11 != 34 || v2 || v1 != -1) { if (v1 > 0) { v4 = __acl_from_xattr(v2, v1, v1); v10 = v4; } else { if (v1) { v12 = *(__errno_location()); if (v12 != 61) { v13 = *(__errno_location()); if (v13 != 61) v10 = 0; } } if (v12 == 61 || v13 == 61 || !v1) { if (!fstat(a0, &v5)) v10 = acl_from_mode(*(&v6)); else v10 = 0; } } } } return v10; }
static int builtin_status (result) int result; { int r; switch (result) { case 258: case 257: r = 2; break; case 259: case 260: case 261: r = 1; break; default: r = (result > 256) ? 1 : 0; break; } return (r); }
long long builtin_status(unsigned long a0) { unsigned int v0; if (a0 > 258) { if (a0 - 259 <= 2) { v0 = 1; return v0; } } else { if (a0 >= 257) { v0 = 2; return v0; } } v0 = 0x100 < a0; return v0; }
static inline _Bool key_numeric (struct keyfield const *key) { return key->numeric || key->general_numeric || key->human_numeric; }
int key_numeric(char a0[54]) { unsigned int v1; unsigned int v2; if (a0[50] || a0[52] || a0[53]) v1 = 1; else v1 = 0; v2 = v1 & 1; return v2; }
static void closefrom_fallback(int lowfd) { long fd, maxfd; maxfd = sysconf( _SC_OPEN_MAX ); if (maxfd < 0) maxfd = 256; for (fd = lowfd; fd < maxfd; fd++) (void) close((int) fd); }
void closefrom_fallback(int param_1) { long local_18; long local_10; local_10 = sysconf(4); if (local_10 < 0) { local_10 = 0x100; } for (local_18 = (long)param_1; local_18 < local_10; local_18 = __addvdi3(local_18,1)) { close((int)local_18); } return; }
static void _rl_handle_signal (int sig) { int block_sig; sigset_t set, oset; (rl_readline_state |= (0x0008000)); if (_rl_sigcleanup) { (*_rl_sigcleanup) (sig, _rl_sigcleanarg); _rl_sigcleanup = 0; _rl_sigcleanarg = 0; } block_sig = 0; sigemptyset (&set); sigprocmask ( 0 , (sigset_t *) ((void *)0) , &set); switch (sig) { case 2 : _rl_reset_completion_state (); rl_free_line_state (); rl_callback_sigcleanup (); case 20 : case 21 : case 22 : if (block_sig == 0) { sigaddset (&set, 22 ); block_sig = 1; } case 1 : case 15 : case 14 : if (sig == 14 ) _rl_timeout_handle_sigalrm (); case 3 : if (block_sig) sigprocmask ( 0 , &set, &oset); rl_echo_signal_char (sig); rl_cleanup_after_signal (); if (block_sig) sigprocmask ( 1 , &oset, (sigset_t *) ((void *)0) ); kill (getpid (), sig); rl_reset_after_signal (); } (rl_readline_state &= ~(0x0008000)); return; }
void _rl_handle_signal(unsigned long a0, unsigned int a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { int tmp_42; unsigned int v0; int tmp_12; char v1; char v2; char v3; unsigned long long v5; unsigned int v6; unsigned long long v7; unsigned long long v8; unsigned long long *v9; unsigned long long v10; v5 = rl_readline_state; *(&v5) = (rl_readline_state >> 8) | 128; tmp_42 = v5; rl_readline_state = tmp_42; 14410530935326671688(a0, 14410530935326671688, 14410530935326671688, 14410530935326671688); _rl_sigcleanarg = 0; _rl_sigcleanarg = 0; v0 = 0; sigemptyset(&v1); v6 = 0; sigprocmask(0x0, NULL, &v1); switch (0) { case 2: _rl_reset_completion_state(); rl_free_line_state(reg_72, 0x0, &v1, 0xc7fc7d8910ec8348, a4, a5); rl_callback_sigcleanup(reg_72, 0x0, &v1, 0xc7fc7d8910ec8348, a4, a5); case 3: if (v0) sigprocmask(0x0, &v1, &v2); rl_echo_signal_char(0x0); rl_cleanup_after_signal(reg_72, a1, a2, 0xc7fc7d8910ec8348); if (v0) sigprocmask(0x1, &v2, NULL); v7 = getpid(); a1 = 0; kill(v7, 0x0); rl_reset_after_signal(v7, a1, a2, 0xc7fc7d8910ec8348); case 20: case 21: case 22: if (!v0) { a1 = 22; sigaddset(&v1, 0x16); v0 = 1; } case 1: case 14: case 15: _rl_timeout_handle_sigalrm(); } v8 = rl_readline_state; *(&v8) = (rl_readline_state >> 8) & 127; tmp_12 = v8; rl_readline_state = tmp_12; v10 = *(&v3) ^ v9[5]; return; }
char * assoc_subrange (hash, start, nelem, starsub, quoted, pflags) HASH_TABLE *hash; arrayind_t start, nelem; int starsub, quoted, pflags; { WORD_LIST *l, *save, *h, *t; int i, j; char *ret; if (((hash)->nentries == 0)) return ((char *) ((void *)0) ); save = l = assoc_to_word_list (hash); if (save == 0) return ((char *) ((void *)0) ); for (i = 1; l && i < start; i++) l = l->next; if (l == 0) { dispose_words (save); return ((char *) ((void *)0) ); } for (j = 0,h = t = l; l && j < nelem; j++) { t = l; l = l->next; } t->next = (WORD_LIST *) ((void *)0) ; ret = string_list_pos_params (starsub ? '*' : '@', h, quoted, pflags); if (t != l) t->next = l; dispose_words (save); return (ret); }
long long assoc_subrange(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) { struct_0 *v0; unsigned int v1; unsigned int v2; unsigned long long *v3; unsigned long long *v4; unsigned long long *v5; unsigned long long *v6; unsigned long long v7; void* v9; unsigned long long v10; v0 = a0; if (!v0->field_c) { v9 = 0; } else { v3 = assoc_to_word_list(v0); v5 = v3; if (!v5) { v9 = 0; } else { v1 = 1; while (true) { if (!v3) break; if (a1 <= v1) break; v3 = *(v3); v1 += 1; } if (!v3) { dispose_words(v5); v9 = 0; } else { v2 = 0; v4 = v3; v6 = v4; while (true) { if (!v3) break; if (a2 <= v2) break; v4 = v3; v3 = *(v3); v2 += 1; } *(v4) = 0; if (a3) v10 = 42; else v10 = 64; v7 = string_list_pos_params(v10, v6, a4, a5); if (v4 != v3) *(v4) = v3; dispose_words(v5); v9 = v7; } } } return v9; }
static int worst_cost (const struct predicate *p) { if (p) { unsigned int cost_r, cost_l, worst; cost_l = worst_cost (p->pred_left); cost_r = worst_cost (p->pred_right); worst = (cost_l > cost_r) ? cost_l : cost_r; if (worst < p->p_cost) worst = p->p_cost; return worst; } else { return 0; } }
int worst_cost(struct_0 *a0) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v4; unsigned int v5; if (!a0) { v4 = 0; return v4; } v1 = worst_cost(a0->field_110); v2 = worst_cost(a0->field_118); v5 = v1; if (v1 <= v2) v5 = v2; v0 = v5; if (v0 < a0->field_20) v0 = a0->field_20; v4 = v0; return v4; }
static void set_winsize (tty) int tty; { struct winsize w; if (ioctl (tty, 0x5413 , &w) == 0) (void) ioctl (tty, 0x5414 , &w); }
void set_winsize(unsigned long a0) { char v0; char v1; unsigned long long *v4; unsigned long long v5; if (!ioctl(a0, 0x5413)) ioctl(*(&v0), 0x5414); v5 = *(&v1) ^ v4[5]; return; }
int rl_transpose_chars (int count, int key) { char *dummy; int i; int char_length, prev_point; if (count == 0) return 0; if (!rl_point || rl_end < 2) { rl_ding (); return 1; } rl_begin_undo_group (); if (rl_point == rl_end) { rl_point = (( (__ctype_get_mb_cur_max ()) > 1 && rl_byte_oriented == 0) ? _rl_find_prev_mbchar ((rl_line_buffer), (rl_point), (0x01)) : ((rl_point) - 1)); count = 1; } prev_point = rl_point; rl_point = (( (__ctype_get_mb_cur_max ()) > 1 && rl_byte_oriented == 0) ? _rl_find_prev_mbchar ((rl_line_buffer), (rl_point), (0x01)) : ((rl_point) - 1)); char_length = prev_point - rl_point; dummy = (char *)xmalloc (char_length + 1); for (i = 0; i < char_length; i++) dummy[i] = rl_line_buffer[rl_point + i]; dummy[i] = '\0'; rl_delete_text (rl_point, rl_point + char_length); rl_point = _rl_find_next_mbchar (rl_line_buffer, rl_point, count, 0x01); _rl_fix_point (0); rl_insert_text (dummy); rl_end_undo_group (); xfree (dummy); return 0; }
long rl_transpose_chars(unsigned int a1) { int prev_mbchar; int v3; unsigned int v4; int i; int v6; int v7; const char *v8; v4 = a1; if ( !a1 ) return 0LL; if ( rl_point && rl_end > 1 ) { rl_begin_undo_group(); if ( rl_point == rl_end ) { if ( _ctype_get_mb_cur_max() <= 1 || rl_byte_oriented ) prev_mbchar = rl_point - 1; else prev_mbchar = rl_find_prev_mbchar(rl_line_buffer, rl_point, 1LL); rl_point = prev_mbchar; v4 = 1; } v6 = rl_point; if ( _ctype_get_mb_cur_max() <= 1 || rl_byte_oriented ) v3 = rl_point - 1; else v3 = rl_find_prev_mbchar(rl_line_buffer, rl_point, 1LL); rl_point = v3; v7 = v6 - v3; v8 = (const char *)xmalloc(v6 - v3 + 1); for ( i = 0; i < v7; ++i ) v8[i] = rl_line_buffer[rl_point + i]; v8[i] = 0; rl_delete_text(rl_point, v7 + rl_point); rl_point = rl_find_next_mbchar(rl_line_buffer, rl_point, v4, 1LL); rl_fix_point(0); rl_insert_text(v8); rl_end_undo_group(); xfree(v8); return 0LL; } else { rl_ding(); return 1LL; } }
static int get_tty_settings (int tty, struct termios *tiop) { set_winsize (tty); (*__errno_location ()) = 0; if (_get_tty_settings (tty, tiop) < 0) return -1; return 0; }
int get_tty_settings(unsigned long a0, void* a1) { set_winsize(a0); *(__errno_location()) = 0; return (_get_tty_settings(a0, a1) < 0 ? 0 : -1); }
static void check_blocks_extents(e2fsck_t ctx, struct problem_context *pctx, struct process_block_struct *pb) { struct ext2_extent_info info; struct ext2_inode *inode = pctx->inode; ext2_extent_handle_t ehandle; ext2_filsys fs = ctx->fs; ext2_ino_t ino = pctx->ino; errcode_t retval; blk64_t eof_lblk; struct ext3_extent_header *eh; eh = (struct ext3_extent_header *) &inode->i_block[0]; retval = ext2fs_extent_header_verify(eh, sizeof(inode->i_block)); if (retval) { if (fix_problem(ctx, 0x010081, pctx)) e2fsck_clear_inode(ctx, ino, inode, 0, "check_blocks_extents"); pctx->errcode = 0; return; } pctx->errcode = ext2fs_extent_open2(fs, ino, inode, &ehandle); if (pctx->errcode) { if (fix_problem(ctx, 0x010056, pctx)) e2fsck_clear_inode(ctx, ino, inode, 0, "check_blocks_extents"); pctx->errcode = 0; return; } retval = ext2fs_extent_get_info(ehandle, &info); if (retval == 0) { int max_depth = info.max_depth; if (max_depth >= 5) max_depth = 5 -1; ctx->extent_depth_count[max_depth]++; } pctx->blk = info.max_depth; pctx->blk2 = ext2fs_max_extent_depth(ehandle); if (pctx->blk2 < pctx->blk && fix_problem(ctx, 0x01007F, pctx)) pb->eti.force_rebuild = 1; pctx->blk = 5; if (pctx->blk2 > pctx->blk) fix_problem(ctx, 0x014005, pctx); memset(pb->eti.ext_info, 0, sizeof(pb->eti.ext_info)); pb->eti.ino = pb->ino; pb->next_lblock = 0; eof_lblk = ((((inode)->i_size | ((__u64) (inode)->i_size_high << 32)) + fs->blocksize - 1) >> ((fs->super)->s_log_block_size + 10)) - 1; scan_extent_node(ctx, pctx, pb, 0, 0, eof_lblk, ehandle, 1); if (pctx->errcode && fix_problem(ctx, 0x010057, pctx)) { pb->num_blocks = 0; inode->i_blocks = 0; e2fsck_clear_inode(ctx, ino, inode, 0x0004, "check_blocks_extents"); pctx->errcode = 0; } ext2fs_extent_free(ehandle); if ((((inode->i_mode) & 00170000) == 0040000) && e2fsck_dir_will_be_rehashed(ctx, ino)) return; if (ctx->options & 0x4000) e2fsck_rebuild_extents_later(ctx, ino); else e2fsck_should_rebuild_extents(ctx, pctx, &pb->eti, &info); }
unsigned long check_blocks_extents(_DWORD *a1, long a2, long a3) { int v5; unsigned int v6; long v7; long v8; long v9; long v10; long info; unsigned long v12; char v13[16]; int v14; unsigned long v15; v15 = __readfsqword(0x28u); v8 = *(_QWORD *)(a2 + 24); v9 = *(_QWORD *)a1; v6 = *(_DWORD *)(a2 + 8); v10 = v8 + 40; info = ext2fs_extent_header_verify(v8 + 40, 60LL); if ( info ) { if ( (unsigned int)fix_problem(a1, 65665LL, a2) ) e2fsck_clear_inode((long)a1, v6, v8, 0, (long)"check_blocks_extents"); *(_QWORD *)a2 = 0LL; } else { *(_QWORD *)a2 = ext2fs_extent_open2(v9, v6, v8, &v7); if ( *(_QWORD *)a2 ) { if ( (unsigned int)fix_problem(a1, 65622LL, a2) ) e2fsck_clear_inode((long)a1, v6, v8, 0, (long)"check_blocks_extents"); *(_QWORD *)a2 = 0LL; } else { info = ext2fs_extent_get_info(v7, v13); if ( !info ) { v5 = v14; if ( v14 > 4 ) v5 = 4; ++a1[v5 + 204]; } *(_QWORD *)(a2 + 40) = v14; *(_QWORD *)(a2 + 48) = ext2fs_max_extent_depth(v7); if ( *(_QWORD *)(a2 + 48) < *(_QWORD *)(a2 + 40) && (unsigned int)fix_problem(a1, 65663LL, a2) ) *(_DWORD *)(a3 + 108) = 1; *(_QWORD *)(a2 + 40) = 5LL; if ( *(_QWORD *)(a2 + 48) > *(_QWORD *)(a2 + 40) ) fix_problem(a1, 81925LL, a2); memset((void *)(a3 + 112), 0, 0x28uLL); *(_DWORD *)(a3 + 104) = *(_DWORD *)a3; *(_QWORD *)(a3 + 96) = 0LL; v12 = (((((unsigned long)*(unsigned int *)(v8 + 108) << 32) | *(unsigned int *)(v8 + 4)) + *(unsigned int *)(v9 + 40) - 1) >> ((unsigned char)*(_DWORD *)(*(_QWORD *)(v9 + 32) + 24LL) + 10)) - 1; scan_extent_node(a1, a2, (unsigned int *)a3, 0LL, 0LL, v12, v7, 1); if ( *(_QWORD *)a2 && (unsigned int)fix_problem(a1, 65623LL, a2) ) { *(_QWORD *)(a3 + 8) = 0LL; *(_DWORD *)(v8 + 28) = 0; e2fsck_clear_inode((long)a1, v6, v8, 4, (long)"check_blocks_extents"); *(_QWORD *)a2 = 0LL; } ext2fs_extent_free(v7); if ( (*(_WORD *)v8 & 0xF000) != 0x4000 || !(unsigned int)e2fsck_dir_will_be_rehashed(a1, v6) ) { if ( (a1[19] & 0x4000) != 0 ) e2fsck_rebuild_extents_later(a1, v6); else e2fsck_should_rebuild_extents(a1, a2, a3 + 104, v13); } } } return __readfsqword(0x28u) ^ v15; }
int dotcmd(int argc, char **argv) { int status = 0; nextopt(nullstr); argv = argptr; if (*argv) { char *fullname; fullname = find_dot_file(*argv); setinputfile(fullname, INPUT_PUSH_FILE); commandname = fullname; status = cmdloop(0); popfile(); } return status; }
long long dotcmd(unsigned long a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned long long *v0; unsigned int v1; unsigned int v2; unsigned long long v3; v1 = a0; v0 = a1; v2 = 0; nextopt(0x500158); v0 = argptr; if (*(v0)) { v3 = find_dot_file(*(v0)); setinputfile(v3, 0x1); commandname = v3; v2 = cmdloop(0x0); popfile(0x0, 0x1, a2, a3, a4, a5); } return v2; }
static void backspace_output (void) { { struct mtop operation; operation.mt_op = 4 ; operation.mt_count = 1; if ((((archive) >= (1 << 30)) ? rmt_ioctl__ (archive - (1 << 30), (((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8))) , (char *) &operation) : ioctl (archive, (((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8))) , (char *) &operation)) >= 0) return; if ( (*__errno_location ()) == 5 && (((archive) >= (1 << 30)) ? rmt_ioctl__ (archive - (1 << 30), (((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8))) , (char *) &operation) : ioctl (archive, (((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8))) , (char *) &operation)) >= 0) return; } { off_t position = (((archive) >= (1 << 30)) ? rmt_lseek__ (archive - (1 << 30), (off_t) 0, 1 ) : lseek (archive, (off_t) 0, 1 )); position -= record_end->buffer - record_start->buffer; if (position < 0) position = 0; if ((((archive) >= (1 << 30)) ? rmt_lseek__ (archive - (1 << 30), position, 0 ) : lseek (archive, position, 0 )) != position) { do { if (error_hook) error_hook (); error (0, 0, gettext ("Cannot backspace archive file; it may be unreadable without -i")); } while (0) ; if (record_start->buffer != output_start) memset (record_start->buffer, 0, output_start - record_start->buffer); } } }
unsigned long backspace_output() { bool v0; bool v1; __off_t v2; __off_t v3; char *v4; long offset; short v7[2]; int v8; unsigned long v9; v9 = __readfsqword(0x28u); v7[0] = 4; v8 = 1; if ( archive <= 0x3FFFFFFF ) v0 = ioctl(archive, 0x40086D01uLL, v7) >= 0; else v0 = (int)rmt_ioctl__((unsigned int)(archive - 0x40000000), 1074294017LL, v7) >= 0; if ( !v0 ) { if ( *_errno_location() != 5 || (archive <= 0x3FFFFFFF ? (v1 = ioctl(archive, 0x40086D01uLL, v7) >= 0) : (v1 = (int)rmt_ioctl__((unsigned int)(archive - 0x40000000), 1074294017LL, v7) >= 0), !v1) ) { if ( archive <= 0x3FFFFFFF ) v2 = lseek(archive, 0LL, 1); else v2 = rmt_lseek__((unsigned int)(archive - 0x40000000), 0LL, 1LL); offset = v2 - ((_BYTE *)record_end - (_BYTE *)record_start); if ( offset < 0 ) offset = 0LL; if ( archive <= 0x3FFFFFFF ) v3 = lseek(archive, offset, 0); else v3 = rmt_lseek__((unsigned int)(archive - 0x40000000), offset, 0LL); if ( v3 != offset ) { if ( error_hook ) error_hook(); v4 = gettext("Cannot backspace archive file; it may be unreadable without -i"); error(0, 0, v4); if ( record_start != (void *)output_start ) memset(record_start, 0, output_start - (_QWORD)record_start); } } } return __readfsqword(0x28u) ^ v9; }
char * sh_mkdoublequoted (s, slen, flags) const char *s; int slen, flags; { char *r, *ret; const char *send; int rlen, mb_cur_max; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); send = s + slen; mb_cur_max = flags ? (__ctype_get_mb_cur_max ()) : 1; rlen = (flags == 0) ? slen + 3 : (2 * slen) + 1; ret = r = (char *)sh_xmalloc((rlen), "shquote.c", 195); *r++ = '"'; while (*s) { if (flags && *s == '"') *r++ = '\\'; if (flags && ((locale_utf8locale && (*s & 0x80)) || (locale_utf8locale == 0 && mb_cur_max > 1 && is_basic (*s) == 0))) { do { if (locale_mb_cur_max > 1) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k) mblength = 1; else if (locale_utf8locale && ((*(s) & 0x80) == 0)) mblength = *(s) != 0; else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); } if (mblength == (size_t)-2 || mblength == (size_t)-1) { state = state_bak; mblength = 1; } else mblength = (mblength < 1) ? 1 : mblength; for (_k = 0; _k < mblength; _k++) *(r)++ = *(s)++; } else *(r)++ = *(s)++; } while (0); continue; } *r++ = *s++; } *r++ = '"'; *r = '\0'; return ret; }
long long sh_mkdoublequoted(unsigned long long a0, unsigned int a1, char a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { char *v0; int tmp_18; int tmp_10; int tmp_14; unsigned int v1; unsigned int v2; unsigned int v3; char *v4; unsigned long long v5; char *v6; char *v7; unsigned long long v8; unsigned long long v9; unsigned int v11; char *v12; char *v13; char *v14; char *v16; v0 = a0; memset(&v8, 0x0, 0x8); v6 = v0; if (!*(&a2)) v11 = 1; else v11 = __ctype_get_mb_cur_max(&v8, 0x0, 0x0, a3, a4, a5); v2 = v11; v11 = (!*(&a2) ? 1 : 3); v3 = v11; v4 = sh_xmalloc(v3, "shquote.c", 0xc3); v7 = v4; tmp_18 = v4; v4 += 1; *(tmp_18) = 34; while (*(v0)) { if (*(&a2) && *(v0) == 34) { v12 = v4; v4 += 1; *(v12) = 92; } if (!*(&a2) || (!locale_utf8locale || *(v0) >= 0) && (locale_utf8locale || v2 <= 1 || is_basic(*(v0)))) { tmp_10 = v0; v0 += 1; v13 = v4; v4 += 1; a2 = *(tmp_10); *(v13) = a2; } else if (locale_mb_cur_max <= 1) { tmp_10 = v0; v0 += 1; v14 = v4; v4 += 1; a2 = *(tmp_10); *(v14) = a2; } else { v1 = is_basic(*(v0)); if (v1) { v5 = 1; } else if (!locale_utf8locale || *(v0) < 0) { v9 = v8; v5 = mbrlen(v0, v6 - v0, &v8, v6 - v0); } else { v5 = *(v0); } if (v5 == -2 || v5 == -1) { v8 = v9; v5 = 1; } else { *(&v5) = (!v5 ? v5 : 1); } for (v1 = 0; v5 > v1; v1 += 1) { tmp_14 = v0; v0 += 1; v16 = v4; v4 += 1; *(v16) = *(tmp_14); } } } tmp_14 = v4; v4 += 1; *(tmp_14) = 34; *(v4) = 0; return v7; }
void remember_mail_dates () { char *mailpaths; char *mailfile, *mp; int i = 0; mailpaths = get_string_value ("MAILPATH"); if (mailpaths == 0 && (mailpaths = get_string_value ("MAIL"))) { add_mail_file (mailpaths, (char *) ((void *)0) ); return; } if (mailpaths == 0) { mailpaths = make_default_mailpath (); if (mailpaths) { add_mail_file (mailpaths, (char *) ((void *)0) ); sh_xfree((mailpaths), "mailcheck.c", 389); } return; } while (mailfile = extract_colon_unit (mailpaths, &i)) { mp = parse_mailpath_spec (mailfile); if (mp && *mp) *mp++ = '\0'; add_mail_file (mailfile, mp); sh_xfree((mailfile), "mailcheck.c", 400); } }
void remember_mail_dates(void) { char *pcVar1; long in_FS_OFFSET; undefined4 local_2c; long local_28; char *local_20; long local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_2c = 0; local_28 = get_string_value("MAILPATH"); if ((local_28 == 0) && (local_28 = get_string_value(&DAT_00101041), local_28 != 0)) { add_mail_file(local_28,0); } else if (local_28 == 0) { local_28 = make_default_mailpath(); if (local_28 != 0) { add_mail_file(local_28,0); sh_xfree(local_28,"mailcheck.c",0x185); } } else { while (local_18 = extract_colon_unit(local_28,&local_2c), local_18 != 0) { pcVar1 = (char *)parse_mailpath_spec(local_18); local_20 = pcVar1; if ((pcVar1 != (char *)0x0) && (*pcVar1 != '\0')) { local_20 = pcVar1 + 1; *pcVar1 = '\0'; } add_mail_file(local_18,local_20); sh_xfree(local_18,"mailcheck.c",400); } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
int ttnoecho () { struct termios tt; if (ttsaved == 0) return -1; tt = ttin; return (ttfd_noecho (0, &tt)); }
long long ttnoecho() { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long v3; unsigned long v4; unsigned long v5; unsigned long v6; unsigned int v7; unsigned long long v9; if (!ttsaved) { v9 = 4294967295; } else { v0 = ttin; v1 = g_400748; v2 = g_400750; v3 = g_400758; v4 = g_400760; v5 = g_400768; v6 = g_400770; v7 = g_400778; v9 = ttfd_noecho(0x0, &v0); } return v9; }
static time_t get_int_date(const char *txt_val, int int_val, const char *msg) { if (batch) { if (txt_val == ((void *)0) ) { time_t secs; if (int_val == 0 || int_val < -2) secs = days_to_secs(365); else { secs = days_to_secs(int_val); } return secs; } else return get_date(txt_val); } else { int days; do { days = read_int(msg); } while (days == 0); return days_to_secs(days); } }
long get_int_date(const char *a1, int a2, const char *a3) { int v5; if ( batch ) { if ( a1 ) { return get_date(a1); } else if ( a2 && a2 >= -2 ) { return days_to_secs(a2); } else { return days_to_secs(365); } } else { do v5 = read_int(a3); while ( !v5 ); return days_to_secs(v5); } }
ARRAY * array_copy(a) ARRAY *a; { ARRAY *a1; ARRAY_ELEMENT *ae, *new; if (a == 0) return((ARRAY *) ((void *)0) ); a1 = array_create(); a1->max_index = a->max_index; a1->num_elements = a->num_elements; for (ae = ((a->head)->next); ae != a->head; ae = ((ae)->next)) { new = array_create_element(((ae)->ind), ((ae)->value)); do { a1->head->prev->next = new; new->prev = a1->head->prev; a1->head->prev = new; new->next = a1->head; } while(0); if (ae == (a->lastref ? a->lastref : ((a->head)->next))) a1->lastref = (new); } return(a1); }
long long array_copy(struct_0 *a0) { unsigned long long v0[3]; void* v1; unsigned long long v2[4]; void* v4; unsigned long long v5; if (!a0) { v4 = 0; } else { v1 = array_create(); *(v1) = a0->field_0; *(&v1[8]) = a0->field_8; for (v0[0] = a0->field_10->field_10; v0 != a0->field_10; v0[0] = v0[2]) { v2[0] = array_create_element(v0[0], v0[1]); *((*((v1[16] + 24)) + 16)) = v2; v2[3] = *((v1[16] + 24)); *((v1[16] + 24)) = v2; v2[2] = v1[16]; if (!a0->field_18) v5 = a0->field_10->field_10; else v5 = a0->field_18; if (v5 == v0) *(&v1[24]) = v2; } v4 = v1; } return v4; }
errcode_t ea_refcount_fetch(ext2_refcount_t refcount, ea_key_t ea_key, ea_value_t *ret) { struct ea_refcount_el *el; el = get_refcount_el(refcount, ea_key, 0); if (!el) { *ret = 0; return 0; } *ret = el->ea_value; return 0; }
long long ea_refcount_fetch(void* a0, unsigned long a1, unsigned long long *a2) { struct_0 *v0; v0 = get_refcount_el(a0, a1, 0x0); if (!v0) *(a2) = 0; else *(a2) = v0->field_8; return 0; }
static char const * trim_leading_zeros (char const *s) { char const *p = s; while (*s == '0') ++s; if (!*s && s != p) --s; return s; }
int trim_leading_zeros(unsigned long a0) { char *v0; char *v1; v0 = a0; for (v1 = v0; *(v0) == 48; v0 += 1); if (!*(v0) && v0 != v1) v0 += 1; return v0; }
static int _rl_vi_callback_set_mark (_rl_callback_generic_arg *data) { _rl_callback_func = 0; _rl_want_redisplay = 1; return (_rl_vi_set_mark ()); }
long long _rl_vi_callback_set_mark(unsigned long a0) { unsigned long v0; v0 = a0; _rl_callback_func = 0; _rl_want_redisplay = 1; return _rl_vi_set_mark(); }
struct coproc * coproc_alloc (name, pid) char *name; pid_t pid; { struct coproc *cp; cp = &sh_coproc; coproc_init (cp); cp->c_lock = 2; cp->c_pid = pid; cp->c_name = (char *)strcpy (sh_xmalloc((1 + strlen (name)), "execute_cmd.c", 2050), (name)); cp->c_lock = 0; return (cp); }
char ** coproc_alloc(const char *a1, int a2) { size_t v2; char *v3; coproc_init((long)&sh_coproc); *((_DWORD *)&sh_coproc + 9) = 2; *((_DWORD *)&sh_coproc + 2) = a2; v2 = strlen(a1); v3 = (char *)sh_xmalloc(v2 + 1, "execute_cmd.c", 2050LL); sh_coproc = strcpy(v3, a1); *((_DWORD *)&sh_coproc + 9) = 0; return &sh_coproc; }
static int save_route(struct nlmsghdr *n, void *arg) { int ret; int len = n->nlmsg_len; struct rtmsg *r = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); struct rtattr *tb[(__RTA_MAX - 1)+1]; int host_len; host_len = af_bit_len(r->rtm_family); len -= ((sizeof(*r)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); parse_rtattr(tb, (__RTA_MAX - 1), ((struct rtattr*)(((char*)(r)) + ( ((sizeof(struct rtmsg))+4U -1) & ~(4U -1) ))), len); if (!filter_nlmsg(n, tb, host_len)) return 0; ret = write( 1 , n, n->nlmsg_len); if ((ret > 0) && (ret != n->nlmsg_len)) { fprintf( stderr , "Short write while saving nlmsg\n"); ret = - 5 ; } return ret == n->nlmsg_len ? 0 : ret; }
long long save_route(unsigned int *a0, unsigned long a1) { unsigned long v0; unsigned int v1; unsigned int v2; unsigned int v3; char *v4; char v5; void* v7; v0 = a1; v2 = *(a0); v4 = &a0[4]; v3 = af_bit_len(*(v4)); v2 -= 28; parse_rtattr(&v5, 0x1e, v4 + 12, v2); if (!filter_nlmsg(a0, &v5, v3)) { v7 = 0; } else { v1 = write(0x1, a0, *(a0)); if (v1 > 0 && *(a0) != v1) { fprintf(stderr, "Short write while saving nlmsg\n"); v1 = -5; } if (*(a0) == v1) v7 = 0; else v7 = v1; } return v7; }
static void nh_init(nh_ctx *hc, aes_int_key prf_key) { kdf(hc->nh_key, prf_key, 1, sizeof(hc->nh_key)); endian_convert((hc->nh_key),(4),(sizeof(hc->nh_key))); nh_reset(hc); }
long nh_init(char *a1, long a2) { kdf(a1, a2, 1, 1072); endian_convert(a1, 4LL, 0x430u); return nh_reset((long)a1); }
static void bytes_chunk_extract (uintmax_t k, uintmax_t n, char *buf, size_t bufsize, size_t initial_read, off_t file_size) { off_t start; off_t end; ((void) sizeof (( k && n && k <= n && n <= file_size ) ? 1 : 0), __extension__ ({ if ( k && n && k <= n && n <= file_size ) ; else __assert_fail ( "k && n && k <= n && n <= file_size" , "src/split.c", 996, __extension__ __PRETTY_FUNCTION__); })) ; start = (k - 1) * (file_size / n); end = (k == n) ? file_size : k * (file_size / n); if (start < initial_read) { memmove (buf, buf + start, initial_read - start); initial_read -= start; } else { if (lseek ( 0 , start - initial_read, 1 ) < 0) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); initial_read = (18446744073709551615UL) ; } while (start < end) { size_t n_read; if (initial_read != (18446744073709551615UL) ) { n_read = initial_read; initial_read = (18446744073709551615UL) ; } else { n_read = safe_read ( 0 , buf, bufsize); if (n_read == ((size_t) -1)) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, infile)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } if (n_read == 0) break; n_read = ((( n_read )<( end - start ))?( n_read ):( end - start )) ; if (full_write ( 1 , buf, n_read) != n_read && ! ignorable ( (*__errno_location ()) )) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, \"-\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, "-")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, "-")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); start += n_read; } }
void bytes_chunk_extract(unsigned long long a0, unsigned long a1, void* a2, unsigned long long a3, unsigned long a4, unsigned long long a5) { unsigned long long 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; unsigned long long v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; v0 = a4; if (a0 && a1 && a0 <= a1 && a1 <= a5) { v1 = (a0 - 1) * (0 CONCAT a5) /m a1; if (a0 != a1) v5 = a0 * (0 CONCAT a5) /m a1; else v5 = a5; v3 = v5; if (v0 > v1) { memmove(a2, v1 + a2, v0 - v1); v0 -= v1; } else { v6 = lseek(0x0, v1 - v0, 0x1); if (v6 < 0) { v12 = quotearg_n_style_colon(0x0, 0x3, *(&infile)); error(0x1, *(__errno_location()), "%s"); } v0 = -1; } if (v6 >= 0 || v0 > v1) { while (true) { v7 = v1; if (v1 >= v3) break; if (v0 != -1) { v8 = v0; v2 = v0; v0 = -1; } else { *(&v2) = safe_read(0x0, a2, a3, a3); if (v2 == -1) { v13 = quotearg_n_style_colon(0x0, 0x3, *(&infile)); error(0x1, *(__errno_location()), "%s"); } } if (v2 != -1 || v0 != -1) { if (!v2) break; if (v2) { v10 = v3 - v1; if (v2 <= v3 - v1) v10 = v2; v2 = v10; v11 = full_write(0x1, a2, v2, a3); if (v2 != v11) { *(&v11) = ignorable(*(__errno_location())) ^ 1; if (v11) { v14 = quotearg_n_style_colon(0x0, 0x3, "-"); error(0x1, *(__errno_location()), "%s"); } } if (!v11 || v2 == v11) v1 = v2 + v1; } } } return; } } if (!a0 || !a1 || a1 > a5 || a0 > a1) __assert_fail(); }
static void check_root(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; blk64_t blk; struct ext2_inode_large inode; struct ext2_inode *iptr = (struct ext2_inode *) &inode; char * block; struct problem_context pctx; clear_problem_context(&pctx); if (ext2fs_test_inode_bitmap2(ctx->inode_used_map, 2)) { if (!(ext2fs_test_inode_bitmap2(ctx->inode_dir_map, 2))) { fix_problem(ctx, 0x030014, &pctx); ctx->flags |= 0x0001; } return; } if (!fix_problem(ctx, 0x030001, &pctx)) { fix_problem(ctx, 0x030015, &pctx); ctx->flags |= 0x0001; return; } e2fsck_read_bitmaps(ctx); if (ctx->root_repair_block) { blk = ctx->root_repair_block; ctx->root_repair_block = 0; goto skip_new_block; } pctx.errcode = ext2fs_new_block2(fs, 0, ctx->block_found_map, &blk); if (pctx.errcode) { pctx.str = "ext2fs_new_block"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } ext2fs_mark_block_bitmap2(ctx->block_found_map, blk); skip_new_block: ext2fs_mark_block_bitmap2(fs->block_map, blk); ext2fs_mark_bb_dirty(fs); memset(&inode, 0, sizeof(inode)); inode.i_mode = 040755; inode.i_size = fs->blocksize; inode.i_atime = inode.i_ctime = inode.i_mtime = ctx->now; inode.i_links_count = 2; ext2fs_iblk_set(fs, iptr, 1); inode.i_block[0] = blk; inode.i_extra_isize = sizeof(struct ext2_inode_large) - 128; pctx.errcode = ext2fs_write_new_inode(fs, 2, iptr); if (pctx.errcode) { pctx.str = "ext2fs_write_inode"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } pctx.errcode = ext2fs_new_dir_block(fs, 2, 2, &block); if (pctx.errcode) { pctx.str = "ext2fs_new_dir_block"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } pctx.errcode = ext2fs_write_dir_block4(fs, blk, block, 0, 2); ext2fs_free_mem(&block); if (pctx.errcode) { pctx.str = "ext2fs_write_dir_block4"; fix_problem(ctx, 0x030012, &pctx); ctx->flags |= 0x0001; return; } e2fsck_add_dir_info(ctx, 2, 2); ext2fs_icount_store(ctx->inode_count, 2, 2); ext2fs_icount_store(ctx->inode_link_info, 2, 2); ext2fs_mark_inode_bitmap2(ctx->inode_used_map, 2); ext2fs_mark_inode_bitmap2(ctx->inode_dir_map, 2); ext2fs_mark_inode_bitmap2(fs->inode_map, 2); ext2fs_mark_ib_dirty(fs); quota_data_add(ctx->qctx, &inode, 2, ((1 << 10) << (fs->super)->s_log_cluster_size)); quota_data_inodes(ctx->qctx, &inode, 2, +1); }
void check_root(struct_0 *a0, unsigned long a1, unsigned long long a2) { unsigned long long v0; char v1; struct_1 *v2; unsigned long long v3; unsigned long v4; unsigned long long v5; unsigned short v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; unsigned short v11; unsigned int v12; unsigned short v13; char v14; unsigned long long *v16; unsigned long long v17; v2 = a0->field_0; v3 = &v6; clear_problem_context(&v4); if (ext2fs_test_inode_bitmap2(a0->field_168, 0x2, a2)) { if (!ext2fs_test_inode_bitmap2(a0->field_178, 0x2, a2)) { fix_problem(a0, 0x30014, &v4); a0->field_48 = a0->field_48 | 1; } } else { if (fix_problem(a0, 0x30001, &v4)) { e2fsck_read_bitmaps(a0); if (a0->field_378) { v0 = a0->field_378; a0->field_378 = 0; goto LABEL_4006ec; } else { v4 = ext2fs_new_block2(v2, 0x0, a0->field_1a0, &v0); if (v4) { v5 = "ext2fs_new_block"; fix_problem(a0, 0x30012, &v4); a0->field_48 = a0->field_48 | 1; } else { ext2fs_mark_block_bitmap2(a0->field_1a0, v0, v0); LABEL_4006ec: ext2fs_mark_block_bitmap2(v2->field_58, v0, v0); ext2fs_mark_bb_dirty(v2); memset(&v6, 0x0, 0xa0); v6 = 16877; v7 = v2->field_28; v10 = a0->field_348; v9 = v10; v8 = v9; v11 = 2; ext2fs_iblk_set(v2, v3, 0x1, v3); v12 = v0; v13 = 32; v4 = ext2fs_write_new_inode(v2, 0x2, v3); if (!v4) { v4 = ext2fs_new_dir_block(v2, 0x2, 0x2, &v1); if (!v4) { v4 = ext2fs_write_dir_block4(v2, v0, *(&v1), 0x0, 0x2); ext2fs_free_mem(&v1); if (v4) { v5 = "ext2fs_write_dir_block4"; fix_problem(a0, 0x30012, &v4); a0->field_48 = a0->field_48 | 1; } else { e2fsck_add_dir_info(a0, 0x2, 0x2); ext2fs_icount_store(a0->field_1b8, 0x2, 0x2); ext2fs_icount_store(a0->field_1c0, 0x2, 0x2); ext2fs_mark_inode_bitmap2(a0->field_168, 0x2); ext2fs_mark_inode_bitmap2(a0->field_178, 0x2); ext2fs_mark_inode_bitmap2(v2->field_50, 0x2); ext2fs_mark_ib_dirty(v2); quota_data_add(a0->field_278, &v6, 0x2, 0x400 << (v2->field_20->field_1c & 31)); quota_data_inodes(a0->field_278, &v6, 0x2, 0x1); } } else { v5 = "ext2fs_new_dir_block"; fix_problem(a0, 0x30012, &v4); a0->field_48 = a0->field_48 | 1; } } else { v5 = "ext2fs_write_inode"; fix_problem(a0, 0x30012, &v4); a0->field_48 = a0->field_48 | 1; } } } } else { fix_problem(a0, 0x30015, &v4); a0->field_48 = a0->field_48 | 1; } } v17 = *(&v14) ^ v16[5]; return; }
void load_server_config(const char *filename, struct sshbuf *conf) { struct stat st; char *line = ((void *)0) , *cp; size_t linesize = 0; FILE *f; int r, lineno = 0; sshlog("servconf.c", __func__, 2502, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "filename %s", filename); if ((f = fopen(filename, "r")) == ((void *)0) ) { perror(filename); exit(1); } sshbuf_reset(conf); if (fstat(fileno(f), &st) == 0 && st.st_size > 0 && (r = sshbuf_allocate(conf, st.st_size)) != 0) sshfatal("servconf.c", __func__, 2511, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "allocate"); while (getline(&line, &linesize, f) != -1) { lineno++; cp = line + strspn(line, " \t\r"); if ((r = sshbuf_put(conf, cp, strlen(cp))) != 0) sshfatal("servconf.c", __func__, 2521, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "sshbuf_put"); } free(line); if ((r = sshbuf_put_u8(conf, 0)) != 0) sshfatal("servconf.c", __func__, 2525, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "sshbuf_put_u8"); fclose(f); sshlog("servconf.c", __func__, 2527, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "done config len = %zu", sshbuf_len(conf)); }
unsigned long load_server_config(const char *a1, long a2) { int v2; long v3; char *v4; size_t v5; long v6; long v7; long v8; int v10; unsigned int v11; unsigned int v12; unsigned int v13; char *s; size_t n; FILE *stream; char *v17; struct stat buf; unsigned long v19; v19 = __readfsqword(0x28u); s = 0LL; n = 0LL; v10 = 0; sshlog("servconf.c", "load_server_config", 2502LL, 1LL, 6LL, 0LL, "filename %s", a1); stream = fopen(a1, "r"); if ( !stream ) { perror(a1); exit(1); } sshbuf_reset(a2); v2 = fileno(stream); if ( fstat(v2, &buf) ) goto LABEL_9; if ( buf.st_size <= 0 ) goto LABEL_9; v11 = sshbuf_allocate(a2, buf.st_size); if ( !v11 ) goto LABEL_9; v3 = ssh_err(v11); sshfatal("servconf.c", "load_server_config", 2511LL, 1LL, 1LL, v3, "allocate"); do { ++v10; v4 = s; v17 = &v4[strspn(s, " \t\r")]; v5 = strlen(v17); v12 = sshbuf_put(a2, v17, v5); if ( v12 ) { v6 = ssh_err(v12); sshfatal("servconf.c", "load_server_config", 2521LL, 1LL, 1LL, v6, "sshbuf_put"); } LABEL_9: ; } while ( getline(&s, &n, stream) != -1 ); free(s); v13 = sshbuf_put_u8(a2, 0LL); if ( v13 ) { v7 = ssh_err(v13); sshfatal("servconf.c", "load_server_config", 2525LL, 1LL, 1LL, v7, "sshbuf_put_u8"); } fclose(stream); v8 = sshbuf_len(a2); sshlog("servconf.c", "load_server_config", 2527LL, 1LL, 6LL, 0LL, "done config len = %zu", v8); return __readfsqword(0x28u) ^ v19; }
int main (int argc, char **argv) { int c; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); hard_LC_COLLATE = hard_locale ( 3 ); atexit (close_stdout); only_file_1 = 1 ; only_file_2 = 1 ; both = 1 ; seen_unpairable = 0 ; issued_disorder_warning[0] = issued_disorder_warning[1] = 0 ; check_input_order = CHECK_ORDER_DEFAULT; total_option = 0 ; while ((c = getopt_long (argc, argv, "123z", long_options, ((void *)0) )) != -1) switch (c) { case '1': only_file_1 = 0 ; break; case '2': only_file_2 = 0 ; break; case '3': both = 0 ; break; case 'z': delim = '\0'; break; case NOCHECK_ORDER_OPTION: check_input_order = CHECK_ORDER_DISABLED; break; case CHECK_ORDER_OPTION: check_input_order = CHECK_ORDER_ENABLED; break; case OUTPUT_DELIMITER_OPTION: if (col_sep_len && !(strcmp (col_sep, optarg) == 0)) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"multiple output delimiters specified\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("multiple output delimiters specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("multiple output delimiters specified")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); col_sep = optarg; col_sep_len = *optarg ? strlen (optarg) : 1; break; case TOTAL_OPTION: total_option = 1 ; break; case GETOPT_HELP_CHAR: usage ( 0 ); break;; case GETOPT_VERSION_CHAR: version_etc ( stdout , "comm", "GNU coreutils", Version, ("Richard M. Stallman"), ("David MacKenzie"), (char *) ((void *)0) ); exit ( 0 ); break;; default: usage ( 1 ); } if (! col_sep_len) col_sep_len = 1; if (argc - optind < 2) { if (argc <= optind) error (0, 0, gettext ("missing operand")); else error (0, 0, gettext ("missing operand after %s"), quote (argv[argc - 1])); usage ( 1 ); } if (2 < argc - optind) { error (0, 0, gettext ("extra operand %s"), quote (argv[optind + 2])); usage ( 1 ); } compare_files (argv + optind); }
int main(unsigned long a0) { void* v0; unsigned int v1; unsigned long v2; unsigned long v4; unsigned long long *v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; v2 = v4; set_program_name(*(v5)); setlocale(0x6, &g_401703); bindtextdomain("coreutils", "/usr/local/share/locale"); textdomain("coreutils"); hard_LC_COLLATE = hard_locale(0x3); atexit(got.close_stdout); only_file_1 = 1; only_file_2 = 1; both = 1; seen_unpairable = 0; g_4015be = 0; issued_disorder_warning = g_4015be; check_input_order = 0; total_option = 0; while (true) { v1 = getopt_long(a0, v5, "123z", &long_options, NULL); if (v1 == -1) break; switch (v1) { case 122: delim = 0; continue; case 128: check_input_order = 1; continue; case 129: check_input_order = 2; continue; case 130: if (col_sep_len && strcmp(col_sep, optarg)) error(0x1, 0x0, gettext("multiple output delimiters specified")); col_sep = optarg; if (!*(optarg)) v6 = 1; else v6 = strlen(optarg); col_sep_len = v6; continue; case 131: total_option = 1; continue; case 51: both = 0; break; case 50: only_file_2 = 0; break; case 49: only_file_1 = 0; break; case 4294967165: v0 = 0; version_etc(stdout, "comm", "GNU coreutils", Version, "Richard M. Stallman", "David MacKenzie"); exit(0x0); case 4294967166: usage(0x0); default: usage(0x1); } } if (!col_sep_len) col_sep_len = 1; if (a0 - optind <= 1) { if (a0 > optind) { v7 = quote(v5[1 + a0]); error(0x0, 0x0, gettext("missing operand after %s")); } else { error(0x0, 0x0, gettext("missing operand")); } usage(0x1); } else if (a0 - optind <= 2) { compare_files(&v5[optind]); } else { v8 = quote(v5[2 + optind]); error(0x0, 0x0, gettext("extra operand %s")); usage(0x1); } }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout); return; }
static block_state deflate_stored(s, flush) deflate_state *s; int flush; { unsigned min_block = ((s->pending_buf_size - 5) > (s->w_size) ? (s->w_size) : (s->pending_buf_size - 5)); unsigned len, left, have, last = 0; unsigned used = s->strm->avail_in; do { len = 65535; have = (s->bi_valid + 42) >> 3; if (s->strm->avail_out < have) break; have = s->strm->avail_out - have; left = s->strstart - s->block_start; if (len > (ulg)left + s->strm->avail_in) len = left + s->strm->avail_in; if (len > have) len = have; if (len < min_block && ((len == 0 && flush != 4) || flush == 0 || len != left + s->strm->avail_in)) break; last = flush == 4 && len == left + s->strm->avail_in ? 1 : 0; _tr_stored_block(s, (char *)0, 0L, last); s->pending_buf[s->pending - 4] = len; s->pending_buf[s->pending - 3] = len >> 8; s->pending_buf[s->pending - 2] = ~len; s->pending_buf[s->pending - 1] = ~len >> 8; flush_pending(s->strm); if (left) { if (left > len) left = len; memcpy(s->strm->next_out, s->window + s->block_start, left); s->strm->next_out += left; s->strm->avail_out -= left; s->strm->total_out += left; s->block_start += left; len -= left; } if (len) { read_buf(s->strm, s->strm->next_out, len); s->strm->next_out += len; s->strm->avail_out -= len; s->strm->total_out += len; } } while (last == 0); used -= s->strm->avail_in; if (used) { if (used >= s->w_size) { s->matches = 2; memcpy(s->window, s->strm->next_in - s->w_size, s->w_size); s->strstart = s->w_size; s->insert = s->strstart; } else { if (s->window_size - s->strstart <= used) { s->strstart -= s->w_size; memcpy(s->window, s->window + s->w_size, s->strstart); if (s->matches < 2) s->matches++; if (s->insert > s->strstart) s->insert = s->strstart; } memcpy(s->window + s->strstart, s->strm->next_in - used, used); s->strstart += used; s->insert += ((used) > (s->w_size - s->insert) ? (s->w_size - s->insert) : (used)); } s->block_start = s->strstart; } if (s->high_water < s->strstart) s->high_water = s->strstart; if (last) return finish_done; if (flush != 0 && flush != 4 && s->strm->avail_in == 0 && (long)s->strstart == s->block_start) return block_done; have = s->window_size - s->strstart; if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) { s->block_start -= s->w_size; s->strstart -= s->w_size; memcpy(s->window, s->window + s->w_size, s->strstart); if (s->matches < 2) s->matches++; have += s->w_size; if (s->insert > s->strstart) s->insert = s->strstart; } if (have > s->strm->avail_in) have = s->strm->avail_in; if (have) { read_buf(s->strm, s->window + s->strstart, have); s->strstart += have; s->insert += ((have) > (s->w_size - s->insert) ? (s->w_size - s->insert) : (have)); } if (s->high_water < s->strstart) s->high_water = s->strstart; have = (s->bi_valid + 42) >> 3; have = ((s->pending_buf_size - have) > (65535) ? (65535) : (s->pending_buf_size - have)); min_block = ((have) > (s->w_size) ? (s->w_size) : (have)); left = s->strstart - s->block_start; if (left >= min_block || ((left || flush == 4) && flush != 0 && s->strm->avail_in == 0 && left <= have)) { len = ((left) > (have) ? (have) : (left)); last = flush == 4 && s->strm->avail_in == 0 && len == left ? 1 : 0; _tr_stored_block(s, (charf *)s->window + s->block_start, len, last); s->block_start += len; flush_pending(s->strm); } return last ? finish_started : need_more; }
undefined8 deflate_stored(long **param_1,int param_2) { int iVar1; uint uVar2; undefined8 uVar3; uint uVar4; byte bVar5; uint uVar6; ulong uVar7; uint local_20; uint local_1c; uint local_18; int local_14; uVar7 = (long)param_1[3] - 5U; if ((ulong)*(uint *)(param_1 + 10) < (long)param_1[3] - 5U) { uVar7 = (ulong)*(uint *)(param_1 + 10); } local_14 = 0; iVar1 = *(int *)(*param_1 + 1); while( true ) { local_20 = 0xffff; uVar2 = *(int *)((long)param_1 + 0x1734) + 0x2a >> 3; if (*(uint *)(*param_1 + 4) < uVar2) break; uVar2 = *(int *)(*param_1 + 4) - uVar2; local_1c = *(int *)((long)param_1 + 0xac) - (int)param_1[0x13]; if ((ulong)*(uint *)(*param_1 + 1) + (ulong)local_1c < 0xffff) { local_20 = local_1c + *(int *)(*param_1 + 1); } if (uVar2 < local_20) { local_20 = uVar2; } if ((local_20 < (uint)uVar7) && ((((local_20 == 0 && (param_2 != 4)) || (param_2 == 0)) || (local_20 != local_1c + *(int *)(*param_1 + 1))))) break; if ((param_2 == 4) && (local_20 == local_1c + *(int *)(*param_1 + 1))) { local_14 = 1; } else { local_14 = 0; } _tr_stored_block(param_1,0,0); *(byte *)((long)param_1[5] + -4 + (long)param_1[2]) = (byte)local_20; bVar5 = (byte)(local_20 >> 8); *(byte *)((long)param_1[5] + -3 + (long)param_1[2]) = bVar5; *(byte *)((long)param_1[5] + -2 + (long)param_1[2]) = ~(byte)local_20; *(byte *)((long)param_1[5] + -1 + (long)param_1[2]) = ~bVar5; flush_pending(*param_1); if (local_1c != 0) { if (local_20 < local_1c) { local_1c = local_20; } memcpy((void *)(*param_1)[3],(void *)((long)param_1[0xc] + (long)param_1[0x13]), (ulong)local_1c); (*param_1)[3] = (ulong)local_1c + (*param_1)[3]; *(uint *)(*param_1 + 4) = *(int *)(*param_1 + 4) - local_1c; (*param_1)[5] = (ulong)local_1c + (*param_1)[5]; param_1[0x13] = (long *)((long)param_1[0x13] + (ulong)local_1c); local_20 = local_20 - local_1c; } if (local_20 != 0) { read_buf(*param_1,(*param_1)[3],local_20); (*param_1)[3] = (ulong)local_20 + (*param_1)[3]; *(uint *)(*param_1 + 4) = *(int *)(*param_1 + 4) - local_20; (*param_1)[5] = (ulong)local_20 + (*param_1)[5]; } if (local_14 != 0) break; } uVar2 = iVar1 - *(int *)(*param_1 + 1); if (uVar2 != 0) { if (uVar2 < *(uint *)(param_1 + 10)) { if ((long)param_1[0xd] - (ulong)*(uint *)((long)param_1 + 0xac) <= (ulong)uVar2) { *(int *)((long)param_1 + 0xac) = *(int *)((long)param_1 + 0xac) - *(int *)(param_1 + 10); memcpy(param_1[0xc],(void *)((long)param_1[0xc] + (ulong)*(uint *)(param_1 + 10)), (ulong)*(uint *)((long)param_1 + 0xac)); if (*(uint *)(param_1 + 0x2e5) < 2) { *(int *)(param_1 + 0x2e5) = *(int *)(param_1 + 0x2e5) + 1; } if (*(uint *)((long)param_1 + 0xac) < *(uint *)((long)param_1 + 0x172c)) { *(undefined4 *)((long)param_1 + 0x172c) = *(undefined4 *)((long)param_1 + 0xac); } } memcpy((void *)((long)param_1[0xc] + (ulong)*(uint *)((long)param_1 + 0xac)), (void *)(**param_1 - (ulong)uVar2),(ulong)uVar2); *(uint *)((long)param_1 + 0xac) = *(int *)((long)param_1 + 0xac) + uVar2; uVar4 = *(int *)(param_1 + 10) - *(int *)((long)param_1 + 0x172c); if (uVar2 <= uVar4) { uVar4 = uVar2; } *(uint *)((long)param_1 + 0x172c) = *(int *)((long)param_1 + 0x172c) + uVar4; } else { *(undefined4 *)(param_1 + 0x2e5) = 2; memcpy(param_1[0xc],(void *)(**param_1 - (ulong)*(uint *)(param_1 + 10)), (ulong)*(uint *)(param_1 + 10)); *(undefined4 *)((long)param_1 + 0xac) = *(undefined4 *)(param_1 + 10); *(undefined4 *)((long)param_1 + 0x172c) = *(undefined4 *)((long)param_1 + 0xac); } param_1[0x13] = (long *)(ulong)*(uint *)((long)param_1 + 0xac); } if (param_1[0x2e7] < (long *)(ulong)*(uint *)((long)param_1 + 0xac)) { param_1[0x2e7] = (long *)(ulong)*(uint *)((long)param_1 + 0xac); } if (local_14 == 0) { if (((param_2 == 0) || (param_2 == 4)) || ((*(int *)(*param_1 + 1) != 0 || ((long *)(ulong)*(uint *)((long)param_1 + 0xac) != param_1[0x13])))) { local_18 = (int)param_1[0xd] - *(int *)((long)param_1 + 0xac); if ((local_18 < *(uint *)(*param_1 + 1)) && ((long)(ulong)*(uint *)(param_1 + 10) <= (long)param_1[0x13])) { param_1[0x13] = (long *)((long)param_1[0x13] - (ulong)*(uint *)(param_1 + 10)); *(int *)((long)param_1 + 0xac) = *(int *)((long)param_1 + 0xac) - *(int *)(param_1 + 10); memcpy(param_1[0xc],(void *)((long)param_1[0xc] + (ulong)*(uint *)(param_1 + 10)), (ulong)*(uint *)((long)param_1 + 0xac)); if (*(uint *)(param_1 + 0x2e5) < 2) { *(int *)(param_1 + 0x2e5) = *(int *)(param_1 + 0x2e5) + 1; } local_18 = local_18 + *(int *)(param_1 + 10); if (*(uint *)((long)param_1 + 0xac) < *(uint *)((long)param_1 + 0x172c)) { *(undefined4 *)((long)param_1 + 0x172c) = *(undefined4 *)((long)param_1 + 0xac); } } if (*(uint *)(*param_1 + 1) < local_18) { local_18 = *(uint *)(*param_1 + 1); } if (local_18 != 0) { read_buf(*param_1,(long)param_1[0xc] + (ulong)*(uint *)((long)param_1 + 0xac),local_18); *(uint *)((long)param_1 + 0xac) = *(int *)((long)param_1 + 0xac) + local_18; uVar2 = *(int *)(param_1 + 10) - *(int *)((long)param_1 + 0x172c); if (local_18 <= uVar2) { uVar2 = local_18; } *(uint *)((long)param_1 + 0x172c) = *(int *)((long)param_1 + 0x172c) + uVar2; } if (param_1[0x2e7] < (long *)(ulong)*(uint *)((long)param_1 + 0xac)) { param_1[0x2e7] = (long *)(ulong)*(uint *)((long)param_1 + 0xac); } uVar7 = (long)param_1[3] - (ulong)(uint)(*(int *)((long)param_1 + 0x1734) + 0x2a >> 3); if (0xffff < uVar7) { uVar7 = 0xffff; } uVar4 = (uint)uVar7; uVar2 = *(uint *)(param_1 + 10); if (uVar4 <= *(uint *)(param_1 + 10)) { uVar2 = uVar4; } uVar6 = *(int *)((long)param_1 + 0xac) - (int)param_1[0x13]; if ((uVar2 <= uVar6) || ((((uVar6 != 0 || (param_2 == 4)) && (param_2 != 0)) && ((*(int *)(*param_1 + 1) == 0 && (uVar6 <= uVar4)))))) { if (uVar6 <= uVar4) { uVar4 = uVar6; } if (((param_2 == 4) && (*(int *)(*param_1 + 1) == 0)) && (uVar4 == uVar6)) { local_14 = 1; } else { local_14 = 0; } _tr_stored_block(param_1,(long)param_1[0xc] + (long)param_1[0x13],uVar4,local_14); param_1[0x13] = (long *)((long)param_1[0x13] + (ulong)uVar4); flush_pending(*param_1); } if (local_14 == 0) { uVar3 = 0; } else { uVar3 = 2; } } else { uVar3 = 1; } } else { uVar3 = 3; } return uVar3; }
void crypto_sign_ed25519_ref_fe25519_freeze(crypto_sign_ed25519_ref_fe25519 *r) { int i; crypto_uint32 m = equal(r->v[31],127); for(i=30;i>0;i--) m &= equal(r->v[i],255); m &= ge(r->v[0],237); m = -m; r->v[31] -= m&127; for(i=30;i>0;i--) r->v[i] -= m&255; r->v[0] -= m&237; }
void crypto_sign_ed25519_ref_fe25519_freeze(unsigned int a0[32]) { unsigned int v0[32]; unsigned int v1; unsigned int v2; unsigned long long v4; unsigned int v5[32]; *(&v0[0]) = a0; v2 = equal(a0[31], 0x7f); for (v1 = 30; v1 > 0; v1 = __addvsi3(v1, 0xffffffff, v4)) { v2 &= equal(a0[v1], 0xff); } v2 &= ge(a0[0], 0xed); v2 = -(v2); a0[31] = a0[31] - (v2 & 127); for (v1 = 30; v1 > 0; v1 = __addvsi3(v1, 0xffffffff, v1)) { a0[v1] = a0[v1] - v2; } v5 = a0; a0[0] = a0[0] - (v2 & 237); return; }
void * x2realloc (void *p, size_t *pn) { return x2nrealloc (p, pn, 1); }
void x2realloc(undefined8 param_1,undefined8 param_2) { x2nrealloc(param_1,param_2,1); return; }
static z_crc_t x2nmodp(n, k) off64_t n; unsigned k; { z_crc_t p; p = (z_crc_t)1 << 31; while (n) { if (n & 1) p = multmodp(x2n_table[k & 31], p); n >>= 1; k++; } return p; }
undefined4 x2nmodp(ulong param_1,uint param_2) { uint local_24; ulong local_20; undefined4 local_c; local_c = 0x80000000; local_24 = param_2; for (local_20 = param_1; local_20 != 0; local_20 = (long)local_20 >> 1) { if ((local_20 & 1) != 0) { local_c = multmodp(*(undefined4 *)(x2n_table + (ulong)(local_24 & 0x1f) * 4),local_c); } local_24 = local_24 + 1; } return local_c; }
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); }
undefined8 rl_vi_yank_arg(int param_1,undefined4 param_2) { if (rl_explicit_arg == 0) { rl_yank_nth_arg(0x24,param_2); } else { rl_yank_nth_arg(param_1 + -1,param_2); } return 0; }
__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) { Int32 nb, na, mid; nb = 0; na = 256; do { mid = (nb + na) >> 1; if (indx >= cftab[mid]) nb = mid; else na = mid; } while (na - nb != 1); return nb; }
int BZ2_indexIntoF(unsigned long a0, unsigned int *a1) { unsigned int v0; unsigned int v1; unsigned int v2; v0 = 0; v1 = 0x100; do { v2 = v1 + v0 >> 1; if (a0 < a1[v2]) v1 = v2; else v0 = v2; } while (v1 - v0 != 1); return v0; }
static void check_writable_dir(struct file *f) { char *tmpname; int tmpfd; tmpname = str_fmt("%s%s", f->name, ".dpkg-divert.tmp"); tmpfd = creat(tmpname, 0600); if (tmpfd < 0) ohshite(gettext("error checking '%s'"), f->name); close(tmpfd); (void)unlink(tmpname); free(tmpname); }
void check_writable_dir(unsigned long long *a0) { unsigned int v0; void* v1; unsigned long long v3; v1 = str_fmt("%s%s", *(a0), ".dpkg-divert.tmp"); v0 = creat(v1, 0x180); if (v0 < 0) ohshite(gettext("error checking '%s'"), *(a0)); close(v0); unlink(v1); v3 = free(v1); return; }
static inline void next_item (uintmax_t *item_idx) { (*item_idx)++; if ((*item_idx) > current_rp->hi) current_rp++; }
void next_item(unsigned long long *a0) { unsigned long long v1; unsigned long long v2; *(a0) = *(a0) + 1; v1 = *((current_rp + 8)); if (*(a0) > *((current_rp + 8))) { v2 = current_rp + 16; current_rp = current_rp + 16; } return; }
static _Bool check_txsc_flags( _Bool es, _Bool scb, _Bool sci) { if (sci && (es || scb)) return 0 ; if (es && scb) return 0 ; return 1 ; }
int check_txsc_flags(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned int v1; if (!a2) { LABEL_4035df: if (a0 && a1) { v1 = 0; goto LABEL_4035f7; } v1 = 1; } else { if (!a0 && !a1) goto LABEL_4035df; v1 = 0; } LABEL_4035f7: return v1; }
static _Bool parse_regex (const struct parser_table* entry, char **argv, int *arg_ptr) { return insert_regex (argv, arg_ptr, entry, options.regex_options); }
long long parse_regex(unsigned long long a0, unsigned long long a1, unsigned long long a2) { return insert_regex(a1, a2, a0, g_500064); }
static char * default_format ( _Bool fs, _Bool terse, _Bool device) { char *format; if (fs) { if (terse) format = xstrdup (fmt_terse_fs); else { format = xstrdup (gettext (" File: \"%n\"\n" " ID: %-8i Namelen: %-7l Type: %T\n" "Block size: %-10s Fundamental block size: %S\n" "Blocks: Total: %-10b Free: %-10f Available: %a\n" "Inodes: Total: %-10c Free: %d\n") ); } } else { if (terse) { if (0 < is_selinux_enabled ()) format = xstrdup (fmt_terse_selinux); else format = xstrdup (fmt_terse_regular); } else { char *temp; format = xstrdup (gettext (" File: %N\n Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n") ); temp = format; if (device) { format = xasprintf ("%s%s", format, gettext ("" "Device: %Hd,%Ld\tInode: %-10i Links: %-5h Device type: %Hr,%Lr\n") ); } else { format = xasprintf ("%s%s", format, gettext ("" "Device: %Hd,%Ld\tInode: %-10i Links: %h\n") ); } free (temp); temp = format; format = xasprintf ("%s%s", format, gettext ("" "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n") ); free (temp); if (0 < is_selinux_enabled ()) { temp = format; format = xasprintf ("%s%s", format, gettext ("Context: %C\n")); free (temp); } temp = format; format = xasprintf ("%s%s", format, gettext ("Access: %x\n" "Modify: %y\n" "Change: %z\n" " Birth: %w\n") ); free (temp); } } return format; }
long default_format(char a1, char a2, char a3) { char *v3; char *v4; char *v5; char *v6; char *v7; char *v8; long v11; const char *v12; const char *v13; const char *v14; char *ptr; char *ptra; char *ptrb; char *ptrc; if ( a1 ) { if ( a2 ) { return xstrdup("%n %i %l %t %s %S %b %f %a %c %d\n"); } else { v3 = gettext( " File: \"%n\"\n" " ID: %-8i Namelen: %-7l Type: %T\n" "Block size: %-10s Fundamental block size: %S\n" "Blocks: Total: %-10b Free: %-10f Available: %a\n" "Inodes: Total: %-10c Free: %d\n"); return xstrdup(v3); } } else if ( a2 ) { if ( (int)is_selinux_enabled() <= 0 ) return xstrdup("%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o\n"); else return xstrdup("%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o %C\n"); } else { v4 = gettext(" File: %N\n Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n"); v12 = (const char *)xstrdup(v4); ptr = (char *)v12; if ( a3 ) v5 = gettext("Device: %Hd,%Ld\tInode: %-10i Links: %-5h Device type: %Hr,%Lr\n"); else v5 = gettext("Device: %Hd,%Ld\tInode: %-10i Links: %h\n"); v13 = (const char *)xasprintf("%s%s", v12, v5); free(ptr); ptra = (char *)v13; v6 = gettext("Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n"); v14 = (const char *)xasprintf("%s%s", v13, v6); free(ptra); if ( (int)is_selinux_enabled() > 0 ) { ptrb = (char *)v14; v7 = gettext("Context: %C\n"); v14 = (const char *)xasprintf("%s%s", v14, v7); free(ptrb); } ptrc = (char *)v14; v8 = gettext("Access: %x\nModify: %y\nChange: %z\n Birth: %w\n"); v11 = xasprintf("%s%s", v14, v8); free(ptrc); } return v11; }
static void print_heredoc_header (redirect) REDIRECT *redirect; { int kill_leading; char *x; kill_leading = redirect->instruction == r_deblank_reading_until; if (redirect->rflags & 0x01) cprintf ("{%s}", redirect->redirector.filename->word); else if (redirect->redirector.dest != 0) cprintf ("%d", redirect->redirector.dest); if (redirect->redirectee.filename->flags & (1 << 1)) { x = sh_single_quote (redirect->here_doc_eof); cprintf ("<<%s%s", kill_leading ? "-" : "", x); sh_xfree((x), "print_cmd.c", 1137); } else cprintf ("<<%s%s", kill_leading ? "-" : "", redirect->here_doc_eof); }
void print_heredoc_header(struct_0 *a0) { unsigned int v0; unsigned long long v1; unsigned long long v3; unsigned long long v4; v0 = a0->field_18 == 8; if ((a0->field_10 & 1)) { cprintf("{%s}"); } else if (a0->field_8) { cprintf("%d"); } if ((a0->field_20->field_8 & 2)) { v1 = sh_single_quote(a0->field_28); cprintf("<<%s%s"); v4 = sh_xfree(v1, "print_cmd.c", 0x471); return; } v3 = cprintf("<<%s%s"); return; }
int ssh_packet_get_connection_in(struct ssh *ssh) { return ssh->state->connection_in; }
long long ssh_packet_get_connection_in(unsigned int **a0) { return *(*(a0)); }
void usage(void) { fprintf( stderr , "Usage:\t shutdown [-akrhPHfFnc] [-t sec] time [warning message]\n" "\t\t -a: use /etc/shutdown.allow\n" "\t\t -k: don't really shutdown, only warn.\n" "\t\t -r: reboot after shutdown.\n" "\t\t -h: halt after shutdown.\n" "\t\t -P: halt action is to turn off power.\n" "\t\t can only be used along with -h flag.\n" "\t\t -H: halt action is to just halt.\n" "\t\t can only be used along with -h flag.\n" "\t\t -f: do a 'fast' reboot (skip fsck).\n" "\t\t -F: Force fsck on reboot.\n" "\t\t -n: do not go through \"init\" but go down real fast.\n" "\t\t -c: cancel a running shutdown.\n" "\t\t -q: quiet mode - display fewer shutdown warnings.\n" "\t\t -Q: full quiet mode - display only final shutdown warning.\n" "\t\t -t secs: delay between warning and kill signal.\n" "\t\t ** the \"time\" argument is mandatory! (try \"now\") **\n"); exit(1); }
void usage() { fprintf(stderr, "Usage:\t shutdown [-akrhPHfFnc] [-t sec] time [warning message]\n\t\t -a: use /etc/shutdown.allow\n\t\t -k: don\'t really shutdown, only warn.\n\t\t -r: reboot after shutdown.\n\t\t -h: halt after shutdown.\n\t\t -P: halt action is to turn off power.\n\t\t can only be used along with -h flag.\n\t\t -H: halt action is to just halt.\n\t\t can only be used along with -h flag.\n\t\t -f: do a \'fast\' reboot (skip fsck).\n\t\t -F: Force fsck on reboot.\n\t\t -n: do not go through \"init\" but go down real fast.\n\t\t -c: cancel a running shutdown.\n\t\t -q: quiet mode - display fewer shutdown warnings.\n\t\t -Q: full quiet mode - display only final shutdown warning.\n\t\t -t secs: delay between warning and kill signal.\n\t\t ** the \"time\" argument is mandatory! (try \"now\") **\n"); exit(0x1); }
!= saved_locale) { (void) setlocale ( 6 , "C"); } syslog (
char * setlocale(int __category,char *__locale) { halt_baddata(); }
int rl_set_timeout (unsigned int secs, unsigned int usecs) { timeout_duration.tv_sec = secs + usecs / 1000000; timeout_duration.tv_usec = usecs % 1000000; return 0; }
long long rl_set_timeout(unsigned long a0, unsigned long a1) { timeout_duration = a0 + (a1 * 1125899907 >> 50); g_401578 = a1 - (a1 * 1125899907 >> 50) * 1000000; return 0; }
static char * scanright( char *startp, char *rmesc, char *rmescend, char *str, int quotes, int zero ) { int esc = 0; char *loc; char *loc2; for (loc = str - 1, loc2 = rmescend; loc >= startp; loc2--) { int match; char c = *loc2; const char *s = loc2; if (zero) { *loc2 = '\0'; s = rmesc; } match = !fnmatch((str), (s), 0); *loc2 = c; if (match) return loc; loc--; if (quotes) { if (--esc < 0) { esc = esclen(startp, loc); } if (esc % 2) { esc--; loc--; } } } return 0; }
char * scanright(char *param_1,char *param_2,char *param_3,char *param_4,int param_5,int param_6) { char cVar1; char *pcVar2; int iVar3; uint local_28; char *local_20; char *local_18; char *local_10; local_28 = 0; local_20 = param_4 + -1; local_18 = param_3; while( true ) { if (local_20 < param_1) { return (char *)0x0; } cVar1 = *local_18; local_10 = local_18; if (param_6 != 0) { *local_18 = '\0'; local_10 = param_2; } iVar3 = fnmatch(param_4,local_10,0); *local_18 = cVar1; if (iVar3 == 0) break; pcVar2 = local_20 + -1; if (param_5 != 0) { local_28 = local_28 - 1; if ((int)local_28 < 0) { local_28 = esclen(param_1,pcVar2); } if ((local_28 & 1) != 0) { local_28 = local_28 - 1; pcVar2 = local_20 + -2; } } local_20 = pcVar2; local_18 = local_18 + -1; } return local_20; }
void trigproc_run_deferred(void) { jmp_buf ejbuf; debug(dbg_triggers, "trigproc_run_deferred"); while (!pkg_queue_is_empty(&deferred)) { struct pkginfo *pkg; pkg = pkg_queue_pop(&deferred); if (!pkg) continue; if ( _setjmp ( ejbuf ) ) { pop_error_context(ehflag_bombout); continue; } push_error_context_jump(&ejbuf, print_error_perpackage, pkg_name(pkg, pnaw_nonambig)); ensure_package_clientdata(pkg); pkg->clientdata->trigprocdeferred = ((void *)0) ; trigproc(pkg, TRIGPROC_TRY_DEFERRED); pop_error_context(ehflag_normaltidy); } }
void trigproc_run_deferred(void) { int iVar1; long lVar2; undefined8 uVar3; long in_FS_OFFSET; __jmp_buf_tag local_d8; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); debug(0x1000,"trigproc_run_deferred"); while (iVar1 = pkg_queue_is_empty(deferred), iVar1 == 0) { lVar2 = pkg_queue_pop(deferred); if (lVar2 != 0) { iVar1 = _setjmp(&local_d8); if (iVar1 == 0) { uVar3 = pkg_name(lVar2,1); push_error_context_jump(&local_d8,uRam00000000001001c6,uVar3); ensure_package_clientdata(lVar2); *(undefined8 *)(*(long *)(lVar2 + 0x138) + 0x18) = 0; trigproc(lVar2,0); pop_error_context(1); } else { pop_error_context(2); } } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static size_t get_format_specifer_length(char ch) { if (strchr ("abcdDfFgGhHiklmMnpPsStuUyYZ%", ch)) { return 1; } else if (strchr ("ABCT", ch)) { return 2; } else { return 0; } }
int get_format_specifer_length(unsigned long a0) { char v0; unsigned int v2; if (strchr("abcdDfFgGhHiklmMnpPsStuUyYZ%", a0)) { v2 = 1; return v2; } v2 = (!strchr("ABCT", v0) ? 2 : 0); return v2; }
void popstackmark(struct stackmark *mark) { struct stack_block *sp; ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); while (stackp != mark->stackp) { sp = stackp; stackp = sp->prev; free((pointer)(sp)); } stacknxt = mark->stacknxt; stacknleft = mark->stacknleft; sstrend = mark->stacknxt + mark->stacknleft; ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); }
long long popstackmark(unsigned long long a0[3]) { unsigned long long *v0; unsigned long long v2; suppressint = suppressint + 1; while (a0[0] != stackp) { v0 = stackp; stackp = *(v0); free(v0); } stacknxt = a0[1]; stacknleft = a0[2]; sstrend = a0[2] + a0[1]; suppressint = suppressint - 1; v2 = suppressint; if (!suppressint) { v2 = intpending; if (intpending) v2 = onint(); } return v2; }
void reset_completer_word_break_chars () { rl_completer_word_break_characters = perform_hostname_completion ? (char *)strcpy (sh_xmalloc((1 + strlen (bash_completer_word_break_characters)), "bashline.c", 369), (bash_completer_word_break_characters)) : (char *)strcpy (sh_xmalloc((1 + strlen (bash_nohostname_word_break_characters)), "bashline.c", 369), (bash_nohostname_word_break_characters)); }
long long reset_completer_word_break_chars() { unsigned long long v1; if (perform_hostname_completion) v1 = strcpy(sh_xmalloc(strlen(bash_completer_word_break_characters) + 1, "bashline.c", 0x171), bash_completer_word_break_characters); else v1 = strcpy(sh_xmalloc(strlen(bash_nohostname_word_break_characters) + 1, "bashline.c", 0x171), bash_nohostname_word_break_characters); rl_completer_word_break_characters = v1; return v1; }
static char * reason2txt(int reason) { switch (reason) { case 1: return "administratively prohibited"; case 2: return "connect failed"; case 3: return "unknown channel type"; case 4: return "resource shortage"; } return "unknown reason"; }
int reason2txt(unsigned long a0) { unsigned int v1; switch (a0) { case 4: v1 = &g_4127cc; return v1; case 3: v1 = &g_4127b7; return v1; case 1: v1 = &g_41278c; return v1; case 2: v1 = &g_4127a8; return v1; default: v1 = &g_4127de; return v1; } }
static _Bool parse_lname (const struct parser_table* entry, char **argv, int *arg_ptr) { const char *name; fnmatch_sanitycheck (); if (collect_arg (argv, arg_ptr, &name)) { struct predicate *our_pred = insert_primary (entry, name); our_pred->args.str = name; our_pred->est_success_rate = 0.1f * estimate_pattern_match_rate (name, 0); return 1 ; } return 0 ; }
long long parse_lname(unsigned long long a0, unsigned long long a1, unsigned long long a2) { char v0; struct_0 *v1; unsigned long long v3; unsigned int v4; fnmatch_sanitycheck(); if (!collect_arg(a1, a2, &v0)) { v3 = 0; return v3; } v1 = insert_primary(a0, *(&v0), *(&v0)); v1->field_38 = *(&v0); estimate_pattern_match_rate(*(&v0), 0x0); v1->field_24 = v4 * 4333543705447025869; v3 = 1; return v3; }
static unsigned decode_c() { unsigned j, mask; if (blocksize == 0) { blocksize = getbits(16); if (blocksize == 0) { return (255 + 256 + 2 - 3); } read_pt_len((16 + 3), 5, 3); read_c_len(); read_pt_len((13 + 1), 4, -1); } blocksize--; j = d_buf[bitbuf >> ((8 * 2 * sizeof(char)) - 12)]; if (j >= (255 + 256 + 2 - 3)) { mask = (unsigned) 1 << ((8 * 2 * sizeof(char)) - 1 - 12); do { if (bitbuf & mask) j = (prev+0x8000)[j]; else j = prev [j]; mask >>= 1; } while (j >= (255 + 256 + 2 - 3)); } fillbuf((int) outbuf[j]); return j; }
long decode_c() { long v1; unsigned int v2; unsigned int v3; if ( !blocksize ) { blocksize = getbits(16); if ( !blocksize ) return 510LL; read_pt_len(19, 5, 3); read_c_len(); read_pt_len(14, 4, -1); } --blocksize; v2 = (unsigned short)d_buf[(unsigned short)bitbuf >> 4]; if ( v2 > 0x1FD ) { v3 = 8; do { if ( ((unsigned short)v3 & (unsigned short)bitbuf) != 0 ) v1 = v2 + 0x8000LL; else v1 = v2; v2 = (unsigned short)prev[v1]; v3 >>= 1; } while ( v2 > 0x1FD ); } fillbuf(*((unsigned char *)&outbuf + v2)); return v2; }
static inline int ila_hook_name2type(char *name) { if (!strcmp(name, "output")) return ILA_HOOK_ROUTE_OUTPUT; else if (!strcmp(name, "input")) return ILA_HOOK_ROUTE_INPUT; else return -1; }
long ila_hook_name2type(const char *a1) { if ( !strcmp(a1, "output") ) return 0LL; if ( !strcmp(a1, "input") ) return 1LL; return 0xFFFFFFFFLL; }
void rl_set_keymap(Keymap k __attribute__((__unused__))) { }
void rl_set_keymap() { ; }
HASH_TABLE * hash_create (buckets) int buckets; { HASH_TABLE *new_table; register int i; new_table = (HASH_TABLE *)sh_xmalloc((sizeof (HASH_TABLE)), "hashlib.c", 68); if (buckets == 0) buckets = 128; new_table->bucket_array = (BUCKET_CONTENTS **)sh_xmalloc((buckets * sizeof (BUCKET_CONTENTS *)), "hashlib.c", 73); new_table->nbuckets = buckets; new_table->nentries = 0; for (i = 0; i < buckets; i++) new_table->bucket_array[i] = (BUCKET_CONTENTS *) ((void *)0) ; return (new_table); }
int hash_create(unsigned long a0) { unsigned int v0; struct_0 *v1; void* v3; v0 = a0; v1 = sh_xmalloc(0x10, "hashlib.c", 0x44); if (!v0) v0 = 128; v1->field_0 = sh_xmalloc(v0 * 8, "hashlib.c", 0x49); v1->field_8 = v0; v1->field_c = 0; for (v3 = 0; v3 < v0; v3 = v3 + 1) { *((&v1->field_0->field_0 + 0x8 * v3)) = 0; } return v1; }
char * ansiexpand (string, start, end, lenp) char *string; int start, end, *lenp; { char *temp, *t; int len, tlen; temp = (char *)sh_xmalloc((end - start + 1), "strtrans.c", 383); for (tlen = 0, len = start; len < end; ) temp[tlen++] = string[len++]; temp[tlen] = '\0'; if (*temp) { t = ansicstr (temp, tlen, 2, (int *) ((void *)0) , lenp); sh_xfree((temp), "strtrans.c", 391); return (t); } else { if (lenp) *lenp = 0; return (temp); } }
char * ansiexpand(long param_1,int param_2,int param_3,undefined4 *param_4) { char *pcVar1; char *pcVar2; int local_20; int local_1c; pcVar1 = (char *)sh_xmalloc((long)((param_3 - param_2) + 1),"strtrans.c",0x17f); local_1c = 0; local_20 = param_2; while (local_20 < param_3) { pcVar1[local_1c] = *(char *)(local_20 + param_1); local_20 = local_20 + 1; local_1c = local_1c + 1; } pcVar1[local_1c] = '\0'; if (*pcVar1 == '\0') { if (param_4 != (undefined4 *)0x0) { *param_4 = 0; } } else { pcVar2 = (char *)ansicstr(pcVar1,local_1c,2,0,param_4); sh_xfree(pcVar1,"strtrans.c",0x187); pcVar1 = pcVar2; } return pcVar1; }
static int to_blob(const struct sshkey *key, u_char **blobp, size_t *lenp, int force_plain, enum sshkey_serialize_rep opts) { int ret = -1; size_t len; struct sshbuf *b = ((void *)0) ; if (lenp != ((void *)0) ) *lenp = 0; if (blobp != ((void *)0) ) *blobp = ((void *)0) ; if ((b = sshbuf_new()) == ((void *)0) ) return -2; if ((ret = to_blob_buf(key, b, force_plain, opts)) != 0) goto out; len = sshbuf_len(b); if (lenp != ((void *)0) ) *lenp = len; if (blobp != ((void *)0) ) { if ((*blobp = malloc(len)) == ((void *)0) ) { ret = -2; goto out; } memcpy(*blobp, sshbuf_ptr(b), len); } ret = 0; out: sshbuf_free(b); return ret; }
long to_blob(long a1, void **a2, long *a3, int a4) { const void *v5; unsigned int v8; long v9; long size; if ( a3 ) *a3 = 0LL; if ( a2 ) *a2 = 0LL; v9 = sshbuf_new(a1); if ( !v9 ) return 4294967294LL; v8 = to_blob_buf(a1, v9, a4); if ( !v8 ) { size = sshbuf_len(v9); if ( a3 ) *a3 = size; if ( a2 ) { *a2 = malloc(size); if ( !*a2 ) { v8 = -2; goto LABEL_15; } v5 = (const void *)sshbuf_ptr(v9); memcpy(*a2, v5, size); } v8 = 0; } LABEL_15: sshbuf_free(v9); return v8; }
static void ck_fflush (FILE *f) { if (fflush_unlocked (f) != 0) perror_fatal (gettext ("write failed")); }
int ck_fflush(FILE *a1) { int result; char *v2; result = fflush_unlocked(a1); if ( result ) { v2 = gettext("write failed"); perror_fatal(v2); } return result; }
int strvis(char *mbdst, const char *mbsrc, int flags) { return istrsenvisxl(&mbdst, ((void *)0) , mbsrc, flags, "", ((void *)0) ); }
long long strvis(unsigned long a0, char *a1, unsigned long a2) { unsigned long v0; v0 = a0; return istrsenvisxl(&v0, NULL, a1, a2, &g_4018e8, 0x0); }
void pty_release(const char *tty) { }
long long pty_release(unsigned long a0) { unsigned long v0; unsigned long v2; v0 = a0; return v2; }
int sshkey_unshield_private(struct sshkey *k) { struct sshbuf *prvbuf = ((void *)0) ; u_char *cp, keyiv[64]; struct sshcipher_ctx *cctx = ((void *)0) ; const struct sshcipher *cipher; struct sshkey *kswap = ((void *)0) , tmp; int r = -1; if (!sshkey_is_shielded(k)) return 0; if ((cipher = cipher_by_name("aes256-ctr")) == ((void *)0) ) { r = -10; goto out; } if (cipher_keylen(cipher) + cipher_ivlen(cipher) > ssh_digest_bytes(4)) { r = -1; goto out; } if (k->shielded_len < cipher_blocksize(cipher) || (k->shielded_len % cipher_blocksize(cipher)) != 0) { r = -4; goto out; } if ((r = ssh_digest_memory(4, k->shield_prekey, k->shield_prekey_len, keyiv, 64)) != 0) goto out; if ((r = cipher_init(&cctx, cipher, keyiv, cipher_keylen(cipher), keyiv + cipher_keylen(cipher), cipher_ivlen(cipher), 0)) != 0) goto out; if ((prvbuf = sshbuf_new()) == ((void *)0) ) { r = -2; goto out; } if ((r = sshbuf_reserve(prvbuf, k->shielded_len, &cp)) != 0) goto out; if ((r = cipher_crypt(cctx, 0, cp, k->shielded_private, k->shielded_len, 0, 0)) != 0) goto out; if ((r = sshkey_private_deserialize(prvbuf, &kswap)) != 0) goto out; if ((r = private2_check_padding(prvbuf)) != 0) goto out; tmp = *kswap; *kswap = *k; *k = tmp; r = 0; out: cipher_free(cctx); explicit_bzero(keyiv, sizeof(keyiv)); explicit_bzero(&tmp, sizeof(tmp)); sshkey_free(kswap); sshbuf_free(prvbuf); return r; }
int sshkey_unshield_private(undefined8 *param_1) { int iVar1; int iVar2; uint uVar3; undefined4 uVar4; undefined4 uVar5; ulong uVar6; long in_FS_OFFSET; undefined8 uVar7; int local_144; undefined8 local_140; undefined8 local_138; undefined8 *local_130; long local_128; long local_120; undefined8 local_118; undefined8 local_110; undefined8 local_108; undefined8 local_100; undefined8 local_f8; undefined8 local_f0; undefined8 local_e8; undefined8 local_e0; undefined8 local_d8; undefined8 local_d0; undefined8 local_c8; undefined8 local_c0; undefined8 local_b8; undefined8 local_b0; undefined8 local_a8; undefined8 local_a0; undefined8 local_98; undefined8 local_90; undefined8 local_88; undefined8 local_80; undefined8 local_78; undefined local_68 [72]; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_128 = 0; local_138 = 0; local_130 = (undefined8 *)0x0; iVar1 = sshkey_is_shielded(param_1); if (iVar1 == 0) { local_144 = 0; } else { local_120 = cipher_by_name("aes256-ctr"); if (local_120 == 0) { local_144 = -10; } else { iVar1 = cipher_keylen(local_120); iVar2 = cipher_ivlen(local_120); uVar6 = ssh_digest_bytes(4); if (uVar6 < (uint)(iVar2 + iVar1)) { local_144 = -1; } else { uVar6 = param_1[0x12]; uVar3 = cipher_blocksize(local_120); if ((uVar6 < uVar3) || (uVar6 = param_1[0x12], uVar3 = cipher_blocksize(local_120), uVar6 % (ulong)uVar3 != 0)) { local_144 = -4; } else { local_144 = ssh_digest_memory(4,param_1[0x13],param_1[0x14],local_68,0x40); if (local_144 == 0) { uVar4 = cipher_ivlen(local_120); uVar3 = cipher_keylen(local_120); uVar7 = 0x104c7d; uVar5 = cipher_keylen(local_120); local_144 = cipher_init(&local_138,local_120,local_68,uVar5,local_68 + uVar3,uVar4,0, uVar7); if (local_144 == 0) { local_128 = sshbuf_new(); if (local_128 == 0) { local_144 = -2; } else { uVar7 = 0x104d08; local_144 = sshbuf_reserve(local_128,param_1[0x12],&local_140); if ((((local_144 == 0) && (local_144 = cipher_crypt(local_138,0,local_140,param_1[0x11], param_1[0x12] & 0xffffffff,0,0,uVar7), local_144 == 0 )) && (local_144 = sshkey_private_deserialize(local_128,&local_130), local_144 == 0)) && (local_144 = private2_check_padding(local_128), local_144 == 0)) { local_118 = *local_130; local_110 = local_130[1]; local_108 = local_130[2]; local_100 = local_130[3]; local_f8 = local_130[4]; local_f0 = local_130[5]; local_e8 = local_130[6]; local_e0 = local_130[7]; local_d8 = local_130[8]; local_d0 = local_130[9]; local_c8 = local_130[10]; local_c0 = local_130[0xb]; local_b8 = local_130[0xc]; local_b0 = local_130[0xd]; local_a8 = local_130[0xe]; local_a0 = local_130[0xf]; local_98 = local_130[0x10]; local_90 = local_130[0x11]; local_88 = local_130[0x12]; local_80 = local_130[0x13]; local_78 = local_130[0x14]; uVar7 = param_1[1]; *local_130 = *param_1; local_130[1] = uVar7; uVar7 = param_1[3]; local_130[2] = param_1[2]; local_130[3] = uVar7; uVar7 = param_1[5]; local_130[4] = param_1[4]; local_130[5] = uVar7; uVar7 = param_1[7]; local_130[6] = param_1[6]; local_130[7] = uVar7; uVar7 = param_1[9]; local_130[8] = param_1[8]; local_130[9] = uVar7; uVar7 = param_1[0xb]; local_130[10] = param_1[10]; local_130[0xb] = uVar7; uVar7 = param_1[0xd]; local_130[0xc] = param_1[0xc]; local_130[0xd] = uVar7; uVar7 = param_1[0xf]; local_130[0xe] = param_1[0xe]; local_130[0xf] = uVar7; uVar7 = param_1[0x11]; local_130[0x10] = param_1[0x10]; local_130[0x11] = uVar7; uVar7 = param_1[0x13]; local_130[0x12] = param_1[0x12]; local_130[0x13] = uVar7; local_130[0x14] = param_1[0x14]; *param_1 = local_118; param_1[1] = local_110; param_1[2] = local_108; param_1[3] = local_100; param_1[4] = local_f8; param_1[5] = local_f0; param_1[6] = local_e8; param_1[7] = local_e0; param_1[8] = local_d8; param_1[9] = local_d0; param_1[10] = local_c8; param_1[0xb] = local_c0; param_1[0xc] = local_b8; param_1[0xd] = local_b0; param_1[0xe] = local_a8; param_1[0xf] = local_a0; param_1[0x10] = local_98; param_1[0x11] = local_90; param_1[0x12] = local_88; param_1[0x13] = local_80; param_1[0x14] = local_78; local_144 = 0; } } } } } } } cipher_free(local_138); explicit_bzero(local_68,0x40); explicit_bzero(&local_118,0xa8); sshkey_free(local_130); sshbuf_free(local_128); } if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return local_144; } __stack_chk_fail(); }
static int node_trav(EditLine *el, keymacro_node_t *ptr, wchar_t *ch, keymacro_value_t *val) { if (ptr->ch == *ch) { if (ptr->next) { if (el_wgetc(el, ch) != 1) return 2; return node_trav(el, ptr->next, ch, val); } else { *val = ptr->val; if (ptr->type != 0) *ch = '\0'; return ptr->type; } } else { if (ptr->sibling) { return node_trav(el, ptr->sibling, ch, val); } else { val->str = ((void *)0) ; return 1; } } }
ulong node_trav(undefined8 param_1,int *param_2,int *param_3,undefined8 *param_4) { int iVar1; ulong uVar2; if (*param_2 == *param_3) { if (*(long *)(param_2 + 4) == 0) { *param_4 = *(undefined8 *)(param_2 + 2); if (param_2[1] != 0) { *param_3 = 0; } uVar2 = (ulong)(uint)param_2[1]; } else { iVar1 = el_wgetc(param_1,param_3); if (iVar1 == 1) { uVar2 = node_trav(param_1,*(undefined8 *)(param_2 + 4),param_3,param_4); } else { uVar2 = 2; } } } else if (*(long *)(param_2 + 6) == 0) { *param_4 = 0; uVar2 = 1; } else { uVar2 = node_trav(param_1,*(undefined8 *)(param_2 + 6),param_3,param_4); } return uVar2; }
static int ipnh_flush(unsigned int all) { int rc = -2; if (all) { filter.groups = 1; filter.ifindex = 0; filter.master = 0; } if (rtnl_open(&rth_del, 0) < 0) { fprintf( stderr , "Cannot open rtnetlink\n"); return 1 ; } again: if (rtnl_nexthopdump_req(&rth, preferred_family, nh_dump_filter) < 0) { perror("Cannot send dump request"); goto out; } if (rtnl_dump_filter_nc(&rth, flush_nexthop, stdout , 0) < 0) { fprintf( stderr , "Dump terminated. Failed to flush nexthops\n"); goto out; } if (all && filter.groups) { filter.groups = 0; goto again; } rc = 0; out: rtnl_close(&rth_del); if (!filter.flushed) printf("Nothing to flush\n"); else printf("Flushed %d nexthops\n", filter.flushed); return rc; }
void ipnh_flush(unsigned long a0) { unsigned int v0; unsigned long long v5; unsigned long long v6; v0 = -2; if (a0) { g_403a04 = 1; g_403a08 = 0; g_403a0c = 0; } if (rtnl_open(&rth_del, 0x0) < 0) { fprintf(*(&stderr), "Cannot open rtnetlink\n"); v5 = 1; } else { while (true) { if (rtnl_nexthopdump_req(0x500090, preferred_family, nh_dump_filter) < 0) { perror("Cannot send dump request"); break; } else if (rtnl_dump_filter_nc(0x500090, flush_nexthop, stdout, 0x0) < 0) { fprintf(*(&stderr), "Dump terminated. Failed to flush nexthops\n"); break; } else { if (a0 && g_403a04) { g_403a04 = 0; continue; } if (!g_403a04 || !a0) { v0 = 0; break; } } } rtnl_close(&rth_del); if (!filter) printf("Nothing to flush\n"); else printf("Flushed %d nexthops\n", filter); v6 = v0; } return; }
void pkcs8_info_int(gnutls_datum_t *data, unsigned format, unsigned ignore_err, FILE *out, const char *tab) { int ret; unsigned schema; unsigned cipher; unsigned char salt[32]; char hex[64+1]; unsigned salt_size = sizeof(salt); unsigned iter_count; gnutls_datum_t bin; size_t hex_size = sizeof(hex); const char *str; char *oid = ((void *)0) ; ret = gnutls_pkcs8_info(data, format, &schema, &cipher, salt, &salt_size, &iter_count, &oid); if (ret == -6) { fprintf(out, "PKCS #8 information:\n"); fprintf(out, "\tSchema: unsupported (%s)\n", oid); goto cleanup; } else if (ret == -50) { fprintf(out, "PKCS #8 information:\n"); fprintf(out, "\tSchema: unencrypted key\n"); goto cleanup; } if (ret < 0) { if (ignore_err) return; fprintf( stderr , "PKCS #8 read error: %s\n", gnutls_strerror(ret)); app_exit(1); } fprintf(out, "%sPKCS #8 information:\n", tab); fprintf(out, "%s\tCipher: %s\n", tab, gnutls_cipher_get_name(cipher)); str = gnutls_pkcs_schema_get_name(schema); if (str != ((void *)0) ) { fprintf(out, "%s\tSchema: %s (%s)\n", tab, str, gnutls_pkcs_schema_get_oid(schema)); } bin.data = salt; bin.size = salt_size; ret = gnutls_hex_encode(&bin, hex, &hex_size); if (ret < 0) { fprintf( stderr , "hex encode error: %s\n", gnutls_strerror(ret)); app_exit(1); } fprintf(out, "%s\tSalt: %s\n", tab, hex); fprintf(out, "%s\tSalt size: %u\n", tab, salt_size); fprintf(out, "%s\tIteration count: %u\n\n", tab, iter_count); cleanup: gnutls_free((void *) (oid)), oid= ((void *)0) ; }
void pkcs8_info_int(unsigned long long a0, unsigned long a1, unsigned long a2, void* a3, unsigned long long a4) { unsigned int v0; unsigned int v1; unsigned long long v2; char v3; char v4; unsigned int v5; char v6; unsigned int v7; unsigned long long v8; void* v9; unsigned long v10; unsigned long v11; unsigned int v12; char v13; char v14; char v15; unsigned long long *v18; unsigned long long v19; v2 = a0; v1 = a1; v0 = a2; v5 = 32; v8 = 65; v9 = 0; v7 = gnutls_pkcs8_info(v2, v1, &v3, &v4, &v13, &v5, &v6, &v9, a4, a3, *(&v0)); if (v7 == -6) { fprintf(a3, "PKCS #8 information:\n"); fprintf(a3, "\tSchema: unsupported (%s)\n", v9); } else if (v7 == -50) { fprintf(a3, "PKCS #8 information:\n"); fprintf(a3, "\tSchema: unencrypted key\n"); } else if (v7 >= 0) { fprintf(a3, "%sPKCS #8 information:\n", a4); fprintf(a3, "%s\tCipher: %s\n", a4, gnutls_cipher_get_name(*(&v4))); v10 = gnutls_pkcs_schema_get_name(*(&v3)); if (v10) fprintf(a3, "%s\tSchema: %s (%s)\n", a4, v10, gnutls_pkcs_schema_get_oid(*(&v3))); v11 = &v13; v12 = v5; v7 = gnutls_hex_encode(&v11, &v14, &v8, &v14); if (v7 < 0) { fprintf(*(&stderr), "hex encode error: %s\n", gnutls_strerror(v7)); app_exit(0x1); } fprintf(a3, "%s\tSalt: %s\n", a4, &v14); fprintf(a3, "%s\tSalt size: %u\n", a4, v5); fprintf(a3, "%s\tIteration count: %u\n\n", a4, *(&v6)); } else { if (!v0) { fprintf(*(&stderr), "PKCS #8 read error: %s\n", gnutls_strerror(v7)); app_exit(0x1); } goto LABEL_4096e9; } *(5243720)(v9); v9 = 0; LABEL_4096e9: v19 = *(&v15) ^ v18[5]; return; }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note() { unsigned long long v1; v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout); return; }
DH * dh_new_group(BIGNUM *gen, BIGNUM *modulus) { DH *dh; if ((dh = DH_new()) == ((void *)0) ) return ((void *)0) ; if (!DH_set0_pqg(dh, modulus, ((void *)0) , gen)) { DH_free(dh); return ((void *)0) ; } return dh; }
void dh_new_group(unsigned long long a0, unsigned long long a1) { unsigned long long v0; void* v3; unsigned long long v4; void* v5; *(&v0) = DH_new(); if (!v0) { v3 = 0; return; } else if (!DH_set0_pqg(v0, a1, 0x0, a0)) { DH_free(v0); v5 = 0; return; } else { v4 = v0; return; } }
static int readline_internal_charloop (void) { int eof = 1; while (rl_done == 0) eof = readline_internal_char (); return (eof); }
long long readline_internal_charloop(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; v0 = 1; while (false) { v0 = readline_internal_char(a0, a1, a2, a3, a4, a5); } return v0; }
test_code_t test_tls1_2(gnutls_session_t session) { int ret; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":+VERS-TLS1.2:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%s", rest); { int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1123)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); ret = test_do_handshake(session); if (ret == TEST_SUCCEED) tls1_2_ok = 1; return ret; }
int test_tls1_2(undefined8 param_1) { int iVar1; sprintf(prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:+VERS-TLS1.2:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%s" ,rest); iVar1 = __gnutls_priority_set_direct(param_1,prio_str,0x463); if (iVar1 == 0) { gnutls_credentials_set(param_1,1,xcred); iVar1 = test_do_handshake(param_1); if (iVar1 == 0) { tls1_2_ok = 1; } } return iVar1; }
ct_encode_char(char *dst, size_t len, wchar_t c) { ssize_t l = 0; if (len < ct_enc_width(c)) return -1; l = wctomb(dst, c); if (l < 0) { wctomb( ((void *)0) , L'\0'); l = 0; } return l; }
int ct_encode_char(char *a0, unsigned long a1, unsigned long a2) { void* v0; unsigned int v2; v0 = 0; v2 = ct_enc_width(a2); if (a1 < v2) { v2 = -1; } else { v0 = wctomb(a0, a2); if ((v0 - 0 >> 63)) { wctomb(NULL, 0x0); v0 = 0; } v2 = v0; } return v2; }
static IF_COM * copy_if_command (com) IF_COM *com; { IF_COM *new_if; new_if = (IF_COM *)sh_xmalloc((sizeof (IF_COM)), "copy_cmd.c", 282); new_if->flags = com->flags; new_if->test = copy_command (com->test); new_if->true_case = copy_command (com->true_case); new_if->false_case = com->false_case ? copy_command (com->false_case) : com->false_case; return (new_if); }
undefined4 * copy_if_command(undefined4 *param_1) { undefined4 *puVar1; undefined8 uVar2; puVar1 = (undefined4 *)sh_xmalloc(0x20,"copy_cmd.c",0x11a); *puVar1 = *param_1; uVar2 = copy_command(*(undefined8 *)(param_1 + 2)); *(undefined8 *)(puVar1 + 2) = uVar2; uVar2 = copy_command(*(undefined8 *)(param_1 + 4)); *(undefined8 *)(puVar1 + 4) = uVar2; if (*(long *)(param_1 + 6) == 0) { uVar2 = *(undefined8 *)(param_1 + 6); } else { uVar2 = copy_command(*(undefined8 *)(param_1 + 6)); } *(undefined8 *)(puVar1 + 6) = uVar2; return puVar1; }
void gid_to_gname (gid_t gid, char **gname) { struct group *group; if (gid != 0 && gid == cached_no_such_gid) { *gname = xstrdup (""); return; } if (!cached_gname || gid != cached_gid) { group = getgrgid (gid); if (group) { cached_gid = gid; assign_string (&cached_gname, group->gr_name); } else { cached_no_such_gid = gid; *gname = xstrdup (""); return; } } *gname = xstrdup (cached_gname); }
long long gid_to_gname(unsigned long a0, unsigned long long *a1) { unsigned long long *v0; unsigned long long *v2; if (a0 && a0 == cached_no_such_gid) { v2 = a1; *(a1) = xstrdup(&g_404344); return v2; } if (!cached_gname || a0 != cached_gid) { v0 = &getgrgid(a0)->gr_name; if (!v0) { cached_no_such_gid = a0; v2 = a1; *(a1) = xstrdup(&g_404344); return v2; } cached_gid = a0; assign_string(&cached_gname, *(v0)); } v2 = a1; *(a1) = xstrdup(cached_gname); return v2; }
int do_iptunnel(int argc, char **argv) { int i; for (i = 0; i < argc - 1; i++) { if (strcmp(argv[i], "mode") == 0) { if (tunnel_mode_is_ipv6(argv[i + 1])) preferred_family = 10 ; break; } } switch (preferred_family) { case 0 : preferred_family = 2 ; break; case 2 : break; case 10 : return do_ip6tunnel(argc, argv); default: fprintf( stderr , "Unsupported protocol family: %d\n", preferred_family); exit(-1); } if (argc > 0) { if (matches(*argv, "add") == 0) return do_add(( 0x89F0 + 1), argc - 1, argv + 1); if (matches(*argv, "change") == 0) return do_add(( 0x89F0 + 3), argc - 1, argv + 1); if (matches(*argv, "delete") == 0) return do_del(argc - 1, argv + 1); if (matches(*argv, "show") == 0 || matches(*argv, "lst") == 0 || matches(*argv, "list") == 0) return do_show(argc - 1, argv + 1); if (matches(*argv, "prl") == 0) return do_prl(argc - 1, argv + 1); if (matches(*argv, "6rd") == 0) return do_6rd(argc - 1, argv + 1); if (matches(*argv, "help") == 0) usage(); } else return do_show(0, ((void *)0) ); fprintf( stderr , "Command \"%s\" is unknown, try \"ip tunnel help\"\n", *argv); exit(-1); }
long do_iptunnel(unsigned int a1, const char **a2) { signed int i; for ( i = 0; i < (int)(a1 - 1); ++i ) { if ( !strcmp(a2[i], "mode") ) { if ( (unsigned int)tunnel_mode_is_ipv6(a2[i + 1]) ) preferred_family = 10; break; } } if ( preferred_family == 10 ) return do_ip6tunnel(a1, a2); if ( preferred_family > 10 ) goto LABEL_14; if ( preferred_family ) { if ( preferred_family != 2 ) { LABEL_14: fprintf(stderr, "Unsupported protocol family: %d\n", preferred_family); exit(-1); } } else { preferred_family = 2; } if ( (int)a1 <= 0 ) return do_show(0, 0LL); if ( (unsigned char)matches(*a2, "add") != 1 ) return do_add(35313, a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "change") != 1 ) return do_add(35315, a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "delete") != 1 ) return do_del(a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "show") != 1 || (unsigned char)matches(*a2, "lst") != 1 || (unsigned char)matches(*a2, "list") != 1 ) { return do_show(a1 - 1, a2 + 1); } if ( (unsigned char)matches(*a2, "prl") != 1 ) return do_prl(a1 - 1, a2 + 1); if ( (unsigned char)matches(*a2, "6rd") == 1 ) { if ( (unsigned char)matches(*a2, "help") != 1 ) usage(); fprintf(stderr, "Command \"%s\" is unknown, try \"ip tunnel help\"\n", *a2); exit(-1); } return do_6rd(a1 - 1, a2 + 1); }
) { fprintf( stderr , "%s: Input file %s is a directory.\n", progName,inName); setExit(1); return; }
int fprintf(FILE *__stream,char *__format,...) { halt_baddata(); }
int check_binary_file (sample, sample_len) const char *sample; int sample_len; { register int i; unsigned char c; if (sample_len >= 4 && sample[0] == 0x7f && sample[1] == 'E' && sample[2] == 'L' && sample[3] == 'F') return 1; if (sample[0] == '#' && sample[1] == '!') return (memchr (sample, '\0', sample_len) != ((void *)0) ); for (i = 0; i < sample_len; i++) { c = sample[i]; if (c == '\n') return (0); if (c == '\0') return (1); } return (0); }
_BOOL8 check_binary_file(_BYTE *a1, int a2) { int i; char v4; if ( a2 > 3 && *a1 == 127 && a1[1] == 69 && a1[2] == 76 && a1[3] == 70 ) return 1LL; if ( *a1 == 35 && a1[1] == 33 ) return memchr(a1, 0, a2) != 0LL; for ( i = 0; i < a2; ++i ) { v4 = a1[i]; if ( v4 == 10 ) return 0LL; if ( !v4 ) return 1LL; } return 0LL; }
static void alloc_string(struct string *s, int len) { s->s = malloc(len); s->len = len; s->end = 0; }
void alloc_string(void **param_1,int param_2) { void *pvVar1; pvVar1 = malloc((long)param_2); *param_1 = pvVar1; *(int *)(param_1 + 1) = param_2; *(undefined4 *)((long)param_1 + 0xc) = 0; return; }
static int open_listen_match_streamlocal(struct permission *allowed_open, const char *requestedpath) { if (allowed_open->host_to_connect == ((void *)0) ) return 0; if (allowed_open->listen_port != -2) return 0; if (allowed_open->listen_path == ((void *)0) || strcmp(allowed_open->listen_path, requestedpath) != 0) return 0; return 1; }
undefined8 open_listen_match_streamlocal(long *param_1,char *param_2) { int iVar1; if ((((*param_1 != 0) && (*(int *)(param_1 + 4) == -2)) && (param_1[3] != 0)) && (iVar1 = strcmp((char *)param_1[3],param_2), iVar1 == 0)) { return 1; } return 0; }
static void set_program_path (char const *arg) { if (strchr (arg, '/')) { program_path = dir_name (arg); } else { char *path = xreadlink ("/proc/self/exe"); if (path) program_path = dir_name (path); else if ((path = getenv ("PATH"))) { char *dir; path = xstrdup (path); for (dir = strtok (path, ":"); dir != ((void *)0) ; dir = strtok ( ((void *)0) , ":")) { char *candidate = file_name_concat (dir, arg, ((void *)0) ); if (access (candidate, 1 ) == 0) { program_path = dir_name (candidate); free (candidate); break; } free (candidate); } } free (path); } }
void set_program_path(char *a0) { void* v0; unsigned long long v1; void* v2; unsigned long long v5; if (strchr(a0, 0x2f)) { *(&program_path) = dir_name(a0); } else { v0 = xreadlink("/proc/self/exe"); if (v0) { program_path = dir_name(v0); } else { v0 = getenv("PATH"); if (v0) { v0 = xstrdup(v0); v1 = strtok(v0, ":"); while (true) { if (!v1) break; v2 = file_name_concat(v1, a0, 0x0, a0); if (access(v2, 0x1)) { free(v2); v1 = strtok(NULL, ":"); } else { program_path = dir_name(v2); free(v2); break; } } } } v5 = free(v0); } return; }
int do_statvfs(struct sftp_conn *conn, const char *path, struct sftp_statvfs *st, int quiet) { struct sshbuf *msg; u_int id; int r; if ((conn->exts & 0x00000002) == 0) { sshlog("sftp-client.c", __func__, 1426, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Server does not support statvfs@openssh.com extension"); return -1; } sshlog("sftp-client.c", __func__, 1430, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "Sending SSH2_FXP_EXTENDED(statvfs@openssh.com) \"%s\"", path); id = conn->msg_id++; if ((msg = sshbuf_new()) == ((void *)0) ) sshfatal("sftp-client.c", __func__, 1435, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); if ((r = sshbuf_put_u8(msg, 200)) != 0 || (r = sshbuf_put_u32(msg, id)) != 0 || (r = sshbuf_put_cstring(msg, "statvfs@openssh.com")) != 0 || (r = sshbuf_put_cstring(msg, path)) != 0) sshfatal("sftp-client.c", __func__, 1440, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose"); send_msg(conn, msg); sshbuf_free(msg); return get_decode_statvfs(conn, st, id, quiet); }
undefined8 do_statvfs(long param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4) { undefined4 uVar1; undefined8 uVar2; char **ppcVar3; undefined *puVar4; char *apcStack96 [5]; undefined auStack56 [4]; undefined4 local_34; undefined8 local_30; undefined8 local_28; long local_20; int local_18; int local_14; long local_10; local_34 = param_4; local_30 = param_3; local_28 = param_2; local_20 = param_1; if ((*(uint *)(param_1 + 0x1c) & 2) == 0) { apcStack96[3] = "Server does not support statvfs@openssh.com extension"; sshlog("sftp-client.c","do_statvfs",0x592,0,2,0); return 0xffffffff; } apcStack96[3] = "Sending SSH2_FXP_EXTENDED(statvfs@openssh.com) \"%s\""; apcStack96[4] = (char *)param_2; sshlog("sftp-client.c","do_statvfs",0x596,0,6,0); ppcVar3 = (char **)auStack56; local_14 = *(int *)(local_20 + 0x18); *(int *)(local_20 + 0x18) = local_14 + 1; apcStack96[4] = (char *)0x10558e; local_10 = sshbuf_new(); if (local_10 == 0) { ppcVar3 = apcStack96 + 3; apcStack96[3] = "sshbuf_new failed"; sshfatal("sftp-client.c","do_statvfs",0x59b,1,1,0); } *(undefined8 *)((long)ppcVar3 + -8) = 0x1055e4; local_18 = sshbuf_put_u8(local_10,200); if (local_18 == 0) { *(undefined8 *)((long)ppcVar3 + -8) = 0x1055fe; local_18 = sshbuf_put_u32(local_10,local_14); if (local_18 == 0) { *(undefined8 *)((long)ppcVar3 + -8) = 0x10561a; local_18 = sshbuf_put_cstring(local_10,"statvfs@openssh.com"); if (local_18 == 0) { *(undefined8 *)((long)ppcVar3 + -8) = 0x105636; local_18 = sshbuf_put_cstring(local_10,local_28); puVar4 = (undefined *)ppcVar3; if (local_18 == 0) goto LAB_00105680; } } } *(undefined8 *)((long)ppcVar3 + -8) = 0x105649; uVar2 = ssh_err(local_18); puVar4 = (undefined *)((long)ppcVar3 + -0x10); *(char **)((long)ppcVar3 + -0x10) = "compose"; *(undefined8 *)((long)ppcVar3 + -0x18) = 0x105680; sshfatal("sftp-client.c","do_statvfs",0x5a0,1,1,uVar2); LAB_00105680: *(undefined8 *)(puVar4 + -8) = 0x105693; send_msg(local_20,local_10); *(undefined8 *)(puVar4 + -8) = 0x10569f; sshbuf_free(local_10); uVar1 = local_34; *(undefined8 *)(puVar4 + -8) = 0x1056b5; uVar2 = get_decode_statvfs(local_20,local_30,local_14,uVar1); return uVar2; }
static void print_link_stats(FILE *fp, struct nlmsghdr *n) { struct ifinfomsg *ifi = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); struct rtattr *tb[(__IFLA_MAX - 1)+1]; parse_rtattr(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(ifi)) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))), n->nlmsg_len - ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); __print_link_stats(fp, tb); print_nl(); }
unsigned long print_link_stats(FILE *a1, _DWORD *a2) { char v3[488]; unsigned long v4; v4 = __readfsqword(0x28u); parse_rtattr(v3, 60LL, a2 + 8, (unsigned int)(*a2 - 32)); _print_link_stats(a1, (long)v3); print_nl(a1); return __readfsqword(0x28u) ^ v4; }
tty_get_signal_character(EditLine *el, int sig) { tcflag_t *ed = tty__get_flag(&el->el_tty.t_ed, 0); if ((*ed & 0001000 ) == 0) return -1; switch (sig) { case 2 : return el->el_tty.t_c[1][ 0 ]; case 3 : return el->el_tty.t_c[1][ 1 ]; case 20 : return el->el_tty.t_c[1][ 10 ]; default: return -1; } }
long long tty_get_signal_character(char a0[484], unsigned long a1) { unsigned int *v0; unsigned long long v2; v0 = tty__get_flag(&a0[1 + 160], 0x0); if (!(*(v0) & 0x200)) { v2 = 4294967295; } else if (a1 != 20) { if (a1 <= 20) { if (a1 == 2) v2 = a0[473]; if (a1 == 3) v2 = a0[474]; } if (a1 > 20 || a1 != 3 && a1 != 2) v2 = 4294967295; } else { v2 = a0[483]; } return v2; }
int rl_vi_first_print (int count, int key) { return (rl_vi_back_to_indent (1, key)); }
long long rl_vi_first_print(unsigned long a0, unsigned long a1) { unsigned int v0; v0 = a0; return rl_vi_back_to_indent(0x1, a1); }
static inline __u8 rta_getattr_u8(const struct rtattr *rta) { return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u8(struct_0 *a0) { return a0->field_4; }
void print_num(FILE *fp, unsigned int width, uint64_t count) { const char *prefix = "kMGTPE"; const unsigned int base = use_iec ? 1024 : 1000; uint64_t powi = 1; uint16_t powj = 1; uint8_t precision = 2; char buf[64]; if (!human_readable || count < base) { fprintf(fp, "%*" "l" "u" " ", width, count); return; } for (;;) { powi *= base; if (count / base < powi) break; if (!prefix[1]) break; ++prefix; } for (; precision > 0; precision--) { powj *= 10; if (count / powi < powj) break; } snprintf(buf, sizeof(buf), "%.*f%c%s", precision, (double) count / powi, *prefix, use_iec ? "i" : ""); fprintf(fp, "%*s ", width, buf); }
void print_num(FILE *param_1,uint param_2,ulong param_3) { uint uVar1; undefined *puVar2; long in_FS_OFFSET; double dVar3; double dVar4; byte local_6f; ushort local_6e; char *local_68; ulong local_60; undefined local_58 [72]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_68 = "kMGTPE"; if (use_iec == 0) { uVar1 = 1000; } else { uVar1 = 0x400; } local_60 = 1; local_6e = 1; local_6f = 2; if ((human_readable == 0) || (param_3 < uVar1)) { fprintf(param_1,"%*lu ",(ulong)param_2,param_3); } else { for (; (local_60 = uVar1 * local_60, local_60 <= param_3 / uVar1 && (local_68[1] != '\0')); local_68 = local_68 + 1) { } while ((local_6f != 0 && (local_6e = local_6e * 10, (ulong)local_6e <= param_3 / local_60))) { local_6f = local_6f - 1; } if (use_iec == 0) { puVar2 = &DAT_00108ca2; } else { puVar2 = &DAT_00108f49; } if ((long)param_3 < 0) { dVar3 = (double)(param_3 >> 1 | (ulong)((uint)param_3 & 1)); dVar3 = dVar3 + dVar3; } else { dVar3 = (double)param_3; } if ((long)local_60 < 0) { dVar4 = (double)(local_60 >> 1) + (double)(local_60 >> 1); } else { dVar4 = (double)local_60; } snprintf((char *)(dVar3 / dVar4),(size_t)local_58,(char *)0x40,"%.*f%c%s",(ulong)local_6f, (ulong)(uint)(int)*local_68,puVar2); fprintf(param_1,"%*s ",(ulong)param_2,local_58); } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
static int export_environment_candidate (var) SHELL_VAR *var; { return (((((var)->attributes) & (0x0000001))) && (((((var)->attributes) & (0x0001000))) == 0 || ((((var)->attributes) & (0x0008000))))); }
long long export_environment_candidate(struct_0 *a0) { unsigned long long v1; if ((a0->field_28 & 1)) { if (!(a0->field_28 & 0x1000)) { LABEL_407b42: v1 = 1; goto LABEL_407b4e; } else if (!(!(a0->field_28 & 0x8000))) { goto LABEL_407b42; } } v1 = 0; LABEL_407b4e: return v1; }
int main (int argc, char **argv) { static char const unknown[] = "unknown"; unsigned int toprint = 0; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("coreutils", "/usr/local/share/locale"); textdomain ("coreutils"); atexit (close_stdout); toprint = decode_switches (argc, argv); if (toprint == 0) toprint = 1; if (toprint & (1 | 2 | 4 | 8 | 16)) { struct utsname name; if (uname (&name) == -1) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"cannot get system name\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , gettext ("cannot get system name")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , gettext ("cannot get system name")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (toprint & 1) print_element_env (name.sysname, "UNAME_SYSNAME"); if (toprint & 2) print_element_env (name.nodename, "UNAME_NODENAME"); if (toprint & 4) print_element_env (name.release, "UNAME_RELEASE"); if (toprint & 8) print_element_env (name.version, "UNAME_VERSION"); if (toprint & 16) print_element_env (name.machine, "UNAME_MACHINE"); } if (toprint & 32) { char const *element = unknown; if (! (toprint == (0x7fffffff * 2U + 1U) && element == unknown)) print_element (element); } if (toprint & 64) { char const *element = unknown; if (! (toprint == (0x7fffffff * 2U + 1U) && element == unknown)) print_element (element); } if (toprint & 128) print_element ("GNU/Linux"); putchar_unlocked ('\n'); return 0 ; }
undefined8 main(undefined4 param_1,undefined8 *param_2) { int iVar1; undefined8 uVar2; int *piVar3; long in_FS_OFFSET; uint local_1bc; utsname local_1a8; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); set_program_name(*param_2); setlocale(6,""); bindtextdomain("coreutils","/usr/local/share/locale"); textdomain("coreutils"); atexit(p_Ram0000000000100746); local_1bc = decode_switches(param_1,param_2); if (local_1bc == 0) { local_1bc = 1; } if ((local_1bc & 0x1f) != 0) { iVar1 = uname(&local_1a8); if (iVar1 == -1) { uVar2 = gettext("cannot get system name"); piVar3 = __errno_location(); error(1,*piVar3,uVar2); } if ((local_1bc & 1) != 0) { print_element_env(&local_1a8,"UNAME_SYSNAME"); } if ((local_1bc & 2) != 0) { print_element_env(local_1a8.nodename,"UNAME_NODENAME"); } if ((local_1bc & 4) != 0) { print_element_env(local_1a8.release,"UNAME_RELEASE"); } if ((local_1bc & 8) != 0) { print_element_env(local_1a8.version,"UNAME_VERSION"); } if ((local_1bc & 0x10) != 0) { print_element_env(local_1a8.machine,"UNAME_MACHINE"); } } if (((local_1bc & 0x20) != 0) && (local_1bc != 0xffffffff)) { print_element("unknown"); } if (((local_1bc & 0x40) != 0) && (local_1bc != 0xffffffff)) { print_element("unknown"); } if ((local_1bc & 0x80) != 0) { print_element("GNU/Linux"); } putchar_unlocked(10); if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return 0; }
int debug_stat (const char *file, struct stat *bufp) { ++stat_count; fprintf ( stderr , "debug_stat (%s)\n", file); switch (options.symlink_handling) { case SYMLINK_ALWAYS_DEREF: return optionl_stat (file, bufp); case SYMLINK_DEREF_ARGSONLY: return optionh_stat (file, bufp); case SYMLINK_NEVER_DEREF: return optionp_stat (file, bufp); } ((void) sizeof (( 0 ) ? 1 : 0), __extension__ ({ if ( 0 ) ; else __assert_fail ( "0" , "util.c", 677, __extension__ __PRETTY_FUNCTION__); })) ; return -1; }
int debug_stat(const char *a1, struct stat *a2) { unsigned int v2; ++stat_count; fprintf(stderr, "debug_stat (%s)\n", a1); v2 = options[18]; if ( v2 == 2 ) return optionh_stat(a1, a2); if ( v2 > 2 ) _assert_fail("0", "util.c", 0x2A5u, "debug_stat"); if ( v2 ) return optionl_stat(a1, a2); else return optionp_stat(a1, a2); }
static size_t lf_refill (struct line_filter *lf) { size_t s = ck_fread (lf->buffer, ((size_t) 65536), lf->infile); lf->bufpos = lf->buffer; lf->buflim = lf->buffer + s; lf->buflim[0] = '\n'; checksigs (); return s; }
int lf_refill(struct_0 *a0) { unsigned long v0; v0 = ck_fread(a0->field_10, 0x10000, a0->field_0); a0->field_8 = a0->field_10; a0->field_18 = a0->field_10 + v0; a0->field_18->field_0 = 10; checksigs(); return v0; }
terminal_set(EditLine *el, const char *term) { int i; char buf[((size_t)2048)]; char *area; const struct termcapstr *t; sigset_t oset, nset; int lins, cols; (void) sigemptyset(&nset); (void) sigaddset(&nset, 28 ); (void) sigprocmask( 0 , &nset, &oset); area = buf; if (term == ((void *)0) ) term = getenv("TERM"); if (!term || !term[0]) term = "dumb"; if (strcmp(term, "emacs") == 0) el->el_flags |= 0x004; (void) memset(el->el_terminal.t_cap, 0, ((size_t)2048)); i = tgetent(el->el_terminal.t_cap, term); if (i <= 0) { if (i == -1) (void) fprintf(el->el_errfile, "Cannot read termcap database;\n"); else if (i == 0) (void) fprintf(el->el_errfile, "No entry for terminal type \"%s\";\n", term); (void) fprintf(el->el_errfile, "using dumb terminal settings.\n"); el->el_terminal.t_val[3] = 80; el->el_terminal.t_val[1] = el->el_terminal.t_val[4] = el->el_terminal.t_val[2] = 0; el->el_terminal.t_val[5] = el->el_terminal.t_val[7]; for (t = tstr; t->name != ((void *)0) ; t++) terminal_alloc(el, t, ((void *)0) ); } else { el->el_terminal.t_val[0] = tgetflag("am"); el->el_terminal.t_val[6] = tgetflag("xn"); el->el_terminal.t_val[1] = tgetflag("pt"); el->el_terminal.t_val[5] = tgetflag("xt"); el->el_terminal.t_val[4] = tgetflag("km"); el->el_terminal.t_val[7] = tgetflag("MT"); el->el_terminal.t_val[3] = tgetnum("co"); el->el_terminal.t_val[2] = tgetnum("li"); for (t = tstr; t->name != ((void *)0) ; t++) { terminal_alloc(el, t, tgetstr(strchr(t->name, *t->name), &area)); } } if (el->el_terminal.t_val[3] < 2) el->el_terminal.t_val[3] = 80; if (el->el_terminal.t_val[2] < 1) el->el_terminal.t_val[2] = 24; el->el_terminal.t_size.v = el->el_terminal.t_val[3]; el->el_terminal.t_size.h = el->el_terminal.t_val[2]; terminal_setflags(el); (void) terminal_get_size(el, &lins, &cols); if (terminal_change_size(el, lins, cols) == -1) return -1; (void) sigprocmask( 2 , &oset, ((void *)0) ); terminal_bind_arrow(el); el->el_terminal.t_name = term; return i <= 0 ? -1 : 0; }
void terminal_set(struct_0 *a0, char *a1) { unsigned long long v0; int tmp_47; int tmp_12; struct_2 *v1; char v2; char v3; unsigned int v4; unsigned long v5; unsigned long long v6; char v7; char v8; char v9; unsigned long long v12; unsigned long long v14; unsigned long long v15; void* v16; v1 = &a0->padding_0; v0 = a1; sigemptyset(&v8); sigaddset(&v8, 0x1c); sigprocmask(0x0, &v8, &v7); v5 = &v9; if (!v0) v0 = getenv("TERM"); if (!v0 || !*(v0)) v0 = "dumb"; if (!strcmp(v0, "emacs")) a0->field_2c = a0->field_2c | 4; memset(a0->field_c0, 0x0, 0x800); v4 = tgetent(a0->field_c0, v0, v0); if (v4 <= 0) { if (v4 == -1) { fprintf(a0->field_18, "Cannot read termcap database;\n"); } else if (!v4) { fprintf(a0->field_18, "No entry for terminal type \"%s\";\n", v0); } fprintf(a0->field_18, "using dumb terminal settings.\n"); a0->field_b8->field_c = 80; tmp_47 = &a0->field_b8->field_8; a0->field_b8->field_8 = 0; tmp_12 = &a0->field_b8->field_10; a0->field_b8->field_10 = *(tmp_47); a0->field_b8->field_4 = *(tmp_12); a0->field_b8->field_14 = a0->field_b8->field_1c; for (v6 = &tstr; *(v6); v6 += 16) { terminal_alloc(a0, v6, 0x0); } } else { a0->field_b8->field_0 = tgetflag("am"); a0->field_b8->field_18 = tgetflag("xn"); a0->field_b8->field_4 = tgetflag("pt"); a0->field_b8->field_14 = tgetflag("xt"); a0->field_b8->field_10 = tgetflag("km"); a0->field_b8->field_1c = tgetflag("MT"); a0->field_b8->field_c = tgetnum("co"); a0->field_b8->field_8 = tgetnum("li"); for (v6 = &tstr; *(v6); v6 += 16) { v12 = strchr(*(v6), *(*(v6))); terminal_alloc(a0, v6, tgetstr(v12, &v5, v12)); } } if (a0->field_b8->field_c <= 1) a0->field_b8->field_c = 80; if (a0->field_b8->field_8 <= 0) a0->field_b8->field_8 = 24; a0->field_94 = a0->field_b8->field_c; a0->field_90 = a0->field_b8->field_8; terminal_setflags(a0); terminal_get_size(a0, &v2, &v3); if (terminal_change_size(a0, *(&v2), *(&v3)) == -1) { v14 = 4294967295; } else { sigprocmask(0x2, &v7, NULL); terminal_bind_arrow(a0); a0->field_88 = v0; if (v4 <= 0) v15 = 4294967295; else v16 = 0; } return; }
static int iptoken_list(int argc, char **argv) { int af = 10 ; struct rtnl_dump_args da = { .fp = stdout }; while (argc > 0) { if (strcmp(*argv, "dev") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if ((da.ifindex = ll_name_to_index(*argv)) == 0) invarg("dev is invalid\n", *argv); break; } argc--; argv++; } if (rtnl_linkdump_req(&rth, af) < 0) { perror("Cannot send dump request"); return -1; } new_json_obj(json); if (rtnl_dump_filter_nc(&rth, print_token, &da, 0) < 0) { delete_json_obj(); fprintf( stderr , "Dump terminated\n"); return -1; } delete_json_obj(); return 0; }
undefined8 iptoken_list(int param_1,char **param_2) { uint uVar1; int iVar2; undefined8 uVar3; long in_FS_OFFSET; char **local_48; int local_3c; undefined8 local_28; ulong local_20; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_20 = 0; local_28 = stdout; local_48 = param_2; for (local_3c = param_1; 0 < local_3c; local_3c = local_3c + -1) { iVar2 = strcmp(*local_48,"dev"); if (iVar2 == 0) { local_48 = local_48 + 1; local_3c = local_3c + -1; if (local_3c < 1) { incomplete_command(); } uVar1 = ll_name_to_index(*local_48); local_20 = local_20 & 0xffffffff00000000 | (ulong)uVar1; if (uVar1 != 0) break; invarg("dev is invalid\n",*local_48); } local_48 = local_48 + 1; } iVar2 = rtnl_linkdump_req(&rth,10); if (iVar2 < 0) { perror("Cannot send dump request"); uVar3 = 0xffffffff; } else { new_json_obj(json); iVar2 = rtnl_dump_filter_nc(&rth,print_token,&local_28,0); if (iVar2 < 0) { delete_json_obj(); fprintf(stderr,"Dump terminated\n"); uVar3 = 0xffffffff; } else { delete_json_obj(); uVar3 = 0; } } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar3; } __stack_chk_fail(); }
COMMAND * make_group_command (command) COMMAND *command; { GROUP_COM *temp; temp = (GROUP_COM *)sh_xmalloc((sizeof (GROUP_COM)), "make_cmd.c", 348); temp->command = command; return (make_command (cm_group, (SIMPLE_COM *)temp)); }
long long make_group_command(unsigned long a0) { struct_0 *v0; v0 = sh_xmalloc(0x10, "make_cmd.c", 0x15c); v0->field_8 = a0; return make_command(0x9, v0); }
static int gotdata(char *buf, size_t len) { char any_set = 0; size_t i; for (i = 0; i < len; ++i) any_set |= buf[i]; if (any_set == 0) return (-1); return (0); }
int gotdata(void* a0, unsigned long a1) { char v0; void* v1; unsigned int v3; v0 = 0; for (v1 = 0; v1 < a1; v1 += 1) { v0 |= *((v1 + a0)); } if (!v0) v3 = -1; else v3 = 0; return v3; }
int rl_get_previous_history (int count, int key) { HIST_ENTRY *old_temp, *temp; int had_saved_line; if (count < 0) return (rl_get_next_history (-count, key)); if (count == 0 || history_list () == 0) return 0; if (_rl_history_saved_point == -1 && (rl_point || rl_end)) _rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point; had_saved_line = _rl_saved_line_for_history != 0; rl_maybe_save_line (); rl_maybe_replace_line (); temp = old_temp = (HIST_ENTRY *) ((void *)0) ; while (count) { temp = previous_history (); if (temp == 0) break; old_temp = temp; --count; } if (!temp && old_temp) temp = old_temp; if (temp == 0) { if (had_saved_line == 0) _rl_free_saved_history_line (); rl_ding (); } else { rl_replace_from_history (temp, 0); _rl_history_set_point (); } return 0; }
void rl_get_previous_history(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; void* v2; void* v3; unsigned long long v5; unsigned int v6; void* v7; void* v8; v0 = a0; if (v0 < 0) { v5 = rl_get_next_history(-(v0), a1); } else { if (v0) { v6 = history_list(); if (v6) { if (_rl_history_saved_point == -1 && (rl_point || rl_end)) { if (rl_point != rl_end) v6 = rl_point; else v6 = -1; _rl_history_saved_point = v6; } v1 = _rl_saved_line_for_history; rl_maybe_save_line(); rl_maybe_replace_line(); v2 = 0; for (v3 = v2; v0; v0 -= 1) { v3 = previous_history(); if (!v3) break; v2 = v3; } if (!v3 && v2) v3 = v2; if (!v3) { if (!v1) _rl_free_saved_history_line(); rl_ding(); } else { rl_replace_from_history(v3, 0x0); _rl_history_set_point(); } v8 = 0; } } if (!v0 || !v6) v7 = 0; } return; }
int do_ipaddr(int argc, char **argv) { if (argc < 1) return ipaddr_list_flush_or_save(0, ((void *)0) , IPADD_LIST); if (matches(*argv, "add") == 0) return ipaddr_modify(RTM_NEWADDR, 0x400|0x200, argc-1, argv+1); if (matches(*argv, "change") == 0 || strcmp(*argv, "chg") == 0) return ipaddr_modify(RTM_NEWADDR, 0x100, argc-1, argv+1); if (matches(*argv, "replace") == 0) return ipaddr_modify(RTM_NEWADDR, 0x400|0x100, argc-1, argv+1); if (matches(*argv, "delete") == 0) return ipaddr_modify(RTM_DELADDR, 0, argc-1, argv+1); if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0 || matches(*argv, "lst") == 0) return ipaddr_list_flush_or_save(argc-1, argv+1, IPADD_LIST); if (matches(*argv, "flush") == 0) return ipaddr_list_flush_or_save(argc-1, argv+1, IPADD_FLUSH); if (matches(*argv, "save") == 0) return ipaddr_list_flush_or_save(argc-1, argv+1, IPADD_SAVE); if (matches(*argv, "showdump") == 0) return ipaddr_showdump(); if (matches(*argv, "restore") == 0) return ipaddr_restore(); if (matches(*argv, "help") == 0) usage(); fprintf( stderr , "Command \"%s\" is unknown, try \"ip address help\".\n", *argv); exit(-1); }
void do_ipaddr(int param_1,char **param_2) { char cVar1; int iVar2; if (param_1 < 1) { ipaddr_list_flush_or_save(0,0,0); } else { cVar1 = matches(*param_2,&DAT_00109d82); if (cVar1 == '\x01') { cVar1 = matches(*param_2,"change"); if ((cVar1 == '\x01') && (iVar2 = strcmp(*param_2,"chg"), iVar2 != 0)) { cVar1 = matches(*param_2,"replace"); if (cVar1 != '\x01') { ipaddr_modify(0x14,0x500,param_1 + -1,param_2 + 1); return; } cVar1 = matches(*param_2,"delete"); if (cVar1 != '\x01') { ipaddr_modify(0x15,0,param_1 + -1,param_2 + 1); return; } cVar1 = matches(*param_2,&DAT_00109da0); if (((cVar1 != '\x01') || (cVar1 = matches(*param_2,&DAT_00109da5), cVar1 != '\x01')) || (cVar1 = matches(*param_2,&DAT_00109daa), cVar1 != '\x01')) { ipaddr_list_flush_or_save(param_1 + -1,param_2 + 1,0); return; } cVar1 = matches(*param_2,"flush"); if (cVar1 != '\x01') { ipaddr_list_flush_or_save(param_1 + -1,param_2 + 1,1); return; } cVar1 = matches(*param_2,&DAT_00109db4); if (cVar1 != '\x01') { ipaddr_list_flush_or_save(param_1 + -1,param_2 + 1,2); return; } cVar1 = matches(*param_2,"showdump"); if (cVar1 != '\x01') { ipaddr_showdump(); return; } cVar1 = matches(*param_2,"restore"); if (cVar1 != '\x01') { ipaddr_restore(); return; } cVar1 = matches(*param_2,&DAT_00109a0c); if (cVar1 != '\x01') { usage(); } fprintf(stderr,"Command \"%s\" is unknown, try \"ip address help\".\n",*param_2); exit(-1); } ipaddr_modify(0x14,0x100,param_1 + -1,param_2 + 1); } else { ipaddr_modify(0x14,0x600,param_1 + -1,param_2 + 1); } } return; }
inline void flush_eltstate (array_eltstate_t *estatep) { if (estatep) do { if (estatep->key) sh_xfree((estatep->key), "arrayfunc.c", 337); } while (0); }
long long flush_eltstate(struct_0 *a0) { unsigned long long v1; if (a0) { v1 = a0->field_10; if (a0->field_10) v1 = sh_xfree(a0->field_10, "arrayfunc.c", 0x151); } return v1; }
static inline void hlist_del(struct hlist_node *n) { struct hlist_node *next = n->next; struct hlist_node **pprev = n->pprev; *pprev = next; if (next) next->pprev = pprev; }
_QWORD * hlist_del(_QWORD *a1) { _QWORD *result; _QWORD *v2; _QWORD *v3; v2 = (_QWORD *)*a1; v3 = (_QWORD *)a1[1]; result = v3; *v3 = *a1; if ( v2 ) { result = v2; v2[1] = v3; } return result; }
static intmax_t do_binop(int op, intmax_t a, intmax_t b) { switch (op) { default: case 13: case 22: if (!b) yyerror("division by zero"); return op == 13 ? a % b : a / b; case 17: return a * b; case 18: return a + b; case 20: return a - b; case 15: return a << b; case 16: return a >> b; case 10: return a < b; case 8: return a <= b; case 11: return a > b; case 9: return a >= b; case 12: return a == b; case 23: return a != b; case 14: return a & b; case 21: return a ^ b; case 19: return a | b; } }
int do_binop(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned int v1; switch (a0) { case 8: v1 = a1 <= a2; break; case 9: v1 = a2 <= a1; break; case 10: v1 = a1 < a2; break; case 11: v1 = a2 < a1; break; case 12: v1 = a1 == a2; break; case 14: v1 = a1 & a2; break; case 15: if ((a2 & 63)) v1 = a1 << (a2 & 63); else v1 = a1 << (a2 & 63); break; case 16: if ((a2 & 63)) v1 = a1 >> (a2 & 63); else v1 = a1 >> (a2 & 63); break; case 17: v1 = a2 * a1; break; case 18: v1 = a2 + a1; break; case 19: v1 = a1 | a2; break; case 20: v1 = a1 - a2; break; case 21: v1 = a1 ^ a2; break; case 23: v1 = a1 != a2; break; default: if (!a2) { yyerror("division by zero"); } else if (a0 == 13) { v1 = (a1 >> 63 CONCAT a1) /m a2 >> 64; break; } else { v1 = (a1 >> 63 CONCAT a1) /m a2; break; } } return v1; }
char * filename_completion_function (const char *s, int i) { return rl_filename_completion_function (s, i); }
long long filename_completion_function(unsigned long long a0, unsigned long a1) { return rl_filename_completion_function(a0, a1, a1); }