input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
int
mm_answer_keyverify(struct ssh *ssh, int sock, struct sshbuf *m)
{
struct sshkey *key;
const u_char *signature, *data, *blob;
char *sigalg =
((void *)0)
, *fp =
((void *)0)
;
size_t signaturelen, datalen, bloblen;
int r, ret, req_presence = 0, req_verify = 0, valid_data = 0;
int encoded_ret;
struct sshkey_sig_details *sig_details =
((void *)0)
;
if ((r = sshbuf_get_string_direct(m, &blob, &bloblen)) != 0 ||
(r = sshbuf_get_string_direct(m, &signature, &signaturelen)) != 0 ||
(r = sshbuf_get_string_direct(m, &data, &datalen)) != 0 ||
(r = sshbuf_get_cstring(m, &sigalg,
((void *)0)
)) != 0)
sshfatal("monitor.c", __func__, 1407, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
if (hostbased_cuser ==
((void *)0)
|| hostbased_chost ==
((void *)0)
||
!monitor_allowed_key(blob, bloblen))
sshfatal("monitor.c", __func__, 1411, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bad key, not previously allowed");
if (*sigalg == '\0') {
free(sigalg);
sigalg =
((void *)0)
;
}
if ((r = sshkey_from_blob(blob, bloblen, &key)) != 0)
sshfatal("monitor.c", __func__, 1421, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse key");
switch (key_blobtype) {
case MM_USERKEY:
valid_data = monitor_valid_userblob(ssh, data, datalen);
auth_method = "publickey";
break;
case MM_HOSTKEY:
valid_data = monitor_valid_hostbasedblob(data, datalen,
hostbased_cuser, hostbased_chost);
auth_method = "hostbased";
break;
default:
valid_data = 0;
break;
}
if (!valid_data)
sshfatal("monitor.c", __func__, 1438, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bad %s signature data blob", key_blobtype == MM_USERKEY ? "userkey" : (key_blobtype == MM_HOSTKEY ? "hostkey" : "unknown"))
;
if ((fp = sshkey_fingerprint(key, options.fingerprint_hash,
SSH_FP_DEFAULT)) ==
((void *)0)
)
sshfatal("monitor.c", __func__, 1444, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshkey_fingerprint failed");
ret = sshkey_verify(key, signature, signaturelen, data, datalen,
sigalg, ssh->compat, &sig_details);
sshlog("monitor.c", __func__, 1448, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "%s %s signature using %s %s%s%s", auth_method, sshkey_type(key), sigalg ==
((void *)0)
? "default" : sigalg, (ret == 0) ? "verified" : "unverified", (ret != 0) ? ": " : "", (ret != 0) ? ssh_err(ret) : "")
;
if (ret == 0 && key_blobtype == MM_USERKEY && sig_details !=
((void *)0)
) {
req_presence = (options.pubkey_auth_options &
(1)) ||
!key_opts->no_require_user_presence;
if (req_presence &&
(sig_details->sk_flags & 0x01) == 0) {
sshlog("monitor.c", __func__, 1459, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "public key %s %s signature for %s%s from %.128s " "port %d rejected: user presence " "(authenticator touch) requirement not met ", sshkey_type(key), fp, authctxt->valid ? "" : "invalid user ", authctxt->user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
ret = -21;
}
req_verify = (options.pubkey_auth_options &
(1<<1)) || key_opts->require_verify;
if (req_verify &&
(sig_details->sk_flags & 0x04) == 0) {
sshlog("monitor.c", __func__, 1472, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "public key %s %s signature for %s%s from %.128s " "port %d rejected: user verification requirement " "not met ", sshkey_type(key), fp, authctxt->valid ? "" : "invalid user ", authctxt->user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh))
;
ret = -21;
}
}
auth2_record_key(authctxt, ret == 0, key);
if (key_blobtype == MM_USERKEY)
auth_activate_options(ssh, key_opts);
monitor_reset_key_state();
sshbuf_reset(m);
encoded_ret = (ret != 0);
if ((r = sshbuf_put_u32(m, encoded_ret)) != 0 ||
(r = sshbuf_put_u8(m, sig_details !=
((void *)0)
)) != 0)
sshfatal("monitor.c", __func__, 1493, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble");
if (sig_details !=
((void *)0)
) {
if ((r = sshbuf_put_u32(m, sig_details->sk_counter)) != 0 ||
(r = sshbuf_put_u8(m, sig_details->sk_flags)) != 0)
sshfatal("monitor.c", __func__, 1497, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble sk");
}
sshkey_sig_details_free(sig_details);
mm_request_send(sock, MONITOR_ANS_KEYVERIFY, m);
free(sigalg);
free(fp);
sshkey_free(key);
return ret == 0;
}
| long long mm_answer_keyverify(struct_0 *a0, unsigned long a1, unsigned long long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
char v6;
char v7;
char v8;
char v9;
void* v10;
char v11;
char v12;
char v13;
unsigned long long v14;
struct_1 *v15;
struct_1 *v16;
unsigned long long v17;
unsigned long v18;
unsigned long v19;
unsigned long long v20;
unsigned long v21;
char v22;
unsigned long v24;
unsigned long long v25;
unsigned long long v26;
unsigned long long v27;
unsigned long long v28;
unsigned long long v31;
unsigned long long v34;
v10 = 0;
v15 = 0;
v3 = 0;
v4 = 0;
v2 = 0;
v14 = 0;
v0 = sshbuf_get_string_direct(a2, &v9, &v13, &v9);
if (!v0) {
v0 = sshbuf_get_string_direct(a2, &v7, &v11, &v7);
if (!v0) {
v0 = sshbuf_get_string_direct(a2, &v8, &v12, &v8);
if (!v0) {
v0 = sshbuf_get_cstring(a2, &v10, 0x0, &v10);
if (!v0)
goto LABEL_4045a5;
}
}
}
sshfatal("monitor.c", "mm_answer_keyverify", 0x57f, 0x1, 0x1, ssh_err(v0), "parse");
LABEL_4045a5:
if (hostbased_cuser && hostbased_chost && !(!monitor_allowed_key(*(&v9), *(&v13))))
goto LABEL_40460f;
v20 = "bad key, not previously allowed";
sshfatal("monitor.c", "mm_answer_keyverify", 0x583, 0x1, 0x1, 0x0, *(&v22));
LABEL_40460f:
if (!*(v10)) {
free(v10);
v10 = 0;
}
v0 = sshkey_from_blob(*(&v9), *(&v13), &v6, *(&v13));
if (v0) {
v20 = "parse key";
sshfatal("monitor.c", "mm_answer_keyverify", 0x58d, 0x1, 0x1, ssh_err(v0), *(&v22));
}
if (key_blobtype == 1) {
v2 = monitor_valid_hostbasedblob(*(&v8), *(&v12), hostbased_cuser, hostbased_chost);
auth_method = "hostbased";
} else if (key_blobtype != 2) {
v2 = 0;
} else {
v2 = monitor_valid_userblob(a0, *(&v8), *(&v12));
auth_method = "publickey";
}
if (!v2) {
if (key_blobtype == 2) {
v24 = "userkey";
} else if (key_blobtype == 1) {
v24 = "hostkey";
} else {
v24 = "unknown";
}
v21 = v24;
v20 = "bad %s signature data blob";
sshfatal("monitor.c", "mm_answer_keyverify", 0x59e, 0x1, 0x1, 0x0, *(&v22));
}
v15 = sshkey_fingerprint(*(&v6), *(5250768), 0x0, *(5250768));
if (!v15) {
v20 = "sshkey_fingerprint failed";
sshfatal("monitor.c", "mm_answer_keyverify", 0x5a4, 0x1, 0x1, 0x0, *(&v22));
}
v21 = &v14;
v20 = a0->field_83c;
v1 = sshkey_verify(*(&v6), *(&v7), *(&v11), *(&v8), *(&v12), v10, *(&v22));
if (!v1)
v25 = &g_4063a3;
else
v25 = ssh_err(v1);
if (v1)
v26 = ": ";
else
v26 = &g_4063a3;
if (!v1)
v27 = "verified";
else
v27 = "unverified";
if (!v10)
v28 = "default";
else
v28 = v10;
v20 = v25;
v19 = v26;
v18 = v27;
v17 = v28;
v16 = sshkey_type(*(&v6));
v15 = auth_method;
v14 = "%s %s signature using %s %s%s%s";
sshlog("monitor.c", "mm_answer_keyverify", 0x5a8, 0x1, 0x7, 0x0);
if (!v1 && key_blobtype == 2 && v14) {
if ((*(5244232) & 1)) {
LABEL_404934:
*(&v24) = 1;
} else {
if (!*((key_opts + 128)))
goto LABEL_404934;
*(&v24) = 0;
}
v3 = v24;
if (v3 && !(*((v14 + 4)) & 1)) {
if (*((authctxt + 12)))
v31 = &g_4063a3;
else
v31 = "invalid user ";
v20 = ssh_remote_port(a0);
v19 = ssh_remote_ipaddr(a0);
v18 = *((authctxt + 32));
v17 = v31;
v16 = v15;
v15 = sshkey_type(*(&v6));
v14 = "public key %s %s signature for %s%s from %.128s port %d rejected: user presence (authenticator touch) requirement not met ";
sshlog("monitor.c", "mm_answer_keyverify", 0x5b3, 0x0, 0x2, 0x0);
v1 = -21;
}
if ((*(5244232) & 2)) {
LABEL_404a33:
*(&v24) = 1;
} else {
if (!(!*((key_opts + 132))))
goto LABEL_404a33;
*(&v24) = 0;
}
v4 = v24;
if (v4 && !(*((v14 + 4)) & 4)) {
if (*((authctxt + 12)))
v34 = &g_4063a3;
else
v34 = "invalid user ";
v20 = ssh_remote_port(a0);
v19 = ssh_remote_ipaddr(a0);
v18 = *((authctxt + 32));
v17 = v34;
v16 = v15;
v15 = sshkey_type(*(&v6));
v14 = "public key %s %s signature for %s%s from %.128s port %d rejected: user verification requirement not met ";
sshlog("monitor.c", "mm_answer_keyverify", 0x5c0, 0x0, 0x2, 0x0);
v1 = -21;
}
}
auth2_record_key(authctxt, !v1, *(&v6));
if (key_blobtype == 2)
auth_activate_options(a0, key_opts, key_opts);
monitor_reset_key_state();
sshbuf_reset(a2);
v5 = v1;
v0 = sshbuf_put_u32(a2, v5, v5);
if (!v0) {
v0 = sshbuf_put_u8(a2, v14);
if (!v0)
goto LABEL_404c0c;
}
v20 = "assemble";
sshfatal("monitor.c", "mm_answer_keyverify", 0x5d5, 0x1, 0x1, ssh_err(v0), *(&v22));
LABEL_404c0c:
if (v14) {
v0 = sshbuf_put_u32(a2, *(v14), *(v14));
if (!v0) {
v0 = sshbuf_put_u8(a2, *((v14 + 4)));
if (!v0)
goto LABEL_404cae;
}
v20 = "assemble sk";
sshfatal("monitor.c", "mm_answer_keyverify", 0x5d9, 0x1, 0x1, ssh_err(v0), *(&v22));
}
LABEL_404cae:
sshkey_sig_details_free(v14);
mm_request_send(a1, 0x19, a2);
free(v10);
free(v15);
sshkey_free(*(&v6));
return !v1;
}
|
void
print_1_line (char const *line_flag, char const *const *line)
{
print_1_line_nl (line_flag, line,
0
);
}
| int print_1_line(_BYTE *a1, char **a2)
{
return print_1_line_nl(a1, a2, 0);
}
|
static void
expandmeta(struct strlist *str)
{
static const char metachars[] = {
'*', '?', '[', 0
};
while (str) {
struct strlist **savelastp;
struct strlist *sp;
char *p;
unsigned len;
if (optlist[1])
goto nometa;
if (!strpbrk(str->text, metachars))
goto nometa;
savelastp = exparg.lastp;
({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; });
p = preglob(str->text, 0x1 | 0x10);
len = strlen(p);
expdir_max = len +
4096
;
expdir = ckmalloc(expdir_max);
expmeta(p, len, 0);
free((pointer)(expdir));
if (p != str->text)
free((pointer)(p));
({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; });
if (exparg.lastp == savelastp) {
nometa:
*exparg.lastp = str;
_rmescapes((str->text), 0);
exparg.lastp = &str->next;
} else {
*exparg.lastp =
((void *)0)
;
*savelastp = sp = expsort(*savelastp);
while (sp->next !=
((void *)0)
)
sp = sp->next;
exparg.lastp = &sp->next;
}
str = str->next;
}
}
| void expandmeta(unsigned long long a0) {
unsigned long long v0[2];
unsigned int v1;
unsigned long long v2[2];
unsigned long long *v3;
void* v4;
unsigned long long v6[2];
v0[0] = a0;
while (true) {
if (!v0)
break;
if (g_5000e9) {
LABEL_401d65:
g_402ac8[0] = v0;
_rmescapes(v0[1], 0x0);
g_402ac8[0] = v0;
goto LABEL_401de5;
} else {
if (!strpbrk(v0[1], "*?["))
goto LABEL_401d65;
v3 = &g_402ac8[0];
suppressint = suppressint + 1;
v4 = preglob(v0[1], 0x11);
v1 = strlen(v4);
expdir_max = v1 + 0x1000;
expdir = ckmalloc(expdir_max);
expmeta(v4, v1, 0x0);
free(expdir);
if (v4 != v0[1])
free(v4);
suppressint = suppressint - 1;
if (!suppressint && intpending)
onint();
if (v3 == g_402ac8)
goto LABEL_401d65;
g_402ac8[0] = 0;
v2[0] = expsort(*(v3));
for (*(v3) = v2; v2[0]; v2[0] = v2[0]);
g_402ac8[0] = v2;
LABEL_401de5:
v6 = v0[0];
v0[0] = v0[0];
}
}
return;
}
|
int e2fsck_fix_ext3_journal_hint(e2fsck_t ctx)
{
struct ext2_super_block *sb = ctx->fs->super;
struct problem_context pctx;
char uuid[37], *journal_name;
struct stat st;
if (!ext2fs_has_feature_journal(sb) ||
uuid_is_null(sb->s_journal_uuid))
return 0;
uuid_unparse(sb->s_journal_uuid, uuid);
journal_name = blkid_get_devname(ctx->blkid, "UUID", uuid);
if (!journal_name)
return 0;
if (stat(journal_name, &st) < 0) {
free(journal_name);
return 0;
}
if (st.st_rdev != sb->s_journal_dev) {
clear_problem_context(&pctx);
pctx.num = st.st_rdev;
if (fix_problem(ctx, 0x000033, &pctx)) {
sb->s_journal_dev = st.st_rdev;
ext2fs_mark_super_dirty(ctx->fs);
}
}
free(journal_name);
return 0;
}
| long long e2fsck_fix_ext3_journal_hint(struct_0 *a0) {
struct_2 *v0;
void* v1;
char v2;
unsigned long long v3;
char v4;
char v5;
char v6;
v0 = a0->field_0->field_20;
if (!ext2fs_has_feature_journal(v0)) {
LABEL_405776:
} else {
if (!(!uuid_is_null(&v0->padding_0[208])))
goto LABEL_405776;
uuid_unparse(&v0->padding_0[208], &v6, &v0->padding_0[208]);
v1 = blkid_get_devname(a0->field_88, "UUID", &v6);
if (v1) {
if (stat(v1, &v4) < 0) {
free(v1);
} else {
if (*(&v5) != v0->field_e4) {
clear_problem_context(&v2);
v3 = *(&v5);
if (fix_problem(a0, 0x33, &v2)) {
v0->field_e4 = *(&v5);
ext2fs_mark_super_dirty(a0->field_0);
}
}
free(v1);
}
}
}
return 0;
}
|
matches(argv[0], "lst") == 0 ||
matches(argv[0], "show") == 0) {
return iptoken_list(argc - 1, argv + 1);
} else if (matches(argv[0], "set") == 0 ||
| void matches(void)
{
halt_baddata();
}
|
(r = sshpkt_get_end(ssh)) != 0)
sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
if (s->num_env > 128) {
sshlog("session.c", __func__, 2083, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "Ignoring env request %s: too many env vars", name);
goto fail;
}
| || (u8 = sshpkt_get_end(a1)) != 0 )
{
sshpkt_fatal(a1, u8, "%s: parse packet", "session_x11_req");
}
|
int
comment_handler (self, defs, arg)
char *self;
DEF_FILE *defs;
char *arg;
{
return (0);
}
| long long comment_handler(unsigned long a0, unsigned long a1, unsigned long a2) {
unsigned long v0;
unsigned long v1;
unsigned long v2;
v2 = a0;
v1 = a1;
v0 = a2;
return 0;
}
|
static size_t
count_newlines (char *buf, size_t bufsize)
{
size_t count = 0;
char *p;
char *lim = buf + bufsize;
char ch = *lim;
*lim = '\n';
for (p = buf; (p = rawmemchr (p, '\n')) != lim; p++)
count++;
*lim = ch;
return count;
}
| long count_newlines(_BYTE *a1, long a2)
{
char *i;
_BYTE v4[9];
char *v5;
v4[8] = 0;
v5 = &a1[a2];
*(_QWORD *)v4 = (unsigned char)a1[a2];
a1[a2] = 10;
for ( i = (char *)rawmemchr(a1, 10); i != v5; i = (char *)rawmemchr(i + 1, 10) )
++*(_QWORD *)&v4[1];
*v5 = v4[0];
return *(_QWORD *)&v4[1];
}
|
static
__inline__
UChar mmed3 ( UChar a, UChar b, UChar c )
{
UChar t;
if (a > b) { t = a; a = b; b = t; };
if (b > c) {
b = c;
if (a > b) b = a;
}
return b;
}
| byte mmed3(byte param_1,byte param_2,byte param_3)
{
byte local_20;
byte local_1c;
local_20 = param_2;
local_1c = param_1;
if (param_2 < param_1) {
local_20 = param_1;
local_1c = param_2;
}
if ((param_3 < local_20) && (local_20 = param_3, param_3 < local_1c)) {
local_20 = local_1c;
}
return local_20;
}
|
static int
read_getcmd(EditLine *el, el_action_t *cmdnum, wchar_t *ch)
{
static const wchar_t meta = (wchar_t)0x80;
el_action_t cmd;
do {
if (el_wgetc(el, ch) != 1)
return -1;
if (el->el_state.metanext) {
el->el_state.metanext = 0;
*ch |= meta;
}
if (*ch >= 256)
cmd = 9;
else
cmd = el->el_map.current[(unsigned char) *ch];
if (cmd == 25) {
keymacro_value_t val;
switch (keymacro_get(el, ch, &val)) {
case 0:
cmd = val.cmd;
break;
case 1:
el_wpush(el, val.str);
break;
case 2:
return -1;
default:
abort();
break;
}
}
} while (cmd == 25);
*cmdnum = cmd;
return 0;
}
| long read_getcmd(long a1, char *a2, int *a3)
{
int v4;
char v6;
const wchar_t *v7[2];
v7[1] = (const wchar_t *)__readfsqword(0x28u);
do
{
if ( (unsigned int)el_wgetc(a1, a3) != 1 )
return 0xFFFFFFFFLL;
if ( *(_DWORD *)(a1 + 124) )
{
*(_DWORD *)(a1 + 124) = 0;
*a3 |= meta_5602;
}
if ( *a3 <= 255 )
v6 = *(_BYTE *)(*(_QWORD *)(a1 + 1024) + (unsigned char)*a3);
else
v6 = 9;
if ( v6 == 25 )
{
v4 = keymacro_get(a1, a3, v7);
if ( v4 == 2 )
return 0xFFFFFFFFLL;
if ( v4 > 2 )
goto LABEL_18;
if ( v4 )
{
if ( v4 != 1 )
LABEL_18:
abort();
el_wpush(a1, v7[0]);
}
else
{
v6 = (char)v7[0];
}
}
}
while ( v6 == 25 );
*a2 = v6;
return 0LL;
}
|
int
can_expand_path(struct sftp_conn *conn)
{
return (conn->exts & 0x00000080) != 0;
}
| int can_expand_path(struct_0 *a0) {
return (a0->field_1c & 128);
}
|
static enum simple_strtod_error
simple_strtod_float (char const *input_str,
char **endptr,
long double *value,
size_t *precision)
{
_Bool
negative;
enum simple_strtod_error e = SSE_OK;
if (precision)
*precision = 0;
e = simple_strtod_int (input_str, endptr, value, &negative);
if (e != SSE_OK && e != SSE_OK_PRECISION_LOSS)
return e;
if ((strncmp (*endptr, decimal_point, decimal_point_length) == 0))
{
char *ptr2;
long double val_frac = 0;
_Bool
neg_frac;
(*endptr) += decimal_point_length;
enum simple_strtod_error e2 =
simple_strtod_int (*endptr, &ptr2, &val_frac, &neg_frac);
if (e2 != SSE_OK && e2 != SSE_OK_PRECISION_LOSS)
return e2;
if (e2 == SSE_OK_PRECISION_LOSS)
e = e2;
if (neg_frac)
return SSE_INVALID_NUMBER;
size_t exponent = ptr2 - *endptr;
val_frac = ((long double) val_frac) / powerld (10, exponent);
if (value)
{
if (negative)
*value -= val_frac;
else
*value += val_frac;
}
if (precision)
*precision = exponent;
*endptr = ptr2;
}
return e;
}
| int simple_strtod_float(unsigned int a0, unsigned long long *a1, unsigned int a2, unsigned long long *a3) {
char v0;
char v1;
unsigned int v2;
unsigned int v3;
char v4;
unsigned int v5;
char v6;
unsigned int v8;
v2 = 0;
if (a3)
*(a3) = 0;
v2 = simple_strtod_int(a0, a1, a2, &v0);
if (v2 && v2 != 1)
v8 = v2;
if (!v2 || v2 == 1) {
v8 = strncmp(*(a1), decimal_point, decimal_point_length);
if (!v8) {
[D] PutI(904:F64x8)[t16,0] = t19
[D] PutI(968:I8x8)[t16,0] = 0x01
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t26,t28)
[D] PutI(968:I8x8)[t16,0] = 0x00
*(a1) = *(a1) + decimal_point_length;
v3 = simple_strtod_int(*(a1), &v4, &v6, &v1);
if (v3 && v3 != 1)
v8 = v3;
if (v3 == 1 || !v3) {
if (v3 == 1)
v2 = v3;
if (v1) {
v8 = 3;
} else {
*(&v5) = *(&v4) - *(a1);
[D] t8 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t20)
if ([D] GetI(968:I8x8)[t7,0]) {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2)
[D] PutI(904:F64x8)[t4,0] = t7
[D] PutI(968:I8x8)[t4,0] = 0x01
} else {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2)
[D] PutI(904:F64x8)[t4,0] = t7
[D] PutI(968:I8x8)[t4,0] = 0x01
}
if ([D] GetI(968:I8x8)[t7,0]) {
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3)
[D] PutI(968:I8x8)[t7,0] = 0x00
} else {
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t1,t3)
[D] PutI(968:I8x8)[t7,0] = 0x00
}
[D] t2 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(0x0000000000405240)
if ([D] GetI(968:I8x8)[t7,0]) {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(0x0000000000405240)
[D] PutI(904:F64x8)[t2,0] = t5
[D] PutI(968:I8x8)[t2,0] = 0x01
} else {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(0x0000000000405240)
[D] PutI(904:F64x8)[t2,0] = t5
[D] PutI(968:I8x8)[t2,0] = 0x01
}
if ([D] GetI(968:I8x8)[t7,0]) {
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t0,t1)
[D] PutI(968:I8x8)[t5,0] = 0x00
} else {
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t0,t1)
[D] PutI(968:I8x8)[t5,0] = 0x00
}
powerld(*(&v5));
[D] t4 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t5)
if ([D] GetI(968:I8x8)[t7,0]) {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2)
[D] PutI(904:F64x8)[t4,0] = t7
[D] PutI(968:I8x8)[t4,0] = 0x01
} else {
[D] t1 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t2)
[D] PutI(904:F64x8)[t4,0] = t7
[D] PutI(968:I8x8)[t4,0] = 0x01
}
[D] PutI(904:F64x8)[t5,1] = t6
[D] PutI(968:I8x8)[t5,1] = 0x01
[D] PutI(968:I8x8)[t5,0] = 0x00
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t25,t27)
[D] PutI(968:I8x8)[t31,0] = 0x00
if (a2) {
if (v0) {
[D] t2 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t9)
[D] PutI(904:F64x8)[t10,0] = t13
[D] PutI(968:I8x8)[t10,0] = 0x01
[D] t4 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t20)
[D] PutI(904:F64x8)[t22,0] = t25
[D] PutI(968:I8x8)[t22,0] = 0x01
[D] PutI(904:F64x8)[t22,1] = t33
[D] PutI(968:I8x8)[t22,1] = 0x01
[D] PutI(968:I8x8)[t22,0] = 0x00
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t54,t55)
[D] PutI(968:I8x8)[t50,0] = 0x00
} else {
[D] t2 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t9)
[D] PutI(904:F64x8)[t10,0] = t13
[D] PutI(968:I8x8)[t10,0] = 0x01
[D] t4 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_loadF80le(t20)
[D] PutI(904:F64x8)[t22,0] = t25
[D] PutI(968:I8x8)[t22,0] = 0x01
[D] PutI(904:F64x8)[t22,1] = t33
[D] PutI(968:I8x8)[t22,1] = 0x01
[D] PutI(968:I8x8)[t22,0] = 0x00
[D] t4294967295 = DIRTY 1 TODO(effects) ::: amd64g_dirtyhelper_storeF80le(t54,t55)
[D] PutI(968:I8x8)[t50,0] = 0x00
}
}
if (a3)
*(a3) = *(&v5);
*(a1) = *(&v4);
}
}
}
if (v3 == 1 || !v1)
v8 = v2;
}
return v8;
}
|
static void
print_while_command (while_command)
WHILE_COM *while_command;
{
print_until_or_while (while_command, "while");
}
| void print_while_command(unsigned long long a0) {
unsigned long long v1;
v1 = print_until_or_while(a0, "while");
return;
}
|
void *
hash_remove (Hash_table *table, const void *entry)
{
void *data;
struct hash_entry *bucket;
data = hash_find_entry (table, entry, &bucket,
1
);
if (!data)
return
((void *)0)
;
table->n_entries--;
if (!bucket->data)
{
table->n_buckets_used--;
if (table->n_buckets_used
< table->tuning->shrink_threshold * table->n_buckets)
{
check_tuning (table);
if (table->n_buckets_used
< table->tuning->shrink_threshold * table->n_buckets)
{
const Hash_tuning *tuning = table->tuning;
size_t candidate =
(tuning->is_n_buckets
? table->n_buckets * tuning->shrink_factor
: (table->n_buckets * tuning->shrink_factor
* tuning->growth_threshold));
if (!hash_rehash (table, candidate))
{
struct hash_entry *cursor = table->free_entry_list;
struct hash_entry *next;
while (cursor)
{
next = cursor->next;
free (cursor);
cursor = next;
}
table->free_entry_list =
((void *)0)
;
}
}
}
}
return data;
}
| void hash_remove(struct_0 *a0, unsigned long long a1) {
char v0;
struct_2 *v1;
unsigned long long v2;
struct_1 *v3;
unsigned long long v4;
void* v5;
void* v8;
unsigned int v9;
int v10;
unsigned int v11;
int v12;
int v13;
uint128_t v14;
int v15;
uint128_t v16;
uint128_t v17;
unsigned long long v18;
unsigned long long v19;
*(&v2) = hash_find_entry(a0, a1, &v0, 0x1);
if (!v2) {
v8 = 0;
} else {
a0->field_20 = a0->field_20 - 1;
if (!*(*(&v0))) {
a0->field_18 = a0->field_18 - 1;
if (a0->field_18 >= 0) {
v15 = a0->field_18;
} else {
v9 = a0->field_18 >> 1 | a0->field_18 & 1;
v15 = v10 * 2;
}
if (a0->field_10 >= 0) {
v13 = a0->field_10;
} else {
v11 = a0->field_10 >> 1 | a0->field_10 & 1;
v13 = v12 * 2;
}
v14 = v13 * (0 CONCAT a0->field_28->field_0);
if ((((BinaryOp CmpF & 69) | ((BinaryOp CmpF & 69) >> 6)) & 1) != 1) {
check_tuning(a0);
if (a0->field_18 >= 0) {
*(&v15) = a0->field_18;
} else {
*(&v15) = a0->field_18 >> 1 | a0->field_18 & 1;
v15 *= 2;
}
if (a0->field_10 >= 0) {
*(&v14) = a0->field_10;
} else {
*(&v14) = a0->field_10 >> 1 | a0->field_10 & 1;
v14 *= 2;
}
*(&v14) = v14 * (0 CONCAT a0->field_28->field_0);
if ((((BinaryOp CmpF & 69) | ((BinaryOp CmpF & 69) >> 6)) & 1) != 1) {
v3 = a0->field_28;
if (v3->field_10) {
if (a0->field_10 >= 0) {
*(&v15) = a0->field_10;
} else {
*(&v15) = a0->field_10 >> 1 | a0->field_10 & 1;
v15 *= 2;
}
xmm0<16> = (xmm0<16> * Conv(32->128, Load(addr=(Load(addr=stack_base-40, size=8, endness=Iend_LE) + 0x4<64>), size=4, endness=Iend_LE)))
if ((BinaryOp CmpF & 1)) {
v18 = v17;
} else {
xmm0lq<8> = Conv(128->64, (xmm0<16> - Conv(32->128, Load(addr=0x401ab4<64>, size=4, endness=Iend_LE))))
v18 = v17 ^ 0x8000000000000000;
}
} else {
if (a0->field_10 >= 0) {
*(&v15) = a0->field_10;
} else {
*(&v15) = a0->field_10 >> 1 | a0->field_10 & 1;
v15 *= 2;
}
xmm0<16> = (Conv(32->128, Load(addr=(Load(addr=stack_base-40, size=8, endness=Iend_LE) + 0x8<64>), size=4, endness=Iend_LE)) * (Conv(32->128, Load(addr=(Load(addr=stack_base-40, size=8, endness=Iend_LE) + 0x4<64>), size=4, endness=Iend_LE)) * xmm0<16>))
if ((BinaryOp CmpF & 1)) {
v18 = v16;
} else {
xmm0lq<8> = Conv(128->64, (xmm0<16> - Conv(32->128, Load(addr=0x401ab4<64>, size=4, endness=Iend_LE))))
v18 = v17 ^ 0x8000000000000000;
}
}
v4 = v18;
*(&v18) = hash_rehash(a0, v4) ^ 1;
if (v18) {
for (v1 = a0->field_48; v1; v1 = v5) {
v5 = v1->field_8;
free(v1);
}
a0->field_48 = 0;
}
}
}
}
v19 = v2;
}
return;
}
|
int xfrm_xfrmproto_getbyname(char *name)
{
int i;
for (i = 0; ; i++) {
const struct typeent *t = &xfrmproto_types[i];
if (!t->t_name || t->t_type == -1)
break;
if (strcmp(t->t_name, name) == 0)
return t->t_type;
}
return -1;
}
| int xfrm_xfrmproto_getbyname(char *a0) {
unsigned int v0;
struct_0 *v1;
unsigned int v3;
v0 = 0;
while (true) {
v1 = &(&xfrmproto_types)[2 * v0];
if (v1->field_0 && v1->field_8 != -1) {
v3 = strcmp(v1->field_0, a0);
if (!v3) {
v3 = v1->field_8;
break;
} else {
v0 += 1;
continue;
}
}
if (v1->field_8 == -1 || !v1->field_0) {
v3 = -1;
break;
}
}
return v3;
}
|
static
_Bool
xattrs_kw_included (const char *kw,
_Bool
archiving)
{
if (xattrs_setup.incl.size)
return xattrs_matches_mask (kw, &xattrs_setup.incl);
else if (archiving)
return
1
;
else
return strncmp (kw, "user.", sizeof ("user.") - 1) == 0;
}
| int xattrs_kw_included(char *a0, unsigned long a1) {
unsigned int v1;
if (g_402388) {
v1 = xattrs_matches_mask(a0, &xattrs_setup);
} else if (a1) {
v1 = 1;
} else {
v1 = strncmp(a0, "user.", 0x5);
*(&v1) = !v1;
}
return v1;
}
|
const char *ehandler_operation(const char *op)
{
const char *ret = operation;
operation = op;
return ret;
}
| undefined8 ehandler_operation(undefined8 param_1)
{
undefined8 uVar1;
uVar1 = operation;
operation = param_1;
return uVar1;
}
|
static int
send_userauth_info_request(struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
KbdintAuthctxt *kbdintctxt;
char *name, *instr, **prompts;
u_int r, i, *echo_on;
kbdintctxt = authctxt->kbdintctxt;
if (kbdintctxt->device->query(kbdintctxt->ctxt,
&name, &instr, &kbdintctxt->nreq, &prompts, &echo_on))
return 0;
if ((r = sshpkt_start(ssh, 60)) != 0 ||
(r = sshpkt_put_cstring(ssh, name)) != 0 ||
(r = sshpkt_put_cstring(ssh, instr)) != 0 ||
(r = sshpkt_put_cstring(ssh, "")) != 0 ||
(r = sshpkt_put_u32(ssh, kbdintctxt->nreq)) != 0)
sshfatal("auth2-chall.c", __func__, 270, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "start packet");
for (i = 0; i < kbdintctxt->nreq; i++) {
if ((r = sshpkt_put_cstring(ssh, prompts[i])) != 0 ||
(r = sshpkt_put_u8(ssh, echo_on[i])) != 0)
sshfatal("auth2-chall.c", __func__, 274, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "assemble packet");
}
if ((r = sshpkt_send(ssh)) != 0 ||
(r = ssh_packet_write_wait(ssh)) != 0)
sshfatal("auth2-chall.c", __func__, 278, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send packet");
for (i = 0; i < kbdintctxt->nreq; i++)
free(prompts[i]);
free(prompts);
free(echo_on);
free(name);
free(instr);
return 1;
}
| long send_userauth_info_request(long a1)
{
long v2;
long v3;
long v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned int i;
unsigned int j;
void *v10;
void *v11;
void *ptr;
void *v13;
long v14;
long v15;
unsigned long v16;
v16 = __readfsqword(0x28u);
v14 = *(_QWORD *)(a1 + 2144);
v15 = *(_QWORD *)(v14 + 88);
if ( (*(unsigned int ( **)(_QWORD, void **, void **, long, void **, void **))(*(_QWORD *)(v15 + 16) + 16LL))(
*(_QWORD *)(v15 + 8),
&v10,
&v11,
v15 + 24,
&ptr,
&v13) )
{
return 0LL;
}
v5 = sshpkt_start(a1, 60LL);
if ( v5
|| (v5 = sshpkt_put_cstring(a1, v10)) != 0
|| (v5 = sshpkt_put_cstring(a1, v11)) != 0
|| (v5 = sshpkt_put_cstring(a1, &s2)) != 0
|| (v5 = sshpkt_put_u32(a1, *(unsigned int *)(v15 + 24))) != 0 )
{
v2 = ssh_err(v5);
sshfatal("auth2-chall.c", "send_userauth_info_request", 270LL, 1LL, 1LL, v2, "start packet");
}
for ( i = 0; i < *(_DWORD *)(v15 + 24); ++i )
{
v6 = sshpkt_put_cstring(a1, *((_QWORD *)ptr + i));
if ( !v6 )
{
v6 = sshpkt_put_u8(a1, (unsigned char)*((_DWORD *)v13 + i));
if ( !v6 )
continue;
}
v3 = ssh_err(v6);
sshfatal("auth2-chall.c", "send_userauth_info_request", 274LL, 1LL, 1LL, v3, "assemble packet");
}
v7 = sshpkt_send(a1);
if ( v7 || (v7 = ssh_packet_write_wait(a1)) != 0 )
{
v4 = ssh_err(v7);
sshfatal("auth2-chall.c", "send_userauth_info_request", 278LL, 1LL, 1LL, v4, "send packet");
}
for ( j = 0; j < *(_DWORD *)(v15 + 24); ++j )
free(*((void **)ptr + j));
free(ptr);
free(v13);
free(v10);
free(v11);
return 1LL;
}
|
static int handle_nomem(e2fsck_t ctx, struct problem_context *pctx,
size_t size_needed)
{
pctx->num = size_needed;
fix_problem(ctx, 0x01007E, pctx);
ctx->flags |= 0x0001;
return 0;
}
| long handle_nomem(long a1, long a2, long a3)
{
*(_QWORD *)(a2 + 80) = a3;
fix_problem(a1, 65662LL, a2);
*(_DWORD *)(a1 + 72) |= 1u;
return 0LL;
}
|
) {
snprintf(err, errlen, "realpath %s failed: %s", name,
strerror(
(*__errno_location ())
));
return -1;
}
| int snprintf(char *__s,size_t __maxlen,char *__format,...)
{
halt_baddata();
}
|
static int
reset_locale_vars ()
{
char *t, *x;
if (lang == 0 || *lang == '\0')
maybe_make_export_env ();
if (setlocale (
6
, lang ? lang : "") == 0)
return 0;
x = 0;
x = setlocale (
0
, get_locale_var ("LC_CTYPE"));
t = setlocale (
3
, get_locale_var ("LC_COLLATE"));
t = setlocale (
5
, get_locale_var ("LC_MESSAGES"));
t = setlocale (
1
, get_locale_var ("LC_NUMERIC"));
t = setlocale (
2
, get_locale_var ("LC_TIME"));
locale_setblanks ();
locale_mb_cur_max =
(__ctype_get_mb_cur_max ())
;
if (x)
locale_utf8locale = locale_isutf8 (x);
locale_shiftstates = mblen ((char *)
((void *)0)
, 0);
u32reset ();
return 1;
}
| int reset_locale_vars(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned long v1;
unsigned long v3;
if (lang && !(!*(lang)))
goto LABEL_400bef;
maybe_make_export_env();
LABEL_400bef:
if (!lang)
v3 = &g_401480;
else
v3 = lang;
if (!setlocale(0x6, v3)) {
*(&v3) = 0;
} else {
v0 = 0;
*(&v0) = setlocale(0x0, get_locale_var("LC_CTYPE"));
v1 = setlocale(0x3, get_locale_var("LC_COLLATE"));
v1 = setlocale(0x5, get_locale_var("LC_MESSAGES"));
v1 = setlocale(0x1, get_locale_var("LC_NUMERIC"));
v1 = setlocale(0x2, get_locale_var("LC_TIME"));
locale_setblanks();
locale_mb_cur_max = __ctype_get_mb_cur_max(0x2, a1, a2, a3, a4, a5);
if (*(&v0))
locale_mb_cur_max = locale_isutf8(*(&v0));
locale_shiftstates = mblen(NULL, 0x0);
u32reset(0x0, 0x0, a2, a3, a4, a5);
*(&v3) = 1;
}
return v3;
}
|
char *
strip_compression_suffix (const char *name)
{
char *s =
((void *)0)
;
size_t len;
struct compression_suffix const *p = find_compression_suffix (name, &len);
if (p)
{
if (len > 4 && strncmp (name + len - 4, ".tar", 4) == 0
&& p->suffix[0] != 't')
len -= 4;
if (len == 0)
return
((void *)0)
;
s = xmalloc (len + 1);
memcpy (s, name, len);
s[len] = 0;
}
return s;
}
| void * strip_compression_suffix(const char *a1)
{
size_t n;
void *dest;
void **compression_suffix;
unsigned long v5;
v5 = __readfsqword(0x28u);
dest = 0LL;
compression_suffix = find_compression_suffix(a1, &n);
if ( compression_suffix )
{
if ( n > 4 && !strncmp(&a1[n - 4], ".tar", 4uLL) && *(_BYTE *)*compression_suffix != 116 )
n -= 4LL;
if ( !n )
return 0LL;
dest = (void *)xmalloc(n + 1);
memcpy(dest, a1, n);
*((_BYTE *)dest + n) = 0;
}
return dest;
}
|
static char *
convert_abs_rel (char const *from, char const *target)
{
char *targetdir = dir_name (target);
char *realdest = canonicalize_filename_mode (targetdir, CAN_MISSING);
char *realfrom = canonicalize_filename_mode (from, CAN_MISSING);
char *relative_from =
((void *)0)
;
if (realdest && realfrom)
{
relative_from = xmalloc (
4096
);
if (!relpath (realfrom, realdest, relative_from,
4096
))
{
free (relative_from);
relative_from =
((void *)0)
;
}
}
free (targetdir);
free (realdest);
free (realfrom);
return relative_from ? relative_from : xstrdup (from);
}
| void * convert_abs_rel(long a1, long a2)
{
void *ptr;
void *v4;
void *v5;
void *v6;
v4 = (void *)dir_name(a2);
v5 = (void *)canonicalize_filename_mode(v4, 2LL);
v6 = (void *)canonicalize_filename_mode(a1, 2LL);
ptr = 0LL;
if ( v5 )
{
if ( v6 )
{
ptr = (void *)xmalloc(4096LL);
if ( (unsigned char)relpath(v6, v5, ptr, 4096LL) != 1 )
{
free(ptr);
ptr = 0LL;
}
}
}
free(v4);
free(v5);
free(v6);
if ( ptr )
return ptr;
else
return (void *)xstrdup(a1);
}
|
static void
code_signed_num (uintmax_t value, char const *keyword,
intmax_t minval, uintmax_t maxval, struct xheader *xhdr)
{
char sbuf[SYSINT_BUFSIZE];
xheader_print (xhdr, keyword, sysinttostr (value, minval, maxval, sbuf));
}
| void code_signed_num(unsigned long long a0, unsigned int a1, unsigned long long a2, unsigned long long a3, void* a4) {
char v0;
char v1;
unsigned long long *v3;
unsigned long long v4;
xheader_print(a4, a1, sysinttostr(a0, a2, a3, &v0));
v4 = *(&v1) ^ v3[5];
return;
}
|
gnutls_session_t init_tls_session(const char *host)
{
gnutls_session_t state =
((void *)0)
;
gnutls_init(&state, (1<<1));
;
if (host && is_ip(host) == 0)
gnutls_server_name_set(state, GNUTLS_NAME_DNS,
host, strlen(host));
return state;
}
| long long init_tls_session(char *a0) {
void* v0;
v0 = 0;
gnutls_init(&v0, 0x2);
if (a0 && !is_ip(a0))
gnutls_server_name_set(v0, 0x1, a0, strlen(a0));
return v0;
}
|
static int
history_next_string(HistoryW *h, HistEventW *ev, const wchar_t *str)
{
size_t len = wcslen(str);
int retval;
for (retval = (*(h)->h_curr)((h)->h_ref, ev); retval != -1; retval = (*(h)->h_prev)((h)->h_ref, ev))
if (wcsncmp(str, ev->str, len) == 0)
return 0;
{ ev->num = 9; ev->str = he_errlist[9]; };
return -1;
}
| long history_next_string(_QWORD *a1, long a2, const wchar_t *a3)
{
int i;
size_t n;
n = wcslen(a3);
for ( i = ((long ( *)(_QWORD, long))a1[6])(*a1, a2);
i != -1;
i = ((long ( *)(_QWORD, long))a1[5])(*a1, a2) )
{
if ( !wcsncmp(a3, *(const wchar_t **)(a2 + 8), n) )
return 0LL;
}
*(_DWORD *)a2 = 9;
*(_QWORD *)(a2 + 8) = "e";
return 0xFFFFFFFFLL;
}
|
static void
nlscan (char const *lim)
{
idx_t newlines = 0;
for (char const *beg = lastnl; beg < lim; beg++)
{
beg = memchr (beg, eolbyte, lim - beg);
if (!beg)
break;
newlines++;
}
totalnl = add_count (totalnl, newlines);
lastnl = lim;
}
| void nlscan(void *param_1)
{
long local_18;
void *local_10;
local_18 = 0;
local_10 = lastnl;
while ((local_10 < param_1 &&
(local_10 = memchr(local_10,(int)eolbyte,(long)param_1 - (long)local_10),
local_10 != (void *)0x0))) {
local_18 = local_18 + 1;
local_10 = (void *)((long)local_10 + 1);
}
totalnl = add_count(totalnl,local_18);
lastnl = param_1;
return;
}
|
static char *
parameter_brace_remove_pattern (varname, value, estatep, patstr, rtype, quoted, flags)
char *varname, *value;
array_eltstate_t *estatep;
char *patstr;
int rtype, quoted, flags;
{
int vtype, patspec, starsub;
char *temp1, *val, *pattern, *oname;
SHELL_VAR *v;
if (value == 0)
return ((char *)
((void *)0)
);
oname = this_command_name;
this_command_name = varname;
vtype = get_var_and_type (varname, value, estatep, quoted, flags, &v, &val);
if (vtype == -1)
{
this_command_name = oname;
return ((char *)
((void *)0)
);
}
starsub = vtype & 128;
vtype &= ~128;
patspec = getpatspec (rtype, patstr);
if (patspec == 1 || patspec == 3)
patstr++;
temp1 = (char *)strcpy (sh_xmalloc((1 + strlen (patstr)), "subst.c", 5883), (patstr));
pattern = getpattern (temp1, quoted, 1);
sh_xfree((temp1), "subst.c", 5885);
temp1 = (char *)
((void *)0)
;
switch (vtype)
{
case 0:
case 3:
temp1 = remove_pattern (val, pattern, patspec);
if (vtype == 0)
do { if (val) sh_xfree((val), "subst.c", 5894); } while (0);
if (temp1)
{
val = (quoted & (0x002|0x001))
? quote_string (temp1)
: quote_escapes (temp1);
sh_xfree((temp1), "subst.c", 5900);
temp1 = val;
}
break;
case 2:
temp1 = array_remove_pattern (v, pattern, patspec, starsub, quoted);
if (temp1 && ((quoted & (0x002|0x001)) == 0))
{
val = quote_escapes (temp1);
sh_xfree((temp1), "subst.c", 5910);
temp1 = val;
}
break;
case 1:
temp1 = parameter_list_remove_pattern (varname[0], pattern, patspec, quoted);
if (temp1 && quoted == 0 && ifs_is_null)
{
}
else if (temp1 && ((quoted & (0x002|0x001)) == 0))
{
val = quote_escapes (temp1);
sh_xfree((temp1), "subst.c", 5924);
temp1 = val;
}
break;
}
this_command_name = oname;
do { if (pattern) sh_xfree((pattern), "subst.c", 5932); } while (0);
return temp1;
}
| char * parameter_brace_remove_pattern(
char *a1,
char *a2,
long a3,
char *a4,
int a5,
unsigned int a6,
unsigned int a7)
{
size_t v8;
char *v9;
char *v10;
int var_and_type;
signed int v15;
int v16;
int v17;
char *v18;
long v19;
char *v20;
long v21;
char *v22;
unsigned long v23;
v23 = __readfsqword(0x28u);
if ( !a2 )
return 0LL;
v21 = this_command_name;
this_command_name = a1;
var_and_type = get_var_and_type(a1, a2, a3, a6, a7, &v19, &v18);
if ( var_and_type == -1 )
{
this_command_name = v21;
return 0LL;
}
v16 = var_and_type & 0x80;
v15 = var_and_type & 0xFFFFFF7F;
v17 = getpatspec(a5, a4);
if ( v17 == 1 || v17 == 3 )
++a4;
v8 = strlen(a4);
v9 = (char *)sh_xmalloc(v8 + 1, "subst.c", 5883LL);
v20 = strcpy(v9, a4);
v22 = getpattern(v20, a6);
sh_xfree(v20, "subst.c", 5885LL);
v20 = 0LL;
if ( v15 == 3 )
goto LABEL_14;
if ( v15 <= 3 )
{
if ( v15 == 2 )
{
v20 = array_remove_pattern(v19, v22, v17, v16, a6);
if ( v20 && (a6 & 3) == 0 )
{
v18 = (char *)quote_escapes(v20);
sh_xfree(v20, "subst.c", 5910LL);
v20 = v18;
}
goto LABEL_31;
}
if ( v15 )
{
if ( v15 == 1 )
{
v20 = parameter_list_remove_pattern(*a1, v22, v17, a6);
if ( (!v20 || a6 || !ifs_is_null) && v20 && (a6 & 3) == 0 )
{
v18 = (char *)quote_escapes(v20);
sh_xfree(v20, "subst.c", 5924LL);
v20 = v18;
}
}
goto LABEL_31;
}
LABEL_14:
v20 = remove_pattern(v18, v22, v17);
if ( !v15 && v18 )
sh_xfree(v18, "subst.c", 5894LL);
if ( v20 )
{
if ( (a6 & 3) != 0 )
v10 = quote_string(v20);
else
v10 = (char *)quote_escapes(v20);
v18 = v10;
sh_xfree(v20, "subst.c", 5900LL);
v20 = v18;
}
}
LABEL_31:
this_command_name = v21;
if ( v22 )
sh_xfree(v22, "subst.c", 5932LL);
return v20;
}
|
size_t strlens(const char *last, ...) {
va_list ap;
size_t ret = 0;
const char *str;
__builtin_va_start(
ap
,
last
)
;
for (str = last; str !=
((void *)0)
; str =
__builtin_va_arg(
ap
,
const char *
)
)
ret += strlen(str);
__builtin_va_end(
ap
)
;
return (ret);
}
| long strlens(const char *a1, long a2, long a3, long a4, long a5, long a6, ...)
{
const char **v6;
long v7;
long v9;
gcc_va_list va;
long v12;
long v13;
long v14;
long v15;
long v16;
va_start(va, a6);
v12 = a2;
v13 = a3;
v14 = a4;
v15 = a5;
v16 = a6;
v9 = 0LL;
va[0].gp_offset = 8;
while ( a1 )
{
v9 += strlen(a1);
if ( va[0].gp_offset > 0x2F )
{
v7 = va_arg(va, _QWORD);
v6 = (const char **)&v7;
}
else
{
v6 = (const char **)((char *)va[0].reg_save_area + va[0].gp_offset);
va[0].gp_offset += 8;
}
a1 = *v6;
}
return v9;
}
|
static int process_block(ext2_filsys fs,
blk64_t *block_nr,
e2_blkcnt_t blockcnt,
blk64_t ref_block __attribute__((unused)),
int ref_offset __attribute__((unused)),
void *priv_data)
{
struct process_block_struct *p;
struct problem_context *pctx;
blk64_t blk = *block_nr;
int ret_code = 0;
problem_t problem = 0;
e2fsck_t ctx;
p = (struct process_block_struct *) priv_data;
pctx = p->pctx;
ctx = p->ctx;
if (p->is_dir && blockcnt == 0 && blk == 0) {
pctx->errcode = ext2fs_add_dir_block2(fs->dblist, p->ino, 0, 0);
if (pctx->errcode) {
pctx->blk = blk;
pctx->num = blockcnt;
goto failed_add_dir_block;
}
p->last_db_block++;
}
if (blk == 0)
return 0;
if (p->previous_block && p->ino != 7) {
if (p->previous_block+1 != blk) {
if (ctx->options & 0x0800) {
char type = '?';
if (p->is_dir)
type = 'd';
else if (p->is_reg)
type = 'f';
printf((gettext ("%6lu(%c): expecting %6lu " "got phys %6lu (blkcnt %lld)\n"))
,
(unsigned long) pctx->ino, type,
(unsigned long) p->previous_block+1,
(unsigned long) blk,
(long long) blockcnt);
}
p->fragmented = 1;
}
}
if (p->is_dir && !ext2fs_has_feature_largedir(fs->super) &&
!pctx->inode->i_size_high &&
blockcnt > (1 << (21 - fs->super->s_log_block_size)))
problem = 0x010044;
if (p->is_dir && p->num_blocks + 1 >= p->max_blocks)
problem = 0x010044;
if (p->is_reg && p->num_blocks + 1 >= p->max_blocks)
problem = 0x010045;
if (!p->is_dir && !p->is_reg && blockcnt > 0)
problem = 0x010046;
if (blk < fs->super->s_first_data_block ||
blk >= ext2fs_blocks_count(fs->super))
problem = 0x01000E;
if (blockcnt < 0 &&
p->ino != 7 &&
blk < ctx->fs->super->s_blocks_count &&
ext2fs_test_block_bitmap2(ctx->block_metadata_map, blk)) {
pctx->blk = blk;
fix_problem(ctx, 0x010071, pctx);
if ((ctx->options & 0x0008) == 0)
ctx->flags |= 0x0008;
}
if (problem) {
p->num_illegal_blocks++;
if (p->ino != 7 &&
ref_block != 0 &&
ext2fs_test_block_bitmap2(ctx->block_metadata_map,
ref_block)) {
*block_nr = 0;
return 0;
}
if (!p->suppress && (p->num_illegal_blocks % 12) == 0) {
if (fix_problem(ctx, 0x010011, pctx)) {
p->clear = 1;
return 2;
}
if (fix_problem(ctx, 0x01002D, pctx)) {
p->suppress = 1;
set_latch_flags(0x0010,
0x0008, 0);
}
}
pctx->blk = blk;
pctx->blkcount = blockcnt;
if (fix_problem(ctx, problem, pctx)) {
blk = *block_nr = 0;
ret_code = 1;
p->inode_modified = 1;
if (problem == 0x010044)
return ret_code;
goto mark_dir;
} else
return 0;
}
if (p->ino == 7) {
if (blockcnt == (-2))
mark_block_used(ctx, blk);
p->num_blocks++;
} else if (!(ctx->fs->cluster_ratio_bits &&
p->previous_block &&
(((blk) >> (ctx->fs)->cluster_ratio_bits) ==
((p->previous_block) >> (ctx->fs)->cluster_ratio_bits)) &&
(blk & ((1 << (ctx->fs)->cluster_ratio_bits) - 1)) ==
((unsigned) blockcnt & ((1 << (ctx->fs)->cluster_ratio_bits) - 1)))) {
mark_block_used(ctx, blk);
p->num_blocks++;
} else if (has_unaligned_cluster_map(ctx, p->previous_block,
p->last_block, blk, blockcnt)) {
pctx->blk = blockcnt;
pctx->blk2 = blk;
fix_problem(ctx, 0x010074, pctx);
mark_block_used(ctx, blk);
mark_block_used(ctx, blk);
}
if (blockcnt >= 0)
p->last_block = blockcnt;
p->previous_block = blk;
mark_dir:
if (p->is_dir && (blockcnt >= 0)) {
while (++p->last_db_block < blockcnt) {
pctx->errcode = ext2fs_add_dir_block2(fs->dblist,
p->ino, 0,
p->last_db_block);
if (pctx->errcode) {
pctx->blk = 0;
pctx->num = p->last_db_block;
goto failed_add_dir_block;
}
}
pctx->errcode = ext2fs_add_dir_block2(fs->dblist, p->ino,
blk, blockcnt);
if (pctx->errcode) {
pctx->blk = blk;
pctx->num = blockcnt;
failed_add_dir_block:
fix_problem(ctx, 0x01002B, pctx);
ctx->flags |= 0x0001;
return 2;
}
}
return ret_code;
}
| long long process_block(struct_1 *a0, unsigned long long *a1, unsigned long a2, unsigned long long a3, unsigned long a4, struct_0 *a5) {
unsigned int v0;
char v1;
unsigned int v2;
unsigned int v3;
unsigned long v4;
struct_3 *v5;
struct_5 *v6;
unsigned long long v8;
v0 = a4;
v4 = *(a1);
v2 = 0;
v3 = 0;
v5 = a5->field_48;
v6 = a5->field_58;
if ((a5->field_4 & 1) && !a2 && !v4) {
v5->field_0 = ext2fs_add_dir_block2(a0->field_90, a5->field_0, 0x0, 0x0);
if (v5->field_0) {
v5->field_28 = v4;
v5->field_50 = a2;
fix_problem(v6, 0x1002b, v5);
v6->field_48 = v6->field_48 | 1;
v8 = 2;
return v8;
}
a5->field_28 = a5->field_28 + 1;
}
if (!v4) {
v8 = 0;
return v8;
}
if (a5->field_38 && a5->field_0 != 7 && v4 != a5->field_38 + 1) {
if ((v6->field_4c & 0x800)) {
v1 = 63;
if ((a5->field_4 & 1)) {
v1 = 100;
} else if ((a5->field_4 & 2)) {
v1 = 102;
}
printf(gettext("%6lu(%c): expecting %6lu got phys %6lu (blkcnt %lld)\n"));
}
a5->field_4 = a5->field_4 | 16;
}
if ((a5->field_4 & 1) && !ext2fs_has_feature_largedir(a0->field_20) && !v5->field_18->field_6c && a2 > 1 << ((21 - a0->field_20->field_18) & 31))
v3 = 65604;
if ((a5->field_4 & 1) && a5->field_8 + 1 >= a5->field_10)
v3 = 65604;
if ((a5->field_4 & 2) && a5->field_8 + 1 >= a5->field_10)
v3 = 65605;
if (!(a5->field_4 & 1) && !(a5->field_4 & 2) && a2 > 0)
v3 = 65606;
if (v4 < a0->field_20->field_14 || v4 >= ext2fs_blocks_count(a0->field_20))
v3 = 65550;
if ((a2 - 0 >> 63) && a5->field_0 != 7 && v4 < v6->field_0->field_20->field_4 && ext2fs_test_block_bitmap2(v6->field_390, v4, v4)) {
v5->field_28 = v4;
fix_problem(v6, 0x10071, v5);
if (!(v6->field_4c & 8))
v6->field_48 = v6->field_48 | 8;
}
if (!v3) {
if (a5->field_0 == 7) {
if (a2 == -2)
mark_block_used(v6, v4);
a5->field_8 = a5->field_8 + 1;
} else if (!v6->field_0->field_c0 || !a5->field_38 || v4 >> (v6->field_0->field_c0 & 63) != a5->field_38 >> (v6->field_0->field_c0 & 63) || ((1 << (v6->field_0->field_c0 & 31)) - 1 & v4) != ((1 << (v6->field_0->field_c0 & 31)) - 1 & a2)) {
mark_block_used(v6, v4);
a5->field_8 = a5->field_8 + 1;
} else if (has_unaligned_cluster_map(v6, a5->field_38, a5->field_18, v4, a2)) {
v5->field_28 = a2;
v5->field_30 = v4;
fix_problem(v6, 0x10074, v5);
mark_block_used(v6, v4);
mark_block_used(v6, v4);
}
if (!((a2 - 0 >> 63)))
a5->field_18 = a2;
a5->field_38 = v4;
} else {
a5->field_30 = a5->field_30 + 1;
if (a5->field_0 != 7 && a3 && ext2fs_test_block_bitmap2(v6->field_390, a3, a3)) {
*(a1) = 0;
v8 = 0;
return v8;
}
if (!(a5->field_4 & 8) && !a5->field_30 - ((((a5->field_30 * 715827883 >> 33) - (a5->field_30 >> 31)) << 1) + ((a5->field_30 * 715827883 >> 33) - (a5->field_30 >> 31)) << 2)) {
if (fix_problem(v6, 0x10011, v5)) {
a5->field_4 = a5->field_4 | 4;
v8 = 2;
return v8;
} else if (fix_problem(v6, 0x1002d, v5)) {
a5->field_4 = a5->field_4 | 8;
set_latch_flags(0x10, 0x8, 0x0);
}
}
v5->field_28 = v4;
v5->field_38 = a2;
if (!fix_problem(v6, v3, v5)) {
v8 = 0;
return v8;
}
*(a1) = 0;
v4 = *(a1);
v2 = 1;
a5->field_4 = a5->field_4 | -128;
if (v3 == 65604) {
v8 = v2;
return v8;
}
}
if ((a5->field_4 & 1) && !((a2 - 0 >> 63))) {
while (true) {
a5->field_28 = a5->field_28 + 1;
if (a2 <= a5->field_28)
break;
v5->field_0 = ext2fs_add_dir_block2(a0->field_90, a5->field_0, 0x0, a5->field_28);
if (v5->field_0) {
v5->field_28 = 0;
v5->field_50 = a5->field_28;
fix_problem(v6, 0x1002b, v5);
v6->field_48 = v6->field_48 | 1;
v8 = 2;
return v8;
}
}
v5->field_0 = ext2fs_add_dir_block2(a0->field_90, a5->field_0, v4, a2);
if (v5->field_0) {
v5->field_28 = v4;
v5->field_50 = a2;
fix_problem(v6, 0x1002b, v5);
v6->field_48 = v6->field_48 | 1;
v8 = 2;
return v8;
}
v8 = v2;
return v8;
}
v8 = v2;
return v8;
}
|
void
sys_detect_dev_null_output (void)
{
static char const dev_null[] = "/dev/null";
struct stat dev_null_stat;
dev_null_output = (strcmp (archive_name_array[0], dev_null) == 0
|| (! ((archive) >= (1 << 30))
&&
((((
archive_stat.st_mode
)) & 0170000) == (0020000))
&& stat (dev_null, &dev_null_stat) == 0
&& archive_stat.st_dev == dev_null_stat.st_dev
&& archive_stat.st_ino == dev_null_stat.st_ino));
}
| unsigned long sys_detect_dev_null_output()
{
bool v0;
struct stat v2;
unsigned long v3;
v3 = __readfsqword(0x28u);
v0 = !strcmp((const char *)*archive_name_array, "/dev/null")
|| archive <= 0x3FFFFFFF
&& (dword_1F18 & 0xF000) == 0x2000
&& !stat("/dev/null", &v2)
&& archive_stat.st_dev == v2.st_dev
&& qword_1F08 == v2.st_ino;
dev_null_output = v0;
return __readfsqword(0x28u) ^ v3;
}
|
int
sshkey_shield_private(struct sshkey *k)
{
struct sshbuf *prvbuf =
((void *)0)
;
u_char *prekey =
((void *)0)
, *enc =
((void *)0)
, keyiv[64];
struct sshcipher_ctx *cctx =
((void *)0)
;
const struct sshcipher *cipher;
size_t i, enclen = 0;
struct sshkey *kswap =
((void *)0)
, tmp;
int r = -1;
if ((cipher = cipher_by_name("aes256-ctr")) ==
((void *)0)
) {
r = -10;
goto out;
}
if (cipher_keylen(cipher) + cipher_ivlen(cipher) >
ssh_digest_bytes(4)) {
r = -1;
goto out;
}
if ((prekey = malloc((16 * 1024))) ==
((void *)0)
) {
r = -2;
goto out;
}
arc4random_buf(prekey, (16 * 1024));
if ((r = ssh_digest_memory(4,
prekey, (16 * 1024),
keyiv, 64)) != 0)
goto out;
if ((r = cipher_init(&cctx, cipher, keyiv, cipher_keylen(cipher),
keyiv + cipher_keylen(cipher), cipher_ivlen(cipher), 1)) != 0)
goto out;
if ((prvbuf = sshbuf_new()) ==
((void *)0)
) {
r = -2;
goto out;
}
if (sshkey_is_shielded(k) && (r = sshkey_unshield_private(k)) != 0)
goto out;
if ((r = sshkey_private_serialize_opt(k, prvbuf,
SSHKEY_SERIALIZE_SHIELD)) != 0)
goto out;
i = 0;
while (sshbuf_len(prvbuf) % cipher_blocksize(cipher)) {
if ((r = sshbuf_put_u8(prvbuf, ++i & 0xff)) != 0)
goto out;
}
enclen = sshbuf_len(prvbuf);
if ((enc = malloc(enclen)) ==
((void *)0)
) {
r = -2;
goto out;
}
if ((r = cipher_crypt(cctx, 0, enc,
sshbuf_ptr(prvbuf), sshbuf_len(prvbuf), 0, 0)) != 0)
goto out;
if ((r = sshkey_from_private(k, &kswap)) != 0)
goto out;
tmp = *kswap;
*kswap = *k;
*k = tmp;
k->shielded_private = enc;
k->shielded_len = enclen;
k->shield_prekey = prekey;
k->shield_prekey_len = (16 * 1024);
enc = prekey =
((void *)0)
;
enclen = 0;
k->sk_flags = kswap->sk_flags;
r = 0;
out:
cipher_free(cctx);
explicit_bzero(keyiv, sizeof(keyiv));
explicit_bzero(&tmp, sizeof(tmp));
freezero(enc, enclen);
freezero(prekey, (16 * 1024));
sshkey_free(kswap);
sshbuf_free(prvbuf);
return r;
}
| int sshkey_shield_private(struct_0 *a0) {
void* v0;
int tmp_215;
int tmp_225;
int tmp_237;
int tmp_249;
int tmp_261;
int tmp_273;
int tmp_285;
int tmp_297;
int tmp_75;
struct_0 *v1;
unsigned int v2;
void* v3;
void* v4;
void* v5;
void* v6;
void* v7;
void* v8;
void* v9;
unsigned long long v10;
unsigned long v11;
unsigned long v12;
unsigned long v13;
unsigned long v14;
unsigned long v15;
unsigned long v16;
unsigned long v17;
unsigned long v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
unsigned long v22;
unsigned long v23;
unsigned long v24;
unsigned long v25;
unsigned long v26;
unsigned long v27;
unsigned long v28;
unsigned long v29;
unsigned long v30;
unsigned long v31;
char v32;
unsigned long long v35;
void* v36;
struct_0 *v37;
unsigned long long v38;
v1 = a0;
v5 = 0;
v6 = 0;
v7 = 0;
v3 = 0;
v9 = 0;
v4 = 0;
v2 = -1;
v10 = cipher_by_name("aes256-ctr");
if (!v10) {
v2 = -10;
} else if (cipher_ivlen(v10) + cipher_keylen(v10) > ssh_digest_bytes(0x4)) {
v2 = -1;
} else {
v6 = malloc(0x4000);
if (!v6) {
v2 = -2;
} else {
arc4random_buf(v6, 0x4000);
v2 = ssh_digest_memory(0x4, v6, 0x4000, &v32, 0x40);
if (!v2) {
v35 = &(&v32)[cipher_keylen(v10)];
v0 = 1;
v2 = cipher_init(&v3, v10, &v32, cipher_keylen(v10), v35, cipher_ivlen(v10));
if (!v2) {
v5 = sshbuf_new();
if (!v5) {
v2 = -2;
} else {
if (sshkey_is_shielded(a0)) {
v2 = sshkey_unshield_private(a0);
if (!(!v2))
goto LABEL_404956;
}
v2 = sshkey_private_serialize_opt(a0, v5, 0x3, v5);
if (!v2) {
v8 = 0;
do {
if (!(0 CONCAT sshbuf_len(v5)) /m cipher_blocksize(v10) >> 64) {
v9 = sshbuf_len(v5);
v7 = malloc(v9);
if (!v7) {
v2 = -2;
break;
} else {
v0 = 0;
v2 = cipher_crypt(v3, 0x0, v7, sshbuf_ptr(v5), sshbuf_len(v5), 0x0);
if (!v2) {
v2 = sshkey_from_private(a0, &v4);
if (!v2) {
v11 = *(v4);
v12 = v4[8];
v13 = v4[16];
v14 = v4[24];
v15 = v4[32];
v16 = v4[40];
v17 = v4[48];
v18 = v4[56];
v19 = v4[64];
v20 = v4[72];
v21 = v4[80];
v22 = v4[88];
v23 = v4[96];
v24 = v4[104];
v25 = v4[112];
v26 = v4[120];
v27 = v4[128];
v28 = v4[136];
v29 = v4[144];
v30 = v4[152];
v31 = v4[160];
v36 = v4;
v37 = a0;
tmp_215 = a0->field_8;
*(v4) = a0->field_0;
*(&v4[8]) = tmp_215;
tmp_225 = a0->field_18;
*(&v4[16]) = a0->field_10;
*(&v4[24]) = tmp_225;
tmp_237 = a0->field_28;
*(&v4[32]) = a0->field_20;
*(&v4[40]) = tmp_237;
tmp_249 = a0->field_38;
*(&v4[48]) = a0->field_30;
*(&v4[56]) = tmp_249;
tmp_261 = a0->field_48;
*(&v4[64]) = a0->field_40;
*(&v4[72]) = tmp_261;
tmp_273 = a0->field_58;
*(&v4[80]) = a0->field_50;
*(&v4[88]) = tmp_273;
tmp_285 = *(&a0->field_68);
*(&v4[96]) = a0->field_60;
*(&v4[104]) = tmp_285;
tmp_297 = a0->field_78;
*(&v4[112]) = a0->field_70;
*(&v4[120]) = tmp_297;
v38 = a0->field_88;
*(&v36[128]) = a0->field_80;
*(&v36[136]) = v38;
tmp_75 = v37->field_98;
*(&v36[144]) = v37->field_90;
*(&v36[152]) = tmp_75;
*(&v36[160]) = v37->field_a0;
a0->field_0 = v11;
a0->field_8 = v12;
a0->field_10 = v13;
a0->field_18 = v14;
a0->field_20 = v15;
a0->field_28 = v16;
a0->field_30 = v17;
a0->field_38 = v18;
a0->field_40 = v19;
a0->field_48 = v20;
a0->field_50 = v21;
a0->field_58 = v22;
a0->field_60 = v23;
*(&a0->field_68) = v24;
a0->field_70 = v25;
a0->field_78 = v26;
a0->field_80 = v27;
a0->field_88 = v28;
a0->field_90 = v29;
a0->field_98 = v30;
a0->field_a0 = v31;
a0->field_88 = v7;
a0->field_90 = v9;
a0->field_98 = v6;
a0->field_a0 = 0x4000;
v6 = 0;
v7 = v6;
v9 = 0;
a0->field_68 = v4[104];
v2 = 0;
break;
}
}
}
}
v8 += 1;
v2 = sshbuf_put_u8(v5, v8, v8);
} while (!v2);
}
}
}
}
}
}
LABEL_404956:
cipher_free(v3);
explicit_bzero(&v32, 0x40);
explicit_bzero(&v11, 0xa8);
freezero(v7, v9);
freezero(v6, 0x4000);
sshkey_free(v4);
sshbuf_free(v5);
return v2;
}
|
kwset_t
kwsalloc (char const *trans)
{
struct kwset *kwset = xmalloc (sizeof *kwset);
_obstack_begin ((&kwset->obstack), 0, 0, (xmalloc), (free));
kwset->words = 0;
kwset->trie = __extension__ ({ struct obstack *__h = (&kwset->obstack); __extension__ ({ struct obstack *__o = (__h); size_t __len = ((sizeof *kwset->trie)); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); ((void) ((__o)->next_free += (__len))); }); __extension__ ({ struct obstack *__o1 = (__h); void *__value = (void *) __o1->object_base; if (__o1->next_free == __value) __o1->maybe_empty_object = 1; __o1->next_free = ((sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (((__o1->next_free) - (sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (__o1->alignment_mask)) & ~(__o1->alignment_mask))); if ((size_t) (__o1->next_free - (char *) __o1->chunk) > (size_t) (__o1->chunk_limit - (char *) __o1->chunk)) __o1->next_free = __o1->chunk_limit; __o1->object_base = __o1->next_free; __value; }); });
kwset->trie->accepting = 0;
kwset->trie->links =
((void *)0)
;
kwset->trie->parent =
((void *)0)
;
kwset->trie->next =
((void *)0)
;
kwset->trie->fail =
((void *)0)
;
kwset->trie->depth = 0;
kwset->trie->shift = 0;
kwset->mind =
(9223372036854775807L)
;
kwset->target =
((void *)0)
;
kwset->trans = trans;
kwset->kwsexec = acexec;
return kwset;
}
| int kwsalloc(unsigned long a0) {
struct_1 *v0;
unsigned long long v1[308];
unsigned long long v2[308];
unsigned long long v3;
unsigned long long v4[308];
struct_0 *v5;
unsigned long v6;
v0 = xmalloc(0x9a0);
_obstack_begin(v0, 0x0, 0x0, got.xmalloc, got.free);
v0->field_58 = 0;
v1[0] = v0;
v2[0] = v1;
v3 = 64;
v4[0] = v2;
if (v4[4] - v4[3] < v3)
_obstack_newchunk(v2, v3, v3);
v2[3] = v2[3] + v3;
v5 = &v1[0];
v6 = v5->field_10;
if (v6 == v5->field_18)
v5->field_50 = v5->field_50 | 2;
v5->field_18 = !(v5->field_30) & v5->field_18 + v5->field_30;
if (v5->field_18 - v5->field_8 > v5->field_20 - v5->field_8)
v5->field_18 = v5->field_20;
v5->field_10 = v5->field_18;
v0->field_60 = v6;
v0->field_60->field_0 = 0;
v0->field_60->field_8 = 0;
v0->field_60->field_10 = 0;
v0->field_60->field_18 = 0;
v0->field_60->field_20 = 0;
v0->field_60->field_28 = 0;
v0->field_60->field_30 = 0;
v0->field_68 = 9223372036854775807;
v0->field_970 = 0;
v0->field_980 = a0;
v0->field_998 = acexec;
return v0;
}
|
static inline void
emit_mandatory_arg_note (void)
{
fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
}
| void emit_mandatory_arg_note(void)
{
char *__s;
FILE *__stream;
__stream = stdout;
__s = (char *)gettext(
"\nMandatory arguments to long options are mandatory for short options too.\n"
);
fputs_unlocked(__s,__stream);
return;
}
|
static char *
pos_params (string, start, end, quoted, pflags)
char *string;
int start, end, quoted, pflags;
{
WORD_LIST *save, *params, *h, *t;
char *ret;
int i;
if (start == end)
return ((char *)
((void *)0)
);
save = params = list_rest_of_args ();
if (save == 0 && start > 0)
return ((char *)
((void *)0)
);
if (start == 0)
{
t = make_word_list (make_word (dollar_vars[0]), params);
save = params = t;
}
for (i = start ? 1 : 0; params && i < start; i++)
params = params->next;
if (params == 0)
{
dispose_words (save);
return ((char *)
((void *)0)
);
}
for (h = t = params; params && i < end; i++)
{
t = params;
params = params->next;
}
t->next = (WORD_LIST *)
((void *)0)
;
ret = string_list_pos_params (string[0], h, quoted, pflags);
if (t != params)
t->next = params;
dispose_words (save);
return (ret);
}
| int pos_params(char *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned long long *v1;
unsigned long long *v2;
unsigned long long *v3;
unsigned long long *v4;
unsigned long v5;
unsigned int v7;
if (a1 == a2) {
v7 = 0;
} else {
v2 = list_rest_of_args();
v1 = v2;
if (!v1 && a1 > 0) {
v7 = 0;
goto LABEL_409609;
}
if (!a1) {
v7 = make_word(dollar_vars);
v3 = make_word_list(v7, v2, v7);
v2 = v3;
v1 = v2;
}
v0 = a1;
while (true) {
if (!v2)
break;
if (v0 >= a1)
break;
v2 = *(v2);
v0 += 1;
}
if (!v2) {
dispose_words(v1);
v7 = 0;
} else {
v3 = v2;
v4 = v3;
while (true) {
if (!v2)
break;
if (v0 >= a2)
break;
v3 = v2;
v2 = *(v2);
v0 += 1;
}
*(v3) = 0;
v5 = string_list_pos_params(*(a0), v4, a3, a4, a4, a5);
if (v3 != v2)
*(v3) = v2;
dispose_words(v1);
v7 = v5;
}
}
LABEL_409609:
return v7;
}
|
static void print_type(FILE *f, __u8 type)
{
char buf[64];
const char *str = buf;
if (type == 0x0001)
str = "tun";
else if (type == 0x0002)
str = "tap";
else
snprintf(buf, sizeof(buf), "UNKNOWN:%hhu", type);
print_string(PRINT_ANY, "type", "type %s ", str);
}
| void print_type(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned long long v1;
char v2;
char v3;
unsigned long long *v5;
unsigned long long v6;
v0 = a0;
v1 = &v2;
if (a1 == 1) {
v1 = "tun";
} else if (a1 == 2) {
v1 = "tap";
} else {
snprintf(&v2, 0x40, "UNKNOWN:%hhu", a1);
}
print_string(0x4, "type", "type %s ", v1);
v6 = *(&v3) ^ v5[5];
return;
}
|
static void print_rx_sc(const char *prefix, __be64 sci, __u8 active,
struct rtattr *rxsc_stats, struct rtattr *sa)
{
struct rtattr *sa_attr[MACSEC_SA_ATTR_MAX + 1];
struct rtattr *a;
int rem;
print_string(PRINT_FP,
((void *)0)
, "%s", prefix);
print_0xhex(PRINT_ANY, "sci",
"RXSC: %016llx,", ((1==ntohl(1)) ? (sci) : ((uint64_t)ntohl((sci) & 0xFFFFFFFF) << 32) | ntohl((sci) >> 32)));
print_bool(PRINT_JSON, "active",
((void *)0)
, active);
print_string(PRINT_FP,
((void *)0)
,
" state %s\n", active ? "on" : "off");
print_rxsc_stats(prefix, rxsc_stats);
open_json_array(PRINT_JSON, "sa_list");
rem = ((int)((sa)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)));
for (a = ((void*)(((char*)(sa)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); ((rem) >= (int)sizeof(struct rtattr) && (a)->rta_len >= sizeof(struct rtattr) && (a)->rta_len <= (rem)); a = ((rem) -= ( (((a)->rta_len)+4U -1) & ~(4U -1) ), (struct rtattr*)(((char*)(a)) + ( (((a)->rta_len)+4U -1) & ~(4U -1) )))) {
_Bool
state;
open_json_object(
((void *)0)
);
(parse_rtattr_flags((sa_attr), (MACSEC_SA_ATTR_MAX), ((void*)(((char*)(a)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((a)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15)));
state = rta_getattr_u8(sa_attr[MACSEC_SA_ATTR_ACTIVE]);
print_string(PRINT_FP,
((void *)0)
, "%s", prefix);
print_string(PRINT_FP,
((void *)0)
, "%s", prefix);
print_uint(PRINT_ANY, "an", "%u:",
rta_getattr_u8(sa_attr[MACSEC_SA_ATTR_AN]));
print_uint(PRINT_ANY, "pn", " PN %u,",
rta_getattr_u32(sa_attr[MACSEC_SA_ATTR_PN]));
print_bool(PRINT_JSON, "active",
((void *)0)
, state);
print_string(PRINT_FP,
((void *)0)
, " state %s,",
state ? "on" : "off");
print_key(sa_attr[MACSEC_SA_ATTR_KEYID]);
print_rxsa_stats(prefix, sa_attr[MACSEC_SA_ATTR_STATS]);
close_json_object();
}
close_json_array(PRINT_JSON,
((void *)0)
);
}
| unsigned long print_rx_sc(
const char *a1,
long a2,
char a3,
unsigned short *a4,
unsigned short *a5)
{
unsigned long v5;
long v6;
const char *v7;
unsigned char v8;
unsigned int v9;
const char *v10;
bool v15;
int v16;
unsigned short *i;
char v18[8];
long v19;
long v20;
long v21;
unsigned short *v22;
unsigned short *v23;
unsigned long v24;
v24 = __readfsqword(0x28u);
print_string(1u, 0LL, "%s", (long)a1);
if ( ntohl(1u) == 1 )
{
v6 = a2;
}
else
{
v5 = (unsigned long)ntohl(a2) << 32;
v6 = v5 | ntohl(HIDWORD(a2));
}
print_0xhex(4u, (long)"sci", (long)"RXSC: %016llx,", v6);
print_bool(2u, (long)"active", 0LL, a3 != 0);
if ( a3 )
v7 = "on";
else
v7 = "off";
print_string(1u, 0LL, " state %s\n", (long)v7);
print_rxsc_stats(a1, a4);
open_json_array(2LL, "sa_list");
v16 = *a5 - 4;
for ( i = a5 + 2; v16 > 3 && *i > 3u && v16 >= *i; i = (unsigned short *)((char *)i + ((*i + 3) & 0xFFFFFFFC)) )
{
open_json_object(0LL);
parse_rtattr_flags(v18, 9LL, i + 2, (unsigned int)*i - 4, 0x8000LL);
v15 = (unsigned char)rta_getattr_u8(v20) != 0;
print_string(1u, 0LL, "%s", (long)a1);
print_string(1u, 0LL, "%s", (long)a1);
v8 = rta_getattr_u8(v19);
print_uint(4u, (long)"an", (long)"%u:", v8);
v9 = rta_getattr_u32(v21);
print_uint(4u, (long)"pn", (long)" PN %u,", v9);
print_bool(2u, (long)"active", 0LL, v15);
if ( v15 )
v10 = "on";
else
v10 = "off";
print_string(1u, 0LL, " state %s,", (long)v10);
print_key(v22);
print_rxsa_stats(a1, v23);
close_json_object(a1);
v16 -= (*i + 3) & 0xFFFFFFFC;
}
close_json_array(2LL, 0LL);
return __readfsqword(0x28u) ^ v24;
}
|
static int check_module_inuse(struct kmod_module *mod) {
struct kmod_list *holders;
int state, ret;
state = kmod_module_get_initstate(mod);
if (state == KMOD_MODULE_BUILTIN) {
log_printf(
3
, "Module %s is builtin.\n", kmod_module_get_name(mod));
return -
2
;
} else if (state < 0) {
log_printf(
3
, "Module %s is not currently loaded\n", kmod_module_get_name(mod))
;
return -
2
;
}
holders = kmod_module_get_holders(mod);
if (holders !=
((void *)0)
) {
struct kmod_list *itr;
log_printf(
3
, "Module %s is in use by:", kmod_module_get_name(mod));
for (itr = holders; itr !=
((void *)0)
; itr = kmod_list_next(holders, itr)) {
struct kmod_module *hm = kmod_module_get_module(itr);
fprintf(
stderr
, " %s", kmod_module_get_name(hm));
kmod_module_unref(hm);
}
fputc('\n',
stderr
);
kmod_module_unref_list(holders);
return -
16
;
}
ret = kmod_module_get_refcnt(mod);
if (ret > 0) {
log_printf(
3
, "Module %s is in use\n", kmod_module_get_name(mod));
return -
16
;
} else if (ret == -
2
) {
log_printf(
3
, "Module unloading is not supported\n");
}
return ret;
}
| int check_module_inuse(unsigned long long a0, unsigned long a1, unsigned long long a2) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
unsigned long long v4;
unsigned int v6;
v0 = kmod_module_get_initstate(a0);
if (!v0) {
log_printf(0x3, "Module %s is builtin.\n", kmod_module_get_name(a0));
v6 = -2;
} else if (v0 < 0) {
log_printf(0x3, "Module %s is not currently loaded\n", kmod_module_get_name(a0));
v6 = -2;
} else {
v3 = kmod_module_get_holders(a0);
if (!v3) {
v1 = kmod_module_get_refcnt(a0);
if (v1 > 0) {
log_printf(0x3, "Module %s is in use\n", kmod_module_get_name(a0));
v6 = -0x10;
} else {
if (v1 == -2)
log_printf(0x3, "Module unloading is not supported\n", a2);
v6 = v1;
}
} else {
log_printf(0x3, "Module %s is in use by:", kmod_module_get_name(a0));
for (v2 = v3; v2; v2 = kmod_list_next(v3, v2, v2)) {
v4 = kmod_module_get_module(v2);
fprintf(stderr, " %s", kmod_module_get_name(v4));
kmod_module_unref(v4);
}
fputc(0xa, stderr);
kmod_module_unref_list(v3);
v6 = -0x10;
}
}
return v6;
}
|
(r = sshbuf_put_string(msg, data, dlen)) != 0)
sshfatal("sftp-server.c", __func__, 591, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "compose");
send_msg(msg);
sshbuf_free(msg);
}
static void
send_data(u_int32_t id, const u_char *data, int dlen)
{
sshlog("sftp-server.c", __func__, 599, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "request %u: sent data len %d", id, dlen);
send_data_or_handle(103, id, data, dlen);
}
| void sshbuf_put_string(void)
{
halt_baddata();
}
|
static VALUE *
eval3 (
_Bool
evaluate)
{
VALUE *l;
VALUE *r;
enum { plus, minus } fxn;
l = eval4 (evaluate);
while (
1
)
{
if (nextarg ("+"))
fxn = plus;
else if (nextarg ("-"))
fxn = minus;
else
return l;
r = eval4 (evaluate);
if (evaluate)
{
if (!toarith (l) || !toarith (r))
((!!sizeof (struct { _Static_assert (EXPR_INVALID, "verify_expr (" "EXPR_INVALID" ", " "(error (EXPR_INVALID, 0, gettext (\"non-integer argument\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXPR_INVALID, 0, gettext ("non-integer argument")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXPR_INVALID, 0, gettext ("non-integer argument")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
(fxn == plus ?
__gmpz_add
:
__gmpz_sub
) (l->u.i, l->u.i, r->u.i);
}
freev (r);
}
}
| int eval3(unsigned long a0) {
unsigned int v0;
void* v1;
void* v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
v1 = eval4(a0);
while (true) {
v4 = nextarg("+");
if (v4) {
v0 = 0;
} else {
v4 = nextarg("-");
if (v4)
v0 = 1;
else
return v1;
}
if (v4 || v4) {
v2 = eval4(a0);
if (a0) {
*(&v4) = toarith(v1) ^ 1;
if (v4)
break;
if (!v4) {
*(&v4) = toarith(v2) ^ 1;
if (v4)
break;
if (!v4) {
if (!v0)
v5 = got.__gmpz_add;
else
v6 = got.__gmpz_sub;
reg_80(v1 + 8, v1 + 8, v2 + 8, v1 + 8);
}
}
}
freev(v2);
}
}
error(0x2, 0x0, gettext("non-integer argument"));
}
|
void
coproc_fdchk (fd)
int fd;
{
coproc_checkfd (&sh_coproc, fd);
}
| long long coproc_fdchk(unsigned long a0) {
return coproc_checkfd(&sh_coproc, a0);
}
|
cv_csearch(EditLine *el, int direction, wint_t ch, int count, int tflag)
{
wchar_t *cp;
if (ch == 0)
return 6;
if (ch == (wint_t)-1) {
wchar_t c;
if (el_wgetc(el, &c) != 1)
return ed_end_of_file(el, 0);
ch = c;
}
el->el_search.chacha = ch;
el->el_search.chadir = direction;
el->el_search.chatflg = (char)tflag;
cp = el->el_line.cursor;
while (count--) {
if ((wint_t)*cp == ch)
cp += direction;
for (;;cp += direction) {
if (cp >= el->el_line.lastchar)
return 6;
if (cp < el->el_line.buffer)
return 6;
if ((wint_t)*cp == ch)
break;
}
}
if (tflag)
cp -= direction;
el->el_line.cursor = cp;
if (el->el_chared.c_vcmd.action != 0x00) {
if (direction > 0)
el->el_line.cursor++;
cv_delfini(el);
return 4;
}
return 5;
}
| long long cv_csearch(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned int v0;
int tmp_9;
unsigned int v1;
char v2;
unsigned int *v3;
unsigned long long v5;
v1 = a2;
v0 = a3;
if (!v1) {
v5 = 6;
} else {
if (v1 == -1) {
if (el_wgetc(a0, &v2, &v2) == 1) {
v1 = *(&v2);
} else {
v5 = ed_end_of_file(a0, 0x0);
goto LABEL_40137a;
}
}
a0->field_4b0 = v1;
a0->field_4ac = a1;
a0->field_4b4 = a4;
v3 = a0->field_58;
while (true) {
tmp_9 = v0;
v0 -= 1;
if (!tmp_9) {
if (a4)
v3 = v3 + -(a1 << 2);
a0->field_58 = v3;
if (!a0->field_3c0) {
v5 = 5;
break;
} else {
if (a1 > 0)
a0->field_58 = a0->field_58 + 4;
cv_delfini(a0);
v5 = 4;
break;
}
} else {
if (*(v3) == v1)
v3 = &v3[a1];
while (true) {
if (v3 >= a0->field_60) {
v5 = 6;
goto LABEL_40137a;
} else if (v3 < a0->field_50) {
v5 = 6;
goto LABEL_40137a;
} else {
if (*(v3) == v1)
break;
v3 = &v3[a1];
}
}
}
}
}
LABEL_40137a:
return v5;
}
|
static
_Bool
record_exec_dir (struct exec_val *execp)
{
if (!execp->state.todo)
{
((void) sizeof ((
!execp->state.todo
) ? 1 : 0), __extension__ ({ if (
!execp->state.todo
) ; else __assert_fail (
"!execp->state.todo"
, "exec.c", 71, __extension__ __PRETTY_FUNCTION__); }))
;
if (strchr (state.rel_pathname, '/'))
{
char *dir = mdir_name (state.rel_pathname);
_Bool
result = initialize_wd_for_exec (execp, state.cwd_dir_fd, dir);
free (dir);
return result;
}
else
{
return initialize_wd_for_exec (execp, state.cwd_dir_fd, ".");
}
}
return
1
;
}
| int record_exec_dir(struct_0 *a0) {
char v0;
void* v1;
unsigned int v3;
if (a0->field_98) {
v3 = 1;
return v3;
} else if (a0->field_98) {
__assert_fail();
} else if (!strchr(mdir_name, 0x2f)) {
v3 = initialize_wd_for_exec(a0, *(&free), ".");
return v3;
} else {
v1 = mdir_name(mdir_name);
v0 = initialize_wd_for_exec(a0, *(&free), v1);
free(v1);
v3 = v0;
return v3;
}
}
|
static
_Bool
is_colored (enum indicator_no type)
{
size_t len = color_indicator[type].len;
char const *s = color_indicator[type].string;
return ! (len == 0
|| (len == 1 && strncmp (s, "" "0" "", sizeof ("0") - 1) == 0)
|| (len == 2 && strncmp (s, "" "00" "", sizeof ("00") - 1) == 0));
}
| undefined4 is_colored(uint param_1)
{
long lVar1;
char *__s1;
int iVar2;
undefined4 uVar3;
lVar1 = *(long *)(color_indicator + (ulong)param_1 * 0x10);
__s1 = *(char **)(color_indicator + (ulong)param_1 * 0x10 + 8);
if (lVar1 == 0) {
LAB_001014d4:
uVar3 = 0;
}
else {
if (lVar1 == 1) {
iVar2 = strncmp(__s1,"0",1);
if (iVar2 == 0) goto LAB_001014d4;
}
if (lVar1 == 2) {
iVar2 = strncmp(__s1,"00",2);
if (iVar2 == 0) goto LAB_001014d4;
}
uVar3 = 1;
}
return uVar3;
}
|
static void verify_provable_privkey(common_info_st * cinfo)
{
gnutls_privkey_t pkey;
int ret;
pkey = load_private_key(1, cinfo);
if (cinfo->seed_size > 0) {
ret = gnutls_privkey_verify_seed(pkey, 0, cinfo->seed, cinfo->seed_size);
} else {
ret = gnutls_privkey_verify_seed(pkey, 0,
((void *)0)
, 0);
}
if (ret < 0) {
if (ret == -1250)
fprintf(
stderr
, "The private key type cannot be associated with validated parameters\n");
else
fprintf(
stderr
, "Error verifying private key: %s\n", gnutls_strerror(ret));
app_exit(1);
}
printf("Key was verified\n");
gnutls_privkey_deinit(pkey);
return;
}
| void verify_provable_privkey(struct_0 *a0) {
unsigned int v0;
unsigned long long v1;
unsigned long long v3;
v1 = load_private_key(0x1, a0);
if (a0->field_98)
v0 = gnutls_privkey_verify_seed(v1, 0x0, a0->field_90, a0->field_98);
else
v0 = gnutls_privkey_verify_seed(v1, 0x0, 0x0, 0x0);
if (v0 >= 0) {
printf("Key was verified\n");
v3 = gnutls_privkey_deinit(v1);
return;
}
if (v0 != -1250)
fprintf(*(&stderr), "Error verifying private key: %s\n", gnutls_strerror(v0));
else
fprintf(*(&stderr), "The private key type cannot be associated with validated parameters\n");
app_exit(0x1);
}
|
static void
file_init(struct file *f, const char *filename)
{
struct varbuf usefilename = { 0, 0,
((void *)0)
};
varbuf_add_buf(&usefilename, instdir, strlen(instdir));
varbuf_add_buf(&usefilename, filename, strlen(filename));
varbuf_end_str(&usefilename);
f->name = varbuf_detach(&usefilename);
f->stat_state = FILE_STAT_INVALID;
}
| void file_init(undefined8 *param_1,char *param_2)
{
size_t sVar1;
undefined8 uVar2;
long in_FS_OFFSET;
undefined8 local_28;
undefined8 local_20;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_28 = 0;
local_20 = 0;
local_18 = 0;
sVar1 = strlen(instdir);
varbuf_add_buf(&local_28,instdir,sVar1);
sVar1 = strlen(param_2);
varbuf_add_buf(&local_28,param_2,sVar1);
varbuf_end_str(&local_28);
uVar2 = varbuf_detach(&local_28);
*param_1 = uVar2;
*(undefined4 *)(param_1 + 1) = 0;
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
clear_files (void)
{
for (size_t i = 0; i < cwd_n_used; i++)
{
struct fileinfo *f = sorted_file[i];
free_ent (f);
}
cwd_n_used = 0;
cwd_some_quoted =
0
;
any_has_acl =
0
;
inode_number_width = 0;
block_size_width = 0;
nlink_width = 0;
owner_width = 0;
group_width = 0;
author_width = 0;
scontext_width = 0;
major_device_number_width = 0;
minor_device_number_width = 0;
file_size_width = 0;
}
| long clear_files()
{
long result;
unsigned long i;
for ( i = 0LL; ; ++i )
{
result = cwd_n_used;
if ( i >= cwd_n_used )
break;
free_ent(*((void ***)sorted_file + i));
}
cwd_n_used = 0LL;
cwd_some_quoted = 0;
any_has_acl = 0;
inode_number_width = 0;
block_size_width = 0;
nlink_width = 0;
owner_width = 0;
group_width = 0;
author_width = 0;
scontext_width = 0;
major_device_number_width = 0;
minor_device_number_width = 0;
file_size_width = 0;
return result;
}
|
static void
re_edit (text)
char *text;
{
if (bash_input.type == st_stdin)
bash_re_edit (text);
}
| long re_edit(long a1)
{
long result;
result = bash_input;
if ( bash_input == 1 )
return bash_re_edit(a1);
return result;
}
|
static struct tm *
convert_time (struct tm *(*convert) (const time_t *, struct tm *),
long_int t, struct tm *tm)
{
time_t x = t;
return convert (&x, tm);
}
| void convert_time(code *param_1,undefined8 param_2,undefined8 param_3)
{
long in_FS_OFFSET;
undefined8 local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_18 = param_2;
(*param_1)(&local_18,param_3);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
copy_name (struct name_elt *ep)
{
const char *source;
size_t source_len;
source = ep->v.name;
source_len = strlen (source);
while (name_buffer_length <= source_len)
name_buffer = x2realloc(name_buffer, &name_buffer_length);
strcpy (name_buffer, source);
chopslash (name_buffer);
}
| long long copy_name(struct_0 *a0) {
char *v0;
unsigned long v1;
v0 = a0->field_18;
for (v1 = strlen(v0); v1 >= name_buffer_length; name_buffer = x2realloc(name_buffer, &name_buffer_length));
strcpy(name_buffer, v0);
return chopslash(name_buffer);
}
|
static void
process_close(u_int32_t id)
{
int r, handle, ret, status = 4;
if ((r = get_handle(iqueue, &handle)) != 0)
sshfatal("sftp-server.c", __func__, 789, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
sshlog("sftp-server.c", __func__, 791, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "request %u: close handle %u", id, handle);
handle_log_close(handle,
((void *)0)
);
ret = handle_close(handle);
status = (ret == -1) ? errno_to_portable(
(*__errno_location ())
) : 0;
send_status(id, status);
}
| long long process_close(unsigned long a0) {
unsigned long long v0;
unsigned long long v1;
unsigned int v2;
unsigned long v3;
unsigned int v4;
unsigned long v5;
char v6;
unsigned int v8;
v2 = 4;
v3 = get_handle(0xe87d894820ec8348, &v1);
if (v3) {
v0 = "parse";
sshfatal("sftp-server.c", "process_close", 0x315, 0x1, 0x1, ssh_err(v3));
}
v5 = *(&v1);
v3 = a0;
v1 = "request %u: close handle %u";
sshlog("sftp-server.c", "process_close", 0x317, 0x0, 0x7, 0x0, *(&v6));
handle_log_close(*(&v1), 0x0);
v4 = handle_close(*(&v1));
if (v4 == -1)
v8 = errno_to_portable(*(__errno_location()));
else
v8 = 0;
v2 = v8;
send_status(a0, v2);
return 0;
}
|
int e2fsck_ino_will_be_rebuilt(e2fsck_t ctx, ext2_ino_t ino)
{
if (!ctx->inodes_to_rebuild)
return 0;
return ext2fs_test_inode_bitmap2(ctx->inodes_to_rebuild, ino);
}
| long long e2fsck_ino_will_be_rebuilt(struct_0 *a0, unsigned long a1) {
void* v1;
if (!a0->field_3a0)
v1 = 0;
else
v1 = ext2fs_test_inode_bitmap2(a0->field_3a0, a1, a1);
return v1;
}
|
static void
alloc_ibuf (void)
{
if (ibuf)
return;
_Bool
extra_byte_for_swab = !!(conversions_mask & C_SWAB);
ibuf = alignalloc (page_size, input_blocksize + extra_byte_for_swab);
if (!ibuf)
{
char hbuf[((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3) + 1];
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"memory exhausted by input buffer of size %td bytes (%s)\"), input_blocksize, human_readable (input_blocksize, hbuf, human_opts | human_base_1024, 1, 1)), assume (false))" ")"); int _gl_dummy; })) ? ((nl_error (
1
, 0, gettext ("memory exhausted by input buffer of size %td bytes (%s)"), input_blocksize, human_readable (input_blocksize, hbuf, human_opts | human_base_1024, 1, 1)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((nl_error (
1
, 0, gettext ("memory exhausted by input buffer of size %td bytes (%s)"), input_blocksize, human_readable (input_blocksize, hbuf, human_opts | human_base_1024, 1, 1)), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
}
| void alloc_ibuf(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned int a5) {
char v0;
char v1;
char v2;
unsigned long long *v4;
unsigned long long v5;
if (!ibuf) {
v0 = (conversions_mask & 128);
ibuf = alignalloc(page_size, v0 + input_blocksize, v0 + input_blocksize);
if (!ibuf)
nl_error(0x1, 0x0, gettext("memory exhausted by input buffer of size %td bytes (%s)"), input_blocksize, human_readable(input_blocksize, &v1, 0x1f1, 0x1, 0x1), a5);
}
v5 = *(&v2) ^ v4[5];
return;
}
|
int
fsleep(sec, usec)
unsigned int sec, usec;
{
int e, r;
sigset_t blocked_sigs, prevmask;
struct timespec ts;
sigemptyset (&blocked_sigs);
sigaddset (&blocked_sigs,
17
);
ts.tv_sec = sec;
ts.tv_nsec = usec * 1000;
do
{
r = pselect(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &ts, &blocked_sigs);
e =
(*__errno_location ())
;
if (r < 0 &&
(*__errno_location ())
==
4
)
return -1;
(*__errno_location ())
= e;
}
while (r < 0 &&
(*__errno_location ())
==
4
);
return r;
}
| long long fsleep(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned long v3;
char v4;
unsigned long long v9;
sigemptyset(&v4);
sigaddset(&v4, 0x11);
v2 = a0;
v3 = a1 * 1000;
do {
v0 = pselect(0x0, 0x0, 0x0, 0x0, &v2, &v4);
v1 = *(__errno_location());
if (v0 < 0 && *(__errno_location()) == 4) {
v9 = 4294967295;
return v9;
}
*(__errno_location()) = v1;
} while (v0 < 0 && *(__errno_location()) == 4);
v9 = v0;
return v9;
}
|
static void
print_function_def (func)
FUNCTION_DEF *func;
{
COMMAND *cmdcopy;
REDIRECT *func_redirects;
func_redirects =
((void *)0)
;
if (posixly_correct == 0)
cprintf ("function %s () \n", func->name->word);
else
cprintf ("%s () \n", func->name->word);
add_unwind_protect (reset_locals, 0);
indent (indentation);
cprintf ("{ \n");
inside_function_def++;
indentation += indentation_amount;
cmdcopy = copy_command (func->command);
if (cmdcopy->type == cm_group)
{
func_redirects = cmdcopy->redirects;
cmdcopy->redirects = (REDIRECT *)
((void *)0)
;
}
make_command_string_internal (cmdcopy->type == cm_group
? cmdcopy->value.Group->command
: cmdcopy);
do { if (deferred_heredocs) print_deferred_heredocs (""); } while (0);
remove_unwind_protect ();
indentation -= indentation_amount;
inside_function_def--;
if (func_redirects)
{
newline ("} ");
print_redirection_list (func_redirects);
cmdcopy->redirects = func_redirects;
}
else
newline ("}");
| long print_function_def(long a1, long a2, long a3, long a4, long a5, long a6)
{
long v6;
long v7;
long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
long v14;
long v15;
long v16;
long v17;
unsigned int *v18;
long v19;
long v20;
long v21;
long v22;
long v23;
long v24;
long v25;
long v26;
long v27;
long v28;
long v29;
long v30;
long v32;
long v33;
v32 = 0LL;
if ( posixly_correct )
cprintf("%s () \n", **(_QWORD **)(a1 + 8), a3, a4, a5, a6);
else
cprintf("function %s () \n", **(_QWORD **)(a1 + 8), a3, a4, a5, a6);
add_unwind_protect(reset_locals, 0LL);
indent(indentation, 0LL, v6, v7, v8, v9);
cprintf("{ \n", 0LL, v10, v11, v12, v13);
++inside_function_def;
indentation += indentation_amount;
v33 = copy_command(*(_QWORD *)(a1 + 16));
if ( *(_DWORD *)v33 == 9 )
{
v32 = *(_QWORD *)(v33 + 16);
*(_QWORD *)(v33 + 16) = 0LL;
}
if ( *(_DWORD *)v33 == 9 )
v18 = *(unsigned int **)(*(_QWORD *)(v33 + 24) + 8LL);
else
v18 = (unsigned int *)v33;
make_command_string_internal(v18, 0LL, v14, v15, v16, v17);
if ( deferred_heredocs )
print_deferred_heredocs(&unk_3583, 0LL, v19, v20, v21, v22);
remove_unwind_protect();
v26 = (unsigned int)(indentation - indentation_amount);
indentation -= indentation_amount;
--inside_function_def;
if ( v32 )
{
newline("} ", 0LL, v26, v23, v24, v25);
print_redirection_list(v32, 0LL, v27, v28, v29, v30);
*(_QWORD *)(v33 + 16) = v32;
}
else
{
newline("}", 0LL, v26, v23, v24, v25);
}
|
void
el_resize(EditLine *el)
{
int lins, cols;
sigset_t oset, nset;
(void) sigemptyset(&nset);
(void) sigaddset(&nset,
28
);
(void) sigprocmask(
0
, &nset, &oset);
if (terminal_get_size(el, &lins, &cols))
terminal_change_size(el, lins, cols);
(void) sigprocmask(
2
, &oset,
((void *)0)
);
}
| void el_resize(undefined8 param_1)
{
int iVar1;
long in_FS_OFFSET;
undefined4 local_120;
undefined4 local_11c;
sigset_t local_118;
sigset_t local_98;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
sigemptyset(&local_98);
sigaddset(&local_98,0x1c);
sigprocmask(0,&local_98,&local_118);
iVar1 = terminal_get_size(param_1,&local_120,&local_11c);
if (iVar1 != 0) {
terminal_change_size(param_1,local_120,local_11c);
}
sigprocmask(2,&local_118,(sigset_t *)0x0);
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static uchar*
getDfltTpl(void)
{
if(loadModConf !=
((void *)0)
&& loadModConf->tplName !=
((void *)0)
)
return loadModConf->tplName;
else if(pszFileDfltTplName ==
((void *)0)
)
return (uchar*)"RSYSLOG_FileFormat";
else
return pszFileDfltTplName;
}
| char * getDfltTpl(void)
{
char *pcVar1;
if ((loadModConf == 0) || (*(long *)(loadModConf + 8) == 0)) {
pcVar1 = pszFileDfltTplName;
if (pszFileDfltTplName == (char *)0x0) {
pcVar1 = "RSYSLOG_FileFormat";
}
}
else {
pcVar1 = *(char **)(loadModConf + 8);
}
return pcVar1;
}
|
static int
parse_revoked_certs(struct sshbuf *buf, struct ssh_krl *krl)
{
int r = -1;
u_char type;
const u_char *blob;
size_t blen, nbits;
struct sshbuf *subsect =
((void *)0)
;
u_int64_t serial, serial_lo, serial_hi;
struct bitmap *bitmap =
((void *)0)
;
char *key_id =
((void *)0)
;
struct sshkey *ca_key =
((void *)0)
;
if ((subsect = sshbuf_new()) ==
((void *)0)
)
return -2;
if ((r = sshbuf_get_string_direct(buf, &blob, &blen)) != 0 ||
(r = sshbuf_get_string_direct(buf,
((void *)0)
,
((void *)0)
)) != 0)
goto out;
if (blen != 0 && (r = sshkey_from_blob(blob, blen, &ca_key)) != 0)
goto out;
while (sshbuf_len(buf) > 0) {
sshbuf_free(subsect);
subsect =
((void *)0)
;
if ((r = sshbuf_get_u8(buf, &type)) != 0 ||
(r = sshbuf_froms(buf, &subsect)) != 0)
goto out;
;
switch (type) {
case 0x20:
while (sshbuf_len(subsect) > 0) {
if ((r = sshbuf_get_u64(subsect, &serial)) != 0)
goto out;
if ((r = ssh_krl_revoke_cert_by_serial(krl,
ca_key, serial)) != 0)
goto out;
}
break;
case 0x21:
if ((r = sshbuf_get_u64(subsect, &serial_lo)) != 0 ||
(r = sshbuf_get_u64(subsect, &serial_hi)) != 0)
goto out;
if ((r = ssh_krl_revoke_cert_by_serial_range(krl,
ca_key, serial_lo, serial_hi)) != 0)
goto out;
break;
case 0x22:
if ((bitmap = bitmap_new()) ==
((void *)0)
) {
r = -2;
goto out;
}
if ((r = sshbuf_get_u64(subsect, &serial_lo)) != 0 ||
(r = sshbuf_get_bignum2_bytes_direct(subsect,
&blob, &blen)) != 0)
goto out;
if (bitmap_from_string(bitmap, blob, blen) != 0) {
r = -4;
goto out;
}
nbits = bitmap_nbits(bitmap);
for (serial = 0; serial < (u_int64_t)nbits; serial++) {
if (serial > 0 && serial_lo + serial == 0) {
sshlog("krl.c", __func__, 908, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "bitmap wraps u64");
r = -4;
goto out;
}
if (!bitmap_test_bit(bitmap, serial))
continue;
if ((r = ssh_krl_revoke_cert_by_serial(krl,
ca_key, serial_lo + serial)) != 0)
goto out;
}
bitmap_free(bitmap);
bitmap =
((void *)0)
;
break;
case 0x23:
while (sshbuf_len(subsect) > 0) {
if ((r = sshbuf_get_cstring(subsect,
&key_id,
((void *)0)
)) != 0)
goto out;
if ((r = ssh_krl_revoke_cert_by_key_id(krl,
ca_key, key_id)) != 0)
goto out;
free(key_id);
key_id =
((void *)0)
;
}
break;
default:
sshlog("krl.c", __func__, 934, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "Unsupported KRL certificate section %u", type);
r = -4;
goto out;
}
if (sshbuf_len(subsect) > 0) {
sshlog("krl.c", __func__, 939, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "KRL certificate section contains unparsed data");
r = -4;
goto out;
}
}
r = 0;
out:
if (bitmap !=
((void *)0)
)
bitmap_free(bitmap);
free(key_id);
sshkey_free(ca_key);
sshbuf_free(subsect);
return r;
}
| int parse_revoked_certs(unsigned long long a0, unsigned long long a1) {
unsigned long v0;
char v1;
unsigned int v2;
char v3;
char v4;
void* v5;
void* v6;
char v7;
char v8;
void* v9;
void* v10;
void* v11;
unsigned long v12;
unsigned int v14;
unsigned int v15;
v2 = -1;
v5 = 0;
v11 = 0;
v9 = 0;
v10 = 0;
v5 = sshbuf_new();
if (!v5) {
v14 = -2;
} else {
v2 = sshbuf_get_string_direct(a0, &v3, &v4, &v3);
if (!v2) {
v2 = sshbuf_get_string_direct(a0, 0x0, 0x0, &v3);
if (!v2) {
if (*(&v4))
v2 = sshkey_from_blob(*(&v3), *(&v4), &v10, *(&v4));
do {
if (!sshbuf_len(a0))
v2 = 0;
sshbuf_free(v5);
v5 = 0;
v2 = sshbuf_get_u8(a0, &v1, &v1);
if (v2)
LABEL_4055f6:
v2 = sshbuf_froms(a0, &v5, &v5);
if (!(!v2))
goto LABEL_4055f6;
v15 = v1;
if (v1 != 35) {
if (v15 <= 35) {
if (v15 == 34) {
v11 = bitmap_new();
if (!v11)
v2 = -2;
v2 = sshbuf_get_u64(v5, &v7, &v7);
if (!v2) {
v2 = sshbuf_get_bignum2_bytes_direct(v5, &v3, &v4, &v3);
if (!v2) {
if (!bitmap_from_string(v11, *(&v3), *(&v4), *(&v3))) {
v12 = bitmap_nbits(v11);
v6 = 0;
while (true) {
if (v12 <= v6) {
bitmap_free(v11);
v11 = 0;
break;
} else {
if (v6 && !v6 + *(&v7)) {
sshlog("krl.c", "parse_revoked_certs", 0x38c, 0x1, 0x2, 0x0, "bitmap wraps u64");
v2 = -0x4;
}
if (bitmap_test_bit(v11, v6, v6))
v2 = ssh_krl_revoke_cert_by_serial(a1, v10, *(&v7) + v6);
v6 += 1;
}
}
} else {
v2 = -0x4;
}
goto LABEL_40557a;
}
}
} else if (v15 <= 34) {
if (v15 == 32) {
while (true) {
if (!sshbuf_len(v5))
break;
v2 = sshbuf_get_u64(v5, &v6, &v6);
if (!(!v2))
goto LABEL_0x40560c;
v2 = ssh_krl_revoke_cert_by_serial(a1, v10, *(&v6));
}
}
if (v15 == 33) {
v2 = sshbuf_get_u64(v5, &v7, &v7);
if (!v2) {
v2 = sshbuf_get_u64(v5, &v8, &v8);
if (!v2)
v2 = ssh_krl_revoke_cert_by_serial_range(a1, v10, *(&v7), *(&v8));
}
}
}
}
v0 = v1;
sshlog("krl.c", "parse_revoked_certs", 0x3a6, 0x0, 0x2, 0x0, "Unsupported KRL certificate section %u");
v2 = -0x4;
}
while (true) {
if (!sshbuf_len(v5))
break;
v2 = sshbuf_get_cstring(v5, &v9, 0x0, &v9);
if (!(!v2))
goto LABEL_0x40560c;
v2 = ssh_krl_revoke_cert_by_key_id(a1, v10, v9);
if (!(!v2))
goto LABEL_0x40560c;
free(v9);
v9 = 0;
}
LABEL_40557a:
} while (!sshbuf_len(v5));
sshlog("krl.c", "parse_revoked_certs", 0x3ab, 0x0, 0x2, 0x0, "KRL certificate section contains unparsed data");
v2 = -0x4;
}
}
if (v11)
bitmap_free(v11);
free(v9);
sshkey_free(v10);
sshbuf_free(v5);
v14 = v2;
}
return v14;
}
|
char *
filesystem_type (const struct stat *statp, const char *path)
{
static
_Bool
fstype_known =
0
;
static char *current_fstype =
((void *)0)
;
static dev_t current_dev;
if (current_fstype !=
((void *)0)
)
{
if (fstype_known && statp->st_dev == current_dev)
return current_fstype;
free (current_fstype);
}
current_dev = statp->st_dev;
current_fstype = file_system_type_uncached (statp, path, &fstype_known);
return current_fstype;
}
| long long filesystem_type(unsigned long long *a0, unsigned int a1) {
unsigned long long v1;
if (current_fstype.5906) {
if (fstype_known.5905 && *(a0) == current_dev.5907) {
v1 = current_fstype.5906;
goto LABEL_400145;
}
free(current_fstype.5906);
}
current_dev.5907 = *(a0);
current_fstype.5906 = file_system_type_uncached(a0, a1, &fstype_known.5905);
v1 = current_fstype.5906;
LABEL_400145:
return v1;
}
|
void
sv_histignore (name)
char *name;
{
setup_history_ignore (name);
}
| void sv_histignore(unsigned long long a0) {
unsigned long long v1;
v1 = setup_history_ignore(a0);
return;
}
|
static int jread(struct buffer_head **bhp, journal_t *journal,
unsigned int offset)
{
int err;
unsigned long long blocknr;
struct buffer_head *bh;
*bhp =
((void *)0)
;
if (offset >= journal->j_total_len) {
printf("" "JBD2: corrupted journal superblock\n");
return -(2133571502L);
}
err = jbd2_journal_bmap(journal, offset, &blocknr);
if (err) {
printf("" "JBD2: bad block at offset %u\n",
offset);
return err;
}
bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
if (!bh)
return -
12
;
if (!buffer_uptodate(bh)) {
if (!1)
do {} while (0);
wait_on_buffer(bh);
}
if (!buffer_uptodate(bh)) {
printf("" "JBD2: Failed to read block at offset %u\n",
offset);
brelse(bh);
return -
5
;
}
*bhp = bh;
return 0;
}
| int jread(unsigned long long *a0, struct_0 *a1, unsigned long a2) {
unsigned int v0;
char v1;
unsigned long long v2;
unsigned int v4;
*(a0) = 0;
if (a2 >= a1->field_80) {
printf("JBD2: corrupted journal superblock\n");
v4 = 2161395794;
return v4;
}
v0 = jbd2_journal_bmap(a1, a2, &v1, a2);
if (v0) {
printf("JBD2: bad block at offset %u\n", a2);
v4 = v0;
return v4;
}
v2 = getblk(a1->field_68, *(&v1), a1->field_78, *(&v1));
if (!v2) {
v4 = -12;
return v4;
}
if (!buffer_uptodate(v2))
wait_on_buffer(v2);
if (buffer_uptodate(v2)) {
*(a0) = v2;
v4 = 0;
return v4;
}
printf("JBD2: Failed to read block at offset %u\n", a2);
brelse(v2);
v4 = -5;
return v4;
}
|
void
usage (int status)
{
if (status !=
0
)
{
fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name);
exit (status);
}
fprintf (
stdout
, gettext ("Usage: %s [-H] [-L] [-P] [-Olevel] [-D debugopts] [path...] [expression]\n")
,
program_name);
fputs (gettext ("\nDefault path is the current directory; default expression is -print.\nExpression may consist of: operators, options, tests, and actions.\n"),
stdout
);
;
fputs (gettext ("\nOperators (decreasing precedence; -and is implicit where no others are given):\n ( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2\n EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2\n"),
stdout
);
;
fputs (gettext ("\nPositional options (always true):\n -daystart -follow -nowarn -regextype -warn\n"),
stdout
);
;
fputs (gettext ("\nNormal options (always true, specified before other expressions):\n -depth -files0-from FILE -maxdepth LEVELS -mindepth LEVELS\n -mount -noleaf -xdev -ignore_readdir_race -noignore_readdir_race\n"),
stdout
);
;
fputs (gettext ("\nTests (N can be +N or -N or N):\n -amin N -anewer FILE -atime N -cmin N -cnewer FILE -context CONTEXT\n -ctime N -empty -false -fstype TYPE -gid N -group NAME -ilname PATTERN\n -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN\n -links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE\n -nouser -nogroup -path PATTERN -perm [-/]MODE -regex PATTERN\n -readable -writable -executable\n -wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N\n -used N -user NAME -xtype [bcdpfls]\n"),
stdout
);
;
fputs (gettext ("\nActions:\n -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print \n -fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit\n -exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;\n -execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;\n"),
stdout
);
;
fputs (gettext ("\nOther common options:\n"),
stdout
);
;
fputs (gettext (" --help display this help and exit\n"),
stdout
);;
fputs (gettext (" --version output version information and exit\n\n"),
stdout
);;
show_valid_debug_options (0);
fputs (gettext ("\nUse '-D help' for a description of the options, or see find(1)\n\n"),
stdout
);
;
explain_how_to_report_bugs (
stdout
, program_name);
exit (status);
}
| void usage(unsigned long a0) {
unsigned long v0;
unsigned long v2;
v0 = v2;
if (!a0) {
fprintf(stdout, gettext("Usage: %s [-H] [-L] [-P] [-Olevel] [-D debugopts] [path...] [expression]\n"));
fputs(gettext("\nDefault path is the current directory; default expression is -print.\nExpression may consist of: operators, options, tests, and actions.\n"), stdout);
fputs(gettext("\nOperators (decreasing precedence; -and is implicit where no others are given):\n ( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2\n EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2\n"), stdout);
fputs(gettext("\nPositional options (always true):\n -daystart -follow -nowarn -regextype -warn\n"), stdout);
fputs(gettext("\nNormal options (always true, specified before other expressions):\n -depth -files0-from FILE -maxdepth LEVELS -mindepth LEVELS\n -mount -noleaf -xdev -ignore_readdir_race -noignore_readdir_race\n"), stdout);
fputs(gettext("\nTests (N can be +N or -N or N):\n -amin N -anewer FILE -atime N -cmin N -cnewer FILE -context CONTEXT\n -ctime N -empty -false -fstype TYPE -gid N -group NAME -ilname PATTERN\n -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN\n -links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE\n -nouser -nogroup -path PATTERN -perm [-/]MODE -regex PATTERN\n -readable -writable -executable\n -wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N\n -used N -user NAME -xtype [bcdpfls]\n"), stdout);
fputs(gettext("\nActions:\n -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print \n -fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit\n -exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;\n -execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;\n"), stdout);
fputs(gettext("\nOther common options:\n"), stdout);
fputs(gettext(" --help display this help and exit\n"), stdout);
fputs(gettext(" --version output version information and exit\n\n"), stdout);
show_valid_debug_options(0x0);
fputs(gettext("\nUse '-D help' for a description of the options, or see find(1)\n\n"), stdout);
explain_how_to_report_bugs(stdout, program_name, program_name);
exit(a0);
}
fprintf(stderr, gettext("Try '%s --help' for more information.\n"));
exit(a0);
}
|
static
void mainSimpleSort ( UInt32* ptr,
UChar* block,
UInt16* quadrant,
Int32 nblock,
Int32 lo,
Int32 hi,
Int32 d,
Int32* budget )
{
Int32 i, j, h, bigN, hp;
UInt32 v;
bigN = hi - lo + 1;
if (bigN < 2) return;
hp = 0;
while (incs[hp] < bigN) hp++;
hp--;
for (; hp >= 0; hp--) {
h = incs[hp];
i = lo + h;
while (((Bool)1)) {
if (i > hi) break;
v = ptr[i];
j = i;
while ( mainGtU (
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
) ) {
ptr[j] = ptr[j-h];
j = j - h;
if (j <= (lo + h - 1)) break;
}
ptr[j] = v;
i++;
if (i > hi) break;
v = ptr[i];
j = i;
while ( mainGtU (
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
) ) {
ptr[j] = ptr[j-h];
j = j - h;
if (j <= (lo + h - 1)) break;
}
ptr[j] = v;
i++;
if (i > hi) break;
v = ptr[i];
j = i;
while ( mainGtU (
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
) ) {
ptr[j] = ptr[j-h];
j = j - h;
if (j <= (lo + h - 1)) break;
}
ptr[j] = v;
i++;
if (*budget < 0) return;
}
}
}
| void mainSimpleSort(unsigned int *a0, char *a1, unsigned short *a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned int v6, unsigned int *a6) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v11;
unsigned long long v13;
unsigned long long v15;
v7 = a5 - a4 + 1;
v3 = a5 - a4 + 1;
if (v3 > 1) {
v2 = 0;
while (true) {
v8 = incs[v2];
if (v3 <= incs[v2])
break;
v2 += 1;
}
v2 -= 1;
while (v2 >= 0) {
v4 = incs[v2];
v0 = v4 + a4;
while (true) {
v9 = v0;
if (v0 <= a5) {
v5 = a0[v0];
v1 = v0;
do {
if (!mainGtU(a0[v1 + -1 * v4] + v6, v6 + v5, a1, a2, a3, a6))
break;
a0[v1] = a0[v1 + -1 * v4];
v1 -= v4;
} while (v1 >= v4 + a4);
a0[v1] = v5;
v0 += 1;
v11 = v0;
if (v0 <= a5) {
v5 = a0[v0];
v1 = v0;
do {
if (!mainGtU(a0[v1 + -1 * v4] + v6, v6 + v5, a1, a2, a3, a6))
break;
a0[v1] = a0[v1 + -1 * v4];
v1 -= v4;
} while (v1 >= v4 + a4);
a0[v1] = v5;
v0 += 1;
v13 = v0;
if (v0 <= a5) {
v5 = a0[v0];
v1 = v0;
do {
if (!mainGtU(a0[v1 + -1 * v4] + v6, v6 + v5, a1, a2, a3, a6))
break;
a0[v1] = a0[v1 + -1 * v4];
v1 -= v4;
} while (v1 >= v4 + a4);
a0[v1] = v5;
v0 += 1;
v15 = *(a6);
if (*(a6) < 0)
break;
}
}
}
if (v0 > a5 || v0 > a5 || v0 > a5) {
v2 -= 1;
break;
}
}
if (v0 <= a5 && v0 <= a5 && *(a6) < 0)
break;
}
}
return;
}
|
static void help(void)
{
printf("Usage:\n"
"\t%s [options] filename [args]\n"
"Options:\n"
"\t-V, --version show version\n"
"\t-h, --help show this help\n",
program_invocation_short_name);
}
| void help() {
unsigned long long v1;
v1 = printf("Usage:\n\t%s [options] filename [args]\nOptions:\n\t-V, --version show version\n\t-h, --help show this help\n", program_invocation_short_name);
return;
}
|
int
rl_delete_text (int from, int to)
{
register char *text;
register int diff, i;
if (from > to)
do { int t; t = from; from = to; to = t; } while (0);
if (to > rl_end)
{
to = rl_end;
if (from > to)
from = to;
}
if (from < 0)
from = 0;
text = rl_copy_text (from, to);
diff = to - from;
for (i = from; i < rl_end - diff; i++)
rl_line_buffer[i] = rl_line_buffer[i + diff];
if (_rl_doing_an_undo == 0)
rl_add_undo (UNDO_DELETE, from, to, text);
else
xfree (text);
rl_end -= diff;
rl_line_buffer[rl_end] = '\0';
_rl_fix_mark ();
return (diff);
}
| long rl_delete_text(signed int a1, signed int a2)
{
long v2;
unsigned int v3;
int i;
unsigned int v6;
int v7;
v7 = a1;
v6 = a2;
if ( a1 > a2 )
{
v7 = a2;
v6 = a1;
}
if ( (int)v6 > rl_end )
{
v6 = rl_end;
if ( v7 > rl_end )
v7 = rl_end;
}
if ( v7 < 0 )
v7 = 0;
v2 = rl_copy_text((unsigned int)v7, v6);
v3 = v6 - v7;
for ( i = v7; i < (int)(rl_end - v3); ++i )
rl_line_buffer[i] = rl_line_buffer[i + v3];
if ( rl_doing_an_undo )
xfree(v2);
else
rl_add_undo(0LL, (unsigned int)v7, v6, v2);
rl_end -= v3;
rl_line_buffer[rl_end] = 0;
rl_fix_mark();
return v3;
}
|
char *
string_list_dollar_star (list, quoted, flags)
WORD_LIST *list;
int quoted, flags;
{
char *ret;
char sep[
(__ctype_get_mb_cur_max ())
+ 1];
if (ifs_firstc_len == 1)
{
sep[0] = ifs_firstc[0];
sep[1] = '\0';
}
else
{
memcpy (sep, ifs_firstc, ifs_firstc_len);
sep[ifs_firstc_len] = '\0';
}
ret = string_list_internal (list, sep);
return ret;
}
| int string_list_dollar_star(void* a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned int v0;
unsigned int v1;
char v2;
char v3[425802354520363005];
unsigned long v4;
unsigned long long v5;
char v6;
unsigned long v8;
v1 = a1;
v0 = a2;
for (v8 = (0 CONCAT __ctype_get_mb_cur_max(a0, a1, a2, a3, a4, a5, *(&v0), a0, *(&v2)) + 16) /m 16 * 16; &v6 != &v0 + -1 * (v8 & -0x1000); v5 = *(&v5));
if ((v8 & 4095))
*((&v5 + (v8 & 4095))) = *((&v5 + (v8 & 4095)));
*(&v3[0]) = &v6;
if (false) {
v3[0] = 1480919671367579151;
v3[1] = 0;
} else {
memcpy(v3, &ifs_firstc, 0x5e8c0fc45b60ffc);
v3[425802354520363004] = 0;
}
v4 = string_list_internal(a0, v3);
return v4;
}
|
static
_Bool
one_argument (void)
{
return argv[pos++][0] != '\0';
}
| bool one_argument()
{
int v0;
v0 = pos++;
return **(_BYTE **)(argv + 8LL * v0) != 0;
}
|
static int
do_assignment_internal (word, expand)
const WORD_DESC *word;
int expand;
{
int offset, appendop, assign_list, aflags, retval;
char *name, *value, *temp;
SHELL_VAR *entry;
char *t;
int ni;
const char *string;
if (word == 0 || word->word == 0)
return 0;
appendop = assign_list = aflags = 0;
string = word->word;
offset = assignment (string, 0);
name = (char *)strcpy (sh_xmalloc((1 + strlen (string)), "subst.c", 3556), (string));
value = (char *)
((void *)0)
;
if (name[offset] == '=')
{
if (name[offset - 1] == '+')
{
appendop = 1;
name[offset - 1] = '\0';
}
name[offset] = 0;
temp = name + offset + 1;
if (expand && (word->flags & (1 << 15)))
{
assign_list = ni = 1;
value = extract_array_assignment_list (temp, &ni);
}
else
if (expand && temp[0])
value = expand_string_if_necessary (temp, 0, expand_string_assignment);
else
value = (char *)strcpy (sh_xmalloc((1 + strlen (temp)), "subst.c", 3581), (temp));
}
if (value == 0)
{
value = (char *)sh_xmalloc((1), "subst.c", 3586);
value[0] = '\0';
}
if (echo_command_at_execute)
{
if (appendop)
name[offset - 1] = '+';
xtrace_print_assignment (name, value, assign_list, 1);
if (appendop)
name[offset - 1] = '\0';
}
if (appendop)
aflags |= 0x0001;
if (t = mbschr (name, '['))
{
if (assign_list)
{
report_error (gettext("%s: cannot assign list to array member"), name);
do { do { if (value) sh_xfree((value), "subst.c", 3610); } while (0); sh_xfree((name), "subst.c", 3610); return (0); } while (0);
}
aflags |= 0x0800;
entry = assign_array_element (name, value, aflags, (array_eltstate_t *)0);
if (entry == 0)
do { do { if (value) sh_xfree((value), "subst.c", 3615); } while (0); sh_xfree((name), "subst.c", 3615); return (0); } while (0);
}
else if (assign_list)
{
if ((word->flags & (1 << 17)) && (word->flags & (1 << 28)))
aflags |= 0x0040;
if ((word->flags & (1 << 17)) && (word->flags & (1 << 25)) == 0)
aflags |= 0x0002;
if ((word->flags & (1 << 17)) && (word->flags & (1 << 25)))
aflags |= 0x0008;
if (word->flags & (1 << 22))
aflags |= 0x0004;
entry = do_compound_assignment (name, value, aflags);
}
else
entry = bind_variable (name, value, aflags);
if (entry)
stupidly_hack_special_variables (entry->name);
else
stupidly_hack_special_variables (name);
if (entry == 0 || ((((entry)->attributes) & (0x0000002))))
retval = 0;
else if (((((entry)->attributes) & (0x0004000))))
{
set_exit_status (1);
retval = 1;
}
else
retval = 1;
if (entry && retval != 0 && ((((entry)->attributes) & (0x0004000))) == 0)
((entry)->attributes &= ~(0x0001000));
do { do { if (value) sh_xfree((value), "subst.c", 3652); } while (0); sh_xfree((name), "subst.c", 3652); return (retval); } while (0);
}
| long do_assignment_internal(long a1, int a2)
{
size_t v3;
char *v4;
size_t v5;
char *v6;
char *v7;
int v8;
int v9;
int v10;
unsigned int v11;
unsigned int v12;
unsigned int v13;
int v14;
_BYTE *v15;
long v16;
char *s;
char *v18;
char *src;
unsigned long v21;
v21 = __readfsqword(0x28u);
if ( !a1 || !*(_QWORD *)a1 )
return 0LL;
v12 = 0;
v11 = 0;
v10 = 0;
s = *(char **)a1;
v14 = assignment(s, 0LL);
v3 = strlen(s);
v4 = (char *)sh_xmalloc(v3 + 1, "subst.c", 3556LL);
v18 = strcpy(v4, s);
v15 = 0LL;
if ( v18[v14] == 61 )
{
if ( v18[v14 - 1] == 43 )
{
v10 = 1;
v18[v14 - 1] = 0;
}
v18[v14] = 0;
src = &v18[v14 + 1];
if ( a2 && (*(_DWORD *)(a1 + 8) & 0x8000) != 0 )
{
v9 = 1;
v11 = 1;
v15 = (_BYTE *)extract_array_assignment_list(src, &v9);
}
else if ( a2 && *src )
{
v15 = expand_string_if_necessary(src, 0, (long ( *)(const char *, _QWORD))expand_string_assignment);
}
else
{
v5 = strlen(src);
v6 = (char *)sh_xmalloc(v5 + 1, "subst.c", 3581LL);
v15 = strcpy(v6, src);
}
}
if ( !v15 )
{
v15 = (_BYTE *)sh_xmalloc(1LL, "subst.c", 3586LL);
*v15 = 0;
}
if ( echo_command_at_execute )
{
if ( v10 )
v18[v14 - 1] = 43;
xtrace_print_assignment(v18, v15, v11, 1LL);
if ( v10 )
v18[v14 - 1] = 0;
}
if ( v10 )
v12 |= 1u;
if ( mbschr(v18, 91LL) )
{
if ( v11 )
{
v7 = gettext("%s: cannot assign list to array member");
report_error(v7, v18);
if ( v15 )
sh_xfree(v15, "subst.c", 3610LL);
sh_xfree(v18, "subst.c", 3610LL);
return 0LL;
}
v12 |= 0x800u;
v16 = assign_array_element(v18, v15, v12, 0LL);
if ( !v16 )
{
if ( v15 )
sh_xfree(v15, "subst.c", 3615LL);
sh_xfree(v18, "subst.c", 3615LL);
return 0LL;
}
}
else if ( v11 )
{
if ( (*(_DWORD *)(a1 + 8) & 0x20000) != 0 && (*(_DWORD *)(a1 + 8) & 0x10000000) != 0 )
v12 |= 0x40u;
if ( (*(_DWORD *)(a1 + 8) & 0x20000) != 0 && (*(_DWORD *)(a1 + 8) & 0x2000000) == 0 )
v12 |= 2u;
if ( (*(_DWORD *)(a1 + 8) & 0x20000) != 0 && (*(_DWORD *)(a1 + 8) & 0x2000000) != 0 )
v12 |= 8u;
if ( (*(_DWORD *)(a1 + 8) & 0x400000) != 0 )
v12 |= 4u;
v16 = do_compound_assignment((long)v18, (long)v15, v12);
}
else
{
v16 = bind_variable(v18, v15, v12);
}
if ( v16 )
stupidly_hack_special_variables(*(_QWORD *)v16);
else
stupidly_hack_special_variables(v18);
if ( v16 && (*(_DWORD *)(v16 + 40) & 2) == 0 )
{
if ( (*(_DWORD *)(v16 + 40) & 0x4000) != 0 )
set_exit_status(1LL);
v13 = 1;
}
else
{
v13 = 0;
}
if ( v16 && v13 && (*(_DWORD *)(v16 + 40) & 0x4000) == 0 )
{
v8 = *(_DWORD *)(v16 + 40);
BYTE1(v8) &= ~0x10u;
*(_DWORD *)(v16 + 40) = v8;
}
if ( v15 )
sh_xfree(v15, "subst.c", 3652LL);
sh_xfree(v18, "subst.c", 3652LL);
return v13;
}
|
void
initialize_terminating_signals ()
{
register int i;
struct sigaction act, oact;
if (termsigs_initialized)
return;
act.
__sigaction_handler.sa_handler
= termsig_sighandler;
act.sa_flags = 0;
sigemptyset (&act.sa_mask);
sigemptyset (&oact.sa_mask);
for (i = 0; i < (sizeof (terminating_signals) / sizeof (struct termsig)); i++)
sigaddset (&act.sa_mask, (terminating_signals[i].signum));
for (i = 0; i < (sizeof (terminating_signals) / sizeof (struct termsig)); i++)
{
if (signal_is_trapped ((terminating_signals[i].signum)))
continue;
sigaction ((terminating_signals[i].signum), &act, &oact);
(terminating_signals[i].orig_handler) = oact.
__sigaction_handler.sa_handler
;
(terminating_signals[i].orig_flags) = oact.sa_flags;
set_original_signal ((terminating_signals[i].signum), act.
__sigaction_handler.sa_handler
);
if (interactive_shell == 0 && (terminating_signals[i].orig_handler) ==
((__sighandler_t) 1)
)
{
sigaction ((terminating_signals[i].signum), &oact, &act);
set_signal_hard_ignored ((terminating_signals[i].signum));
}
if ((terminating_signals[i].signum) ==
27
&& (terminating_signals[i].orig_handler) !=
((__sighandler_t) 0)
&& (terminating_signals[i].orig_handler) !=
((__sighandler_t) 1)
)
sigaction ((terminating_signals[i].signum), &oact, (struct sigaction *)
((void *)0)
);
}
termsigs_initialized = 1;
}
| void initialize_terminating_signals(void)
{
int iVar1;
uint uVar2;
long in_FS_OFFSET;
sigaction local_158;
sigaction local_b8;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
if (termsigs_initialized == 0) {
local_158.__sigaction_handler = termsig_sighandler;
local_158.sa_flags = 0;
sigemptyset(&local_158.sa_mask);
sigemptyset(&local_b8.sa_mask);
for (uVar2 = 0; uVar2 < 0x11; uVar2 = uVar2 + 1) {
sigaddset(&local_158.sa_mask,*(int *)(terminating_signals + (long)(int)uVar2 * 0x18));
}
for (uVar2 = 0; uVar2 < 0x11; uVar2 = uVar2 + 1) {
iVar1 = signal_is_trapped();
if (iVar1 == 0) {
sigaction(*(int *)(terminating_signals + (long)(int)uVar2 * 0x18),&local_158,&local_b8);
*(undefined8 *)(terminating_signals + (long)(int)uVar2 * 0x18 + 8) =
local_b8.__sigaction_handler;
*(int *)(terminating_signals + (long)(int)uVar2 * 0x18 + 0x10) = local_b8.sa_flags;
set_original_signal(*(undefined4 *)(terminating_signals + (long)(int)uVar2 * 0x18),
local_158.__sigaction_handler);
if ((interactive_shell == 0) &&
(*(long *)(terminating_signals + (long)(int)uVar2 * 0x18 + 8) == 1)) {
sigaction(*(int *)(terminating_signals + (long)(int)uVar2 * 0x18),&local_b8,&local_158);
set_signal_hard_ignored();
}
if (((*(int *)(terminating_signals + (long)(int)uVar2 * 0x18) == 0x1b) &&
(*(long *)(terminating_signals + (long)(int)uVar2 * 0x18 + 8) != 0)) &&
(*(long *)(terminating_signals + (long)(int)uVar2 * 0x18 + 8) != 1)) {
sigaction(*(int *)(terminating_signals + (long)(int)uVar2 * 0x18),&local_b8,
(sigaction *)0x0);
}
}
}
termsigs_initialized = 1;
}
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
void
initialize_shell_builtins ()
{
qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin),
(QSFUNC *)shell_builtin_compare);
}
| long long initialize_shell_builtins() {
return qsort(shell_builtins, num_shell_builtins, 0x30, shell_builtin_compare);
}
|
(*opts)[strlen(term)] == '=') {
*opts += strlen(term) + 1;
return 1;
}
| size_t strlen(char *__s)
{
halt_baddata();
}
|
int
process_config_line(Options *options, struct passwd *pw, const char *host,
const char *original_host, char *line, const char *filename,
int linenum, int *activep, int flags)
{
return process_config_line_depth(options, pw, host, original_host,
line, filename, linenum, activep, flags,
((void *)0)
, 0);
}
| long process_config_line(
long a1,
long a2,
long a3,
const char *a4,
char *a5,
const char *a6,
unsigned int a7,
int *a8,
int a9)
{
return process_config_line_depth(a1, a2, a3, a4, a5, a6, a7, a8, a9, 0LL, 0);
}
|
static int jbd2_descriptor_block_csum_verify(journal_t *j, void *buf)
{
struct jbd2_journal_block_tail *tail;
__be32 provided;
__u32 calculated;
if (!jbd2_journal_has_csum_v2or3(j))
return 1;
tail = (struct jbd2_journal_block_tail *)((char *)buf +
j->j_blocksize - sizeof(struct jbd2_journal_block_tail));
provided = tail->t_checksum;
tail->t_checksum = 0;
calculated = jbd2_chksum(j, j->j_csum_seed, buf, j->j_blocksize);
tail->t_checksum = provided;
return provided == (( __be32)ext2fs_swab32((__u32)(calculated)));
}
| int jbd2_descriptor_block_csum_verify(unsigned int a0[50], unsigned long long a1) {
unsigned int v0;
unsigned int v1;
unsigned int *v2;
unsigned int v4;
v4 = jbd2_journal_has_csum_v2or3(a0);
if (!v4) {
v4 = 1;
} else {
v2 = a1 + a0[30] - 4;
v0 = *(v2);
*(v2) = 0;
v1 = jbd2_chksum(a0, a0[49], a1, a0[30]);
*(v2) = v0;
v4 = v0 == ext2fs_swab32(v1);
}
return v4;
}
|
char *
sh_single_quote (char *string)
{
register int c;
char *result, *r, *s;
result = (char *)xmalloc (3 + (4 * strlen (string)));
r = result;
*r++ = '\'';
for (s = string; s && (c = *s); s++)
{
*r++ = c;
if (c == '\'')
{
*r++ = '\\';
*r++ = '\'';
*r++ = '\'';
}
}
*r++ = '\'';
*r = '\0';
return (result);
}
| long long sh_single_quote(char *a0) {
char *v0;
int tmp_20;
int tmp_14;
int tmp_22;
int tmp_30;
int tmp_19;
char *v1;
unsigned long v2;
unsigned int v4;
char *v5;
v2 = xmalloc(strlen(a0) * 4 + 3);
v0 = v2;
tmp_20 = v0;
v0 += 1;
*(tmp_20) = 39;
v1 = a0;
while (true) {
if (!v1)
break;
v4 = *(v1);
if (!*(v1))
break;
v5 = v0;
v0 += 1;
*(v5) = *(v1);
if (v4 == 39) {
tmp_14 = v0;
v0 += 1;
*(tmp_14) = 92;
tmp_22 = v0;
v0 += 1;
*(tmp_22) = 39;
tmp_30 = v0;
v0 += 1;
*(tmp_30) = 39;
}
v1 += 1;
}
tmp_19 = v0;
v0 += 1;
*(tmp_19) = 39;
*(v0) = 0;
return v2;
}
|
(r = sshbuf_put_string(b,
((void *)0)
, 0)) != 0)
goto out;
for (i = 0; i < dch->nkeys; i++) {
if ((r = sshkey_puts(dch->keys[i], b)) != 0 ||
(r = sshbuf_put_u8(b, dch->key_is_ca[i] != 0)) != 0)
goto out;
}
| (local_14 = sshbuf_put_string(lVar1,0,0), local_14 == 0)) {
for (local_18 = 0; local_18 < *(uint *)((long)param_2 + 0x14); local_18 = local_18 + 1) {
local_14 = sshkey_puts(*(undefined8 *)(param_2[3] + (ulong)local_18 * 8),lVar1);
if ((local_14 != 0) ||
(local_14 = sshbuf_put_u8(lVar1,*(int *)(param_2[4] + (ulong)local_18 * 4) != 0),
local_14 != 0)) goto LAB_00100f78;
}
local_14 = sshbuf_put_stringb(param_1,lVar1);
if (local_14 == 0) {
local_14 = 0;
}
}
|
static int
should_expand (s)
char *s;
{
char *p;
for (p = s; p && *p; p++)
{
if (*p == '\\')
p++;
else if (*p == '&')
return 1;
}
return 0;
}
| int should_expand(unsigned long a0) {
char *v0;
unsigned int v2;
v0 = a0;
while (true) {
if (!v0) {
LABEL_4011e0:
v2 = 0;
break;
} else {
if (!*(v0))
goto LABEL_4011e0;
if (*(v0) == 92) {
v0 += 1;
} else if (*(v0) == 38) {
v2 = 1;
break;
}
v0 += 1;
}
}
return v2;
}
|
void ea_refcount_intr_begin(ext2_refcount_t refcount)
{
refcount->cursor = 0;
}
| long long ea_refcount_intr_begin(struct_0 *a0) {
a0->field_10 = 0;
return a0;
}
|
static
int run_inline_command(inline_cmds_st * cmd, socket_st * hd)
{
switch (cmd->cmd_found) {
case INLINE_COMMAND_RESUME:
return try_resume(hd);
case INLINE_COMMAND_REKEY_LOCAL:
return try_rekey(hd, 0);
case INLINE_COMMAND_REKEY_BOTH:
return try_rekey(hd, 1);
case INLINE_COMMAND_RENEGOTIATE:
return try_rehandshake(hd);
default:
return -1;
}
}
| long run_inline_command(long a1, unsigned int *a2)
{
unsigned int v2;
v2 = *(_DWORD *)(a1 + 16);
if ( v2 == 4 )
return try_rekey((long)a2, 1);
if ( v2 > 4 )
return 0xFFFFFFFFLL;
switch ( v2 )
{
case 3u:
return try_rekey((long)a2, 0);
case 1u:
return try_resume((long)a2);
case 2u:
return try_rehandshake(a2);
default:
return 0xFFFFFFFFLL;
}
}
|
vi_add(EditLine *el, wint_t c __attribute__((__unused__)))
{
int ret;
el->el_map.current = el->el_map.key;
if (el->el_line.cursor < el->el_line.lastchar) {
el->el_line.cursor++;
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
ret = 5;
} else
ret = 0;
cv_undo(el);
return (el_action_t)ret;
}
| long vi_add(_QWORD *a1)
{
unsigned int v2;
a1[128] = a1[127];
if ( a1[11] >= a1[12] )
{
v2 = 0;
}
else
{
a1[11] += 4LL;
if ( a1[11] > a1[12] )
a1[11] = a1[12];
v2 = 5;
}
cv_undo(a1);
return v2;
}
|
int
ssh_packet_not_very_much_data_to_write(struct ssh *ssh)
{
if (ssh->state->interactive_mode)
return sshbuf_len(ssh->state->output) < 16384;
else
return sshbuf_len(ssh->state->output) < 128 * 1024;
}
| long long ssh_packet_not_very_much_data_to_write(struct struct_0 **a0) {
unsigned long v1;
if (!*(a0)->field_140)
v1 = sshbuf_len(*(a0)->field_28) <= 131071;
else
v1 = sshbuf_len(*(a0)->field_28) <= 16383;
return v1;
}
|
void
get_remote_user_groups_from_glob(struct sftp_conn *conn, _ssh_compat_glob_t *g)
{
u_int *uids =
((void *)0)
, nuids = 0, *gids =
((void *)0)
, ngids = 0;
if (!can_get_users_groups_by_id(conn))
return;
collect_ids_from_glob(g, 1, &uids, &nuids);
collect_ids_from_glob(g, 0, &gids, &ngids);
lookup_and_record(conn, uids, nuids, gids, ngids);
free(uids);
free(gids);
}
| void get_remote_user_groups_from_glob(undefined8 param_1,undefined8 param_2)
{
int iVar1;
long in_FS_OFFSET;
undefined4 local_28;
undefined4 local_24;
void *local_20;
void *local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_20 = (void *)0x0;
local_28 = 0;
local_18 = (void *)0x0;
local_24 = 0;
iVar1 = can_get_users_groups_by_id(param_1);
if (iVar1 != 0) {
collect_ids_from_glob(param_2,1,&local_20,&local_28);
collect_ids_from_glob(param_2,0,&local_18,&local_24);
lookup_and_record(param_1,local_20,local_28,local_18,local_24);
free(local_20);
free(local_18);
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void print_usage(FILE *f)
{
fprintf(f,
"Usage: ... amt\n"
" [ discovery IP_ADDRESS ]\n"
" [ mode MODE ]\n"
" [ local ADDR ]\n"
" [ dev PHYS_DEV ]\n"
" [ relay_port PORT ]\n"
" [ gateway_port PORT ]\n"
" [ max_tunnels NUMBER ]\n"
"\n"
"Where: ADDR := { IP_ADDRESS }\n"
" MODE := { gateway | relay }\n"
);
}
| void print_usage(void* a0) {
unsigned long long v1;
v1 = fprintf(a0, "Usage: ... amt\n [ discovery IP_ADDRESS ]\n [ mode MODE ]\n [ local ADDR ]\n [ dev PHYS_DEV ]\n [ relay_port PORT ]\n [ gateway_port PORT ]\n [ max_tunnels NUMBER ]\n\nWhere: ADDR\t:= { IP_ADDRESS }\n MODE\t:= { gateway | relay }\n");
return;
}
|
static void
init_mail_file (i)
int i;
{
mailfiles[i]->access_time = mailfiles[i]->mod_time = last_time_mail_checked ? last_time_mail_checked : shell_start_time;
mailfiles[i]->file_size = 0;
mailfiles[i]->flags = 0;
}
| void init_mail_file(int param_1)
{
long lVar1;
long lVar2;
lVar2 = shell_start_time;
if (last_time_mail_checked != 0) {
lVar2 = last_time_mail_checked;
}
lVar1 = *(long *)(mailfiles + (long)param_1 * 8);
*(long *)(lVar1 + 0x18) = lVar2;
*(undefined8 *)(*(long *)(mailfiles + (long)param_1 * 8) + 0x10) = *(undefined8 *)(lVar1 + 0x18);
*(undefined8 *)(*(long *)(mailfiles + (long)param_1 * 8) + 0x20) = 0;
*(undefined4 *)(*(long *)(mailfiles + (long)param_1 * 8) + 0x28) = 0;
return;
}
|
static int
istrsenvisxl(char *mbdst, size_t *dlen, const char *mbsrc,
int flags, const char *mbextra, int *cerr_ptr)
{
return istrsenvisxna(mbdst, dlen, mbsrc,
mbsrc !=
((void *)0)
? strlen(mbsrc) : 0, flags, mbextra, cerr_ptr);
}
| void istrsenvisxl(undefined8 param_1,undefined8 param_2,char *param_3,undefined4 param_4,
undefined8 param_5,undefined8 param_6)
{
size_t sVar1;
if (param_3 == (char *)0x0) {
sVar1 = 0;
}
else {
sVar1 = strlen(param_3);
}
istrsenvisxna(param_1,param_2,param_3,sVar1,param_4,param_5,param_6);
return;
}
|
static void
put_indicator (const struct bin_str *ind)
{
if (! used_color)
{
used_color =
1
;
if (0 <= tcgetpgrp (
1
))
signal_init ();
prep_non_filename_text ();
}
fwrite_unlocked (ind->string,ind->len,1,
stdout
);
}
| void put_indicator(unsigned long long a0[2]) {
unsigned long long v2;
if ((used_color ^ 1)) {
used_color = 1;
if (tcgetpgrp(0x1) >= 0)
signal_init();
prep_non_filename_text();
}
v2 = fwrite_unlocked(a0[1], a0[0], 0x1, stdout);
return;
}
|
void cron_close_pam(void) {
}
| void cron_close_pam(void)
{
return;
}
|
int Clean_Line(char *source_line, char *output_line)
{
int source_index = 0, target_index = 0;
int source_max_index;
char a_letter;
int done;
char *garbage;
if (! source_line) return 0;
if (! output_line) return 0;
source_max_index = strlen(source_line);
while (source_index < source_max_index)
{
a_letter = source_line[source_index];
if (a_letter == '^')
{
done = 0;
while (! done)
{
source_index++;
if (source_index >= source_max_index)
done = 1;
else
{
a_letter = source_line[source_index];
if ( (a_letter == '.') || (a_letter == ' ') ||
(a_letter == '(') || (a_letter == 'd') ||
(a_letter == '\n') )
done = 1;
}
}
}
else if ( (a_letter == '?') && (source_line[source_index + 1] == '?') &&
(source_line[source_index + 2] == '7') )
{
source_index += 3;
output_line[target_index] = ' ';
target_index++;
}
else if ( (a_letter == '8') && (source_line[source_index + 1] == '?') &&
(source_line[source_index + 2] == '?') )
{
source_index += 3;
output_line[target_index] = ']';
target_index++;
}
else
{
output_line[target_index] = a_letter;
target_index++;
source_index++;
}
}
garbage = strstr(output_line, " .\n");
if (garbage)
{
garbage[0] = '\n';
garbage[1] = '\0';
}
return 1;
}
| undefined8 Clean_Line(char *param_1,char *param_2)
{
char cVar1;
bool bVar2;
undefined8 uVar3;
size_t sVar4;
char *pcVar5;
int local_20;
int local_1c;
local_20 = 0;
local_1c = 0;
if (param_1 == (char *)0x0) {
uVar3 = 0;
}
else if (param_2 == (char *)0x0) {
uVar3 = 0;
}
else {
sVar4 = strlen(param_1);
while (local_20 < (int)sVar4) {
cVar1 = param_1[local_20];
if (cVar1 == '^') {
bVar2 = false;
while (!bVar2) {
local_20 = local_20 + 1;
if (local_20 < (int)sVar4) {
cVar1 = param_1[local_20];
if (((cVar1 == '.') || (cVar1 == ' ')) ||
((cVar1 == '(' || ((cVar1 == 'd' || (cVar1 == '\n')))))) {
bVar2 = true;
}
}
else {
bVar2 = true;
}
}
}
else if (((cVar1 == '?') && (param_1[(long)local_20 + 1] == '?')) &&
(param_1[(long)local_20 + 2] == '7')) {
local_20 = local_20 + 3;
param_2[local_1c] = ' ';
local_1c = local_1c + 1;
}
else if (((cVar1 == '8') && (param_1[(long)local_20 + 1] == '?')) &&
(param_1[(long)local_20 + 2] == '?')) {
local_20 = local_20 + 3;
param_2[local_1c] = ']';
local_1c = local_1c + 1;
}
else {
param_2[local_1c] = cVar1;
local_1c = local_1c + 1;
local_20 = local_20 + 1;
}
}
pcVar5 = strstr(param_2," .\n");
if (pcVar5 != (char *)0x0) {
*pcVar5 = '\n';
pcVar5[1] = '\0';
}
uVar3 = 1;
}
return uVar3;
}
|
void
fn_display_match_list(EditLine * el, char **matches, size_t num, size_t width,
const char *(*app_func) (const char *))
{
size_t line, lines, col, cols, thisguy;
int screenwidth = el->el_terminal.t_size.h;
if (app_func ==
((void *)0)
)
app_func = append_char_function;
matches++;
num--;
cols = (size_t)screenwidth / (width + 2);
if (cols == 0)
cols = 1;
lines = (num + cols - 1) / cols;
qsort(matches, num, sizeof(char *), _fn_qsort_string_compare);
for (line = 0; line < lines; line++) {
for (col = 0; col < cols; col++) {
thisguy = line + col * lines;
if (thisguy >= num)
break;
(void)fprintf(el->el_outfile, "%s%s%s",
col == 0 ? "" : " ", matches[thisguy],
(*app_func)(matches[thisguy]));
(void)fprintf(el->el_outfile, "%-*s",
(int) (width - strlen(matches[thisguy])), "");
}
(void)fprintf(el->el_outfile, "\n");
}
}
| void fn_display_match_list(struct_0 *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned long long v0;
unsigned long long v1;
unsigned long long *v2;
unsigned int v3;
void* v4;
void* v5;
unsigned long long v6;
unsigned long v7;
unsigned long long *v8;
unsigned long v10;
unsigned int v12;
v2 = a1;
v1 = a2;
v0 = a4;
v3 = a0->field_90;
if (!v0)
v0 = append_char_function;
v2 += 8;
v1 -= 1;
v6 = (0 CONCAT v3) /m (a3 + 2);
if (!v6)
v6 = 1;
v7 = (0 CONCAT v6 + v1 - 1) /m v6;
qsort(v2, v1, 0x8, _fn_qsort_string_compare);
v4 = 0;
while (true) {
v10 = v4;
if (v4 >= v7)
break;
for (v5 = 0; v5 < v6; v5 += 1) {
v8 = v4 + v7 * v5;
if (v8 >= v1)
break;
if (v8 < v1) {
if (!v5)
*(&v10) = &g_401c28;
else
*(&v10) = &g_401c31;
}
v12 = (stack_base)[112](*((v2 + 0x8 * v8)));
fprintf(a0->field_10, "%s%s%s", v10, *((v2 + 0x8 * v8)), v12);
strlen(*((v2 + 0x8 * v8)));
fprintf(a0->field_10, "%-*s");
}
fprintf(a0->field_10, "\n");
v4 += 1;
}
return;
}
|
void
mm_request_receive_expect(int sock, enum monitor_reqtype type, struct sshbuf *m)
{
u_char rtype;
int r;
sshlog("monitor_wrap.c", __func__, 170, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "entering, type %d", type);
mm_request_receive(sock, m);
if ((r = sshbuf_get_u8(m, &rtype)) != 0)
sshfatal("monitor_wrap.c", __func__, 174, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
if (rtype != type)
sshfatal("monitor_wrap.c", __func__, 176, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "read: rtype %d != type %d", rtype, type);
}
| void mm_request_receive_expect(unsigned long a0, unsigned long a1, unsigned long long a2) {
unsigned long v0;
unsigned long long v1;
unsigned long v2;
char v3;
unsigned int v4;
unsigned long long v5;
unsigned long long *v7;
unsigned long long v8;
v0 = a1;
sshlog("monitor_wrap.c", "mm_request_receive_expect", 0xaa, 0x1, 0x7, 0x0, "entering, type %d");
mm_request_receive(a0, a2);
v4 = sshbuf_get_u8(a2, &v3, &v3);
if (v4)
sshfatal("monitor_wrap.c", "mm_request_receive_expect", 0xae, 0x1, 0x1, ssh_err(v4));
if (a1 != v3) {
v5 = a1;
v2 = v3;
v1 = "read: rtype %d != type %d";
sshfatal("monitor_wrap.c", "mm_request_receive_expect", 0xb0, 0x1, 0x1, 0x0);
}
v8 = v5 ^ v7[5];
return;
}
|
static void *
tar_pool_alloc(size_t size)
{
if (!tar_pool_init) {
_obstack_begin ((
&tar_pool
), 0, 0, (void *(*)(long))
m_malloc
, (void (*)(void *))
free
)
;
tar_pool_init =
1
;
}
return
__extension__ ({ struct obstack *__h = (
&tar_pool
); __extension__ ({ struct obstack *__o = (__h); int __len = ((
size
)); if (__o->chunk_limit - __o->next_free < __len) _obstack_newchunk (__o, __len); ((__o)->next_free += (__len)); (void) 0; }); __extension__ ({ struct obstack *__o1 = (__h); void *__value = (void *) __o1->object_base; if (__o1->next_free == __value) __o1->maybe_empty_object = 1; __o1->next_free = ((sizeof (long int) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (((__o1->next_free) - (sizeof (long int) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (__o1->alignment_mask)) & ~(__o1->alignment_mask))); if (__o1->next_free - (char *) __o1->chunk > __o1->chunk_limit - (char *) __o1->chunk) __o1->next_free = __o1->chunk_limit; __o1->object_base = __o1->next_free; __value; }); })
;
}
| int tar_pool_alloc(unsigned long long a0) {
unsigned long long v0;
unsigned long long v1;
unsigned long long v2;
unsigned long v3;
if ((tar_pool_init ^ 1)) {
_obstack_begin(&tar_pool, 0x0, 0x0, got.m_malloc, got.free);
tar_pool_init = 1;
}
v0 = &tar_pool;
v1 = v0;
if (*((v1 + 32)) - *((v1 + 24)) < a0)
_obstack_newchunk(v1, a0, a0);
*((v1 + 24)) = *((v1 + 24)) + a0;
v2 = v0;
v3 = *((v2 + 16));
if (v3 == *((v2 + 24)))
*((v2 + 80)) = *((v2 + 80)) | 2;
*((v2 + 24)) = !(*((v2 + 48))) & *((v2 + 24)) + *((v2 + 48));
if (*((v2 + 24)) > *((v2 + 32)))
*((v2 + 24)) = *((v2 + 32));
*((v2 + 16)) = *((v2 + 24));
return v3;
}
|
static void
mm_session_close(Session *s)
{
sshlog("monitor.c", __func__, 1537, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "session %d pid %ld", s->self, (long)s->pid);
if (s->ttyfd != -1) {
sshlog("monitor.c", __func__, 1539, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "tty %s ptyfd %d", s->tty, s->ptyfd);
session_pty_cleanup2(s);
}
session_unused(s->self);
}
| void mm_session_close(unsigned int a0[14]) {
unsigned long long v0;
unsigned long v1;
unsigned long v2;
unsigned long long v4;
v2 = a0[8];
v1 = a0[1];
v0 = "session %d pid %ld";
sshlog("monitor.c", "mm_session_close", 0x601, 0x1, 0x7, 0x0);
if (a0[13] != -1) {
v2 = a0[12];
v1 = &a0[1 + 5];
v0 = "tty %s ptyfd %d";
sshlog("monitor.c", "mm_session_close", 0x603, 0x1, 0x7, 0x0);
session_pty_cleanup2(a0);
}
v4 = session_unused(a0[1]);
return;
}
|
SHELL_VAR **
all_shell_variables ()
{
return (vapply ((sh_var_map_func_t *)
((void *)0)
));
}
| void all_shell_variables(void)
{
vapply(0);
return;
}
|
int
main (argc, argv)
int argc;
char **argv;
{
int arg_index = 1;
FILE *structfile, *externfile;
char *documentation_filename, *temp_struct_filename;
structfile = externfile = (FILE *)
((void *)0)
;
documentation_filename = "builtins.texi";
temp_struct_filename = (char *)
((void *)0)
;
while (arg_index < argc && argv[arg_index][0] == '-')
{
char *arg = argv[arg_index++];
if (strcmp (arg, "-externfile") == 0)
extern_filename = argv[arg_index++];
else if (strcmp (arg, "-includefile") == 0)
include_filename = argv[arg_index++];
else if (strcmp (arg, "-structfile") == 0)
struct_filename = argv[arg_index++];
else if (strcmp (arg, "-noproduction") == 0)
inhibit_production = 1;
else if (strcmp (arg, "-nofunctions") == 0)
inhibit_functions = 1;
else if (strcmp (arg, "-document") == 0)
documentation_file = fopen (documentation_filename, "w");
else if (strcmp (arg, "-D") == 0)
{
int len;
if (error_directory)
free (error_directory);
error_directory = xmalloc (2 + strlen (argv[arg_index]));
strcpy (error_directory, argv[arg_index]);
len = strlen (error_directory);
if (len && error_directory[len - 1] != '/')
strcat (error_directory, "/");
arg_index++;
}
else if (strcmp (arg, "-documentonly") == 0)
{
only_documentation = 1;
documentation_file = fopen (documentation_filename, "w");
}
else if (strcmp (arg, "-H") == 0)
{
separate_helpfiles = 1;
helpfile_directory = argv[arg_index++];
}
else if (strcmp (arg, "-S") == 0)
single_longdoc_strings = 0;
else
{
fprintf (
stderr
, "%s: Unknown flag %s.\n", argv[0], arg);
exit (2);
}
}
if (include_filename == 0)
include_filename = extern_filename;
if (arg_index == argc)
exit (0);
if (!only_documentation)
{
if (struct_filename)
{
temp_struct_filename = xmalloc (15);
sprintf (temp_struct_filename, "mk-%ld", (long) getpid ());
structfile = fopen (temp_struct_filename, "w");
if (!structfile)
file_error (temp_struct_filename);
}
if (extern_filename)
{
externfile = fopen (extern_filename, "w");
if (!externfile)
file_error (extern_filename);
}
write_file_headers (structfile, externfile);
}
if (documentation_file)
{
fprintf (documentation_file, "@c Table of builtins created with %s.\n",
argv[0]);
fprintf (documentation_file, "@ftable @asis\n");
}
while (arg_index < argc)
{
register char *arg;
arg = argv[arg_index++];
extract_info (arg, structfile, externfile);
}
if (!only_documentation)
{
write_file_footers (structfile, externfile);
if (structfile)
{
write_longdocs (structfile, saved_builtins);
fclose (structfile);
rename (temp_struct_filename, struct_filename);
}
if (externfile)
fclose (externfile);
}
if (documentation_file)
{
fprintf (documentation_file, "@end ftable\n");
fclose (documentation_file);
}
exit (0);
}
| int main(unsigned long a0) {
unsigned int v0;
int tmp_16;
int tmp_12;
int tmp_13;
int tmp_15;
unsigned int v1;
unsigned int v2;
void* v3;
void* v4;
void* v5;
unsigned long long v6;
char *v7;
unsigned long v8;
unsigned long v10;
char **v11;
v8 = v10;
v0 = a0;
v1 = 1;
v4 = 0;
v3 = v4;
v6 = "builtins.texi";
v5 = 0;
while (v1 < v0) {
if (*(v11[v1]) != 45)
break;
tmp_16 = v1;
v1 += 1;
v7 = v11[tmp_16];
if (!strcmp(v7, "-externfile")) {
tmp_12 = v1;
v1 += 1;
extern_filename = v11[tmp_12];
} else if (!strcmp(v7, "-includefile")) {
tmp_12 = v1;
v1 += 1;
include_filename = v11[tmp_12];
} else if (!strcmp(v7, "-structfile")) {
tmp_12 = v1;
v1 += 1;
struct_filename = v11[tmp_12];
} else if (!strcmp(v7, "-noproduction")) {
inhibit_production = 1;
} else if (!strcmp(v7, "-nofunctions")) {
inhibit_functions = 1;
} else if (!strcmp(v7, "-document")) {
documentation_file = fopen(v6, "w");
} else if (!strcmp(v7, "-D")) {
if (error_directory)
free(error_directory);
error_directory = xmalloc(strlen(v11[v1]) + 2);
strcpy(error_directory, v11[v1]);
v2 = strlen(error_directory);
if (v2 && *((error_directory + v2 - 1)) != 47)
strcat(error_directory, "/");
v1 += 1;
} else if (!strcmp(v7, "-documentonly")) {
only_documentation = 1;
documentation_file = fopen(v6, "w");
} else if (!strcmp(v7, "-H")) {
separate_helpfiles = 1;
tmp_13 = v1;
v1 += 1;
helpfile_directory = v11[tmp_13];
} else if (!strcmp(v7, "-S")) {
single_longdoc_strings = 0;
} else {
fprintf(stderr, "%s: Unknown flag %s.\n", *(v11), v7);
exit(0x2);
}
}
if (!include_filename)
include_filename = extern_filename;
if (v1 == v0)
exit(0x0);
if (!only_documentation) {
if (struct_filename) {
v5 = xmalloc(0xf);
sprintf(v5, "mk-%ld", getpid());
v3 = fopen(v5, "w");
if (!v3)
file_error(v5);
}
if (!struct_filename || v3) {
if (extern_filename) {
v4 = fopen(extern_filename, "w");
if (!v4)
file_error(extern_filename);
}
if (!extern_filename || v4)
write_file_headers(v3, v4);
}
}
if (only_documentation || !extern_filename && !struct_filename || !extern_filename && v3 || !struct_filename && v4 || v3 && v4) {
if (documentation_file) {
fprintf(documentation_file, "@c Table of builtins created with %s.\n", *(v11));
fprintf(documentation_file, "@ftable @asis\n");
}
while (v1 < v0) {
tmp_15 = v1;
v1 += 1;
extract_info(v11[tmp_15], v3, v4);
}
if (!only_documentation) {
write_file_footers(v3, v4);
if (v3) {
write_longdocs(v3, saved_builtins);
fclose(v3);
rename(v5, struct_filename);
}
if (v4)
fclose(v4);
}
if (documentation_file) {
fprintf(documentation_file, "@end ftable\n");
fclose(documentation_file);
}
exit(0x0);
}
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| long long emit_ancillary_info(char *a0) {
unsigned long long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
unsigned long long v19;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
v1[0] = &v4;
while (true) {
if (!v1[0])
break;
if (!strcmp(a0, v1[0]))
break;
v1[0] = v1 + 1;
}
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
if (!strcmp(a0, "["))
v19 = "test";
else
v19 = a0;
v3 = v19;
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
return 0;
}
|
_Bool
pred_inum (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
(void) pathname;
switch (pred_ptr->args.numinfo.kind)
{
case COMP_GT:
if (stat_buf->st_ino > pred_ptr->args.numinfo.l_val)
return (
1
);
break;
case COMP_LT:
if (stat_buf->st_ino < pred_ptr->args.numinfo.l_val)
return (
1
);
break;
case COMP_EQ:
if (stat_buf->st_ino == pred_ptr->args.numinfo.l_val)
return (
1
);
break;
}
return (
0
);
}
| long long pred_inum(unsigned long a0, struct_0 *a1, struct_1 *a2) {
unsigned long v0;
unsigned long long v2;
v0 = a0;
switch (a2->field_38) {
case 2:
if (a1->field_8 != a2->field_40) {
v2 = 0;
return v2;
}
v2 = 1;
return v2;
case 0:
if (a1->field_8 <= a2->field_40) {
v2 = 0;
return v2;
}
v2 = 1;
return v2;
case 1:
if (a1->field_8 >= a2->field_40) {
v2 = 0;
return v2;
}
v2 = 1;
return v2;
default:
v2 = 0;
return v2;
}
}
|
static
_Bool
to_chars (int negative, uintmax_t value, size_t valsize,
uintmax_t (*substitute) (int *),
char *where, size_t size, const char *type)
{
int gnu_format = (archive_format == GNU_FORMAT
|| archive_format == OLDGNU_FORMAT);
if (! negative && value <= ((size - 1) * (3) < sizeof (uintmax_t) * 8 ? ((uintmax_t) 1 << ((size - 1) * (3))) - 1 : (uintmax_t) -1))
{
where[size - 1] = '\0';
to_octal (value, where, size - 1);
return
1
;
}
else if (gnu_format)
{
if (((negative ? -1 - value : value)
<= ((size - 1) * (8) < sizeof (uintmax_t) * 8 ? ((uintmax_t) 1 << ((size - 1) * (8))) - 1 : (uintmax_t) -1)))
{
where[0] = negative ? -1 : 1 << (8 - 1);
to_base256 (negative, value, where + 1, size - 1);
return
1
;
}
else if (negative && valsize * 8 <= (size - 1) * 3)
{
static int warned_once;
if (! warned_once)
{
warned_once = 1;
do { if (error_hook) error_hook (); error (0, 0, gettext ("Generating negative octal headers")); } while (0);
}
where[size - 1] = '\0';
to_octal (value & ((valsize * 8) * (1) < sizeof (uintmax_t) * 8 ? ((uintmax_t) 1 << ((valsize * 8) * (1))) - 1 : (uintmax_t) -1),
where, size - 1);
return
1
;
}
}
else
substitute =
((void *)0)
;
return to_chars_subst (negative, gnu_format, value, valsize, substitute,
where, size, type);
}
| void to_chars(unsigned long a0, unsigned long a1, unsigned long long a2, unsigned int a3, char *a4, unsigned long long a5, unsigned long long v4) {
void* v0;
unsigned long long v1;
unsigned long long v2;
unsigned int v3;
unsigned int v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
v2 = a1;
v1 = a2;
*(&v0) = a3;
if (archive_format == 6) {
LABEL_4007b7:
v5 = 1;
} else {
if (archive_format == 2)
goto LABEL_4007b7;
v5 = 0;
}
v3 = v5;
if (!a0) {
if ((a5 << 1) + a5 - 3 > 63)
v6 = -1;
else
v6 = (1 << ((a5 * 2 + a5 - 3) & 63)) - 1;
if (v6 >= a1) {
a4[1 + a5] = 0;
to_octal(a1, a4, a5 - 1);
v7 = 1;
goto LABEL_4009f6;
}
}
if (!v3) {
v0 = 0;
} else {
if (a0)
v8 = !(v2);
else
v8 = a1;
if (a5 - 1 << 3 > 63)
v9 = -1;
else
v9 = (1 << (((a5 - 1) * 8) & 63)) - 1;
if (v8 <= v9) {
if (a0)
*(&v9) = 255;
else
*(&v9) = 128;
*(a4) = v9;
to_base256(a0, a1, a4 + 1, a5 - 1);
v11 = 1;
goto LABEL_4009f6;
}
if (a0 && v1 << 3 <= (a5 << 1) + a5 - 3) {
if (!warned_once.7114) {
warned_once.7114 = 1;
if (error_hook)
*(5242912)();
error(0x0, 0x0, gettext("Generating negative octal headers"));
}
a4[1 + a5] = 0;
if (v1 << 3 > 63)
v12 = -1;
else
v12 = (1 << ((v1 * 8) & 63)) - 1;
to_octal(v12 & a1, a4, a5 - 1);
v13 = 1;
goto LABEL_4009f6;
}
}
v10 = to_chars_subst(a0, v3, a1, v1, v0, a4, a5, v4);
LABEL_4009f6:
return;
}
|
static
void init_RL ( EState* s )
{
s->state_in_ch = 256;
s->state_in_len = 0;
}
| void init_RL(unsigned int a0[25]) {
char v0;
unsigned int v2[25];
unsigned long long v3;
a0[23] = 0x100;
v2 = a0;
a0[24] = 0;
v3 = *(&v0);
return;
}
|
static int
sdirent_comp(const void *aa, const void *bb)
{
SFTP_DIRENT *a = *(SFTP_DIRENT **)aa;
SFTP_DIRENT *b = *(SFTP_DIRENT **)bb;
int rmul = sort_flag & 0x0040 ? -1 : 1;
if (sort_flag & 0x0008)
return (rmul * strcmp(a->filename, b->filename));
else if (sort_flag & 0x0010)
return (rmul * (a->a.mtime == b->a.mtime ? 0 : (a->a.mtime < b->a.mtime ? 1 : -1)));
else if (sort_flag & 0x0020)
return (rmul * (a->a.size == b->a.size ? 0 : (a->a.size < b->a.size ? 1 : -1)));
sshfatal("sftp.c", __func__, 828, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "Unknown ls sort type");
}
| void sdirent_comp(long *param_1,long *param_2)
{
char **ppcVar1;
char **ppcVar2;
undefined4 uVar3;
int iVar4;
undefined4 uVar5;
ppcVar1 = (char **)*param_1;
ppcVar2 = (char **)*param_2;
if ((sort_flag & 0x40) == 0) {
uVar3 = 1;
}
else {
uVar3 = 0xffffffff;
}
if ((sort_flag & 8) == 0) {
if ((sort_flag & 0x10) == 0) {
if ((sort_flag & 0x20) == 0) {
sshfatal("sftp.c","sdirent_comp",0x33c,0,1,0,"Unknown ls sort type");
}
else {
if (ppcVar1[3] == ppcVar2[3]) {
uVar5 = 0;
}
else if (ppcVar1[3] < ppcVar2[3]) {
uVar5 = 1;
}
else {
uVar5 = 0xffffffff;
}
__mulvsi3(uVar5,uVar3);
}
}
else {
if (*(int *)(ppcVar1 + 6) == *(int *)(ppcVar2 + 6)) {
uVar5 = 0;
}
else if (*(uint *)(ppcVar1 + 6) < *(uint *)(ppcVar2 + 6)) {
uVar5 = 1;
}
else {
uVar5 = 0xffffffff;
}
__mulvsi3(uVar5,uVar3);
}
}
else {
iVar4 = strcmp(*ppcVar1,*ppcVar2);
__mulvsi3(iVar4,uVar3);
}
return;
}
|
static void
update_current_files_info (void)
{
if (sort_type == sort_width
|| (line_length && (format == many_per_line || format == horizontal)))
{
size_t i;
for (i = 0; i < cwd_n_used; i++)
{
struct fileinfo *f = sorted_file[i];
f->width = fileinfo_name_width (f);
}
}
}
| void update_current_files_info(void)
{
long lVar1;
undefined8 uVar2;
ulong local_18;
if ((sort_type == 2) || ((line_length != 0 && ((format == 2 || (format == 3)))))) {
for (local_18 = 0; local_18 < cwd_n_used; local_18 = local_18 + 1) {
lVar1 = *(long *)(sorted_file + local_18 * 8);
uVar2 = fileinfo_name_width(lVar1);
*(undefined8 *)(lVar1 + 200) = uVar2;
}
}
return;
}
|
static char *peer_print_info(gnutls_session_t session, int *ret_length,
const char *header)
{
const char *tmp;
unsigned char sesid[32];
size_t i, sesid_size;
char *http_buffer, *desc;
gnutls_kx_algorithm_t kx_alg;
size_t len = 20 * 1024 + strlen(header);
char *crtinfo =
((void *)0)
;
gnutls_protocol_t version;
size_t ncrtinfo = 0;
if (verbose == 0) {
http_buffer = malloc(len);
if (http_buffer ==
((void *)0)
)
return
((void *)0)
;
strcpy(http_buffer, "HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n" "\n" "<HTML><BODY>\n" "<CENTER><H1>This is <a href=\"http:
strcpy(&http_buffer[sizeof("HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n" "\n" "<HTML><BODY>\n" "<CENTER><H1>This is <a href=\"http:
strcpy(&http_buffer
[sizeof("HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n" "\n" "<HTML><BODY>\n" "<CENTER><H1>This is <a href=\"http:
"</BODY></HTML>\n\n");
*ret_length =
sizeof(DEFAULT_DATA) + sizeof("HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n" "\n" "<HTML><BODY>\n" "<CENTER><H1>This is <a href=\"http:
sizeof("</BODY></HTML>\n\n") - 3;
return http_buffer;
}
if (gnutls_certificate_type_get2(session, GNUTLS_CTYPE_CLIENT) == GNUTLS_CRT_X509) {
const gnutls_datum_t *cert_list;
unsigned int cert_list_size = 0;
cert_list =
gnutls_certificate_get_peers(session, &cert_list_size);
for (i = 0; i < cert_list_size; i++) {
gnutls_x509_crt_t cert =
((void *)0)
;
gnutls_datum_t info;
if (gnutls_x509_crt_init(&cert) == 0 &&
gnutls_x509_crt_import(cert, &cert_list[i],
GNUTLS_X509_FMT_DER) ==
0
&& gnutls_x509_crt_print(cert,
GNUTLS_CRT_PRINT_FULL,
&info) == 0) {
const char post[] = "</PRE><P><PRE>";
char *crtinfo_new;
size_t ncrtinfo_new;
ncrtinfo_new = xsum3(ncrtinfo, info.size,
sizeof(post));
if (((ncrtinfo_new) ==
(18446744073709551615UL)
)) {
free(crtinfo);
return
((void *)0)
;
}
crtinfo_new = realloc(crtinfo, ncrtinfo_new);
if (crtinfo_new ==
((void *)0)
) {
free(crtinfo);
return
((void *)0)
;
}
crtinfo = crtinfo_new;
memcpy(crtinfo + ncrtinfo, info.data,
info.size);
ncrtinfo += info.size;
memcpy(crtinfo + ncrtinfo, post,
strlen(post));
ncrtinfo += strlen(post);
crtinfo[ncrtinfo] = '\0';
gnutls_free((void *) (info.data)), info.data=
((void *)0)
;
}
gnutls_x509_crt_deinit(cert);
}
}
http_buffer = malloc(len);
if (http_buffer ==
((void *)0)
) {
free(crtinfo);
return
((void *)0)
;
}
strcpy(http_buffer, "HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n" "\n" "<HTML><BODY>\n" "<CENTER><H1>This is <a href=\"http:
version = gnutls_protocol_get_version(session);
sesid_size = sizeof(sesid);
gnutls_session_get_id(session, sesid, &sesid_size);
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer), "\n<p>Session ID: <i>");
for (i = 0; i < sesid_size; i++)
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer), "%.2X", sesid[i]);
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer), "</i></p>\n");
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<h5>If your browser supports session resumption, then you should see the "
"same session ID, when you press the <b>reload</b> button.</h5>\n");
{
char dns[256];
size_t dns_size = sizeof(dns);
unsigned int type;
if (gnutls_server_name_get
(session, dns, &dns_size, &type, 0) == 0) {
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"\n<p>Server Name: %s</p>\n", dns);
}
}
kx_alg = gnutls_kx_get(session);
if (kx_alg == GNUTLS_KX_SRP) {
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<p>Connected as user '%s'.</p>\n",
gnutls_srp_server_get_username(session));
}
if (kx_alg == GNUTLS_KX_PSK && gnutls_psk_server_get_username(session)) {
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<p>Connected as user '%s'.</p>\n",
gnutls_psk_server_get_username(session));
}
strcat(http_buffer, "<P>\n");
tmp =
gnutls_protocol_get_name(version);
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TABLE border=1><TR><TD>Protocol version:</TD><TD>%s</TD></TR>\n",
tmp);
desc = gnutls_session_get_desc(session);
if (desc) {
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>Description:</TD><TD>%s</TD></TR>\n",
desc);
gnutls_free((void *) (desc)), desc=
((void *)0)
;
}
if (gnutls_auth_get_type(session) == GNUTLS_CRD_CERTIFICATE &&
gnutls_certificate_type_get2(session, GNUTLS_CTYPE_CLIENT) != GNUTLS_CRT_X509) {
tmp =
gnutls_certificate_type_get_name
(gnutls_certificate_type_get2(session, GNUTLS_CTYPE_CLIENT));
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>Certificate Type:</TD><TD>%s</TD></TR>\n",
tmp);
}
if (version < GNUTLS_TLS1_3) {
tmp = gnutls_kx_get_name(kx_alg);
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>Key Exchange:</TD><TD>%s</TD></TR>\n", tmp);
if (kx_alg == GNUTLS_KX_ANON_DH) {
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<p> Connect using anonymous DH (prime of %d bits)</p>\n",
gnutls_dh_get_prime_bits(session));
}
if (kx_alg == GNUTLS_KX_DHE_RSA || kx_alg == GNUTLS_KX_DHE_DSS) {
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"Ephemeral DH using prime of <b>%d</b> bits.<br>\n",
gnutls_dh_get_prime_bits(session));
}
tmp = gnutls_compression_get_name(gnutls_compression_get(session));
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>Compression</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_cipher_suite_get_name(kx_alg,
gnutls_cipher_get(session),
gnutls_mac_get(session));
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>Ciphersuite</TD><TD>%s</TD></TR>\n",
tmp);
}
tmp = gnutls_cipher_get_name(gnutls_cipher_get(session));
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>Cipher</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_mac_get_name(gnutls_mac_get(session));
if (tmp ==
((void *)0)
)
tmp = str_unknown;
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<TR><TD>MAC</TD><TD>%s</TD></TR>\n", tmp);
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"</TABLE></P>\n");
if (crtinfo) {
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<hr><PRE>%s\n</PRE>\n", crtinfo);
free(crtinfo);
}
snprintf(&http_buffer[strlen(http_buffer)], len-strlen(http_buffer),
"<hr><P>Your HTTP header was:<PRE>%s</PRE></P>\n"
"</BODY></HTML>\n\n", header);
*ret_length = strlen(http_buffer);
return http_buffer;
}
| char * peer_print_info(undefined8 param_1,undefined4 *param_2,char *param_3)
{
byte bVar1;
int iVar2;
undefined4 uVar3;
uint uVar4;
undefined4 uVar5;
char *pcVar6;
size_t sVar7;
size_t sVar8;
undefined8 uVar9;
long lVar10;
long in_FS_OFFSET;
uint local_1bc;
uint local_1b8;
int local_1b4;
ulong local_1b0;
undefined *local_1a8;
ulong local_1a0;
void *local_198;
long local_190;
size_t local_188;
long local_180;
size_t local_178;
void *local_170;
char *local_168;
long local_160;
void *local_158;
uint local_150;
byte local_148 [32];
undefined8 local_128;
undefined4 local_120;
undefined2 local_11c;
undefined local_11a;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_188 = strlen(param_3);
local_188 = local_188 + 0x5000;
local_198 = (void *)0x0;
local_190 = 0;
if (verbose == 0) {
local_168 = (char *)malloc(local_188);
if (local_168 == (char *)0x0) {
pcVar6 = (char *)0x0;
}
else {
strcpy(local_168,
"HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n\n<HTML><BODY>\n<CENTER><H1>This is <a href=\"http:
);
strcpy(local_168 + 0x95,
"This is the default message reported by the GnuTLS implementation. For more information please visit <a href=\"https:
);
strcpy(local_168 + 0x138,"</BODY></HTML>\n\n");
*param_2 = 0x148;
pcVar6 = local_168;
}
}
else {
iVar2 = gnutls_certificate_type_get2(param_1,0);
if (iVar2 == 1) {
local_1bc = 0;
local_180 = gnutls_certificate_get_peers(param_1,&local_1bc);
for (local_1a0 = 0; local_1a0 < local_1bc; local_1a0 = local_1a0 + 1) {
local_1b0 = 0;
iVar2 = gnutls_x509_crt_init(&local_1b0);
if (iVar2 == 0) {
iVar2 = gnutls_x509_crt_import(local_1b0,local_1a0 * 0x10 + local_180,0);
if (iVar2 == 0) {
iVar2 = gnutls_x509_crt_print(local_1b0,0,&local_158);
if (iVar2 == 0) {
local_128 = 0x503c3e4552502f3c;
local_120 = 0x52503c3e;
local_11c = 0x3e45;
local_11a = 0;
local_178 = xsum3(local_190,local_150,0xf);
if (local_178 == 0xffffffffffffffff) {
free(local_198);
pcVar6 = (char *)0x0;
goto LAB_00101a2f;
}
local_170 = realloc(local_198,local_178);
if (local_170 == (void *)0x0) {
free(local_198);
pcVar6 = (char *)0x0;
goto LAB_00101a2f;
}
local_198 = local_170;
memcpy((void *)((long)local_170 + local_190),local_158,(ulong)local_150);
local_190 = local_190 + (ulong)local_150;
sVar7 = strlen((char *)&local_128);
memcpy((void *)((long)local_198 + local_190),&local_128,sVar7);
sVar7 = strlen((char *)&local_128);
local_190 = local_190 + sVar7;
*(undefined *)(local_190 + (long)local_198) = 0;
(*gnutls_free)(local_158);
local_158 = (void *)0x0;
}
}
}
gnutls_x509_crt_deinit(local_1b0);
}
}
local_168 = (char *)malloc(local_188);
if (local_168 == (char *)0x0) {
free(local_198);
pcVar6 = (char *)0x0;
}
else {
strcpy(local_168,
"HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n\n<HTML><BODY>\n<CENTER><H1>This is <a href=\"http:
);
local_1b8 = gnutls_protocol_get_version(param_1);
local_1b0 = 0x20;
gnutls_session_get_id(param_1,local_148,&local_1b0);
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"\n<p>Session ID: <i>");
for (local_1a0 = 0; local_1a0 < local_1b0; local_1a0 = local_1a0 + 1) {
bVar1 = local_148[local_1a0];
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"%.2X",(ulong)bVar1);
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"</i></p>\n");
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,
"<h5>If your browser supports session resumption, then you should see the same session ID, when you press the <b>reload</b> button.</h5>\n"
);
local_158 = (void *)0x100;
iVar2 = gnutls_server_name_get(param_1,&local_128,&local_158,&local_1bc,0);
if (iVar2 == 0) {
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"\n<p>Server Name: %s</p>\n",&local_128);
}
local_1b4 = gnutls_kx_get(param_1);
if (local_1b4 == 5) {
uVar9 = gnutls_srp_server_get_username(param_1);
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<p>Connected as user \'%s\'.</p>\n",uVar9);
}
if (local_1b4 == 9) {
lVar10 = gnutls_psk_server_get_username(param_1);
if (lVar10 != 0) {
uVar9 = gnutls_psk_server_get_username(param_1);
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<p>Connected as user \'%s\'.</p>\n",uVar9);
}
}
strcat(local_168,"<P>\n");
local_1a8 = (undefined *)gnutls_protocol_get_name(local_1b8);
if (local_1a8 == (undefined *)0x0) {
local_1a8 = &str_unknown;
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,
"<TABLE border=1><TR><TD>Protocol version:</TD><TD>%s</TD></TR>\n",local_1a8);
local_160 = gnutls_session_get_desc(param_1);
if (local_160 != 0) {
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<TR><TD>Description:</TD><TD>%s</TD></TR>\n",local_160);
(*gnutls_free)(local_160);
local_160 = 0;
}
iVar2 = gnutls_auth_get_type(param_1);
if (iVar2 == 1) {
iVar2 = gnutls_certificate_type_get2(param_1,0);
if (iVar2 != 1) {
uVar3 = gnutls_certificate_type_get2(param_1,0);
local_1a8 = (undefined *)gnutls_certificate_type_get_name(uVar3);
if (local_1a8 == (undefined *)0x0) {
local_1a8 = &str_unknown;
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<TR><TD>Certificate Type:</TD><TD>%s</TD></TR>\n",
local_1a8);
}
}
if (local_1b8 < 5) {
local_1a8 = (undefined *)gnutls_kx_get_name(local_1b4);
if (local_1a8 == (undefined *)0x0) {
local_1a8 = &str_unknown;
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<TR><TD>Key Exchange:</TD><TD>%s</TD></TR>\n",local_1a8);
if (local_1b4 == 4) {
uVar4 = gnutls_dh_get_prime_bits(param_1);
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<p> Connect using anonymous DH (prime of %d bits)</p>\n"
,(ulong)uVar4);
}
if ((local_1b4 == 3) || (local_1b4 == 2)) {
uVar4 = gnutls_dh_get_prime_bits(param_1);
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"Ephemeral DH using prime of <b>%d</b> bits.<br>\n",
(ulong)uVar4);
}
uVar3 = gnutls_compression_get(param_1);
local_1a8 = (undefined *)gnutls_compression_get_name(uVar3);
if (local_1a8 == (undefined *)0x0) {
local_1a8 = &str_unknown;
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<TR><TD>Compression</TD><TD>%s</TD></TR>\n",local_1a8);
uVar3 = gnutls_mac_get(param_1);
uVar5 = gnutls_cipher_get(param_1);
local_1a8 = (undefined *)gnutls_cipher_suite_get_name(local_1b4,uVar5,uVar3);
if (local_1a8 == (undefined *)0x0) {
local_1a8 = &str_unknown;
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<TR><TD>Ciphersuite</TD><TD>%s</TD></TR>\n",local_1a8);
}
uVar3 = gnutls_cipher_get(param_1);
local_1a8 = (undefined *)gnutls_cipher_get_name(uVar3);
if (local_1a8 == (undefined *)0x0) {
local_1a8 = &str_unknown;
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<TR><TD>Cipher</TD><TD>%s</TD></TR>\n",local_1a8);
uVar3 = gnutls_mac_get(param_1);
local_1a8 = (undefined *)gnutls_mac_get_name(uVar3);
if (local_1a8 == (undefined *)0x0) {
local_1a8 = &str_unknown;
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<TR><TD>MAC</TD><TD>%s</TD></TR>\n",local_1a8);
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"</TABLE></P>\n");
if (local_198 != (void *)0x0) {
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,"<hr><PRE>%s\n</PRE>\n",local_198);
free(local_198);
}
sVar7 = strlen(local_168);
sVar7 = local_188 - sVar7;
sVar8 = strlen(local_168);
snprintf(local_168 + sVar8,sVar7,
"<hr><P>Your HTTP header was:<PRE>%s</PRE></P>\n</BODY></HTML>\n\n",param_3);
sVar7 = strlen(local_168);
*param_2 = (int)sVar7;
pcVar6 = local_168;
}
}
LAB_00101a2f:
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return pcVar6;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.