input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static void
check_stdout (void)
{
if (ferror_unlocked (
stdout
))
fatal ("write failed");
else if (fclose (
stdout
) != 0)
perror_fatal (gettext ("standard output"));
}
| void check_stdout() {
if (ferror_unlocked(stdout)) {
fatal("write failed");
} else if (fclose(stdout)) {
perror_fatal(gettext("standard output"));
} else {
return;
}
}
|
int
login_write(struct logininfo *li)
{
if (geteuid() != 0) {
sshlog("loginrec.c", __func__, 444, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Attempt to write login records by non-root user (aborting)");
return (1);
}
login_set_current_time(li);
syslogin_write_entry(li);
if (li->type == 7)
lastlog_write_entry(li);
return (0);
}
| void login_write(struct_0 *a0) {
char v0;
char v1;
unsigned long long v3;
void* v4;
if (geteuid()) {
sshlog("loginrec.c", "login_write", 0x1bc, 0x0, 0x3, 0x0, "Attempt to write login records by non-root user (aborting)", *(&v0), *(&v1));
v3 = 1;
return;
}
login_set_current_time(a0);
syslogin_write_entry(a0);
if (a0->field_44 == 7)
lastlog_write_entry(a0);
v4 = 0;
return;
}
|
static void
decode_options (int argc, char **argv)
{
int idx;
struct option_locus loc = { OPTS_COMMAND_LINE, 0, 0, 0 };
struct tar_args args = { &loc,
((void *)0)
,
0
,
0
,
0
,
((void *)0)
,
((void *)0)
};
argp_version_setup ("tar", tar_authors);
args.backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
posixly_correct = getenv ("POSIXLY_CORRECT") !=
((void *)0)
;
subcommand_option = UNKNOWN_SUBCOMMAND;
archive_format = DEFAULT_FORMAT;
blocking_factor = 20;
record_size = 20 * 512;
excluded = new_exclude ();
hole_detection = HOLE_DETECTION_DEFAULT;
newer_mtime_option.tv_sec = ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))));
newer_mtime_option.tv_nsec = -1;
mtime_option.tv_sec = ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))));
mtime_option.tv_nsec = -1;
recursion_option =
(1 << 3)
;
unquote_option =
1
;
tar_sparse_major = 1;
tar_sparse_minor = 0;
savedir_sort_order = SAVEDIR_SORT_NONE;
owner_option = -1; owner_name_option =
((void *)0)
;
group_option = -1; group_name_option =
((void *)0)
;
check_device_option =
1
;
incremental_level = -1;
seek_option = -1;
if (argc > 1 && argv[1][0] != '-')
{
int new_argc;
char **new_argv;
char *const *in;
char **out;
const char *letter;
char buffer[3];
buffer[0] = '-';
buffer[2] = '\0';
new_argc = argc - 1 + strlen (argv[1]);
new_argv = xmalloc ((new_argc + 1) * sizeof (char *));
in = argv;
out = new_argv;
*out++ = *in++;
for (letter = *in++; *letter; letter++)
{
struct argp_option const *opt;
buffer[1] = *letter;
*out++ = xstrdup (buffer);
opt = find_argp_option (&argp, *letter);
if (opt && opt->arg)
{
if (in < argv + argc)
*out++ = *in++;
else
do { if (error_hook) error_hook (); error (0, 0, gettext ("Old option '%c' requires an argument."), *letter); usage (2); } while (0)
;
}
}
while (in < argv + argc)
*out++ = *in++;
*out = 0;
argc = new_argc;
argv = new_argv;
}
parse_default_options (&args);
if (argp_parse (&argp, argc, argv, 0x08, &idx, &args))
exit (2);
if (args.o_option)
{
if (subcommand_option == CREATE_SUBCOMMAND)
{
set_archive_format ("v7");
}
else
{
same_owner_option = -1;
}
}
for (; idx < argc; idx++)
name_add_name (argv[idx]);
if (archive_format == DEFAULT_FORMAT)
{
if (args.pax_option)
archive_format = POSIX_FORMAT;
else
archive_format = GNU_FORMAT;
}
if ((volume_label_option && subcommand_option == CREATE_SUBCOMMAND)
|| incremental_option
|| multi_volume_option
|| sparse_option)
assert_format ((1<<(OLDGNU_FORMAT))
| (1<<(GNU_FORMAT))
| (1<<(POSIX_FORMAT)));
if (occurrence_option)
{
if (!name_more_files ())
do { if (error_hook) error_hook (); error (0, 0, gettext ("--occurrence is meaningless without a file list")); usage (2); } while (0)
;
if (!(subcommand_class[subcommand_option] & (0x10)))
{
if (option_set_in_cl (OC_OCCURRENCE))
option_conflict_error ("--occurrence",
subcommand_string (subcommand_option));
else
occurrence_option = 0;
}
}
if (archive_names == 0)
{
archive_names = 1;
archive_name_array[0] = getenv ("TAPE");
if (! archive_name_array[0])
archive_name_array[0] = "-";
}
if (archive_names > 1 && !multi_volume_option)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Multiple archive files require '-M' option")); usage (2); } while (0)
;
if (listed_incremental_option
&& (0 <= (newer_mtime_option).tv_nsec))
{
struct option_locus *listed_loc = optloc_lookup (OC_LISTED_INCREMENTAL);
struct option_locus *newer_loc = optloc_lookup (OC_NEWER);
if (optloc_eq (listed_loc, newer_loc))
option_conflict_error ("--listed-incremental", "--newer");
else if (listed_loc->source == OPTS_COMMAND_LINE)
listed_incremental_option =
((void *)0)
;
else
memset (&newer_mtime_option, 0, sizeof (newer_mtime_option));
}
if (incremental_level != -1 && !listed_incremental_option)
do { if (error_hook) error_hook (); error (0, 0, gettext ("--level is meaningless without --listed-incremental")); } while (0)
;
if (volume_label_option)
{
if (archive_format == GNU_FORMAT || archive_format == OLDGNU_FORMAT)
{
size_t volume_label_max_len =
(sizeof current_header->header.name
- 1
- (multi_volume_option
? (sizeof " Volume "
- 1
+ (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1)))
- 1 )
: 0));
if (volume_label_max_len < strlen (volume_label_option))
do { if (error_hook) error_hook (); error (0, 0, ngettext ("%s: Volume label is too long (limit is %lu byte)", "%s: Volume label is too long (limit is %lu bytes)", volume_label_max_len), quotearg_colon (volume_label_option), (unsigned long) volume_label_max_len); usage (2); } while (0)
;
}
}
if (verify_option)
{
if (multi_volume_option)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Cannot verify multi-volume archives")); usage (2); } while (0);
if (use_compress_program_option)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Cannot verify compressed archives")); usage (2); } while (0);
if (!(subcommand_class[subcommand_option] & (0x02)))
{
if (option_set_in_cl (OC_VERIFY))
option_conflict_error ("--verify",
subcommand_string (subcommand_option));
else
verify_option =
0
;
}
}
if (use_compress_program_option)
{
if (multi_volume_option)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Cannot use multi-volume compressed archives")); usage (2); } while (0);
if ((subcommand_class[subcommand_option] & (0x04)))
do { if (error_hook) error_hook (); error (0, 0, gettext ("Cannot update compressed archives")); usage (2); } while (0);
if (subcommand_option == CAT_SUBCOMMAND)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Cannot concatenate compressed archives")); usage (2); } while (0);
}
if (set_mtime_option == CLAMP_MTIME)
{
if (!(0 <= (mtime_option).tv_nsec))
do { if (error_hook) error_hook (); error (0, 0, gettext ("--clamp-mtime needs a date specified using --mtime")); usage (2); } while (0)
;
}
if (args.pax_option
&& archive_format != POSIX_FORMAT
&& !(subcommand_class[subcommand_option] & (0x01)))
do { if (error_hook) error_hook (); error (0, 0, gettext ("--pax-option can be used only on POSIX archives")); usage (2); } while (0);
if ((acls_option > 0)
&& archive_format != POSIX_FORMAT
&& !(subcommand_class[subcommand_option] & (0x01)))
do { if (error_hook) error_hook (); error (0, 0, gettext ("--acls can be used only on POSIX archives")); usage (2); } while (0);
if ((selinux_context_option > 0)
&& archive_format != POSIX_FORMAT
&& !(subcommand_class[subcommand_option] & (0x01)))
do { if (error_hook) error_hook (); error (0, 0, gettext ("--selinux can be used only on POSIX archives")); usage (2); } while (0);
if ((xattrs_option > 0)
&& archive_format != POSIX_FORMAT
&& !(subcommand_class[subcommand_option] & (0x01)))
do { if (error_hook) error_hook (); error (0, 0, gettext ("--xattrs can be used only on POSIX archives")); usage (2); } while (0);
if (starting_file_option && !(subcommand_class[subcommand_option] & (0x01)))
{
if (option_set_in_cl (OC_STARTING_FILE))
option_conflict_error ("--starting-file",
subcommand_string (subcommand_option));
else
starting_file_option =
0
;
}
if (same_order_option && !(subcommand_class[subcommand_option] & (0x01)))
{
if (option_set_in_cl (OC_SAME_ORDER))
option_conflict_error ("--same-order",
subcommand_string (subcommand_option));
else
same_order_option =
0
;
}
if (one_top_level_option)
{
char *base;
if (absolute_names_option)
{
struct option_locus *one_top_level_loc =
optloc_lookup (OC_ONE_TOP_LEVEL);
struct option_locus *absolute_names_loc =
optloc_lookup (OC_ABSOLUTE_NAMES);
if (optloc_eq (one_top_level_loc, absolute_names_loc))
option_conflict_error ("--one-top-level", "--absolute-names");
else if (one_top_level_loc->source == OPTS_COMMAND_LINE)
absolute_names_option =
0
;
else
one_top_level_option =
0
;
}
if (one_top_level_option && !one_top_level_dir)
{
base = base_name (archive_name_array[0]);
one_top_level_dir = strip_compression_suffix (base);
free (base);
if (!one_top_level_dir)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Cannot deduce top-level directory name; " "please set it explicitly with --one-top-level=DIR")); usage (2); } while (0)
;
}
}
if (recursive_unlink_option)
old_files_option = UNLINK_FIRST_OLD_FILES;
{
int base_open_flags =
(
0
|
02000000
|
0400
|
04000
| (dereference_option ? 0 :
0400000
)
| (atime_preserve_option == system_atime_preserve ?
01000000
: 0));
open_read_flags =
00
| base_open_flags;
open_searchdir_flags =
00
|
0200000
| base_open_flags;
}
fstatat_flags = dereference_option ? 0 :
0x100
;
if (subcommand_option == TEST_LABEL_SUBCOMMAND)
{
if (!name_more_files ())
verbose_option++;
}
else if (utc_option)
verbose_option = 2;
if (tape_length_option && tape_length_option < record_size)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Volume length cannot be less than record size")); usage (2); } while (0);
if (same_order_option && listed_incremental_option)
{
struct option_locus *preserve_order_loc = optloc_lookup (OC_SAME_ORDER);
struct option_locus *listed_incremental_loc =
optloc_lookup (OC_LISTED_INCREMENTAL);
if (optloc_eq (preserve_order_loc, listed_incremental_loc))
option_conflict_error ("--preserve-order", "--listed-incremental");
else if (preserve_order_loc->source == OPTS_COMMAND_LINE)
listed_incremental_option =
0
;
else
same_order_option =
0
;
}
switch (subcommand_option)
{
case CREATE_SUBCOMMAND:
if (!name_more_files ())
do { if (error_hook) error_hook (); error (0, 0, gettext ("Cowardly refusing to create an empty archive")); usage (2); } while (0)
;
if (args.compress_autodetect && archive_names
&& strcmp (archive_name_array[0], "-"))
set_compression_program_by_suffix (archive_name_array[0],
use_compress_program_option);
break;
case EXTRACT_SUBCOMMAND:
case LIST_SUBCOMMAND:
case DIFF_SUBCOMMAND:
case TEST_LABEL_SUBCOMMAND:
for (archive_name_cursor = archive_name_array;
archive_name_cursor < archive_name_array + archive_names;
archive_name_cursor++)
if (!strcmp (*archive_name_cursor, "-"))
request_stdin ("-f");
break;
case CAT_SUBCOMMAND:
case UPDATE_SUBCOMMAND:
case APPEND_SUBCOMMAND:
for (archive_name_cursor = archive_name_array;
archive_name_cursor < archive_name_array + archive_names;
archive_name_cursor++)
if (!strcmp (*archive_name_cursor, "-"))
do { if (error_hook) error_hook (); error (0, 0, gettext ("Options '-Aru' are incompatible with '-f -'")); usage (2); } while (0)
;
default:
break;
}
if (index_file_name)
{
stdlis = fopen (index_file_name, "w");
if (! stdlis)
open_fatal (index_file_name);
}
else
stdlis = to_stdout_option ?
stderr
:
stdout
;
archive_name_cursor = archive_name_array;
if (args.backup_suffix_string)
simple_backup_suffix = xstrdup (args.backup_suffix_string);
if (backup_option)
{
backup_type = xget_version ("--backup", args.version_control_string);
if (backup_type == no_backups || (to_stdout_option || to_command_option))
backup_option =
0
;
}
checkpoint_finish_compile ();
report_textual_dates (&args);
}
| unsigned long decode_options(int a1, long a2)
{
int v2;
char **v3;
_QWORD *v4;
_QWORD *v5;
_QWORD *v6;
unsigned int v7;
char *v8;
_QWORD *v9;
_QWORD *v10;
const char *v11;
char *v12;
const char *v13;
char **v14;
char *v15;
char *v16;
unsigned long v17;
long v18;
char *v19;
char *v20;
char *v21;
const char *v22;
char *v23;
char *v24;
char *v25;
char *v26;
char *v27;
char *v28;
char *v29;
char *v30;
const char *v31;
const char *v32;
char *v33;
int v34;
int v35;
int v36;
double v37;
char *v38;
char *v39;
long v40;
char *v41;
FILE *v42;
char **argv;
int argc;
int v46;
int v47;
int v48;
unsigned long v49;
_QWORD *v50;
char *i;
_QWORD *v52;
long argp_option;
const char *v54;
long v55;
unsigned long n;
const char *v57;
long v58;
void *ptr;
const char *v60;
long v61;
int v62;
long v63;
long v64;
long v65;
long input[2];
char v67;
char v68;
char v69;
char *v70;
long v71;
char v72[3];
unsigned long v73;
argc = a1;
argv = (char **)a2;
v73 = __readfsqword(0x28u);
v62 = 1;
v63 = 0LL;
v64 = 0LL;
v65 = 0LL;
input[0] = (long)&v62;
input[1] = 0LL;
v67 = 0;
v68 = 0;
v69 = 0;
v70 = 0LL;
v71 = 0LL;
argp_version_setup("tar", tar_authors);
v70 = getenv("SIMPLE_BACKUP_SUFFIX");
posixly_correct = getenv("POSIXLY_CORRECT") != 0LL;
subcommand_option = 0;
archive_format = 0;
blocking_factor = 20;
record_size = 10240LL;
excluded = new_exclude();
hole_detection = 0;
newer_mtime_option[0] = 0x8000000000000000LL;
newer_mtime_option[1] = -1LL;
mtime_option[0] = 0x8000000000000000LL;
mtime_option[1] = -1LL;
recursion_option = 8;
unquote_option = 1;
tar_sparse_major = 1;
tar_sparse_minor = 0;
savedir_sort_order = 0;
owner_option = -1;
owner_name_option = 0LL;
group_option = -1;
group_name_option = 0LL;
check_device_option = 1;
incremental_level = -1;
seek_option = -1;
if ( a1 > 1 && **(_BYTE **)(a2 + 8) != 45 )
{
v72[0] = 45;
v72[2] = 0;
v2 = strlen(*(const char **)(a2 + 8));
v47 = v2 + a1 - 1;
v52 = xmalloc(8LL * (v2 + a1));
v49 = a2 + 8;
v50 = v52 + 1;
*v52 = *(_QWORD *)a2;
v3 = (char **)v49;
v49 += 8LL;
for ( i = *v3; *i; ++i )
{
v72[1] = *i;
v4 = v50++;
*v4 = xstrdup(v72);
argp_option = find_argp_option((long *)&argp, *i);
if ( argp_option && *(_QWORD *)(argp_option + 16) )
{
if ( v49 >= 8LL * a1 + a2 )
{
if ( error_hook )
error_hook(&argp);
v7 = *i;
v8 = gettext("Old option '%c' requires an argument.");
error(0, 0, v8, v7);
usage(2);
}
v5 = (_QWORD *)v49;
v49 += 8LL;
v6 = v50++;
*v6 = *v5;
}
}
while ( v49 < 8LL * a1 + a2 )
{
v9 = (_QWORD *)v49;
v49 += 8LL;
v10 = v50++;
*v10 = *v9;
}
*v50 = 0LL;
argc = v47;
argv = (char **)v52;
}
parse_default_options(input);
v11 = (const char *)&argp;
if ( argp_parse(&argp, argc, argv, 8u, &v46, input) )
exit(2);
if ( v67 )
{
if ( subcommand_option == 3 )
{
v11 = "v7";
set_archive_format("v7");
}
else
{
same_owner_option = -1;
}
}
while ( argc > v46 )
{
v11 = argv[v46];
name_add_name(v11);
++v46;
}
if ( !archive_format )
{
if ( v68 )
archive_format = 4;
else
archive_format = 6;
}
if ( volume_label_option && subcommand_option == 3 || incremental_option || multi_volume_option || sparse_option )
{
v11 = (_BYTE *)(&loc_51 + 3);
assert_format(84LL);
}
if ( occurrence_option )
{
if ( !name_more_files() )
{
if ( error_hook )
error_hook(v11);
v12 = gettext("--occurrence is meaningless without a file list");
error(0, 0, v12);
usage(2);
}
if ( (subcommand_class[subcommand_option] & 0x10) == 0 )
{
v11 = (_BYTE *)&loc_1;
if ( option_set_in_cl(1) )
{
v13 = subcommand_string(subcommand_option);
option_conflict_error((long)"--occurrence", (long)v13);
}
occurrence_option = 0LL;
}
}
if ( !archive_names )
{
archive_names = 1LL;
v14 = (char **)archive_name_array;
v11 = "TAPE";
*v14 = getenv("TAPE");
if ( !*(_QWORD *)archive_name_array )
*(_QWORD *)archive_name_array = "-";
}
if ( (unsigned long)archive_names > 1 && multi_volume_option != 1 )
{
if ( error_hook )
error_hook(v11);
v15 = gettext("Multiple archive files require '-M' option");
error(0, 0, v15);
usage(2);
}
if ( listed_incremental_option && newer_mtime_option[1] >= 0 )
{
v54 = (const char *)optloc_lookup(2);
v55 = optloc_lookup(3);
v11 = v54;
if ( optloc_eq((long)v54, v55) )
option_conflict_error((long)"--listed-incremental", (long)"--newer");
if ( *(_DWORD *)v54 == 1 )
{
listed_incremental_option = 0LL;
}
else
{
v11 = (const char *)newer_mtime_option;
memset(newer_mtime_option, 0, sizeof(newer_mtime_option));
}
}
if ( incremental_level != -1 && !listed_incremental_option )
{
if ( error_hook )
error_hook(v11);
v16 = gettext("--level is meaningless without --listed-incremental");
v11 = 0LL;
error(0, 0, v16);
}
if ( volume_label_option && (archive_format == 6 || archive_format == 2) )
{
v17 = multi_volume_option ? 81LL : 99LL;
n = v17;
v11 = volume_label_option;
if ( v17 < strlen(volume_label_option) )
{
if ( error_hook )
error_hook(volume_label_option);
v18 = quotearg_colon(volume_label_option);
v19 = ngettext(
"%s: Volume label is too long (limit is %lu byte)",
"%s: Volume label is too long (limit is %lu bytes)",
n);
error(0, 0, v19, v18, n);
usage(2);
}
}
if ( verify_option )
{
if ( multi_volume_option )
{
if ( error_hook )
error_hook(v11);
v20 = gettext("Cannot verify multi-volume archives");
error(0, 0, v20);
usage(2);
}
if ( use_compress_program_option )
{
if ( error_hook )
error_hook(v11);
v21 = gettext("Cannot verify compressed archives");
error(0, 0, v21);
usage(2);
}
if ( (subcommand_class[subcommand_option] & 2) == 0 )
{
v11 = (_BYTE *)&loc_4;
if ( option_set_in_cl(4) )
{
v22 = subcommand_string(subcommand_option);
option_conflict_error((long)"--verify", (long)v22);
}
verify_option = 0;
}
}
if ( use_compress_program_option )
{
if ( multi_volume_option )
{
if ( error_hook )
error_hook(v11);
v23 = gettext("Cannot use multi-volume compressed archives");
error(0, 0, v23);
usage(2);
}
if ( (subcommand_class[subcommand_option] & 4) != 0 )
{
if ( error_hook )
error_hook(v11);
v24 = gettext("Cannot update compressed archives");
error(0, 0, v24);
usage(2);
}
if ( subcommand_option == 2 )
{
if ( error_hook )
error_hook(v11);
v25 = gettext("Cannot concatenate compressed archives");
error(0, 0, v25);
usage(2);
}
}
if ( set_mtime_option == 2 && mtime_option[1] < 0 )
{
if ( error_hook )
error_hook(v11);
v26 = gettext("--clamp-mtime needs a date specified using --mtime");
error(0, 0, v26);
usage(2);
}
if ( v68 && archive_format != 4 && (subcommand_class[subcommand_option] & 1) == 0 )
{
if ( error_hook )
error_hook(v11);
v27 = gettext("--pax-option can be used only on POSIX archives");
error(0, 0, v27);
usage(2);
}
if ( acls_option > 0 && archive_format != 4 && (subcommand_class[subcommand_option] & 1) == 0 )
{
if ( error_hook )
error_hook(v11);
v28 = gettext("--acls can be used only on POSIX archives");
error(0, 0, v28);
usage(2);
}
if ( selinux_context_option > 0 && archive_format != 4 && (subcommand_class[subcommand_option] & 1) == 0 )
{
if ( error_hook )
error_hook(v11);
v29 = gettext("--selinux can be used only on POSIX archives");
error(0, 0, v29);
usage(2);
}
if ( xattrs_option > 0 && archive_format != 4 && (subcommand_class[subcommand_option] & 1) == 0 )
{
if ( error_hook )
error_hook(v11);
v30 = gettext("--xattrs can be used only on POSIX archives");
error(0, 0, v30);
usage(2);
}
if ( starting_file_option && (subcommand_class[subcommand_option] & 1) == 0 )
{
v11 = (_BYTE *)(&loc_4 + 1);
if ( option_set_in_cl(5) )
{
v31 = subcommand_string(subcommand_option);
option_conflict_error((long)"--starting-file", (long)v31);
}
starting_file_option = 0;
}
if ( same_order_option && (subcommand_class[subcommand_option] & 1) == 0 )
{
v11 = (_BYTE *)(&loc_4 + 2);
if ( option_set_in_cl(6) )
{
v32 = subcommand_string(subcommand_option);
option_conflict_error((long)"--same-order", (long)v32);
}
same_order_option = 0;
}
if ( one_top_level_option )
{
if ( absolute_names_option )
{
v57 = (const char *)optloc_lookup(7);
v58 = optloc_lookup(8);
v11 = v57;
if ( optloc_eq((long)v57, v58) )
option_conflict_error((long)"--one-top-level", (long)"--absolute-names");
if ( *(_DWORD *)v57 == 1 )
absolute_names_option = 0;
else
one_top_level_option = 0;
}
if ( one_top_level_option )
{
if ( !one_top_level_dir )
{
ptr = (void *)base_name(*(_QWORD *)archive_name_array);
one_top_level_dir = strip_compression_suffix(ptr);
v11 = (const char *)ptr;
free(ptr);
if ( !one_top_level_dir )
{
if ( error_hook )
error_hook(v11);
v33 = gettext("Cannot deduce top-level directory name; please set it explicitly with --one-top-level=DIR");
error(0, 0, v33);
usage(2);
}
}
}
}
if ( recursive_unlink_option )
old_files_option = 3;
if ( dereference_option )
v34 = 526592;
else
v34 = 657664;
if ( atime_preserve_option == 2 )
v35 = 0x40000;
else
v35 = 0;
v48 = v34 | v35;
open_read_flags = v34 | v35;
open_searchdir_flags = v34 | v35 | 0x10000;
if ( dereference_option )
v36 = 0;
else
v36 = 256;
fstatat_flags = v36;
if ( subcommand_option == 9 )
{
if ( !name_more_files() )
++verbose_option;
}
else if ( utc_option )
{
verbose_option = 2;
}
if ( *(double *)&tape_length_option != 0.0 )
{
v37 = record_size < 0
? (double)(int)(record_size & 1 | ((unsigned long)record_size >> 1))
+ (double)(int)(record_size & 1 | ((unsigned long)record_size >> 1))
: (double)(int)record_size;
if ( v37 > *(double *)&tape_length_option )
{
if ( error_hook )
error_hook(v11);
v38 = gettext("Volume length cannot be less than record size");
error(0, 0, v38);
usage(2);
}
}
if ( same_order_option && listed_incremental_option )
{
v60 = (const char *)optloc_lookup(6);
v61 = optloc_lookup(2);
v11 = v60;
if ( optloc_eq((long)v60, v61) )
option_conflict_error((long)"--preserve-order", (long)"--listed-incremental");
if ( *(_DWORD *)v60 == 1 )
listed_incremental_option = 0LL;
else
same_order_option = 0;
}
switch ( subcommand_option )
{
case 1:
case 2:
case 8:
for ( archive_name_cursor = (long)archive_name_array;
(unsigned long)archive_name_array + 8 * archive_names > archive_name_cursor;
archive_name_cursor += 8LL )
{
v40 = *(_QWORD *)archive_name_cursor;
if ( !strcmp(*(const char **)archive_name_cursor, "-") )
{
if ( error_hook )
error_hook(v40);
v41 = gettext("Options '-Aru' are incompatible with '-f -'");
error(0, 0, v41);
usage(2);
}
}
break;
case 3:
if ( !name_more_files() )
{
if ( error_hook )
error_hook(v11);
v39 = gettext("Cowardly refusing to create an empty archive");
error(0, 0, v39);
usage(2);
}
if ( v69 && archive_names && strcmp(*(const char **)archive_name_array, "-") )
set_compression_program_by_suffix(*(_QWORD *)archive_name_array, use_compress_program_option);
break;
case 5:
case 6:
case 7:
case 9:
for ( archive_name_cursor = (long)archive_name_array;
(unsigned long)archive_name_array + 8 * archive_names > archive_name_cursor;
archive_name_cursor += 8LL )
{
if ( !strcmp(*(const char **)archive_name_cursor, "-") )
request_stdin((long)"-f");
}
break;
default:
break;
}
if ( index_file_name )
{
stdlis = fopen(index_file_name, "w");
if ( stdlis )
goto LABEL_212;
open_fatal(index_file_name);
}
if ( to_stdout_option )
v42 = stderr;
else
v42 = stdout;
stdlis = v42;
LABEL_212:
archive_name_cursor = (long)archive_name_array;
if ( v70 )
simple_backup_suffix = xstrdup(v70);
if ( backup_option )
{
backup_type = xget_version("--backup", v71);
if ( !backup_type || to_stdout_option || to_command_option )
backup_option = 0;
}
checkpoint_finish_compile();
report_textual_dates((long)input);
return __readfsqword(0x28u) ^ v73;
}
|
static void
print_initspawn (const STRUCT_UTMP *utmp_ent)
{
char *comment = make_id_equals_comment (utmp_ent);
char pidstr[(((((sizeof (utmp_ent->ut_pid) * 8) - (! ((__typeof__ (utmp_ent->ut_pid)) 0 < (__typeof__ (utmp_ent->ut_pid)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (utmp_ent->ut_pid)) 0 < (__typeof__ (utmp_ent->ut_pid)) -1))) + 1]; sprintf (pidstr, "%ld", (long int) (utmp_ent->ut_pid));
print_line (-1, "", ' ', sizeof utmp_ent->ut_line, utmp_ent->ut_line,
time_string (utmp_ent), "", pidstr, comment, "");
free (comment);
}
| void print_initspawn(struct_0 *a0) {
unsigned long v0;
char v1;
char v2;
unsigned long long *v4;
unsigned long long v5;
v0 = make_id_equals_comment(a0);
sprintf(&v1, "%ld", a0->field_4);
print_line(0xffffffff, &g_401de3, 0x20, 0x20, a0 + 1, time_string(a0), &g_401de3, &v1, v0, &g_401de3);
free(v0);
v5 = *(&v2) ^ v4[5];
return;
}
|
static int
sshsk_key_from_response(int alg, const char *application, uint8_t flags,
struct sk_enroll_response *resp, struct sshkey **keyp)
{
struct sshkey *key =
((void *)0)
;
int r = -1;
*keyp =
((void *)0)
;
if (resp->public_key ==
((void *)0)
|| resp->key_handle ==
((void *)0)
) {
sshlog("ssh-sk.c", __func__, 301, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "sk_enroll response invalid");
r = -4;
goto out;
}
switch (alg) {
case 0x00:
if ((r = sshsk_ecdsa_assemble(resp, &key)) != 0)
goto out;
break;
case 0x01:
if ((r = sshsk_ed25519_assemble(resp, &key)) != 0)
goto out;
break;
default:
sshlog("ssh-sk.c", __func__, 317, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "unsupported algorithm %d", alg);
r = -10;
goto out;
}
key->sk_flags = flags;
if ((key->sk_key_handle = sshbuf_new()) ==
((void *)0)
||
(key->sk_reserved = sshbuf_new()) ==
((void *)0)
) {
sshlog("ssh-sk.c", __func__, 324, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "allocation failed");
r = -2;
goto out;
}
if ((key->sk_application = strdup(application)) ==
((void *)0)
) {
sshlog("ssh-sk.c", __func__, 329, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "strdup application failed");
r = -2;
goto out;
}
if ((r = sshbuf_put(key->sk_key_handle, resp->key_handle,
resp->key_handle_len)) != 0) {
sshlog("ssh-sk.c", __func__, 335, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "put key handle");
goto out;
}
r = 0;
*keyp = key;
key =
((void *)0)
;
out:
sshkey_free(key);
return r;
}
| int sshsk_key_from_response(unsigned long a0, char *a1, unsigned long a2, unsigned long long a3[5], unsigned long long *a4) {
unsigned long long v0;
unsigned long v1;
unsigned int v2;
void* v3;
void* v5;
void* v6;
void* v7;
v3 = 0;
v2 = -1;
*(a4) = 0;
if (a3[1] && a3[3]) {
if (!a0) {
v2 = sshsk_ecdsa_assemble(a3, &v3);
} else if (a0 != 1) {
v1 = a0;
v0 = "unsupported algorithm %d";
sshlog("ssh-sk.c", "sshsk_key_from_response", 0x13d, 0x1, 0x2, 0x0);
v2 = -10;
}
if (a0 == 1)
v2 = sshsk_ed25519_assemble(a3, &v3);
if ((!v2 || !v2) && (!v2 || a0 == 1) && (!v2 || !a0) && (a0 == 1 || !a0)) {
*(&v3[104]) = a2;
v5 = v3;
*(&v5[112]) = sshbuf_new();
if (v5[112]) {
v6 = v3;
*(&v6[120]) = sshbuf_new();
if (v6[120]) {
v7 = v3;
*(&v7[96]) = strdup(a1);
if (!v7[96]) {
v0 = "strdup application failed";
sshlog("ssh-sk.c", "sshsk_key_from_response", 0x149, 0x1, 0x2, 0x0);
v2 = -2;
} else {
v2 = sshbuf_put(v3[112], a3[3], a3[4], a3[3]);
if (v2) {
v0 = "put key handle";
sshlog("ssh-sk.c", "sshsk_key_from_response", 0x14f, 0x1, 0x2, ssh_err(v2));
} else {
v2 = 0;
*(a4) = v3;
v3 = 0;
}
}
}
}
if (!v6[120] || !v5[112]) {
v0 = "allocation failed";
sshlog("ssh-sk.c", "sshsk_key_from_response", 0x144, 0x1, 0x2, 0x0);
v2 = -2;
}
}
}
if (!a3[3] || !a3[1]) {
v0 = "sk_enroll response invalid";
sshlog("ssh-sk.c", "sshsk_key_from_response", 0x12d, 0x1, 0x2, 0x0);
v2 = -0x4;
}
sshkey_free(v3);
return v2;
}
|
static int
parse_ls_flags(char **argv, int argc, int *lflag)
{
int ch;
BSDoptind = BSDoptreset = 1;
BSDopterr = 0;
*lflag = 0x0008;
while ((ch = BSDgetopt(argc, argv, "1Safhlnrt")) != -1) {
switch (ch) {
case '1':
*lflag &= ~(0x0001|0x0002|0x0004|0x0100);
*lflag |= 0x0002;
break;
case 'S':
*lflag &= ~(0x0008|0x0010|0x0020);
*lflag |= 0x0020;
break;
case 'a':
*lflag |= 0x0080;
break;
case 'f':
*lflag &= ~(0x0008|0x0010|0x0020);
break;
case 'h':
*lflag |= 0x0100;
break;
case 'l':
*lflag &= ~0x0002;
*lflag |= 0x0001;
break;
case 'n':
*lflag &= ~0x0002;
*lflag |= 0x0004|0x0001;
break;
case 'r':
*lflag |= 0x0040;
break;
case 't':
*lflag &= ~(0x0008|0x0010|0x0020);
*lflag |= 0x0010;
break;
default:
sshlog("sftp.c", __func__, 527, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "ls: Invalid flag -%c", BSDoptopt);
return -1;
}
}
return BSDoptind;
}
| long parse_ls_flags(long a1, unsigned int a2, int *a3)
{
int v3;
int v4;
int v5;
BSDoptreset = 1;
BSDoptind = 1;
BSDopterr = 0;
*a3 = 8;
v3 = BSDgetopt(a2, a1, "1Safhlnrt");
while ( 2 )
{
if ( v3 != -1 )
{
switch ( v3 )
{
case '1':
*a3 &= 0xFFFFFEF8;
*a3 |= 2u;
goto LABEL_13;
case 'S':
*a3 &= 0xFFFFFFC7;
*a3 |= 0x20u;
goto LABEL_13;
case 'a':
v4 = *a3;
LOBYTE(v4) = *a3 | 0x80;
*a3 = v4;
goto LABEL_13;
case 'f':
*a3 &= 0xFFFFFFC7;
goto LABEL_13;
case 'h':
v5 = *a3;
BYTE1(v5) = BYTE1(*a3) | 1;
*a3 = v5;
goto LABEL_13;
case 'l':
*a3 &= ~2u;
*a3 |= 1u;
goto LABEL_13;
case 'n':
*a3 &= ~2u;
*a3 |= 5u;
goto LABEL_13;
case 'r':
*a3 |= 0x40u;
goto LABEL_13;
case 't':
*a3 &= 0xFFFFFFC7;
*a3 |= 0x10u;
LABEL_13:
v3 = BSDgetopt(a2, a1, "1Safhlnrt");
continue;
default:
sshlog("sftp.c", "parse_ls_flags", 527LL, 0LL, 2LL, 0LL, "ls: Invalid flag -%c", BSDoptopt);
return 0xFFFFFFFFLL;
}
}
return BSDoptind;
}
}
|
char *
sh_physpath (path, flags)
char *path;
int flags;
{
char tbuf[
4096
+1], linkbuf[
4096
+1];
char *result, *p, *q, *qsave, *qbase, *workpath;
int double_slash_path, linklen, nlink;
linklen = strlen (path);
nlink = 0;
q = result = (char *)sh_xmalloc((
4096
+ 1), "pathphys.c", 92);
if (linklen >=
4096
)
workpath = (char *)strcpy (sh_xmalloc((1 + strlen (path)), "pathphys.c", 97), (path));
else
{
workpath = (char *)sh_xmalloc((
4096
+ 1), "pathphys.c", 100);
strcpy (workpath, path);
}
qbase = workpath + 1;
double_slash_path = ((workpath[0] == '/') && (workpath[1] == '/') && workpath[2] != '/');
qbase += double_slash_path;
for (p = workpath; p < qbase; )
*q++ = *p++;
qbase = q;
while (*p)
{
if (((p[0]) == '/'))
p++;
else if(p[0] == '.' && (((p[1]) == '/') || (p[1]) == 0))
p += 1;
else if (p[0] == '.' && p[1] == '.' && (((p[2]) == '/') || (p[2]) == 0))
{
p += 2;
if (q > qbase)
{
while (--q > qbase && ((*q) == '/') == 0)
;
}
}
else
{
qsave = q;
if (q != qbase)
*q++ = '/';
while (*p && (((*p) == '/') == 0))
{
if (q - result >=
4096
)
{
(*__errno_location ())
=
36
;
goto error;
}
*q++ = *p++;
}
*q = '\0';
linklen = _path_readlink (result, linkbuf,
4096
);
if (linklen < 0)
{
if (
(*__errno_location ())
!=
22
)
goto error;
continue;
}
nlink++;
if (nlink >
20
)
{
(*__errno_location ())
=
40
;
error:
sh_xfree((result), "pathphys.c", 185);
sh_xfree((workpath), "pathphys.c", 186);
return ((char *)
((void *)0)
);
}
linkbuf[linklen] = '\0';
if ((strlen (p) + linklen + 2) >=
4096
)
{
(*__errno_location ())
=
36
;
goto error;
}
strcpy (tbuf, linkbuf);
tbuf[linklen] = '/';
strcpy (tbuf + linklen, p);
strcpy (workpath, tbuf);
if (((linkbuf)[0] == '/'))
{
q = result;
qbase = workpath + 1;
double_slash_path = ((workpath[0] == '/') && (workpath[1] == '/') && workpath[2] != '/');
qbase += double_slash_path;
for (p = workpath; p < qbase; )
*q++ = *p++;
qbase = q;
}
else
{
p = workpath;
q = qsave;
}
}
}
*q = '\0';
sh_xfree((workpath), "pathphys.c", 238);
if (((result[0] == '/') && (result[1] == '/') && result[2] != '/') && double_slash_path == 0)
{
if (result[2] == '\0')
result[1] = '\0';
else
memmove (result, result + 1, strlen (result + 1) + 1);
}
return (result);
}
| int sh_physpath(char *a0, unsigned long a1) {
unsigned int v0;
int tmp_10;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char v4[3];
char v5[3];
char v6[3];
char v7[3];
char v8[3];
char v9[3];
char v10;
unsigned long long v11;
char v12;
unsigned long long v13;
unsigned int v15;
v13 = *(&v13);
v11 = *(&v11);
v0 = a1;
v3 = strlen(a0);
v2 = 0;
*(&v8) = sh_xmalloc(0x1001, "pathphys.c", 0x5c);
*(&v5) = v8;
if (v3 > 4095) {
*(&v7) = strcpy(sh_xmalloc(strlen(a0) + 1, "pathphys.c", 0x61), a0);
} else {
*(&v7) = sh_xmalloc(0x1001, "pathphys.c", 0x64);
strcpy(v7, a0);
}
v6 = &v7[1];
if (v7[0] == 47 && v7[1] == 47 && v7[2] != 47)
v15 = 1;
if (v7[2] == 47 || v7[1] != 47 || v7[0] != 47)
v15 = 0;
v1 = v15;
v6 += v1;
for (*(&v4) = v7; v4 < v6; v15[0] = *(tmp_10)) {
tmp_10 = v4;
*(&v4) = &v4[1];
v15 = v5;
*(&v5) = &v5[1];
}
for (*(&v6) = v5; ; *(&v4) = &v4[1]) {
if (!v4[0]) {
v5[0] = 0;
sh_xfree(v7, "pathphys.c", 0xee);
if (v8[0] == 47 && v8[1] == 47 && v8[2] != 47 && !v1) {
if (!v8[2])
v8[1] = 0;
else
memmove(v8, &v8[1], strlen(&v8[1]) + 1);
}
v15 = v8;
break;
} else if (v4[0] != 47) {
if (v4[0] == 46 && (v4[1] == 47 || !v4[1]))
continue;
if (v4[0] != 46 || v4[1] != 47 && v4[1]) {
if (v4[0] == 46 && v4[1] == 46 && (!v4[2] || v4[2] == 47)) {
*(&v4) = &v4[2];
if (v5 <= v6)
continue;
do {
*(&v5) = &v5[1];
if (v5 <= v6)
break;
} while (v5[0] != 47);
}
if (v4[1] != 46 || v4[0] != 46 || v4[2] && v4[2] != 47) {
*(&v9) = v5;
if (v5 != v6) {
v15 = v5;
*(&v5) = &v5[1];
v15[0] = 47;
}
while (true) {
if (v4[0] && v4[0] != 47) {
if (v5 - v8 > 4095) {
*(__errno_location()) = 36;
} else {
tmp_10 = v4;
*(&v4) = &v4[1];
v15 = v5;
*(&v5) = &v5[1];
v15[0] = *(tmp_10);
continue;
}
}
if (!v4[0] || v4[0] == 47) {
v5[0] = 0;
v3 = _path_readlink(v8, &v12, 0x1000);
if (v3 < 0) {
*(&v15) = *(__errno_location());
if (*(&v15) == 22)
break;
} else {
v2 += 1;
if (v2 > 20) {
*(__errno_location()) = 40;
} else {
(&v12)[v3] = 0;
v15 = strlen(v4) + v3 + 2;
if (v15 > 4095) {
*(__errno_location()) = 36;
} else {
strcpy(&v10, &v12);
(&v10)[v3] = 47;
strcpy(&(&v10)[v3], v4);
strcpy(v7, &v10);
if (v12 == 47) {
*(&v5) = v8;
v6 = &v7[1];
if (v7[0] == 47 && v7[1] == 47 && v7[2] != 47)
v15 = 1;
if (v7[2] == 47 || v7[1] != 47 || v7[0] != 47)
v15 = 0;
v1 = v15;
v6 += v1;
for (*(&v4) = v7; v4 < v6; v15[0] = *(tmp_10)) {
tmp_10 = v4;
*(&v4) = &v4[1];
v15 = v5;
*(&v5) = &v5[1];
}
*(&v6) = v5;
break;
} else {
*(&v4) = v7;
*(&v5) = v9;
break;
}
}
}
}
}
if (v3 < 0 && !v4[0] && *(&v15) != 22 || v3 < 0 && v4[0] == 47 && *(&v15) != 22 || !v4[0] && v3 >= 0 && v2 > 20 || !v4[0] && v3 >= 0 && v15 > 4095 || v4[0] == 47 && v3 >= 0 && v2 > 20 || v4[0] == 47 && v3 >= 0 && v15 > 4095 || v5 - v8 > 4095 && v4[0] && v4[0] != 47) {
sh_xfree(v8, "pathphys.c", 0xb9);
sh_xfree(v7, "pathphys.c", 0xba);
v15 = 0;
break;
}
}
if (v3 < 0 && !v4[0] && *(&v15) != 22 || v3 < 0 && v4[0] == 47 && *(&v15) != 22 || !v4[0] && v3 >= 0 && v2 > 20 || !v4[0] && v3 >= 0 && v15 > 4095 || v4[0] == 47 && v3 >= 0 && v2 > 20 || v4[0] == 47 && v3 >= 0 && v15 > 4095 || v5 - v8 > 4095 && v4[0] && v4[0] != 47)
break;
}
}
}
}
return v15;
}
|
int
ssh_ecdsa_sign(const struct sshkey *key, u_char **sigp, size_t *lenp,
const u_char *data, size_t datalen, u_int compat)
{
ECDSA_SIG *sig =
((void *)0)
;
const BIGNUM *sig_r, *sig_s;
int hash_alg;
u_char digest[64];
size_t len, dlen;
struct sshbuf *b =
((void *)0)
, *bb =
((void *)0)
;
int ret = -1;
if (lenp !=
((void *)0)
)
*lenp = 0;
if (sigp !=
((void *)0)
)
*sigp =
((void *)0)
;
if (key ==
((void *)0)
|| key->ecdsa ==
((void *)0)
||
sshkey_type_plain(key->type) != KEY_ECDSA)
return -10;
if ((hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1 ||
(dlen = ssh_digest_bytes(hash_alg)) == 0)
return -1;
if ((ret = ssh_digest_memory(hash_alg, data, datalen,
digest, sizeof(digest))) != 0)
goto out;
if ((sig = ECDSA_do_sign(digest, dlen, key->ecdsa)) ==
((void *)0)
) {
ret = -22;
goto out;
}
if ((bb = sshbuf_new()) ==
((void *)0)
|| (b = sshbuf_new()) ==
((void *)0)
) {
ret = -2;
goto out;
}
ECDSA_SIG_get0(sig, &sig_r, &sig_s);
if ((ret = sshbuf_put_bignum2(bb, sig_r)) != 0 ||
(ret = sshbuf_put_bignum2(bb, sig_s)) != 0)
goto out;
if ((ret = sshbuf_put_cstring(b, sshkey_ssh_name_plain(key))) != 0 ||
(ret = sshbuf_put_stringb(b, bb)) != 0)
goto out;
len = sshbuf_len(b);
if (sigp !=
((void *)0)
) {
if ((*sigp = malloc(len)) ==
((void *)0)
) {
ret = -2;
goto out;
}
memcpy(*sigp, sshbuf_ptr(b), len);
}
if (lenp !=
((void *)0)
)
*lenp = len;
ret = 0;
out:
explicit_bzero(digest, sizeof(digest));
sshbuf_free(b);
sshbuf_free(bb);
ECDSA_SIG_free(sig);
return ret;
}
| long long ssh_ecdsa_sign(struct_0 *a0, unsigned long long *a1, unsigned long long *a2, unsigned long long a3, unsigned long long a4, unsigned long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
char v3;
char v4;
void* v5;
void* v6;
void* v7;
unsigned long long v8;
unsigned int v9;
char v10;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
v0 = a5;
v5 = 0;
v6 = 0;
v7 = 0;
v1 = -1;
if (a2)
*(a2) = 0;
if (a1)
*(a1) = 0;
if (a0 && a0->field_20) {
v12 = sshkey_type_plain(a0->field_0);
if (v12 == 2) {
v2 = sshkey_ec_nid_to_hash_alg(a0->field_18);
if (v2 != -1) {
v8 = ssh_digest_bytes(v2);
if (v8) {
v1 = ssh_digest_memory(v2, a3, a4, &v10, 0x40);
if (!v1) {
v5 = ECDSA_do_sign(&v10, v8, a0->field_20, v8);
if (!v5) {
v1 = -22;
} else {
v7 = sshbuf_new();
if (v7) {
v6 = sshbuf_new();
if (v6) {
ECDSA_SIG_get0(v5, &v3, &v4, &v3);
v1 = sshbuf_put_bignum2(v7, *(&v3), *(&v3));
if (!v1) {
v1 = sshbuf_put_bignum2(v7, *(&v4), *(&v4));
if (!v1) {
v14 = sshkey_ssh_name_plain(a0);
v1 = sshbuf_put_cstring(v6, v14, v14);
if (!v1) {
v1 = sshbuf_put_stringb(v6, v7, v7);
if (!v1) {
*(&v9) = sshbuf_len(v6);
if (a1) {
*(a1) = malloc(*(&v9));
if (!*(a1))
v1 = -2;
else
memcpy(*(a1), sshbuf_ptr(v6), *(&v9));
}
if (!a1 || *(a1)) {
if (a2)
*(a2) = *(&v9);
v1 = 0;
}
}
}
}
}
}
}
if (!v6 || !v7)
v1 = -2;
}
}
explicit_bzero(&v10, 0x40);
sshbuf_free(v6);
sshbuf_free(v7);
ECDSA_SIG_free(v5);
v13 = v1;
}
}
if (v2 == -1 || !v8)
v13 = 4294967295;
}
}
if (!a0 || !a0->field_20 || v12 != 2)
v13 = 4294967286;
return v13;
}
|
static
_Bool
parse_uid (const struct parser_table* entry, char **argv, int *arg_ptr)
{
struct predicate *p = insert_num (argv, arg_ptr, entry);
if (p)
{
p->est_success_rate = (p->args.numinfo.l_val < 100) ? 0.99 : 0.2;
return
1
;
}
else
{
--*arg_ptr;
return
0
;
}
}
| long long parse_uid(unsigned long long a0, unsigned long long a1, unsigned int *a2) {
unsigned int *v0;
struct_0 *v1;
unsigned long long v3;
unsigned int v4;
v0 = a2;
v1 = insert_num(a1, a2, a0);
if (v1) {
if (v1->field_40 <= 99)
v4 = 4489188110487089316;
else
v4 = 4561245704505052365;
v1->field_24 = v4;
v3 = 1;
} else {
*(a2) = *(a2) - 1;
v3 = 0;
}
return v3;
}
|
static
_Bool
and (void)
{
_Bool
value =
1
;
while (
1
)
{
value &= term ();
if (! (pos < argc && (strcmp (argv[pos], "-a") == 0)))
return value;
advance (
0
);
}
}
| int and() {
char v0;
v0 = 1;
while (true) {
v0 = (term() & v0);
if (pos >= argc)
break;
if (strcmp(*((argv + (pos << 3))), "-a"))
break;
advance(0x0);
}
return v0;
}
|
static void cmov_aff(ge25519_aff *r, const ge25519_aff *p, unsigned char b)
{
crypto_sign_ed25519_ref_fe25519_cmov(&r->x, &p->x, b);
crypto_sign_ed25519_ref_fe25519_cmov(&r->y, &p->y, b);
}
| void cmov_aff(unsigned long long a0, unsigned long long a1, unsigned long a2) {
unsigned long long v1;
crypto_sign_ed25519_ref_fe25519_cmov(a0, a1, a2, a1);
v1 = crypto_sign_ed25519_ref_fe25519_cmov(a0 + 128, a1 + 128, a2, a0 + 128);
return;
}
|
void
ttrestore()
{
if (ttsaved == 0)
return;
ttsetattr (0, &ttin);
ttsetattr (1, &ttout);
ttsaved = 0;
}
| void ttrestore(void)
{
if (ttsaved != 0) {
ttsetattr(0,ttin);
ttsetattr(1,ttout);
ttsaved = 0;
}
return;
}
|
static gl_list_node_t
gl_linked_nx_add_at (gl_list_t list, size_t position, const void *elt)
{
size_t count = list->count;
gl_list_node_t new_node;
if (!(position <= count))
abort ();
new_node = (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
if (new_node ==
((void *)0)
)
return
((void *)0)
;
new_node->value = elt;
if (position <= (count / 2))
{
gl_list_node_t node;
node = &list->root;
for (; position > 0; position--)
node = node->next;
new_node->prev = node;
new_node->next = node->next;
new_node->next->prev = new_node;
node->next = new_node;
}
else
{
gl_list_node_t node;
position = count - position;
node = &list->root;
for (; position > 0; position--)
node = node->prev;
new_node->next = node;
new_node->prev = node->prev;
new_node->prev->next = new_node;
node->prev = new_node;
}
list->count++;
return new_node;
}
| long long gl_linked_nx_add_at(struct_0 *a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long long *v1;
struct_1 *v2;
unsigned long v3;
void* v4;
void* v6;
v0 = a1;
v3 = a0->field_40;
if (v0 > v3)
abort();
v4 = malloc(0x18);
if (!v4) {
v6 = 0;
} else {
*(&v4[16]) = a2;
if (v0 <= v3 >> 1) {
for (v1 = &a0->padding_0[40]; v0; v0 -= 1) {
v1 = *(v1);
}
*(&v4[8]) = v1;
*(v4) = *(v1);
*((*(v4) + 8)) = v4;
*(v1) = v4;
} else {
v0 = v3 - v0;
for (v2 = &a0->padding_0[40]; v0; v0 -= 1) {
v2 = v2->field_8;
}
*(v4) = v2;
*(&v4[8]) = v2->field_8;
*(v4[8]) = v4;
v2->field_8 = v4;
}
a0->field_40 = a0->field_40 + 1;
v6 = v4;
}
return v6;
}
|
static void
ossl_error(const char *msg)
{
unsigned long e;
sshlog("ssh-pkcs11.c", __func__, 88, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "%s", msg);
while ((e = ERR_get_error()) != 0)
sshlog("ssh-pkcs11.c", __func__, 90, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "libcrypto error: %s", ERR_error_string(e,
((void *)0)
));
}
| void ossl_error(unsigned long a0) {
unsigned long v0;
unsigned long long v1;
v0 = a0;
sshlog("ssh-pkcs11.c", "ossl_error", 0x58, 0x1, 0x2, 0x0, "%s");
while (true) {
*(&v1) = ERR_get_error();
if (!v1)
break;
v0 = ERR_error_string(v1, 0x0);
sshlog("ssh-pkcs11.c", "ossl_error", 0x5a, 0x1, 0x2, 0x0, "libcrypto error: %s");
}
return;
}
|
static void
initbuf (struct buffer *buf, size_t line_bytes, size_t alloc)
{
while (
1
)
{
alloc += sizeof (struct line) - alloc % sizeof (struct line);
buf->buf = malloc (alloc);
if (buf->buf)
break;
alloc /= 2;
if (alloc <= line_bytes + 1)
xalloc_die ();
}
buf->line_bytes = line_bytes;
buf->alloc = alloc;
buf->used = buf->left = buf->nlines = 0;
buf->eof =
0
;
}
| long initbuf(long a1, long a2, size_t a3)
{
long result;
while ( 1 )
{
a3 = (a3 & 0xFFFFFFFFFFFFFFE0LL) + 32;
*(_QWORD *)a1 = malloc(a3);
if ( *(_QWORD *)a1 )
break;
a3 >>= 1;
if ( a3 <= a2 + 1 )
{
xalloc_die();
break;
}
}
*(_QWORD *)(a1 + 40) = a2;
*(_QWORD *)(a1 + 24) = a3;
*(_QWORD *)(a1 + 16) = 0LL;
*(_QWORD *)(a1 + 32) = *(_QWORD *)(a1 + 16);
*(_QWORD *)(a1 + 8) = *(_QWORD *)(a1 + 32);
result = a1;
*(_BYTE *)(a1 + 48) = 0;
return result;
}
|
static ssize_t
funopen_write(void *cookie, const char *buf, size_t size)
{
struct funopen_cookie *cookiewrap = cookie;
if (cookiewrap->writefn ==
((void *)0)
)
return
(-1)
;
return cookiewrap->writefn(cookiewrap->orig_cookie, buf, size);
}
| long funopen_write(undefined8 *param_1,undefined8 param_2,undefined4 param_3)
{
int iVar1;
long lVar2;
if (param_1[2] == 0) {
lVar2 = -1;
}
else {
iVar1 = (*(code *)param_1[2])(*param_1,param_2,param_3);
lVar2 = (long)iVar1;
}
return lVar2;
}
|
void init_nfs(void)
{
struct stat st;
struct mntent * ent;
FILE * mnt;
nlist = (NFS*)0;
if (stat("/proc/version", &st) < 0)
return;
if ((mnt = setmntent("/proc/mounts", "r")) == (FILE*)0)
return;
while ((ent = getmntent(mnt))) {
if (isnetfs(ent->mnt_type)) {
size_t nlen = strlen(ent->mnt_dir);
NFS *__restrict__ p;
xmemalign((void*)&p, sizeof(void*), ((sizeof(NFS)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))+(nlen+1));
p->name = ((char*)p)+((sizeof(NFS)+(sizeof(void*)-1)) & ~(sizeof(void*)-1));
p->nlen = nlen;
p->shadow = (SHADOW*)0;
strcpy(p->name, ent->mnt_dir);
if (nlist)
nlist->prev = p;
p->next = nlist;
p->prev = (NFS*)0;
nlist = p;
}
}
endmntent(mnt);
if ((mnt = setmntent("/proc/mounts", "r")) == (FILE*)0)
return;
while ((ent = getmntent(mnt))) {
NFS *p;
for (p = nlist; p; p = p->next) {
SHADOW * __restrict__ s;
size_t nlen;
if (strcmp(ent->mnt_dir, p->name) == 0)
continue;
if (strncmp(ent->mnt_dir, p->name, p->nlen) != 0)
continue;
nlen = strlen(ent->mnt_dir);
xmemalign((void*)&s, sizeof(void*), ((sizeof(SHADOW)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))+(nlen+1));
s->name = ((char*)s)+((sizeof(SHADOW)+(sizeof(void*)-1)) & ~(sizeof(void*)-1));
s->nlen = nlen;
strcpy(s->name, ent->mnt_dir);
if (p->shadow)
p->shadow->prev = s;
s->next = p->shadow;
s->prev = (SHADOW*)0;
p->shadow = s;
}
}
endmntent(mnt);
}
| void init_nfs(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
unsigned long long v1;
void* v2;
struct_0 *v3;
unsigned long v4;
unsigned long v5;
char v6;
char v7;
unsigned long long *v9;
unsigned long long v10;
progname = 0;
if (stat("/proc/version", &v6) >= 0) {
v2 = setmntent("/proc/mounts", "r");
if (v2) {
while (true) {
v3[0] = getmntent(v2);
if (!v3)
break;
if (isnetfs(v3[2])) {
v5 = strlen(v3[1]);
xmemalign(&v0, 0x8, v5 + 41, a3, a4, a5);
*((v0 + 32)) = v0 + 40;
*((v0 + 24)) = v5;
*((v0 + 16)) = 0;
strcpy(*((v0 + 32)), v3[1]);
g_448b4808247c8950 = v0;
*(v0) = 4939120616150960456;
*((v0 + 8)) = 0;
progname = v0;
}
}
endmntent(v2);
v2 = setmntent("/proc/mounts", "r");
if (v2) {
while (true) {
v3 = &getmntent(v2)->mnt_fsname;
if (!v3)
break;
for (v1 = 4939120616150960456; v1; v1 = *(v1)) {
if (strcmp(v3->field_8, *((v1 + 32))) && !strncmp(v3->field_8, *((v1 + 32)), *((v1 + 24)))) {
v4 = strlen(v3->field_8);
xmemalign(&v0, 0x8, v4 + 33, a3, a4, a5);
*((v0 + 24)) = v0 + 32;
*((v0 + 16)) = v4;
strcpy(*((v0 + 24)), v3->field_8);
if (*((v1 + 16)))
*((*((v1 + 16)) + 8)) = v0;
*(v0) = *((v1 + 16));
*((v0 + 8)) = 0;
*((v1 + 16)) = v0;
}
}
}
endmntent(v2);
}
}
}
v10 = *(&v7) ^ v9[5];
return;
}
|
int
dh_pub_is_valid(const DH *dh, const BIGNUM *dh_pub)
{
int i;
int n = BN_num_bits(dh_pub);
int bits_set = 0;
BIGNUM *tmp;
const BIGNUM *dh_p;
DH_get0_pqg(dh, &dh_p,
((void *)0)
,
((void *)0)
);
if (BN_is_negative(dh_pub)) {
sshlog("dh.c", __func__, 247, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "invalid public DH value: negative");
return 0;
}
if (BN_cmp(dh_pub, BN_value_one()) != 1) {
sshlog("dh.c", __func__, 251, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "invalid public DH value: <= 1");
return 0;
}
if ((tmp = BN_new()) ==
((void *)0)
) {
sshlog("dh.c", __func__, 256, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "BN_new failed");
return 0;
}
if (!BN_sub(tmp, dh_p, BN_value_one()) ||
BN_cmp(dh_pub, tmp) != -1) {
BN_clear_free(tmp);
sshlog("dh.c", __func__, 262, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "invalid public DH value: >= p-1");
return 0;
}
BN_clear_free(tmp);
for (i = 0; i <= n; i++)
if (BN_is_bit_set(dh_pub, i))
bits_set++;
sshlog("dh.c", __func__, 270, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "bits set: %d/%d", bits_set, BN_num_bits(dh_p));
if (bits_set < 4) {
sshlog("dh.c", __func__, 276, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "invalid public DH value (%d/%d)", bits_set, BN_num_bits(dh_p))
;
return 0;
}
return 1;
}
| int dh_pub_is_valid(unsigned long long a0, unsigned long long a1) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char v4;
unsigned long long v5;
unsigned int v7;
v3 = BN_num_bits(a1);
v2 = 0;
DH_get0_pqg(a0, &v4, 0x0, 0x0);
if (BN_is_negative(a1)) {
sshlog("dh.c", "dh_pub_is_valid", 0xf7, 0x0, 0x3, 0x0, "invalid public DH value: negative", *(&v0));
v7 = 0;
} else {
v7 = BN_value_one();
if (BN_cmp(a1, v7, v7) != 1) {
sshlog("dh.c", "dh_pub_is_valid", 0xfb, 0x0, 0x3, 0x0, "invalid public DH value: <= 1", *(&v0));
v7 = 0;
} else {
v5 = BN_new();
if (!v5) {
sshlog("dh.c", "dh_pub_is_valid", 0x100, 0x1, 0x2, 0x0, "BN_new failed", *(&v0));
v7 = 0;
} else if (!BN_sub(v5, *(&v4), BN_value_one(), *(&v4))) {
LABEL_400c11:
BN_clear_free(v5);
sshlog("dh.c", "dh_pub_is_valid", 0x106, 0x0, 0x3, 0x0, "invalid public DH value: >= p-1", *(&v0));
v7 = 0;
} else {
if (!(BN_cmp(a1, v5, v5) == -1))
goto LABEL_400c11;
BN_clear_free(v5);
for (v1 = 0; v1 <= v3; v1 = __addvsi3(v1, 0x1)) {
if (BN_is_bit_set(a1, v1, v1))
v2 = __addvsi3(v2, 0x1);
}
BN_num_bits(*(&v4));
sshlog("dh.c", "dh_pub_is_valid", 0x10e, 0x0, 0x6, 0x0, "bits set: %d/%d", v2);
if (v2 > 3) {
v7 = 1;
} else {
BN_num_bits(*(&v4));
sshlog("dh.c", "dh_pub_is_valid", 0x114, 0x0, 0x3, 0x0, "invalid public DH value (%d/%d)", v2);
v7 = 0;
}
}
}
}
return v7;
}
|
static void
chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes)
{
u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
u8 *ctarget =
((void *)0)
;
u8 tmp[64];
u_int i;
if (!bytes) return;
j0 = x->input[0];
j1 = x->input[1];
j2 = x->input[2];
j3 = x->input[3];
j4 = x->input[4];
j5 = x->input[5];
j6 = x->input[6];
j7 = x->input[7];
j8 = x->input[8];
j9 = x->input[9];
j10 = x->input[10];
j11 = x->input[11];
j12 = x->input[12];
j13 = x->input[13];
j14 = x->input[14];
j15 = x->input[15];
for (;;) {
if (bytes < 64) {
for (i = 0;i < bytes;++i) tmp[i] = m[i];
m = tmp;
ctarget = c;
c = tmp;
}
x0 = j0;
x1 = j1;
x2 = j2;
x3 = j3;
x4 = j4;
x5 = j5;
x6 = j6;
x7 = j7;
x8 = j8;
x9 = j9;
x10 = j10;
x11 = j11;
x12 = j12;
x13 = j13;
x14 = j14;
x15 = j15;
for (i = 20;i > 0;i -= 2) {
x0 = (((u32)((x0) + (x4)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x0))) << (16)) & (0xFFFFFFFFU)) | ((((x12) ^ (x0))) >> (32 - (16))))); x8 = (((u32)((x8) + (x12)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x8))) << (12)) & (0xFFFFFFFFU)) | ((((x4) ^ (x8))) >> (32 - (12))))); x0 = (((u32)((x0) + (x4)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x0))) << (8)) & (0xFFFFFFFFU)) | ((((x12) ^ (x0))) >> (32 - (8))))); x8 = (((u32)((x8) + (x12)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x8))) << (7)) & (0xFFFFFFFFU)) | ((((x4) ^ (x8))) >> (32 - (7)))));
x1 = (((u32)((x1) + (x5)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x1))) << (16)) & (0xFFFFFFFFU)) | ((((x13) ^ (x1))) >> (32 - (16))))); x9 = (((u32)((x9) + (x13)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x9))) << (12)) & (0xFFFFFFFFU)) | ((((x5) ^ (x9))) >> (32 - (12))))); x1 = (((u32)((x1) + (x5)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x1))) << (8)) & (0xFFFFFFFFU)) | ((((x13) ^ (x1))) >> (32 - (8))))); x9 = (((u32)((x9) + (x13)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x9))) << (7)) & (0xFFFFFFFFU)) | ((((x5) ^ (x9))) >> (32 - (7)))));
x2 = (((u32)((x2) + (x6)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x2))) << (16)) & (0xFFFFFFFFU)) | ((((x14) ^ (x2))) >> (32 - (16))))); x10 = (((u32)((x10) + (x14)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x10))) << (12)) & (0xFFFFFFFFU)) | ((((x6) ^ (x10))) >> (32 - (12))))); x2 = (((u32)((x2) + (x6)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x2))) << (8)) & (0xFFFFFFFFU)) | ((((x14) ^ (x2))) >> (32 - (8))))); x10 = (((u32)((x10) + (x14)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x10))) << (7)) & (0xFFFFFFFFU)) | ((((x6) ^ (x10))) >> (32 - (7)))));
x3 = (((u32)((x3) + (x7)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x3))) << (16)) & (0xFFFFFFFFU)) | ((((x15) ^ (x3))) >> (32 - (16))))); x11 = (((u32)((x11) + (x15)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x11))) << (12)) & (0xFFFFFFFFU)) | ((((x7) ^ (x11))) >> (32 - (12))))); x3 = (((u32)((x3) + (x7)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x3))) << (8)) & (0xFFFFFFFFU)) | ((((x15) ^ (x3))) >> (32 - (8))))); x11 = (((u32)((x11) + (x15)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x11))) << (7)) & (0xFFFFFFFFU)) | ((((x7) ^ (x11))) >> (32 - (7)))));
x0 = (((u32)((x0) + (x5)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x0))) << (16)) & (0xFFFFFFFFU)) | ((((x15) ^ (x0))) >> (32 - (16))))); x10 = (((u32)((x10) + (x15)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x10))) << (12)) & (0xFFFFFFFFU)) | ((((x5) ^ (x10))) >> (32 - (12))))); x0 = (((u32)((x0) + (x5)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x0))) << (8)) & (0xFFFFFFFFU)) | ((((x15) ^ (x0))) >> (32 - (8))))); x10 = (((u32)((x10) + (x15)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x10))) << (7)) & (0xFFFFFFFFU)) | ((((x5) ^ (x10))) >> (32 - (7)))));
x1 = (((u32)((x1) + (x6)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x1))) << (16)) & (0xFFFFFFFFU)) | ((((x12) ^ (x1))) >> (32 - (16))))); x11 = (((u32)((x11) + (x12)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x11))) << (12)) & (0xFFFFFFFFU)) | ((((x6) ^ (x11))) >> (32 - (12))))); x1 = (((u32)((x1) + (x6)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x1))) << (8)) & (0xFFFFFFFFU)) | ((((x12) ^ (x1))) >> (32 - (8))))); x11 = (((u32)((x11) + (x12)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x11))) << (7)) & (0xFFFFFFFFU)) | ((((x6) ^ (x11))) >> (32 - (7)))));
x2 = (((u32)((x2) + (x7)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x2))) << (16)) & (0xFFFFFFFFU)) | ((((x13) ^ (x2))) >> (32 - (16))))); x8 = (((u32)((x8) + (x13)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x8))) << (12)) & (0xFFFFFFFFU)) | ((((x7) ^ (x8))) >> (32 - (12))))); x2 = (((u32)((x2) + (x7)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x2))) << (8)) & (0xFFFFFFFFU)) | ((((x13) ^ (x2))) >> (32 - (8))))); x8 = (((u32)((x8) + (x13)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x8))) << (7)) & (0xFFFFFFFFU)) | ((((x7) ^ (x8))) >> (32 - (7)))));
x3 = (((u32)((x3) + (x4)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x3))) << (16)) & (0xFFFFFFFFU)) | ((((x14) ^ (x3))) >> (32 - (16))))); x9 = (((u32)((x9) + (x14)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x9))) << (12)) & (0xFFFFFFFFU)) | ((((x4) ^ (x9))) >> (32 - (12))))); x3 = (((u32)((x3) + (x4)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x3))) << (8)) & (0xFFFFFFFFU)) | ((((x14) ^ (x3))) >> (32 - (8))))); x9 = (((u32)((x9) + (x14)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x9))) << (7)) & (0xFFFFFFFFU)) | ((((x4) ^ (x9))) >> (32 - (7)))));
}
x0 = (((u32)((x0) + (j0)) & (0xFFFFFFFFU)));
x1 = (((u32)((x1) + (j1)) & (0xFFFFFFFFU)));
x2 = (((u32)((x2) + (j2)) & (0xFFFFFFFFU)));
x3 = (((u32)((x3) + (j3)) & (0xFFFFFFFFU)));
x4 = (((u32)((x4) + (j4)) & (0xFFFFFFFFU)));
x5 = (((u32)((x5) + (j5)) & (0xFFFFFFFFU)));
x6 = (((u32)((x6) + (j6)) & (0xFFFFFFFFU)));
x7 = (((u32)((x7) + (j7)) & (0xFFFFFFFFU)));
x8 = (((u32)((x8) + (j8)) & (0xFFFFFFFFU)));
x9 = (((u32)((x9) + (j9)) & (0xFFFFFFFFU)));
x10 = (((u32)((x10) + (j10)) & (0xFFFFFFFFU)));
x11 = (((u32)((x11) + (j11)) & (0xFFFFFFFFU)));
x12 = (((u32)((x12) + (j12)) & (0xFFFFFFFFU)));
x13 = (((u32)((x13) + (j13)) & (0xFFFFFFFFU)));
x14 = (((u32)((x14) + (j14)) & (0xFFFFFFFFU)));
x15 = (((u32)((x15) + (j15)) & (0xFFFFFFFFU)));
j12 = ((((u32)(((j12)) + (1)) & (0xFFFFFFFFU))));
if (!j12) {
j13 = ((((u32)(((j13)) + (1)) & (0xFFFFFFFFU))));
}
do { (c + 0)[0] = ((u8)((x0)) & (0xFFU)); (c + 0)[1] = ((u8)((x0) >> 8) & (0xFFU)); (c + 0)[2] = ((u8)((x0) >> 16) & (0xFFU)); (c + 0)[3] = ((u8)((x0) >> 24) & (0xFFU)); } while (0);
do { (c + 4)[0] = ((u8)((x1)) & (0xFFU)); (c + 4)[1] = ((u8)((x1) >> 8) & (0xFFU)); (c + 4)[2] = ((u8)((x1) >> 16) & (0xFFU)); (c + 4)[3] = ((u8)((x1) >> 24) & (0xFFU)); } while (0);
do { (c + 8)[0] = ((u8)((x2)) & (0xFFU)); (c + 8)[1] = ((u8)((x2) >> 8) & (0xFFU)); (c + 8)[2] = ((u8)((x2) >> 16) & (0xFFU)); (c + 8)[3] = ((u8)((x2) >> 24) & (0xFFU)); } while (0);
do { (c + 12)[0] = ((u8)((x3)) & (0xFFU)); (c + 12)[1] = ((u8)((x3) >> 8) & (0xFFU)); (c + 12)[2] = ((u8)((x3) >> 16) & (0xFFU)); (c + 12)[3] = ((u8)((x3) >> 24) & (0xFFU)); } while (0);
do { (c + 16)[0] = ((u8)((x4)) & (0xFFU)); (c + 16)[1] = ((u8)((x4) >> 8) & (0xFFU)); (c + 16)[2] = ((u8)((x4) >> 16) & (0xFFU)); (c + 16)[3] = ((u8)((x4) >> 24) & (0xFFU)); } while (0);
do { (c + 20)[0] = ((u8)((x5)) & (0xFFU)); (c + 20)[1] = ((u8)((x5) >> 8) & (0xFFU)); (c + 20)[2] = ((u8)((x5) >> 16) & (0xFFU)); (c + 20)[3] = ((u8)((x5) >> 24) & (0xFFU)); } while (0);
do { (c + 24)[0] = ((u8)((x6)) & (0xFFU)); (c + 24)[1] = ((u8)((x6) >> 8) & (0xFFU)); (c + 24)[2] = ((u8)((x6) >> 16) & (0xFFU)); (c + 24)[3] = ((u8)((x6) >> 24) & (0xFFU)); } while (0);
do { (c + 28)[0] = ((u8)((x7)) & (0xFFU)); (c + 28)[1] = ((u8)((x7) >> 8) & (0xFFU)); (c + 28)[2] = ((u8)((x7) >> 16) & (0xFFU)); (c + 28)[3] = ((u8)((x7) >> 24) & (0xFFU)); } while (0);
do { (c + 32)[0] = ((u8)((x8)) & (0xFFU)); (c + 32)[1] = ((u8)((x8) >> 8) & (0xFFU)); (c + 32)[2] = ((u8)((x8) >> 16) & (0xFFU)); (c + 32)[3] = ((u8)((x8) >> 24) & (0xFFU)); } while (0);
do { (c + 36)[0] = ((u8)((x9)) & (0xFFU)); (c + 36)[1] = ((u8)((x9) >> 8) & (0xFFU)); (c + 36)[2] = ((u8)((x9) >> 16) & (0xFFU)); (c + 36)[3] = ((u8)((x9) >> 24) & (0xFFU)); } while (0);
do { (c + 40)[0] = ((u8)((x10)) & (0xFFU)); (c + 40)[1] = ((u8)((x10) >> 8) & (0xFFU)); (c + 40)[2] = ((u8)((x10) >> 16) & (0xFFU)); (c + 40)[3] = ((u8)((x10) >> 24) & (0xFFU)); } while (0);
do { (c + 44)[0] = ((u8)((x11)) & (0xFFU)); (c + 44)[1] = ((u8)((x11) >> 8) & (0xFFU)); (c + 44)[2] = ((u8)((x11) >> 16) & (0xFFU)); (c + 44)[3] = ((u8)((x11) >> 24) & (0xFFU)); } while (0);
do { (c + 48)[0] = ((u8)((x12)) & (0xFFU)); (c + 48)[1] = ((u8)((x12) >> 8) & (0xFFU)); (c + 48)[2] = ((u8)((x12) >> 16) & (0xFFU)); (c + 48)[3] = ((u8)((x12) >> 24) & (0xFFU)); } while (0);
do { (c + 52)[0] = ((u8)((x13)) & (0xFFU)); (c + 52)[1] = ((u8)((x13) >> 8) & (0xFFU)); (c + 52)[2] = ((u8)((x13) >> 16) & (0xFFU)); (c + 52)[3] = ((u8)((x13) >> 24) & (0xFFU)); } while (0);
do { (c + 56)[0] = ((u8)((x14)) & (0xFFU)); (c + 56)[1] = ((u8)((x14) >> 8) & (0xFFU)); (c + 56)[2] = ((u8)((x14) >> 16) & (0xFFU)); (c + 56)[3] = ((u8)((x14) >> 24) & (0xFFU)); } while (0);
do { (c + 60)[0] = ((u8)((x15)) & (0xFFU)); (c + 60)[1] = ((u8)((x15) >> 8) & (0xFFU)); (c + 60)[2] = ((u8)((x15) >> 16) & (0xFFU)); (c + 60)[3] = ((u8)((x15) >> 24) & (0xFFU)); } while (0);
if (bytes <= 64) {
if (bytes < 64) {
for (i = 0;i < bytes;++i) ctarget[i] = c[i];
}
x->input[12] = j12;
x->input[13] = j13;
return;
}
bytes -= 64;
c += 64;
}
}
| void chacha_encrypt_bytes(unsigned int a0[16], unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned long v0;
int tmp_234;
int tmp_267;
int tmp_324;
int tmp_357;
int tmp_414;
int tmp_447;
int tmp_504;
int tmp_537;
int tmp_594;
int tmp_627;
int tmp_684;
int tmp_170;
int tmp_203;
int tmp_260;
int tmp_293;
int tmp_350;
int tmp_383;
int tmp_440;
void* v1;
char *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;
unsigned int v11;
unsigned int v12;
unsigned int v13;
unsigned int v14;
unsigned int v15;
unsigned int v16;
unsigned int v17;
unsigned int v18;
unsigned int v19;
unsigned int v20;
unsigned int v21;
unsigned int v22;
unsigned int v23;
unsigned int v24;
unsigned int v25;
unsigned int v26;
unsigned int v27;
unsigned int v28;
unsigned int v29;
unsigned int v30;
unsigned int v31;
unsigned int v32;
unsigned int v33;
unsigned int v34;
unsigned int v35;
void* v36;
char v37;
char v38;
unsigned long v40;
unsigned long v41;
unsigned long v42;
unsigned long long *v43;
unsigned long long v44;
v2 = a1;
v1 = a2;
v0 = a3;
v36 = 0;
if (v0) {
v22 = a0[0];
v23 = a0[1];
v24 = a0[2];
v25 = a0[3];
v26 = a0[4];
v27 = a0[5];
v28 = a0[6];
v29 = a0[7];
v30 = a0[8];
v31 = a0[9];
v32 = a0[10];
v33 = a0[11];
v19 = a0[12];
v20 = a0[13];
v34 = a0[14];
v35 = a0[15];
while (true) {
if (v0 <= 63) {
for (v21 = 0; v21 < v0; v21 += 1) {
(&v37)[v21] = v2[v21];
}
v2 = &v37;
v36 = v1;
v1 = &v37;
}
v3 = v22;
v4 = v23;
v5 = v24;
v6 = v25;
v7 = v26;
v8 = v27;
v9 = v28;
v10 = v29;
v11 = v30;
v12 = v31;
v13 = v32;
v14 = v33;
v15 = v19;
v16 = v20;
v17 = v34;
v18 = v35;
for (v21 = 20; v21; v21 -= 2) {
v3 += v7;
tmp_234 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, cc_ndep<8>);
v15 = (v15 ^ v3) * 0x10000 | (v15 ^ v3) >> 16;
v11 += v15;
tmp_267 = v7 ^ v11;
v7 = (v7 ^ v11) * 0x1000 | (v7 ^ v11) >> 20;
v3 += v7;
tmp_324 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v15 = (v15 ^ v3) * 0x100 | (v15 ^ v3) >> 24;
v11 += v15;
tmp_357 = v7 ^ v11;
v7 = (v7 ^ v11) * 128 | (v7 ^ v11) >> 25;
v4 += v8;
tmp_414 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v16 = (v16 ^ v4) * 0x10000 | (v16 ^ v4) >> 16;
v12 += v16;
tmp_447 = v8 ^ v12;
v8 = (v8 ^ v12) * 0x1000 | (v8 ^ v12) >> 20;
v4 += v8;
tmp_504 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v16 = (v16 ^ v4) * 0x100 | (v16 ^ v4) >> 24;
v12 += v16;
tmp_537 = v8 ^ v12;
v8 = (v8 ^ v12) * 128 | (v8 ^ v12) >> 25;
v5 += v9;
tmp_594 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v17 = (v17 ^ v5) * 0x10000 | (v17 ^ v5) >> 16;
v13 += v17;
tmp_627 = v9 ^ v13;
v9 = (v9 ^ v13) * 0x1000 | (v9 ^ v13) >> 20;
v5 += v9;
tmp_684 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v17 = (v17 ^ v5) * 0x100 | (v17 ^ v5) >> 24;
v13 += v17;
v40 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-204, size=4, endness=Iend_LE) ^ Load(addr=stack_base-188, size=4, endness=Iend_LE))), 0x0<64>, t684);
v9 = (v9 ^ v13) * 128 | (v9 ^ v13) >> 25;
v6 += v10;
tmp_234 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, cc_ndep<8>);
v18 = (v18 ^ v6) * 0x10000 | (v18 ^ v6) >> 16;
v14 += v18;
tmp_267 = v10 ^ v14;
v10 = (v10 ^ v14) * 0x1000 | (v10 ^ v14) >> 20;
v6 += v10;
tmp_324 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v18 = (v18 ^ v6) * 0x100 | (v18 ^ v6) >> 24;
v14 += v18;
tmp_357 = v10 ^ v14;
v10 = (v10 ^ v14) * 128 | (v10 ^ v14) >> 25;
v3 += v8;
tmp_414 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v18 = (v18 ^ v3) * 0x10000 | (v18 ^ v3) >> 16;
v13 += v18;
tmp_447 = v8 ^ v13;
v8 = (v8 ^ v13) * 0x1000 | (v8 ^ v13) >> 20;
v3 += v8;
tmp_504 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v18 = (v18 ^ v3) * 0x100 | (v18 ^ v3) >> 24;
v13 += v18;
tmp_537 = v8 ^ v13;
v8 = (v8 ^ v13) * 128 | (v8 ^ v13) >> 25;
v4 += v9;
tmp_594 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v15 = (v15 ^ v4) * 0x10000 | (v15 ^ v4) >> 16;
v14 += v15;
tmp_627 = v9 ^ v14;
v9 = (v9 ^ v14) * 0x1000 | (v9 ^ v14) >> 20;
v4 += v9;
tmp_684 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v15 = (v15 ^ v4) * 0x100 | (v15 ^ v4) >> 24;
v14 += v15;
v41 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-204, size=4, endness=Iend_LE) ^ Load(addr=stack_base-184, size=4, endness=Iend_LE))), 0x0<64>, t684);
v9 = (v9 ^ v14) * 128 | (v9 ^ v14) >> 25;
v5 += v10;
tmp_170 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, cc_ndep<8>);
v16 = (v16 ^ v5) * 0x10000 | (v16 ^ v5) >> 16;
v11 += v16;
tmp_203 = v10 ^ v11;
v10 = (v10 ^ v11) * 0x1000 | (v10 ^ v11) >> 20;
v5 += v10;
tmp_260 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v16 = (v16 ^ v5) * 0x100 | (v16 ^ v5) >> 24;
v11 += v16;
tmp_293 = v10 ^ v11;
v10 = (v10 ^ v11) * 128 | (v10 ^ v11) >> 25;
v6 += v7;
tmp_350 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v17 = (v17 ^ v6) * 0x10000 | (v17 ^ v6) >> 16;
v12 += v17;
tmp_383 = v7 ^ v12;
v7 = (v7 ^ v12) * 0x1000 | (v7 ^ v12) >> 20;
v6 += v7;
tmp_440 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>));
v17 = (v17 ^ v6) * 0x100 | (v17 ^ v6) >> 24;
v12 += v17;
v42 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-212, size=4, endness=Iend_LE) ^ Load(addr=stack_base-192, size=4, endness=Iend_LE))), 0x0<64>, t440);
v7 = (v7 ^ v12) * 128 | (v7 ^ v12) >> 25;
}
v3 += v22;
v4 += v23;
v5 += v24;
v6 += v25;
v7 += v26;
v8 += v27;
v9 += v28;
v10 += v29;
v11 += v30;
v12 += v31;
v13 += v32;
v14 += v33;
v15 += v19;
v16 += v20;
v17 += v34;
v18 += v35;
v19 += 1;
if (!v19)
v20 += 1;
*(v1) = v3;
*(&v1[1]) = v3 >> 8;
*(&v1[2]) = v3 >> 16;
*(&v1[3]) = v3 >> 24;
*(&v1[4]) = v4;
*(&v1[5]) = v4 >> 8;
*(&v1[6]) = v4 >> 16;
*(&v1[7]) = v4 >> 24;
*(&v1[8]) = v5;
*(&v1[9]) = v5 >> 8;
*(&v1[10]) = v5 >> 16;
*(&v1[11]) = v5 >> 24;
*(&v1[12]) = v6;
*(&v1[13]) = v6 >> 8;
*(&v1[14]) = v6 >> 16;
*(&v1[15]) = v6 >> 24;
*(&v1[16]) = v7;
*(&v1[17]) = v7 >> 8;
*(&v1[18]) = v7 >> 16;
*(&v1[19]) = v7 >> 24;
*(&v1[20]) = v8;
*(&v1[21]) = v8 >> 8;
*(&v1[22]) = v8 >> 16;
*(&v1[23]) = v8 >> 24;
*(&v1[24]) = v9;
*(&v1[25]) = v9 >> 8;
*(&v1[26]) = v9 >> 16;
*(&v1[27]) = v9 >> 24;
*(&v1[28]) = v10;
*(&v1[29]) = v10 >> 8;
*(&v1[30]) = v10 >> 16;
*(&v1[31]) = v10 >> 24;
*(&v1[32]) = v11;
*(&v1[33]) = v11 >> 8;
*(&v1[34]) = v11 >> 16;
*(&v1[35]) = v11 >> 24;
*(&v1[36]) = v12;
*(&v1[37]) = v12 >> 8;
*(&v1[38]) = v12 >> 16;
*(&v1[39]) = v12 >> 24;
*(&v1[40]) = v13;
*(&v1[41]) = v13 >> 8;
*(&v1[42]) = v13 >> 16;
*(&v1[43]) = v13 >> 24;
*(&v1[44]) = v14;
*(&v1[45]) = v14 >> 8;
*(&v1[46]) = v14 >> 16;
*(&v1[47]) = v14 >> 24;
*(&v1[48]) = v15;
*(&v1[49]) = v15 >> 8;
*(&v1[50]) = v15 >> 16;
*(&v1[51]) = v15 >> 24;
*(&v1[52]) = v16;
*(&v1[53]) = v16 >> 8;
*(&v1[54]) = v16 >> 16;
*(&v1[55]) = v16 >> 24;
*(&v1[56]) = v17;
*(&v1[57]) = v17 >> 8;
*(&v1[58]) = v17 >> 16;
*(&v1[59]) = v17 >> 24;
*(&v1[60]) = v18;
*(&v1[61]) = v18 >> 8;
*(&v1[62]) = v18 >> 16;
*(&v1[63]) = v18 >> 24;
if (v0 <= 64)
break;
v0 = v0 - 64;
v1 += 64;
}
if (v0 <= 63) {
for (v21 = 0; v21 < v0; v21 += 1) {
*(v36 + v21) = *(v1 + v21);
}
}
a0[12] = v19;
a0[13] = v20;
}
v44 = *(&v38) ^ v43[5];
return;
}
|
int
rl_crlf(void)
{
re_putc(e, '\n', 0);
return 0;
}
| long long rl_crlf(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
re_putc(e, 0xa, 0x0, a3);
return 0;
}
|
int
rl_backward_byte (int count, int key)
{
if (count < 0)
return (rl_forward_byte (-count, key));
if (count > 0)
{
if (rl_point < count)
{
rl_point = 0;
rl_ding ();
}
else
rl_point -= count;
}
if (rl_point < 0)
rl_point = 0;
return 0;
}
| long rl_backward_byte(int a1, unsigned int a2)
{
if ( a1 < 0 )
return rl_forward_byte(-a1, a2);
if ( a1 > 0 )
{
if ( a1 <= rl_point )
{
rl_point -= a1;
}
else
{
rl_point = 0;
rl_ding();
}
}
if ( rl_point < 0 )
rl_point = 0;
return 0LL;
}
|
static void
print_esc_char (char c)
{
switch (c)
{
case 'a':
c ='\a';
break;
case 'b':
c ='\b';
break;
case 'e':
c ='\x1B';
break;
case 'f':
c ='\f';
break;
case 'n':
c ='\n';
break;
case 'r':
c ='\r';
break;
case 't':
c ='\t';
break;
case 'v':
c ='\v';
break;
case '"':
case '\\':
break;
default:
error (0, 0, gettext ("warning: unrecognized escape '\\%c'"), c);
break;
}
putchar_unlocked (c);
}
| void print_esc_char(char param_1)
{
int iVar1;
undefined8 uVar2;
char local_1c;
iVar1 = (int)param_1;
local_1c = param_1;
if (iVar1 == 0x22) goto LAB_00102803;
if (((iVar1 < 0x22) || (0x76 < iVar1)) || (iVar1 < 0x5c)) {
switchD_001027a4_caseD_5d:
uVar2 = gettext("warning: unrecognized escape \'\\%c\'");
error(0,0,uVar2,(int)param_1);
}
else {
switch(iVar1) {
case 0x5c:
break;
default:
goto switchD_001027a4_caseD_5d;
case 0x61:
local_1c = '\a';
break;
case 0x62:
local_1c = '\b';
break;
case 0x65:
local_1c = '\x1b';
break;
case 0x66:
local_1c = '\f';
break;
case 0x6e:
local_1c = '\n';
break;
case 0x72:
local_1c = '\r';
break;
case 0x74:
local_1c = '\t';
break;
case 0x76:
local_1c = '\v';
}
}
LAB_00102803:
putchar_unlocked((int)local_1c);
return;
}
|
static void
init_column_info (size_t max_cols)
{
size_t i;
static size_t column_info_alloc;
if (column_info_alloc < max_cols)
{
size_t new_column_info_alloc;
size_t *p;
if (!max_idx || max_cols < max_idx / 2)
{
column_info = xnrealloc (column_info, max_cols,
2 * sizeof *column_info);
new_column_info_alloc = 2 * max_cols;
}
else
{
column_info = xnrealloc (column_info, max_idx, sizeof *column_info);
new_column_info_alloc = max_idx;
}
{
size_t column_info_growth = new_column_info_alloc - column_info_alloc;
size_t s = column_info_alloc + 1 + new_column_info_alloc;
size_t t = s * column_info_growth;
if (s < new_column_info_alloc || t / column_info_growth != s)
xalloc_die ();
p = xnmalloc (t / 2, sizeof *p);
}
for (i = column_info_alloc; i < new_column_info_alloc; i++)
{
column_info[i].col_arr = p;
p += i + 1;
}
column_info_alloc = new_column_info_alloc;
}
for (i = 0; i < max_cols; ++i)
{
size_t j;
column_info[i].valid_len =
1
;
column_info[i].line_len = (i + 1) * MIN_COLUMN_WIDTH;
for (j = 0; j <= i; ++j)
column_info[i].col_arr[j] = MIN_COLUMN_WIDTH;
}
}
| void init_column_info(ulong param_1)
{
ulong uVar1;
ulong uVar2;
ulong local_40;
ulong local_38;
long local_30;
ulong local_28;
if (column_info_alloc_10449 < param_1) {
if ((max_idx == 0) || (param_1 < max_idx >> 1)) {
column_info = xnrealloc(column_info,param_1,0x30);
local_38 = param_1 * 2;
}
else {
column_info = xnrealloc(column_info,max_idx,0x18);
local_38 = max_idx;
}
uVar1 = local_38 + column_info_alloc_10449 + 1;
uVar2 = uVar1 * (local_38 - column_info_alloc_10449);
if ((uVar1 < local_38) || (uVar1 != uVar2 / (local_38 - column_info_alloc_10449))) {
xalloc_die();
}
local_30 = xnmalloc(uVar2 >> 1,8);
for (local_40 = column_info_alloc_10449; local_40 < local_38; local_40 = local_40 + 1) {
*(long *)(column_info + local_40 * 0x18 + 0x10) = local_30;
local_30 = local_30 + (local_40 + 1) * 8;
}
column_info_alloc_10449 = local_38;
}
for (local_40 = 0; local_40 < param_1; local_40 = local_40 + 1) {
*(undefined *)(local_40 * 0x18 + column_info) = 1;
*(ulong *)(column_info + local_40 * 0x18 + 8) = (local_40 + 1) * 3;
for (local_28 = 0; local_28 <= local_40; local_28 = local_28 + 1) {
*(undefined8 *)(*(long *)(local_40 * 0x18 + column_info + 0x10) + local_28 * 8) = 3;
}
}
return;
}
|
static void print_explain(FILE *f)
{
fprintf(f,
"Usage: ... ipoib [ pkey PKEY ]\n"
" [ mode {datagram | connected} ]\n"
" [ umcast {0|1} ]\n"
"\n"
"PKEY := 0x8001-0xffff\n"
);
}
| void print_explain(void* a0) {
unsigned long long v1;
v1 = fprintf(a0, "Usage: ... ipoib [ pkey PKEY ]\n\t\t [ mode {datagram | connected} ]\n\t\t [ umcast {0|1} ]\n\nPKEY := 0x8001-0xffff\n");
return;
}
|
&& x->backup_type == no_backups
&& seen_file (x->src_info, src_name, &src_sb))
{
error (0, 0, gettext ("warning: source file %s specified more than once"),
quotearg_style (shell_escape_always_quoting_style, src_name));
return
1
;
}
| ((*local_380 == 0 &&
(cVar8 = seen_file(*(undefined8 *)(local_380 + 0x14),local_350,&local_278), cVar8 != '\0')))
) {
uVar15 = quotearg_style(4,local_350);
uVar16 = gettext("warning: source file %s specified more than once");
error(0,0,uVar16,uVar15);
puVar29 = auStack936;
uVar9 = 1;
goto LAB_00106db3;
}
|
void pushstackmark(struct stackmark *mark, size_t len)
{
mark->stackp = stackp;
mark->stacknxt = stacknxt;
mark->stacknleft = stacknleft;
grabstackblock(len);
}
| void pushstackmark(unsigned long long a0[3], unsigned long long a1) {
unsigned long long v1;
a0[0] = stackp;
a0[1] = stacknxt;
a0[2] = stacknleft;
v1 = grabstackblock(a1);
return;
}
|
static void
print_progress(unsigned long start_lineno, unsigned long current_lineno,
unsigned long end_lineno)
{
static time_t time_start, time_prev;
time_t time_now, elapsed;
unsigned long num_to_process, processed, remaining, percent, eta;
double time_per_line;
char *eta_str;
time_now = monotime();
if (time_start == 0) {
time_start = time_prev = time_now;
return;
}
if (time_now - time_prev < 5 * 60)
return;
time_prev = time_now;
elapsed = time_now - time_start;
processed = current_lineno - start_lineno;
remaining = end_lineno - current_lineno;
num_to_process = end_lineno - start_lineno;
time_per_line = (double)elapsed / processed;
time(&time_now);
if (end_lineno ==
(0x7fffffffffffffffL * 2UL + 1UL)
) {
sshlog("moduli.c", __func__, 557, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "%.24s processed %lu in %s", ctime(&time_now), processed, fmt_time(elapsed))
;
return;
}
percent = 100 * processed / num_to_process;
eta = time_per_line * remaining;
eta_str = xstrdup(fmt_time(eta));
sshlog("moduli.c", __func__, 564, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "%.24s processed %lu of %lu (%lu%%) in %s, ETA %s", ctime(&time_now), processed, num_to_process, percent, fmt_time(elapsed), eta_str)
;
free(eta_str);
}
| void print_progress(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
uint128_t v9;
unsigned long v10;
unsigned long v11;
unsigned long v12;
unsigned long long v13;
void* v14;
char v15;
unsigned long long v18;
uint128_t v19;
unsigned long long v20;
uint128_t v21;
int v22;
uint128_t v23;
unsigned long long v24;
unsigned long long *v25;
unsigned long long v26;
v6 = monotime();
if (!time_start.17760) {
time_prev.17761 = v6;
time_start.17760 = time_prev.17761;
} else if (__subvdi3(v6, time_prev.17761, time_prev.17761) > 299) {
time_prev.17761 = v6;
*(&v7) = __subvdi3(v6, time_start.17760, time_start.17760);
v8 = a1 - a0;
*(&v9) = a2 - a1;
v10 = a2 - a0;
v18 = v7;
if (v8 >= 0) {
v19 = v8;
} else {
v20 = v8 >> 1 | v8 & 1;
v19 = v21 * 2;
}
v23 = v22 / v19;
v24 = v23;
v11 = v24;
time(&v6);
if (a2 == -1) {
v5 = fmt_time(v7);
v4 = v8;
v3 = ctime(&v6);
sshlog("moduli.c", "print_progress", 0x22d, 0x0, 0x3, 0x0, "%.24s processed %lu in %s");
} else {
v12 = (0 CONCAT v8 * 100) /m v10;
if (v9 >= 0) {
v24 = v9;
} else {
v24 = v9 >> 1 | v9 & 1;
v24 *= 2;
}
xmm0lq<8> = Conv(128->64, (xmm0<16> * Conv(64->128, Load(addr=stack_base-64, size=8, endness=Iend_LE))))
if ((BinaryOp CmpF & 1)) {
v13 = v24;
} else {
v13 = *(&v13) - 0x43e0000000000000;
v13 ^= 0x8000000000000000;
}
v13 = v13;
v14 = xstrdup(fmt_time(v13));
v4 = v14;
v3 = fmt_time(v7);
v2 = v10;
v1 = v8;
v0 = ctime(&v6);
sshlog("moduli.c", "print_progress", 0x234, 0x0, 0x3, 0x0, "%.24s processed %lu of %lu (%lu%%) in %s, ETA %s");
free(v14);
}
}
v26 = *(&v15) ^ v25[5];
return;
}
|
void
archive_read_error (void)
{
read_error (*archive_name_cursor);
if (record_start_block == 0)
do { if (error_hook) error_hook (); error (0, 0, gettext ("At beginning of tape, quitting now")); fatal_exit (); } while (0);
if (read_error_count++ > 10)
do { if (error_hook) error_hook (); error (0, 0, gettext ("Too many errors, quitting")); fatal_exit (); } while (0);
return;
}
| void archive_read_error(unsigned long a0, unsigned int a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v1;
unsigned long long v2;
read_error(*(archive_name_cursor));
if (!record_start_block) {
if (error_hook)
*(5243096)();
a1 = 0;
error(0x0, 0x0, gettext("At beginning of tape, quitting now"));
fatal_exit(0x0, a1, a2, a3, a4, a5);
}
v1 = read_error_count;
read_error_count = read_error_count + 1;
if (v1 > 10) {
if (error_hook)
*(5243096)();
a1 = 0;
error(0x0, 0x0, gettext("Too many errors, quitting"));
v2 = fatal_exit(0x0, a1, a2, a3, a4, a5);
}
return;
}
|
static intmax_t
exp1 ()
{
register intmax_t val;
if (curtok == '!')
{
readtok ();
val = !exp1 ();
lasttok = 6;
}
else if (curtok == '~')
{
readtok ();
val = ~exp1 ();
lasttok = 6;
}
else if (curtok == '-')
{
readtok ();
val = - exp1 ();
lasttok = 6;
}
else if (curtok == '+')
{
readtok ();
val = exp1 ();
lasttok = 6;
}
else
val = exp0 ();
return (val);
}
| intmax_t exp1()
{
long v0;
switch ( curtok )
{
case '!':
readtok();
v0 = exp1() == 0;
lasttok = 6;
break;
case '~':
readtok();
v0 = ~exp1();
lasttok = 6;
break;
case '-':
readtok();
v0 = -exp1();
lasttok = 6;
break;
case '+':
readtok();
v0 = exp1();
lasttok = 6;
break;
default:
return exp0();
}
return v0;
}
|
static void
makedumpdir (struct directory *directory, const char *dir)
{
size_t i,
dirsize,
len;
const char *p;
char const **array;
char *new_dump, *new_dump_ptr;
struct dumpdir *dump;
if (directory->children == ALL_CHILDREN)
dump =
((void *)0)
;
else if (directory->orig)
dump = directory->orig->idump ?
directory->orig->idump : directory->orig->dump;
else
dump = directory->dump;
dirsize = 0;
len = 0;
for (p = dir; *p; p += strlen (p) + 1, dirsize++)
len += strlen (p) + 2;
len++;
array = xcalloc (dirsize, sizeof array[0]);
for (i = 0, p = dir; *p; p += strlen (p) + 1, i++)
array[i] = p;
qsort (array, dirsize, sizeof (array[0]), compare_dirnames);
new_dump = xmalloc (len);
new_dump_ptr = new_dump;
for (i = 0; i < dirsize; i++)
{
const char *loc = dumpdir_locate (dump, array[i]);
if (loc)
{
if (directory->tagfile)
*new_dump_ptr = 'I';
else
*new_dump_ptr = ' ';
new_dump_ptr++;
}
else if (directory->tagfile)
*new_dump_ptr++ = 'I';
else
*new_dump_ptr++ = 'Y';
for (p = array[i]; (*new_dump_ptr++ = *p++); )
;
}
*new_dump_ptr = 0;
directory->idump = directory->dump;
directory->dump = dumpdir_create0 (new_dump,
((void *)0)
);
free (new_dump);
free (array);
}
| void makedumpdir(long param_1,char *param_2)
{
char *pcVar1;
char cVar2;
void *__base;
size_t sVar3;
char *__ptr;
long lVar4;
undefined8 uVar5;
ulong local_50;
size_t local_48;
long local_40;
char *local_38;
char *local_30;
undefined8 local_28;
if (*(int *)(param_1 + 0x38) == 2) {
local_28 = 0;
}
else if (*(long *)(param_1 + 0x40) == 0) {
local_28 = *(undefined8 *)(param_1 + 0x28);
}
else if (*(long *)(*(long *)(param_1 + 0x40) + 0x30) == 0) {
local_28 = *(undefined8 *)(*(long *)(param_1 + 0x40) + 0x28);
}
else {
local_28 = *(undefined8 *)(*(long *)(param_1 + 0x40) + 0x30);
}
local_48 = 0;
local_40 = 0;
for (local_38 = param_2; *local_38 != '\0'; local_38 = local_38 + sVar3 + 1) {
sVar3 = strlen(local_38);
local_40 = sVar3 + local_40 + 2;
sVar3 = strlen(local_38);
local_48 = local_48 + 1;
}
__base = (void *)xcalloc(local_48,8);
local_50 = 0;
for (local_38 = param_2; *local_38 != '\0'; local_38 = local_38 + sVar3 + 1) {
*(char **)(local_50 * 8 + (long)__base) = local_38;
sVar3 = strlen(local_38);
local_50 = local_50 + 1;
}
qsort(__base,local_48,8,compare_dirnames);
__ptr = (char *)xmalloc(local_40 + 1);
local_30 = __ptr;
for (local_50 = 0; local_50 < local_48; local_50 = local_50 + 1) {
lVar4 = dumpdir_locate(local_28,*(undefined8 *)((long)__base + local_50 * 8));
if (lVar4 == 0) {
if (*(long *)(param_1 + 0x48) == 0) {
*local_30 = 'Y';
}
else {
*local_30 = 'I';
}
}
else if (*(long *)(param_1 + 0x48) == 0) {
*local_30 = ' ';
}
else {
*local_30 = 'I';
}
local_30 = local_30 + 1;
local_38 = *(char **)((long)__base + local_50 * 8);
do {
pcVar1 = local_30 + 1;
*local_30 = *local_38;
cVar2 = *local_30;
local_38 = local_38 + 1;
local_30 = pcVar1;
} while (cVar2 != '\0');
}
*local_30 = '\0';
*(undefined8 *)(param_1 + 0x30) = *(undefined8 *)(param_1 + 0x28);
uVar5 = dumpdir_create0(__ptr,0);
*(undefined8 *)(param_1 + 0x28) = uVar5;
free(__ptr);
free(__base);
return;
}
|
static void
control_client_sigrelay(int signo)
{
int save_errno =
(*__errno_location ())
;
if (muxserver_pid > 1)
kill(muxserver_pid, signo);
(*__errno_location ())
= save_errno;
}
| long long control_client_sigrelay(unsigned long a0) {
unsigned int v0;
unsigned int *v2;
v0 = *(__errno_location());
if (muxserver_pid > 1)
kill(muxserver_pid, a0);
v2 = __errno_location();
*(v2) = v0;
return v2;
}
|
int fill_inbuf(eof_ok)
int eof_ok;
{
int len;
insize = 0;
do {
len = read_buffer (ifd, (char *) inbuf + insize, 0x40000 - insize);
if (len == 0) break;
if (len == -1) {
read_error();
break;
}
insize += len;
} while (insize < 0x40000);
if (insize == 0) {
if (eof_ok) return
(-1)
;
flush_window();
(*__errno_location ())
= 0;
read_error();
}
bytes_in += (off_t)insize;
inptr = 1;
return inbuf[0];
}
| long fill_inbuf(int a1)
{
int buffer;
insize = 0;
do
{
buffer = read_buffer(ifd, (char *)&inbuf + insize, 0x40000 - insize);
if ( !buffer )
break;
if ( buffer == -1 )
read_error();
insize += buffer;
}
while ( insize <= 0x3FFFFu );
if ( !insize )
{
if ( a1 )
return 0xFFFFFFFFLL;
flush_window();
*_errno_location() = 0;
read_error();
}
bytes_in += insize;
inptr = 1;
return inbuf;
}
|
int
compopt_builtin (list)
WORD_LIST *list;
{
int opts_on, opts_off, *opts, opt, oind, ret, Dflag, Eflag, Iflag;
WORD_LIST *l, *wl;
COMPSPEC *cs;
opts_on = opts_off = Eflag = Dflag = Iflag = 0;
ret = 0;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "+o:DEI")) != -1)
{
opts = (list_opttype == '-') ? &opts_on : &opts_off;
switch (opt)
{
case 'o':
oind = find_compopt (list_optarg);
if (oind < 0)
{
sh_invalidoptname (list_optarg);
return (258);
}
*opts |= compopts[oind].optflag;
break;
case 'D':
Dflag = 1;
break;
case 'E':
Eflag = 1;
break;
case 'I':
Iflag = 1;
break;
case -99: builtin_help (); return (258);
default:
builtin_usage ();
return (258);
}
}
list = loptend;
if (Dflag)
wl = make_word_list (make_bare_word ("_DefaultCmD_"), (WORD_LIST *)
((void *)0)
);
else if (Eflag)
wl = make_word_list (make_bare_word ("_EmptycmD_"), (WORD_LIST *)
((void *)0)
);
else if (Iflag)
wl = make_word_list (make_bare_word ("_InitialWorD_"), (WORD_LIST *)
((void *)0)
);
else
wl = (WORD_LIST *)
((void *)0)
;
if (list == 0 && wl == 0)
{
if ((rl_readline_state & (0x0004000)) == 0 || pcomp_curcs == 0)
{
builtin_error (gettext("not currently executing completion function"));
return (1);
}
cs = pcomp_curcs;
if (opts_on == 0 && opts_off == 0)
{
print_compopts (pcomp_curcmd, cs, 1);
return (sh_chkwrite (ret));
}
pcomp_set_compspec_options (cs, opts_on, 1);
pcomp_set_compspec_options (cs, opts_off, 0);
pcomp_set_readline_variables (opts_on, 1);
pcomp_set_readline_variables (opts_off, 0);
return (ret);
}
for (l = wl ? wl : list; l; l = l->next)
{
cs = progcomp_search (l->word->word);
if (cs == 0)
{
builtin_error (gettext("%s: no completion specification"), l->word->word);
ret = 1;
continue;
}
if (opts_on == 0 && opts_off == 0)
{
print_compopts (l->word->word, cs, 1);
continue;
}
pcomp_set_compspec_options (cs, opts_on, 1);
pcomp_set_compspec_options (cs, opts_off, 0);
}
if (wl)
dispose_words (wl);
return (ret);
}
| long long compopt_builtin(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
void* v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
void* v9;
void* v10;
void* v11;
unsigned int *v12;
unsigned long long v14;
void* v15;
unsigned long long v16;
v0 = a0;
v6 = 0;
v4 = v6;
v5 = v4;
v2 = v5;
v1 = v2;
v3 = 0;
reset_internal_getopt();
while (true) {
v7 = internal_getopt(v0, "+o:DEI");
if (v7 == -1) {
v0 = loptend;
if (v4) {
v10 = make_word_list(make_bare_word("_DefaultCmD_"), 0x0);
} else if (v5) {
v10 = make_word_list(make_bare_word("_EmptycmD_"), 0x0);
} else if (!v6) {
v10 = 0;
} else {
v10 = make_word_list(make_bare_word("_InitialWorD_"), 0x0);
}
if (!v0 && !v10) {
if ((rl_readline_state & 0x4000) && pcomp_curcs) {
v11 = pcomp_curcs;
if (!v1 && !v2) {
print_compopts(pcomp_curcmd, v11, 0x1);
v16 = sh_chkwrite(v3);
break;
}
pcomp_set_compspec_options(v11, v1, 0x1, v1);
pcomp_set_compspec_options(v11, v2, 0x0, v2);
pcomp_set_readline_variables(v1, 0x1);
pcomp_set_readline_variables(v2, 0x0);
v16 = v3;
break;
}
builtin_error(gettext("not currently executing completion function"), a1);
v16 = 1;
break;
}
if (v10)
v15 = v10;
else
v15 = v0;
v9 = v15;
while (true) {
if (!v9)
break;
v11 = progcomp_search(*(v9[8]));
if (!v11) {
builtin_error(gettext("%s: no completion specification"), *(v9[8]));
v3 = 1;
goto LABEL_401a22;
}
if (!v1 && !v2) {
print_compopts(*(v9[8]), v11, 0x1);
goto LABEL_401a22;
}
pcomp_set_compspec_options(v11, v1, 0x1, v1);
pcomp_set_compspec_options(v11, v2, 0x0, v2);
LABEL_401a22:
v9 = *(v9);
}
if (v10)
dispose_words(v10);
v16 = v3;
break;
}
if (list_opttype == 45)
v14 = &v1;
else
v14 = &v2;
v12 = v14;
if (v7 == 111) {
v8 = find_compopt(list_optarg);
if (v8 < 0) {
sh_invalidoptname(list_optarg);
v16 = 258;
break;
} else {
*(v12) = *((4202664 + 16 * v8)) | *(v12);
continue;
}
}
if (v7 > 111) {
LABEL_4017c3:
builtin_usage(a0, "+o:DEI", a2, a3, a4, a5);
v16 = 258;
break;
} else {
if (v7 == 73) {
v6 = 1;
continue;
}
if (!(v7 <= 73))
goto LABEL_4017c3;
if (v7 == 69) {
v5 = 1;
continue;
}
if (!(v7 <= 69))
goto LABEL_4017c3;
if (v7 == -99) {
builtin_help();
v16 = 258;
break;
}
if (!(v7 == 68))
goto LABEL_4017c3;
v4 = 1;
}
}
return v16;
}
|
static void
cmdputs(const char *s)
{
const char *p, *str;
char cc[2] = " ";
char *nextc;
signed char c;
int subtype = 0;
int quoted = 0;
static const char vstype[0x0f + 1][4] = {
"", "}", "-", "+", "?", "=",
"%", "%%", "#", "##",
};
| unsigned long cmdputs(const char *a1)
{
size_t v1;
unsigned int v2;
long v3;
char *v4;
const char *v5;
char *v6;
char *v7;
const char *v8;
char *v9;
char *v10;
char v12;
char v13;
int v14;
int v15;
const char *v16;
const char *v17;
char *v18;
short v19;
unsigned long v20;
v20 = __readfsqword(0x28u);
v19 = 32;
v14 = 0;
v15 = 0;
v1 = strlen(a1);
v18 = (char *)makestrspace(8 * (v1 + 1), cmdnextc);
v16 = a1;
while ( 1 )
{
v9 = (char *)v16++;
v12 = *v9;
if ( !*v9 )
break;
v17 = 0LL;
if ( v12 <= -120 )
{
if ( v12 >= -127 )
{
switch ( v12 )
{
case -127:
v4 = (char *)v16++;
v12 = *v4;
goto LABEL_28;
case -126:
v5 = v16++;
v14 = *v5;
if ( (v14 & 0xF) == 10 )
v17 = (const char *)&unk_28F0;
else
v17 = (const char *)&unk_28F4;
goto LABEL_32;
case -125:
v17 = (char *)&unk_28F7 + ((v15 & 1) == 0);
v15 >>= 1;
v14 = 0;
goto LABEL_32;
case -124:
v17 = "$(...)";
goto LABEL_32;
case -122:
v17 = "$((";
goto LABEL_32;
case -121:
v17 = "))";
goto LABEL_32;
case -120:
v15 ^= 1u;
v12 = 34;
goto LABEL_28;
default:
goto LABEL_28;
}
}
goto LABEL_28;
}
if ( v12 > 92 )
goto LABEL_28;
if ( v12 < 34 )
goto LABEL_28;
v2 = v12 - 34;
if ( v2 > 0x3A )
goto LABEL_28;
v3 = 1LL << v2;
if ( (v3 & 0x400000000000025LL) != 0 )
{
LOBYTE(v19) = v12;
v17 = (const char *)&v19;
v12 = 92;
goto LABEL_28;
}
if ( (v3 & 0x8000000) == 0 || !v14 )
goto LABEL_28;
if ( (v14 & 0xF) != 1 )
v15 *= 2;
v17 = (char *)&vstype_5048 + 4 * (v14 & 0xF);
if ( (v14 & 0x10) != 0 )
{
v12 = 58;
LABEL_28:
v6 = v18++;
*v6 = v12;
}
if ( v17 )
{
LABEL_32:
while ( 1 )
{
v8 = v17++;
v13 = *v8;
if ( !*v8 )
break;
v7 = v18++;
*v7 = v13;
}
}
}
if ( (v15 & 1) != 0 )
{
v10 = v18++;
*v10 = 34;
}
*v18 = 0;
cmdnextc = (long)v18;
return __readfsqword(0x28u) ^ v20;
}
|
void
auth_debug_reset(void)
{
if (auth_debug !=
((void *)0)
)
sshbuf_reset(auth_debug);
else if ((auth_debug = sshbuf_new()) ==
((void *)0)
)
sshfatal("auth.c", __func__, 606, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new failed");
}
| long long auth_debug_reset() {
unsigned long long v1;
if (auth_debug) {
v1 = sshbuf_reset(auth_debug);
return v1;
}
auth_debug = sshbuf_new();
v1 = auth_debug;
if (!auth_debug) {
v1 = sshfatal("auth.c", "auth_debug_reset", 0x25e, 0x1, 0x1, 0x0, "sshbuf_new failed");
return v1;
}
return v1;
}
|
static void print_linkmode(FILE *f, struct rtattr *tb)
{
unsigned int mode = rta_getattr_u8(tb);
if (mode >= (sizeof(link_modes) / sizeof((link_modes)[0])))
print_int(PRINT_ANY,
"linkmode_index",
"mode %d ",
mode);
else
print_string(PRINT_ANY,
"linkmode",
"mode %s "
, link_modes[mode]);
}
| long print_linkmode(long a1, long a2)
{
unsigned int v3;
v3 = (unsigned char)rta_getattr_u8(a2);
if ( v3 <= 1 )
return print_string(4u, (long)"linkmode", "mode %s ", (long)link_modes[v3]);
else
return print_int(4u, (long)"linkmode_index", (long)"mode %d ", v3);
}
|
void set_up_logging(e2fsck_t ctx)
{
ctx->logf = set_up_log_file(ctx, "log_filename", ctx->log_fn);
ctx->problem_logf = set_up_log_file(ctx, "problem_log_filename",
ctx->problem_log_fn);
}
| FILE * set_up_logging(_QWORD *a1)
{
FILE *result;
a1[5] = set_up_log_file((long)a1, (long)"log_filename", a1[6]);
result = set_up_log_file((long)a1, (long)"problem_log_filename", a1[8]);
a1[7] = result;
return result;
}
|
static void
channel_post_auth_listener(struct ssh *ssh, Channel *c)
{
Channel *nc;
int r, newsock;
struct sockaddr_storage addr;
socklen_t addrlen;
if ((c->io_ready & 0x10) == 0)
return;
addrlen = sizeof(addr);
newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen);
if (newsock == -1) {
sshlog("channels.c", __func__, 1850, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "accept from auth socket: %.100s", strerror(
(*__errno_location ())
));
if (
(*__errno_location ())
==
24
||
(*__errno_location ())
==
23
)
c->notbefore = monotime() + 1;
return;
}
nc = channel_new(ssh, "accepted auth socket",
3, newsock, newsock, -1,
c->local_window_max, c->local_maxpacket,
0, "accepted auth socket", 1);
open_preamble(ssh, __func__, nc, "auth-agent@openssh.com");
if ((r = sshpkt_send(ssh)) != 0)
sshfatal("channels.c", __func__, 1861, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %i", c->self);
}
| long long channel_post_auth_listener(void* a0, struct_0 *a1) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
void* v4;
char v5;
if (!(a1->field_30 & 16))
return 0;
v1 = 128;
v2 = accept(a1->field_28, &v5, &v1);
if (v2 == -1) {
v0 = strerror(*(__errno_location()));
sshlog("channels.c", "channel_post_auth_listener", 0x73a, 0x0, 0x2, 0x0, "accept from auth socket: %.100s");
if (*(__errno_location()) != 24 && *(__errno_location()) != 23)
return 0;
a1->field_58 = __addvdi3(monotime(), 0x1);
return 0;
} else {
v4 = channel_new(a0, "accepted auth socket", 0x3, v2, v2, 0xffffffff, a1->field_b4, a1->field_bc, 0x0, "accepted auth socket", 0x1);
open_preamble(a0, "channel_post_auth_listener", v4, "auth-agent@openssh.com");
v3 = sshpkt_send(a0);
if (v3) {
v0 = a1->field_4;
sshfatal("channels.c", "channel_post_auth_listener", 0x745, 0x1, 0x1, ssh_err(v3));
return 0;
}
return 0;
}
}
|
static void print_namespace(struct rtattr *attrs[])
{
print_uint(PRINT_ANY, "namespace", "namespace %u",
rta_getattr_u16(attrs[IOAM6_ATTR_NS_ID]));
if (attrs[IOAM6_ATTR_SC_ID])
print_uint(PRINT_ANY, "schema", " [schema %u]",
rta_getattr_u32(attrs[IOAM6_ATTR_SC_ID]));
if (attrs[IOAM6_ATTR_NS_DATA])
print_hex(PRINT_ANY, "data", ", data %#010x",
rta_getattr_u32(attrs[IOAM6_ATTR_NS_DATA]));
if (attrs[IOAM6_ATTR_NS_DATA_WIDE])
print_0xhex(PRINT_ANY, "wide", ", wide %#018lx",
rta_getattr_u64(attrs[IOAM6_ATTR_NS_DATA_WIDE]));
print_nl();
}
| void print_namespace(long param_1)
{
undefined2 uVar1;
undefined4 uVar2;
undefined8 uVar3;
uVar1 = rta_getattr_u16(*(undefined8 *)(param_1 + 8));
print_uint(4,"namespace","namespace %u",uVar1);
if (*(long *)(param_1 + 0x20) != 0) {
uVar2 = rta_getattr_u32(*(undefined8 *)(param_1 + 0x20));
print_uint(4,"schema"," [schema %u]",uVar2);
}
if (*(long *)(param_1 + 0x10) != 0) {
uVar2 = rta_getattr_u32(*(undefined8 *)(param_1 + 0x10));
print_hex(4,&DAT_001014bf,", data %#010x",uVar2);
}
if (*(long *)(param_1 + 0x18) != 0) {
uVar3 = rta_getattr_u64(*(undefined8 *)(param_1 + 0x18));
print_0xhex(4,&DAT_001014d3,", wide %#018lx",uVar3);
}
print_nl();
return;
}
|
int
main (int argc, char **argv)
{
_Bool
multiple_names =
0
;
_Bool
use_nuls =
0
;
char const *suffix =
((void *)0)
;
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
while (
1
)
{
int c = getopt_long (argc, argv, "+as:z", longopts,
((void *)0)
);
if (c == -1)
break;
switch (c)
{
case 's':
suffix = optarg;
__attribute__ ((__fallthrough__));
case 'a':
multiple_names =
1
;
break;
case 'z':
use_nuls =
1
;
break;
case GETOPT_HELP_CHAR: usage (
0
); break;;
case GETOPT_VERSION_CHAR: version_etc (
stdout
, "basename", "GNU coreutils", Version, ("David MacKenzie"), (char *)
((void *)0)
); exit (
0
); break;;
default:
usage (
1
);
}
}
if (argc < optind + 1)
{
error (0, 0, gettext ("missing operand"));
usage (
1
);
}
if (!multiple_names && optind + 2 < argc)
{
error (0, 0, gettext ("extra operand %s"), quote (argv[optind + 2]));
usage (
1
);
}
if (multiple_names)
{
for (; optind < argc; optind++)
perform_basename (argv[optind], suffix, use_nuls);
}
else
perform_basename (argv[optind],
optind + 2 == argc ? argv[optind + 1] :
((void *)0)
, use_nuls);
return
0
;
}
| int main(unsigned long a0, unsigned long long *a1) {
char v0;
char v1;
unsigned int v2;
void* v3;
unsigned long long v6;
v0 = 0;
v1 = 0;
v3 = 0;
set_program_name(*(a1));
setlocale(0x6, &g_400963);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit(got.close_stdout);
while (true) {
v2 = getopt_long(a0, a1, "+as:z", &longopts, NULL);
if (v2 == -1)
break;
switch (v2) {
case 122:
v1 = 1;
break;
case 4294967165:
version_etc(stdout, "basename", "GNU coreutils", Version, "David MacKenzie", 0x0);
exit(0x0);
case 4294967166:
usage(0x0);
case 115:
v3 = optarg;
case 97:
v0 = 1;
break;
default:
usage(0x1);
}
}
if (a0 <= optind) {
error(0x0, 0x0, gettext("missing operand"));
usage(0x1);
}
if ((v0 ^ 1) && a0 > optind + 2) {
v6 = quote(a1[2 + optind]);
error(0x0, 0x0, gettext("extra operand %s"));
usage(0x1);
}
if (!v0) {
perform_basename(a1[optind], (a0 == optind + 2 ? 0 : a1[1 + optind]), v1);
return 0;
}
for (; a0 > optind; optind = optind + 1) {
perform_basename(a1[optind], v3, v1);
}
return 0;
}
|
static int vti6_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
struct ifinfomsg *ifi = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
struct {
struct nlmsghdr n;
struct ifinfomsg i;
} req = {
.n.nlmsg_len = ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01,
.n.nlmsg_type = RTM_GETLINK,
.i.ifi_family = preferred_family,
.i.ifi_index = ifi->ifi_index,
};
struct nlmsghdr *answer;
struct rtattr *tb[(__IFLA_MAX - 1) + 1];
struct rtattr *linkinfo[(__IFLA_INFO_MAX - 1)+1];
struct rtattr *vtiinfo[(__IFLA_VTI_MAX - 1) + 1];
__be32 ikey = 0;
__be32 okey = 0;
inet_prefix saddr, daddr;
unsigned int link = 0;
__u32 fwmark = 0;
int len;
inet_prefix_reset(&saddr);
inet_prefix_reset(&daddr);
if (!(n->nlmsg_flags & 0x400)) {
const struct rtattr *rta;
if (rtnl_talk(&rth, &req.n, &answer) < 0) {
get_failed:
fprintf(
stderr
,
"Failed to get existing tunnel info.\n");
return -1;
}
len = answer->nlmsg_len;
len -= ((sizeof(*ifi)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0)
goto get_failed;
parse_rtattr(tb, (__IFLA_MAX - 1), ((struct rtattr*)(((char*)(((void *)(((char *)answer) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))))) + ( ((sizeof(struct ifinfomsg))+4U -1) & ~(4U -1) ))), len);
if (!tb[IFLA_LINKINFO])
goto get_failed;
(parse_rtattr_flags((linkinfo), ((__IFLA_INFO_MAX - 1)), ((void*)(((char*)(tb[IFLA_LINKINFO])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((tb[IFLA_LINKINFO])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
if (!linkinfo[IFLA_INFO_DATA])
goto get_failed;
(parse_rtattr_flags((vtiinfo), ((__IFLA_VTI_MAX - 1)), ((void*)(((char*)(linkinfo[IFLA_INFO_DATA])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((linkinfo[IFLA_INFO_DATA])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)))
;
rta = vtiinfo[IFLA_VTI_LOCAL];
if (rta && get_addr_rta(&saddr, rta,
10
))
goto get_failed;
rta = vtiinfo[IFLA_VTI_REMOTE];
if (rta && get_addr_rta(&daddr, rta,
10
))
goto get_failed;
if (vtiinfo[IFLA_VTI_IKEY])
ikey = rta_getattr_u32(vtiinfo[IFLA_VTI_IKEY]);
if (vtiinfo[IFLA_VTI_OKEY])
okey = rta_getattr_u32(vtiinfo[IFLA_VTI_OKEY]);
if (vtiinfo[IFLA_VTI_LINK])
link = rta_getattr_u8(vtiinfo[IFLA_VTI_LINK]);
if (vtiinfo[IFLA_VTI_FWMARK])
fwmark = rta_getattr_u32(vtiinfo[IFLA_VTI_FWMARK]);
free(answer);
}
while (argc > 0) {
if (!matches(*argv, "key")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ikey = okey = tnl_parse_key("key", *argv);
} else if (!matches(*argv, "ikey")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
ikey = tnl_parse_key("ikey", *argv);
} else if (!matches(*argv, "okey")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
okey = tnl_parse_key("okey", *argv);
} else if (!matches(*argv, "remote")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
get_addr(&daddr, *argv,
10
);
} else if (!matches(*argv, "local")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
get_addr(&saddr, *argv,
10
);
} else if (!matches(*argv, "dev")) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
link = ll_name_to_index(*argv);
if (!link)
exit(nodev(*argv));
} else if (strcmp(*argv, "fwmark") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&fwmark, *argv, 0))
invarg("invalid fwmark\n", *argv);
} else {
vti6_print_help(lu, argc, argv,
stderr
);
return -1;
}
argc--; argv++;
}
addattr32(n, 1024, IFLA_VTI_IKEY, ikey);
addattr32(n, 1024, IFLA_VTI_OKEY, okey);
if (is_addrtype_inet_not_unspec(&saddr))
addattr_l(n, 1024, IFLA_VTI_LOCAL, saddr.data, saddr.bytelen);
if (is_addrtype_inet_not_unspec(&daddr))
addattr_l(n, 1024, IFLA_VTI_REMOTE, daddr.data, daddr.bytelen);
addattr32(n, 1024, IFLA_VTI_FWMARK, fwmark);
if (link)
addattr32(n, 1024, IFLA_VTI_LINK, link);
return 0;
}
| long long vti6_parse_opt(unsigned int a0, unsigned long a1, unsigned int a2, struct_0 *a3) {
unsigned long long *v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
char v7;
struct_1 *v8;
unsigned long long v9;
void* v10;
unsigned short v11;
unsigned short v12;
void* v13;
void* v14;
unsigned int v15;
void* v16;
char v17;
char v18;
char v19;
char v20;
char v21;
char v22;
char v23;
char v24;
char v25;
char v26;
char v27;
char v28;
char v29;
char v30;
char v31;
char v32;
char v33;
unsigned long long v35;
v1 = a1;
*(&v0) = a2;
v8 = &a3[2].padding_0;
v10 = 0;
v13 = 0;
v14 = 0;
v16 = 0;
v10 = 32;
v11 = 18;
v12 = 1;
v14 = preferred_family;
v15 = v8->field_4;
v3 = 0;
v4 = 0;
v5 = 0;
v2 = 0;
inet_prefix_reset(&v26);
inet_prefix_reset(&v29);
if ((a3->field_6 & 0x400)) {
for (; v1 > 0; v0 += 1) {
if ((matches(*(v0), "key") ^ 1)) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v4 = tnl_parse_key("key", *(v0));
v3 = v4;
} else if ((matches(*(v0), "ikey") ^ 1)) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v3 = tnl_parse_key("ikey", *(v0));
} else if ((matches(*(v0), "okey") ^ 1)) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v4 = tnl_parse_key("okey", *(v0));
} else if ((matches(*(v0), "remote") ^ 1)) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
get_addr(&v29, *(v0), 0xa, *(v0));
} else if ((matches(*(v0), "local") ^ 1)) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
get_addr(&v26, *(v0), 0xa, *(v0));
} else if ((matches(*(v0), "dev") ^ 1)) {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
v5 = ll_name_to_index(*(v0));
if (!v5)
exit(nodev(*(v0)));
} else if (strcmp(*(v0), "fwmark")) {
vti6_print_help(a0, v1, v0, *(&stderr));
v35 = 4294967295;
return v35;
} else {
v0 = v0 + 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
if (get_u32(&v2, *(v0), 0x0, *(v0))) {
invarg("invalid fwmark\n", *(v0));
vti6_print_help(a0, v1, v0, *(&stderr));
v35 = 4294967295;
return v35;
}
}
v1 -= 1;
}
addattr32(a3, 0x400, 0x2, v3);
addattr32(a3, 0x400, 0x3, v4);
if (is_addrtype_inet_not_unspec(&v26))
addattr_l(a3, 0x400, 0x4, &v28, *(&v27));
if (is_addrtype_inet_not_unspec(&v29))
addattr_l(a3, 0x400, 0x5, &v31, *(&v30));
addattr32(a3, 0x400, 0x6, v2);
if (v5) {
addattr32(a3, 0x400, 0x1, v5);
v35 = 0;
return v35;
}
v35 = 0;
return v35;
} else {
if (rtnl_talk(0x500020, &v10, &v7) >= 0 && (v6 = *(*(&v7)), v6 -= 32, v6 >= 0)) {
parse_rtattr(&v32, 0x3c, *(&v7) + 32, v6);
if (*(&v33) && (parse_rtattr_flags(&v17, 0x5, *(&v33) + 4, (*(*(&v33)) - 4), 0x8000), *(&v18))) {
parse_rtattr_flags(&v19, 0x6, *(&v18) + 4, *(*(&v18)) - 4, 0x8000);
v9 = *(&v23);
if ((!v9 || !get_addr_rta(&v26, v9, 0xa, v9)) && (v9 = *(&v24), !v9 || !get_addr_rta(&v29, v9, 0xa, v9))) {
if (*(&v21))
v3 = rta_getattr_u32(*(&v21));
if (*(&v22))
v4 = rta_getattr_u32(*(&v22));
if (*(&v20))
v5 = rta_getattr_u8(*(&v20));
if (*(&v25))
v2 = rta_getattr_u32(*(&v25));
free(*(&v7));
}
}
}
fprintf(*(&stderr), "Failed to get existing tunnel info.\n");
v35 = 4294967295;
return v35;
}
}
|
Channel *
channel_connect_to_port(struct ssh *ssh, const char *host, u_short port,
char *ctype, char *rname, int *reason, const char **errmsg)
{
struct ssh_channels *sc = ssh->chanctxt;
struct permission_set *pset = &sc->local_perms;
struct channel_connect cctx;
Channel *c;
u_int i, permit, permit_adm = 1;
int sock;
struct permission *perm;
permit = pset->all_permitted;
if (!permit) {
for (i = 0; i < pset->num_permitted_user; i++) {
perm = &pset->permitted_user[i];
if (open_match(perm, host, port)) {
permit = 1;
break;
}
}
}
if (pset->num_permitted_admin > 0) {
permit_adm = 0;
for (i = 0; i < pset->num_permitted_admin; i++) {
perm = &pset->permitted_admin[i];
if (open_match(perm, host, port)) {
permit_adm = 1;
break;
}
}
}
if (!permit || !permit_adm) {
sshlog("channels.c", __func__, 4641, 0, SYSLOG_LEVEL_INFO,
((void *)0)
, "Received request from %.100s port %d to connect to " "host %.100s port %d, but the request was denied.", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), host, port)
;
if (reason !=
((void *)0)
)
*reason = 1;
return
((void *)0)
;
}
memset(&cctx, 0, sizeof(cctx));
sock = connect_to_helper(ssh, host, port,
SOCK_STREAM
, ctype, rname,
&cctx, reason, errmsg);
if (sock == -1) {
channel_connect_ctx_free(&cctx);
return
((void *)0)
;
}
c = channel_new(ssh, ctype, 12, sock, sock, -1,
(64*(32*1024)), (32*1024), 0, rname, 1);
c->host_port = port;
c->path = xstrdup(host);
c->connect_ctx = cctx;
return c;
}
| long long channel_connect_to_port(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned int a3, unsigned long a4, unsigned int a5, unsigned int v13) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned long v5;
struct_1 *v6;
void* v7;
void* v8;
char v9;
char v10;
char v11;
char v12;
unsigned long long v14;
void* v15;
*(&v0) = *(&v13);
v5 = a0->field_868;
v6 = v5 + 32;
v3 = 1;
v2 = v6->field_20;
if (!v2) {
v1 = 0;
while (true) {
if (v1 >= v6->field_0)
break;
v7 = v1 * 48 + v6->field_8;
if (!open_match(v7, a1, a2)) {
v1 += 1;
} else {
v2 = 1;
break;
}
}
}
if (v6->field_10) {
v3 = 0;
v1 = 0;
while (true) {
if (v1 >= v6->field_10)
break;
v7 = v1 * 48 + v6->field_18;
if (!open_match(v7, a1, a2)) {
v1 += 1;
} else {
v3 = 1;
break;
}
}
}
if (!v2) {
LABEL_40f3b7:
v14 = ssh_remote_port(a0);
ssh_remote_ipaddr(a0);
sshlog("channels.c", "channel_connect_to_port", 0x1221, 0x0, 0x3, 0x0, "Received request from %.100s port %d to connect to host %.100s port %d, but the request was denied.");
if (a5)
*(a5) = 1;
v15 = 0;
} else {
if (!v3)
goto LABEL_40f3b7;
memset(&v9, 0x0, 0x20);
v4 = connect_to_helper(a0, a1, a2, 0x1, a3, a4, &v9, a5, *(&v0));
if (v4 == -1) {
channel_connect_ctx_free(&v9);
v15 = 0;
} else {
v8 = channel_new(a0, a3, 0xc, v4, v4, 0xffffffff, 0x200000, 0x8000, 0x0, a4, 0x1);
*(&v8[152]) = a2;
*(&v8[128]) = xstrdup(a1);
*(&v8[296]) = *(&v9);
*(&v8[304]) = *(&v10);
*(&v8[312]) = *(&v11);
*(&v8[320]) = *(&v12);
v15 = v8;
}
}
return v15;
}
|
static void check_flags (int argc, int opt_index)
{
if (argc != opt_index + 1) {
usage (2);
}
if (lflg && (mflg || Mflg || dflg || Wflg || Iflg || Eflg)) {
fprintf (
stderr
,
gettext ("%s: do not include \"l\" with other flags\n"),
Prog);
usage (2);
}
}
| void check_flags(unsigned long a0, unsigned long a1) {
unsigned long long v1;
unsigned long long v2;
if (a0 != a1 + 1)
usage(0x2);
v1 = lflg;
if (!lflg)
return;
if (!mflg && !Mflg && !dflg && !Wflg && !Iflg) {
v2 = Eflg;
if (!Eflg)
return;
}
fprintf(stderr, gettext("%s: do not include \"l\" with other flags\n"));
usage(0x2);
}
|
void
channel_clear_permission(struct ssh *ssh, int who, int where)
{
struct permission **permp;
u_int *npermp;
permission_set_get_array(ssh, who, where, &permp, &npermp);
*permp = xrecallocarray(*permp, *npermp, 0, sizeof(**permp));
*npermp = 0;
}
| void channel_clear_permission(unsigned long long a0, unsigned long a1, unsigned long a2) {
char v0;
unsigned long long v1;
char v2;
unsigned long long *v5;
unsigned long long v6;
permission_set_get_array(a0, a1, a2, &v0, &v1);
*(*(&v0)) = xrecallocarray(*(*(&v0)), *(v1), 0x0, 0x30);
*(v1) = 0;
v6 = *(&v2) ^ v5[5];
return;
}
|
static inline
_Bool
c_isspace(int c)
{
return c_isbits(c, C_CTYPE_SPACE);
}
| int c_isspace(unsigned long a0) {
return c_isbits(a0, 0x4);
}
|
) { *ppData =
((void *)0)
; return RS_RET_OUT_OF_MEMORY; }
| undefined4 createWrkrInstance(void **param_1,undefined8 param_2)
{
undefined4 uVar1;
undefined8 *puVar2;
puVar2 = (undefined8 *)calloc(1,8);
if (puVar2 == (undefined8 *)0x0) {
*param_1 = (void *)0x0;
uVar1 = 0xfffffffa;
}
else {
*puVar2 = param_2;
*param_1 = puVar2;
uVar1 = 0;
}
return uVar1;
}
|
static int
history_def_set(void *p, HistEventW *ev, const int n)
{
history_t *h = (history_t *) p;
if (h->cur == 0) {
{ ev->num = 5; ev->str = he_errlist[5]; };
return -1;
}
if (h->cursor == &h->list || h->cursor->ev.num != n) {
for (h->cursor = h->list.next; h->cursor != &h->list;
h->cursor = h->cursor->next)
if (h->cursor->ev.num == n)
break;
}
if (h->cursor == &h->list) {
{ ev->num = 9; ev->str = he_errlist[9]; };
return -1;
}
return 0;
}
| undefined8 history_def_set(long param_1,undefined4 *param_2,int param_3)
{
undefined8 uVar1;
if (*(int *)(param_1 + 0x34) == 0) {
*param_2 = 5;
*(wchar_t **)(param_2 + 2) = L"empty list";
uVar1 = 0xffffffff;
}
else {
if ((*(long *)(param_1 + 0x28) == param_1) || (param_3 != **(int **)(param_1 + 0x28))) {
*(undefined8 *)(param_1 + 0x28) = *(undefined8 *)(param_1 + 0x18);
while ((*(long *)(param_1 + 0x28) != param_1 && (param_3 != **(int **)(param_1 + 0x28)))) {
*(undefined8 *)(param_1 + 0x28) = *(undefined8 *)(*(long *)(param_1 + 0x28) + 0x18);
}
}
if (*(long *)(param_1 + 0x28) == param_1) {
*param_2 = 9;
*(wchar_t **)(param_2 + 2) = L"event not found";
uVar1 = 0xffffffff;
}
else {
uVar1 = 0;
}
}
return uVar1;
}
|
static Fq Fq_recip(Fq a1)
{
int i = 1;
Fq ai = a1;
while (i < 4591 -2) {
ai = Fq_freeze(a1*(crypto_int32)ai);
i += 1;
}
return ai;
}
| int Fq_recip(unsigned long a0) {
unsigned short v0;
unsigned int v1;
unsigned int v3;
unsigned long long v4;
v1 = 1;
for (v0 = a0; v1 <= 4588; v1 = __addvsi3(v1, 0x1, v4)) {
v0 = Fq_freeze(__mulvsi3(a0, v0, v0), v3, v4);
}
return v0;
}
|
int
fmprintf(FILE *stream, const char *fmt, ...)
{
va_list ap;
int ret;
__builtin_va_start(
ap
,
fmt
)
;
ret = vfmprintf(stream, fmt, ap);
__builtin_va_end(
ap
)
;
return ret;
}
| long long fmprintf() {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
char v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
unsigned long v22;
unsigned long v23;
char v24;
int v25;
int v26;
int v27;
int v28;
int v29;
int v30;
int v31;
int v32;
unsigned long long *v33;
void* v34;
char *v35;
v7 = v20;
v8 = v21;
v9 = v22;
v10 = v23;
if (v24) {
v11 = v25;
v12 = v26;
v13 = v27;
v14 = v28;
v15 = v29;
v16 = v30;
v17 = v31;
v18 = v32;
}
v5 = v33[5];
v1 = 16;
v2 = 48;
v3 = &v19;
v4 = &v6;
v0 = vfmprintf(v34, v35, &v1);
if ((v5 ^ v33[5]))
__stack_chk_fail();
return v0;
}
|
int load_env(char *envstr, FILE * f) {
long filepos;
int fileline;
enum env_state state;
char quotechar, *c, *str, *val;
filepos = ftell(f);
fileline = LineNumber;
if (
(-1)
== get_string(envstr, 131072, f, "\n"))
return ((-1));
if ((DebugFlags & (0x0008)) != 0) printf ("load_env, read <%s>\n", envstr);
val = str = envstr;
state = NAMEI;
quotechar = '\0';
c = envstr;
while (state != ERROR && *c) {
switch (state) {
case NAMEI:
case VALUEI:
if (*c == '\'' || *c == '"')
quotechar = *c++;
state++;
case NAME:
case VALUE:
if (quotechar) {
if (*c == quotechar) {
state++;
c++;
break;
}
if (state == NAME && *c == '=') {
state = ERROR;
break;
}
}
else {
if (state == NAME) {
if (
((*__ctype_b_loc ())[(int) ((
(unsigned char) *c
))] & (unsigned short int) _ISspace)
) {
c++;
state++;
break;
}
if (*c == '=') {
state++;
break;
}
}
}
*str++ = *c++;
break;
case EQ1:
if (*c == '=') {
state++;
quotechar = '\0';
*str++ = *c;
val = str;
}
else {
if (!
((*__ctype_b_loc ())[(int) ((
(unsigned char) *c
))] & (unsigned short int) _ISspace)
)
state = ERROR;
}
c++;
break;
case EQ2:
case FINI:
if (
((*__ctype_b_loc ())[(int) ((
(unsigned char) *c
))] & (unsigned short int) _ISspace)
)
c++;
else
state++;
break;
default:
abort();
}
}
if (state != FINI && state != EQ2 && !(state == VALUE && !quotechar)) {
if ((DebugFlags & (0x0008)) != 0) printf ("load_env, not an env var, state = %d\n", state);
if (fseek(f, filepos, 0)) {
return (-1);
}
{if ((DebugFlags & (0x0008|0x0001)) != 0) printf ("linenum=%d\n",fileline); LineNumber = fileline; };
return (0);
}
*str = '\0';
if (state == VALUE) {
while (str > val &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)str[-1]
))] & (unsigned short int) _ISspace)
)
*(--str) = '\0';
}
return 1;
}
| long load_env(const char *a1, FILE *a2)
{
const char *v3;
const char *v4;
char *v5;
char *v6;
char v7;
unsigned int v8;
unsigned int v9;
const char *v10;
const char *v11;
const char *v12;
long off;
off = ftell(a2);
v9 = LineNumber;
if ( (unsigned int)get_string(a1, 0x20000LL, a2, &unk_930) == -1 )
return 0xFFFFFFFFLL;
if ( (DebugFlags & 8) != 0 )
printf("load_env, read <%s>\n", a1);
v11 = a1;
v12 = a1;
v8 = 0;
v7 = 0;
v10 = a1;
LABEL_32:
while ( v8 != 7 && *v10 )
{
switch ( v8 )
{
case 0u:
case 4u:
if ( *v10 == 39 || *v10 == 34 )
{
v3 = v10++;
v7 = *v3;
}
++v8;
goto LABEL_11;
case 1u:
case 5u:
LABEL_11:
if ( v7 )
{
if ( v7 == *v10 )
{
++v8;
++v10;
goto LABEL_32;
}
if ( v8 == 1 && *v10 == 61 )
{
v8 = 7;
goto LABEL_32;
}
}
else if ( v8 == 1 )
{
if ( ((*_ctype_b_loc())[*(unsigned char *)v10] & 0x2000) != 0 )
{
++v10;
v8 = 2;
goto LABEL_32;
}
if ( *v10 == 61 )
{
v8 = 2;
goto LABEL_32;
}
}
v4 = v10++;
v5 = (char *)v11++;
*v5 = *v4;
break;
case 2u:
if ( *v10 == 61 )
{
++v8;
v7 = 0;
v6 = (char *)v11++;
*v6 = *v10;
v12 = v11;
}
else if ( ((*_ctype_b_loc())[*(unsigned char *)v10] & 0x2000) == 0 )
{
v8 = 7;
}
++v10;
goto LABEL_32;
case 3u:
case 6u:
if ( ((*_ctype_b_loc())[*(unsigned char *)v10] & 0x2000) != 0 )
++v10;
else
++v8;
goto LABEL_32;
default:
abort();
}
}
if ( v8 == 6 || v8 == 3 || v8 == 5 && !v7 )
{
*v11 = 0;
if ( v8 == 5 )
{
while ( v11 > v12 && ((*_ctype_b_loc())[*((unsigned char *)v11 - 1)] & 0x2000) != 0 )
*--v11 = 0;
}
return 1LL;
}
else
{
if ( (DebugFlags & 8) != 0 )
printf("load_env, not an env var, state = %d\n", v8);
if ( fseek(a2, off, 0) )
{
return 0xFFFFFFFFLL;
}
else
{
if ( (DebugFlags & 9) != 0 )
printf("linenum=%d\n", v9);
LineNumber = v9;
return 0LL;
}
}
}
|
void
rijndaelEncrypt(const u32 rk[ ], int Nr, const u8 pt[16],
u8 ct[16])
{
u32 s0, s1, s2, s3, t0, t1, t2, t3;
int r;
s0 = (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3])) ^ rk[0];
s1 = (((u32)(pt + 4)[0] << 24) ^ ((u32)(pt + 4)[1] << 16) ^ ((u32)(pt + 4)[2] << 8) ^ ((u32)(pt + 4)[3])) ^ rk[1];
s2 = (((u32)(pt + 8)[0] << 24) ^ ((u32)(pt + 8)[1] << 16) ^ ((u32)(pt + 8)[2] << 8) ^ ((u32)(pt + 8)[3])) ^ rk[2];
s3 = (((u32)(pt + 12)[0] << 24) ^ ((u32)(pt + 12)[1] << 16) ^ ((u32)(pt + 12)[2] << 8) ^ ((u32)(pt + 12)[3])) ^ rk[3];
r = Nr >> 1;
for (;;) {
t0 =
Te0[(s0 >> 24) ] ^
Te1[(s1 >> 16) & 0xff] ^
Te2[(s2 >> 8) & 0xff] ^
Te3[(s3 ) & 0xff] ^
rk[4];
t1 =
Te0[(s1 >> 24) ] ^
Te1[(s2 >> 16) & 0xff] ^
Te2[(s3 >> 8) & 0xff] ^
Te3[(s0 ) & 0xff] ^
rk[5];
t2 =
Te0[(s2 >> 24) ] ^
Te1[(s3 >> 16) & 0xff] ^
Te2[(s0 >> 8) & 0xff] ^
Te3[(s1 ) & 0xff] ^
rk[6];
t3 =
Te0[(s3 >> 24) ] ^
Te1[(s0 >> 16) & 0xff] ^
Te2[(s1 >> 8) & 0xff] ^
Te3[(s2 ) & 0xff] ^
rk[7];
rk += 8;
if (--r == 0) {
break;
}
s0 =
Te0[(t0 >> 24) ] ^
Te1[(t1 >> 16) & 0xff] ^
Te2[(t2 >> 8) & 0xff] ^
Te3[(t3 ) & 0xff] ^
rk[0];
s1 =
Te0[(t1 >> 24) ] ^
Te1[(t2 >> 16) & 0xff] ^
Te2[(t3 >> 8) & 0xff] ^
Te3[(t0 ) & 0xff] ^
rk[1];
s2 =
Te0[(t2 >> 24) ] ^
Te1[(t3 >> 16) & 0xff] ^
Te2[(t0 >> 8) & 0xff] ^
Te3[(t1 ) & 0xff] ^
rk[2];
s3 =
Te0[(t3 >> 24) ] ^
Te1[(t0 >> 16) & 0xff] ^
Te2[(t1 >> 8) & 0xff] ^
Te3[(t2 ) & 0xff] ^
rk[3];
}
s0 =
(Te2[(t0 >> 24) ] & 0xff000000) ^
(Te3[(t1 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t2 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t3 ) & 0xff] & 0x000000ff) ^
rk[0];
{ (ct)[0] = (u8)((s0) >> 24); (ct)[1] = (u8)((s0) >> 16); (ct)[2] = (u8)((s0) >> 8); (ct)[3] = (u8)(s0); };
s1 =
(Te2[(t1 >> 24) ] & 0xff000000) ^
(Te3[(t2 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t3 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t0 ) & 0xff] & 0x000000ff) ^
rk[1];
{ (ct + 4)[0] = (u8)((s1) >> 24); (ct + 4)[1] = (u8)((s1) >> 16); (ct + 4)[2] = (u8)((s1) >> 8); (ct + 4)[3] = (u8)(s1); };
s2 =
(Te2[(t2 >> 24) ] & 0xff000000) ^
(Te3[(t3 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t0 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t1 ) & 0xff] & 0x000000ff) ^
rk[2];
{ (ct + 8)[0] = (u8)((s2) >> 24); (ct + 8)[1] = (u8)((s2) >> 16); (ct + 8)[2] = (u8)((s2) >> 8); (ct + 8)[3] = (u8)(s2); };
s3 =
(Te2[(t3 >> 24) ] & 0xff000000) ^
(Te3[(t0 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t1 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t2 ) & 0xff] & 0x000000ff) ^
rk[3];
{ (ct + 12)[0] = (u8)((s3) >> 24); (ct + 12)[1] = (u8)((s3) >> 16); (ct + 12)[2] = (u8)((s3) >> 8); (ct + 12)[3] = (u8)(s3); };
}
| long long rijndaelEncrypt(unsigned long a0, unsigned long a1, char a2[16], char a3[16]) {
unsigned int v0[8];
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
*(&v0[0]) = a0;
v1 = v0[0] ^ (a2[0] * 0x1000000) ^ (a2[1] * 0x10000) ^ (a2[2] * 0x100) ^ a2[3];
v2 = v0[1] ^ (a2[4] * 0x1000000) ^ (a2[5] * 0x10000) ^ (a2[6] * 0x100) ^ a2[7];
v3 = v0[2] ^ (a2[8] * 0x1000000) ^ (a2[9] * 0x10000) ^ (a2[10] * 0x100) ^ a2[11];
v4 = v0[3] ^ (a2[12] * 0x1000000) ^ (a2[13] * 0x10000) ^ (a2[14] * 0x100) ^ a2[15];
v5 = a1 >> 1;
while (true) {
v6 = v0[4] ^ *((4 * (v1 >> 24) + &Te0)) ^ *((4199776 + 4 * (v2 >> 16))) ^ *((4 * (v3 >> 8) + &Te2)) ^ *((4 * v4 + &Te3));
v7 = v0[5] ^ *((4 * (v2 >> 24) + &Te0)) ^ *((4199776 + 4 * (v3 >> 16))) ^ *((4 * (v4 >> 8) + &Te2)) ^ *((4 * v1 + &Te3));
v8 = v0[6] ^ *((4 * (v3 >> 24) + &Te0)) ^ *((4199776 + 4 * (v4 >> 16))) ^ *((4 * (v1 >> 8) + &Te2)) ^ *((4 * v2 + &Te3));
v9 = v0[7] ^ *((4 * (v4 >> 24) + &Te0)) ^ *((4199776 + 4 * (v1 >> 16))) ^ *((4 * (v2 >> 8) + &Te2)) ^ *((4 * v3 + &Te3));
*(&v0[0]) = v0 + 1;
v5 = __addvsi3(v5, 0xffffffff, *((4 * (v4 >> 24) + &Te0)) ^ *((4199776 + 4 * (v1 >> 16))) ^ *((4 * (v2 >> 8) + &Te2)) ^ *((4 * v3 + &Te3)), *((4 * (v4 >> 24) + &Te0)) ^ *((4199776 + 4 * (v1 >> 16))) ^ *((4 * (v2 >> 8) + &Te2)) ^ *((4 * v3 + &Te3)));
if (!v5)
break;
if (v5) {
v1 = v0[0] ^ *((4 * (v6 >> 24) + &Te0)) ^ *((4199776 + 4 * (v7 >> 16))) ^ *((4 * (v8 >> 8) + &Te2)) ^ *((4 * v9 + &Te3));
v2 = v0[1] ^ *((4 * (v7 >> 24) + &Te0)) ^ *((4199776 + 4 * (v8 >> 16))) ^ *((4 * (v9 >> 8) + &Te2)) ^ *((4 * v6 + &Te3));
}
v3 = v0[2] ^ *((4 * (v8 >> 24) + &Te0)) ^ *((4199776 + 4 * (v9 >> 16))) ^ *((4 * (v6 >> 8) + &Te2)) ^ *((4 * v7 + &Te3));
v4 = v0[3] ^ *((4 * (v9 >> 24) + &Te0)) ^ *((4199776 + 4 * (v6 >> 16))) ^ *((4 * (v7 >> 8) + &Te2)) ^ *((4 * v8 + &Te3));
}
v1 = v0[0] ^ (*((4 * (v6 >> 24) + &Te2)) & -0x1000000 | *((4 * (v7 >> 16) + &Te3)) & 0xff0000) ^ *((4 * (v8 >> 8) + &Te0)) & 0xff00 ^ *((4199776 + 4 * v9));
a3[0] = v1 >> 24;
a3[1] = v1 >> 16;
a3[2] = v1 >> 8;
a3[3] = v1;
v2 = v0[1] ^ (*((4 * (v7 >> 24) + &Te2)) & -0x1000000 | *((4 * (v8 >> 16) + &Te3)) & 0xff0000) ^ *((4 * (v9 >> 8) + &Te0)) & 0xff00 ^ *((4199776 + 4 * v6));
a3[4] = v2 >> 24;
a3[5] = v2 >> 16;
a3[6] = v2 >> 8;
a3[7] = v2;
v3 = v0[2] ^ (*((4 * (v8 >> 24) + &Te2)) & -0x1000000 | *((4 * (v9 >> 16) + &Te3)) & 0xff0000) ^ *((4 * (v6 >> 8) + &Te0)) & 0xff00 ^ *((4199776 + 4 * v7));
a3[8] = v3 >> 24;
a3[9] = v3 >> 16;
a3[10] = v3 >> 8;
a3[11] = v3;
v4 = v0[3] ^ (*((4 * (v9 >> 24) + &Te2)) & -0x1000000 | *((4 * (v6 >> 16) + &Te3)) & 0xff0000) ^ *((4 * (v7 >> 8) + &Te0)) & 0xff00 ^ *((4199776 + 4 * v8));
a3[12] = v4 >> 24;
a3[13] = v4 >> 16;
a3[14] = v4 >> 8;
a3[15] = v4;
return &a3[15];
}
|
== spw) {
printf (gettext ("no matching password file entry in %s\n"),
spw_dbname ());
printf (gettext ("add user '%s' in %s? "),
pwd->pw_name, spw_dbname ());
*errors += 1;
if (yes_or_no (read_only)) {
struct spwd sp;
struct passwd pw;
sp.sp_namp = pwd->pw_name;
sp.sp_pwdp = pwd->pw_passwd;
sp.sp_min =
getdef_num ("PASS_MIN_DAYS", -1);
sp.sp_max =
getdef_num ("PASS_MAX_DAYS", -1);
sp.sp_warn =
getdef_num ("PASS_WARN_AGE", -1);
sp.sp_inact = -1;
sp.sp_expire = -1;
sp.sp_flag = ((unsigned long int)-1);
sp.sp_lstchg = (long) gettime () / (24L*3600L);
if (0 == sp.sp_lstchg) {
sp.sp_lstchg = -1;
}
*changed =
1
;
if (spw_update (&sp) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, spw_dbname (), sp.sp_namp);
fail_exit (5);
}
pw = *pwd;
pw.pw_passwd = "x";
if (pw_update (&pw) == 0) {
fprintf (
stderr
,
gettext ("%s: failed to prepare the new %s entry '%s'\n"),
Prog, pw_dbname (), pw.pw_name);
fail_exit (5);
}
}
} else {
| int printf(char *__format,...)
{
halt_baddata();
}
|
int
_rl_arg_overflow (void)
{
if (rl_numeric_arg > 1000000)
{
_rl_argcxt = 0;
rl_explicit_arg = rl_numeric_arg = 0;
rl_ding ();
rl_restore_prompt ();
rl_clear_message ();
(rl_readline_state &= ~(0x0000400));
return 1;
}
return 0;
}
| int _rl_arg_overflow(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
int tmp_7;
unsigned int v1;
if (rl_numeric_arg > 1000000) {
_rl_argcxt = 0;
rl_numeric_arg = 0;
rl_explicit_arg = rl_numeric_arg;
rl_ding();
rl_restore_prompt(a0, a1, a2, a3, a4, a5);
rl_clear_message(a0, a1, a2, a3, a4, a5);
v1 = *(&rl_readline_state);
*(&v1) = (*(&rl_readline_state) >> 8) & 251;
tmp_7 = v1;
*(&rl_readline_state) = tmp_7;
v1 = 1;
} else {
v1 = 0;
}
return v1;
}
|
static void
append_to_list (struct gnutls_cli_list *list,
const char *name, const char *arg)
{
const char **tmp;
size_t new_count = xsum (list->count, 1);
if (((new_count) ==
(18446744073709551615UL)
))
error (
1
, 0, "too many arguments for %s",
name);
tmp = reallocarray (list->args, new_count, sizeof (char *));
if (!tmp)
error (
1
, 0, "unable to allocate memory for %s",
name);
list->args = tmp;
list->args[list->count] = optarg;
list->count = new_count;
}
| void append_to_list(struct_0 *a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned int v2;
unsigned long v3;
struct_0 *v5;
v1 = a1;
v0 = a2;
*(&v2) = xsum(a0->field_8, 0x1);
if (*(&v2) == -1)
error(0x1, 0x0, "too many arguments for %s");
v3 = reallocarray(a0->field_0, *(&v2), 0x8);
if (v3) {
a0->field_0 = v3;
*((a0->field_0 + a0->field_8 * 8)) = *(got.optarg);
v5 = a0;
a0->field_8 = *(&v2);
return;
}
error(0x1, 0x0, "unable to allocate memory for %s");
}
|
static void
unbind_compfunc_variables (exported)
int exported;
{
unbind_variable_noref ("COMP_LINE");
unbind_variable_noref ("COMP_POINT");
unbind_variable_noref ("COMP_TYPE");
unbind_variable_noref ("COMP_KEY");
unbind_variable_noref ("COMP_WORDS");
unbind_variable_noref ("COMP_CWORD");
if (exported)
array_needs_making = 1;
}
| long unbind_compfunc_variables(int a1)
{
long result;
unbind_variable_noref("COMP_LINE");
unbind_variable_noref("COMP_POINT");
unbind_variable_noref("COMP_TYPE");
unbind_variable_noref("COMP_KEY");
unbind_variable_noref("COMP_WORDS");
result = unbind_variable_noref("COMP_CWORD");
if ( a1 )
array_needs_making = 1;
return result;
}
|
int crypto_verify_32(const unsigned char *x,const unsigned char *y)
{
unsigned int differentbits = 0;
differentbits |= x[0] ^ y[0];
differentbits |= x[1] ^ y[1];
differentbits |= x[2] ^ y[2];
differentbits |= x[3] ^ y[3];
differentbits |= x[4] ^ y[4];
differentbits |= x[5] ^ y[5];
differentbits |= x[6] ^ y[6];
differentbits |= x[7] ^ y[7];
differentbits |= x[8] ^ y[8];
differentbits |= x[9] ^ y[9];
differentbits |= x[10] ^ y[10];
differentbits |= x[11] ^ y[11];
differentbits |= x[12] ^ y[12];
differentbits |= x[13] ^ y[13];
differentbits |= x[14] ^ y[14];
differentbits |= x[15] ^ y[15];
differentbits |= x[16] ^ y[16];
differentbits |= x[17] ^ y[17];
differentbits |= x[18] ^ y[18];
differentbits |= x[19] ^ y[19];
differentbits |= x[20] ^ y[20];
differentbits |= x[21] ^ y[21];
differentbits |= x[22] ^ y[22];
differentbits |= x[23] ^ y[23];
differentbits |= x[24] ^ y[24];
differentbits |= x[25] ^ y[25];
differentbits |= x[26] ^ y[26];
differentbits |= x[27] ^ y[27];
differentbits |= x[28] ^ y[28];
differentbits |= x[29] ^ y[29];
differentbits |= x[30] ^ y[30];
differentbits |= x[31] ^ y[31];
return (1 & ((differentbits - 1) >> 8)) - 1;
}
| long long crypto_verify_32(char a0[32], char a1[32]) {
unsigned int v0;
v0 = 0;
v0 |= a1[0] ^ a0[0];
v0 |= a1[1] ^ a0[1];
v0 |= a1[2] ^ a0[2];
v0 |= a1[3] ^ a0[3];
v0 |= a1[4] ^ a0[4];
v0 |= a1[5] ^ a0[5];
v0 |= a1[6] ^ a0[6];
v0 |= a1[7] ^ a0[7];
v0 |= a1[8] ^ a0[8];
v0 |= a1[9] ^ a0[9];
v0 |= a1[10] ^ a0[10];
v0 |= a1[11] ^ a0[11];
v0 |= a1[12] ^ a0[12];
v0 |= a1[13] ^ a0[13];
v0 |= a1[14] ^ a0[14];
v0 |= a1[15] ^ a0[15];
v0 |= a1[16] ^ a0[16];
v0 |= a1[17] ^ a0[17];
v0 |= a1[18] ^ a0[18];
v0 |= a1[19] ^ a0[19];
v0 |= a1[20] ^ a0[20];
v0 |= a1[21] ^ a0[21];
v0 |= a1[22] ^ a0[22];
v0 |= a1[23] ^ a0[23];
v0 |= a1[24] ^ a0[24];
v0 |= a1[25] ^ a0[25];
v0 |= a1[26] ^ a0[26];
v0 |= a1[27] ^ a0[27];
v0 |= a1[28] ^ a0[28];
v0 |= a1[29] ^ a0[29];
v0 |= a1[30] ^ a0[30];
v0 |= a1[31] ^ a0[31];
return ((v0 - 1 >> 8) & 1) - 1;
}
|
static
_Bool
wd_comparator (const void *e1, const void *e2)
{
const struct File_spec *spec1 = e1;
const struct File_spec *spec2 = e2;
return spec1->wd == spec2->wd;
}
| long long wd_comparator(struct_0 *a0, struct_0 *a1) {
unsigned long long v1;
v1 = a1->field_44;
*(&v1) = a0->field_44 == a1->field_44;
return v1;
}
|
static char *
change_to_size(int nr)
{
int i;
switch (nr) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
nr = nr - '0';
break;
case '\0':
break;
default:
nr = current_size + nr;
if (nr > 9)
nr = 9;
if (nr < -9)
nr = -9;
break;
}
if (nr == current_size)
return "";
i = current_font;
sizebuf[0] = '\0';
strcat(sizebuf, change_to_font(0));
if (current_size)
strcat(sizebuf, "</FONT>");
current_size = nr;
if (nr) {
int l;
strcat(sizebuf, "<FONT SIZE=");
l = strlen(sizebuf);
if (nr > 0)
sizebuf[l++] = '+';
else
sizebuf[l++] = '-', nr = -nr;
sizebuf[l++] = nr + '0';
sizebuf[l++] = '>';
sizebuf[l] = '\0';
}
strcat(sizebuf, change_to_font(i));
return sizebuf;
}
| int change_to_size(unsigned long a0) {
unsigned int v0;
int tmp_7;
int tmp_13;
int tmp_25;
int tmp_45;
unsigned int v1;
unsigned int v2;
unsigned int v4;
v0 = a0;
if (v0) {
if (v0 >= 0 && v0 - 48 <= 9)
v0 -= 48;
if (v0 < 0 || v0 - 48 > 9) {
v0 += current_size;
if (v0 > 9)
v0 = 9;
if (v0 < -9)
v0 = -9;
}
}
if (v0 == current_size) {
v4 = &g_41026c;
} else {
v2 = current_font;
sizebuf = 0;
strcat(&sizebuf, change_to_font(0x0));
if (current_size)
strcat(&sizebuf, "</FONT>");
current_size = v0;
if (v0) {
strcat(&sizebuf, "<FONT SIZE=");
v1 = strlen(&sizebuf);
if (v0 > 0) {
tmp_7 = v1;
v1 += 1;
(&sizebuf)[tmp_7] = 43;
} else {
tmp_13 = v1;
v1 += 1;
(&sizebuf)[tmp_13] = 45;
v0 = -(v0);
}
tmp_25 = v1;
v1 += 1;
(&sizebuf)[tmp_25] = v0 + 48;
tmp_45 = v1;
v1 += 1;
(&sizebuf)[tmp_45] = 62;
*(&(&sizebuf)[v1]) = 0;
}
strcat(&sizebuf, change_to_font(v2));
v4 = &sizebuf;
}
return v4;
}
|
static int
errno_to_portable(int unixerrno)
{
int ret = 0;
switch (unixerrno) {
case 0:
ret = 0;
break;
case
2
:
case
20
:
case
9
:
case
40
:
ret = 2;
break;
case
1
:
case
13
:
case
14
:
ret = 3;
break;
case
36
:
case
22
:
ret = 5;
break;
case
38
:
ret = 8;
break;
default:
ret = 4;
break;
}
return ret;
}
| undefined4 errno_to_portable(undefined4 param_1)
{
undefined4 local_c;
switch(param_1) {
case 0:
local_c = 0;
break;
case 1:
case 0xd:
case 0xe:
local_c = 3;
break;
case 2:
case 9:
case 0x14:
case 0x28:
local_c = 2;
break;
default:
local_c = 4;
break;
case 0x16:
case 0x24:
local_c = 5;
break;
case 0x26:
local_c = 8;
}
return local_c;
}
|
void
md5hash(struct pkginfo *pkg, char *hashbuf, const char *fn)
{
struct dpkg_error err;
static int fd;
fd = open(fn,
00
);
if (fd >= 0) {
push_cleanup(cu_closefd, ehflag_bombout, 1, &fd);
if (buffer_copy_IntPtr(fd, 0, hashbuf, 5,
((void *)0)
, 3, -1, &err) < 0)
ohshit(gettext("cannot compute MD5 hash for file '%s': %s"),
fn, err.str);
pop_cleanup(ehflag_normaltidy);
close(fd);
} else if (
(*__errno_location ())
==
2
) {
strcpy(hashbuf, "nonexistent");
} else {
warning(gettext("%s: unable to open %s for hash: %s"),
pkg_name(pkg, pnaw_nonambig), fn, strerror(
(*__errno_location ())
));
strcpy(hashbuf, "-");
}
}
| unsigned long md5hash(long a1, char *a2, const char *a3)
{
const char *v3;
char *v4;
int *v5;
char *v6;
long v7;
char *v8;
char v12[8];
unsigned long v13;
v13 = __readfsqword(0x28u);
fd_6506 = open(a3, 0);
if ( fd_6506 < 0 )
{
if ( *_errno_location() == 2 )
{
strcpy(a2, "nonexistent");
}
else
{
v5 = _errno_location();
v6 = strerror(*v5);
v7 = pkg_name(a1, 1LL);
v8 = gettext("%s: unable to open %s for hash: %s");
warning(v8, v7, a3, v6);
strcpy(a2, "-");
}
}
else
{
push_cleanup(&cu_closefd, 2LL, 1LL, &fd_6506);
v3 = 0LL;
if ( buffer_copy_IntPtr((unsigned int)fd_6506, 0LL, a2, 5LL, 0LL, 3LL, -1LL, v12) < 0 )
{
v4 = gettext("cannot compute MD5 hash for file '%s': %s");
v3 = a3;
ohshit(v4);
}
pop_cleanup(1LL, v3);
close(fd_6506);
}
return __readfsqword(0x28u) ^ v13;
}
|
static int check_inode_extra_negative_epoch(__u32 xtime, __u32 extra) {
return (xtime & (1U << 31)) != 0 &&
(extra & ((1 << 2) - 1)) == ((1 << 2) - 1);
}
| undefined8 check_inode_extra_negative_epoch(int param_1,uint param_2)
{
undefined8 uVar1;
if ((param_1 < 0) && ((param_2 & 3) == 3)) {
uVar1 = 1;
}
else {
uVar1 = 0;
}
return uVar1;
}
|
static gnutls_datum_t wrap_db_fetch(void *dbf, gnutls_datum_t key)
{
gnutls_datum_t res = {
((void *)0)
, 0 };
time_t now = time(0);
int i;
for (i = 0; i < cache_db_ptr; i++) {
if (key.size == cache_db[i].session_id_size &&
memcmp(key.data, cache_db[i].session_id,
key.size) == 0 &&
now < gnutls_db_check_entry_expire_time(&cache_db[i].
session_data)) {
res.size = cache_db[i].session_data.size;
res.data = malloc(res.size);
if (res.data ==
((void *)0)
)
return res;
memcpy(res.data, cache_db[i].session_data.data,
res.size);
return res;
}
}
return res;
}
| long long wrap_db_fetch(unsigned long a0, void* a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned int v2;
unsigned long v3;
void* v4;
unsigned int v5;
void* v7;
v1 = a0;
v0 = a2;
v4 = 0;
v5 = 0;
v3 = time(NULL);
v2 = 0;
while (true) {
if (v2 >= cache_db_ptr) {
v7 = v4;
break;
} else {
if (v0 == *(((((v2 << 3) + v2 << 1) + v2 << 3) + cache_db + 128)) && !memcmp(a1, (((v2 << 3) + v2 << 1) + v2 << 3) + cache_db, v0) && v3 < gnutls_db_check_entry_expire_time((((v2 << 3) + v2 << 1) + v2 << 3) + cache_db + 136)) {
v5 = *((v2 * 152 + cache_db + 144));
v4 = malloc(v5);
if (!v4) {
v7 = v4;
break;
} else {
memcpy(v4, *((v2 * 152 + cache_db + 136)), v5);
v7 = v4;
break;
}
}
v2 += 1;
}
}
return v7;
}
|
int
_rl_peek_macro_key (void)
{
if (rl_executing_macro == 0)
return (0);
if (rl_executing_macro[executing_macro_index] == 0 && (macro_list == 0 || macro_list->string == 0))
return (0);
if (rl_executing_macro[executing_macro_index] == 0 && macro_list && macro_list->string)
return (macro_list->string[0]);
return (rl_executing_macro[executing_macro_index]);
}
| long long _rl_peek_macro_key() {
void* v1;
if (!rl_executing_macro) {
v1 = 0;
} else {
if (!*((executing_macro_index + rl_executing_macro)) && (!macro_list || !*((macro_list + 8))))
v1 = 0;
if (*((executing_macro_index + rl_executing_macro)) || macro_list && *((macro_list + 8))) {
if (!*((executing_macro_index + rl_executing_macro)) && macro_list && *((macro_list + 8)))
v1 = *(*((macro_list + 8)));
if (!macro_list || !*((macro_list + 8)) || *((executing_macro_index + rl_executing_macro)))
v1 = *((executing_macro_index + rl_executing_macro));
}
}
return v1;
}
|
int
acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p)
{
acl_entry_obj *entry_obj_p = ((acl_entry_obj *)__ext2int_and_check(entry_d, (0x9D6B)));
if (!entry_obj_p)
return -1;
if (!tag_type_p) {
(*__errno_location ())
=
22
;
return -1;
}
*tag_type_p = entry_obj_p->i.e_entry.e_tag;
return 0;
}
| undefined8 acl_get_tag_type(undefined8 param_1,undefined4 *param_2)
{
long lVar1;
undefined8 uVar2;
int *piVar3;
lVar1 = __ext2int_and_check(param_1,0x9d6b);
if (lVar1 == 0) {
uVar2 = 0xffffffff;
}
else if (param_2 == (undefined4 *)0x0) {
piVar3 = __errno_location();
*piVar3 = 0x16;
uVar2 = 0xffffffff;
}
else {
*param_2 = *(undefined4 *)(lVar1 + 0x20);
uVar2 = 0;
}
return uVar2;
}
|
static void
hash_shrink (table)
HASH_TABLE *table;
{
int nsize;
nsize = table->nbuckets / 4;
hash_rehash (table, nsize);
}
| long long hash_shrink(struct_0 *a0) {
unsigned int v0;
v0 = (a0->field_8 < 0 ? a0->field_8 + 3 : a0->field_8) >> 2;
return hash_rehash(a0, v0);
}
|
int
session_setup_x11fwd(struct ssh *ssh, Session *s)
{
struct stat st;
char display[512], auth_display[512];
char hostname[
1025
];
u_int i;
if (!auth_opts->permit_x11_forwarding_flag) {
ssh_packet_send_debug(ssh, "X11 forwarding disabled by key options.");
return 0;
}
if (!options.x11_forwarding) {
sshlog("session.c", __func__, 2572, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "X11 forwarding disabled in server configuration file.");
return 0;
}
if (options.xauth_location ==
((void *)0)
||
(stat(options.xauth_location, &st) == -1)) {
ssh_packet_send_debug(ssh, "No xauth program; cannot forward X11.");
return 0;
}
if (s->display !=
((void *)0)
) {
sshlog("session.c", __func__, 2581, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "X11 display already set.");
return 0;
}
if (x11_create_display_inet(ssh, options.x11_display_offset,
options.x11_use_localhost, s->single_connection,
&s->display_number, &s->x11_chanids) == -1) {
sshlog("session.c", __func__, 2587, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "x11_create_display_inet failed.");
return 0;
}
for (i = 0; s->x11_chanids[i] != -1; i++) {
channel_register_cleanup(ssh, s->x11_chanids[i],
session_close_single_x11, 0);
}
if (gethostname(hostname, sizeof(hostname)) == -1)
sshfatal("session.c", __func__, 2597, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "gethostname: %.100s", strerror(
(*__errno_location ())
));
if (options.x11_use_localhost) {
snprintf(display, sizeof display, "localhost:%u.%u",
s->display_number, s->screen);
snprintf(auth_display, sizeof auth_display, "unix:%u.%u",
s->display_number, s->screen);
s->display = xstrdup(display);
s->auth_display = xstrdup(auth_display);
} else {
snprintf(display, sizeof display, "%.400s:%u.%u", hostname,
s->display_number, s->screen);
s->display = xstrdup(display);
s->auth_display = xstrdup(display);
}
return 1;
}
| int session_setup_x11fwd(unsigned long long a0, struct_0 *a1, unsigned long long a2) {
unsigned long long v0;
unsigned long v1;
unsigned int v2;
char v3;
char v4;
char v5;
char v6;
unsigned int v8;
if (!*((auth_opts + 8))) {
ssh_packet_send_debug(a0, "X11 forwarding disabled by key options.", a2);
v8 = 0;
} else if (!g_500548) {
v0 = "X11 forwarding disabled in server configuration file.";
sshlog("session.c", "session_setup_x11fwd", 0xa0c, 0x0, 0x5, 0x0);
v8 = 0;
} else {
if (g_500558) {
v8 = stat(g_500558, &v3);
if (v8 != -1) {
if (a1->field_90) {
v0 = "X11 display already set.";
sshlog("session.c", "session_setup_x11fwd", 0xa15, 0x0, 0x5, 0x0);
v8 = 0;
} else {
v8 = x11_create_display_inet(a0, g_50054c, g_500550, a1->field_b8, &a1->field_8c, &a1->field_c0);
if (v8 == -1) {
v0 = "x11_create_display_inet failed.";
sshlog("session.c", "session_setup_x11fwd", 0xa1b, 0x0, 0x5, 0x0);
v8 = 0;
} else {
for (v2 = 0; *((a1->field_c0 + (v2 << 2))) != -1; v2 += 1) {
channel_register_cleanup(a0, *((a1->field_c0 + v2 * 4)), session_close_single_x11, 0x0);
}
v8 = gethostname(&v6, 0x401);
if (v8 == -1) {
v1 = strerror(*(__errno_location()));
v0 = "gethostname: %.100s";
sshfatal("session.c", "session_setup_x11fwd", 0xa25, 0x0, 0x1, 0x0);
}
if (g_500550) {
snprintf(&v4, 0x200, "localhost:%u.%u", a1->field_8c, a1->field_98);
snprintf(&v5, 0x200, "unix:%u.%u", a1->field_8c, a1->field_98);
a1->field_90 = xstrdup(&v4);
a1->field_a0 = xstrdup(&v5);
} else {
snprintf(&v4, 0x200, "%.400s:%u.%u", &v6, a1->field_8c, a1->field_98);
a1->field_90 = xstrdup(&v4);
a1->field_a0 = xstrdup(&v4);
}
v8 = 1;
}
}
}
}
if (v8 == -1 || !g_500558) {
ssh_packet_send_debug(a0, "No xauth program; cannot forward X11.", a2);
v8 = 0;
}
}
return v8;
}
|
static void
do_convert_from_pkcs8(struct sshkey **k, int *private)
{
EVP_PKEY *pubkey;
FILE *fp;
if ((fp = fopen(identity_file, "r")) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 694, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s: %s: %s", __progname, identity_file, strerror(
(*__errno_location ())
));
if ((pubkey = PEM_read_PUBKEY(fp,
((void *)0)
,
((void *)0)
,
((void *)0)
)) ==
((void *)0)
) {
sshfatal("ssh-keygen.c", __func__, 696, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "%s is not a recognised public key format", identity_file)
;
}
fclose(fp);
switch (
EVP_PKEY_get_base_id
(pubkey)) {
case
6
:
if ((*k = sshkey_new(KEY_UNSPEC)) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 703, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshkey_new failed");
(*k)->type = KEY_RSA;
(*k)->rsa = EVP_PKEY_get1_RSA(pubkey);
break;
case
116
:
if ((*k = sshkey_new(KEY_UNSPEC)) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 709, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshkey_new failed");
(*k)->type = KEY_DSA;
(*k)->dsa = EVP_PKEY_get1_DSA(pubkey);
break;
case
408
:
if ((*k = sshkey_new(KEY_UNSPEC)) ==
((void *)0)
)
sshfatal("ssh-keygen.c", __func__, 716, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshkey_new failed");
(*k)->type = KEY_ECDSA;
(*k)->ecdsa = EVP_PKEY_get1_EC_KEY(pubkey);
(*k)->ecdsa_nid = sshkey_ecdsa_key_to_nid((*k)->ecdsa);
break;
default:
sshfatal("ssh-keygen.c", __func__, 723, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "unsupported pubkey type %d",
EVP_PKEY_get_base_id
(pubkey))
;
}
EVP_PKEY_free(pubkey);
return;
}
| void do_convert_from_pkcs8(struct struct_1 **a0, unsigned long a1) {
unsigned long v0;
unsigned long long v1;
unsigned long v2;
unsigned long v3;
void* v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
char v8;
unsigned long long v10;
unsigned long long v11;
v3 = a1;
v4 = fopen(&identity_file, "r");
if (!v4) {
v2 = strerror(*(__errno_location()));
v1 = &identity_file;
v0 = __progname;
sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 0x2b6, 0x0, 0x1, 0x0, "%s: %s: %s");
}
v5 = PEM_read_PUBKEY(v4, 0x0, 0x0, 0x0);
if (!v5) {
v7 = &identity_file;
v6 = "%s is not a recognised public key format";
sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 0x2b8, 0x1, 0x1, 0x0, *(&v8));
}
fclose(v4);
v10 = EVP_PKEY_get_base_id(v5);
if (v10 == 408) {
*(a0) = sshkey_new(0xe);
if (!*(a0)) {
v6 = "sshkey_new failed";
sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 0x2cc, 0x0, 0x1, 0x0, *(&v8));
}
*(a0)->field_0 = 2;
*(&(*(a0))[2].field_0) = EVP_PKEY_get1_EC_KEY(v5);
*(&(*(a0))[1].field_8) = sshkey_ecdsa_key_to_nid(*(&(*(a0))[2].field_0));
} else {
if (v10 <= 408) {
if (v10 == 6) {
*(a0) = sshkey_new(0xe);
if (!*(a0)) {
v6 = "sshkey_new failed";
sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 0x2bf, 0x0, 0x1, 0x0, *(&v8));
}
*(a0)->field_0 = 0;
*(a0)->field_8 = EVP_PKEY_get1_RSA(v5);
goto LABEL_402500;
}
if (v10 == 116) {
*(a0) = sshkey_new(0xe);
if (!*(a0)) {
v6 = "sshkey_new failed";
sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 0x2c5, 0x0, 0x1, 0x0, *(&v8));
}
*(a0)->field_0 = 1;
*(&(*(a0))[1].field_0) = EVP_PKEY_get1_DSA(v5);
goto LABEL_402500;
}
}
v7 = EVP_PKEY_get_base_id(v5);
v6 = "unsupported pubkey type %d";
sshfatal("ssh-keygen.c", "do_convert_from_pkcs8", 0x2d3, 0x1, 0x1, 0x0, *(&v8));
}
LABEL_402500:
v11 = EVP_PKEY_free(v5);
return;
}
|
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 [STRING]...\n or: %s OPTION\n")
,
program_name, program_name);
fputs_unlocked (gettext ("Repeatedly output a line with all specified STRING(s), or 'y'.\n\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
emit_ancillary_info ("yes");
}
exit (status);
}
| long long usage(unsigned long a0) {
unsigned long v0;
unsigned long v1;
unsigned long v3;
unsigned long v4;
v1 = v3;
v0 = v4;
if (a0) {
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
} else {
printf(gettext("Usage: %s [STRING]...\n or: %s OPTION\n"));
fputs_unlocked(gettext("Repeatedly output a line with all specified STRING(s), or 'y'.\n\n"), stdout);
fputs_unlocked(gettext(" --help display this help and exit\n"), stdout);
fputs_unlocked(gettext(" --version output version information and exit\n"), stdout);
emit_ancillary_info("yes");
}
exit(a0);
}
|
static int
it_init_joblist (itp, jstate)
ITEMLIST *itp;
int jstate;
{
STRINGLIST *sl;
register int i;
register PROCESS *p;
char *s, *t;
JOB *j;
JOB_STATE ws;
ws = JNONE;
if (jstate == 0)
ws = JRUNNING;
else if (jstate == 1)
ws = JSTOPPED;
sl = strlist_create (js.j_jobslots);
for (i = js.j_jobslots - 1; i >= 0; i--)
{
j = (jobs[(i)]);
if (j == 0)
continue;
p = j->pipe;
if (jstate == -1 || (jobs[(i)]->state) == ws)
{
s = (char *)strcpy (sh_xmalloc((1 + strlen (p->command)), "pcomplete.c", 583), (p->command));
t = strpbrk (s, " \t\n");
if (t)
*t = '\0';
sl->list[sl->list_len++] = s;
}
}
itp->slist = sl;
return 0;
}
| void it_init_joblist(struct_1 *a0, unsigned long a1) {
unsigned int v0;
int tmp_26;
unsigned int v1;
struct_2 *v2;
struct_3 *v3;
char *v4;
char *v5;
unsigned long long *v7;
unsigned long long *v8;
void* v9;
v0 = a1;
v1 = -1;
if (!v0) {
v1 = 1;
} else if (v0 == 1) {
v1 = 2;
}
v2 = strlist_create(g_5000cc);
v7 = g_5000cc - 1;
while (true) {
if (v7 < 0)
break;
v3 = *((jobs + v7 * 8));
if (v3) {
if (v0 != -1 && !(v1 == *((*((jobs + (v7 << 3))) + 20))))
goto LABEL_400ea8;
v4 = strcpy(sh_xmalloc(strlen(v3->field_8->field_18) + 1, "pcomplete.c", 0x247), v3->field_8->field_18);
v5 = strpbrk(v4, " \t\n");
if (v5)
*(v5) = 0;
v8 = v2->field_0;
tmp_26 = v2->field_c;
v2->field_c = v2->field_c + 1;
v8[tmp_26] = v4;
}
LABEL_400ea8:
v7 = v7 - 1;
}
a0->field_10 = v2;
v9 = 0;
return;
}
|
static int
shouldexp_filterpat (s)
char *s;
{
register char *p;
for (p = s; p && *p; p++)
{
if (*p == '\\')
p++;
else if (*p == '&')
return 1;
}
return 0;
}
| long shouldexp_filterpat(_BYTE *a1)
{
while ( a1 && *a1 )
{
if ( *a1 == 92 )
{
++a1;
}
else if ( *a1 == 38 )
{
return 1LL;
}
++a1;
}
return 0LL;
}
|
static void print_explain(FILE *f)
{
fprintf(f,
"Usage: ... vlan id VLANID\n"
" [ protocol VLANPROTO ]\n"
" [ reorder_hdr { on | off } ]\n"
" [ gvrp { on | off } ]\n"
" [ mvrp { on | off } ]\n"
" [ loose_binding { on | off } ]\n"
" [ bridge_binding { on | off } ]\n"
" [ ingress-qos-map QOS-MAP ]\n"
" [ egress-qos-map QOS-MAP ]\n"
"\n"
"VLANID := 0-4095\n"
"VLANPROTO: [ 802.1Q | 802.1ad ]\n"
"QOS-MAP := [ QOS-MAP ] QOS-MAPPING\n"
"QOS-MAPPING := FROM:TO\n"
);
}
| void print_explain(void* a0) {
unsigned long long v1;
v1 = fprintf(a0, "Usage: ... vlan id VLANID\n\t\t[ protocol VLANPROTO ]\n\t\t[ reorder_hdr { on | off } ]\n\t\t[ gvrp { on | off } ]\n\t\t[ mvrp { on | off } ]\n\t\t[ loose_binding { on | off } ]\n\t\t[ bridge_binding { on | off } ]\n\t\t[ ingress-qos-map QOS-MAP ]\n\t\t[ egress-qos-map QOS-MAP ]\n\nVLANID := 0-4095\nVLANPROTO: [ 802.1Q | 802.1ad ]\nQOS-MAP := [ QOS-MAP ] QOS-MAPPING\nQOS-MAPPING := FROM:TO\n");
return;
}
|
int
default_columns ()
{
char *v;
int c;
c = -1;
v = get_string_value ("COLUMNS");
if (v && *v)
{
c = atoi (v);
if (c > 0)
return c;
}
if (check_window_size)
get_new_window_size (0, (int *)0, &c);
return (c > 0 ? c : 80);
}
| long long default_columns() {
unsigned int v0;
char *v1;
unsigned long long v3;
v0 = -1;
v1 = get_string_value("COLUMNS");
if (v1 && *(v1)) {
v0 = atoi(v1);
if (v0 > 0)
v3 = v0;
}
if (!*(v1) || !v1 || v0 <= 0) {
if (check_window_size)
get_new_window_size(0x0, 0x0, &v0);
if (v0 > 0)
v3 = v0;
else
v3 = 80;
}
return v3;
}
|
char *
acl_to_text(acl_t acl, ssize_t *len_p)
{
return __acl_to_any_text(acl, len_p,
((void *)0)
, '\n', "\n",
0x01);
}
| long long acl_to_text(unsigned long long a0, unsigned long long a1) {
return __acl_to_any_text(a0, a1, 0x0, 0xa, "\n", 0x1, a1, a0);
}
|
void
flush_read (void)
{
flush_read_ptr ();
}
| void flush_read() {
unsigned long long v1;
v1 = *(4213560)();
return;
}
|
static int
kex_choose_conf(struct ssh *ssh)
{
struct kex *kex = ssh->kex;
struct newkeys *newkeys;
char **my =
((void *)0)
, **peer =
((void *)0)
;
char **cprop, **sprop;
int nenc, nmac, ncomp;
u_int mode, ctos, need, dh_need, authlen;
int r, first_kex_follows;
sshlog("kex.c", __func__, 926, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "local %s KEXINIT proposal", kex->server ? "server" : "client");
if ((r = kex_buf2prop(kex->my,
((void *)0)
, &my)) != 0)
goto out;
sshlog("kex.c", __func__, 929, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "peer %s KEXINIT proposal", kex->server ? "client" : "server");
if ((r = kex_buf2prop(kex->peer, &first_kex_follows, &peer)) != 0)
goto out;
if (kex->server) {
cprop=peer;
sprop=my;
} else {
cprop=my;
sprop=peer;
}
if (kex->server && (kex->flags & 0x0002)) {
char *ext;
ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS],
((void *)0)
);
kex->ext_info_c = (ext !=
((void *)0)
);
free(ext);
}
if (kex->server && (kex->flags & 0x0002)) {
if (has_any_alg(peer[PROPOSAL_SERVER_HOST_KEY_ALGS],
"rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com"))
kex->flags |= 0x0008;
if (has_any_alg(peer[PROPOSAL_SERVER_HOST_KEY_ALGS],
"rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com"))
kex->flags |= 0x0010;
}
if ((r = choose_kex(kex, cprop[PROPOSAL_KEX_ALGS],
sprop[PROPOSAL_KEX_ALGS])) != 0) {
kex->failed_choice = peer[PROPOSAL_KEX_ALGS];
peer[PROPOSAL_KEX_ALGS] =
((void *)0)
;
goto out;
}
if ((r = choose_hostkeyalg(kex, cprop[PROPOSAL_SERVER_HOST_KEY_ALGS],
sprop[PROPOSAL_SERVER_HOST_KEY_ALGS])) != 0) {
kex->failed_choice = peer[PROPOSAL_SERVER_HOST_KEY_ALGS];
peer[PROPOSAL_SERVER_HOST_KEY_ALGS] =
((void *)0)
;
goto out;
}
for (mode = 0; mode < MODE_MAX; mode++) {
if ((newkeys = calloc(1, sizeof(*newkeys))) ==
((void *)0)
) {
r = -2;
goto out;
}
kex->newkeys[mode] = newkeys;
ctos = (!kex->server && mode == MODE_OUT) ||
(kex->server && mode == MODE_IN);
nenc = ctos ? PROPOSAL_ENC_ALGS_CTOS : PROPOSAL_ENC_ALGS_STOC;
nmac = ctos ? PROPOSAL_MAC_ALGS_CTOS : PROPOSAL_MAC_ALGS_STOC;
ncomp = ctos ? PROPOSAL_COMP_ALGS_CTOS : PROPOSAL_COMP_ALGS_STOC;
if ((r = choose_enc(&newkeys->enc, cprop[nenc],
sprop[nenc])) != 0) {
kex->failed_choice = peer[nenc];
peer[nenc] =
((void *)0)
;
goto out;
}
authlen = cipher_authlen(newkeys->enc.cipher);
if (authlen == 0 &&
(r = choose_mac(ssh, &newkeys->mac, cprop[nmac],
sprop[nmac])) != 0) {
kex->failed_choice = peer[nmac];
peer[nmac] =
((void *)0)
;
goto out;
}
if ((r = choose_comp(&newkeys->comp, cprop[ncomp],
sprop[ncomp])) != 0) {
kex->failed_choice = peer[ncomp];
peer[ncomp] =
((void *)0)
;
goto out;
}
sshlog("kex.c", __func__, 1005, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "kex: %s cipher: %s MAC: %s compression: %s", ctos ? "client->server" : "server->client", newkeys->enc.name, authlen == 0 ? newkeys->mac.name : "<implicit>", newkeys->comp.name)
;
}
need = dh_need = 0;
for (mode = 0; mode < MODE_MAX; mode++) {
newkeys = kex->newkeys[mode];
need = (((need) > (newkeys->enc.key_len)) ? (need) : (newkeys->enc.key_len));
need = (((need) > (newkeys->enc.block_size)) ? (need) : (newkeys->enc.block_size));
need = (((need) > (newkeys->enc.iv_len)) ? (need) : (newkeys->enc.iv_len));
need = (((need) > (newkeys->mac.key_len)) ? (need) : (newkeys->mac.key_len));
dh_need = (((dh_need) > (cipher_seclen(newkeys->enc.cipher))) ? (dh_need) : (cipher_seclen(newkeys->enc.cipher)));
dh_need = (((dh_need) > (newkeys->enc.block_size)) ? (dh_need) : (newkeys->enc.block_size));
dh_need = (((dh_need) > (newkeys->enc.iv_len)) ? (dh_need) : (newkeys->enc.iv_len));
dh_need = (((dh_need) > (newkeys->mac.key_len)) ? (dh_need) : (newkeys->mac.key_len));
}
kex->we_need = need;
kex->dh_need = dh_need;
if (first_kex_follows && !proposals_match(my, peer))
ssh->dispatch_skip_packets = 1;
r = 0;
out:
kex_prop_free(my);
kex_prop_free(peer);
return r;
}
| int kex_choose_conf(struct_0 *a0) {
unsigned long v0;
unsigned long v1;
unsigned int v2;
unsigned long v3;
char v4;
unsigned int v5;
unsigned long long v6;
unsigned long long v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned int v12;
unsigned int v13;
void* v14;
void* v15;
void* v16;
void* v17;
struct_2 *v18;
void* v19;
unsigned long long v20[7];
unsigned int v23;
unsigned long v24;
v18 = a0->field_8;
v14 = 0;
v15 = 0;
*(&v3) = (!v18->field_18 ? "server" : "client");
sshlog("kex.c", "kex_choose_conf", 0x39e, 0x0, 0x6, 0x0, "local %s KEXINIT proposal");
v8 = kex_buf2prop(v18->field_50, NULL, &v14);
if (!v8) {
v23 = (!v18->field_18 ? "client" : "server");
v3 = v23;
sshlog("kex.c", "kex_choose_conf", 0x3a1, 0x0, 0x6, 0x0, "peer %s KEXINIT proposal");
v8 = kex_buf2prop(v18->field_58, &v4, &v15);
if (!v8) {
if (v18->field_18) {
v16 = v15;
v17 = v14;
} else {
v16 = v14;
v17 = v15;
}
if (v18->field_18 && (v18->field_8c & 2)) {
v19 = match_list("ext-info-c", *(v15), 0x0, 0x0);
v18->field_48 = v19;
free(v19);
}
if (v18->field_18 && (v18->field_8c & 2)) {
if (has_any_alg(v15[8], "rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com"))
v18->field_8c = v18->field_8c | 8;
if (has_any_alg(v15[8], "rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com"))
v18->field_8c = v18->field_8c | 16;
}
v8 = choose_kex(v18, *(v16), *(v17));
if (v8) {
v18->field_98 = *(v15);
*(v15) = 0;
} else {
v8 = choose_hostkeyalg(v18, v16[8], v17[8]);
if (v8) {
v18->field_98 = v15[8];
*(&v15[8]) = 0;
} else {
v5 = 0;
while (true) {
if (v5 > 1) {
v7 = 0;
v6 = v7;
for (v5 = 0; v5 <= 1; v5 += 1) {
v20 = (&v18->field_0)[v5];
v23 = v20->field_14;
if (v20->field_14 <= v6)
v23 = v6;
*(&v6) = v23;
v23 = v20->field_1c;
if (v20->field_1c <= v6)
v23 = v6;
*(&v6) = v23;
v23 = v20->field_18;
if (v20->field_18 <= v6)
v23 = v6;
*(&v6) = v23;
v23 = v20->field_48;
if (v20->field_48 <= v6)
v23 = v6;
v6 = v23;
if (v7 > cipher_seclen(v20->field_8))
v23 = v7;
else
v23 = cipher_seclen(v20->field_8);
*(&v7) = v23;
v23 = v20->field_1c;
if (v20->field_1c <= v7)
v23 = v7;
*(&v7) = v23;
v23 = v20->field_18;
if (v20->field_18 <= v7)
v23 = v7;
*(&v7) = v23;
v23 = v20->field_48;
if (v20->field_48 <= v7)
v23 = v7;
v7 = v23;
}
v18->field_10 = v6;
v18->field_14 = v7;
if (*(&v4) && !proposals_match(v14, v15))
a0->field_838 = 1;
v8 = 0;
break;
} else {
v20[0] = calloc(0x1, 0x78);
if (!v20) {
v8 = -2;
break;
} else {
(&v18->field_0)[v5] = v20;
if (!v18->field_18 && v5 == 1 || v18->field_18 && !v5)
v23 = 1;
else
v23 = 0;
v9 = v23;
v23 = (!v9 ? 2 : 3);
v10 = v23;
v23 = (!v9 ? 4 : 5);
v11 = v23;
v23 = (!v9 ? 6 : 7);
v12 = v23;
v8 = choose_enc(v20, *((v16 + 8 * v10)), *((v17 + 8 * v10)));
if (v8) {
v18->field_98 = *((v15 + 8 * v10));
*((v15 + 8 * v10)) = 0;
break;
} else {
v13 = cipher_authlen(v20[1]);
if (!v13 && (v8 = choose_mac(a0, v20 + 48, *((v16 + 8 * v11)), *((v17 + 8 * v11))), v8)) {
v18->field_98 = *((v15 + 8 * v11));
*((v15 + 8 * v11)) = 0;
break;
} else {
v8 = choose_comp(&v20[1 + 6], *((v16 + 8 * v12)), *((v17 + 8 * v12)));
if (!v8) {
v23 = (!v13 ? "<implicit>" : v20[6]);
v24 = (!v9 ? "client->server" : "server->client");
v2 = v23;
v1 = v20[0];
v0 = v24;
sshlog("kex.c", "kex_choose_conf", 0x3ed, 0x0, 0x5, 0x0, "kex: %s cipher: %s MAC: %s compression: %s");
v5 += 1;
} else {
v18->field_98 = *((v15 + 8 * v12));
*((v15 + 8 * v12)) = 0;
break;
}
}
}
}
}
}
}
}
}
}
kex_prop_free(v14);
kex_prop_free(v15);
return v8;
}
|
static wint_t
collwcsym (s, len)
wchar_t *s;
int len;
{
register struct _collwcsym *csp;
for (csp = posix_collwcsyms; csp->name; csp++)
{
if (((csp->name)[0] == (s)[0] && wcsncmp(csp->name, s, len) == 0) && csp->name[len] == L'\0')
return (csp->code);
}
if (len == 1)
return s[0];
return
(0xffffffffu)
;
}
| int collwcsym(unsigned int *a0, unsigned long a1) {
unsigned long long v1;
unsigned int v2;
v1 = &posix_collwcsyms;
while (true) {
if (*(v1)) {
if (*(*(v1)) == *(a0) && !wcsncmp(*(v1), a0, a1) && !*((*(v1) + (a1 << 2)))) {
v2 = *((v1 + 8));
break;
}
v1 += 16;
} else if (a1 != 1) {
v2 = -1;
break;
} else {
v2 = *(a0);
break;
}
}
return v2;
}
|
int
confirm (const char *message_action, const char *message_name)
{
static FILE *confirm_file;
static int confirm_file_EOF;
_Bool
status =
0
;
if (!confirm_file)
{
if (archive == 0 || stdin_used_by)
{
confirm_file = fopen ("/dev/tty", "r");
if (! confirm_file)
open_fatal ("/dev/tty");
}
else
{
request_stdin ("-w");
confirm_file =
stdin
;
}
}
fprintf (stdlis, "%s %s?", message_action, quote (message_name));
fflush_unlocked (stdlis);
if (!confirm_file_EOF)
{
char *response =
((void *)0)
;
size_t response_size = 0;
if (getline (&response, &response_size, confirm_file) < 0)
confirm_file_EOF = 1;
else
status = rpmatch (response) > 0;
free (response);
}
if (confirm_file_EOF)
{
fputc_unlocked ('\n',stdlis);
fflush_unlocked (stdlis);
}
return status;
}
| long long confirm(unsigned long a0, unsigned long long a1) {
char v0;
void* v1;
void* v2;
unsigned long long v4;
v0 = 0;
if (!confirm_file.7386) {
if (stdin_used_by) {
confirm_file.7386 = fopen("/dev/tty", "r");
if (!confirm_file.7386)
open_fatal("/dev/tty");
}
if (!stdin_used_by || !confirm_file.7386) {
request_stdin("-w");
confirm_file.7386 = stdin;
}
}
fprintf(stdlis, "%s %s?", a0, quote(a1));
fflush_unlocked(stdlis);
if (!confirm_file_EOF.7387) {
v1 = 0;
v2 = 0;
v4 = getline(&v1, &v2, confirm_file.7386);
if (v4 < 0) {
confirm_file_EOF.7387 = 1;
} else {
*(&v4) = rpmatch(v1) > 0;
v0 = *(&v4);
}
free(v1);
}
if (confirm_file_EOF.7387) {
fputc_unlocked(0xa, stdlis);
fflush_unlocked(stdlis);
}
return v0;
}
|
static inline __u8 rta_getattr_u8(const struct rtattr *rta)
{
return *(__u8 *)((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
}
| undefined rta_getattr_u8(long param_1)
{
return *(undefined *)(param_1 + 4);
}
|
test_code_t test_send_record_with_allow_small_records(gnutls_session_t session)
{
int ret;
if (send_record_ok)
return TEST_FAILED;
sprintf(prio_str,
"NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:"
"+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":" "+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH" ":+VKO-GOST-12" ":%%ALLOW_SMALL_RECORDS:%s",
protocol_str, rest);
{ int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 1763)) != TEST_SUCCEED) { return _ret; } };
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
ret = test_do_handshake_and_send_record(session);
if (ret == TEST_SUCCEED)
strcat(rest, ":%ALLOW_SMALL_RECORDS");
return ret;
}
| int test_send_record_with_allow_small_records(undefined8 param_1)
{
int iVar1;
if (send_record_ok == 0) {
sprintf(prio_str,
"NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+ECDHE-RSA:+ECDHE-ECDSA:+ANON-ECDH:+VKO-GOST-12:%%ALLOW_SMALL_RECORDS:%s"
,protocol_str,rest);
iVar1 = __gnutls_priority_set_direct(param_1,prio_str,0x6e3);
if (iVar1 == 0) {
gnutls_credentials_set(param_1,1,xcred);
iVar1 = test_do_handshake_and_send_record(param_1);
if (iVar1 == 0) {
strcat(rest,":%ALLOW_SMALL_RECORDS");
}
}
}
else {
iVar1 = 1;
}
return iVar1;
}
|
timezone_t
tzalloc (char const *name)
{
size_t name_size = name ? strlen (name) + 1 : 0;
size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1;
timezone_t tz = malloc (((
__builtin_offsetof (
struct tm_zone
,
abbrs
)
+ _Alignof (struct tm_zone) - 1 + (abbr_size)) & ~ (_Alignof (struct tm_zone) - 1)));
if (tz)
{
tz->next =
((void *)0)
;
tz->tz_is_set = !!name;
tz->abbrs[0] = '\0';
if (name)
extend_abbrs (tz->abbrs, name, name_size);
}
return tz;
}
| int tzalloc(char *a0) {
void* v0;
unsigned long v1;
struct_0 *v2;
void* v4;
unsigned long long v5;
unsigned long long v6;
if (!a0)
v4 = 0;
else
v4 = strlen(a0) + 1;
v0 = v4;
if (118 <= v0)
v5 = v0;
else
v5 = 118;
v6 = v5 + 1;
v1 = v6;
v2 = malloc(v1 + 16 & -8);
if (v2) {
v2->field_0 = 0;
v2->field_8 = a0;
v2->field_9 = 0;
if (a0)
extend_abbrs(&v2->field_9, a0, v0);
}
return v2;
}
|
SHELL_VAR *
make_local_assoc_variable (name, flags)
char *name;
int flags;
{
SHELL_VAR *var;
HASH_TABLE *hash;
int array_ok;
array_ok = flags & 0x02;
var = make_local_variable (name, flags & 0x04);
if (var == 0 || ((((var)->attributes) & (0x0000040))) || (array_ok && ((((var)->attributes) & (0x0000004)))))
return var;
if (localvar_inherit && ((((var)->attributes) & (0x0000004))))
{
internal_warning (gettext("%s: cannot inherit value from incompatible type"), name);
((var)->attributes &= ~(0x0000004));
dispose_variable_value (var);
hash = (hash_create((1024)));
((var)->value = (char *)(hash));
}
else if (localvar_inherit)
var = convert_var_to_assoc (var);
else
{
dispose_variable_value (var);
hash = (hash_create((1024)));
((var)->value = (char *)(hash));
}
((var)->attributes |= (0x0000040));
return var;
}
| long long make_local_assoc_variable(void* a0, unsigned long a1) {
unsigned int v0;
struct_0 *v1;
unsigned long v2;
struct_0 *v4;
v0 = a1 & 2;
v1 = make_local_variable(a0, a1 & 4);
if (v1 && !(v1->field_28 & 64) && (!v0 || !(v1->field_28 & 4))) {
if (localvar_inherit && (v1->field_28 & 4)) {
internal_warning(gettext("%s: cannot inherit value from incompatible type"), a0);
v1->field_28 = v1->field_28 & -5;
dispose_variable_value(v1);
v2 = hash_create(0x400);
v1->field_8 = v2;
}
if (!(v1->field_28 & 4) || !localvar_inherit) {
if (localvar_inherit) {
v1 = convert_var_to_assoc(v1);
} else {
dispose_variable_value(v1);
v2 = hash_create(0x400);
v1->field_8 = v2;
}
}
v1->field_28 = v1->field_28 | 64;
v4 = v1;
}
if (!v1 || (v1->field_28 & 64) || v0 && (v1->field_28 & 4))
v4 = v1;
return v4;
}
|
const char *
errmsg(int e, int action)
{
if (e !=
2
&& e !=
20
)
return strerror(e);
if (action & 01)
return "No such file";
else if (action & 02)
return "Directory nonexistent";
else
return "not found";
}
| char * errmsg(int param_1,uint param_2)
{
char *pcVar1;
if ((param_1 == 2) || (param_1 == 0x14)) {
if ((param_2 & 1) == 0) {
if ((param_2 & 2) == 0) {
pcVar1 = "not found";
}
else {
pcVar1 = "Directory nonexistent";
}
}
else {
pcVar1 = "No such file";
}
}
else {
pcVar1 = strerror(param_1);
}
return pcVar1;
}
|
int
mm_is_monitor(void)
{
return (pmonitor && pmonitor->m_pid > 0);
}
| _BOOL8 mm_is_monitor()
{
return pmonitor && *(int *)(pmonitor + 24LL) > 0;
}
|
static int
get_list(bitstr_t * bits, int low, int high, const char *names[],
int ch, FILE * file) {
int done;
if ((DebugFlags & (0x0008 | 0x0001)) != 0) printf ("get_list()...entered\n");
{ register bitstr_t *_name = bits; register int _start = 0, _stop = (high - low); register int _startbyte = ((_start) >> 3); register int _stopbyte = ((_stop) >> 3); if (_startbyte == _stopbyte) { _name[_startbyte] &= (bitstr_t)((0xff >> (8 - (_start&0x7))) | (0xff << ((_stop&0x7) + 1))); } else { _name[_startbyte] &= (bitstr_t)(0xff >> (8 - (_start&0x7))); while (++_startbyte < _stopbyte) _name[_startbyte] = 0; _name[_stopbyte] &= (bitstr_t)(0xff << ((_stop&0x7) + 1)); } };
done = 0;
unget_char(ch, file);
while (!done) {
if (
(-1)
== (ch = get_range(bits, low, high, names, file)))
return (
(-1)
);
if (ch == ',')
continue;
else
done = 1;
}
while (ch!='\t' && ch!=' ' && ch!='\n' && ch !=
(-1)
) ch = get_char(file);
while (ch == '\t' || ch == ' ') ch = get_char(file);
if ((DebugFlags & (0x0008 | 0x0001)) != 0) printf ("get_list()...exiting w/ %02x\n", ch);
return (ch);
}
| int get_list(char *a0, unsigned long a1, unsigned long a2, unsigned long long a3, unsigned long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
unsigned int v4;
v0 = a4;
if ((DebugFlags & 9))
printf("get_list()...entered\n");
if (!(a2 - a1 >> 3)) {
*(a0) = *(a0) & (255 << (((a2 - a1 & 7) + 1) & 31));
} else {
for (*(a0) = 0; 1 < (a2 - a1 >> 3); a0[1] = 0);
a0[a2 - a1 >> 3] = a0[a2 - a1 >> 3] & (255 << (((a2 - a1 & 7) + 1) & 31));
}
v1 = 0;
unget_char(v0, a5, a5);
while (true) {
if (!v1) {
v0 = get_range(a0, a1, a2, a3, a5);
if (v0 == -1) {
v4 = -1;
break;
} else {
if (v0 == 44)
continue;
v1 = 1;
}
} else {
for (; v0 != 9; v0 = get_char(a5)) {
if (v0 == 32)
break;
if (v0 != 32) {
if (v0 == 10)
break;
if (v0 != 10) {
if (v0 == -1)
break;
}
}
}
while (true) {
if (v0 != 9) {
if (v0 != 32)
break;
}
v0 = get_char(a5);
}
if ((DebugFlags & 9))
printf("get_list()...exiting w/ %02x\n", v0);
v4 = v0;
break;
}
}
return v4;
}
|
static int
gcd(int a, int b)
{
int c;
c = a % b;
while (c != 0) {
a = b;
b = c;
c = a % b;
}
return (b);
}
| long gcd(int a1, signed int a2)
{
unsigned int v3;
signed int v4;
int i;
v3 = a2;
for ( i = a1 % a2; i; i = v4 % i )
{
v4 = v3;
v3 = i;
}
return v3;
}
|
int
hashcmd(int argc, char **argv)
{
struct tblentry **pp;
struct tblentry *cmdp;
int c;
struct cmdentry entry;
char *name;
while ((c = nextopt("r")) != '\0') {
clearcmdentry();
return 0;
}
if (*argptr ==
((void *)0)
) {
for (pp = cmdtable ; pp < &cmdtable[31] ; pp++) {
for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
if (cmdp->cmdtype == 0)
printentry(cmdp);
}
}
return 0;
}
c = 0;
while ((name = *argptr) !=
((void *)0)
) {
if ((cmdp = cmdlookup(name, 0)) &&
(cmdp->cmdtype == 0 ||
(cmdp->cmdtype == 2 &&
!(cmdp->param.cmd->flags & 0x2) &&
builtinloc > 0)))
delete_cmd_entry();
find_command(name, &entry, 0x01, ((&(&(&varinit[0])[1])[1])[1].text + 5));
if (entry.cmdtype == -1)
c = 1;
argptr++;
}
return c;
}
| long long hashcmd(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
unsigned long long v3;
struct_2 *v4;
char *v5;
char v6;
void* v8;
v1 = a0;
v0 = a1;
v2 = nextopt("r");
if (v2) {
clearcmdentry();
v8 = 0;
} else if (!*(argptr)) {
for (v3 = &cmdtable; v3 < "%s: %s"; v3 += 8) {
for (v4 = *(v3); v4; v4 = v4->field_0) {
if (!v4->field_10)
printentry(v4);
}
}
v8 = 0;
} else {
v2 = 0;
while (true) {
v5 = *(argptr);
if (!v5)
break;
v4 = cmdlookup(v5, 0x0);
if (v4) {
if (v4->field_10) {
if (!(v4->field_10 == 2))
goto LABEL_4005ec;
if (!(!(v4->field_8->field_10 & 2)))
goto LABEL_4005ec;
if (builtinloc <= 0)
goto LABEL_4005ec;
}
delete_cmd_entry();
}
LABEL_4005ec:
find_command(v5, &v6, 0x1, onint + 5);
if (*(&v6) == -1)
v2 = 1;
argptr = argptr + 8;
}
v8 = v2;
}
return v8;
}
|
void
unwind_protect_mem (var, size)
char *var;
int size;
{
without_interrupts (unwind_protect_mem_internal, var, (char *) &size);
}
| long long unwind_protect_mem(unsigned long long a0, unsigned long a1) {
unsigned int v0;
v0 = a1;
return without_interrupts(unwind_protect_mem_internal, a0, &a1);
}
|
static void int32_divmod_uint14(crypto_int32 *q,crypto_uint16 *r,crypto_int32 x,crypto_uint16 m)
{
crypto_uint32 uq,uq2;
crypto_uint16 ur,ur2;
crypto_uint32 mask;
uint32_divmod_uint14(&uq,&ur,0x80000000+(crypto_uint32)x,m);
uint32_divmod_uint14(&uq2,&ur2,0x80000000,m);
ur -= ur2; uq -= uq2;
mask = -(crypto_uint32)(ur>>15);
ur += mask&m; uq += mask;
*r = ur; *q = uq;
}
| unsigned long int32_divmod_uint14(_DWORD *a1, unsigned short *a2, int a3, unsigned short a4)
{
unsigned short v6;
short v7;
int v8;
int v9;
int v10;
unsigned long v11;
v11 = __readfsqword(0x28u);
uint32_divmod_uint14(&v8, &v6, a3 + 0x80000000, a4);
uint32_divmod_uint14(&v9, &v7, 0x80000000, a4);
v6 -= v7;
v8 -= v9;
v10 = -(v6 >> 15);
v6 += a4 & -(v6 >> 15);
v8 += v10;
*a2 = v6;
*a1 = v8;
return __readfsqword(0x28u) ^ v11;
}
|
static void
terminal_reset_arrow(EditLine *el)
{
funckey_t *arrow = el->el_terminal.t_fkey;
static const wchar_t strA[] = L"\033[A";
static const wchar_t strB[] = L"\033[B";
static const wchar_t strC[] = L"\033[C";
static const wchar_t strD[] = L"\033[D";
static const wchar_t strH[] = L"\033[H";
static const wchar_t strF[] = L"\033[F";
static const wchar_t stOA[] = L"\033OA";
static const wchar_t stOB[] = L"\033OB";
static const wchar_t stOC[] = L"\033OC";
static const wchar_t stOD[] = L"\033OD";
static const wchar_t stOH[] = L"\033OH";
static const wchar_t stOF[] = L"\033OF";
keymacro_add(el, strA, &arrow[1].fun, arrow[1].type);
keymacro_add(el, strB, &arrow[0].fun, arrow[0].type);
keymacro_add(el, strC, &arrow[3].fun, arrow[3].type);
keymacro_add(el, strD, &arrow[2].fun, arrow[2].type);
keymacro_add(el, strH, &arrow[4].fun, arrow[4].type);
keymacro_add(el, strF, &arrow[5].fun, arrow[5].type);
keymacro_add(el, stOA, &arrow[1].fun, arrow[1].type);
keymacro_add(el, stOB, &arrow[0].fun, arrow[0].type);
keymacro_add(el, stOC, &arrow[3].fun, arrow[3].type);
keymacro_add(el, stOD, &arrow[2].fun, arrow[2].type);
keymacro_add(el, stOH, &arrow[4].fun, arrow[4].type);
keymacro_add(el, stOF, &arrow[5].fun, arrow[5].type);
if (el->el_map.type != 1)
return;
keymacro_add(el, &strA[1], &arrow[1].fun, arrow[1].type);
keymacro_add(el, &strB[1], &arrow[0].fun, arrow[0].type);
keymacro_add(el, &strC[1], &arrow[3].fun, arrow[3].type);
keymacro_add(el, &strD[1], &arrow[2].fun, arrow[2].type);
keymacro_add(el, &strH[1], &arrow[4].fun, arrow[4].type);
keymacro_add(el, &strF[1], &arrow[5].fun, arrow[5].type);
keymacro_add(el, &stOA[1], &arrow[1].fun, arrow[1].type);
keymacro_add(el, &stOB[1], &arrow[0].fun, arrow[0].type);
keymacro_add(el, &stOC[1], &arrow[3].fun, arrow[3].type);
keymacro_add(el, &stOD[1], &arrow[2].fun, arrow[2].type);
keymacro_add(el, &stOH[1], &arrow[4].fun, arrow[4].type);
keymacro_add(el, &stOF[1], &arrow[5].fun, arrow[5].type);
}
| void terminal_reset_arrow(struct_0 *a0) {
unsigned int v0[47];
unsigned long long v2;
unsigned long long v3;
*(&v0[0]) = a0->field_c8;
keymacro_add(a0, &strA.7375, &v0[12], v0[14]);
keymacro_add(a0, &strB.7376, &v0[4], v0[6]);
keymacro_add(a0, &strC.7377, &v0[28], v0[30]);
keymacro_add(a0, &strD.7378, &v0[20], v0[22]);
keymacro_add(a0, &strH.7379, &v0[98120979115476337 + 29], v0[98120979115476337 + 27]);
keymacro_add(a0, &strF.7380, &v0[44], v0[46]);
keymacro_add(a0, &stOA.7381, &v0[12], v0[14]);
keymacro_add(a0, &stOB.7382, &v0[4], v0[6]);
keymacro_add(a0, &stOC.7383, &v0[28], v0[30]);
keymacro_add(a0, &stOD.7384, &v0[20], v0[22]);
keymacro_add(a0, &stOH.7385, &v0[98120979115476337 + 29], v0[98120979115476337 + 27]);
keymacro_add(a0, &stOF.7386, &v0[44], v0[46]);
v2 = a0->field_420;
if (a0->field_420 == 1) {
keymacro_add(a0, "[", &v0[12], v0[14]);
keymacro_add(a0, "[", &v0[4], v0[6]);
keymacro_add(a0, "[", &v0[28], v0[30]);
keymacro_add(a0, "[", &v0[20], v0[22]);
keymacro_add(a0, "[", &v0[98120979115476337 + 29], v0[98120979115476337 + 27]);
keymacro_add(a0, "[", &v0[44], v0[46]);
keymacro_add(a0, "O", &v0[12], v0[14]);
keymacro_add(a0, "O", &v0[4], v0[6]);
keymacro_add(a0, "O", &v0[28], v0[30]);
keymacro_add(a0, "O", &v0[20], v0[22]);
keymacro_add(a0, "O", &v0[98120979115476337 + 29], v0[98120979115476337 + 27]);
v3 = keymacro_add(a0, "O", &v0[44], v0[46]);
}
return;
}
|
int
wmatchlen (pat, max)
wchar_t *pat;
size_t max;
{
wchar_t c;
int matlen, bracklen, t, in_cclass, in_collsym, in_equiv;
if (*pat == 0)
return (0);
matlen = in_cclass = in_collsym = in_equiv = 0;
while (c = *pat++)
{
switch (c)
{
default:
matlen++;
break;
case L'\\':
if (*pat == 0)
return ++matlen;
else
{
matlen++;
pat++;
}
break;
case L'?':
if (*pat == L'(')
return (matlen = -1);
else
matlen++;
break;
case L'*':
return (matlen = -1);
case L'+':
case L'!':
case L'@':
if (*pat == L'(')
return (matlen = -1);
else
matlen++;
break;
case L'[':
bracklen = 1;
c = *pat++;
do
{
if (c == 0)
{
pat--;
matlen += bracklen;
goto bad_bracket;
}
else if (c == L'\\')
{
bracklen++;
if (*pat == 0 || *++pat == 0)
{
matlen += bracklen;
goto bad_bracket;
}
}
else if (c == L'[' && *pat == L':')
{
pat++;
bracklen++;
in_cclass = 1;
}
else if (in_cclass && c == L':' && *pat == L']')
{
pat++;
bracklen++;
in_cclass = 0;
}
else if (c == L'[' && *pat == L'.')
{
pat++;
bracklen++;
if (*pat == L']')
{
pat++;
bracklen++;
}
in_collsym = 1;
}
else if (in_collsym && c == L'.' && *pat == L']')
{
pat++;
bracklen++;
in_collsym = 0;
}
else if (c == L'[' && *pat == L'=')
{
pat++;
bracklen++;
if (*pat == L']')
{
pat++;
bracklen++;
}
in_equiv = 1;
}
else if (in_equiv && c == L'=' && *pat == L']')
{
pat++;
bracklen++;
in_equiv = 0;
}
else
bracklen++;
}
while ((c = *pat++) != L']');
matlen++;
bad_bracket:
break;
}
}
return matlen;
}
| int wmatchlen(int *param_1)
{
int iVar1;
bool bVar2;
bool bVar3;
bool bVar4;
int *piVar5;
int *local_30;
int local_20;
int local_1c;
int local_18;
if (*param_1 == 0) {
local_1c = 0;
}
else {
bVar4 = false;
bVar3 = false;
bVar2 = false;
local_1c = 0;
local_30 = param_1;
LAB_00100b8b:
piVar5 = local_30 + 1;
iVar1 = *local_30;
if (iVar1 != 0) {
if (iVar1 == 0x5c) {
if (*piVar5 == 0) {
return local_1c + 1;
}
local_1c = local_1c + 1;
local_30 = local_30 + 2;
goto LAB_00100b8b;
}
if (iVar1 < 0x5d) {
if (0x40 < iVar1) {
if (iVar1 != 0x5b) goto switchD_00100963_caseD_22;
local_18 = 1;
local_20 = *piVar5;
local_30 = local_30 + 2;
do {
if (local_20 == 0) {
local_1c = local_1c + local_18;
local_30 = local_30 + -1;
goto LAB_00100b8b;
}
if (local_20 == 0x5c) {
local_18 = local_18 + 1;
if ((*local_30 == 0) || (local_30 = local_30 + 1, *local_30 == 0)) {
local_1c = local_1c + local_18;
goto LAB_00100b8b;
}
}
else if ((local_20 == 0x5b) && (*local_30 == 0x3a)) {
local_30 = local_30 + 1;
local_18 = local_18 + 1;
bVar2 = true;
}
else if ((bVar2) && ((local_20 == 0x3a && (*local_30 == 0x5d)))) {
local_30 = local_30 + 1;
local_18 = local_18 + 1;
bVar2 = false;
}
else if ((local_20 == 0x5b) && (*local_30 == 0x2e)) {
piVar5 = local_30 + 1;
iVar1 = local_18 + 1;
if (local_30[1] == 0x5d) {
piVar5 = local_30 + 2;
iVar1 = local_18 + 2;
}
local_18 = iVar1;
local_30 = piVar5;
bVar3 = true;
}
else if (((bVar3) && (local_20 == 0x2e)) && (*local_30 == 0x5d)) {
local_30 = local_30 + 1;
local_18 = local_18 + 1;
bVar3 = false;
}
else if ((local_20 == 0x5b) && (*local_30 == 0x3d)) {
piVar5 = local_30 + 1;
iVar1 = local_18 + 1;
if (local_30[1] == 0x5d) {
piVar5 = local_30 + 2;
iVar1 = local_18 + 2;
}
local_18 = iVar1;
local_30 = piVar5;
bVar4 = true;
}
else if ((bVar4) && ((local_20 == 0x3d && (*local_30 == 0x5d)))) {
local_30 = local_30 + 1;
local_18 = local_18 + 1;
bVar4 = false;
}
else {
local_18 = local_18 + 1;
}
piVar5 = local_30 + 1;
local_20 = *local_30;
local_30 = piVar5;
} while (local_20 != 0x5d);
local_1c = local_1c + 1;
goto LAB_00100b8b;
}
if (iVar1 < 0x21) goto switchD_00100963_caseD_22;
switch(iVar1) {
case 0x21:
case 0x2b:
case 0x40:
if (*piVar5 == 0x28) {
return -1;
}
local_1c = local_1c + 1;
local_30 = piVar5;
goto LAB_00100b8b;
case 0x2a:
return -1;
case 0x3f:
if (*piVar5 == 0x28) {
return -1;
}
local_1c = local_1c + 1;
local_30 = piVar5;
goto LAB_00100b8b;
}
}
switchD_00100963_caseD_22:
local_1c = local_1c + 1;
local_30 = piVar5;
goto LAB_00100b8b;
}
}
return local_1c;
}
|
do { char *old_locale = setlocale (
6
,
((void *)0)
); char *saved_locale =
((void *)0)
; if (
((void *)0)
!= old_locale) { saved_locale = strdup (old_locale); } if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, "C"); } syslog (
3
, "failed to unlock %s", pw_dbname ()) ; if (
((void *)0)
!= saved_locale) { (void) setlocale (
6
, saved_locale); free (saved_locale); } } while (
| char * setlocale(int __category,char *__locale)
{
halt_baddata();
}
|
Channel *
channel_by_remote_id(struct ssh *ssh, u_int remote_id)
{
Channel *c;
u_int i;
for (i = 0; i < ssh->chanctxt->channels_alloc; i++) {
c = ssh->chanctxt->channels[i];
if (c !=
((void *)0)
&& c->have_remote_id && c->remote_id == remote_id)
return c;
}
return
((void *)0)
;
}
| long channel_by_remote_id(long param_1,int param_2)
{
long lVar1;
uint local_14;
local_14 = 0;
while( true ) {
if (*(uint *)(*(long *)(param_1 + 0x868) + 8) <= local_14) {
return 0;
}
lVar1 = *(long *)(**(long **)(param_1 + 0x868) + (ulong)local_14 * 8);
if (((lVar1 != 0) && (*(int *)(lVar1 + 0xc) != 0)) && (param_2 == *(int *)(lVar1 + 8))) break;
local_14 = local_14 + 1;
}
return lVar1;
}
|
static
_Bool
millerrabin (uintmax_t n, uintmax_t ni, uintmax_t b, uintmax_t q,
unsigned int k, uintmax_t one)
{
uintmax_t y = powm (b, q, n, ni, one);
uintmax_t nm1 = n - one;
if (y == one || y == nm1)
return
1
;
for (unsigned int i = 1; i < k; i++)
{
y = mulredc (y, y, n, ni);
if (y == nm1)
return
1
;
if (y == one)
return
0
;
}
return
0
;
}
| undefined8
millerrabin(long param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,uint param_5,
long param_6)
{
undefined8 uVar1;
uint local_1c;
long local_18;
local_18 = powm(param_3,param_4,param_1,param_2,param_6);
if ((local_18 == param_6) || (local_18 == param_1 - param_6)) {
uVar1 = 1;
}
else {
for (local_1c = 1; local_1c < param_5; local_1c = local_1c + 1) {
local_18 = mulredc(local_18,local_18,param_1,param_2);
if (local_18 == param_1 - param_6) {
return 1;
}
if (local_18 == param_6) {
return 0;
}
}
uVar1 = 0;
}
return uVar1;
}
|
int
sshpkt_get_u64(struct ssh *ssh, u_int64_t *valp)
{
return sshbuf_get_u64(ssh->state->incoming_packet, valp);
}
| long sshpkt_get_u64(long a1, long a2)
{
return sshbuf_get_u64(*(_QWORD *)(*(_QWORD *)a1 + 56LL), a2);
}
|
static void
exverror(int cond, const char *msg, va_list ap)
{
exvwarning2(msg, ap);
flushall();
exraise(cond);
}
| void exverror(unsigned long long a0) {
char v0;
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
exvwarning2(v2, v3);
flushall(a0, v2, v3, v4, v5, v6, *(&v0), v1);
exraise(a0);
}
|
static
void do_power_fail(int pwrstat)
{
CHILD *ch;
for (ch = family; ch; ch = ch->next) {
if (pwrstat == 'O') {
if (ch->action == 8)
ch->flags &= ~128;
} else if (pwrstat == 'L') {
if (ch->action == 14)
ch->flags &= ~128;
} else {
if (ch->action == 6 || ch->action == 7)
ch->flags &= ~128;
}
}
}
| void do_power_fail(unsigned long a0) {
struct_0 *v0;
unsigned long long v2;
unsigned long long v3;
v2 = family;
v0 = family;
while (true) {
if (!v0)
break;
if (a0 == 79) {
if (v0->field_30 == 8) {
*(&v2) = v0->field_0;
*(&v2) = v0->field_0 & 127;
v0->field_0 = v2;
}
} else {
if (a0 != 76) {
if (v0->field_30 != 6 && !(v0->field_30 == 7))
goto LABEL_404847;
*(&v2) = v0->field_0;
*(&v2) = v0->field_0 & 127;
v0->field_0 = v2;
} else if (v0->field_30 == 14) {
*(&v2) = v0->field_0;
*(&v2) = v0->field_0 & 127;
v0->field_0 = v2;
}
}
LABEL_404847:
v3 = v0->field_c0;
v0 = v0->field_c0;
}
return;
}
|
static rsRetVal
TCPSendBufCompressed(wrkrInstanceData_t *pWrkrData, uchar *buf, unsigned len, sbool bIsFlush)
{
int zRet;
unsigned outavail;
uchar zipBuf[32*1024];
int op;
rsRetVal iRet = RS_RET_OK;
if(!pWrkrData->bzInitDone) {
pWrkrData->zstrm.zalloc =
0
;
pWrkrData->zstrm.zfree =
0
;
pWrkrData->zstrm.opaque =
0
;
zRet =
deflateInit_((
&pWrkrData->zstrm
), (
pWrkrData->pData->compressionLevel
), "1.2.11", (int)sizeof(z_stream))
;
if(zRet !=
0
) {
if(Debug) { r_dbgprintf("omfwd.c", "error %d returned from zlib/deflateInit()\n", zRet); };
do { iRet = RS_RET_ZLIB_ERR; goto finalize_it; } while (0);
}
pWrkrData->bzInitDone = 1;
}
pWrkrData->zstrm.next_in = (Bytef*) buf;
pWrkrData->zstrm.avail_in = len;
if(pWrkrData->pData->strmCompFlushOnTxEnd && bIsFlush)
op =
2
;
else
op =
0
;
do {
if(Debug) { r_dbgprintf("omfwd.c", "omfwd: in deflate() loop, avail_in %d, total_in %ld, isFlush %d\n", pWrkrData->zstrm.avail_in, pWrkrData->zstrm.total_in, bIsFlush); }
;
pWrkrData->zstrm.avail_out = sizeof(zipBuf);
pWrkrData->zstrm.next_out = zipBuf;
zRet = deflate(&pWrkrData->zstrm, op);
if(Debug) { r_dbgprintf("omfwd.c", "after deflate, ret %d, avail_out %d\n", zRet, pWrkrData->zstrm.avail_out); };
outavail = sizeof(zipBuf) - pWrkrData->zstrm.avail_out;
if(outavail != 0) {
if((iRet = TCPSendBufUncompressed(pWrkrData, zipBuf, outavail)) != RS_RET_OK) goto finalize_it;
}
} while (pWrkrData->zstrm.avail_out == 0);
finalize_it:
return iRet;
}
| int TCPSendBufCompressed(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
char v4;
char v5;
unsigned long long v6;
unsigned long v7;
unsigned long long *v9;
do {
v6 = v6;
} while (&v6 != &v5);
v7 = v9[5];
v1 = 0;
if (!a0->field_38) {
a0->field_80 = 0;
a0->field_88 = 0;
a0->field_90 = 0;
v2 = deflateInit_(&a0->field_40, a0->field_0->field_68, "1.2.11", 0x70);
if (!v2) {
a0->field_38 = 1;
} else {
if (*(&Debug))
r_dbgprintf("omfwd.c", "error %d returned from zlib/deflateInit()\n");
v1 = -2141;
goto LABEL_401250;
}
}
a0->field_40 = a1;
a0->field_48 = a2;
if (a0->field_0->field_d4 && a3) {
v0 = 2;
goto LABEL_40112e;
}
v0 = 0;
do {
LABEL_40112e:
if (*(&Debug))
r_dbgprintf("omfwd.c", "omfwd: in deflate() loop, avail_in %d, total_in %ld, isFlush %d\n");
a0->field_60 = 0x8000;
a0->field_58 = &v4;
v2 = deflate(&a0->field_40, v0, &a0->field_40);
if (*(&Debug))
r_dbgprintf("omfwd.c", "after deflate, ret %d, avail_out %d\n");
v3 = 0x8000 - a0->field_60;
if (!v3)
continue;
v1 = TCPSendBufUncompressed(a0, &v4, v3);
if (v1)
break;
continue;
} while (!a0->field_60);
LABEL_401250:
if (!(v7 ^ v9[5]))
return v1;
__stack_chk_fail();
}
|
static int
history_load(HistoryW *h, const char *fname)
{
FILE *fp;
char *line;
size_t llen;
ssize_t sz;
size_t max_size;
char *ptr;
int i = -1;
HistEventW ev;
wchar_t *decode_result;
static ct_buffer_t conv;
if ((fp = fopen(fname, "r")) ==
((void *)0)
)
return i;
line =
((void *)0)
;
llen = 0;
if ((sz = getline(&line, &llen, fp)) == -1)
goto done;
if (strncmp(line, hist_cookie, (size_t)sz) != 0)
goto done;
ptr = malloc((max_size = 1024) * sizeof(*ptr));
if (ptr ==
((void *)0)
)
goto done;
for (i = 0; (sz = getline(&line, &llen, fp)) != -1; i++) {
if (sz > 0 && line[sz - 1] == '\n')
line[--sz] = '\0';
if (max_size < (size_t)sz) {
char *nptr;
max_size = ((size_t)sz + 1024) & (size_t)~1023;
nptr = realloc((ptr), (max_size * sizeof(*ptr)));
if (nptr ==
((void *)0)
) {
i = -1;
goto oomem;
}
ptr = nptr;
}
(void) strunvis(ptr, line);
decode_result = ct_decode_string(ptr, &conv);
if (decode_result ==
((void *)0)
)
continue;
if ((*(h)->h_enter)((h)->h_ref, &ev, decode_result) == -1) {
i = -1;
goto oomem;
}
}
oomem:
free(ptr);
done:
free(line);
(void) fclose(fp);
return i;
}
| int history_load(unsigned long long a0[11], char *a1) {
unsigned int v0;
void* v1;
void* v2;
void* v3;
unsigned long long v4;
void* v5;
void* v6;
void* v7;
unsigned long long v8;
char v9;
unsigned int v11;
v0 = -1;
v6 = fopen(a1, "r");
if (!v6) {
v11 = v0;
return v11;
}
v1 = 0;
v2 = 0;
*(&v3) = getline(&v1, &v2, v6);
if (*(&v3) != -1 && !strncmp(v1, "_HiStOrY_V2_\n", *(&v3))) {
v4 = 0x400;
v5 = malloc(0x400);
if (v5) {
v0 = 0;
while (true) {
v3 = getline(&v1, &v2, v6);
if (v3 == -1)
break;
if (v3 > 0 && *((v1 + v3 - 1)) == 10) {
v3 -= 1;
*((v3 + v1)) = 0;
}
if (v4 < v3) {
*(&v4) = v3 + 0x400 & -0x400;
v7 = realloc(v5, *(&v4));
if (v7) {
v5 = v7;
} else {
v0 = -1;
break;
}
}
strunvis(v5, v1, v1);
v8 = ct_decode_string(v5, &conv.4127);
if (!v8 || a0[10](a0[0], &v9, v8, &v9, a0[10]) != -1) {
v0 += 1;
} else {
v0 = -1;
break;
}
}
free(v5);
}
}
free(v1);
fclose(v6);
v11 = v0;
return v11;
}
|
void
builtin_warning (const char *format, ...)
{
va_list args;
builtin_error_prolog ();
fprintf (
stderr
, gettext("warning: "));
__builtin_va_start(
args
,
format
)
;
vfprintf (
stderr
, format, args);
__builtin_va_end(
args
)
;
fprintf (
stderr
, "\n");
}
| void builtin_warning(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
char *param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12,
undefined8 param_13,undefined8 param_14)
{
char in_AL;
char *__format;
long in_FS_OFFSET;
undefined4 local_d8;
undefined4 local_d4;
undefined *local_d0;
undefined *local_c8;
long local_c0;
undefined local_b8 [8];
undefined8 local_b0;
undefined8 local_a8;
undefined8 local_a0;
undefined8 local_98;
undefined8 local_90;
undefined4 local_88;
undefined4 local_78;
undefined4 local_68;
undefined4 local_58;
undefined4 local_48;
undefined4 local_38;
undefined4 local_28;
undefined4 local_18;
if (in_AL != '\0') {
local_88 = param_1;
local_78 = param_2;
local_68 = param_3;
local_58 = param_4;
local_48 = param_5;
local_38 = param_6;
local_28 = param_7;
local_18 = param_8;
}
local_c0 = *(long *)(in_FS_OFFSET + 0x28);
local_b0 = param_10;
local_a8 = param_11;
local_a0 = param_12;
local_98 = param_13;
local_90 = param_14;
builtin_error_prolog();
__format = (char *)gettext("warning: ");
fprintf(stderr,__format);
local_d8 = 8;
local_d4 = 0x30;
local_d0 = &stack0x00000008;
local_c8 = local_b8;
vfprintf(stderr,param_9,&local_d8);
fprintf(stderr,"\n");
if (local_c0 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
specify_sort_size (int oi, char c, char const *s)
{
uintmax_t n;
char *suffix;
enum strtol_error e = xstrtoumax (s, &suffix, 10, &n, "EgGkKmMPtTYZ");
if (e == LONGINT_OK && ((unsigned int) (suffix[-1]) - '0' <= 9))
{
if (n <=
(18446744073709551615UL)
/ 1024)
n *= 1024;
else
e = LONGINT_OVERFLOW;
}
if (e == LONGINT_INVALID_SUFFIX_CHAR && ((unsigned int) (suffix[-1]) - '0' <= 9) && ! suffix[1])
switch (suffix[0])
{
case 'b':
e = LONGINT_OK;
break;
case '%':
{
double mem = physmem_total () * n / 100;
if (mem <
(18446744073709551615UL)
)
{
n = mem;
e = LONGINT_OK;
}
else
e = LONGINT_OVERFLOW;
}
break;
}
if (e == LONGINT_OK)
{
if (n < sort_size)
return;
sort_size = n;
if (sort_size == n)
{
sort_size =
(((
sort_size
)>(
(nmerge * (2 + sizeof (struct line)))
))?(
sort_size
):(
(nmerge * (2 + sizeof (struct line)))
))
;
return;
}
e = LONGINT_OVERFLOW;
}
xstrtol_fatal (e, oi, c, long_options, s);
}
| void specify_sort_size(unsigned long a0, unsigned long a1, unsigned long long a2) {
unsigned int v0;
unsigned long long v1;
char v2;
unsigned long v3;
char v4;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v11;
unsigned long long *v12;
unsigned long long v13;
v0 = xstrtoumax(a2, &v2, 0xa, &v1, "EgGkKmMPtTYZ");
if (!v0 && *((*(&v2) - 1)) - 48 <= 9) {
if (v1 > 18014398509481983)
v0 = 1;
else
v1 *= 0x400;
}
if (!(v0 != 2 || *((*(&v2) - 1)) - 48 > 9 || *((*(&v2) + 1)))) {
if (*(*(&v2)) == 37) {
physmem_total();
v8 = v7;
if (v1 >= 0) {
v7 = v1;
} else {
v9 = v1 >> 1 | v1 & 1;
v7 = reg_224 * 2;
}
v7 = v7 * v8 / 0x4059000000000000;
v3 = v7;
if ((((BinaryOp CmpF & 69) | ((BinaryOp CmpF & 69) >> 6)) & 1) == 1) {
v0 = 1;
} else {
*(&v1) = ((BinaryOp CmpF & 69 & 1) ? v3 - 0x43e0000000000000 ^ 0x8000000000000000 : v3);
v0 = 0;
}
} else if (*(*(&v2)) == 98) {
v0 = 0;
}
}
if (v0)
xstrtol_fatal(v0, a0, a1, &long_options, a2);
if (v1 >= sort_size) {
sort_size = v1;
if (sort_size != v1) {
v0 = 1;
xstrtol_fatal(v0, a0, a1, &long_options, a2);
}
v11 = sort_size;
if ((nmerge << 4) + nmerge <= (nmerge << 4) + nmerge)
v11 = nmerge * 34;
sort_size = v11;
}
v13 = *(&v4) ^ v12[5];
return;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.