input
stringlengths
28
169k
output
stringlengths
20
317k
static void mainSimpleSort ( UInt32* ptr, UChar* block, UInt16* quadrant, Int32 nblock, Int32 lo, Int32 hi, Int32 d, Int32* budget ) { Int32 i, j, h, bigN, hp; UInt32 v; bigN = hi - lo + 1; if (bigN < 2) return; hp = 0; while (incs[hp] < bigN) hp++; hp--; for (; hp >= 0; hp--) { h = incs[hp]; i = lo + h; while (((Bool)1)) { if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; if (*budget < 0) return; } } }
void mainSimpleSort(unsigned int *a0, char *a1, unsigned short *a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned int v6, unsigned int *a6) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; unsigned long long v11; unsigned long long v12; v7 = a5 - a4 + 1; v3 = a5 - a4 + 1; if (v3 <= 1) return; v2 = 0; while (true) { v8 = incs[v2]; if (v3 <= incs[v2]) break; v2 += 1; } for (v2 -= 1; v2 >= 0; v2 -= 1) { v4 = incs[v2]; v0 = v4 + a4; while (true) { v9 = v0; if (v0 > a5) break; v5 = a0[v0]; v1 = v0; do { } while (mainGtU(a0[v1 + -1 * v4] + v6, v6 + v5, a1, a2, a3, a6) && (a0[v1] = a0[v1 + -1 * v4], v1 -= v4, v1 >= v4 + a4)); a0[v1] = v5; v0 += 1; v10 = v0; if (v0 > a5) break; v5 = a0[v0]; v1 = v0; do { } while (mainGtU(a0[v1 + -1 * v4] + v6, v6 + v5, a1, a2, a3, a6) && (a0[v1] = a0[v1 + -1 * v4], v1 -= v4, v1 >= v4 + a4)); a0[v1] = v5; v0 += 1; v11 = v0; if (v0 > a5) break; v5 = a0[v0]; v1 = v0; do { } while (mainGtU(a0[v1 + -1 * v4] + v6, v6 + v5, a1, a2, a3, a6) && (a0[v1] = a0[v1 + -1 * v4], v1 -= v4, v1 >= v4 + a4)); a0[v1] = v5; v0 += 1; v12 = *(a6); if (*(a6) < 0) return; } } return; }
static void close_files (void) { if (gr_close () == 0) { fprintf ( stderr , gettext ("%s: failure while writing changes to %s\n"), Prog, gr_dbname ()); exit (1); } add_cleanup (log_gpasswd_success_group, ((void *)0) ); del_cleanup (log_gpasswd_failure_group); cleanup_unlock_group ( ((void *)0) ); del_cleanup (cleanup_unlock_group); if (is_shadowgrp) { if (sgr_close () == 0) { fprintf ( stderr , gettext ("%s: failure while writing changes to %s\n"), Prog, sgr_dbname ()); exit (1); } del_cleanup (log_gpasswd_failure_gshadow); cleanup_unlock_gshadow ( ((void *)0) ); del_cleanup (cleanup_unlock_gshadow); } log_gpasswd_success_system ( ((void *)0) ); del_cleanup (log_gpasswd_success_group); }
long close_files() { long v0; long v1; char *v2; long v3; long v4; char *v5; if ( !(unsigned int)gr_close() ) { v0 = gr_dbname(); v1 = Prog; v2 = gettext("%s: failure while writing changes to %s\n"); fprintf(stderr, v2, v1, v0); exit(1); } add_cleanup(log_gpasswd_success_group, 0LL); del_cleanup(log_gpasswd_failure_group); cleanup_unlock_group(0LL); del_cleanup(&cleanup_unlock_group); if ( is_shadowgrp ) { if ( !(unsigned int)sgr_close() ) { v3 = sgr_dbname(); v4 = Prog; v5 = gettext("%s: failure while writing changes to %s\n"); fprintf(stderr, v5, v4, v3); exit(1); } del_cleanup(log_gpasswd_failure_gshadow); cleanup_unlock_gshadow(0LL); del_cleanup(&cleanup_unlock_gshadow); } log_gpasswd_success_system(); return del_cleanup(log_gpasswd_success_group); }
static void free_out_dir(struct out_dir *outdir) { free(outdir->buf); free(outdir->hashes); outdir->max = 0; outdir->num =0; }
long free_out_dir(long a1) { long result; free(*(void **)(a1 + 8)); free(*(void **)(a1 + 16)); *(_DWORD *)(a1 + 4) = 0; result = a1; *(_DWORD *)a1 = 0; return result; }
void history_end(History *h) { HistEvent ev; if (h->h_next == history_def_next) history_def_clear(h->h_ref, &ev); free(h->h_ref); free(h); }
void history_end(void **param_1) { long in_FS_OFFSET; undefined local_28 [24]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if ((code *)param_1[3] == history_def_next) { history_def_clear(*param_1,local_28); } free(*param_1); free(param_1); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
char * hpdelim2(char **cp, char *delim) { char *s, *old; if (cp == ((void *)0) || *cp == ((void *)0) ) return ((void *)0) ; old = s = *cp; if (*s == '[') { if ((s = strchr(s, ']')) == ((void *)0) ) return ((void *)0) ; else s++; } else if ((s = strpbrk(s, ":/")) == ((void *)0) ) s = *cp + strlen(*cp); switch (*s) { case '\0': *cp = ((void *)0) ; break; case ':': case '/': if (delim != ((void *)0) ) *delim = *s; *s = '\0'; *cp = s + 1; break; default: return ((void *)0) ; } return old; }
char * hpdelim2(char **a1, char *a2) { int v3; char *s; char *sa; const char *sb; char *v7; if ( !a1 || !*a1 ) return 0LL; s = *a1; v7 = *a1; if ( **a1 == 91 ) { sa = strchr(s, 93); if ( !sa ) return 0LL; sb = sa + 1; } else { sb = strpbrk(s, ":/"); if ( !sb ) sb = &(*a1)[strlen(*a1)]; } v3 = *sb; if ( v3 == 58 ) { LABEL_16: if ( a2 ) *a2 = *sb; *sb = 0; *a1 = (char *)(sb + 1); return v7; } if ( v3 > 58 ) return 0LL; if ( *sb ) { if ( v3 != 47 ) return 0LL; goto LABEL_16; } *a1 = 0LL; return v7; }
static void check_inode_bitmaps(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; ext2_ino_t i; unsigned int free_inodes = 0; int group_free = 0; int dirs_count = 0; dgrp_t group = 0; unsigned int inodes = 0; ext2_ino_t *free_array; ext2_ino_t *dir_array; int actual, bitmap; errcode_t retval; struct problem_context pctx; problem_t problem, save_problem; int fixit, had_problem; int csum_flag; int skip_group = 0; int redo_flag = 0; ext2_ino_t first_free = fs->super->s_inodes_per_group + 1; clear_problem_context(&pctx); free_array = (ext2_ino_t *) e2fsck_allocate_memory(ctx, fs->group_desc_count * sizeof(ext2_ino_t), "free inode count array"); dir_array = (ext2_ino_t *) e2fsck_allocate_memory(ctx, fs->group_desc_count * sizeof(ext2_ino_t), "directory count array"); if ((1 < ext2fs_get_inode_bitmap_start2(ctx->inode_used_map)) || (fs->super->s_inodes_count > ext2fs_get_inode_bitmap_end2(ctx->inode_used_map))) { pctx.num = 3; pctx.blk = 1; pctx.blk2 = fs->super->s_inodes_count; pctx.ino = ext2fs_get_inode_bitmap_start2(ctx->inode_used_map); pctx.ino2 = ext2fs_get_inode_bitmap_end2(ctx->inode_used_map); fix_problem(ctx, 0x050010, &pctx); ctx->flags |= 0x0001; goto errout; } if ((1 < ext2fs_get_inode_bitmap_start2(fs->inode_map)) || (fs->super->s_inodes_count > ext2fs_get_inode_bitmap_end2(fs->inode_map))) { pctx.num = 4; pctx.blk = 1; pctx.blk2 = fs->super->s_inodes_count; pctx.ino = ext2fs_get_inode_bitmap_start2(fs->inode_map); pctx.ino2 = ext2fs_get_inode_bitmap_end2(fs->inode_map); fix_problem(ctx, 0x050010, &pctx); ctx->flags |= 0x0001; goto errout; } csum_flag = ext2fs_has_group_desc_csum(fs); redo_counts: had_problem = 0; save_problem = 0; pctx.ino = pctx.ino2 = 0; if (csum_flag && (ext2fs_bg_flags_test(fs, group, 0x0001))) skip_group++; for (i = 1; i <= fs->super->s_inodes_count && i > 0; i++) { bitmap = 0; if (skip_group && i % fs->super->s_inodes_per_group == 1) { if (ext2fs_test_inode_bitmap_range( ctx->inode_used_map, i, fs->super->s_inodes_per_group)) { first_free = 1; inodes = fs->super->s_inodes_per_group - 1; group_free = inodes; free_inodes += inodes; i += inodes; skip_group = 0; goto do_counts; } } actual = ext2fs_fast_test_inode_bitmap2(ctx->inode_used_map, i); if (redo_flag) bitmap = actual; else if (!skip_group) bitmap = ext2fs_fast_test_inode_bitmap2(fs->inode_map, i); if (!actual == !bitmap) goto do_counts; if (!actual && bitmap) { problem = 0x050008; } else { problem = 0x050009; if (skip_group) { struct problem_context pctx2; pctx2.blk = i; pctx2.group = group; if (fix_problem(ctx, 0x050019,&pctx2)){ ext2fs_bg_flags_clear(fs, group, 0x0001); skip_group = 0; } } } if (pctx.ino == 0) { pctx.ino = pctx.ino2 = i; save_problem = problem; } else { if ((problem == save_problem) && (pctx.ino2 == i-1)) pctx.ino2++; else { print_bitmap_problem(ctx, save_problem, &pctx); pctx.ino = pctx.ino2 = i; save_problem = problem; } } ctx->flags |= 0x0040; had_problem++; ctx->options &= ~0x2000; do_counts: inodes++; if (bitmap) { if (ext2fs_test_inode_bitmap2(ctx->inode_dir_map, i)) dirs_count++; if (inodes > first_free) { e2fsck_discard_inodes(ctx, group, first_free, inodes - first_free); first_free = fs->super->s_inodes_per_group + 1; } } else { group_free++; free_inodes++; if (first_free > inodes) first_free = inodes; } if ((inodes == fs->super->s_inodes_per_group) || (i == fs->super->s_inodes_count)) { if (!bitmap && inodes >= first_free) e2fsck_discard_inodes(ctx, group, first_free, inodes - first_free + 1); if ((ctx->options & 0x2000) && (fs->io->flags & 0x02) && !(ext2fs_bg_flags_test(fs, group, 0x0004))) { ext2fs_bg_flags_set(fs, group, 0x0004); ext2fs_group_desc_csum_set(fs, group); } first_free = fs->super->s_inodes_per_group + 1; free_array[group] = group_free; dir_array[group] = dirs_count; group ++; inodes = 0; skip_group = 0; group_free = 0; dirs_count = 0; if (ctx->progress) if ((ctx->progress)(ctx, 5, group + fs->group_desc_count, fs->group_desc_count*2)) goto errout; if (csum_flag && (i != fs->super->s_inodes_count) && (ext2fs_bg_flags_test(fs, group, 0x0001) )) skip_group++; } } if (pctx.ino) print_bitmap_problem(ctx, save_problem, &pctx); if (had_problem) fixit = end_problem_latch(ctx, 0x0030); else fixit = -1; ctx->flags &= ~0x0040; if (fixit == 1) { ext2fs_free_inode_bitmap(fs->inode_map); retval = ext2fs_copy_bitmap(ctx->inode_used_map, &fs->inode_map); if (retval) { clear_problem_context(&pctx); fix_problem(ctx, 0x050012, &pctx); ctx->flags |= 0x0001; goto errout; } ext2fs_set_bitmap_padding(fs->inode_map); ext2fs_mark_ib_dirty(fs); inodes = 0; free_inodes = 0; group_free = 0; dirs_count = 0; group = 0; memset(free_array, 0, fs->group_desc_count * sizeof(int)); memset(dir_array, 0, fs->group_desc_count * sizeof(int)); redo_flag++; goto redo_counts; } else if (fixit == 0) ext2fs_unmark_valid(fs); for (i = 0; i < fs->group_desc_count; i++) { if (free_array[i] != ext2fs_bg_free_inodes_count(fs, i)) { pctx.group = i; pctx.ino = ext2fs_bg_free_inodes_count(fs, i); pctx.ino2 = free_array[i]; if (fix_problem(ctx, 0x05000B, &pctx)) { ext2fs_bg_free_inodes_count_set(fs, i, free_array[i]); ext2fs_mark_super_dirty(fs); } else ext2fs_unmark_valid(fs); } if (dir_array[i] != ext2fs_bg_used_dirs_count(fs, i)) { pctx.group = i; pctx.ino = ext2fs_bg_used_dirs_count(fs, i); pctx.ino2 = dir_array[i]; if (fix_problem(ctx, 0x05000C, &pctx)) { ext2fs_bg_used_dirs_count_set(fs, i, dir_array[i]); ext2fs_mark_super_dirty(fs); } else ext2fs_unmark_valid(fs); } } if (free_inodes != fs->super->s_free_inodes_count) { pctx.group = -1; pctx.ino = fs->super->s_free_inodes_count; pctx.ino2 = free_inodes; if (fix_problem(ctx, 0x05000D, &pctx)) { fs->super->s_free_inodes_count = free_inodes; ext2fs_mark_super_dirty(fs); } } errout: ext2fs_free_mem(&free_array); ext2fs_free_mem(&dir_array); }
unsigned long check_inode_bitmaps(long a1) { unsigned int v1; unsigned int v2; int v3; int v4; int v5; unsigned int i; unsigned int j; int v9; unsigned int v10; int v11; unsigned int v12; unsigned int v13; int v14; int v15; unsigned int v16; int v17; int v18; int v19; int v20; unsigned int v21; _BOOL4 has_group_desc_csum; int v23; void *s; void *memory; long v26; char v28[8]; unsigned int inode_bitmap_start2; unsigned int inode_bitmap_end2; long v31; long v32; unsigned int v33; long v34; char v35[40]; long v36; unsigned int v37; unsigned long v38; v38 = __readfsqword(0x28u); v26 = *(_QWORD *)a1; v9 = 0; v10 = 0; v11 = 0; v12 = 0; v13 = 0; v19 = 0; v20 = 0; v21 = *(_DWORD *)(*(_QWORD *)(v26 + 32) + 40LL) + 1; clear_problem_context(v28); s = (void *)e2fsck_allocate_memory(a1, 4LL * *(unsigned int *)(v26 + 48), "free inode count array"); memory = (void *)e2fsck_allocate_memory(a1, 4LL * *(unsigned int *)(v26 + 48), "directory count array"); if ( (unsigned int)ext2fs_get_inode_bitmap_start2(*(_QWORD *)(a1 + 360)) <= 1 && (v1 = **(_DWORD **)(v26 + 32), v1 <= (unsigned int)ext2fs_get_inode_bitmap_end2(*(_QWORD *)(a1 + 360))) ) { if ( (unsigned int)ext2fs_get_inode_bitmap_start2(*(_QWORD *)(v26 + 80)) <= 1 && (v2 = **(_DWORD **)(v26 + 32), v2 <= (unsigned int)ext2fs_get_inode_bitmap_end2(*(_QWORD *)(v26 + 80))) ) { has_group_desc_csum = ext2fs_has_group_desc_csum(v26); while ( 1 ) { v18 = 0; v16 = 0; inode_bitmap_end2 = 0; inode_bitmap_start2 = 0; if ( has_group_desc_csum && (unsigned int)ext2fs_bg_flags_test(v26, 0LL, 1LL) ) ++v19; for ( i = 1; i <= **(_DWORD **)(v26 + 32) && i; ++i ) { v14 = 0; if ( v19 && i % *(_DWORD *)(*(_QWORD *)(v26 + 32) + 40LL) == 1 && (unsigned int)ext2fs_test_inode_bitmap_range( *(_QWORD *)(a1 + 360), i, *(unsigned int *)(*(_QWORD *)(v26 + 32) + 40LL)) ) { v21 = 1; v13 = *(_DWORD *)(*(_QWORD *)(v26 + 32) + 40LL) - 1; v10 = v13; v9 += v13; i += v13; v19 = 0; } else { v23 = ext2fs_fast_test_inode_bitmap2(*(_QWORD *)(a1 + 360), i); if ( v20 ) { v14 = v23; } else if ( !v19 ) { v14 = ext2fs_fast_test_inode_bitmap2(*(_QWORD *)(v26 + 80), i); } if ( (v23 != 0) == (v14 == 0) ) { if ( v23 || !v14 ) { v15 = 327689; if ( v19 ) { v36 = i; v37 = v12; if ( (unsigned int)fix_problem(a1, 327705LL, v35) ) { ext2fs_bg_flags_clear(v26, v12, 1LL); v19 = 0; } } } else { v15 = 327688; } if ( inode_bitmap_start2 ) { if ( v15 == v16 && inode_bitmap_end2 == i - 1 ) { ++inode_bitmap_end2; } else { print_bitmap_problem(a1, v16, (long)v28); inode_bitmap_end2 = i; inode_bitmap_start2 = i; v16 = v15; } } else { inode_bitmap_end2 = i; inode_bitmap_start2 = i; v16 = v15; } *(_DWORD *)(a1 + 72) |= 0x40u; ++v18; v3 = *(_DWORD *)(a1 + 76); BYTE1(v3) &= ~0x20u; *(_DWORD *)(a1 + 76) = v3; } } ++v13; if ( v14 ) { if ( (unsigned int)ext2fs_test_inode_bitmap2(*(_QWORD *)(a1 + 376), i) ) ++v11; if ( v13 > v21 ) { e2fsck_discard_inodes(a1, v12, v21, v13 - v21); v21 = *(_DWORD *)(*(_QWORD *)(v26 + 32) + 40LL) + 1; } } else { ++v10; ++v9; if ( v21 > v13 ) v21 = v13; } if ( v13 == *(_DWORD *)(*(_QWORD *)(v26 + 32) + 40LL) || i == **(_DWORD **)(v26 + 32) ) { if ( !v14 && v13 >= v21 ) e2fsck_discard_inodes(a1, v12, v21, v13 - v21 + 1); if ( (*(_DWORD *)(a1 + 76) & 0x2000) != 0 && (*(_DWORD *)(*(_QWORD *)(v26 + 8) + 52LL) & 2) != 0 && !(unsigned int)ext2fs_bg_flags_test(v26, v12, 4LL) ) { ext2fs_bg_flags_set(v26, v12, 4LL); ext2fs_group_desc_csum_set(v26, v12); } v21 = *(_DWORD *)(*(_QWORD *)(v26 + 32) + 40LL) + 1; *((_DWORD *)s + v12) = v10; *((_DWORD *)memory + v12++) = v11; v13 = 0; v19 = 0; v10 = 0; v11 = 0; if ( *(_QWORD *)(a1 + 352) && (*(unsigned int ( **)(long, long, _QWORD, _QWORD))(a1 + 352))( a1, 5LL, *(_DWORD *)(v26 + 48) + v12, (unsigned int)(2 * *(_DWORD *)(v26 + 48))) ) { goto LABEL_84; } if ( has_group_desc_csum && i != **(_DWORD **)(v26 + 32) && (unsigned int)ext2fs_bg_flags_test(v26, v12, 1LL) ) { v19 = 1; } } } if ( inode_bitmap_start2 ) print_bitmap_problem(a1, v16, (long)v28); v17 = v18 ? end_problem_latch(a1, 48LL) : -1; *(_DWORD *)(a1 + 72) &= ~0x40u; if ( v17 != 1 ) break; ext2fs_free_inode_bitmap(*(_QWORD *)(v26 + 80)); if ( ext2fs_copy_bitmap(*(_QWORD *)(a1 + 360), v26 + 80) ) { clear_problem_context(v28); fix_problem(a1, 327698LL, v28); *(_DWORD *)(a1 + 72) |= 1u; goto LABEL_84; } ext2fs_set_bitmap_padding(*(_QWORD *)(v26 + 80)); ext2fs_mark_ib_dirty(v26); v13 = 0; v9 = 0; v10 = 0; v11 = 0; v12 = 0; memset(s, 0, 4LL * *(unsigned int *)(v26 + 48)); memset(memory, 0, 4LL * *(unsigned int *)(v26 + 48)); ++v20; } if ( !v17 ) ext2fs_unmark_valid(v26); for ( j = 0; j < *(_DWORD *)(v26 + 48); ++j ) { v4 = *((_DWORD *)s + j); if ( v4 != (unsigned int)ext2fs_bg_free_inodes_count(v26, j) ) { v33 = j; inode_bitmap_start2 = ext2fs_bg_free_inodes_count(v26, j); inode_bitmap_end2 = *((_DWORD *)s + j); if ( (unsigned int)fix_problem(a1, 327691LL, v28) ) { ext2fs_bg_free_inodes_count_set(v26, j, *((unsigned int *)s + j)); ext2fs_mark_super_dirty(v26); } else { ext2fs_unmark_valid(v26); } } v5 = *((_DWORD *)memory + j); if ( v5 != (unsigned int)ext2fs_bg_used_dirs_count(v26, j) ) { v33 = j; inode_bitmap_start2 = ext2fs_bg_used_dirs_count(v26, j); inode_bitmap_end2 = *((_DWORD *)memory + j); if ( (unsigned int)fix_problem(a1, 327692LL, v28) ) { ext2fs_bg_used_dirs_count_set(v26, j, *((unsigned int *)memory + j)); ext2fs_mark_super_dirty(v26); } else { ext2fs_unmark_valid(v26); } } } if ( v9 != *(_DWORD *)(*(_QWORD *)(v26 + 32) + 16LL) ) { v33 = -1; inode_bitmap_start2 = *(_DWORD *)(*(_QWORD *)(v26 + 32) + 16LL); inode_bitmap_end2 = v9; if ( (unsigned int)fix_problem(a1, 327693LL, v28) ) { *(_DWORD *)(*(_QWORD *)(v26 + 32) + 16LL) = v9; ext2fs_mark_super_dirty(v26); } } } else { v34 = 4LL; v31 = 1LL; v32 = **(unsigned int **)(v26 + 32); inode_bitmap_start2 = ext2fs_get_inode_bitmap_start2(*(_QWORD *)(v26 + 80)); inode_bitmap_end2 = ext2fs_get_inode_bitmap_end2(*(_QWORD *)(v26 + 80)); fix_problem(a1, 327696LL, v28); *(_DWORD *)(a1 + 72) |= 1u; } } else { v34 = 3LL; v31 = 1LL; v32 = **(unsigned int **)(v26 + 32); inode_bitmap_start2 = ext2fs_get_inode_bitmap_start2(*(_QWORD *)(a1 + 360)); inode_bitmap_end2 = ext2fs_get_inode_bitmap_end2(*(_QWORD *)(a1 + 360)); fix_problem(a1, 327696LL, v28); *(_DWORD *)(a1 + 72) |= 1u; } LABEL_84: ext2fs_free_mem(&s); ext2fs_free_mem(&memory); return __readfsqword(0x28u) ^ v38; }
static void format_address_label (uintmax_t address, char c) { format_address_std (address, ' '); format_address_paren (address + pseudo_offset, c); }
long long format_address_label(unsigned int a0, unsigned long a1) { format_address_std(a0, 0x20); return format_address_paren(a0 + pseudo_offset, a1); }
char * history_arg_extract(int start, int end, const char *str) { size_t i, len, max; char **arr, *result = ((void *)0) ; arr = history_tokenize(str); if (!arr) return ((void *)0) ; if (arr && *arr == ((void *)0) ) goto out; for (max = 0; arr[max]; max++) continue; max--; if (start == '$') start = (int)max; if (end == '$') end = (int)max; if (end < 0) end = (int)max + end + 1; if (start < 0) start = end; if (start < 0 || end < 0 || (size_t)start > max || (size_t)end > max || start > end) goto out; for (i = (size_t)start, len = 0; i <= (size_t)end; i++) len += strlen(arr[i]) + 1; len++; result = calloc(len, sizeof(*result)); if (result == ((void *)0) ) goto out; for (i = (size_t)start, len = 0; i <= (size_t)end; i++) { (void)strcpy(result + len, arr[i]); len += strlen(arr[i]); if (i < (size_t)end) result[len++] = ' '; } result[len] = '\0'; out: for (i = 0; arr[i]; i++) free(arr[i]); free(arr); return result; }
int history_arg_extract(unsigned long a0, unsigned long a1, unsigned long long a2) { unsigned int v0; int tmp_10; unsigned int v1; void* v2; unsigned long v3; void* v4; void* v5; void* v6; unsigned int v8; v1 = a0; v0 = a1; v5 = 0; v6 = history_tokenize(a2); if (!v6) { v8 = 0; } else { for (v4 = 0; *((v6 + 0x8 * v4)); v4 += 1); v4 -= 1; if (v1 == 36) v1 = v4; if (v0 == 36) v0 = v4; if (v0 < 0) v0 = v0 + v4 + 1; if (v1 < 0) v1 = v0; if (v1 >= 0 && v0 >= 0 && v4 >= v1 && v4 >= v0 && v1 <= v0) { v2 = v1; for (v3 = 0; v2 <= v0; v2 += 1) { v8 = strlen(*((v6 + 0x8 * v2))) + v3 + 1; *(&v3) = v8; } *(&v3) = v3 + 1; v5 = calloc(*(&v3), 0x1); if (v5) { v2 = v1; for (v3 = 0; v2 <= v0; v2 += 1) { strcpy(v3 + v5, *((v6 + 0x8 * v2))); v3 += strlen(*((v6 + 0x8 * v2))); if (v2 < v0) { tmp_10 = v3; v3 += 1; *(tmp_10 + v5) = 32; } } *((v3 + v5)) = 0; } } for (v2 = 0; *((v6 + 0x8 * v2)); v2 += 1) { free(*((v6 + 0x8 * v2))); } free(v6); v8 = v5; } return v8; }
static void ask_server(const char *url) { gnutls_datum_t resp_data; int ret, v = 0, total_v = 0; unsigned char noncebuf[23]; gnutls_datum_t nonce = { noncebuf, sizeof(noncebuf) }; gnutls_datum_t *n; gnutls_x509_crt_t chain[8]; unsigned chain_size, counter; unsigned idx = 0; common_info_st info; chain_size = load_chain(chain); if (chain_size > 2 && ocsptool_options.present.outfile) { if (outcert_format != GNUTLS_X509_FMT_PEM) { fprintf( stderr , "error: You cannot combine --outfile when more than 2 certificates are found in a chain\n"); fprintf( stderr , "Did you mean to use --outpem?\n"); app_exit(1); } } counter = chain_size; while(counter > 1) { if (ocsptool_options.enabled.nonce) { ret = gnutls_rnd(GNUTLS_RND_NONCE, nonce.data, nonce.size); if (ret < 0) { fprintf( stderr , "gnutls_rnd: %s\n", gnutls_strerror(ret)); app_exit(1); } n = &nonce; } else { n = ((void *)0) ; } ret = send_ocsp_request(url, chain[idx], chain[idx+1], &resp_data, n); if (ret < 0) { fprintf( stderr , "Cannot send OCSP request\n"); app_exit(1); } _response_info(&resp_data, 1); if (ocsptool_options.present.load_trust) { v = _verify_response(&resp_data, n, ((void *)0) , 0); } else if (ocsptool_options.present.load_signer) { memset(&info, 0, sizeof(info)); info.verbose = verbose; info.cert = ocsptool_options.arg.load_signer; v = _verify_response(&resp_data, n, load_cert(1, &info), 0); } else { if (!ocsptool_options.present.load_chain) fprintf( stderr , "\nAssuming response's signer = issuer (use --load-signer to override).\n"); v = _verify_response(&resp_data, n, chain[idx+1], 0); } total_v += v; free(resp_data.data); idx++; counter--; printf("\n"); } for (idx = 0;idx<chain_size;idx++) { gnutls_x509_crt_deinit(chain[idx]); } if (total_v && !ocsptool_options.present.ignore_errors) app_exit(1); }
unsigned long ask_server(long a1) { const char *v1; int v2; long cert; int v5; int v6; unsigned int i; int v8; unsigned int j; unsigned int chain; int v11; long *v12; void *ptr[2]; char *v14; unsigned int v15; long s[28]; long v17[8]; char v18; unsigned long v19; v19 = __readfsqword(0x28u); v6 = 0; v14 = &v18; v15 = 23; v8 = 0; chain = load_chain(v17); if ( chain > 2 && ocsptool_options[3] && outcert_format != 1 ) { fprintf(stderr, "error: You cannot combine --outfile when more than 2 certificates are found in a chain\n"); fprintf(stderr, "Did you mean to use --outpem?\n"); app_exit(1); } for ( i = chain; i > 1; --i ) { if ( ocsptool_options[141] ) { v11 = gnutls_rnd(0LL, v14, v15); if ( v11 < 0 ) { v1 = (const char *)gnutls_strerror((unsigned int)v11); fprintf(stderr, "gnutls_rnd: %s\n", v1); app_exit(1); } v12 = (long *)&v14; v2 = send_ocsp_request(a1, v17[v8], v17[v8 + 1], ptr, &v14); } else { v12 = 0LL; v2 = send_ocsp_request(a1, v17[v8], v17[v8 + 1], ptr, 0LL); } if ( v2 < 0 ) { fprintf(stderr, "Cannot send OCSP request\n"); app_exit(1); } response_info((long)ptr, 1); if ( ocsptool_options[13] ) { v5 = verify_response((long)ptr, (long)v12, 0LL, 0); } else if ( ocsptool_options[14] ) { memset(s, 0, 0xD8uLL); HIDWORD(s[24]) = verbose; s[5] = *(_QWORD *)&ocsptool_options[96]; cert = load_cert(1LL, s); v5 = verify_response((long)ptr, (long)v12, cert, 0); } else { if ( ocsptool_options[10] != 1 ) fprintf(stderr, "\nAssuming response's signer = issuer (use --load-signer to override).\n"); v5 = verify_response((long)ptr, (long)v12, v17[v8 + 1], 0); } v6 += v5; free(ptr[0]); ++v8; printf("\n"); } for ( j = 0; j < chain; ++j ) gnutls_x509_crt_deinit(v17[j]); if ( v6 && ocsptool_options[20] != 1 ) app_exit(1); return __readfsqword(0x28u) ^ v19; }
static WORD_LIST * make_arith_for_expr (s) char *s; { WORD_LIST *result; WORD_DESC *wd; if (s == 0 || *s == '\0') return ((WORD_LIST *) ((void *)0) ); wd = make_word (s); wd->flags |= (1 << 5)|(1 << 4)|(1 << 1)|(1 << 12)|(1 << 20); result = make_word_list (wd, (WORD_LIST *) ((void *)0) ); return result; }
int make_arith_for_expr(char *a0) { struct_0 *v0; unsigned long v1; unsigned int v3; if (!a0) { LABEL_400668: v3 = 0; } else { if (!*(a0)) goto LABEL_400668; v0 = make_word(a0); v0->field_8 = v0->field_8 | 1052722; v1 = make_word_list(v0, 0x0); v3 = v1; } return v3; }
static _Bool scan_for_digit_differences (const char *p, const char *q, size_t *first, size_t *n) { _Bool seen = 0 ; size_t i; for (i=0; p[i] && q[i]; i++) { if (p[i] != q[i]) { if (! ((*__ctype_b_loc ())[(int) (( (unsigned char)p[i] ))] & (unsigned short int) _ISdigit) || ! ((*__ctype_b_loc ())[(int) (( (unsigned char)q[i] ))] & (unsigned short int) _ISdigit) ) return 0 ; if (!seen) { *first = i; *n = 1; seen = 1; } else { if (i-*first == *n) { ++*n; } else { return 0 ; } } } } if (p[i] || q[i]) { return 0 ; } return 1 ; }
_BOOL8 scan_for_digit_differences(long a1, long a2, _QWORD *a3, _QWORD *a4) { char v7; long i; v7 = 0; for ( i = 0LL; *(_BYTE *)(a1 + i) && *(_BYTE *)(a2 + i); ++i ) { if ( *(_BYTE *)(a1 + i) != *(_BYTE *)(a2 + i) ) { if ( ((*_ctype_b_loc())[*(unsigned char *)(a1 + i)] & 0x800) == 0 || ((*_ctype_b_loc())[*(unsigned char *)(a2 + i)] & 0x800) == 0 ) { return 0LL; } if ( v7 != 1 ) { *a3 = i; *a4 = 1LL; v7 = 1; } else { if ( i - *a3 != *a4 ) return 0LL; ++*a4; } } } return !*(_BYTE *)(a1 + i) && !*(_BYTE *)(a2 + i); }
int rl_emacs_editing_mode (int count, int key) { rl_editing_mode = 1; _rl_set_insert_mode (1, 1); _rl_keymap = emacs_standard_keymap; if (_rl_show_mode_in_prompt) _rl_reset_prompt (); return 0; }
undefined8 rl_emacs_editing_mode(void) { rl_editing_mode = 1; _rl_set_insert_mode(1,1); _rl_keymap = &emacs_standard_keymap; if (_rl_show_mode_in_prompt != 0) { _rl_reset_prompt(); } return 0; }
static int vflopenat(int dirfd, const char *path, int flags, va_list ap) { int fd, operation, serrno, trunc; struct stat sb, fsb; mode_t mode; mode = 0; if (flags & 0100 ) { mode = (mode_t) __builtin_va_arg( ap , int ) ; } operation = 2 ; if (flags & 04000 ) operation |= 4 ; trunc = (flags & 01000 ); flags &= ~ 01000 ; for (;;) { if ((fd = openat(dirfd, path, flags, mode)) == -1) return (-1); if (flock(fd, operation) == -1) { serrno = (*__errno_location ()) ; (void)close(fd); (*__errno_location ()) = serrno; return (-1); } if (fstatat(dirfd, path, &sb, 0) == -1) { (void)close(fd); continue; } if (fstat(fd, &fsb) == -1) { serrno = (*__errno_location ()) ; (void)close(fd); (*__errno_location ()) = serrno; return (-1); } if (sb.st_dev != fsb.st_dev || sb.st_ino != fsb.st_ino) { (void)close(fd); continue; } if (trunc && ftruncate(fd, 0) != 0) { serrno = (*__errno_location ()) ; (void)close(fd); (*__errno_location ()) = serrno; return (-1); } return (fd); } }
int vflopenat(unsigned long a0, unsigned long long a1, unsigned long a2, struct_0 *a3) { struct_0 *v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; char v7; char v8; char v9; char v10; unsigned long v12; v1 = a2; v0 = a3; v3 = 0; if ((v1 & 64)) { if (a3->field_0 > 47) { v12 = a3->field_8; a3->field_8 = a3->field_8 + 8; } else { v12 = a3->field_0 + a3->field_10; a3->field_0 = a3->field_0 + 8; } *(&v12) = *(v12); v3 = v12; } v2 = 2; if ((v1 & 0x800)) v2 |= 4; v4 = v1 & 0x200; v1 &= -513; while (true) { v5 = openat(a0, a1, v1, v3); if (v5 == -1) { *(&v12) = -1; break; } else if (flock(v5, v2, v2) == -1) { v6 = *(__errno_location()); close(v5); *(__errno_location()) = v6; *(&v12) = -1; break; } else if (fstatat(a0, a1, &v7, 0x0) == -1) { close(v5); } else if (fstat(v5, &v9) == -1) { v6 = *(__errno_location()); close(v5); *(__errno_location()) = v6; *(&v12) = -1; break; } else { if (*(&v7) == *(&v9) && *(&v8) == *(&v10)) { if (v4 && ftruncate(v5, 0x0)) { v6 = *(__errno_location()); close(v5); *(__errno_location()) = v6; *(&v12) = -1; break; } *(&v12) = v5; break; } close(v5); } } return v12; }
inline void init_eltstate (array_eltstate_t *estatep) { if (estatep) { estatep->type = -1; estatep->subtype = 0; estatep->key = estatep->value = 0; estatep->ind = (-9223372036854775807L -1) ; } }
long long init_eltstate(struct_0 *a0) { if (a0) { a0->field_0 = 65535; a0->field_2 = 0; a0->field_18 = 0; a0->field_10 = a0->field_18; a0->field_8 = 0x8000000000000000; } return a0; }
static inline int is_basic (char c) { return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) & 1; }
uint is_basic(byte param_1) { return *(uint *)(&is_basic_table + (long)(int)(uint)(param_1 >> 5) * 4) >> (param_1 & 0x1f) & 1; }
static inline _Bool usable_st_size (struct stat const *sb) { return ( (((( sb->st_mode )) & 0170000) == (0100000)) || (((( sb->st_mode )) & 0170000) == (0120000)) || (( sb )->st_mode - ( sb )->st_mode) || 0 ); }
undefined4 usable_st_size(long param_1) { undefined4 uVar1; if (((*(uint *)(param_1 + 0x18) & 0xf000) == 0x8000) || ((*(uint *)(param_1 + 0x18) & 0xf000) == 0xa000)) { uVar1 = 1; } else { uVar1 = 0; } return uVar1; }
static int ssh_packet_send_mux(struct ssh *ssh) { struct session_state *state = ssh->state; u_char type, *cp; size_t len; int r; if (ssh->kex) return -1; len = sshbuf_len(state->outgoing_packet); if (len < 6) return -1; cp = sshbuf_mutable_ptr(state->outgoing_packet); type = cp[5]; if (ssh_packet_log_type(type)) sshlog("packet.c", __func__, 2638, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "type %u", type); if (type >= 80 && type <= 127) { do { const u_int32_t __v = (len - 4); ((u_char *)(cp))[0] = (__v >> 24) & 0xff; ((u_char *)(cp))[1] = (__v >> 16) & 0xff; ((u_char *)(cp))[2] = (__v >> 8) & 0xff; ((u_char *)(cp))[3] = __v & 0xff; } while (0); if ((r = sshbuf_putb(state->output, state->outgoing_packet)) != 0) return r; } sshbuf_reset(state->outgoing_packet); return 0; }
long ssh_packet_send_mux(long *a1) { unsigned char v2; unsigned int v3; long v4; unsigned long v5; _BYTE *v6; v4 = *a1; if ( a1[1] ) return 0xFFFFFFFFLL; v5 = sshbuf_len(*(_QWORD *)(v4 + 48)); if ( v5 <= 5 ) return 0xFFFFFFFFLL; v6 = (_BYTE *)sshbuf_mutable_ptr(*(_QWORD *)(v4 + 48)); v2 = v6[5]; if ( ssh_packet_log_type(v2) ) sshlog("packet.c", "ssh_packet_send_mux", 2638LL, 1LL, 7LL, 0LL, "type %u", v2); if ( (char)v2 >= 80 ) { *v6 = (unsigned int)(v5 - 4) >> 24; v6[1] = (unsigned int)(v5 - 4) >> 16; v6[2] = (unsigned short)(v5 - 4) >> 8; v6[3] = v5 - 4; v3 = sshbuf_putb(*(_QWORD *)(v4 + 40), *(_QWORD *)(v4 + 48)); if ( v3 ) return v3; } sshbuf_reset(*(_QWORD *)(v4 + 48)); return 0LL; }
static int write_random_lines (struct randint_source *s, size_t count, char *const *lines, size_t n_lines) { for (size_t i = 0; i < count; i++) { const randint j = randint_choose (s, n_lines); char *const *p = lines + j; size_t len = p[1] - p[0]; if (fwrite_unlocked (p[0],sizeof *p[0],len, stdout ) != len) return -1; } return 0; }
long write_random_lines(long a1, unsigned long a2, long a3, long a4) { unsigned long i; long v8; size_t n; for ( i = 0LL; i < a2; ++i ) { v8 = randint_choose(a1, a4); n = *(_QWORD *)(8 * v8 + a3 + 8) - *(_QWORD *)(8 * v8 + a3); if ( n != fwrite_unlocked(*(const void **)(8 * v8 + a3), 1uLL, n, stdout) ) return 0xFFFFFFFFLL; } return 0LL; }
static _Bool iswheel (const char *username) { struct group *grp; grp = getgrnam ("wheel"); if ( ( ((void *)0) ==grp) || ( ((void *)0) == grp->gr_mem)) { return 0 ; } return is_on_list (grp->gr_mem, username); }
int iswheel(unsigned long long a0) { struct_0 *v0; unsigned int v2; v0 = &getgrnam("wheel")->gr_name; if (!v0) { v2 = 0; return v2; } else if (!v0->field_18) { v2 = 0; return v2; } else { v2 = is_on_list(v0->field_18, a0, a0); return v2; } }
static int add_group (const char *name, const char *gid, gid_t *ngid, uid_t uid) { const struct group *grp; struct group grent; char *members[1]; const struct sgrp *sg; grp = getgrnam (gid); if ( ((void *)0) == grp) { grp = gr_locate (gid); } if ( ((void *)0) != grp) { *ngid = grp->gr_gid; return 0; } if ( ((*__ctype_b_loc ())[(int) (( gid[0] ))] & (unsigned short int) _ISdigit) ) { if (get_gid (gid, &grent.gr_gid) == 0) { fprintf ( stderr , gettext ("%s: invalid group ID '%s'\n"), Prog, gid); return -1; } if ( (getgrgid ((gid_t) grent.gr_gid) != ((void *)0) ) || (gr_locate_gid ((gid_t) grent.gr_gid) != ((void *)0) )) { *ngid = (gid_t) grent.gr_gid; return 0; } if (grent.gr_gid == (gid_t)-1) { fprintf ( stderr , gettext ("%s: invalid group ID '%s'\n"), Prog, gid); return -1; } } else { if (find_new_gid(rflg, &grent.gr_gid, &uid) < 0) { return -1; } } if (('\0' != gid[0]) && (! ((*__ctype_b_loc ())[(int) (( gid[0] ))] & (unsigned short int) _ISdigit) )) { grent.gr_name = xstrdup (gid); } else { grent.gr_name = xstrdup (name); } if (!is_valid_group_name (grent.gr_name)) { fprintf ( stderr , gettext ("%s: invalid group name '%s'\n"), Prog, grent.gr_name); free (grent.gr_name); return -1; } grent.gr_passwd = "*"; members[0] = ((void *)0) ; grent.gr_mem = members; *ngid = grent.gr_gid; if (is_shadow_grp) { sg = sgr_locate (grent.gr_name); if ( ((void *)0) != sg) { fprintf ( stderr , gettext ("%s: group '%s' is a shadow group, but does not exist in /etc/group\n"), Prog, grent.gr_name); return -1; } } if (is_shadow_grp) { struct sgrp sgrent; char *admins[1]; sgrent.sg_name = grent.gr_name; sgrent.sg_passwd = "*"; grent.gr_passwd = "x"; admins[0] = ((void *)0) ; sgrent.sg_adm = admins; sgrent.sg_mem = members; if (sgr_update (&sgrent) == 0) { return -1; } } if (gr_update (&grent) == 0) { return -1; } return 0; }
long add_group(long a1, char *a2, __gid_t *a3, int a4) { long v5; char *v6; void *v7; long v8; char *v9; void *v10; long v11; char *v12; int v13; __gid_t *v14; char *name; long v16; struct group *v17; long v18; void *ptr; const char *v20; __gid_t gid; long *v22; long v23[5]; long v24; long v25[4]; v16 = a1; name = a2; v14 = a3; v13 = a4; v25[1] = __readfsqword(0x28u); v17 = getgrnam(a2); if ( !v17 ) v17 = (struct group *)gr_locate(name); if ( v17 ) { *v14 = v17->gr_gid; return 0LL; } if ( ((*_ctype_b_loc())[*name] & 0x800) != 0 ) { if ( !(unsigned int)get_gid(name, &gid) ) { LABEL_7: v5 = Prog; v6 = gettext("%s: invalid group ID '%s'\n"); fprintf(stderr, v6, v5, name); return 0xFFFFFFFFLL; } if ( getgrgid(gid) || gr_locate_gid(gid) ) { *v14 = gid; return 0LL; } if ( gid == -1 ) goto LABEL_7; } else if ( (int)find_new_gid((unsigned char)rflg, &gid, &v13) < 0 ) { return 0xFFFFFFFFLL; } if ( !*name || ((*_ctype_b_loc())[*name] & 0x800) != 0 ) ptr = (void *)xstrdup(v16); else ptr = (void *)xstrdup(name); if ( (unsigned char)is_valid_group_name(ptr) != 1 ) { v7 = ptr; v8 = Prog; v9 = gettext("%s: invalid group name '%s'\n"); fprintf(stderr, v9, v8, v7); free(ptr); return 0xFFFFFFFFLL; } else { v20 = "*"; v24 = 0LL; v22 = &v24; *v14 = gid; if ( is_shadow_grp && (v18 = sgr_locate(ptr)) != 0 ) { v10 = ptr; v11 = Prog; v12 = gettext("%s: group '%s' is a shadow group, but does not exist in /etc/group\n"); fprintf(stderr, v12, v11, v10); return 0xFFFFFFFFLL; } else if ( !is_shadow_grp || (v23[0] = (long)ptr, v23[1] = (long)"*", v20 = "x", v25[0] = 0LL, v23[2] = (long)v25, v23[3] = (long)&v24, (unsigned int)sgr_update(v23)) ) { if ( (unsigned int)gr_update(&ptr) ) return 0LL; else return 0xFFFFFFFFLL; } else { return 0xFFFFFFFFLL; } } }
strcmp(*argv, "any") == 0) proto = 0; else invarg("Cannot guess tunnel mode.", *argv); } else if (strcmp(*argv, "remote") == 0) {
int strcmp(char *__s1,char *__s2) { halt_baddata(); }
static void sighup_handler(int sig) { received_sighup = 1; }
long long sighup_handler(unsigned long a0) { unsigned int v0; unsigned long v2; v0 = a0; received_sighup = 1; return v2; }
void crypto_sign_ed25519_ref_fe25519_add(crypto_sign_ed25519_ref_fe25519 *r, const crypto_sign_ed25519_ref_fe25519 *x, const crypto_sign_ed25519_ref_fe25519 *y) { int i; for(i=0;i<32;i++) r->v[i] = x->v[i] + y->v[i]; reduce_add_sub(r); }
void crypto_sign_ed25519_ref_fe25519_add(long param_1,long param_2,long param_3) { int local_c; for (local_c = 0; local_c < 0x20; local_c = __addvsi3(local_c,1)) { *(int *)(param_1 + (long)local_c * 4) = *(int *)(param_2 + (long)local_c * 4) + *(int *)(param_3 + (long)local_c * 4); } reduce_add_sub(param_1); return; }
int rl_exchange_point_and_mark (int count, int key) { if (rl_mark > rl_end) rl_mark = -1; if (rl_mark < 0) { rl_ding (); rl_mark = 0; return 1; } else { do { int t; t = rl_point; rl_point = rl_mark; rl_mark = t; } while (0); rl_activate_mark (); } return 0; }
bool rl_exchange_point_and_mark(void) { int iVar1; bool bVar2; iVar1 = rl_point; if (rl_end < rl_mark) { rl_mark = -1; } bVar2 = -1 < rl_mark; if (bVar2) { rl_point = rl_mark; rl_mark = iVar1; rl_activate_mark(); } else { rl_ding(); rl_mark = 0; } return !bVar2; }
char * single_quote(const char *s) { char *p; ((p) = ((void *)stacknxt)); do { char *q; size_t len; len = strchrnul(s, '\'') - s; q = p = makestrspace(len + 3, p); *q++ = '\''; q = mempcpy(q, s, len); *q++ = '\''; s += len; (p += (q - p)); len = strspn(s, "'"); if (!len) break; q = p = makestrspace(len + 3, p); *q++ = '"'; q = mempcpy(q, s, len); *q++ = '"'; s += len; (p += (q - p)); } while (*s); (*p++ = (0)); return ((void *)stacknxt); }
long long single_quote(void* a0) { char *v0; int tmp_23; int tmp_21; int tmp_22; int tmp_12; char *v1; unsigned int v2; char *v3; v0 = a0; v1 = stacknxt; while (true) { *(&v2) = strchrnul(v0, 0x27) - v0; v1 = makestrspace(*(&v2) + 3, v1, *(&v2) + 3); v3 = v1; tmp_23 = v3; v3 += 1; *(tmp_23) = 39; v3 = mempcpy(v3, v0, *(&v2)); tmp_21 = v3; v3 += 1; *(tmp_21) = 39; v0 = &v0[*(&v2)]; v1 = v3; *(&v2) = strspn(v0, "'"); if (!*(&v2)) break; v1 = makestrspace(*(&v2) + 3, v1, *(&v2) + 3); v3 = v1; tmp_23 = v3; v3 += 1; *(tmp_23) = 34; v3 = mempcpy(v3, v0, *(&v2)); tmp_22 = v3; v3 += 1; *(tmp_22) = 34; v0 = &v0[*(&v2)]; v1 = v3; if (!*(v0)) break; } tmp_12 = v1; v1 += 1; *(tmp_12) = 0; return stacknxt; }
static void check_error(const char *msg) { CheckErrorCount++; fprintf( stderr , "\"%s\":%d: %s\n", Filename, LineNumber - 1, msg); }
int check_error(const char *a1) { ++CheckErrorCount; return fprintf(stderr, "\"%s\":%d: %s\n", &Filename, (unsigned int)(LineNumber - 1), a1); }
static void explain(struct link_util *lu) { print_explain(lu, stderr ); }
void explain(void* a0) { unsigned long long v1; v1 = print_explain(a0, stderr); return; }
static int restore_handler(struct rtnl_ctrl_data *ctrl, struct nlmsghdr *n, void *arg) { int ret; n->nlmsg_flags |= 0x01 | 0x400 | 0x04; ll_init_map(&rth); ret = rtnl_talk(&rth, n, ((void *)0) ); if ((ret < 0) && ( (*__errno_location ()) == 17 )) ret = 0; return ret; }
long restore_handler(long a1, long a2) { int v3; *(_WORD *)(a2 + 6) |= 0x405u; ll_init_map(rth); v3 = rtnl_talk(rth, a2, 0LL); if ( v3 < 0 && *_errno_location() == 17 ) return 0; return (unsigned int)v3; }
static inline int is_basic (char c) { return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) & 1; }
int is_basic(unsigned long a0) { return (*((4 * (a0 >> 5) + &is_basic_table)) >> (a0 & 31 & 31)) & 1; }
static int flush_rule(struct nlmsghdr *n, void *arg) { struct rtnl_handle rth2; struct fib_rule_hdr *frh = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); int len = n->nlmsg_len; struct rtattr *tb[(__FRA_MAX - 1)+1]; int host_len = -1; len -= ((sizeof(*frh)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))); if (len < 0) return -1; parse_rtattr(tb, (__FRA_MAX - 1), ((struct rtattr*)(((char*)(frh)) + ( ((sizeof(struct rtmsg))+4U -1) & ~(4U -1) ))), len); host_len = af_bit_len(frh->family); if (!filter_nlmsg(n, tb, host_len)) return 0; if (tb[FRA_PROTOCOL]) { __u8 protocol = rta_getattr_u8(tb[FRA_PROTOCOL]); if ((filter.protocol ^ protocol) & filter.protocolmask) return 0; } if (tb[FRA_PRIORITY]) { n->nlmsg_type = RTM_DELRULE; n->nlmsg_flags = 0x01; if (rtnl_open(&rth2, 0) < 0) return -1; if (rtnl_talk(&rth2, n, ((void *)0) ) < 0) return -2; rtnl_close(&rth2); } return 0; }
long long flush_rule(struct_0 *a0, unsigned long a1) { unsigned long v0; char v1; unsigned int v2; unsigned int v3; char *v4; char v5; char v6; char v7; char v8; unsigned long long v10; v0 = a1; v4 = &a0[2].field_0; v2 = a0->field_0; v3 = -1; v2 -= 28; if (v2 < 0) { v10 = 4294967295; } else { parse_rtattr(&v6, 0x18, v4 + 12, v2); v3 = af_bit_len(*(v4)); if ((filter_nlmsg(a0, &v6, v3) ^ 1)) { v10 = 0; } else { if (*(&v8)) { v1 = rta_getattr_u8(*(&v8)); if ((g_403b34 & (g_403b30 ^ v1))) { v10 = 0; goto LABEL_401922; } } if (*(&v7)) { a0->field_4 = 33; a0->field_6 = 1; if (rtnl_open(&v5, 0x0) < 0) { v10 = 4294967295; goto LABEL_401922; } if (rtnl_talk(&v5, a0, 0x0, a0) < 0) { v10 = 4294967294; goto LABEL_401922; } else { rtnl_close(&v5); } } v10 = 0; } } LABEL_401922: return v10; }
void wordinit (void) { for (int i = 0; i < NCHAR; i++) sbwordchar[i] = wordchar (localeinfo.sbctowc[i]); }
long long wordinit() { unsigned int v0; unsigned long long v2; for (v0 = 0; v0 <= 255; v0 += 1) { v2 = wordchar(*((0x100 + 4 * v0 + &g_50000c))); *(v0 + &sbwordchar) = v2; } return v2; }
static void print_rcs_hunk (struct change *hunk) { lin i, f0, l0, f1, l1; printint tf0, tl0, tf1, tl1; enum changes changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1); if (!changes) return; begin_output (); translate_range (&files[0], f0, l0, &tf0, &tl0); if (changes & OLD) { fprintf (outfile, "d%""l""d %""l""d\n", tf0, tf0 <= tl0 ? tl0 - tf0 + 1 : 1); } if (changes & NEW) { translate_range (&files[1], f1, l1, &tf1, &tl1); fprintf (outfile, "a%""l""d %""l""d\n", tl0, tf1 <= tl1 ? tl1 - tf1 + 1 : 1); for (i = f1; i <= l1; i++) print_1_line ("", &files[1].linbuf[i]); } }
long long print_rcs_hunk(unsigned long long a0) { unsigned int v0; char v1; char v2; char v3; char v4; char v5; char v6; char v7; char v8; unsigned long long v9; v0 = analyze_hunk(a0, &v1, &v2, &v3, &v4); if (!v0) return 0; begin_output(); translate_range(0x500028, *(&v1), *(&v2), &v5, &v6); if ((v0 & 1)) fprintf(outfile, "d%ld %ld\n", *(&v5), (*(&v5) <= *(&v6) ? 1 : (*(&v6) - *(&v5) + 1))); if (!(v0 & 2)) return 0; translate_range(0x500158, *(&v3), *(&v4), &v7, &v8); fprintf(outfile, "a%ld %ld\n", *(&v6), (*(&v7) <= *(&v8) ? 1 : (*(&v8) - *(&v7) + 1))); for (v9 = *(&v3); v9 <= *(&v4); v9 += 1) { print_1_line(&g_4004e5, *(5243408) + v9 * 8, v9 * 8); } return 0; }
static void merge_loop (struct merge_node_queue *queue, size_t total_lines, FILE *tfp, char const *temp_output) { while ( 1 ) { struct merge_node *node = queue_pop (queue); if (node->level == MERGE_END) { unlock_node (node); queue_insert (queue, node); break; } mergelines_node (node, total_lines, tfp, temp_output); queue_check_insert (queue, node); queue_check_insert_parent (queue, node); unlock_node (node); } }
int merge_loop(long a1, unsigned long a2, FILE *a3, char *a4) { long v7; while ( 1 ) { v7 = queue_pop(a1); if ( !*(_DWORD *)(v7 + 80) ) break; mergelines_node((long *)v7, a2, a3, a4); queue_check_insert(a1, v7); queue_check_insert_parent(a1, v7); unlock_node(v7); } unlock_node(v7); return queue_insert(a1, v7); }
void get_policy_set(gnutls_x509_crt_t crt) { int ret = 0, i; gnutls_x509_policy_st policy; if (batch) { if (cfg.skip_certs >= 0) { ret = gnutls_x509_crt_set_inhibit_anypolicy(crt, cfg.skip_certs); if (ret < 0) { fprintf( stderr , "error setting inhibit anypolicy: %s\n", gnutls_strerror(ret)); exit(1); } } for (i = 0; cfg.policy_oid[i] != ((void *)0) ; i++) { memset(&policy, 0, sizeof(policy)); policy.oid = cfg.policy_oid[i]; if (cfg.policy_txt[i] != ((void *)0) ) { policy.qualifier[policy.qualifiers].type = GNUTLS_X509_QUALIFIER_NOTICE; policy.qualifier[policy.qualifiers].data = cfg.policy_txt[i]; policy.qualifier[policy.qualifiers].size = strlen(cfg.policy_txt[i]); policy.qualifiers++; } if (cfg.policy_url[i] != ((void *)0) ) { policy.qualifier[policy.qualifiers].type = GNUTLS_X509_QUALIFIER_URI; policy.qualifier[policy.qualifiers].data = cfg.policy_url[i]; policy.qualifier[policy.qualifiers].size = strlen(cfg.policy_url[i]); policy.qualifiers++; } ret = gnutls_x509_crt_set_policy(crt, &policy, 0); if (ret < 0) break; } } if (ret < 0) { fprintf( stderr , "set_policy: %s\n", gnutls_strerror(ret)); exit(1); } }
unsigned long get_policy_set(long a1) { const char *v1; const char *v2; int v4; int i; long s[27]; unsigned long v7; v7 = __readfsqword(0x28u); v4 = 0; if ( batch ) { if ( (int)cfg[134] >= 0 ) { v4 = gnutls_x509_crt_set_inhibit_anypolicy(a1, (unsigned int)cfg[134]); if ( v4 < 0 ) { v1 = (const char *)gnutls_strerror((unsigned int)v4); fprintf(stderr, "error setting inhibit anypolicy: %s\n", v1); exit(1); } } for ( i = 0; *(_QWORD *)&cfg[2 * i + 28]; ++i ) { memset(s, 0, 0xD0uLL); s[0] = *(_QWORD *)&cfg[2 * i + 28]; if ( *(_QWORD *)&cfg[2 * i + 44] ) { LODWORD(s[3 * LODWORD(s[1]) + 2]) = 2; s[3 * LODWORD(s[1]) + 3] = *(_QWORD *)&cfg[2 * i + 44]; LODWORD(s[3 * LODWORD(s[1]) + 4]) = strlen(*(const char **)&cfg[2 * i + 44]); ++LODWORD(s[1]); } if ( *(_QWORD *)&cfg[2 * i + 60] ) { LODWORD(s[3 * LODWORD(s[1]) + 2]) = 1; s[3 * LODWORD(s[1]) + 3] = *(_QWORD *)&cfg[2 * i + 60]; LODWORD(s[3 * LODWORD(s[1]) + 4]) = strlen(*(const char **)&cfg[2 * i + 60]); ++LODWORD(s[1]); } v4 = gnutls_x509_crt_set_policy(a1, s, 0LL); if ( v4 < 0 ) break; } } if ( v4 < 0 ) { v2 = (const char *)gnutls_strerror((unsigned int)v4); fprintf(stderr, "set_policy: %s\n", v2); exit(1); } return __readfsqword(0x28u) ^ v7; }
static int write_human(FILE *out, char modname[], char devname[], char type, unsigned int maj, unsigned int min) { int ret; ret = fprintf(out, "Module: %s\n" "\tDevice node: /dev/%s\n" "\t\tType: %s device\n" "\t\tMajor: %u\n" "\t\tMinor: %u\n", modname, devname, (type == 'c') ? "character" : "block", maj, min); if (ret >= 0) return 0 ; else return 1 ; }
_BOOL8 write_human(FILE *a1, const char *a2, const char *a3, char a4, unsigned int a5, unsigned int a6) { const char *v6; if ( a4 == 99 ) v6 = "character"; else v6 = "block"; return fprintf( a1, "Module: %s\n\tDevice node: /dev/%s\n\t\tType: %s device\n\t\tMajor: %u\n\t\tMinor: %u\n", a2, a3, v6, a5, a6) < 0; }
static void display_recoverable (struct termios *mode) { printf ("%lx:%lx:%lx:%lx", (unsigned long int) mode->c_iflag, (unsigned long int) mode->c_oflag, (unsigned long int) mode->c_cflag, (unsigned long int) mode->c_lflag); for (size_t i = 0; i < 32 ; ++i) printf (":%lx", (unsigned long int) mode->c_cc[i]); putchar_unlocked ('\n'); }
void display_recoverable(unsigned int a0[4]) { void* v0; unsigned long long v2; printf("%lx:%lx:%lx:%lx", a0[0], a0[1], a0[2], a0[3]); for (v0 = 0; v0 <= 31; v0 += 1) { printf(":%lx", *((v0 + a0 + 17))); } v2 = putchar_unlocked(0xa); return; }
static int _rl_vi_callback_change_char (_rl_callback_generic_arg *data) { int c; char mb[ 16 +1]; c = _rl_vi_callback_getchar (mb, 16 ); if (c < 0) return -1; if ( (__ctype_get_mb_cur_max ()) > 1 && rl_byte_oriented == 0) strncpy (_rl_vi_last_replacement, mb, 16 ); else _rl_vi_last_replacement[0] = c; _rl_vi_last_replacement[ 16 ] = '\0'; _rl_callback_func = 0; _rl_want_redisplay = 1; return (_rl_vi_change_char (data->count, c, mb)); }
long long _rl_vi_callback_change_char(unsigned int *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { unsigned int v0; char v1; unsigned long long v3; unsigned long long v4; v0 = _rl_vi_callback_getchar(&v1, 0x10); if (v0 < 0) { v3 = 4294967295; } else { v4 = __ctype_get_mb_cur_max(); if (v4 > 1 && !rl_byte_oriented) strncpy(&_rl_vi_last_replacement, &v1, 0x10); if (v4 <= 1 || rl_byte_oriented) _rl_vi_last_replacement = v0; g_4049a0 = 0; _rl_callback_func = 0; _rl_want_redisplay = 1; v3 = _rl_vi_change_char(*(a0), v0, &v1, v0, a4, a5); } return v3; }
static errcode_t e2fsck_readahead_bitmap(ext2_filsys fs, ext2fs_block_bitmap ra_map) { blk64_t start, end, out; errcode_t err; start = 1; end = ext2fs_blocks_count(fs->super) - 1; err = ext2fs_find_first_set_block_bitmap2(ra_map, start, end, &out); while (err == 0) { start = out; err = ext2fs_find_first_zero_block_bitmap2(ra_map, start, end, &out); if (err == 2 ) { out = end; err = 0; if (out == start) break; } else if (err) break; err = io_channel_cache_readahead(fs->io, start, out - start); if (err) break; start = out; err = ext2fs_find_first_set_block_bitmap2(ra_map, start, end, &out); } if (err == 2 ) err = 0; return err; }
long e2fsck_readahead_bitmap(long param_1,undefined8 param_2) { long in_FS_OFFSET; long local_30; long local_28; long local_20; long local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_20 = 1; local_18 = ext2fs_blocks_count(*(undefined8 *)(param_1 + 0x20)); local_18 = local_18 + -1; local_28 = ext2fs_find_first_set_block_bitmap2(param_2,local_20,local_18,&local_30); while (local_28 == 0) { local_20 = local_30; local_28 = ext2fs_find_first_zero_block_bitmap2(param_2,local_30,local_18,&local_30); if (local_28 == 2) { local_30 = local_18; local_28 = 0; if (local_20 == local_18) break; } else if (local_28 != 0) break; local_28 = io_channel_cache_readahead(*(undefined8 *)(param_1 + 8),local_20,local_30 - local_20) ; if (local_28 != 0) break; local_20 = local_30; local_28 = ext2fs_find_first_set_block_bitmap2(param_2,local_30,local_18,&local_30); } if (local_28 == 2) { local_28 = 0; } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return local_28; } __stack_chk_fail(); }
int muxclient(const char *path) { struct sockaddr_un addr; int sock; u_int pid; if (muxclient_command == 0) { if (options.stdio_forward_host != ((void *)0) ) muxclient_command = 4; else muxclient_command = 1; } switch (options.control_master) { case 2: case 4: sshlog("mux.c", __func__, 2255, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "auto-mux: Trying existing master"); case 0: break; default: return -1; } memset(&addr, '\0', sizeof(addr)); addr.sun_family = 1 ; if (strlcpy(addr.sun_path, path, sizeof(addr.sun_path)) >= sizeof(addr.sun_path)) sshfatal("mux.c", __func__, 2268, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "ControlPath too long ('%s' >= %u bytes)", path, (unsigned int)sizeof(addr.sun_path)) ; if ((sock = socket( 1 , SOCK_STREAM , 0)) == -1) sshfatal("mux.c", __func__, 2272, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "socket(): %s", strerror( (*__errno_location ()) )); if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) { switch (muxclient_command) { case 1: case 4: break; default: sshfatal("mux.c", __func__, 2280, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Control socket connect(%.100s): %s", path, strerror( (*__errno_location ()) )) ; } if ( (*__errno_location ()) == 111 && options.control_master != 0) { sshlog("mux.c", __func__, 2285, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Stale control socket %.100s, unlinking", path); unlink(path); } else if ( (*__errno_location ()) == 2 ) { sshlog("mux.c", __func__, 2288, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Control socket \"%.100s\" does not exist", path); } else { sshlog("mux.c", __func__, 2290, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Control socket connect(%.100s): %s", path, strerror( (*__errno_location ()) )) ; } close(sock); return -1; } set_nonblock(sock); if (mux_client_hello_exchange(sock) != 0) { sshlog("mux.c", __func__, 2299, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "master hello exchange failed"); close(sock); return -1; } switch (muxclient_command) { case 2: if ((pid = mux_client_request_alive(sock)) == 0) sshfatal("mux.c", __func__, 2307, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "master alive check failed"); fprintf( stderr , "Master running (pid=%u)\r\n", pid); exit(0); case 3: mux_client_request_terminate(sock); if (options.log_level != SYSLOG_LEVEL_QUIET) fprintf( stderr , "Exit request sent.\r\n"); exit(0); case 5: if (mux_client_forwards(sock, 0) != 0) sshfatal("mux.c", __func__, 2317, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "master forward request failed"); exit(0); case 1: if (mux_client_forwards(sock, 0) != 0) { sshlog("mux.c", __func__, 2321, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "master forward request failed"); return -1; } mux_client_request_session(sock); return -1; case 4: mux_client_request_stdio_fwd(sock); exit(0); case 6: mux_client_request_stop_listening(sock); if (options.log_level != SYSLOG_LEVEL_QUIET) fprintf( stderr , "Stop listening request sent.\r\n"); exit(0); case 7: if (mux_client_forwards(sock, 1) != 0) sshlog("mux.c", __func__, 2336, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "master cancel forward request failed"); exit(0); case 8: mux_client_proxy(sock); return (sock); default: sshfatal("mux.c", __func__, 2342, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "unrecognised muxclient_command %d", muxclient_command); } }
long long muxclient(char *a0) { unsigned long v0; unsigned int v1; unsigned int v2; char v3; char v4; unsigned long long v5; unsigned long v6; unsigned long long v7; unsigned long v8; char v9; unsigned long long v11; unsigned int v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; unsigned long long v16; if (!muxclient_command) { if (*(5247856)) muxclient_command = 4; else muxclient_command = 1; } if (*(5247936) == 4) { LABEL_4087e0: sshlog("mux.c", "muxclient", 0x8cf, 0x0, 0x5, 0x0, "auto-mux: Trying existing master"); LABEL_40882a: memset(&v3, 0x0, 0x6e); v3 = 1; if (strlcpy(&v4, a0, 0x6c, &v4) > 107) { v0 = a0; sshfatal("mux.c", "muxclient", 0x8dc, 0x0, 0x1, 0x0, "ControlPath too long ('%s' >= %u bytes)"); } v1 = socket(0x1, 0x1, 0x0); if (v1 == -1) { v8 = strerror(*(__errno_location())); v7 = "socket(): %s"; sshfatal("mux.c", "muxclient", 0x8e0, 0x1, 0x1, 0x0, *(&v9)); } v12 = 110; if (connect(v1, &v3, 0x6e) == -1) { if (muxclient_command != 1 && muxclient_command != 4) { v7 = strerror(*(__errno_location())); v6 = a0; v5 = "Control socket connect(%.100s): %s"; sshfatal("mux.c", "muxclient", 0x8e8, 0x0, 0x1, 0x0, *(&v9)); } if (*(__errno_location()) == 111 && *(5247936)) { v8 = a0; v7 = "Stale control socket %.100s, unlinking"; sshlog("mux.c", "muxclient", 0x8ed, 0x0, 0x5, 0x0, *(&v9)); unlink(a0); goto LABEL_408aa6; } if (*(__errno_location()) == 2) { v8 = a0; v7 = "Control socket \"%.100s\" does not exist"; sshlog("mux.c", "muxclient", 0x8f0, 0x0, 0x5, 0x0, *(&v9)); } else { v7 = strerror(*(__errno_location())); v6 = a0; v5 = "Control socket connect(%.100s): %s"; sshlog("mux.c", "muxclient", 0x8f2, 0x0, 0x2, 0x0, *(&v9)); } LABEL_408aa6: close(v1); v11 = 4294967295; } else { set_nonblock(v1); if (mux_client_hello_exchange(v1, &v3, v13, v14, v15, v16)) { v7 = "master hello exchange failed"; sshlog("mux.c", "muxclient", 0x8fb, 0x1, 0x2, 0x0, *(&v9)); close(v1); v11 = 4294967295; } else { switch (muxclient_command) { case 1: if (mux_client_forwards(v1, 0x0)) { v7 = "master forward request failed"; sshlog("mux.c", "muxclient", 0x911, 0x1, 0x2, 0x0, *(&v9)); v11 = 4294967295; break; } else { mux_client_request_session(v1); v11 = 4294967295; break; } case 2: v2 = mux_client_request_alive(v1); if (!v2) { v7 = "master alive check failed"; sshfatal("mux.c", "muxclient", 0x903, 0x1, 0x1, 0x0, *(&v9)); } fprintf(*(&stderr), "Master running (pid=%u)\r\n", v2); exit(0x0); case 3: mux_client_request_terminate(v1); if (*(&sshbuf_put)) fprintf(*(&stderr), "Exit request sent.\r\n"); exit(0x0); case 4: mux_client_request_stdio_fwd(v1); exit(0x0); case 5: if (mux_client_forwards(v1, 0x0)) { v7 = "master forward request failed"; sshfatal("mux.c", "muxclient", 0x90d, 0x1, 0x1, 0x0, *(&v9)); } exit(0x0); case 6: mux_client_request_stop_listening(v1); if (*(&sshbuf_put)) fprintf(*(&stderr), "Stop listening request sent.\r\n"); exit(0x0); case 7: if (mux_client_forwards(v1, 0x1)) { v7 = "master cancel forward request failed"; sshlog("mux.c", "muxclient", 0x920, 0x1, 0x2, 0x0, *(&v9)); } exit(0x0); case 8: mux_client_proxy(v1, &v3, &g_40a354, v14, v15, v16); v11 = v1; break; default: v8 = muxclient_command; v7 = "unrecognised muxclient_command %d"; v11 = sshfatal("mux.c", "muxclient", 0x926, 0x0, 0x1, 0x0, *(&v9)); } } } LABEL_408df1: return v11; } else { if (*(5247936) <= 4) { if (!*(5247936)) goto LABEL_40882a; if (*(5247936) == 2) goto LABEL_4087e0; } v11 = 4294967295; goto LABEL_408df1; } }
static int compare_names (struct name const *n1, struct name const *n2) { return strcmp (n1->name, n2->name); }
long long compare_names(struct_0 *a0, struct_0 *a1) { return strcmp(a0->field_10, a1->field_10); }
static int terminal_rebuffer_display(EditLine *el) { coord_t *c = &el->el_terminal.t_size; terminal_free_display(el); c->h = el->el_terminal.t_val[3]; c->v = el->el_terminal.t_val[2]; if (terminal_alloc_display(el) == -1) return -1; return 0; }
long terminal_rebuffer_display(long a1) { terminal_free_display(a1); *(_DWORD *)(a1 + 144) = *(_DWORD *)(*(_QWORD *)(a1 + 184) + 12LL); *(_DWORD *)(a1 + 148) = *(_DWORD *)(*(_QWORD *)(a1 + 184) + 8LL); if ( (unsigned int)terminal_alloc_display(a1) == -1 ) return 0xFFFFFFFFLL; else return 0LL; }
static int read_char(EditLine *el, wchar_t *cp) { ssize_t num_read; int tried = (el->el_flags & 0x100) == 0; char cbuf[ 16 ]; size_t cbp = 0; int save_errno = (*__errno_location ()) ; again: el->el_signal->sig_no = 0; while ((num_read = read(el->el_infd, cbuf + cbp, (size_t)1)) == -1) { int e = (*__errno_location ()) ; switch (el->el_signal->sig_no) { case 18 : el_wset(el, 20); case 28 : sig_set(el); goto again; default: break; } if (!tried && read__fixio(el->el_infd, e) == 0) { (*__errno_location ()) = save_errno; tried = 1; } else { (*__errno_location ()) = e; *cp = L'\0'; return -1; } } if (num_read == 0) { *cp = L'\0'; return 0; } for (;;) { mbstate_t mbs; ++cbp; memset(&mbs, 0, sizeof(mbs)); switch (mbrtowc(cp, cbuf, cbp, &mbs)) { case (size_t)-1: if (cbp > 1) { cbuf[0] = cbuf[cbp - 1]; cbp = 0; break; } else { cbp = 0; goto again; } case (size_t)-2: if (cbp >= 16 ) { (*__errno_location ()) = 84 ; *cp = L'\0'; return -1; } goto again; default: return 1; } } }
long read_char(long a1, wchar_t *a2) { int v2; int fixio; size_t v5; _BOOL4 v6; int v7; int v8; size_t n; ssize_t v10; mbstate_t s; char v12[24]; unsigned long v13; v13 = __readfsqword(0x28u); v6 = (*(_DWORD *)(a1 + 44) & 0x100) == 0; n = 0LL; v7 = *_errno_location(); LABEL_2: while ( 2 ) { *(_DWORD *)(*(_QWORD *)(a1 + 1208) + 1192LL) = 0; while ( 1 ) { v10 = read(*(_DWORD *)(a1 + 32), &v12[n], 1uLL); if ( v10 != -1 ) break; v8 = *_errno_location(); v2 = *(_DWORD *)(*(_QWORD *)(a1 + 1208) + 1192LL); if ( v2 == 18 ) { el_wset(a1, 20LL); LABEL_8: sig_set(a1); goto LABEL_2; } if ( v2 == 28 ) goto LABEL_8; if ( v6 || (fixio = read__fixio(*(_DWORD *)(a1 + 32), v8)) != 0 ) { *_errno_location() = v8; *a2 = 0; return 0xFFFFFFFFLL; } *_errno_location() = v7; v6 = 1; } if ( v10 ) { while ( 1 ) { ++n; memset(&s, 0, sizeof(s)); v5 = mbrtowc(a2, v12, n, &s); if ( v5 == -2LL ) break; if ( v5 != -1LL ) return 1LL; if ( n <= 1 ) { n = 0LL; goto LABEL_2; } v12[0] = v12[n - 1]; n = 0LL; } if ( n <= 0xF ) continue; *_errno_location() = 84; *a2 = 0; return 0xFFFFFFFFLL; } else { *a2 = 0; return 0LL; } } }
static ssize_t wait_for_text(socket_st * socket, const char *txt, unsigned txt_size) { char buf[1024]; char *pbuf, *p; int ret; fd_set read_fds; struct timeval tv; size_t left, got; if (txt_size > sizeof(buf)) abort(); if (socket->verbose && txt != ((void *)0) ) fprintf( stderr , "starttls: waiting for: \"%.*s\"\n", txt_size, txt); pbuf = buf; left = sizeof(buf)-1; got = 0; do { do { unsigned int __i; fd_set *__arr = ( &read_fds ); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) ((__arr)->fds_bits)[__i] = 0; } while (0) ; ((void) ((( &read_fds )->fds_bits)[(( socket->fd ) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << (( socket->fd ) % (8 * (int) sizeof (__fd_mask))))))) ; tv.tv_sec = 10; tv.tv_usec = 0; ret = select(socket->fd + 1, &read_fds, ((void *)0) , ((void *)0) , &tv); if (ret > 0) ret = recv(socket->fd, pbuf, left, 0); if (ret == -1) { fprintf( stderr , "error receiving '%s': %s\n", txt, strerror( (*__errno_location ()) )); exit(2); } else if (ret == 0) { fprintf( stderr , "error receiving '%s': Timeout\n", txt); exit(2); } pbuf[ret] = 0; if (txt == ((void *)0) ) break; if (socket->verbose) fprintf( stderr , "starttls: received: %s\n", pbuf); pbuf += ret; left -= ret; got += ret; if (got > txt_size) { p = memmem(buf, got, txt, txt_size); if (p != ((void *)0) && p != buf) { p--; if (*p == '\n' || *p == '\r' || (*txt == '<' && *p == '>')) break; } } } while(got < txt_size || strncmp(buf, txt, txt_size) != 0); return got; }
void wait_for_text(unsigned int a0[19], char *a1, unsigned long a2) { unsigned int v0; unsigned int v1; char *v2; unsigned long v3; void* v4; unsigned long long *v5; unsigned long v6; unsigned long long v7; void* v8; char v9; char v10; void* v12; if (a2 > 0x400) abort(); if (a0[18] && a1) fprintf(stderr, "starttls: waiting for: \"%.*s\"\n", a2); v2 = &v10; v3 = 1023; v4 = 0; while (true) { v5 = &v9; for (v1 = 0; v1 <= 15; v1 += 1) { v5[v1] = 0; } *(&(&v9)[8 * ((a0[0] < 0 ? a0[0] + 63 : a0[0]) >> 6)]) = *(&(&v9)[8 * ((a0[0] < 0 ? a0[0] + 63 : a0[0]) >> 6)]) | 1 << (((a0[0] + (a0[0] >> 31 >> 26) & 63) - (a0[0] >> 31 >> 26)) & 63); v7 = 10; v8 = 0; v0 = select(a0[0] + 1, &v9, NULL, NULL, &v7); if (v0 > 0) v0 = recv(a0[0], v2, v3, 0x0); if (v0 == -1) { fprintf(stderr, "error receiving '%s': %s\n", a1, strerror(*(__errno_location()))); exit(0x2); } if (!v0) { fprintf(stderr, "error receiving '%s': Timeout\n", a1); exit(0x2); } v2[v0] = 0; if (!a1) break; if (a0[18]) fprintf(stderr, "starttls: received: %s\n", v2); v2 = &v2[v0]; v3 -= v0; v4 += v0; if (v4 > a2) { v6 = memmem(&v10, v4, a1, a2); if (v6 && v6 != &v10) { v6 -= 1; if (*(v6) == 10) break; if (*(v6) == 13) break; if (*(a1) == 60 && *(v6) == 62) break; } } if (v4 < a2) continue; if (!strncmp(&v10, a1, a2)) break; } v12 = v4; return; }
static void parse_default_options (struct tar_args *args) { char *opts = getenv ("TAR_OPTIONS"); struct wordsplit ws; struct option_locus loc = { OPTS_ENVIRON, "TAR_OPTIONS", 0, 0 }; struct option_locus *save_loc_ptr; if (!opts) return; ws.ws_offs = 1; if (wordsplit (opts, &ws, (0x00000040 | 0x00000004 | (0x00000200|0x00000400) | 0x00000800 | 0x02000000)|0x00000002)) do { if (error_hook) error_hook (); error (0, 0, gettext ("cannot split TAR_OPTIONS: %s"), wordsplit_strerror (&ws)); fatal_exit (); } while (0) ; if (ws.ws_wordc) { int idx; ws.ws_wordv[0] = (char*) program_name; save_loc_ptr = args->loc; args->loc = &loc; if (argp_parse (&argp, ws.ws_offs + ws.ws_wordc, ws.ws_wordv, 0x08|0x20, &idx, args)) abort (); args->loc = save_loc_ptr; if (name_more_files ()) do { if (error_hook) error_hook (); error (0, 0, gettext ("non-option arguments in %s"), loc.name); usage (2); } while (0); ws.ws_wordc = 0; } wordsplit_free (&ws); }
void parse_default_options(long *param_1) { char *pcVar1; char cVar2; int iVar3; undefined8 uVar4; undefined8 uVar5; long in_FS_OFFSET; undefined local_13c [4]; char *local_138; long local_130; undefined4 local_128 [2]; char *local_120; undefined8 local_118; undefined8 local_110; long local_108; undefined8 *local_100; undefined8 local_f8; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_138 = getenv("TAR_OPTIONS"); local_128[0] = 0; local_120 = "TAR_OPTIONS"; local_118 = 0; local_110 = 0; if (local_138 != (char *)0x0) { local_f8 = 1; iVar3 = wordsplit(local_138,&local_108,0x2000e46); if (iVar3 != 0) { if (error_hook != (code *)0x0) { (*error_hook)(); } uVar4 = wordsplit_strerror(&local_108); uVar5 = gettext("cannot split TAR_OPTIONS: %s"); error(0,0,uVar5,uVar4); fatal_exit(); } if (local_108 != 0) { *local_100 = program_name; local_130 = *param_1; *param_1 = (long)local_128; iVar3 = argp_parse(argp,(int)local_108 + (int)local_f8,local_100,0x28,local_13c,param_1); if (iVar3 != 0) { abort(); } *param_1 = local_130; cVar2 = name_more_files(); if (cVar2 != '\0') { if (error_hook != (code *)0x0) { (*error_hook)(); } pcVar1 = local_120; uVar4 = gettext("non-option arguments in %s"); error(0,0,uVar4,pcVar1); usage(2); } local_108 = 0; } wordsplit_free(&local_108); } if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
static void find_identical_ends (struct file_data filevec[]) { size_t *w0, *w1; char *p0, *p1, *buffer0, *buffer1; char const *end0, *beg0; char const **linbuf0, **linbuf1; lin i, lines; size_t n0, n1; lin alloc_lines0, alloc_lines1; _Bool prefix_needed; lin buffered_prefix, prefix_count, prefix_mask; lin middle_guess, suffix_guess; slurp (&filevec[0]); prepare_text (&filevec[0]); if (filevec[0].desc != filevec[1].desc) { slurp (&filevec[1]); prepare_text (&filevec[1]); } else { filevec[1].buffer = filevec[0].buffer; filevec[1].bufsize = filevec[0].bufsize; filevec[1].buffered = filevec[0].buffered; filevec[1].missing_newline = filevec[0].missing_newline; } w0 = filevec[0].buffer; w1 = filevec[1].buffer; p0 = buffer0 = (char *) w0; p1 = buffer1 = (char *) w1; n0 = filevec[0].buffered; n1 = filevec[1].buffered; if (p0 == p1) p0 = p1 += n1; else { if (n0 < n1) p0[n0] = ~p1[n0]; else p1[n1] = ~p0[n1]; while (*w0 == *w1) w0++, w1++; p0 = (char *) w0; p1 = (char *) w1; while (*p0 == *p1) p0++, p1++; if (((output_style) != OUTPUT_ED && (output_style) != OUTPUT_FORWARD_ED) && ((buffer0 + n0 - filevec[0].missing_newline < p0) != (buffer1 + n1 - filevec[1].missing_newline < p1))) p0--, p1--; } i = horizon_lines; while (p0 != buffer0 && (p0[-1] != '\n' || i--)) p0--, p1--; filevec[0].prefix_end = p0; filevec[1].prefix_end = p1; p0 = buffer0 + n0; p1 = buffer1 + n1; if (! ((output_style) != OUTPUT_ED && (output_style) != OUTPUT_FORWARD_ED) || filevec[0].missing_newline == filevec[1].missing_newline) { end0 = p0; beg0 = filevec[0].prefix_end + (n0 < n1 ? 0 : n0 - n1); while (p0 != beg0) if (*--p0 != *--p1) { ++p0, ++p1; beg0 = p0; break; } i = horizon_lines + !((buffer0 == p0 || p0[-1] == '\n') && (buffer1 == p1 || p1[-1] == '\n')); while (i-- && p0 != end0) while (*p0++ != '\n') continue; p1 += p0 - beg0; } filevec[0].suffix_begin = p0; filevec[1].suffix_begin = p1; if (no_diff_means_no_output && ! function_regexp.fastmap && context < (9223372036854775807L) / 4 && context < n0) { middle_guess = guess_lines (0, 0, p0 - filevec[0].prefix_end); suffix_guess = guess_lines (0, 0, buffer0 + n0 - p0); for (prefix_count = 1; prefix_count <= context; prefix_count *= 2) continue; alloc_lines0 = (prefix_count + middle_guess + ((context) <= (suffix_guess) ? (context) : (suffix_guess))); } else { prefix_count = 0; alloc_lines0 = guess_lines (0, 0, n0); } prefix_mask = prefix_count - 1; lines = 0; linbuf0 = xmalloc (alloc_lines0 * sizeof *linbuf0); prefix_needed = ! (no_diff_means_no_output && filevec[0].prefix_end == p0 && filevec[1].prefix_end == p1); p0 = buffer0; if (prefix_needed) { end0 = filevec[0].prefix_end; while (p0 != end0) { lin l = lines++ & prefix_mask; if (l == alloc_lines0) { if ( (9223372036854775807L) / (2 * sizeof *linbuf0) <= alloc_lines0) xalloc_die (); alloc_lines0 *= 2; linbuf0 = xrealloc (linbuf0, alloc_lines0 * sizeof *linbuf0); } linbuf0[l] = p0; while (*p0++ != '\n') continue; } } buffered_prefix = prefix_count && context < lines ? context : lines; middle_guess = guess_lines (lines, p0 - buffer0, p1 - filevec[1].prefix_end); suffix_guess = guess_lines (lines, p0 - buffer0, buffer1 + n1 - p1); alloc_lines1 = buffered_prefix + middle_guess + ((context) <= (suffix_guess) ? (context) : (suffix_guess)); if (alloc_lines1 < buffered_prefix || (9223372036854775807L) / sizeof *linbuf1 <= alloc_lines1) xalloc_die (); linbuf1 = xmalloc (alloc_lines1 * sizeof *linbuf1); if (buffered_prefix != lines) { for (i = 0; i < buffered_prefix; i++) linbuf1[i] = linbuf0[(lines - context + i) & prefix_mask]; for (i = 0; i < buffered_prefix; i++) linbuf0[i] = linbuf1[i]; } for (i = 0; i < buffered_prefix; i++) linbuf1[i] = linbuf0[i] - buffer0 + buffer1; filevec[0].linbuf = linbuf0 + buffered_prefix; filevec[1].linbuf = linbuf1 + buffered_prefix; filevec[0].linbuf_base = filevec[1].linbuf_base = - buffered_prefix; filevec[0].alloc_lines = alloc_lines0 - buffered_prefix; filevec[1].alloc_lines = alloc_lines1 - buffered_prefix; filevec[0].prefix_lines = filevec[1].prefix_lines = lines; }
void find_identical_ends(struct_0 *a0) { int tmp_9; char v0; int tmp_15; void* v1; void* v2; void* v3; void* v4; char *v5; void* v6; void* v7; void* v8; char v9; unsigned long long v10; void* v11; void* v12; void* v13; void* v14; char *v15; unsigned long v16; unsigned long long v17; unsigned long v18; void* v19; void* v20; unsigned long long v21; void* v22; unsigned int v24; void* v25; unsigned long long v26; unsigned long long v27; unsigned long long v28; char v29; void* v30; void* v31; void* v32; unsigned long long v33; struct_0 *v34; slurp(a0); prepare_text(a0); if (a0->field_0 != a0->field_130) { slurp(&a0->field_130); prepare_text(&a0->field_130); } else { a0->field_1d0 = a0->field_a0; a0->field_1d8 = a0->field_a8; a0->field_1e0 = a0->field_b0; a0->field_250 = a0->field_120; } v1 = a0->field_a0; v2 = a0->field_1d0; v11 = v1; v3 = v11; v12 = v2; v4 = v12; v13 = a0->field_b0; v14 = a0->field_1e0; if (v3 == v4) { v4 += v14; v3 = v4; } else { if (v13 < v14) { v24 = v3; *((v13 + v3)) = !(*((v13 + v4))); } else { v24 = v4; *((v14 + v4)) = !(*((v14 + v3))); } for (; *(v1) == *(v2); v2 += 8) { v1 += 8; } v3 = v1; for (v4 = v2; *(v3) == *(v4); v4 += 1) { v3 += 1; } if (output_style != 4 && output_style != 5) { *(&v24) = !(v3 <= v11 + v13 - a0->field_120); v29 = v12 + v14 - a0->field_250; *(&v29) = !(v4 <= v12 + v14 - a0->field_250); *(&v29) = v29 ^ v24; if (v29) { v3 -= 1; v4 -= 1; } } } for (v7 = horizon_lines; v3 != v11; v4 -= 1) { if (v3[1] == 10) { v29 = v7; v7 -= 1; if (!v29) break; } v3 -= 1; } a0->field_e0 = v3; a0->field_210 = v4; v3 = v13 + v11; v4 = v14 + v12; if (output_style == 5 || output_style == 4 || a0->field_120 == a0->field_250) { v15 = v3; if (v13 >= v14) v25 = v13 - v14; else v25 = 0; v26 = v25 + a0->field_e0; v5 = v26; while (v3 != v5) { v3 -= 1; v4 = &v4[1]; if (*(v3) == *(v4)) continue; v3 += 1; v4 = &v4[1]; v5 = v3; break; } if ((v12 != v4 || v11 != v3) && (v12 != v4 || v3[1] != 10) && (v4[1] != 10 || v11 != v3) && (v4[1] != 10 || v3[1] != 10)) v27 = 1; else v27 = 0; v28 = horizon_lines + v27; v7 = v28; while (true) { v29 = v7; v7 -= 1; if (!v29) break; if (v3 == v15) break; do { tmp_9 = v3; v3 = &v3[1]; *(&v29) = *(tmp_9); } while (v29 != 10); } v4 = v4 + v3 + -0x1 * v5; } a0->field_f0 = v3; a0->field_220 = v4; if (no_diff_means_no_output && !*(5243096) && context <= 2305843009213693950 && v13 > context) { v16 = guess_lines(0x0, 0x0); v17 = guess_lines(0x0, 0x0); for (v10 = 1; v10 <= context; v10 *= 2); v30 = context; if (v17 <= context) v30 = v17; v29 = v30 + v10 + v16; v9 = v29; } if (!no_diff_means_no_output || v13 <= context || context > 2305843009213693950 || *(5243096)) { v10 = 0; *(&v9) = guess_lines(0x0, 0x0); } v18 = v10 - 1; v8 = 0; v6 = xmalloc(*(&v9) * 8); if (!(no_diff_means_no_output ^ 1) && v3 == a0->field_e0 && v4 == a0->field_210) v29 = 0; if (v3 != a0->field_e0 || (no_diff_means_no_output ^ 1) || v4 != a0->field_210) v29 = 1; v0 = v29; v0 &= 1; v3 = v11; if (v0) { v15 = a0->field_e0; while (v3 != v15) { tmp_15 = v8; v8 += 1; v19 = tmp_15 & v18; if (v19 == *(&v9)) { if (*(&v9) > 576460752303423486) xalloc_die(); *(&v9) = *(&v9) * 2; v6 = xrealloc(v6, *(&v9) * 8, *(&v9) * 8); } if (*(&v9) <= 576460752303423486 || v19 != *(&v9)) { *((0x8 * v19 + v6)) = v3; do { tmp_9 = v3; v3 = &v3[1]; v29 = *(tmp_9); } while (v29 != 10); } } } if (v10 && v8 > context) v31 = context; if (v8 <= context || !v10) v31 = v8; v20 = v31; v16 = guess_lines(v8, v3 - v11); v17 = guess_lines(v8, v3 - v11); v32 = context; if (v17 <= context) v32 = v17; v33 = v32 + v20 + v16; v21 = v33; if (v21 >= v20 && v21 <= 1152921504606846974) { v22 = xmalloc(v21 * 8); if (v20 != v8) { for (v7 = 0; v7 < v20; v7 += 1) { *((v22 + 0x8 * v7)) = *((v6 + 8 * (v7 + v8 - context & v18))); } for (v7 = 0; v7 < v20; v7 += 1) { *((v6 + 0x8 * v7)) = *((v22 + 0x8 * v7)); } } for (v7 = 0; v7 < v20; v7 += 1) { *((v22 + 0x8 * v7)) = v12 + *((v6 + 0x8 * v7)) - v11; } a0->field_b8 = v20 * 8 + v6; a0->field_1e8 = v22 + v20 * 8; a0->field_1f0 = -(v20); a0->field_c0 = a0->field_1f0; a0->field_d8 = *(&v9) - v20; a0->field_208 = v21 - v20; a0->field_218 = v8; v34 = a0; a0->field_e8 = a0->field_218; return; } if (v21 < v20 || v21 > 1152921504606846974) xalloc_die(); }
get_stat_mtime (struct stat const *st) { return ((st)->st_mtim); }
void get_stat_mtime(void) { halt_baddata(); }
static void client_suspend_self(struct sshbuf *bin, struct sshbuf *bout, struct sshbuf *berr) { if (sshbuf_len(bout) > 0) atomicio((ssize_t (*)(int, void *, size_t))write, fileno( stdout ), sshbuf_mutable_ptr(bout), sshbuf_len(bout)); if (sshbuf_len(berr) > 0) atomicio((ssize_t (*)(int, void *, size_t))write, fileno( stderr ), sshbuf_mutable_ptr(berr), sshbuf_len(berr)); leave_raw_mode(options.request_tty == 3); sshbuf_reset(bin); sshbuf_reset(bout); sshbuf_reset(berr); kill(getpid(), 20 ); received_window_change_signal = 1; enter_raw_mode(options.request_tty == 3); }
long client_suspend_self(long a1, long a2, long a3) { long v3; long v4; unsigned int v5; long v6; long v7; unsigned int v8; __pid_t v9; if ( sshbuf_len(a2) ) { v3 = sshbuf_len(a2); v4 = sshbuf_mutable_ptr(a2); v5 = fileno(stdout); atomicio(&write, v5, v4, v3); } if ( sshbuf_len(a3) ) { v6 = sshbuf_len(a3); v7 = sshbuf_mutable_ptr(a3); v8 = fileno(stderr); atomicio(&write, v8, v7, v6); } leave_raw_mode(options[1257] == 3); sshbuf_reset(a1); sshbuf_reset(a2); sshbuf_reset(a3); v9 = getpid(); kill(v9, 20); received_window_change_signal = 1; return enter_raw_mode(options[1257] == 3); }
COMMAND * make_until_command (test, action) COMMAND *test, *action; { return (make_until_or_while (cm_until, test, action)); }
long long make_until_command(unsigned int a0, unsigned int a1) { return make_until_or_while(0x8, a0, a1); }
static void install_cleanup (int sigterm) { struct sigaction sa; sigemptyset (&sa.sa_mask); sa. __sigaction_handler.sa_handler = cleanup; sa.sa_flags = 0x10000000 ; sigaction ( 14 , &sa, ((void *)0) ); sigaction ( 2 , &sa, ((void *)0) ); sigaction ( 3 , &sa, ((void *)0) ); sigaction ( 1 , &sa, ((void *)0) ); sigaction ( 15 , &sa, ((void *)0) ); sigaction (sigterm, &sa, ((void *)0) ); }
void install_cleanup(unsigned long a0) { unsigned long long v0; char v1; unsigned int v2; char v3; unsigned long long *v5; unsigned long long v6; sigemptyset(&v1); v0 = cleanup; v2 = 0x10000000; sigaction(0xe, &v0, 0x0); sigaction(0x2, &v0, 0x0); sigaction(0x3, &v0, 0x0); sigaction(0x1, &v0, 0x0); sigaction(0xf, &v0, 0x0); sigaction(a0, &v0, 0x0); v6 = *(&v3) ^ v5[5]; return; }
static long double powerld (long double base, unsigned int x) { long double result = base; if (x == 0) return 1; while (--x) result *= base; return result; }
void powerld(unsigned long a0) { unsigned int v0; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; v0 = a0; [D] t4 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t12) v3 = v2 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v4 = v3 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v4 = v3 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } if ([D] GetI(968:I8x8)[t4,0]) { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 v10 = v4 + 1; } else { [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3) [D] PutI(968:I8x8)[t7,0] = 0x00 v10 = v4 + 1; } if (!v0) { [D] PutI(904:F64x8)[t0,0] = t3 [D] PutI(968:I8x8)[t0,0] = 0x01 return; } while (true) { v0 = v0 - 1; if (!v0) break; [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v5 = v10 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v6 = v5 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v6 = v5 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v7 = v6 - 1; if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v8 = v7 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } else { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) v8 = v7 - 1; [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 } [D] PutI(904:F64x8)[t1,1] = t2 [D] PutI(968:I8x8)[t1,1] = 0x01 [D] PutI(968:I8x8)[t1,0] = 0x00 v9 = v8 + 1; [D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t21,t23) [D] PutI(968:I8x8)[t27,0] = 0x00 v10 = v9 + 1; } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) if ([D] GetI(968:I8x8)[t4,0]) { [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 return; } [D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2) [D] PutI(904:F64x8)[t4,0] = t7 [D] PutI(968:I8x8)[t4,0] = 0x01 return; }
static void ssh_init_forwarding(struct ssh *ssh, char **ifname) { int success = 0; int i; ssh_init_forward_permissions(ssh, "permitremoteopen", options.permitted_remote_opens, options.num_permitted_remote_opens); if (options.exit_on_forward_failure) forward_confirms_pending = 0; for (i = 0; i < options.num_local_forwards; i++) { sshlog("ssh.c", __func__, 1944, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Local connections to %.200s:%d forwarded to remote " "address %.200s:%d", (options.local_forwards[i].listen_path != ((void *)0) ) ? options.local_forwards[i].listen_path : (options.local_forwards[i].listen_host == ((void *)0) ) ? (options.fwd_opts.gateway_ports ? "*" : "LOCALHOST") : options.local_forwards[i].listen_host, options.local_forwards[i].listen_port, (options.local_forwards[i].connect_path != ((void *)0) ) ? options.local_forwards[i].connect_path : options.local_forwards[i].connect_host, options.local_forwards[i].connect_port) ; success += channel_setup_local_fwd_listener(ssh, &options.local_forwards[i], &options.fwd_opts); } if (i > 0 && success != i && options.exit_on_forward_failure) sshfatal("ssh.c", __func__, 1960, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Could not request local forwarding."); if (i > 0 && success == 0) sshlog("ssh.c", __func__, 1962, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Could not request local forwarding."); for (i = 0; i < options.num_remote_forwards; i++) { sshlog("ssh.c", __func__, 1966, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Remote connections from %.200s:%d forwarded to " "local address %.200s:%d", (options.remote_forwards[i].listen_path != ((void *)0) ) ? options.remote_forwards[i].listen_path : (options.remote_forwards[i].listen_host == ((void *)0) ) ? "LOCALHOST" : options.remote_forwards[i].listen_host, options.remote_forwards[i].listen_port, (options.remote_forwards[i].connect_path != ((void *)0) ) ? options.remote_forwards[i].connect_path : options.remote_forwards[i].connect_host, options.remote_forwards[i].connect_port) ; if ((options.remote_forwards[i].handle = channel_request_remote_forwarding(ssh, &options.remote_forwards[i])) >= 0) { client_register_global_confirm( ssh_confirm_remote_forward, &options.remote_forwards[i]); forward_confirms_pending++; } else if (options.exit_on_forward_failure) sshfatal("ssh.c", __func__, 1985, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Could not request remote forwarding."); else sshlog("ssh.c", __func__, 1987, 0, SYSLOG_LEVEL_INFO, ((void *)0) , "Warning: Could not request remote forwarding."); } if (options.tun_open != 0x00) { if ((*ifname = client_request_tun_fwd(ssh, options.tun_open, options.tun_local, options.tun_remote, ssh_tun_confirm, ((void *)0) )) != ((void *)0) ) forward_confirms_pending++; else if (options.exit_on_forward_failure) sshfatal("ssh.c", __func__, 1997, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Could not request tunnel forwarding."); else sshlog("ssh.c", __func__, 1999, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "Could not request tunnel forwarding."); } if (forward_confirms_pending > 0) { sshlog("ssh.c", __func__, 2002, 1, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "expecting replies for %d forwards", forward_confirms_pending) ; } }
void ssh_init_forwarding(unsigned long long a0, unsigned long long *a1) { unsigned long v0; unsigned long v1; unsigned long v2; unsigned long long v3; unsigned long long v4; unsigned int v5; unsigned int v6; unsigned long v7; unsigned long long v8; unsigned long v9; char v10; unsigned long long v11; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; unsigned long long v16; unsigned long long v17; v3 = a0; v5 = 0; ssh_init_forward_permissions(v3, "permitremoteopen", 0xfedc7e8c78948d6, 0xfc7d83fc458900); forward_confirms_pending = 0; for (v6 = 0; v6 < 15760771; v6 = __addvsi3(v6, 0x1)) { if (*(((v6 * 7 << 3) + 10036535951075311656))) v12 = *((v6 * 56 + 10036535951075311656)); else v12 = *((v6 * 56 + 10036535951075311640)); if (*(((v6 * 7 << 3) + 10036535951075311632))) { v13 = *((v6 * 56 + 10036535951075311632)); } else if (!*(((v6 * 7 << 3) + 0x8b48f0458b480000))) { if (false) v13 = "LOCALHOST"; v13 = "*"; } else { v13 = *((v6 * 56 + 0x8b48f0458b480000)); } v2 = *((v6 * 56 + 10036535951075311648)); v1 = v12; v0 = *((v6 * 56 + 10036535951075311624)); sshlog("ssh.c", "ssh_init_forwarding", 0x798, 0x0, 0x5, 0x0, "Local connections to %.200s:%d forwarded to remote address %.200s:%d", v13); v5 = __addvsi3(v5, channel_setup_local_fwd_listener(v3, 0x8b48f0458b480000 + v6 * 56, &g_400048, 0x8b48f0458b480000 + v6 * 56)); } if (v6 > 0 && v5 != v6) { v2 = "Could not request local forwarding."; sshfatal("ssh.c", "ssh_init_forwarding", 0x7a8, 0x0, 0x1, 0x0); } if (v6 > 0 && !v5) { v8 = "Could not request local forwarding."; sshlog("ssh.c", "ssh_init_forwarding", 0x7aa, 0x0, 0x2, 0x0, *(&v10), v11); } for (v6 = 0; v6 < 0xc0854800; v6 = __addvsi3(v6, 0x1)) { if (*(((v6 * 7 << 3) + 4501487157288))) v14 = *((v6 * 56 + 4501487157288)); else v14 = *((v6 * 56 + 4501487157272)); if (*(((v6 * 7 << 3) + 4501487157264))) { v15 = *((v6 * 56 + 4501487157264)); } else if (*(((v6 * 7 << 3) + 0x418158b0000))) { v15 = *((v6 * 56 + 0x418158b0000)); } else { v15 = "LOCALHOST"; } v8 = *((v6 * 56 + 4501487157280)); v7 = v14; v5 = *((v6 * 56 + 4501487157256)); v4 = v15; v3 = "Remote connections from %.200s:%d forwarded to local address %.200s:%d"; sshlog("ssh.c", "ssh_init_forwarding", 0x7ae, 0x0, 0x5, 0x0, *(&v10), v11); *((0x418158b0000 + *((&v5 + 4)) * 56 + 52)) = channel_request_remote_forwarding(v3, 0x418158b0000 + *((&v5 + 4)) * 56, *((&v5 + 4)), 0x418158b0000 + *((&v5 + 4)) * 56); if (*((0x418158b0000 + (*((&v5 + 4)) * 7 << 3) + 52)) >= 0) { client_register_global_confirm(ssh_confirm_remote_forward, *((&v5 + 4)) * 56 + 0x418158b0000, *((&v5 + 4)), 0x418158b0000); forward_confirms_pending = __addvsi3(forward_confirms_pending, 0x1); } else { v8 = "Could not request remote forwarding."; sshfatal("ssh.c", "ssh_init_forwarding", 0x7c1, 0x0, 0x1, 0x0); v8 = "Warning: Could not request remote forwarding."; sshlog("ssh.c", "ssh_init_forwarding", 0x7c3, 0x0, 0x3, 0x0, *(&v10), v11); } } *(a1) = client_request_tun_fwd(v3, 0xc748f0458b48, 0xe90000000000c748, 0xa0e9000000, ssh_tun_confirm, 0x0); if (*(a1)) { forward_confirms_pending = __addvsi3(forward_confirms_pending, 0x1); } else { v8 = "Could not request tunnel forwarding."; sshfatal("ssh.c", "ssh_init_forwarding", 0x7cd, 0x0, 0x1, 0x0); v8 = "Could not request tunnel forwarding."; sshlog("ssh.c", "ssh_init_forwarding", 0x7cf, 0x0, 0x2, 0x0, *(&v10), v11); } v16 = forward_confirms_pending; if (forward_confirms_pending > 0) { v9 = forward_confirms_pending; v8 = "expecting replies for %d forwards"; v17 = sshlog("ssh.c", "ssh_init_forwarding", 0x7d2, 0x1, 0x5, 0x0, *(&v10), v11); } return; }
static void HashConfirm(unsigned char *h,const unsigned char *r,const unsigned char *pk,const unsigned char *cache) { unsigned char x[32*2]; int i; Hash_prefix(x,3,r,((761 +3)/4)); for (i = 0;i < 32;++i) x[32 +i] = cache[i]; Hash_prefix(h,2,x,sizeof x); }
void HashConfirm(char *a0, char *a1, unsigned long a2, char *a3) { unsigned long v0; unsigned int v1; char v2; char v3; unsigned long long *v5; unsigned long long v6; v0 = a2; Hash_prefix(&v2, 0x3, a1, 0xbf); for (v1 = 0; v1 <= 31; v1 = __addvsi3(v1, 0x1, a3[v1])) { (&v2)[__addvsi3(v1, 0x20, v1)] = a3[v1]; } Hash_prefix(a0, 0x2, &v2, 0x40); v6 = *(&v3) ^ v5[5]; return; }
, "channel %d: packet too big %u > %u", c->self, (256 * 1024), need) ; chan_rcvd_oclose(ssh, c); return; } if (read_mux(ssh, c, need + 4) < need + 4) return; if (c->mux_rcb(ssh, c) != 0) { sshlog("channels.c", __func__, 2262, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "channel %d: mux_rcb failed", c->self); chan_mark_dead(ssh, c); return; }
void chan_rcvd_oclose(void) { halt_baddata(); }
static void cfg_free(struct cfg *cfg) { while (cfg->overrides) { struct cfg_override *tmp = cfg->overrides; cfg->overrides = cfg->overrides->next; cfg_override_free(tmp); } while (cfg->searches) { struct cfg_search *tmp = cfg->searches; cfg->searches = cfg->searches->next; cfg_search_free(tmp); } while (cfg->externals) { struct cfg_external *tmp = cfg->externals; cfg->externals = cfg->externals->next; cfg_external_free(tmp); } while (cfg->excludes) { struct cfg_exclude *tmp = cfg->excludes; cfg->excludes = cfg->excludes->next; cfg_exclude_free(tmp); } }
void cfg_free(struct struct_0 *a0[519]) { unsigned long long *v0; unsigned long long *v1; unsigned long long *v2; unsigned long long *v3; unsigned long long *v5; while (a0[515]) { v3 = &a0[515]->field_0; a0[515] = a0[515]->field_0; cfg_override_free(v3); } while (a0[516]) { v2 = &a0[516]->field_0; a0[516] = a0[516]->field_0; cfg_search_free(v2); } while (a0[517]) { v1 = &a0[517]->field_0; a0[517] = a0[517]->field_0; cfg_external_free(v1); } while (true) { v5 = a0[518]; if (!a0[518]) break; v0 = &a0[518]->field_0; a0[518] = a0[518]->field_0; cfg_exclude_free(v0); } return; }
static inline void initialize_exit_failure (int status) { if (status != 1 ) exit_failure = status; }
void initialize_exit_failure(int param_1) { if (param_1 != 1) { _exit_failure = param_1; } return; }
static size_t format_code_offset (char const *directive) { size_t len = strspn (directive + 1, printf_flags); char const *fmt_char = directive + len + 1; fmt_char += strspn (fmt_char, digits); if (*fmt_char == '.') fmt_char += 1 + strspn (fmt_char + 1, digits); return fmt_char - directive; }
char * format_code_offset(long a1) { char *sa; char *s; sa = (char *)(strspn((const char *)(a1 + 1), "'-+ #0I") + 1 + a1); s = &sa[strspn(sa, "0123456789")]; if ( *s == 46 ) s += strspn(s + 1, "0123456789") + 1; return &s[-a1]; }
void arc4random_addrandom(unsigned char *dat, int datlen) { pthread_mutex_lock(&arc4random_mtx); _rs_stir_if_needed(datlen); _rs_rekey(dat, datlen); pthread_mutex_unlock(&arc4random_mtx); }
long long arc4random_addrandom(void* a0, unsigned long a1) { pthread_mutex_lock(&arc4random_mtx); _rs_stir_if_needed(a1); _rs_rekey(a0, a1); return pthread_mutex_unlock(&arc4random_mtx); }
static _Bool entry_comparator (const void *av, const void *bv) { const struct SharefileEntry *a=av, *b=bv; return (a->inode == b->inode) && (a->device == b->device); }
long long entry_comparator(unsigned long long a0[2], unsigned long long a1[2]) { unsigned int v1; unsigned long long v2; if (a0[1] == a1[1] && a0[0] == a1[0]) v1 = 1; if (a0[0] != a1[0] || a0[1] != a1[1]) v1 = 0; v2 = v1 & 1; return v2; }
void xtrace_print_arith_cmd (list) WORD_LIST *list; { WORD_LIST *w; xtrace_fp = (xtrace_fp ? xtrace_fp : stderr ); fprintf (xtrace_fp, "%s", indirection_level_string ()); fprintf (xtrace_fp, "(( "); for (w = list; w; w = w->next) fprintf (xtrace_fp, "%s%s", w->word->word, w->next ? " " : ""); fprintf (xtrace_fp, " ))\n"); fflush (xtrace_fp); }
long long xtrace_print_arith_cmd(unsigned long a0) { struct_0 *v0; unsigned int v2; if (*(&xtrace_fp)) v2 = *(&xtrace_fp); else v2 = stderr; *(&xtrace_fp) = v2; fprintf(*(&xtrace_fp), "%s", indirection_level_string()); fprintf(*(&xtrace_fp), "(( "); for (v0 = a0; v0; v0 = v0->field_0) { if (!v0->field_0) v2 = &g_403583; else v2 = " "; fprintf(*(&xtrace_fp), "%s%s", v0->field_8->field_0, v2); } fprintf(*(&xtrace_fp), " ))\n"); return fflush(*(&xtrace_fp)); }
static int monitor_allowed_key(const u_char *blob, u_int bloblen) { if (key_blob == ((void *)0) || key_bloblen != bloblen || timingsafe_bcmp(key_blob, blob, key_bloblen)) return (0); return (1); }
_BOOL8 monitor_allowed_key(long a1, int a2) { return key_blob && a2 == key_bloblen && !(unsigned int)timingsafe_bcmp(key_blob, a1, key_bloblen); }
int isnetconn (fd) int fd; { int rv; socklen_t l; struct sockaddr sa; l = sizeof(sa); rv = getpeername(fd, &sa, &l); return ((rv < 0 && ( (*__errno_location ()) == 88 || (*__errno_location ()) == 107 || (*__errno_location ()) == 22 || (*__errno_location ()) == 9 )) ? 0 : 1); }
long long isnetconn(unsigned long a0) { unsigned int v0; unsigned int v1; char v2; unsigned long long v8; v0 = 16; v1 = getpeername(a0, &v2, &v0); if (v1 >= 0) { LABEL_400076: v8 = 1; } else { if (*(__errno_location()) != 88 && *(__errno_location()) != 107 && *(__errno_location()) != 22) { if (*(__errno_location()) == 9) goto LABEL_40007d; goto LABEL_400076; } LABEL_40007d: v8 = 0; } return v8; }
void xheader_decode (struct tar_stat_info *st) { run_override_list (keyword_global_override_list, st); run_override_list (global_header_override_list, st); if (st->xhdr.size) { char *p = st->xhdr.buffer + 512; while (decode_record (&st->xhdr, &p, decx, st)) continue; } run_override_list (keyword_override_list, st); st->archive_file_size = st->stat.st_size; if (st->real_size_set) st->stat.st_size = st->real_size; }
long long xheader_decode(struct_0 *a0) { unsigned long v0; run_override_list(keyword_global_override_list, a0); run_override_list(global_header_override_list, a0); if (a0->field_170) { v0 = a0->field_178 + 0x200; do { } while (decode_record(&a0->padding_151[23], &v0, decx, a0)); } run_override_list(keyword_override_list, a0); a0->field_118 = a0->field_88; if (a0->field_150) { a0->field_88 = a0->field_148; return 0; } return 0; }
static long parse_number (const char *arg) { char *endptr = ((void *)0) ; (*__errno_location ()) = 0; long result; if (strncmp (arg, "0x", 2) == 0) result = strtol (arg + 2, &endptr, 16); else if (strncmp (arg, "0", 1) == 0 && strspn (arg, "012345678") == strlen (optarg)) result = strtol (arg + 1, &endptr, 8); else result = strtol (arg, &endptr, 10); if ( (*__errno_location ()) != 0 || (endptr && *endptr != '\0')) error ( 1 , (*__errno_location ()) , "'%s' is not a recognizable number.", arg); return result; }
long parse_number(char *param_1) { int iVar1; int *piVar2; size_t sVar3; size_t sVar4; long in_FS_OFFSET; char *local_30; long local_28; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_30 = (char *)0x0; piVar2 = __errno_location(); *piVar2 = 0; iVar1 = strncmp(param_1,"0x",2); if (iVar1 == 0) { local_28 = strtol(param_1 + 2,&local_30,0x10); } else { iVar1 = strncmp(param_1,"0",1); if (iVar1 == 0) { sVar3 = strspn(param_1,"012345678"); sVar4 = strlen(*ppcRam00000000001001c3); if (sVar3 == sVar4) { local_28 = strtol(param_1 + 1,&local_30,8); goto LAB_00100211; } } local_28 = strtol(param_1,&local_30,10); } LAB_00100211: piVar2 = __errno_location(); if ((*piVar2 == 0) && ((local_30 == (char *)0x0 || (*local_30 == '\0')))) { if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return local_28; } piVar2 = __errno_location(); error(1,*piVar2,"\'%s\' is not a recognizable number.",param_1); }
static int huft_build( unsigned *b, unsigned n, unsigned s, ush *d, ush *e, struct huft **t, int *m ) { unsigned a; unsigned c[16 +1]; unsigned f; int g; int h; register unsigned i; register unsigned j; register int k; int l; register unsigned *p; register struct huft *q; struct huft r; struct huft *u[16]; unsigned v[288]; register int w; unsigned x[16 +1]; unsigned *xp; int y; unsigned z; memset ((voidp)(c), 0, (sizeof(c))); p = b; i = n; do { ; c[*p]++; p++; } while (--i); if (c[0] == n) { q = (struct huft *) malloc (3 * sizeof *q); if (!q) return 3; hufts += 3; q[0].v.t = (struct huft *) ((void *)0) ; q[1].e = 99; q[1].b = 1; q[2].e = 99; q[2].b = 1; *t = q + 1; *m = 1; return 0; } l = *m; for (j = 1; j <= 16; j++) if (c[j]) break; k = j; if ((unsigned)l < j) l = j; for (i = 16; i; i--) if (c[i]) break; g = i; if ((unsigned)l > i) l = i; *m = l; for (y = 1 << j; j < i; j++, y <<= 1) if ((y -= c[j]) < 0) return 2; if ((y -= c[i]) < 0) return 2; c[i] += y; x[1] = j = 0; p = c + 1; xp = x + 2; while (--i) { *xp++ = (j += *p++); } p = b; i = 0; do { if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); n = x[g]; x[0] = i = 0; p = v; h = -1; w = -l; u[0] = (struct huft *) ((void *)0) ; q = (struct huft *) ((void *)0) ; z = 0; for (; k <= g; k++) { a = c[k]; while (a--) { while (k > w + l) { h++; w += l; z = (z = g - w) > (unsigned)l ? l : z; if ((f = 1 << (j = k - w)) > a + 1) { f -= a + 1; xp = c + k; if (j < z) while (++j < z) { if ((f <<= 1) <= *++xp) break; f -= *xp; } } z = 1 << j; if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == (struct huft *) ((void *)0) ) { if (h) huft_free(u[0]); return 3; } hufts += z + 1; *t = q + 1; *(t = &(q->v.t)) = (struct huft *) ((void *)0) ; u[h] = ++q; if (h) { x[h] = i; r.b = (uch)l; r.e = (uch)(16 + j); r.v.t = q; j = i >> (w - l); u[h-1][j] = r; } } r.b = (uch)(k - w); if (p >= v + n) r.e = 99; else if (*p < s) { r.e = (uch)(*p < 256 ? 16 : 15); r.v.n = (ush)(*p); p++; } else { r.e = (uch)e[*p - s]; r.v.n = d[*p++ - s]; } f = 1 << (k - w); for (j = i >> w; j < z; j += f) q[j] = r; for (j = 1 << (k - 1); i & j; j >>= 1) i ^= j; i ^= j; while ((i & ((1 << w) - 1)) != x[h]) { h--; w -= l; } } } return y != 0 && g != 1; }
long huft_build( unsigned int *a1, unsigned int a2, unsigned int a3, long a4, long a5, _QWORD *a6, unsigned int *a7) { unsigned int *v7; unsigned int v8; _QWORD *v9; unsigned int i; unsigned int j; int v13; int *v14; int *v15; long *v16; unsigned int *v17; unsigned int v18; unsigned int *v19; unsigned int v20; int v21; unsigned int v22; int *v23; int v24; char *v25; unsigned int v26; unsigned int v27; _QWORD *v28; _QWORD *v29; char v30; int *v31; unsigned int m; char *v33; unsigned int n; signed int v36; int v41; int v42; unsigned int v43; int v44; unsigned int v45; int v46; unsigned int v47; int v48; int v49; int v50; unsigned int v51; signed int v52; long *k; int *v54; long v55; char *v56; int s[20]; int v58[2]; long v59; long v60[16]; int v61[290]; unsigned long v62; v62 = __readfsqword(0x28u); memset(s, 0, 0x44uLL); v7 = a1; v8 = a2; do { ++s[*v7++]; --v8; } while ( v8 ); if ( a2 == s[0] ) { v9 = malloc(0x30uLL); if ( v9 ) { hufts += 3; v9[1] = 0LL; *((_BYTE *)v9 + 16) = 99; *((_BYTE *)v9 + 17) = 1; *((_BYTE *)v9 + 32) = 99; *((_BYTE *)v9 + 33) = 1; *a6 = v9 + 2; *a7 = 1; return 0LL; } else { return 3LL; } } else { v47 = *a7; for ( i = 1; i <= 0x10 && !s[i]; ++i ) ; v36 = i; if ( i > v47 ) v47 = i; for ( j = 16; j && !s[j]; --j ) ; v52 = j; if ( j < v47 ) v47 = j; *a7 = v47; v48 = 1 << i; while ( i < j ) { v49 = v48 - s[i]; if ( v49 < 0 ) return 2LL; ++i; v48 = 2 * v49; } v50 = v48 - s[j]; if ( v50 >= 0 ) { s[j] += v50; v13 = 0; v58[1] = 0; v14 = &s[1]; for ( k = &v59; --j; k = (long *)((char *)k + 4) ) { v15 = v14++; v13 += *v15; v16 = k; *(_DWORD *)v16 = v13; } v17 = a1; v18 = 0; do { v19 = v17++; v20 = *v19; if ( *v19 ) { v21 = v58[v20]; v58[v20] = v21 + 1; v61[v21] = v18; } ++v18; } while ( v18 < a2 ); v41 = v58[v52]; v22 = 0; v58[0] = 0; v23 = v61; v46 = -1; v24 = -v47; v60[0] = 0LL; v25 = 0LL; v51 = 0; while ( 1 ) { if ( v36 > v52 ) return v50 && v52 != 1; v42 = s[v36]; LABEL_68: if ( v42-- ) break; ++v36; } while ( 1 ) { if ( v36 <= (int)(v24 + v47) ) { if ( v23 < &v61[v41] ) { if ( a3 <= *v23 ) { LOBYTE(v55) = *(_WORD *)(2LL * (*v23 - a3) + a5); v31 = v23++; LOWORD(v56) = *(_WORD *)(2LL * (*v31 - a3) + a4); } else { if ( (unsigned int)*v23 > 0xFF ) v30 = 15; else v30 = 16; LOBYTE(v55) = v30; LOWORD(v56) = *v23++; } } else { LOBYTE(v55) = 99; } for ( m = v22 >> v24; m < v51; m += 1 << (v36 - v24) ) { v33 = &v25[16 * m]; BYTE1(v55) = v36 - v24; *(_QWORD *)v33 = v55; *((_QWORD *)v33 + 1) = v56; } for ( n = 1 << (v36 - 1); (n & v22) != 0; n >>= 1 ) v22 ^= n; v22 ^= n; while ( (v22 & ((1 << v24) - 1)) != v58[v46] ) { --v46; v24 -= v47; } goto LABEL_68; } ++v46; v24 += v47; if ( v52 - v24 <= v47 ) v26 = v52 - v24; else v26 = v47; v27 = v36 - v24; v43 = 1 << (v36 - v24); if ( v43 > v42 + 1 ) { v44 = v43 - v42 - 1; v54 = &s[v36]; if ( v27 < v26 ) { while ( ++v27 < v26 ) { v45 = 2 * v44; if ( v45 <= *++v54 ) break; v44 = v45 - *v54; } } } v51 = 1 << v27; v28 = malloc(16LL * (unsigned int)((1 << v27) + 1)); if ( !v28 ) break; hufts += v51 + 1; *a6 = v28 + 2; a6 = v28 + 1; v28[1] = 0LL; v25 = (char *)(v28 + 2); v60[v46] = (long)(v28 + 2); if ( v46 ) { v58[v46] = v22; BYTE1(v55) = v47; LOBYTE(v55) = v27 + 16; v56 = (char *)(v28 + 2); v29 = (_QWORD *)(v60[v46 - 1] + 16LL * (v22 >> (v24 - v47))); *v29 = v55; v29[1] = v25; } } if ( v46 ) huft_free(v60[0]); return 3LL; } else { return 2LL; } } }
char * user_command_matches (name, flags, state) const char *name; int flags, state; { register int i; int path_index, name_len; char *path_list, *path_element, *match; struct stat dotinfo; static char **match_list = ((void *)0) ; static int match_list_size = 0; static int match_index = 0; if (state == 0) { if (match_list == 0) { match_list_size = 5; match_list = strvec_create (match_list_size); } for (i = 0; i < match_list_size; i++) match_list[i] = 0; match_index = 0; if (absolute_program (name)) { match_list[0] = find_absolute_program (name, flags); match_list[1] = (char *) ((void *)0) ; path_list = (char *) ((void *)0) ; } else { name_len = strlen (name); file_to_lose_on = (char *) ((void *)0) ; dot_found_in_search = 0; if (stat (".", &dotinfo) < 0) dotinfo.st_dev = dotinfo.st_ino = 0; path_list = get_string_value ("PATH"); path_index = 0; } while (path_list && path_list[path_index]) { path_element = get_next_path_element (path_list, &path_index); if (path_element == 0) break; match = find_in_path_element (name, path_element, flags, name_len, &dotinfo, (int *)0); sh_xfree((path_element), "findcmd.c", 471); if (match == 0) continue; if (match_index + 1 == match_list_size) { match_list_size += 10; match_list = strvec_resize (match_list, (match_list_size + 1)); } match_list[match_index++] = match; match_list[match_index] = (char *) ((void *)0) ; do { if (file_to_lose_on) sh_xfree((file_to_lose_on), "findcmd.c", 484); } while (0); file_to_lose_on = (char *) ((void *)0) ; } match_index = 0; } match = match_list[match_index]; if (match) match_index++; return (match); }
long user_command_matches(char *param_1,undefined4 param_2,int param_3) { undefined8 *puVar1; int iVar2; undefined8 uVar3; size_t sVar4; long lVar5; long in_FS_OFFSET; int local_d8; undefined4 local_d4; long local_d0; long local_c8; long local_c0; stat local_b8; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); if (param_3 == 0) { if (match_list_7740 == (undefined8 *)0x0) { match_list_size_7741 = 5; match_list_7740 = (undefined8 *)strvec_create(5); } for (iVar2 = 0; iVar2 < match_list_size_7741; iVar2 = iVar2 + 1) { match_list_7740[iVar2] = 0; } match_index_7742 = 0; iVar2 = absolute_program(param_1); puVar1 = match_list_7740; if (iVar2 == 0) { sVar4 = strlen(param_1); local_d4 = (undefined4)sVar4; file_to_lose_on = 0; dot_found_in_search = 0; iVar2 = stat(".",&local_b8); if (iVar2 < 0) { local_b8.st_ino = 0; local_b8.st_dev = 0; } local_d0 = get_string_value(&DAT_0010105b); local_d8 = 0; } else { uVar3 = find_absolute_program(param_1,param_2); *puVar1 = uVar3; match_list_7740[1] = 0; local_d0 = 0; } while (((local_d0 != 0 && (*(char *)(local_d0 + local_d8) != '\0')) && (local_c8 = get_next_path_element(local_d0,&local_d8), local_c8 != 0))) { local_c0 = find_in_path_element(param_1,local_c8,param_2,local_d4,&local_b8,0); sh_xfree(local_c8,"findcmd.c",0x1d7); if (local_c0 != 0) { if (match_index_7742 + 1 == match_list_size_7741) { iVar2 = match_list_size_7741 + 0xb; match_list_size_7741 = match_list_size_7741 + 10; match_list_7740 = (undefined8 *)strvec_resize(match_list_7740,iVar2); } lVar5 = (long)match_index_7742; match_index_7742 = match_index_7742 + 1; match_list_7740[lVar5] = local_c0; match_list_7740[match_index_7742] = 0; if (file_to_lose_on != 0) { sh_xfree(file_to_lose_on,"findcmd.c",0x1e4); } file_to_lose_on = 0; } } match_index_7742 = 0; } local_c0 = match_list_7740[match_index_7742]; if (local_c0 != 0) { match_index_7742 = match_index_7742 + 1; } if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return local_c0; } __stack_chk_fail(); }
static inline __u32 rta_getattr_u32(const struct rtattr *rta) { return *(__u32 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); }
int rta_getattr_u32(struct_0 *a0) { return a0->field_4; }
static void check_output_alive (void) { if (! monitor_output) return; struct pollfd pfd; pfd.fd = 1 ; pfd.events = pfd.revents = 0; if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & ( 0x008 | 0x010 ))) die_pipe (); }
unsigned long check_output_alive() { struct pollfd fds; unsigned long v2; v2 = __readfsqword(0x28u); if ( monitor_output == 1 ) { fds.fd = 1; fds.revents = 0; fds.events = 0; if ( poll(&fds, 1uLL, 0) >= 0 && (fds.revents & 0x18) != 0 ) die_pipe(); } return __readfsqword(0x28u) ^ v2; }
void xattrs_selinux_get (int parentfd, char const *file_name, struct tar_stat_info *st, int fd) { if (selinux_context_option > 0) { int result = fd ? rpl_fgetfilecon (fd, &st->cntx_name) : lgetfileconat (parentfd, file_name, &st->cntx_name); if (result == -1 && (*__errno_location ()) != 61 && (*__errno_location ()) != 95 ) call_arg_warn (fd ? "fgetfilecon" : "lgetfileconat", file_name); } }
void xattrs_selinux_get(undefined4 param_1,undefined8 param_2,long param_3,int param_4) { int iVar1; int *piVar2; char *pcVar3; if (0 < selinux_context_option) { if (param_4 == 0) { iVar1 = lgetfileconat(param_1,param_2,param_3 + 0x30); } else { iVar1 = rpl_fgetfilecon(param_4,param_3 + 0x30); } if (iVar1 == -1) { piVar2 = __errno_location(); if (*piVar2 != 0x3d) { piVar2 = __errno_location(); if (*piVar2 != 0x5f) { if (param_4 == 0) { pcVar3 = "lgetfileconat"; } else { pcVar3 = "fgetfilecon"; } call_arg_warn(pcVar3,param_2); } } } } return; }
static rsRetVal preprocessBatch(batch_t *pBatch, int *pbShutdownImmediate) { prop_t *ip; prop_t *fqdn; prop_t *localName; int bIsPermitted; smsg_t *pMsg; int i; rsRetVal localRet; rsRetVal iRet = RS_RET_OK; for(i = 0 ; i < pBatch->nElem && !*pbShutdownImmediate ; i++) { pMsg = pBatch->pElem[i].pMsg; if((pMsg->msgFlags & 0x080) != 0) { if(Debug) { r_dbgprintf("rsyslogd.c", "msgConsumer: UDP ACL must be checked for message (hostname-based)\n"); }; if(net.cvthname(pMsg->rcvFrom.pfrominet, &localName, &fqdn, &ip) != RS_RET_OK) continue; bIsPermitted = net.isAllowedSender2((uchar*)"UDP", (struct sockaddr *)pMsg->rcvFrom.pfrominet, (char*)propGetSzStr(fqdn), 1); if(!bIsPermitted) { if(Debug) { r_dbgprintf("rsyslogd.c", "Message from '%s' discarded, not a permitted sender host\n", propGetSzStr(fqdn)); } ; pBatch->eltState[i] = 4; } else { MsgSetRcvFrom(pMsg, localName); if((iRet = MsgSetRcvFromIP(pMsg, ip)) != RS_RET_OK) goto finalize_it; pMsg->msgFlags &= ~0x080; } } if((pMsg->msgFlags & 0x010) != 0) { if((localRet = parser.ParseMsg(pMsg)) != RS_RET_OK) { if(Debug) { r_dbgprintf("rsyslogd.c", "Message discarded, parsing error %d\n", localRet); }; pBatch->eltState[i] = 4; } } } finalize_it: return iRet; }
void preprocessBatch(struct_0 *a0, unsigned int *a1) { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v3; char v4; char v5; char v6; struct_1 *v7; unsigned int v9; unsigned long long v10; v1 = 0; for (v0 = 0; true; v0 += 1) { if (v0 >= a0->field_4 || *(a1)) { break; } else { v7 = *((a0->field_18 + v0 * 8)); if ((v7->field_58 & 128)) { if (Debug) r_dbgprintf("rsyslogd.c", "msgConsumer: UDP ACL must be checked for message (hostname-based)\n", v0 * 8); if (g_4044e8(v7->field_f8, &v6, &v5, &v4, g_4044e8)) { continue; } else { v2 = *(4212064)("UDP", v7->field_f8, propGetSzStr(*(&v5)), 1); if (!v2) { if (Debug) r_dbgprintf("rsyslogd.c", "Message from '%s' discarded, not a permitted sender host\n", propGetSzStr(*(&v5))); *((v0 + a0->field_20)) = 4; } else { MsgSetRcvFrom(v7, *(&v6), *(&v6)); v1 = MsgSetRcvFromIP(v7, *(&v4), *(&v4)); if (v1) break; v9 = v7->field_58; *(&v9) = v7->field_58 & 127; v7->field_58 = v9; } } } if ((v7->field_58 & 16)) { v3 = *(4211744)(v7); if (v3) { if (Debug) r_dbgprintf("rsyslogd.c", "Message discarded, parsing error %d\n", v3); *((v0 + a0->field_20)) = 4; } } } } v10 = v1; return; }
void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file, int replace_bad_blocks) { ext2_filsys fs = ctx->fs; errcode_t retval; badblocks_list bb_list = 0; FILE *f; char buf[1024]; e2fsck_read_bitmaps(ctx); retval = ext2fs_block_iterate(fs, 1, 0, 0, check_bb_inode_blocks, 0); if (retval) { com_err("ext2fs_block_iterate", retval, "%s", (gettext ("while sanity checking the bad blocks inode"))); goto fatal; } if (!replace_bad_blocks) { retval = ext2fs_read_bb_inode(fs, &bb_list); if (retval) { com_err("ext2fs_read_bb_inode", retval, "%s", (gettext ("while reading the bad blocks inode"))); goto fatal; } } if (bad_blocks_file) { f = fopen(bad_blocks_file, "r"); if (!f) { com_err("read_bad_blocks_file", (*__errno_location ()) , (gettext ("while trying to open %s")), bad_blocks_file); goto fatal; } } else { sprintf(buf, "badblocks -b %d -X %s%s%s %llu", fs->blocksize, (ctx->options & 0x0002) ? "" : "-s ", (ctx->options & 0x0200) ? "-n " : "", fs->device_name, (unsigned long long) ext2fs_blocks_count(fs->super)-1); f = popen(buf, "r"); if (!f) { com_err("read_bad_blocks_file", (*__errno_location ()) , (gettext ("while trying popen '%s'")), buf); goto fatal; } } retval = ext2fs_read_bb_FILE(fs, f, &bb_list, invalid_block); if (bad_blocks_file) fclose(f); else pclose(f); if (retval) { com_err("ext2fs_read_bb_FILE", retval, "%s", (gettext ("while reading in list of bad blocks from file"))); goto fatal; } printf("%s: Updating bad block inode.\n", ctx->device_name); retval = ext2fs_update_bb_inode(fs, bb_list); if (retval) { com_err("ext2fs_update_bb_inode", retval, "%s", (gettext ("while updating bad block inode"))); goto fatal; } ext2fs_badblocks_list_free(bb_list); return; fatal: ctx->flags |= 0x0001; if (bb_list) ext2fs_badblocks_list_free(bb_list); return; }
long long read_bad_blocks_file(struct_0 *a0, char *a1, unsigned long a2) { void* v0; void* v1; struct_1 *v2; unsigned long long v3; char v4; unsigned int v7; unsigned int v8; v2 = a0->field_0; v0 = 0; e2fsck_read_bitmaps(a0); v3 = ext2fs_block_iterate(v2, 0x1, 0x0, 0x0, check_bb_inode_blocks, 0x0); if (v3) { com_err("ext2fs_block_iterate", v3, "%s", gettext("while sanity checking the bad blocks inode")); } else { if (!a2) { v3 = ext2fs_read_bb_inode(v2, &v0, &v0); if (v3) com_err("ext2fs_read_bb_inode", v3, "%s", gettext("while reading the bad blocks inode")); } if (!v3 || a2) { if (a1) { v1 = fopen(a1, "r"); if (!v1) com_err("read_bad_blocks_file", *(__errno_location()), gettext("while trying to open %s"), a1); } else { if ((a0->field_4c & 0x200)) v7 = "-n "; else v7 = &g_4005db; if ((a0->field_4c & 2)) v8 = &g_4005db; else v8 = &g_4005dc; sprintf(&v4, "badblocks -b %d -X %s%s%s %llu", v2->field_28, v8, v7, v2->field_18, (ext2fs_blocks_count(v2->field_20) - 1)); v1 = popen(&v4, "r"); if (!v1) com_err("read_bad_blocks_file", *(__errno_location()), gettext("while trying popen '%s'"), &v4); } if (!a1 && v1 || a1 && v1) { v3 = ext2fs_read_bb_FILE(v2, v1, &v0, invalid_block); if (a1) fclose(v1); else pclose(v1); if (v3) { com_err("ext2fs_read_bb_FILE", v3, "%s", gettext("while reading in list of bad blocks from file")); } else { printf("%s: Updating bad block inode.\n", a0->field_18); v3 = ext2fs_update_bb_inode(v2, v0, v0); if (v3) com_err("ext2fs_update_bb_inode", v3, "%s", gettext("while updating bad block inode")); else ext2fs_badblocks_list_free(v0); } } } } if (v3 || v3 || v3 || !a1 && !v1 || !a2 && v3 || !v1 && a1) { a0->field_48 = a0->field_48 | 1; if (v0) ext2fs_badblocks_list_free(v0); } return 0; }
void _rl_clean_up_for_exit (void) { if (_rl_echoing_p) { if (_rl_vis_botlin > 0) _rl_move_vert (_rl_vis_botlin); _rl_vis_botlin = 0; fflush (rl_outstream); rl_restart_output (1, 0); } }
long long _rl_clean_up_for_exit() { unsigned long long v1; v1 = _rl_echoing_p; if (_rl_echoing_p) { if (_rl_vis_botlin > 0) _rl_move_vert(_rl_vis_botlin); _rl_vis_botlin = 0; fflush(rl_outstream); v1 = rl_restart_output(0x1, 0x0); } return v1; }
struct buffer_head *getblk(kdev_t kdev, unsigned long long blocknr, int blocksize) { struct buffer_head *bh; int bufsize = sizeof(*bh) + kdev->k_ctx->fs->blocksize - sizeof(bh->b_data); bh = e2fsck_allocate_memory(kdev->k_ctx, bufsize, "block buffer"); if (!bh) return ((void *)0) ; if ((-1) >= 3) bh_count++; do { if ((4) <= (-1)) { printf ("" "(%s, %d): %s: ", "journal.c", 132, __FUNCTION__); printf ("getblk for block %llu (%d bytes)(total %d)\n", blocknr, blocksize, bh_count); } } while (0) ; bh->b_ctx = kdev->k_ctx; if (kdev->k_dev == 1) bh->b_io = kdev->k_ctx->fs->io; else bh->b_io = kdev->k_ctx->journal_io; bh->b_size = blocksize; bh->b_blocknr = blocknr; return bh; }
int getblk(struct_0 *a0, unsigned long a1, unsigned long a2) { unsigned int v0; struct_3 *v1; unsigned int v3; v0 = a0->field_0->field_0->field_28 + 40; v1 = e2fsck_allocate_memory(a0->field_0, v0, "block buffer", v0); if (!v1) { v3 = 0; return v3; } v1->field_0 = a0->field_0; if (a0->field_8 == 1) v1->field_8 = a0->field_0->field_0->field_8; else v1->field_8 = a0->field_0->field_268; v1->field_10 = a2; v1->field_20 = a1; v3 = v1; return v3; }
static void print_heading (void) { printf ("%-8s", gettext ("Login")); if (include_fullname) printf (" %-19s", gettext ("Name")); printf (" %-9s", gettext (" TTY")); if (include_idle) printf (" %-6s", gettext ("Idle")); printf (" %-*s", time_format_width, gettext ("When")); if (include_where) printf (" %s", gettext ("Where")); putchar_unlocked ('\n'); }
void print_heading() { unsigned long long v1; gettext("Login"); printf("%-8s"); if (include_fullname) { gettext("Name"); printf(" %"); } gettext(" TTY"); printf(" %-9s"); if (include_idle) { gettext("Idle"); printf(" %-6s"); } gettext("When"); printf(" %-*s"); if (include_where) printf(" %s", gettext("Where")); v1 = putchar_unlocked(0xa); return; }
void sv_funcnest (name) char *name; { SHELL_VAR *v; intmax_t num; v = find_variable (name); if (v == 0) funcnest_max = 0; else if (legal_number (((v)->value), &num) == 0) funcnest_max = 0; else funcnest_max = num; }
void sv_funcnest(unsigned long long a0) { char v0; struct_0 *v1; char v2; unsigned long long *v4; unsigned long long v5; v1 = find_variable(a0); if (!v1) { funcnest_max = 0; } else if (!legal_number(v1->field_8, &v0, &v0)) { funcnest_max = 0; } else { funcnest_max = *(&v0); } v5 = *(&v2) ^ v4[5]; return; }
0 ) { fputs(asig, stdout ); fflush( stdout ); } else {
int fputs(char *__s,FILE *__stream) { halt_baddata(); }
void get_state_crq_set(gnutls_x509_crq_t crq) { int ret; if (batch) { if (!cfg.state) return; ret = gnutls_x509_crq_set_dn_by_oid(crq, "2.5.4.8", 0, cfg.state, strlen(cfg.state)); if (ret < 0) { fprintf( stderr , "set_dn: %s\n", gnutls_strerror(ret)); exit(1); } } else { read_crq_set(crq, "State or province name: ", "2.5.4.8"); } }
unsigned long get_state_crq_set(long a1) { unsigned long result; unsigned int v2; const char *v3; if ( !batch ) return read_crq_set(a1, "State or province name: ", (long)"2.5.4.8"); result = *(_QWORD *)&cfg[6]; if ( result ) { v2 = strlen(*(const char **)&cfg[6]); result = gnutls_x509_crq_set_dn_by_oid(a1, "2.5.4.8", 0LL, *(_QWORD *)&cfg[6], v2); if ( (result & 0x80000000) != 0LL ) { v3 = (const char *)gnutls_strerror((unsigned int)result); fprintf(stderr, "set_dn: %s\n", v3); exit(1); } } return result; }
static void print_current_files (void) { size_t i; switch (format) { case one_per_line: for (i = 0; i < cwd_n_used; i++) { print_file_name_and_frills (sorted_file[i], 0); putchar_unlocked (eolbyte); } break; case many_per_line: if (! line_length) print_with_separator (' '); else print_many_per_line (); break; case horizontal: if (! line_length) print_with_separator (' '); else print_horizontal (); break; case with_commas: print_with_separator (','); break; case long_format: for (i = 0; i < cwd_n_used; i++) { set_normal_color (); print_long_format (sorted_file[i]); dired_outbyte (eolbyte); } break; } }
void print_current_files() { void* v0; unsigned long long v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; v2 = format; switch (format) { case 0: v0 = 0; while (true) { v5 = *(&cwd_n_used); if (v0 >= *(&cwd_n_used)) break; set_normal_color(); print_long_format(*((*(&sorted_file) + v0 * 8))); dired_outbyte(eolbyte); v0 += 1; } case 1: v0 = 0; while (true) { v4 = *(&cwd_n_used); if (v0 >= *(&cwd_n_used)) break; print_file_name_and_frills(*((*(&sorted_file) + v0 * 8)), 0x0); putchar_unlocked(eolbyte); v0 += 1; } case 2: if (*(&line_length)) { v6 = print_many_per_line(); break; } else { v7 = print_with_separator(0x20); break; } case 3: if (*(&line_length)) { v8 = print_horizontal(); break; } else { v9 = print_with_separator(0x20); break; } case 4: v3 = print_with_separator(0x2c); break; } return; }
static void collect_ids_from_glob(_ssh_compat_glob_t *g, int user, u_int **idsp, u_int *nidsp) { u_int id, i, n = 0, *ids = ((void *)0) ; for (i = 0; g->gl_pathv[i] != ((void *)0) ; i++) { if (user) { if (ruser_name(g->gl_statv[i]->st_uid) != ((void *)0) ) continue; id = (u_int)g->gl_statv[i]->st_uid; } else { if (rgroup_name(g->gl_statv[i]->st_gid) != ((void *)0) ) continue; id = (u_int)g->gl_statv[i]->st_gid; } if (has_id(id, ids, n)) continue; ids = xrecallocarray(ids, n, n + 1, sizeof(*ids)); ids[n++] = id; } *idsp = ids; *nidsp = n; }
unsigned int * collect_ids_from_glob(long a1, int a2, long *a3, unsigned int *a4) { _BOOL4 v4; unsigned int v5; unsigned int *result; int v9; unsigned int i; unsigned int v11; long v12; v11 = 0; v12 = 0LL; for ( i = 0; *(_QWORD *)(8LL * i + *(_QWORD *)(a1 + 32)); ++i ) { if ( a2 ) { if ( ruser_name(*(_DWORD *)(*(_QWORD *)(8LL * i + *(_QWORD *)(a1 + 40)) + 28LL)) ) continue; v9 = *(_DWORD *)(*(_QWORD *)(8LL * i + *(_QWORD *)(a1 + 40)) + 28LL); v4 = has_id(v9, v12, v11); } else { if ( rgroup_name(*(_DWORD *)(*(_QWORD *)(8LL * i + *(_QWORD *)(a1 + 40)) + 32LL)) ) continue; v9 = *(_DWORD *)(*(_QWORD *)(8LL * i + *(_QWORD *)(a1 + 40)) + 32LL); v4 = has_id(v9, v12, v11); } if ( !v4 ) { v12 = xrecallocarray(v12, v11, v11 + 1, 4LL); v5 = v11++; *(_DWORD *)(v12 + 4LL * v5) = v9; } } *a3 = v12; result = a4; *a4 = v11; return result; }
void _ssh__compat_globfree(_ssh_compat_glob_t *pglob) { size_t i; char **pp; if (pglob->gl_pathv != ((void *)0) ) { pp = pglob->gl_pathv + pglob->gl_offs; for (i = pglob->gl_pathc; i--; ++pp) free(*pp); free(pglob->gl_pathv); pglob->gl_pathv = ((void *)0) ; } if (pglob->gl_statv != ((void *)0) ) { for (i = 0; i < pglob->gl_pathc; i++) { free(pglob->gl_statv[i]); } free(pglob->gl_statv); pglob->gl_statv = ((void *)0) ; } }
long long _ssh__compat_globfree(unsigned long long a0[6]) { void* v0; unsigned long long *v1; unsigned long long v3; unsigned long long v4[6]; if (a0[4]) { v1 = a0[2] * 8 + a0[4]; v0 = a0[0]; while (true) { v3 = v0; v0 -= 1; if (!v3) break; free(*(v1)); v1 += 1; } free(a0[4]); a0[4] = 0; } v4 = a0[5]; if (a0[5]) { for (v0 = 0; v0 < a0[0]; v0 += 1) { free(*((a0[5] + v0 * 8))); } free(a0[5]); v4 = a0; a0[5] = 0; } return v4; }
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; }
void hlist_del(unsigned long long a0[2]) { struct_0 *v0; unsigned long long *v1; unsigned long long *v3; struct_0 *v4; v0 = a0[0]; v1 = a0[1]; v3 = v1; *(v1) = v0; if (v0) { v4 = v0; v0->field_8 = v1; } return; }
static void update_signed_certificate(common_info_st * cinfo) { gnutls_x509_crt_t crt; int result; gnutls_privkey_t ca_key; gnutls_privkey_t pkey; gnutls_pubkey_t pubkey; gnutls_x509_crt_t ca_crt; gnutls_datum_t out; time_t tim; unsigned int flags = 0; fprintf(stdlog, "Generating a signed certificate...\n"); ca_key = load_ca_private_key(cinfo); ca_crt = load_ca_cert(1, cinfo); crt = load_cert(1, cinfo); fprintf( stderr , "Activation/Expiration time.\n"); tim = get_activation_date(); result = gnutls_x509_crt_set_activation_time(crt, tim); if (result < 0) { fprintf( stderr , "set_activation: %s\n", gnutls_strerror(result)); app_exit(1); } tim = get_expiration_date(); result = gnutls_x509_crt_set_expiration_time(crt, tim); if (result < 0) { fprintf( stderr , "set_expiration: %s\n", gnutls_strerror(result)); app_exit(1); } pkey = load_private_key(0, cinfo); pubkey = load_public_key_or_import(0, pkey, cinfo); if (pubkey) { fprintf( stderr , "Updating public key\n"); result = gnutls_x509_crt_set_pubkey(crt, pubkey); if (result < 0) { fprintf( stderr , "cannot set public key: %s\n", gnutls_strerror(result)); app_exit(1); } } fprintf( stderr , "\n\nSigning certificate...\n"); if (cinfo->rsa_pss_sign) flags |= GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS; result = gnutls_x509_crt_privkey_sign(crt, ca_crt, ca_key, get_dig(ca_crt, cinfo), flags); if (result < 0) { fprintf( stderr , "crt_sign: %s\n", gnutls_strerror(result)); app_exit(1); } result = gnutls_x509_crt_export2(crt, outcert_format, &out); if (result < 0) { fprintf( stderr , "crt_export: %s\n", gnutls_strerror(result)); app_exit(1); } fwrite(out.data, 1, out.size, outfile); gnutls_free((void *) (out.data)), out.data= ((void *)0) ; gnutls_x509_crt_deinit(crt); }
void update_signed_certificate(struct_0 *a0) { unsigned int v0; unsigned int v1; unsigned long long v2; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; char v8; char v9; char v10; unsigned long long *v12; unsigned long long v13; v0 = 0; fprintf(stdlog, "Generating a signed certificate...\n"); v2 = load_ca_private_key(a0); v3 = load_ca_cert(0x1, a0); v4 = load_cert(0x1, a0); fprintf(stderr, "Activation/Expiration time.\n"); v5 = get_activation_date(); v1 = gnutls_x509_crt_set_activation_time(v4, v5, v5); if (v1 < 0) { fprintf(stderr, "set_activation: %s\n", gnutls_strerror(v1)); app_exit(0x1); } v5 = get_expiration_date(); v1 = gnutls_x509_crt_set_expiration_time(v4, v5, v5); if (v1 < 0) { fprintf(stderr, "set_expiration: %s\n", gnutls_strerror(v1)); app_exit(0x1); } v6 = load_private_key(0x0, a0); v7 = load_public_key_or_import(0x0, v6, a0); if (v7) { fprintf(stderr, "Updating public key\n"); v1 = gnutls_x509_crt_set_pubkey(v4, v7, v7); if (v1 < 0) { fprintf(stderr, "cannot set public key: %s\n", gnutls_strerror(v1)); app_exit(0x1); } } fprintf(stderr, "\n\nSigning certificate...\n"); if (a0->field_c8) v0 |= 128; v1 = gnutls_x509_crt_privkey_sign(v4, v3, v2, get_dig(v3, a0), v0); if (v1 < 0) { fprintf(stderr, "crt_sign: %s\n", gnutls_strerror(v1)); app_exit(0x1); } v1 = gnutls_x509_crt_export2(v4, outcert_format, &v8, outcert_format); if (v1 >= 0) { fwrite(*(&v8), 0x1, *(&v9), outfile); *(5243720)(*(&v8)); v8 = 0; gnutls_x509_crt_deinit(v4); v13 = *(&v10) ^ v12[5]; return; } fprintf(stderr, "crt_export: %s\n", gnutls_strerror(v1)); app_exit(0x1); }
void usage (int status) { if (status != 0 ) do { fprintf ( stderr , gettext ("Try '%s --help' for more information.\n"), program_name); } while (0); else { printf (gettext ("Usage: %s [OPTION]... [-T] SOURCE DEST\n or: %s [OPTION]... SOURCE... DIRECTORY\n or: %s [OPTION]... -t DIRECTORY SOURCE...\n") , program_name, program_name, program_name); fputs_unlocked (gettext ("Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"), stdout ) ; emit_mandatory_arg_note (); fputs_unlocked (gettext (" -a, --archive same as -dR --preserve=all\n --attributes-only don't copy the file data, just the attributes\n --backup[=CONTROL] make a backup of each existing destination file\n -b like --backup but does not accept an argument\n --copy-contents copy contents of special files when recursive\n -d same as --no-dereference --preserve=links\n"), stdout ) ; fputs_unlocked (gettext (" -f, --force if an existing destination file cannot be\n opened, remove it and try again (this option\n is ignored when the -n option is also used)\n -i, --interactive prompt before overwrite (overrides a previous -n\n option)\n -H follow command-line symbolic links in SOURCE\n"), stdout ) ; fputs_unlocked (gettext (" -l, --link hard link files instead of copying\n -L, --dereference always follow symbolic links in SOURCE\n"), stdout ) ; fputs_unlocked (gettext (" -n, --no-clobber do not overwrite an existing file (overrides\n a previous -i option)\n -P, --no-dereference never follow symbolic links in SOURCE\n"), stdout ) ; fputs_unlocked (gettext (" -p same as --preserve=mode,ownership,timestamps\n --preserve[=ATTR_LIST] preserve the specified attributes (default:\n mode,ownership,timestamps), if possible\n additional attributes: context, links, xattr,\n all\n"), stdout ) ; fputs_unlocked (gettext (" --no-preserve=ATTR_LIST don't preserve the specified attributes\n --parents use full source file name under DIRECTORY\n"), stdout ) ; fputs_unlocked (gettext (" -R, -r, --recursive copy directories recursively\n --reflink[=WHEN] control clone/CoW copies. See below\n --remove-destination remove each existing destination file before\n attempting to open it (contrast with --force)\n"), stdout ) ; fputs_unlocked (gettext (" --sparse=WHEN control creation of sparse files. See below\n --strip-trailing-slashes remove any trailing slashes from each SOURCE\n argument\n"), stdout ) ; fputs_unlocked (gettext (" -s, --symbolic-link make symbolic links instead of copying\n -S, --suffix=SUFFIX override the usual backup suffix\n -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n -T, --no-target-directory treat DEST as a normal file\n"), stdout ) ; fputs_unlocked (gettext (" -u, --update copy only when the SOURCE file is newer\n than the destination file or when the\n destination file is missing\n -v, --verbose explain what is being done\n -x, --one-file-system stay on this file system\n"), stdout ) ; fputs_unlocked (gettext (" -Z set SELinux security context of destination\n file to default type\n --context[=CTX] like -Z, or if CTX is specified then set the\n SELinux or SMACK security context to CTX\n"), stdout ) ; fputs_unlocked (gettext (" --help display this help and exit\n"), stdout ); fputs_unlocked (gettext (" --version output version information and exit\n"), stdout ); fputs_unlocked (gettext ("\nBy default, sparse SOURCE files are detected by a crude heuristic and the\ncorresponding DEST file is made sparse as well. That is the behavior\nselected by --sparse=auto. Specify --sparse=always to create a sparse DEST\nfile whenever the SOURCE file contains a long enough sequence of zero bytes.\nUse --sparse=never to inhibit creation of sparse files.\n"), stdout ) ; fputs_unlocked (gettext ("\nWhen --reflink[=always] is specified, perform a lightweight copy, where the\ndata blocks are copied only when modified. If this is not possible the copy\nfails, or if --reflink=auto is specified, fall back to a standard copy.\nUse --reflink=never to ensure a standard copy is performed.\n"), stdout ) ; emit_backup_suffix_note (); fputs_unlocked (gettext ("\nAs a special case, cp makes a backup of SOURCE when the force and backup\noptions are given and SOURCE and DEST are the same name for an existing,\nregular file.\n"), stdout ) ; emit_ancillary_info ("cp"); } exit (status); }
void usage(int a1) { long v1; char *v2; long v3; long v4; long v5; char *v6; FILE *v7; char *v8; FILE *v9; char *v10; FILE *v11; char *v12; FILE *v13; char *v14; FILE *v15; char *v16; FILE *v17; char *v18; FILE *v19; char *v20; FILE *v21; char *v22; FILE *v23; char *v24; FILE *v25; char *v26; FILE *v27; char *v28; FILE *v29; char *v30; FILE *v31; char *v32; FILE *v33; char *v34; FILE *v35; char *v36; FILE *v37; char *v38; FILE *v39; char *v40; if ( a1 ) { v1 = program_name; v2 = gettext("Try '%s --help' for more information.\n"); fprintf(stderr, v2, v1); } else { v3 = program_name; v4 = program_name; v5 = program_name; v6 = gettext( "Usage: %s [OPTION]... [-T] SOURCE DEST\n" " or: %s [OPTION]... SOURCE... DIRECTORY\n" " or: %s [OPTION]... -t DIRECTORY SOURCE...\n"); printf(v6, v5, v4, v3); v7 = stdout; v8 = gettext("Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"); fputs_unlocked(v8, v7); emit_mandatory_arg_note(); v9 = stdout; v10 = gettext( " -a, --archive same as -dR --preserve=all\n" " --attributes-only don't copy the file data, just the attributes\n" " --backup[=CONTROL] make a backup of each existing destination file\n" " -b like --backup but does not accept an argument\n" " --copy-contents copy contents of special files when recursive\n" " -d same as --no-dereference --preserve=links\n"); fputs_unlocked(v10, v9); v11 = stdout; v12 = gettext( " -f, --force if an existing destination file cannot be\n" " opened, remove it and try again (this option\n" " is ignored when the -n option is also used)\n" " -i, --interactive prompt before overwrite (overrides a previous -n\n" " option)\n" " -H follow command-line symbolic links in SOURCE\n"); fputs_unlocked(v12, v11); v13 = stdout; v14 = gettext( " -l, --link hard link files instead of copying\n" " -L, --dereference always follow symbolic links in SOURCE\n"); fputs_unlocked(v14, v13); v15 = stdout; v16 = gettext( " -n, --no-clobber do not overwrite an existing file (overrides\n" " a previous -i option)\n" " -P, --no-dereference never follow symbolic links in SOURCE\n"); fputs_unlocked(v16, v15); v17 = stdout; v18 = gettext( " -p same as --preserve=mode,ownership,timestamps\n" " --preserve[=ATTR_LIST] preserve the specified attributes (default:\n" " mode,ownership,timestamps), if possible\n" " additional attributes: context, links, xattr,\n" " all\n"); fputs_unlocked(v18, v17); v19 = stdout; v20 = gettext( " --no-preserve=ATTR_LIST don't preserve the specified attributes\n" " --parents use full source file name under DIRECTORY\n"); fputs_unlocked(v20, v19); v21 = stdout; v22 = gettext( " -R, -r, --recursive copy directories recursively\n" " --reflink[=WHEN] control clone/CoW copies. See below\n" " --remove-destination remove each existing destination file before\n" " attempting to open it (contrast with --force)\n"); fputs_unlocked(v22, v21); v23 = stdout; v24 = gettext( " --sparse=WHEN control creation of sparse files. See below\n" " --strip-trailing-slashes remove any trailing slashes from each SOURCE\n" " argument\n"); fputs_unlocked(v24, v23); v25 = stdout; v26 = gettext( " -s, --symbolic-link make symbolic links instead of copying\n" " -S, --suffix=SUFFIX override the usual backup suffix\n" " -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n" " -T, --no-target-directory treat DEST as a normal file\n"); fputs_unlocked(v26, v25); v27 = stdout; v28 = gettext( " -u, --update copy only when the SOURCE file is newer\n" " than the destination file or when the\n" " destination file is missing\n" " -v, --verbose explain what is being done\n" " -x, --one-file-system stay on this file system\n"); fputs_unlocked(v28, v27); v29 = stdout; v30 = gettext( " -Z set SELinux security context of destination\n" " file to default type\n" " --context[=CTX] like -Z, or if CTX is specified then set the\n" " SELinux or SMACK security context to CTX\n"); fputs_unlocked(v30, v29); v31 = stdout; v32 = gettext(" --help display this help and exit\n"); fputs_unlocked(v32, v31); v33 = stdout; v34 = gettext(" --version output version information and exit\n"); fputs_unlocked(v34, v33); v35 = stdout; v36 = gettext( "\n" "By default, sparse SOURCE files are detected by a crude heuristic and the\n" "corresponding DEST file is made sparse as well. That is the behavior\n" "selected by --sparse=auto. Specify --sparse=always to create a sparse DEST\n" "file whenever the SOURCE file contains a long enough sequence of zero bytes.\n" "Use --sparse=never to inhibit creation of sparse files.\n"); fputs_unlocked(v36, v35); v37 = stdout; v38 = gettext( "\n" "When --reflink[=always] is specified, perform a lightweight copy, where the\n" "data blocks are copied only when modified. If this is not possible the copy\n" "fails, or if --reflink=auto is specified, fall back to a standard copy.\n" "Use --reflink=never to ensure a standard copy is performed.\n"); fputs_unlocked(v38, v37); emit_backup_suffix_note(); v39 = stdout; v40 = gettext( "\n" "As a special case, cp makes a backup of SOURCE when the force and backup\n" "options are given and SOURCE and DEST are the same name for an existing,\n" "regular file.\n"); fputs_unlocked(v40, v39); emit_ancillary_info("cp"); } exit(a1); }
int rl_maybe_save_line (void) { if (_rl_saved_line_for_history == 0) { _rl_saved_line_for_history = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); _rl_saved_line_for_history->line = strcpy ((char *)xmalloc (1 + strlen (rl_line_buffer)), (rl_line_buffer)); _rl_saved_line_for_history->timestamp = (char *) ((void *)0) ; _rl_saved_line_for_history->data = (char *)rl_undo_list; } return 0; }
void rl_maybe_save_line() { void* v1; if (!_rl_saved_line_for_history) { _rl_saved_line_for_history = xmalloc(0x18); *(_rl_saved_line_for_history) = strcpy(xmalloc(strlen(rl_line_buffer) + 1), rl_line_buffer); *((_rl_saved_line_for_history + 8)) = 0; *((_rl_saved_line_for_history + 16)) = rl_undo_list; } v1 = 0; return; }
static void indent (from, to) int from, to; { while (from < to) { if ((to / tabsize) > (from / tabsize)) { putc ('\t', stderr ); from += tabsize - from % tabsize; } else { putc (' ', stderr ); from++; } } }
void indent(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned long long v2; v0 = a0; while (true) { v2 = v0; if (v0 >= a1) break; if ((a1 >> 31 CONCAT a1) /m tabsize > (v0 >> 31 CONCAT v0) /m tabsize) { putc(0x9, *(&stderr)); v0 += tabsize - ((v0 >> 31 CONCAT v0) /m tabsize >> 32); } else { putc(0x20, *(&stderr)); v0 += 1; } } return; }
int aliascmd(int argc, char **argv) { char *n, *v; int ret = 0; struct alias *ap; if (argc == 1) { int i; for (i = 0; i < 39; i++) for (ap = atab[i]; ap; ap = ap->next) { printalias(ap); } return (0); } while ((n = *++argv) != ((void *)0) ) { if ((v = strchr(n+1, '=')) == ((void *)0) ) { if ((ap = *__lookupalias(n)) == ((void *)0) ) { outfmt(out2, "%s: %s not found\n", "alias", n); ret = 1; } else printalias(ap); } else { *v++ = '\0'; setalias(n, v); } } return (ret); }
undefined4 aliascmd(int param_1,long *param_2) { long lVar1; char *pcVar2; long *plVar3; long *local_38; undefined4 local_28; int local_24; undefined8 *local_20; local_28 = 0; local_38 = param_2; if (param_1 == 1) { for (local_24 = 0; local_24 < 0x27; local_24 = local_24 + 1) { for (local_20 = *(undefined8 **)(atab + (long)local_24 * 8); local_20 != (undefined8 *)0x0; local_20 = (undefined8 *)*local_20) { printalias(local_20); } } local_28 = 0; } else { while( true ) { local_38 = local_38 + 1; lVar1 = *local_38; if (lVar1 == 0) break; pcVar2 = strchr((char *)(lVar1 + 1),0x3d); if (pcVar2 == (char *)0x0) { plVar3 = (long *)__lookupalias(lVar1); if (*plVar3 == 0) { outfmt(out2,"%s: %s not found\n","alias",lVar1); local_28 = 1; } else { printalias(*plVar3); } } else { *pcVar2 = '\0'; setalias(lVar1,pcVar2 + 1); } } } return local_28; }
void add_remote_forward(Options *options, const struct Forward *newfwd) { struct Forward *fwd; int i; for (i = 0; i < options->num_remote_forwards; i++) { if (forward_equals(newfwd, options->remote_forwards + i)) return; } options->remote_forwards = xreallocarray(options->remote_forwards, options->num_remote_forwards + 1, sizeof(*options->remote_forwards)); fwd = &options->remote_forwards[options->num_remote_forwards++]; fwd->listen_host = newfwd->listen_host; fwd->listen_port = newfwd->listen_port; fwd->listen_path = newfwd->listen_path; fwd->connect_host = newfwd->connect_host; fwd->connect_port = newfwd->connect_port; fwd->connect_path = newfwd->connect_path; fwd->handle = newfwd->handle; fwd->allocated_port = 0; }
void add_remote_forward(struct_0 *a0, struct_1 *a1) { unsigned int v0; struct_2 *v1; unsigned long long v4; unsigned long long v5; unsigned long long v6; struct_2 *v7; v0 = 0; while (true) { if (v0 >= a0->field_12f0) { v4 = __addvsi3(a0->field_12f0, 0x1); a0->field_12f8 = xreallocarray(a0->field_12f8, v4, 0x38, v4); v5 = a0->field_12f8; v6 = a0->field_12f0; a0->field_12f0 = __addvsi3(a0->field_12f0, 0x1); v1 = v6 * 56 + v5; v1->field_0 = a1->field_0; v1->field_8 = a1->field_8; v1->field_10 = a1->field_10; v1->field_18 = a1->field_18; v1->field_20 = a1->field_20; v1->field_28 = a1->field_28; v1->field_34 = a1->field_34; v7 = v1; v1->field_30 = 0; break; } else { if (forward_equals(a1, a0->field_12f8 + v0 * 56, a0->field_12f8 + v0 * 56, a0->field_12f8)) break; v0 = __addvsi3(v0, 0x1); } } return; }
static _Bool compare_line_list (char * const list1[], size_t const lengths1[], char * const list2[], size_t const lengths2[], lin nl) { char * const *l1 = list1; char * const *l2 = list2; size_t const *lgths1 = lengths1; size_t const *lgths2 = lengths2; while (nl--) if (!*l1 || !*l2 || *lgths1 != *lgths2++ || memcmp (*l1++, *l2++, *lgths1++) != 0) return 0 ; return 1 ; }
int compare_line_list(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4) { unsigned long long v0; int tmp_15; int tmp_16; int tmp_25; int tmp_34; unsigned long v1; unsigned long v2; unsigned long v3; unsigned long long *v4; unsigned long long *v5; unsigned long long *v6; unsigned long long *v7; unsigned int v9; unsigned long v10; v3 = a0; v2 = a1; v1 = a2; v0 = a4; v4 = v3; v5 = v1; v6 = v2; v7 = a3; while (true) { v9 = v0; v0 -= 1; if (!v9) { v9 = 1; break; } if (!*(v4)) { LABEL_40181d: v9 = 0; break; } else { if (!*(v5)) goto LABEL_40181d; tmp_15 = v7; v7 += 1; if (!(*(v6) == *(tmp_15))) goto LABEL_40181d; tmp_16 = v6; v6 += 1; v10 = *(tmp_16); tmp_25 = v5; v5 += 1; tmp_34 = v4; v4 += 1; if (!(!memcmp(*(tmp_34), *(tmp_25), v10))) goto LABEL_40181d; } } return v9; }
static void diff_multivol (void) { struct stat stat_data; int fd, status; off_t offset; if (current_stat_info.had_trailing_slash) { diff_dir (); return; } if (!get_stat_data (current_stat_info.file_name, &stat_data)) return; if (! (((( stat_data.st_mode )) & 0170000) == (0100000)) ) { report_difference (&current_stat_info, gettext ("File type differs")); skip_member (); return; } offset = off_from_header (current_header->oldgnu_header.offset, sizeof (current_header->oldgnu_header.offset)); if (offset < 0 || __builtin_add_overflow_p (current_stat_info.stat.st_size, offset, (__typeof__ ((current_stat_info.stat.st_size) + (offset))) 0) || stat_data.st_size != current_stat_info.stat.st_size + offset) { report_difference (&current_stat_info, gettext ("Size differs")); skip_member (); return; } fd = openat (chdir_fd, current_stat_info.file_name, open_read_flags); if (fd < 0) { open_error (current_stat_info.file_name); report_difference (&current_stat_info, ((void *)0) ); skip_member (); return; } if (lseek (fd, offset, 0 ) < 0) { seek_error_details (current_stat_info.file_name, offset); report_difference (&current_stat_info, ((void *)0) ); } else read_and_process (&current_stat_info, process_rawdata); status = close (fd); if (status != 0) close_error (current_stat_info.file_name); }
unsigned long diff_multivol() { char *v0; long v1; long v2; long v3; long v4; char *v5; long v6; long v7; long v8; long v9; long v10; long v11; long v12; long v13; long v14; long v15; long v16; long v17; int fd; long offset; char v21[24]; int v22; long v23; unsigned long v24; v24 = __readfsqword(0x28u); if ( LOBYTE(current_stat_info[2]) ) { diff_dir(); } else if ( (unsigned int)get_stat_data(current_stat_info[1], (long)v21) ) { if ( (v22 & 0xF000) == 0x8000 ) { offset = off_from_header(current_header + 369LL, 12LL); if ( offset >= 0 && !__OFADD__(current_stat_info[17], offset) && v23 == current_stat_info[17] + offset ) { fd = openat(chdir_fd, (const char *)current_stat_info[1], open_read_flags); if ( fd >= 0 ) { if ( lseek(fd, offset, 0) >= 0 ) { read_and_process( (long)current_stat_info, (unsigned int ( *)(unsigned long, long))process_rawdata); } else { seek_error_details(current_stat_info[1], offset); report_difference((long)current_stat_info, 0LL, v14, v15, v16, v17); } if ( close(fd) ) close_error(current_stat_info[1]); } else { open_error(current_stat_info[1]); report_difference((long)current_stat_info, 0LL, v10, v11, v12, v13, fd); skip_member(); } } else { v5 = gettext("Size differs"); report_difference((long)current_stat_info, v5, v6, v7, v8, v9); skip_member(); } } else { v0 = gettext("File type differs"); report_difference((long)current_stat_info, v0, v1, v2, v3, v4); skip_member(); } } return __readfsqword(0x28u) ^ v24; }
void * assoc_replace (hash, key, value) HASH_TABLE *hash; char *key; char *value; { BUCKET_CONTENTS *b; void * t; b = hash_search (key, hash, 0x02); if (b == 0) return (void *)0; if (b->key != key) sh_xfree((key), "assoc.c", 107); t = b->data; b->data = value ? (char *)strcpy (sh_xmalloc((1 + strlen (value)), "assoc.c", 109), (value)) : (char *)0; return t; }
long long assoc_replace(unsigned long long a0, unsigned long long a1, char *a2) { unsigned long long v0[3]; unsigned long long v1; void* v3; void* v4; v0[0] = hash_search(a1, a0, 0x2, a0); if (!v0) { v3 = 0; } else { if (a1 != v0[1]) sh_xfree(a1, "assoc.c", 0x6b); v1 = v0[2]; if (a2) v4 = strcpy(sh_xmalloc(strlen(a2) + 1, "assoc.c", 0x6d), a2); else v4 = 0; v0[2] = v4; v3 = v1; } return v3; }
static void merge_lists (struct predlist lists[], int nlists, struct predlist *name_list, struct predlist *regex_list, struct predicate **last) { int i; static void (*mergefn)(struct predlist *, struct predicate**); mergefn = predlist_merge_sort; mergefn (name_list, last); mergefn (regex_list, last); for (i=0; i<nlists; i++) mergefn (&lists[i], last); }
void merge_lists(unsigned long a0, unsigned long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4) { unsigned int v0; unsigned long long v2; mergefn.5804 = predlist_merge_sort; *(4206936)(a2, a4, a2, a3); *(4206936)(a3, a4, a2, a3); v0 = 0; while (true) { v2 = v0; if (v0 >= a1) break; *(4206936)(v0 * 16 + a0, a4, a2, a3); v0 += 1; } return; }
static _Bool sparse_scan_file_wholesparse (struct tar_sparse_file *file) { struct tar_stat_info *st = file->stat_info; struct sp_array sp = {0, 0}; if (((st->stat).st_blocks) == 0) { st->archive_file_size = 0; sp.offset = st->stat.st_size; sparse_add_map (st, &sp); return 1 ; } return 0 ; }
int sparse_scan_file_wholesparse(struct_0 *a0) { unsigned long long v0[36]; unsigned long v1; void* v2; unsigned int v4; v0[0] = a0->field_18; v1 = 0; v2 = 0; if (v0[19]) { v4 = 0; return v4; } v0[35] = 0; v1 = v0[17]; sparse_add_map(v0, &v1); v4 = 1; return v4; }
static void pkcs12_bag_enc_info(gnutls_pkcs12_bag_t bag, FILE *out) { 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_pkcs12_bag_enc_info(bag, &schema, &cipher, salt, &salt_size, &iter_count, &oid); if (ret == -6) { fprintf(out, "\tSchema: unsupported (%s)\n", oid); gnutls_free((void *) (oid)), oid= ((void *)0) ; return; } if (ret < 0) { fprintf( stderr , "PKCS #12 bag read error: %s\n", gnutls_strerror(ret)); return; } gnutls_free((void *) (oid)), oid= ((void *)0) ; fprintf(out, "\tCipher: %s\n", gnutls_cipher_get_name(cipher)); str = gnutls_pkcs_schema_get_name(schema); if (str != ((void *)0) ) { fprintf(out, "\tSchema: %s (%s)\n", 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, "\tSalt: %s\n", hex); fprintf(out, "\tSalt size: %u\n", salt_size); fprintf(out, "\tIteration count: %u\n", iter_count); }
void pkcs12_bag_enc_info(undefined8 param_1,FILE *param_2) { undefined8 uVar1; long in_FS_OFFSET; undefined4 local_b4; undefined4 local_b0; uint local_ac; uint local_a8; int local_a4; undefined8 local_a0; undefined8 local_98; long local_90; undefined *local_88; uint local_80; undefined local_78 [32]; undefined local_58 [72]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_ac = 0x20; local_a0 = 0x41; local_98 = 0; local_a4 = gnutls_pkcs12_bag_enc_info (param_1,&local_b4,&local_b0,local_78,&local_ac,&local_a8,&local_98); if (local_a4 == -6) { fprintf(param_2,"\tSchema: unsupported (%s)\n",local_98); (*gnutls_free)(local_98); local_98 = 0; } else if (local_a4 < 0) { uVar1 = gnutls_strerror(local_a4); fprintf(stderr,"PKCS #12 bag read error: %s\n",uVar1); } else { (*gnutls_free)(local_98); local_98 = 0; uVar1 = gnutls_cipher_get_name(local_b0); fprintf(param_2,"\tCipher: %s\n",uVar1); local_90 = gnutls_pkcs_schema_get_name(local_b4); if (local_90 != 0) { uVar1 = gnutls_pkcs_schema_get_oid(local_b4); fprintf(param_2,"\tSchema: %s (%s)\n",local_90,uVar1); } local_88 = local_78; local_80 = local_ac; local_a4 = gnutls_hex_encode(&local_88,local_58,&local_a0); if (local_a4 < 0) { uVar1 = gnutls_strerror(local_a4); fprintf(stderr,"hex encode error: %s\n",uVar1); app_exit(1); } fprintf(param_2,"\tSalt: %s\n",local_58); fprintf(param_2,"\tSalt size: %u\n",(ulong)local_ac); fprintf(param_2,"\tIteration count: %u\n",(ulong)local_a8); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
int _rl_nchars_available () { int chars_avail, fd, result; chars_avail = 0; fd = fileno (rl_instream); (*__errno_location ()) = 0; result = ioctl (fd, 0x541B , &chars_avail); if (result == -1 && (*__errno_location ()) == 5 ) return -1; return chars_avail; }
long long _rl_nchars_available() { unsigned int v0; unsigned int v1; unsigned int v2; unsigned int v4; unsigned long long v5; v0 = 0; v1 = fileno(rl_instream); *(__errno_location()) = 0; v2 = ioctl(v1, 0x541b); if (v2 == -1) { v4 = *(__errno_location()); if (v4 == 5) v5 = 4294967295; } if (v4 != 5 || v2 != -1) v5 = v0; return v5; }
int sshkey_check_sigtype(const u_char *sig, size_t siglen, const char *requested_alg) { const char *expected_alg; char *sigtype = ((void *)0) ; int r; if (requested_alg == ((void *)0) ) return 0; if ((expected_alg = sshkey_sigalg_by_name(requested_alg)) == ((void *)0) ) return -10; if ((r = sshkey_get_sigtype(sig, siglen, &sigtype)) != 0) return r; r = strcmp(expected_alg, sigtype) == 0; free(sigtype); return r ? 0 : -58; }
long long sshkey_check_sigtype(unsigned long long a0, unsigned long long a1, char *a2) { unsigned int v0; void* v1; char *v2; unsigned long long v4; v1 = 0; if (!a2) { v4 = 0; } else { v2 = sshkey_sigalg_by_name(a2); if (!v2) { v4 = 4294967286; } else { v0 = sshkey_get_sigtype(a0, a1, &v1); if (v0) { v4 = v0; } else { v0 = !strcmp(v2, v1); free(v1); if (v0) v4 = 0; else v4 = 4294967238; } } } return v4; }
ssize_t zreadcintr (fd, cp) int fd; char *cp; { ssize_t nr; if (lind == lused || lused == 0) { nr = zreadintr (fd, lbuf, sizeof (lbuf)); lind = 0; if (nr <= 0) { lused = 0; return nr; } lused = nr; } if (cp) *cp = lbuf[lind++]; return 1; }
long zreadcintr(undefined4 param_1,undefined *param_2) { undefined *puVar1; long lVar2; if ((lind == lused) || (lused == 0)) { lused = zreadintr(param_1,lbuf,0x1000); lind = 0; if (lused < 1) { lVar2 = lused; lind = 0; lused = 0; return lVar2; } } if (param_2 != (undefined *)0x0) { puVar1 = lbuf + lind; lind = lind + 1; *param_2 = *puVar1; } return 1; }
_Bool millerrabin2 (const uintmax_t *np, uintmax_t ni, const uintmax_t *bp, const uintmax_t *qp, unsigned int k, const uintmax_t *one) { uintmax_t y1, y0, nm1_1, nm1_0, r1m; y0 = powm2 (&r1m, bp, qp, np, ni, one); y1 = r1m; if (y0 == one[0] && y1 == one[1]) return 1 ; __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (nm1_1), "=&r" (nm1_0) : "0" ((UDItype)(np[1])), "rme" ((UDItype)(one[1])), "1" ((UDItype)(np[0])), "rme" ((UDItype)(one[0]))); if (y0 == nm1_0 && y1 == nm1_1) return 1 ; for (unsigned int i = 1; i < k; i++) { y0 = mulredc2 (&r1m, y1, y0, y1, y0, np[1], np[0], ni); y1 = r1m; if (y0 == nm1_0 && y1 == nm1_1) return 1 ; if (y0 == one[0] && y1 == one[1]) return 0 ; } return 0 ; }
long long millerrabin2(unsigned long long a0[2], unsigned int a1, void* a2, void* a3, unsigned long a4, unsigned long long a5[2]) { unsigned int v0; char v1; unsigned long long v2; unsigned int v3; unsigned long v4; unsigned long v5; unsigned long long v7; *(&v3) = powm2(&v1, a2, a3, a0, a1, a5); v2 = *(&v1); if (*(&v3) == a5[0] && v2 == a5[1]) v7 = 1; if (*(&v3) != a5[0] || v2 != a5[1]) { v4 = a0[1] - a5[1] - (a0[0] < a5[0]); v5 = a0[0] - a5[0]; if (*(&v3) == v5 && v2 == v4) v7 = 1; if (v2 != v4 || *(&v3) != v5) { v0 = 1; while (true) { if (v0 < a4) { *(&v3) = mulredc2(&v1, v2, *(&v3), v2, *(&v3), a0[1], a0[0], a1); v2 = *(&v1); if (*(&v3) == v5 && v2 == v4) { v7 = 1; break; } if (v2 != v4 || *(&v3) != v5) { if (*(&v3) == a5[0] && v2 == a5[1]) { v7 = 0; break; } if (*(&v3) != a5[0] || v2 != a5[1]) v0 += 1; } } else { v7 = 0; break; } } } } return v7; }
void usage(void) { fprintf( stderr , "usage: %s [-n] [-w] [-d] [-f] [-h] [-i]%s\n", progname, strcmp(progname, "halt") ? "" : " [-p]"); fprintf( stderr , "\t-n: don't sync before halting the system\n"); fprintf( stderr , "\t-w: only write a wtmp reboot record and exit.\n"); fprintf( stderr , "\t-d: don't write a wtmp record.\n"); fprintf( stderr , "\t-f: force halt/reboot, don't call shutdown.\n"); fprintf( stderr , "\t-h: put harddisks in standby mode.\n"); fprintf( stderr , "\t-i: shut down all network interfaces.\n"); if (!strcmp(progname, "halt")) fprintf( stderr , "\t-p: power down the system (if possible, otherwise halt).\n"); exit(1); }
void usage() { unsigned int v1; if (!strcmp(0x48fffffff9058b48, "halt")) v1 = &g_40074d; else v1 = &g_40074c; fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-h] [-i]%s\n", -117077176, v1); fprintf(stderr, "\t-n: don't sync before halting the system\n"); fprintf(stderr, "\t-w: only write a wtmp reboot record and exit.\n"); fprintf(stderr, "\t-d: don't write a wtmp record.\n"); fprintf(stderr, "\t-f: force halt/reboot, don't call shutdown.\n"); fprintf(stderr, "\t-h: put harddisks in standby mode.\n"); fprintf(stderr, "\t-i: shut down all network interfaces.\n"); if (!strcmp(0x48fffffff9058b48, "halt")) fprintf(stderr, "\t-p: power down the system (if possible, otherwise halt).\n"); exit(0x1); }
static struct dev_ino dev_ino_pop (void) { void *vdi; struct dev_ino *di; int dev_ino_size = sizeof *di; ((void) sizeof (( dev_ino_size <= __extension__ ({ struct obstack const *__o = (&dev_ino_obstack); (size_t) (__o->next_free - __o->object_base); }) ) ? 1 : 0), __extension__ ({ if ( dev_ino_size <= __extension__ ({ struct obstack const *__o = (&dev_ino_obstack); (size_t) (__o->next_free - __o->object_base); }) ) ; else __assert_fail ( "dev_ino_size <= obstack_object_size (&dev_ino_obstack)" , "src/ls.c", 1053, __extension__ __PRETTY_FUNCTION__); })) ; ((void) ((&dev_ino_obstack)->next_free += (-dev_ino_size))); vdi = ((void *) (&dev_ino_obstack)->next_free); di = vdi; return *di; }
int dev_ino_pop() { unsigned int v0; unsigned long long v1; unsigned long v2; unsigned long long *v3; v0 = 16; v1 = &dev_ino_obstack; if (*((v1 + 24)) - *((v1 + 16)) < v0) __assert_fail(); g_40aa58 = -(v0) + g_40aa58; v2 = g_40aa58; v3 = v2; return *(v3); }
static inline char * mk_env_string (name, value, attributes) const char *name, *value; int attributes; { size_t name_len, value_len; char *p, *q, *t; int isfunc, isarray; name_len = strlen (name); value_len = (((value) && (value)[0]) ? ((value)[1] ? ((value)[2] ? strlen(value) : 2) : 1) : 0); isfunc = attributes & 0x0000008; if (isfunc && value) { p = (char *)sh_xmalloc((10 + name_len + 2 + value_len + 2), "variables.c", 4774); q = p; memcpy (q, "BASH_FUNC_", 10); q += 10; memcpy (q, name, name_len); q += name_len; memcpy (q, "%%", 2); q += 2; } else { p = (char *)sh_xmalloc((2 + name_len + value_len), "variables.c", 4818); memcpy (p, name, name_len); q = p + name_len; } q[0] = '='; if (value && *value) { if (isfunc) { t = dequote_escapes (value); value_len = (((t) && (t)[0]) ? ((t)[1] ? ((t)[2] ? strlen(t) : 2) : 1) : 0); memcpy (q + 1, t, value_len + 1); sh_xfree((t), "variables.c", 4831); } else memcpy (q + 1, value, value_len + 1); } else q[1] = '\0'; return (p); }
int mk_env_string(void* a0, char a1[3], unsigned long a2) { unsigned int v0; void* v1; void* v2; unsigned int v3; unsigned long long v4; char v5[3]; unsigned long long v7; unsigned long long v8; *(&v3) = strlen(a0); if (a1 && a1[0]) { if (!a1[1]) { v7 = 1; } else if (a1[2]) { v7 = strlen(a1); } else { v7 = 2; } } if (!a1 || !a1[0]) v7 = 0; v4 = v7; v0 = a2 & 8; if (v0 && a1) { v1 = sh_xmalloc(v4 + *(&v3) + 14, "variables.c", 0x12a6); v2 = v1; memcpy(v2, "BASH_FUNC_", 0xa); v2 += 10; memcpy(v2, a0, *(&v3)); v2 += *(&v3); memcpy(v2, "%%", 0x2); *(&v2) = v2 + 2; } if (!a1 || !v0) { v1 = sh_xmalloc(v4 + *(&v3) + 2, "variables.c", 0x12d2); memcpy(v1, a0, *(&v3)); *(&v2) = *(&v3) + v1; } v2[0] = 61; if (a1 && a1[0]) { if (v0) { *(&v5) = dequote_escapes(a1); if (v5 && v5[0]) { if (!v5[1]) { v8 = 1; } else if (v5[2]) { v8 = strlen(v5); } else { v8 = 2; } } if (!v5[0] || !v5) v8 = 0; v4 = v8; memcpy(&v2[1], v5, v4 + 1); sh_xfree(v5, "variables.c", 0x12df); } else { memcpy(&v2[1], a1, v4 + 1); } } if (!a1 || !a1[0]) v2[1] = 0; return v1; }
void * xrealloc (void * pointer, size_t bytes) { void * temp; temp = pointer ? realloc (pointer, bytes) : malloc (bytes); if (temp == 0) memory_error_and_abort ("xrealloc"); return (temp); }
long long xrealloc(void* a0, unsigned int a1) { unsigned long v0; unsigned long long v2; if (a0) v2 = realloc(a0, a1); else v2 = malloc(a1); v0 = v2; if (!v0) memory_error_and_abort("xrealloc"); return v0; }