input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
void
put_u16(void *vp, u_int16_t v)
{
u_char *p = (u_char *)vp;
p[0] = (u_char)(v >> 8) & 0xff;
p[1] = (u_char)v & 0xff;
}
| void put_u16(undefined *param_1,undefined2 param_2)
{
*param_1 = (char)((ushort)param_2 >> 8);
param_1[1] = (char)param_2;
return;
}
|
static int
valid_request(struct passwd *pw, char *host, struct sshkey **ret, char **pkalgp,
u_char *data, size_t datalen)
{
struct sshbuf *b;
struct sshkey *key =
((void *)0)
;
u_char type, *pkblob;
char *p;
size_t blen, len;
char *pkalg, *luser;
int r, pktype, fail;
if (ret !=
((void *)0)
)
*ret =
((void *)0)
;
if (pkalgp !=
((void *)0)
)
*pkalgp =
((void *)0)
;
fail = 0;
if ((b = sshbuf_from(data, datalen)) ==
((void *)0)
)
sshfatal("ssh-keysign.c", __func__, 83, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_from failed");
if ((r = sshbuf_get_string(b,
((void *)0)
, &len)) != 0)
sshfatal("ssh-keysign.c", __func__, 87, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse session ID");
if (len != 20 &&
len != 32 &&
len != 48 &&
len != 64)
fail++;
if ((r = sshbuf_get_u8(b, &type)) != 0)
sshfatal("ssh-keysign.c", __func__, 95, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse type");
if (type != 50)
fail++;
if ((r = sshbuf_get_string_direct(b,
((void *)0)
,
((void *)0)
)) != 0)
sshfatal("ssh-keysign.c", __func__, 101, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse user");
if ((r = sshbuf_get_cstring(b, &p,
((void *)0)
)) != 0)
sshfatal("ssh-keysign.c", __func__, 105, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse service");
if (strcmp("ssh-connection", p) != 0)
fail++;
free(p);
if ((r = sshbuf_get_cstring(b, &p,
((void *)0)
)) != 0)
sshfatal("ssh-keysign.c", __func__, 112, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse method");
if (strcmp("hostbased", p) != 0)
fail++;
free(p);
if ((r = sshbuf_get_cstring(b, &pkalg,
((void *)0)
)) != 0 ||
(r = sshbuf_get_string(b, &pkblob, &blen)) != 0)
sshfatal("ssh-keysign.c", __func__, 120, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse pk");
pktype = sshkey_type_from_name(pkalg);
if (pktype == KEY_UNSPEC)
fail++;
else if ((r = sshkey_from_blob(pkblob, blen, &key)) != 0) {
sshlog("ssh-keysign.c", __func__, 126, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "decode key");
fail++;
} else if (key->type != pktype)
fail++;
if ((r = sshbuf_get_cstring(b, &p, &len)) != 0)
sshfatal("ssh-keysign.c", __func__, 133, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse hostname");
sshlog("ssh-keysign.c", __func__, 134, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "check expect chost %s got %s", host, p);
if (strlen(host) != len - 1)
fail++;
else if (p[len - 1] != '.')
fail++;
else if (strncasecmp(host, p, len - 1) != 0)
fail++;
free(p);
if ((r = sshbuf_get_cstring(b, &luser,
((void *)0)
)) != 0)
sshfatal("ssh-keysign.c", __func__, 145, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse luser");
if (strcmp(pw->pw_name, luser) != 0)
fail++;
free(luser);
if (sshbuf_len(b) != 0)
fail++;
sshbuf_free(b);
sshlog("ssh-keysign.c", __func__, 156, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "fail %d", fail);
if (!fail) {
if (ret !=
((void *)0)
) {
*ret = key;
key =
((void *)0)
;
}
if (pkalgp !=
((void *)0)
) {
*pkalgp = pkalg;
pkalg =
((void *)0)
;
}
}
sshkey_free(key);
free(pkalg);
free(pkblob);
return (fail ? -1 : 0);
}
| undefined8
valid_request(char **param_1,char *param_2,int **param_3,void **param_4,undefined8 param_5,
undefined8 param_6)
{
char *__s1;
int iVar1;
undefined8 uVar2;
size_t sVar3;
long lVar4;
char **ppcVar5;
undefined *puVar6;
undefined *puVar7;
long in_FS_OFFSET;
char *apcStack320 [22];
undefined8 local_90;
void **local_88;
int **local_80;
char *local_78;
char **local_70;
char local_5d;
int local_5c;
uint local_58;
int local_54;
int *local_50;
void *local_48;
char *local_40;
undefined8 local_38;
long local_30;
void *local_28;
char *local_20;
long local_18;
long local_10;
ppcVar5 = apcStack320 + 0x15;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_50 = (int *)0x0;
if (param_3 != (int **)0x0) {
*param_3 = (int *)0x0;
}
if (param_4 != (void **)0x0) {
*param_4 = (void *)0x0;
}
local_58 = 0;
apcStack320[20] = (char *)0x100088;
apcStack320[21] = (char *)param_6;
local_90 = param_5;
local_88 = param_4;
local_80 = param_3;
local_78 = param_2;
local_70 = param_1;
local_18 = sshbuf_from(param_5,param_6);
if (local_18 == 0) {
ppcVar5 = apcStack320 + 0x13;
apcStack320[19] = "sshbuf_from failed";
sshfatal("ssh-keysign.c","valid_request",0x53,1,1,0);
}
*(undefined8 *)((long)ppcVar5 + -8) = 0x1000e2;
local_5c = sshbuf_get_string(local_18,0,&local_30);
puVar6 = (undefined *)ppcVar5;
if (local_5c != 0) {
*(undefined8 *)((long)ppcVar5 + -8) = 0x1000f5;
uVar2 = ssh_err(local_5c);
puVar6 = (undefined *)((long)ppcVar5 + -0x10);
*(char **)((long)ppcVar5 + -0x10) = "parse session ID";
*(undefined8 *)((long)ppcVar5 + -0x18) = 0x10012c;
sshfatal("ssh-keysign.c","valid_request",0x57,1,1,uVar2);
}
if ((((local_30 != 0x14) && (local_30 != 0x20)) && (local_30 != 0x30)) && (local_30 != 0x40)) {
*(undefined8 *)(puVar6 + -8) = 0x100161;
local_58 = __addvsi3(local_58,1);
}
*(undefined8 *)(puVar6 + -8) = 0x100177;
local_5c = sshbuf_get_u8(local_18,&local_5d);
puVar7 = puVar6;
if (local_5c != 0) {
*(undefined8 *)(puVar6 + -8) = 0x10018a;
uVar2 = ssh_err(local_5c);
puVar7 = puVar6 + -0x10;
*(char **)(puVar6 + -0x10) = "parse type";
*(undefined8 *)(puVar6 + -0x18) = 0x1001c1;
sshfatal("ssh-keysign.c","valid_request",0x5f,1,1,uVar2);
}
if (local_5d != '2') {
*(undefined8 *)(puVar7 + -8) = 0x1001d6;
local_58 = __addvsi3(local_58,1);
}
*(undefined8 *)(puVar7 + -8) = 0x1001ef;
local_5c = sshbuf_get_string_direct(local_18,0,0);
puVar6 = puVar7;
if (local_5c != 0) {
*(undefined8 *)(puVar7 + -8) = 0x100202;
uVar2 = ssh_err(local_5c);
puVar6 = puVar7 + -0x10;
*(char **)(puVar7 + -0x10) = "parse user";
*(undefined8 *)(puVar7 + -0x18) = 0x100239;
sshfatal("ssh-keysign.c","valid_request",0x65,1,1,uVar2);
}
*(undefined8 *)(puVar6 + -8) = 0x100251;
local_5c = sshbuf_get_cstring(local_18,&local_40,0);
puVar7 = puVar6;
if (local_5c != 0) {
*(undefined8 *)(puVar6 + -8) = 0x100264;
uVar2 = ssh_err(local_5c);
puVar7 = puVar6 + -0x10;
*(char **)(puVar6 + -0x10) = "parse service";
*(undefined8 *)(puVar6 + -0x18) = 0x10029b;
sshfatal("ssh-keysign.c","valid_request",0x69,1,1,uVar2);
}
*(undefined8 *)(puVar7 + -8) = 0x1002ae;
iVar1 = strcmp("ssh-connection",local_40);
if (iVar1 != 0) {
*(undefined8 *)(puVar7 + -8) = 0x1002bf;
local_58 = __addvsi3(local_58,1);
}
*(undefined8 *)(puVar7 + -8) = 0x1002ce;
free(local_40);
*(undefined8 *)(puVar7 + -8) = 0x1002e6;
local_5c = sshbuf_get_cstring(local_18,&local_40,0);
puVar6 = puVar7;
if (local_5c != 0) {
*(undefined8 *)(puVar7 + -8) = 0x1002f9;
uVar2 = ssh_err(local_5c);
puVar6 = puVar7 + -0x10;
*(char **)(puVar7 + -0x10) = "parse method";
*(undefined8 *)(puVar7 + -0x18) = 0x100330;
sshfatal("ssh-keysign.c","valid_request",0x70,1,1,uVar2);
}
*(undefined8 *)(puVar6 + -8) = 0x100343;
iVar1 = strcmp("hostbased",local_40);
if (iVar1 != 0) {
*(undefined8 *)(puVar6 + -8) = 0x100354;
local_58 = __addvsi3(local_58,1);
}
*(undefined8 *)(puVar6 + -8) = 0x100363;
free(local_40);
*(undefined8 *)(puVar6 + -8) = 0x10037b;
local_5c = sshbuf_get_cstring(local_18,&local_28,0);
if (local_5c == 0) {
*(undefined8 *)(puVar6 + -8) = 0x10039b;
local_5c = sshbuf_get_string(local_18,&local_48,&local_38);
puVar7 = puVar6;
if (local_5c == 0) goto LAB_001003e5;
}
*(undefined8 *)(puVar6 + -8) = 0x1003ae;
uVar2 = ssh_err(local_5c);
puVar7 = puVar6 + -0x10;
*(char **)(puVar6 + -0x10) = "parse pk";
*(undefined8 *)(puVar6 + -0x18) = 0x1003e5;
sshfatal("ssh-keysign.c","valid_request",0x78,1,1,uVar2);
LAB_001003e5:
*(undefined8 *)(puVar7 + -8) = 0x1003f1;
local_54 = sshkey_type_from_name(local_28);
if (local_54 == 0xe) {
*(undefined8 *)(puVar7 + -8) = 0x100407;
local_58 = __addvsi3(local_58,1);
}
else {
*(undefined8 *)(puVar7 + -8) = 0x100426;
local_5c = sshkey_from_blob(local_48,local_38,&local_50);
if (local_5c == 0) {
if (local_54 != *local_50) {
*(undefined8 *)(puVar7 + -8) = 0x10049e;
local_58 = __addvsi3(local_58,1);
}
}
else {
*(undefined8 *)(puVar7 + -8) = 0x100439;
uVar2 = ssh_err(local_5c);
*(char **)(puVar7 + -0x10) = "decode key";
*(undefined8 *)(puVar7 + -0x18) = 0x100470;
sshlog("ssh-keysign.c","valid_request",0x7e,1,2,uVar2);
*(undefined8 *)(puVar7 + -8) = 0x100481;
local_58 = __addvsi3(local_58,1);
}
}
*(undefined8 *)(puVar7 + -8) = 0x1004b8;
local_5c = sshbuf_get_cstring(local_18,&local_40,&local_30);
puVar6 = puVar7;
if (local_5c != 0) {
*(undefined8 *)(puVar7 + -8) = 0x1004cb;
uVar2 = ssh_err(local_5c);
puVar6 = puVar7 + -0x10;
*(char **)(puVar7 + -0x10) = "parse hostname";
*(undefined8 *)(puVar7 + -0x18) = 0x100502;
sshfatal("ssh-keysign.c","valid_request",0x85,1,1,uVar2);
}
*(char **)(puVar6 + -0x10) = local_40;
*(char **)(puVar6 + -0x18) = local_78;
*(char **)(puVar6 + -0x20) = "check expect chost %s got %s";
*(undefined8 *)(puVar6 + -0x28) = 0x100544;
sshlog("ssh-keysign.c","valid_request",0x86,1,6,0);
*(undefined8 *)(puVar6 + -8) = 0x100554;
sVar3 = strlen(local_78);
if (sVar3 == local_30 - 1U) {
if (local_40[local_30 + -1] == '.') {
*(undefined8 *)(puVar6 + -8) = 0x1005b6;
iVar1 = strncasecmp(local_78,local_40,local_30 - 1);
if (iVar1 != 0) {
*(undefined8 *)(puVar6 + -8) = 0x1005c7;
local_58 = __addvsi3(local_58,1);
}
}
else {
*(undefined8 *)(puVar6 + -8) = 0x100596;
local_58 = __addvsi3(local_58,1);
}
}
else {
*(undefined8 *)(puVar6 + -8) = 0x10056e;
local_58 = __addvsi3(local_58,1);
}
*(undefined8 *)(puVar6 + -8) = 0x1005d6;
free(local_40);
*(undefined8 *)(puVar6 + -8) = 0x1005ee;
local_5c = sshbuf_get_cstring(local_18,&local_20,0);
puVar7 = puVar6;
if (local_5c != 0) {
*(undefined8 *)(puVar6 + -8) = 0x100601;
uVar2 = ssh_err(local_5c);
puVar7 = puVar6 + -0x10;
*(char **)(puVar6 + -0x10) = "parse luser";
*(undefined8 *)(puVar6 + -0x18) = 0x100638;
sshfatal("ssh-keysign.c","valid_request",0x91,1,1,uVar2);
}
__s1 = *local_70;
*(undefined8 *)(puVar7 + -8) = 0x10064e;
iVar1 = strcmp(__s1,local_20);
if (iVar1 != 0) {
*(undefined8 *)(puVar7 + -8) = 0x10065f;
local_58 = __addvsi3(local_58,1);
}
*(undefined8 *)(puVar7 + -8) = 0x10066e;
free(local_20);
*(undefined8 *)(puVar7 + -8) = 0x10067a;
lVar4 = sshbuf_len(local_18);
if (lVar4 != 0) {
*(undefined8 *)(puVar7 + -8) = 0x10068c;
local_58 = __addvsi3(local_58,1);
}
*(undefined8 *)(puVar7 + -8) = 0x10069b;
sshbuf_free(local_18);
*(ulong *)(puVar7 + -8) = (ulong)local_58;
*(char **)(puVar7 + -0x10) = "fail %d";
*(undefined8 *)(puVar7 + -0x18) = 0x1006d5;
sshlog("ssh-keysign.c","valid_request",0x9c,1,7,0);
if (local_58 == 0) {
if (local_80 != (int **)0x0) {
*local_80 = local_50;
local_50 = (int *)0x0;
}
if (local_88 != (void **)0x0) {
*local_88 = local_28;
local_28 = (void *)0x0;
}
}
*(undefined8 *)(puVar7 + -8) = 0x10071f;
sshkey_free(local_50);
*(undefined8 *)(puVar7 + -8) = 0x10072b;
free(local_28);
*(undefined8 *)(puVar7 + -8) = 0x100737;
free(local_48);
if (local_58 == 0) {
uVar2 = 0;
}
else {
uVar2 = 0xffffffff;
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
*(undefined8 *)(puVar7 + -8) = 0x10075d;
__stack_chk_fail();
}
return uVar2;
}
|
static void ge25519_mixadd2(crypto_sign_ed25519_ref_ge25519 *r, const ge25519_aff *q)
{
crypto_sign_ed25519_ref_fe25519 a,b,t1,t2,c,d,e,f,g,h,qt;
crypto_sign_ed25519_ref_fe25519_mul(&qt, &q->x, &q->y);
crypto_sign_ed25519_ref_fe25519_sub(&a, &r->y, &r->x);
crypto_sign_ed25519_ref_fe25519_add(&b, &r->y, &r->x);
crypto_sign_ed25519_ref_fe25519_sub(&t1, &q->y, &q->x);
crypto_sign_ed25519_ref_fe25519_add(&t2, &q->y, &q->x);
crypto_sign_ed25519_ref_fe25519_mul(&a, &a, &t1);
crypto_sign_ed25519_ref_fe25519_mul(&b, &b, &t2);
crypto_sign_ed25519_ref_fe25519_sub(&e, &b, &a);
crypto_sign_ed25519_ref_fe25519_add(&h, &b, &a);
crypto_sign_ed25519_ref_fe25519_mul(&c, &r->t, &qt);
crypto_sign_ed25519_ref_fe25519_mul(&c, &c, &ge25519_ec2d);
crypto_sign_ed25519_ref_fe25519_add(&d, &r->z, &r->z);
crypto_sign_ed25519_ref_fe25519_sub(&f, &d, &c);
crypto_sign_ed25519_ref_fe25519_add(&g, &d, &c);
crypto_sign_ed25519_ref_fe25519_mul(&r->x, &e, &f);
crypto_sign_ed25519_ref_fe25519_mul(&r->y, &h, &g);
crypto_sign_ed25519_ref_fe25519_mul(&r->z, &g, &f);
crypto_sign_ed25519_ref_fe25519_mul(&r->t, &e, &h);
}
| void ge25519_mixadd2(unsigned long long a0, unsigned long long a1) {
char v0;
char v1;
char v2;
char v3;
char v4;
char v5;
char v6;
char v7;
char v8;
char v9;
char v10;
char v11;
unsigned long long *v13;
unsigned long long v14;
crypto_sign_ed25519_ref_fe25519_mul(&v10, a1, a1 + 128, a1);
crypto_sign_ed25519_ref_fe25519_sub(&v0, a0 + 128, a0, a0 + 128);
crypto_sign_ed25519_ref_fe25519_add(&v1, a0 + 128, a0, a0 + 128);
crypto_sign_ed25519_ref_fe25519_sub(&v2, a1 + 128, a1, a1 + 128);
crypto_sign_ed25519_ref_fe25519_add(&v3, a1 + 128, a1, a1 + 128);
crypto_sign_ed25519_ref_fe25519_mul(&v0, &v0, &v2, &v0);
crypto_sign_ed25519_ref_fe25519_mul(&v1, &v1, &v3, &v1);
crypto_sign_ed25519_ref_fe25519_sub(&v6, &v1, &v0, &v1);
crypto_sign_ed25519_ref_fe25519_add(&v9, &v1, &v0, &v1);
crypto_sign_ed25519_ref_fe25519_mul(&v4, a0 + 384, &v10, a0 + 384);
crypto_sign_ed25519_ref_fe25519_mul(&v4, &v4, "Y", &v4);
crypto_sign_ed25519_ref_fe25519_add(&v5, a0 + 0x100, a0 + 0x100, a0 + 0x100);
crypto_sign_ed25519_ref_fe25519_sub(&v7, &v5, &v4, &v5);
crypto_sign_ed25519_ref_fe25519_add(&v8, &v5, &v4, &v5);
crypto_sign_ed25519_ref_fe25519_mul(a0, &v6, &v7, &v6);
crypto_sign_ed25519_ref_fe25519_mul(a0 + 128, &v9, &v8, a0 + 128);
crypto_sign_ed25519_ref_fe25519_mul(a0 + 0x100, &v8, &v7, a0 + 0x100);
crypto_sign_ed25519_ref_fe25519_mul(a0 + 384, &v6, &v9, a0 + 384);
v14 = *(&v11) ^ v13[5];
return;
}
|
time_t get_crl_revocation_date(void)
{
if (batch && cfg.revocation_date !=
((void *)0)
) {
return get_date(cfg.revocation_date);
}
return time(
((void *)0)
);
}
| long long get_crl_revocation_date() {
unsigned long long v1;
if (*(got.batch) && *((got.cfg + 496))) {
v1 = get_date(*((got.cfg + 496)));
return v1;
}
v1 = time(NULL);
return v1;
}
|
void
xattrs_selinux_get (int parentfd, char const *file_name,
struct tar_stat_info *st, int fd)
{
if (selinux_context_option > 0)
{
int result = fd ?
rpl_fgetfilecon (fd, &st->cntx_name)
: lgetfileconat (parentfd, file_name, &st->cntx_name);
if (result == -1 &&
(*__errno_location ())
!=
61
&&
(*__errno_location ())
!=
95
)
call_arg_warn (fd ? "fgetfilecon" : "lgetfileconat", file_name);
}
}
| long long xattrs_selinux_get(unsigned long a0, unsigned long long a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
unsigned long long v2;
unsigned long long v3;
v2 = selinux_context_option;
if (selinux_context_option > 0) {
if (a3)
v2 = rpl_fgetfilecon(a3, a2 + 48, a2 + 48);
else
v2 = lgetfileconat(a0, a1, a2 + 48, a1);
v0 = v2;
if (v0 == -1) {
v2 = *(__errno_location());
if (v2 != 61) {
v2 = *(__errno_location());
if (v2 != 95) {
if (a3)
v3 = "fgetfilecon";
else
v3 = "lgetfileconat";
v2 = call_arg_warn(v3, a1);
}
}
}
}
return v2;
}
|
static void
sigterm_handler(int sig)
{
received_sigterm = sig;
}
| long sigterm_handler(int a1)
{
long result;
result = (unsigned int)a1;
received_sigterm = a1;
return result;
}
|
static void compress_block(ltree, dtree)
ct_data *ltree;
ct_data *dtree;
{
unsigned dist;
int lc;
unsigned lx = 0;
unsigned dx = 0;
unsigned fx = 0;
uch flag = 0;
unsigned code;
int extra;
if (last_lit != 0) do {
if ((lx & 7) == 0) flag = flag_buf[fx++];
lc = inbuf[lx++];
if ((flag & 1) == 0) {
send_bits(ltree[lc].fc.code, ltree[lc].dl.len);
;
} else {
code = length_code[lc];
send_bits(ltree[code+256 +1].fc.code, ltree[code+256 +1].dl.len);
extra = extra_lbits[code];
if (extra != 0) {
lc -= base_length[code];
send_bits(lc, extra);
}
dist = d_buf[dx++];
code = ((dist) < 256 ? dist_code[dist] : dist_code[256+((dist)>>7)]);
;
send_bits(dtree[code].fc.code, dtree[code].dl.len);
extra = extra_dbits[code];
if (extra != 0) {
dist -= base_dist[code];
send_bits(dist, extra);
}
}
flag >>= 1;
} while (lx < last_lit);
send_bits(ltree[256].fc.code, ltree[256].dl.len);
}
| void compress_block(unsigned short *a0, unsigned short *a1) {
char v0;
int tmp_8;
int tmp_15;
int tmp_13;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned int v7;
unsigned long long v11;
unsigned int v13;
unsigned long long v14;
v1 = 0;
v2 = 0;
v3 = 0;
v0 = 0;
if (last_lit) {
do {
if (!(v1 & 7)) {
tmp_8 = v3;
v3 += 1;
v0 = *(tmp_8 + &flag_buf);
}
tmp_15 = v1;
v1 += 1;
v4 = *(tmp_15 + &inbuf);
if (!(v0 & 1)) {
send_bits(a0[2 * v4], a0[1 + 2 * v4], a0[1 + 2 * v4], v4 * 4);
} else {
v5 = *(v4 + &length_code);
send_bits(a0[514 + 2 * v5], a0[515 + 2 * v5], a0[515 + 2 * v5], (v5 + 257) * 4);
v6 = *((4 * v5 + &extra_lbits));
if (v6) {
v4 -= *((4 * v5 + &base_length));
send_bits(v4, v6, v6, v11);
}
tmp_13 = v2;
v2 += 1;
v7 = *((2 * tmp_13 + &d_buf));
if (v7 <= 255)
v13 = *(v7 + &dist_code);
else
v13 = *((v7 >> 7) + &g_403c40);
v5 = v13;
send_bits(a1[2 * v5], a1[1 + 2 * v5], a1[1 + 2 * v5], v5 * 4);
v6 = *((4 * v5 + &extra_dbits));
if (v6) {
v7 -= *((4 * v5 + &base_dist));
send_bits(v7, v6, v6, v11);
}
}
v0 >>= 1;
} while (v1 < last_lit);
}
v14 = send_bits(a0[0x200], a0[513], a0[513], v11);
return;
}
|
static
_Bool
fillbuf (struct buffer *buf, FILE *fp, char const *file)
{
struct keyfield const *key = keylist;
char eol = eolchar;
size_t line_bytes = buf->line_bytes;
size_t mergesize = merge_buffer_size - (2 + sizeof (struct line));
if (buf->eof)
return
0
;
if (buf->used != buf->left)
{
memmove (buf->buf, buf->buf + buf->used - buf->left, buf->left);
buf->used = buf->left;
buf->nlines = 0;
}
while (
1
)
{
char *ptr = buf->buf + buf->used;
struct line *linelim = buffer_linelim (buf);
struct line *line = linelim - buf->nlines;
size_t avail = (char *) linelim - buf->nlines * line_bytes - ptr;
char *line_start = buf->nlines ? line->text + line->length : buf->buf;
while (line_bytes + 1 < avail)
{
size_t readsize = (avail - 1) / (line_bytes + 1);
size_t bytes_read = fread_unlocked (ptr,1,readsize,fp);
char *ptrlim = ptr + bytes_read;
char *p;
avail -= bytes_read;
if (bytes_read != readsize)
{
if (ferror_unlocked (fp))
sort_die (gettext ("read failed"), file);
if (feof_unlocked (fp))
{
buf->eof =
1
;
if (buf->buf == ptrlim)
return
0
;
if (line_start != ptrlim && ptrlim[-1] != eol)
*ptrlim++ = eol;
}
}
while ((p = memchr (ptr, eol, ptrlim - ptr)))
{
*p = '\0';
ptr = p + 1;
line--;
line->text = line_start;
line->length = ptr - line_start;
mergesize =
(((
mergesize
)>(
line->length
))?(
mergesize
):(
line->length
))
;
avail -= line_bytes;
if (key)
{
line->keylim = (key->eword ==
(18446744073709551615UL)
? p
: limfield (line, key));
if (key->sword !=
(18446744073709551615UL)
)
line->keybeg = begfield (line, key);
else
{
if (key->skipsblanks)
while (blanks[to_uchar (*line_start)])
line_start++;
line->keybeg = line_start;
}
}
line_start = ptr;
}
ptr = ptrlim;
if (buf->eof)
break;
}
buf->used = ptr - buf->buf;
buf->nlines = buffer_linelim (buf) - line;
if (buf->nlines != 0)
{
buf->left = ptr - line_start;
merge_buffer_size = mergesize + (2 + sizeof (struct line));
return
1
;
}
{
size_t line_alloc = buf->alloc / sizeof (struct line);
buf->buf = x2nrealloc (buf->buf, &line_alloc, sizeof (struct line));
buf->alloc = line_alloc * sizeof (struct line);
}
}
}
| int fillbuf(struct_0 *a0, void* a1, unsigned long long a2) {
char v0;
unsigned long long v1;
unsigned long long v2;
void* v3;
unsigned long long v4[4];
unsigned long v5;
char *v6;
void* v7;
struct_1 *v8;
unsigned long v9;
unsigned long v10;
unsigned int v11;
unsigned long v12;
char *v13;
unsigned int v15;
char *v16;
unsigned long long v17;
char *v18;
unsigned long long v19;
unsigned long v20;
v8 = keylist;
v0 = eolchar;
v9 = a0->field_28;
v2 = merge_buffer_size - 34;
if (a0->field_30) {
v15 = 0;
} else {
if (a0->field_8 != a0->field_20) {
memmove(a0->field_0, a0->field_0 + a0->field_8 - a0->field_20, a0->field_20);
a0->field_8 = a0->field_20;
a0->field_10 = 0;
}
while (true) {
v3 = a0->field_8 + a0->field_0;
v10 = buffer_linelim(a0);
v4[0] = v10 + -(a0->field_10 << 5);
v5 = v10 + -(v9 * a0->field_10) - v3;
if (a0->field_10)
v15 = v4[1] + v4[0];
else
v15 = a0->field_0;
v6 = v15;
while (true) {
if (v5 <= v9 + 1) {
LABEL_402d5e:
a0->field_8 = v3 - a0->field_0;
a0->field_10 = buffer_linelim(a0) + -0x1 * v4 >> 5;
if (a0->field_10) {
a0->field_20 = v3 - v6;
merge_buffer_size = v2 + 34;
v15 = 1;
goto LABEL_402e37;
} else {
v1 = a0->field_18 >> 5;
a0->field_0 = x2nrealloc(a0->field_0, &v1, 0x20);
a0->field_18 = v1 * 32;
break;
}
} else {
*(&v11) = (0 CONCAT v5 - 1) /m (v9 + 1);
v12 = fread_unlocked(v3, 0x1, *(&v11), a1);
v7 = v12 + v3;
v5 -= v12;
if (v12 != *(&v11)) {
if (ferror_unlocked(a1)) {
v20 = gettext("read failed");
sort_die(v20, a2, v20);
}
if (feof_unlocked(a1)) {
a0->field_30 = 1;
if (v7 == a0->field_0) {
v15 = 0;
goto LABEL_402e37;
} else if (v6 != v7 && v0 != v7[1]) {
v16 = v7;
v7 += 1;
*(v16) = v0;
}
}
}
while (true) {
v15 = memchr(v3, v0, v7 - v3);
v13 = v15;
if (!v13)
break;
*(v13) = 0;
v3 = v13 + 1;
v4[0] = v4 + 1;
v4[0] = v6;
v4[1] = v3 - v6;
v17 = v4[1];
if (v4[1] <= v2)
v17 = v2;
v2 = v17;
v5 -= v9;
if (v8) {
if (v8->field_10 != -1)
v18 = limfield(v4, v8);
else
v18 = v13;
v4[3] = v18;
if (v8->field_0 != -1) {
v4[2] = begfield(v4, v8);
} else {
if (v8->field_30) {
while (true) {
v19 = to_uchar(*(v6));
*(&v19) = *(v19 + &blanks);
if (!v19)
break;
v6 += 1;
}
}
v4[2] = v6;
}
}
v6 = v3;
}
v3 = v7;
if (!(!a0->field_30))
goto LABEL_402d5e;
}
}
}
}
LABEL_402e37:
return v15;
}
|
static int ifa_label_match_rta(int ifindex, const struct rtattr *rta)
{
const char *label;
if (!filter.label)
return 0;
if (rta)
label = ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
else
label = ll_index_to_name(ifindex);
return fnmatch(filter.label, label, 0);
}
| int ifa_label_match_rta(unsigned long a0, unsigned long a1) {
char *v0;
unsigned int v2;
if (!g_408630) {
v2 = 0;
} else {
if (a1)
v0 = a1 + 4;
else
v0 = ll_index_to_name(a0);
v2 = fnmatch(g_408630, v0, 0x0);
}
return v2;
}
|
re_goto_bottom(EditLine *el)
{
terminal_move_to_line(el, el->el_refresh.r_oldcv);
terminal__putc(el, '\n');
re_clear_display(el);
terminal__flush(el);
}
| long re_goto_bottom(long a1)
{
terminal_move_to_line(a1, *(unsigned int *)(a1 + 792));
terminal__putc(a1, 10LL);
re_clear_display(a1);
return terminal__flush(a1);
}
|
static void usage(void)
{
fprintf(
stderr
, gettext ("usage: %s <pid> <uid> <loweruid> <count> [ <uid> <loweruid> <count> ] ... \n"), Prog);
exit(
1
);
}
| void usage() {
unsigned long v0;
unsigned long v2;
v0 = v2;
fprintf(stderr, gettext("usage: %s <pid> <uid> <loweruid> <count> [ <uid> <loweruid> <count> ] ... \n"));
exit(0x1);
}
|
static int
history_def_insert(history_t *h, HistEventW *ev, const wchar_t *str)
{
hentry_t *c;
c = malloc(sizeof(*c));
if (c ==
((void *)0)
)
goto oomem;
if ((c->ev.str = wcsdup(str)) ==
((void *)0)
) {
free(c);
goto oomem;
}
c->data =
((void *)0)
;
c->ev.num = ++h->eventid;
c->next = h->list.next;
c->prev = &h->list;
h->list.next->prev = c;
h->list.next = c;
h->cur++;
h->cursor = c;
*ev = c->ev;
return 0;
oomem:
{ ev->num = 2; ev->str = he_errlist[2]; };
return -1;
}
| int history_def_insert(struct_0 *a0, struct_2 *a1, unsigned short *a2) {
unsigned short *v0;
struct_3 *v1;
unsigned long long v3;
unsigned int v4;
v0 = a2;
v1 = malloc(0x28);
if (v1) {
v1->field_8 = wcsdup(v0);
if (v1->field_8) {
v1->field_10 = 0;
a0->field_38 = a0->field_38 + 1;
*(&v1->field_0) = a0->field_38;
v1->field_18 = a0->field_18;
v1->field_20 = a0;
a0->field_18->field_20 = v1;
a0->field_18 = &v1->field_0;
a0->field_34 = a0->field_34 + 1;
a0->field_28 = v1;
v3 = v1->field_8;
*(&a1->field_0) = *(&v1->field_0);
a1->field_8 = v3;
v4 = 0;
goto LABEL_400985;
} else {
free(v1);
}
}
a1->field_0 = 2;
a1->field_8 = "m";
v4 = -1;
LABEL_400985:
return v4;
}
|
static void
get_spec_stats (struct Spec_list *s)
{
struct List_element *p;
count length = 0;
s->n_indefinite_repeats = 0;
s->has_equiv_class =
0
;
s->has_restricted_char_class =
0
;
s->has_char_class =
0
;
for (p = s->head->next; p; p = p->next)
{
count len = 0;
count new_length;
switch (p->type)
{
case RE_NORMAL_CHAR:
len = 1;
break;
case RE_RANGE:
((void) sizeof ((
p->u.range.last_char >= p->u.range.first_char
) ? 1 : 0), __extension__ ({ if (
p->u.range.last_char >= p->u.range.first_char
) ; else __assert_fail (
"p->u.range.last_char >= p->u.range.first_char"
, "src/tr.c", 1265, __extension__ __PRETTY_FUNCTION__); }))
;
len = p->u.range.last_char - p->u.range.first_char + 1;
break;
case RE_CHAR_CLASS:
s->has_char_class =
1
;
for (int i = 0; i < N_CHARS; i++)
if (is_char_class_member (p->u.char_class, i))
++len;
switch (p->u.char_class)
{
case CC_UPPER:
case CC_LOWER:
break;
default:
s->has_restricted_char_class =
1
;
break;
}
break;
case RE_EQUIV_CLASS:
for (int i = 0; i < N_CHARS; i++)
if (is_equiv_class_member (p->u.equiv_code, i))
++len;
s->has_equiv_class =
1
;
break;
case RE_REPEATED_CHAR:
if (p->u.repeated_char.repeat_count > 0)
len = p->u.repeated_char.repeat_count;
else
{
s->indefinite_repeat_element = p;
++(s->n_indefinite_repeats);
}
break;
default:
abort ();
}
new_length = length + len;
if (! (length <= new_length && new_length <= (
(18446744073709551615UL)
- 1)))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"too many characters in set\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("too many characters in set")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("too many characters in set")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
length = new_length;
}
s->length = length;
}
| void get_spec_stats(struct_0 *a0) {
unsigned int v0;
unsigned int v1;
struct_3 *v2;
void* v3;
unsigned long long v4;
unsigned long v5;
struct_2 *v9;
v3 = 0;
a0->field_20 = 0;
a0->field_30 = 0;
a0->field_32 = 0;
a0->field_31 = 0;
v2 = a0->field_0->field_8;
while (true) {
if (v2) {
v4 = 0;
switch (v2->field_0) {
case 0:
v4 = 1;
v5 = v4 + v3;
if (v3 <= v5 && v5 != -1) {
v3 = v5;
v2 = v2->field_8;
continue;
}
case 1:
if (v2->field_11 < v2->field_10)
__assert_fail();
v4 = v2->field_11 - v2->field_10 + 1;
break;
case 2:
a0->field_31 = 1;
for (v0 = 0; v0 <= 255; v0 += 1) {
if (is_char_class_member(*(&v2->field_10), v0))
v4 += 1;
}
if (*(&v2->field_10) != 6 && *(&v2->field_10) != 10)
a0->field_32 = 1;
break;
case 3:
for (v1 = 0; v1 <= 255; v1 += 1) {
if (is_equiv_class_member(v2->field_10, v1))
v4 += 1;
}
a0->field_30 = 1;
break;
case 4:
if (v2->field_18) {
v4 = v2->field_18;
break;
} else {
a0->field_28 = v2;
a0->field_20 = a0->field_20 + 1;
break;
}
default:
abort();
}
} else {
v9 = a0;
a0->field_18 = v3;
return;
}
}
error(0x1, 0x0, gettext("too many characters in set"));
}
|
int
ssh_packet_get_connection_in(struct ssh *ssh)
{
return ssh->state->connection_in;
}
| long long ssh_packet_get_connection_in(unsigned int **a0) {
return *(*(a0));
}
|
static
_Bool
consider_arm_swap (struct predicate *p)
{
int left_cost, right_cost;
const char *reason =
((void *)0)
;
struct predicate **pl, **pr;
if (BI_OP != p->p_type)
reason = "Not a binary operation";
if (!reason)
{
if (
((void *)0)
== p->pred_left ||
((void *)0)
== p->pred_right)
reason = "Doesn't have two arms";
}
if (!reason)
{
if (
((void *)0)
== p->pred_left->pred_right)
reason = "Left arm has no child on RHS";
}
pr = &p->pred_right;
pl = &p->pred_left->pred_right;
if (!reason)
{
if (subtree_has_side_effects (*pl))
reason = "Left subtree has side-effects";
}
if (!reason)
{
if (subtree_has_side_effects (*pr))
reason = "Right subtree has side-effects";
}
if (!reason)
{
left_cost = worst_cost (*pl);
right_cost = worst_cost (*pr);
if (left_cost < right_cost)
{
reason = "efficient as-is";
}
}
if (!reason)
{
_Bool
want_swap;
if (left_cost == right_cost)
{
float succ_rate_l = (*pl)->est_success_rate;
float succ_rate_r = (*pr)->est_success_rate;
if (options.debug_options & DebugTreeOpt)
{
fprintf (
stderr
, "Success rates: l=%f, r=%f\n", succ_rate_l, succ_rate_r);
}
if (( ((p)->pred_func) == (pred_or) ))
{
want_swap = succ_rate_r < succ_rate_l;
if (!want_swap)
reason = "Operation is OR; right success rate >= left";
}
else if (( ((p)->pred_func) == (pred_and) ))
{
want_swap = succ_rate_r > succ_rate_l;
if (!want_swap)
reason = "Operation is AND; right success rate <= left";
}
else
{
want_swap =
0
;
reason = "Not 'AND' or 'OR'";
}
}
else
{
want_swap =
1
;
}
if (want_swap)
{
if (options.debug_options & DebugTreeOpt)
{
fprintf (
stderr
, "Performing arm swap on:\n");
print_tree (
stderr
, p, 0);
}
perform_arm_swap (p);
return
1
;
}
}
if (options.debug_options & DebugTreeOpt)
{
fprintf (
stderr
, "Not an arm swap candidate (%s):\n", reason);
print_tree (
stderr
, p, 0);
}
return
0
;
}
| int consider_arm_swap(struct_0 *a0) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned long long v5;
struct struct_2 **v6;
struct struct_2 **v7;
unsigned int v9;
unsigned int v10;
unsigned int v11;
v5 = 0;
if (a0->field_10 != 3)
v5 = "Not a binary operation";
if (!v5) {
if (a0->field_110 && !(!a0->field_118))
goto LABEL_400d33;
v5 = "Doesn't have two arms";
}
LABEL_400d33:
if (!v5 && !a0->field_110->field_118)
v5 = "Left arm has no child on RHS";
v6 = &a0->field_118;
v7 = &a0->field_110->field_118;
if (!v5 && subtree_has_side_effects(*(v7)))
v5 = "Left subtree has side-effects";
if (!v5 && subtree_has_side_effects(*(v6)))
v5 = "Right subtree has side-effects";
if (!v5) {
v1 = worst_cost(*(v7));
v2 = worst_cost(*(v6));
if (v1 < v2)
v5 = "efficient as-is";
}
if (!v5) {
if (v1 != v2) {
v0 = 1;
} else {
v3 = *(v7)->field_24;
v4 = *(v6)->field_24;
if ((got.pred_or & 8))
fprintf(stderr, "Success rates: l=%f, r=%f\n", v9, v10);
if (a0->field_0 == got.pred_or) {
v0 = !((BinaryOp CmpF & 69 | (BinaryOp CmpF & 69) >> 6) & 1);
if ((v0 ^ 1))
v5 = "Operation is OR; right success rate >= left";
} else if (a0->field_0 != got.pred_and) {
v0 = 0;
v5 = "Not 'AND' or 'OR'";
} else {
v0 = !((BinaryOp CmpF & 69 | (BinaryOp CmpF & 69) >> 6) & 1);
if ((v0 ^ 1))
v5 = "Operation is AND; right success rate <= left";
}
}
if (v0) {
if ((got.pred_or & 8)) {
fprintf(stderr, "Performing arm swap on:");
print_tree(stderr, a0, 0x0);
}
perform_arm_swap(a0);
v11 = 1;
goto LABEL_400fa9;
}
}
if ((got.pred_or & 8)) {
fprintf(stderr, "Not an arm swap candidate (%s):\n", v5);
print_tree(stderr, a0, 0x0);
}
v11 = 0;
LABEL_400fa9:
return v11;
}
|
static void tun_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
{
if (!tb)
return;
if (tb[IFLA_TUN_TYPE])
print_type(f, rta_getattr_u8(tb[IFLA_TUN_TYPE]));
if (tb[IFLA_TUN_PI])
print_on_off(PRINT_ANY, "pi", "pi %s ",
rta_getattr_u8(tb[IFLA_TUN_PI]));
if (tb[IFLA_TUN_VNET_HDR]) {
print_on_off(PRINT_ANY, "vnet_hdr", "vnet_hdr %s ",
rta_getattr_u8(tb[IFLA_TUN_VNET_HDR]));
}
print_mq(f, tb);
if (tb[IFLA_TUN_PERSIST])
print_on_off(PRINT_ANY, "persist", "persist %s ",
rta_getattr_u8(tb[IFLA_TUN_PERSIST]));
if (tb[IFLA_TUN_OWNER])
print_owner(f, rta_getattr_u32(tb[IFLA_TUN_OWNER]));
if (tb[IFLA_TUN_GROUP])
print_group(f, rta_getattr_u32(tb[IFLA_TUN_GROUP]));
}
| long long tun_print_opt(unsigned long a0, unsigned int a1, unsigned long long a2[7]) {
unsigned long v0;
unsigned long long v2;
v0 = a0;
if (!a2)
return v2;
if (a2[3])
print_type(a1, rta_getattr_u8(a2[3]));
if (a2[4])
print_on_off(0x4, "pi", "pi %s ", rta_getattr_u8(a2[4]));
if (a2[5])
print_on_off(0x4, "vnet_hdr", "vnet_hdr %s ", rta_getattr_u8(a2[5]));
print_mq(a1, a2);
if (a2[6])
print_on_off(0x4, "persist", "persist %s ", rta_getattr_u8(a2[6]));
if (a2[1])
print_owner(a1, rta_getattr_u32(a2[1]));
v2 = a2[2];
if (a2[2]) {
v2 = print_group(a1, rta_getattr_u32(a2[2]));
return v2;
}
return v2;
}
|
int
_rl_output_character_function (int c)
{
return putc (c, _rl_out_stream);
}
| void _rl_output_character_function(int param_1)
{
putc(param_1,_rl_out_stream);
return;
}
|
void get_ip_addr_set(int type, void *crt)
{
int ret = 0, i;
unsigned char ip[16];
int len;
if (batch) {
if (!cfg.ip_addr)
return;
for (i = 0; cfg.ip_addr[i] !=
((void *)0)
; i++) {
len = string_to_ip(ip, cfg.ip_addr[i]);
if (len <= 0) {
fprintf(
stderr
,
"Error parsing address: %s\n",
cfg.ip_addr[i]);
exit(1);
}
if (type == 1)
ret =
gnutls_x509_crt_set_subject_alt_name
(crt, GNUTLS_SAN_IPADDRESS, ip, len,
1);
else
ret =
gnutls_x509_crq_set_subject_alt_name
(crt, GNUTLS_SAN_IPADDRESS, ip, len,
1);
if (ret < 0)
break;
}
} else {
const char *p;
p = read_str
("Enter the IP address of the subject of the certificate: ");
if (!p)
return;
len = string_to_ip(ip, p);
if (len <= 0) {
fprintf(
stderr
, "Error parsing address: %s\n", p);
exit(1);
}
if (type == 1)
ret =
gnutls_x509_crt_set_subject_alt_name(crt,
GNUTLS_SAN_IPADDRESS,
ip, len,
1);
else
ret =
gnutls_x509_crq_set_subject_alt_name(crt,
GNUTLS_SAN_IPADDRESS,
ip, len,
1);
}
if (ret < 0) {
fprintf(
stderr
, "set_subject_alt_name: %s\n",
gnutls_strerror(ret));
exit(1);
}
}
| void get_ip_addr_set(int param_1,undefined8 param_2)
{
int iVar1;
long lVar2;
long in_FS_OFFSET;
int local_3c;
int local_38;
undefined local_28 [24];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_3c = 0;
if (*piRam00000000001075ec == 0) {
lVar2 = read_str("Enter the IP address of the subject of the certificate: ");
if (lVar2 == 0) goto LAB_00107808;
iVar1 = string_to_ip(local_28,lVar2);
if (iVar1 < 1) {
fprintf(*ppFRam0000000000107757,"Error parsing address: %s\n",lVar2);
}
if (param_1 == 1) {
local_3c = gnutls_x509_crt_set_subject_alt_name(param_2,4,local_28,iVar1,1);
}
else {
local_3c = gnutls_x509_crq_set_subject_alt_name(param_2,4,local_28,iVar1,1);
}
}
else {
if (*(long *)(lRam00000000001075fd + 0x148) == 0) goto LAB_00107808;
local_38 = 0;
while (*(long *)(*(long *)(lRam00000000001076f4 + 0x148) + (long)local_38 * 8) != 0) {
iVar1 = string_to_ip(local_28,*(undefined8 *)
(*(long *)(lRam0000000000107620 + 0x148) + (long)local_38 * 8))
;
if (iVar1 < 1) {
fprintf(*ppFRam0000000000107674,"Error parsing address: %s\n",
*(undefined8 *)(*(long *)(lRam0000000000107656 + 0x148) + (long)local_38 * 8));
}
if (param_1 == 1) {
local_3c = gnutls_x509_crt_set_subject_alt_name(param_2,4,local_28,iVar1,1);
}
else {
local_3c = gnutls_x509_crq_set_subject_alt_name(param_2,4,local_28,iVar1,1);
}
if (local_3c < 0) break;
local_38 = local_38 + 1;
}
}
if (local_3c < 0) {
gnutls_strerror(local_3c);
}
LAB_00107808:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
|
static crypto_uint32 lt(crypto_uint32 a,crypto_uint32 b)
{
unsigned int x = a;
x -= (unsigned int) b;
x >>= 31;
return x;
}
| long lt(int a1, int a2)
{
return (unsigned int)(a1 - a2) >> 31;
}
|
extern inline
_Bool
c_ispunct (int c)
{
switch (c)
{
case '!': case '"': case '#': case '$': case '%': case '&': case '\'': case '(': case ')': case '*': case '+': case ',': case '-': case '.': case '/': case ':': case ';': case '<': case '=': case '>': case '?': case '@': case '[': case '\\': case ']': case '^': case '_': case '`': case '{': case '|': case '}': case '~':
return
1
;
default:
return
0
;
}
}
| long long c_ispunct(unsigned long a0) {
unsigned long long v1;
if (a0 <= 126 && (a0 <= 96 || a0 >= 123) && (a0 <= 47 || a0 - 58 <= 6 || a0 >= 123 || a0 >= 91) && (a0 > 47 || a0 >= 123 || a0 >= 91 || a0 >= 33))
v1 = 1;
if (a0 > 126 || a0 < 123 && a0 > 96 || a0 <= 47 && a0 < 123 && a0 < 91 && a0 < 33 || a0 < 123 && a0 < 91 && a0 > 47 && a0 - 58 > 6)
v1 = 0;
return v1;
}
|
static int gz_comp(state, flush)
gz_statep state;
int flush;
{
int ret, writ;
unsigned have, put, max = ((unsigned)-1 >> 2) + 1;
z_streamp strm = &(state->strm);
if (state->size == 0 && gz_init(state) == -1)
return -1;
if (state->direct) {
while (strm->avail_in) {
put = strm->avail_in > max ? max : strm->avail_in;
writ = write(state->fd, strm->next_in, put);
if (writ < 0) {
gz_error(state, (-1), strerror(
(*__errno_location ())
));
return -1;
}
strm->avail_in -= (unsigned)writ;
strm->next_in += writ;
}
return 0;
}
if (state->reset) {
if (strm->avail_in == 0)
return 0;
deflateReset(strm);
state->reset = 0;
}
ret = 0;
do {
if (strm->avail_out == 0 || (flush != 0 &&
(flush != 4 || ret == 1))) {
while (strm->next_out > state->x.next) {
put = strm->next_out - state->x.next > (int)max ? max :
(unsigned)(strm->next_out - state->x.next);
writ = write(state->fd, state->x.next, put);
if (writ < 0) {
gz_error(state, (-1), strerror(
(*__errno_location ())
));
return -1;
}
state->x.next += writ;
}
if (strm->avail_out == 0) {
strm->avail_out = state->size;
strm->next_out = state->out;
state->x.next = state->out;
}
}
have = strm->avail_out;
ret = deflate(strm, flush);
if (ret == (-2)) {
gz_error(state, (-2),
"internal error: deflate stream corrupt");
return -1;
}
have -= strm->avail_out;
} while (have);
if (flush == 4)
state->reset = 1;
return 0;
}
| undefined8 gz_comp(long param_1,int param_2)
{
int iVar1;
uint uVar2;
void **ppvVar3;
undefined8 uVar4;
ssize_t sVar5;
int *piVar6;
char *pcVar7;
int local_24;
uint local_20;
local_20 = 0x40000000;
ppvVar3 = (void **)(param_1 + 0x80);
if ((*(int *)(param_1 + 0x28) == 0) && (iVar1 = gz_init(), iVar1 == -1)) {
uVar4 = 0xffffffff;
}
else if (*(int *)(param_1 + 0x40) == 0) {
if (*(int *)(param_1 + 0x60) != 0) {
if (*(int *)(param_1 + 0x88) == 0) {
return 0;
}
deflateReset();
*(undefined4 *)(param_1 + 0x60) = 0;
}
local_24 = 0;
do {
if ((*(int *)(param_1 + 0xa0) == 0) || ((param_2 != 0 && ((param_2 != 4 || (local_24 == 1)))))
) {
while (*(ulong *)(param_1 + 8) < *(ulong *)(param_1 + 0x98)) {
uVar2 = local_20;
if (*(long *)(param_1 + 0x98) - *(long *)(param_1 + 8) < 0x40000001) {
uVar2 = (int)*(undefined8 *)(param_1 + 0x98) - (int)*(undefined8 *)(param_1 + 8);
}
sVar5 = write(*(int *)(param_1 + 0x1c),*(void **)(param_1 + 8),(ulong)uVar2);
if ((int)sVar5 < 0) {
piVar6 = __errno_location();
pcVar7 = strerror(*piVar6);
gz_error(param_1,0xffffffff,pcVar7);
return 0xffffffff;
}
*(long *)(param_1 + 8) = *(long *)(param_1 + 8) + (long)(int)sVar5;
}
if (*(int *)(param_1 + 0xa0) == 0) {
*(undefined4 *)(param_1 + 0xa0) = *(undefined4 *)(param_1 + 0x28);
*(undefined8 *)(param_1 + 0x98) = *(undefined8 *)(param_1 + 0x38);
*(undefined8 *)(param_1 + 8) = *(undefined8 *)(param_1 + 0x38);
}
}
iVar1 = *(int *)(param_1 + 0xa0);
local_24 = deflate(ppvVar3,param_2);
if (local_24 == -2) {
gz_error(param_1,0xfffffffe,"internal error: deflate stream corrupt");
return 0xffffffff;
}
} while (iVar1 != *(int *)(param_1 + 0xa0));
if (param_2 == 4) {
*(undefined4 *)(param_1 + 0x60) = 1;
}
uVar4 = 0;
}
else {
while (*(int *)(param_1 + 0x88) != 0) {
uVar2 = *(uint *)(param_1 + 0x88);
if (0x3fffffff < *(uint *)(param_1 + 0x88)) {
uVar2 = local_20;
}
sVar5 = write(*(int *)(param_1 + 0x1c),*ppvVar3,(ulong)uVar2);
iVar1 = (int)sVar5;
if (iVar1 < 0) {
piVar6 = __errno_location();
pcVar7 = strerror(*piVar6);
gz_error(param_1,0xffffffff,pcVar7);
return 0xffffffff;
}
*(int *)(param_1 + 0x88) = *(int *)(param_1 + 0x88) - iVar1;
*ppvVar3 = (void *)((long)*ppvVar3 + (long)iVar1);
}
uVar4 = 0;
}
return uVar4;
}
|
int swap_uids(void) {
save_egid = getegid();
save_euid = geteuid();
return ((setegid(getgid()) || seteuid(getuid()))? -1 : 0);
}
| long long swap_uids() {
unsigned long long v1;
save_egid = getegid();
save_euid = geteuid();
if (setegid(getgid())) {
LABEL_400fb6:
v1 = 4294967295;
} else {
if (!(!seteuid(getuid())))
goto LABEL_400fb6;
v1 = 0;
}
return v1;
}
|
static enum section
check_section (void)
{
size_t len = line_buf.length - 1;
if (len < 2 || footer_del_len < 2
|| memcmp (line_buf.buffer, section_del, 2))
return Text;
if (len == header_del_len
&& !memcmp (line_buf.buffer, header_del, header_del_len))
return Header;
if (len == body_del_len
&& !memcmp (line_buf.buffer, body_del, body_del_len))
return Body;
if (len == footer_del_len
&& !memcmp (line_buf.buffer, footer_del, footer_del_len))
return Footer;
return Text;
}
| int check_section() {
unsigned long v0;
unsigned int v2;
v0 = g_401788 - 1;
if (v0 <= 1) {
v2 = 3;
return v2;
} else if (footer_del_len <= 1) {
v2 = 3;
return v2;
} else if (memcmp(g_401790, section_del, 0x2)) {
v2 = 3;
return v2;
} else {
if (v0 == header_del_len && !memcmp(g_401790, header_del, header_del_len)) {
v2 = 0;
return v2;
}
if (v0 == body_del_len && !memcmp(g_401790, body_del, body_del_len)) {
v2 = 1;
return v2;
}
if (v0 != footer_del_len) {
v2 = 3;
return v2;
} else if (memcmp(g_401790, footer_del, footer_del_len)) {
v2 = 3;
return v2;
} else {
v2 = 2;
return v2;
}
}
}
|
int
addr_sa_pton(const char *h, const char *s, struct sockaddr *sa, socklen_t slen)
{
struct addrinfo hints, *ai;
memset(&hints, '\0', sizeof(hints));
hints.ai_flags =
0x0004
;
if (h ==
((void *)0)
|| getaddrinfo(h, s, &hints, &ai) != 0)
return -1;
if (ai ==
((void *)0)
)
return -1;
if (ai->ai_addr ==
((void *)0)
) {
freeaddrinfo(ai);
return -1;
}
if (sa !=
((void *)0)
) {
if (slen < ai->ai_addrlen) {
freeaddrinfo(ai);
return -1;
}
memcpy(sa, &ai->ai_addr, ai->ai_addrlen);
}
freeaddrinfo(ai);
return 0;
}
| long long addr_sa_pton(unsigned long long a0, unsigned long long a1, void* a2, unsigned long a3) {
char v0;
unsigned int v1;
unsigned long long v3;
memset(&v1, 0x0, 0x30);
v1 = 4;
if (!a0) {
v3 = 4294967295;
return v3;
} else if (getaddrinfo(a0, a1, &v1, &v0)) {
v3 = 4294967295;
return v3;
} else if (!*(&v0)) {
v3 = 4294967295;
return v3;
} else if (*((*(&v0) + 24))) {
if (a2) {
if (a3 >= *((*(&v0) + 16))) {
memcpy(a2, *(&v0) + 24, *((*(&v0) + 16)));
} else {
freeaddrinfo(*(&v0));
v3 = 4294967295;
return v3;
}
}
freeaddrinfo(*(&v0));
v3 = 0;
return v3;
} else {
freeaddrinfo(*(&v0));
v3 = 4294967295;
return v3;
}
}
|
_Bool
filesavespackage(struct fsys_namenode_list *file,
struct pkginfo *pkgtobesaved,
struct pkginfo *pkgbeinginstalled)
{
struct fsys_node_pkgs_iter *iter;
struct pkgset *divpkgset;
struct pkginfo *thirdpkg;
debug(dbg_eachfiledetail, "filesavespackage file '%s' package %s",
file->namenode->name, pkg_name(pkgtobesaved, pnaw_always));
if (file->namenode->divert && file->namenode->divert->useinstead) {
divpkgset = file->namenode->divert->pkgset;
if (divpkgset == pkgtobesaved->set || divpkgset == pkgbeinginstalled->set) {
debug(dbg_eachfiledetail,"filesavespackage ... diverted -- save!");
return
1
;
}
}
if (file->namenode->flags & FNNF_NEW_INARCHIVE) {
debug(dbg_eachfiledetail,"filesavespackage ... in new archive -- no save");
return
0
;
}
iter = fsys_node_pkgs_iter_new(file->namenode);
while ((thirdpkg = fsys_node_pkgs_iter_next(iter))) {
debug(dbg_eachfiledetail, "filesavespackage ... also in %s",
pkg_name(thirdpkg, pnaw_always));
if (thirdpkg == pkgbeinginstalled || thirdpkg == pkgtobesaved)
continue;
if (pkgtobesaved->installed.multiarch == PKG_MULTIARCH_SAME &&
thirdpkg->set == pkgtobesaved->set)
continue;
debug(dbg_eachfiledetail,"filesavespackage ... is 3rd package");
if (!thirdpkg->files_list_valid) {
debug(dbg_eachfiledetail, "process_archive ... already disappeared!");
continue;
}
debug(dbg_eachfiledetail, "filesavespackage ... taken -- no save");
fsys_node_pkgs_iter_free(iter);
return
0
;
}
fsys_node_pkgs_iter_free(iter);
debug(dbg_eachfiledetail, "filesavespackage ... not taken -- save !");
return
1
;
}
| long long filesavespackage(struct_0 *a0, struct_2 *a1, unsigned long long *a2) {
unsigned long v0;
unsigned long long v1;
struct_3 *v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
debug(0x40, "filesavespackage file '%s' package %s", a0->field_8->field_8, pkg_name(a1, 0x3));
if (a0->field_8->field_18 && *(a0->field_8->field_18)) {
v0 = *((a0->field_8->field_18 + 16));
if (v0 != a1->field_0 && !(v0 == *(a2)))
goto LABEL_4003c5;
debug(0x40, "filesavespackage ... diverted -- save!", a2, v4);
v5 = 1;
goto LABEL_400523;
}
LABEL_4003c5:
if ((a0->field_8->field_30 & 2)) {
debug(0x40, "filesavespackage ... in new archive -- no save", a2, v6);
v5 = 0;
} else {
v1 = fsys_node_pkgs_iter_new(a0->field_8);
while (true) {
v2 = fsys_node_pkgs_iter_next(v1);
if (!v2) {
fsys_node_pkgs_iter_free(v1);
debug(0x40, "filesavespackage ... not taken -- save !", v2->field_0, v7);
v5 = 1;
break;
} else {
debug(0x40, "filesavespackage ... also in %s", pkg_name(v2, 0x3), v7);
if (v2 == a2)
continue;
if (v2 == a1)
continue;
if (a1->field_54 == 1 && v2->field_0 == a1->field_0)
continue;
debug(0x40, "filesavespackage ... is 3rd package", v2->field_0, v7);
if ((v2->field_178 ^ 1)) {
debug(0x40, "process_archive ... already disappeared!", v2->field_0, v7);
} else {
debug(0x40, "filesavespackage ... taken -- no save", v2->field_0, v7);
fsys_node_pkgs_iter_free(v1);
v5 = 0;
break;
}
}
}
}
LABEL_400523:
return v5;
}
|
static int
mux_master_process_stop_listening(struct ssh *ssh, u_int rid,
Channel *c, struct sshbuf *m, struct sshbuf *reply)
{
sshlog("mux.c", __func__, 1092, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "channel %d: stop listening", c->self);
if (options.control_master == 3 ||
options.control_master == 4) {
if (!ask_permission("Disable further multiplexing on shared "
"connection to %s? ", host)) {
sshlog("mux.c", __func__, 1098, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "stop listen refused by user");
reply_error(reply, 0x80000002, rid,
"Permission denied");
return 0;
}
}
if (mux_listener_channel !=
((void *)0)
) {
channel_free(ssh, mux_listener_channel);
client_stop_mux();
free(options.control_path);
options.control_path =
((void *)0)
;
mux_listener_channel =
((void *)0)
;
muxserver_sock = -1;
}
reply_ok(reply, rid);
return 0;
}
| long mux_master_process_stop_listening(long a1, unsigned int a2, long a3, long a4, long a5)
{
sshlog(
"mux.c",
"mux_master_process_stop_listening",
1092LL,
1LL,
5LL,
0LL,
"channel %d: stop listening",
*(unsigned int *)(a3 + 4));
if ( (options[1242] == 3 || options[1242] == 4)
&& !(unsigned int)ask_permission("Disable further multiplexing on shared connection to %s? ", host) )
{
sshlog("mux.c", "mux_master_process_stop_listening", 1098LL, 1LL, 6LL, 0LL, "stop listen refused by user");
reply_error(a5, 0x80000002, a2, (long)"Permission denied");
return 0LL;
}
else
{
if ( mux_listener_channel )
{
channel_free(a1, mux_listener_channel);
client_stop_mux();
free(*(void **)&options[1240]);
*(_QWORD *)&options[1240] = 0LL;
mux_listener_channel = 0LL;
muxserver_sock = -1;
}
reply_ok(a5, a2);
return 0LL;
}
}
|
static int
execute_intern_function (name, funcdef)
WORD_DESC *name;
FUNCTION_DEF *funcdef;
{
SHELL_VAR *var;
char *t;
if (check_identifier (name, posixly_correct) == 0)
{
if (posixly_correct && interactive_shell == 0)
{
last_command_exit_value = 2;
jump_to_top_level (4);
}
return (1);
}
if (strchr (name->word, '\001'))
{
t = dequote_escapes (name->word);
sh_xfree((name->word), "execute_cmd.c", 6129);
name->word = t;
}
if (posixly_correct && find_special_builtin (name->word))
{
internal_error (gettext("`%s': is a special builtin"), name->word);
last_command_exit_value = 2;
jump_to_top_level (interactive_shell ? 2 : 4);
}
var = find_function (name->word);
if (var && (((((var)->attributes) & (0x0000002))) || ((((var)->attributes) & (0x0004000)))))
{
if (((((var)->attributes) & (0x0000002))))
internal_error (gettext("%s: readonly function"), var->name);
return (1);
}
bind_function_def (name->word, funcdef, 1);
bind_function (name->word, funcdef->command);
return (0);
}
| undefined8 execute_intern_function(char **param_1,long param_2)
{
int iVar1;
undefined4 uVar2;
undefined8 uVar3;
char *pcVar4;
long lVar5;
undefined8 *puVar6;
undefined8 uVar7;
iVar1 = check_identifier(param_1,posixly_correct);
if (iVar1 == 0) {
if ((posixly_correct != 0) && (interactive_shell == 0)) {
last_command_exit_value = 2;
jump_to_top_level(4);
}
uVar3 = 1;
}
else {
pcVar4 = strchr(*param_1,1);
if (pcVar4 != (char *)0x0) {
pcVar4 = (char *)dequote_escapes(*param_1);
sh_xfree(*param_1,"execute_cmd.c",0x17f1);
*param_1 = pcVar4;
}
if (posixly_correct != 0) {
lVar5 = find_special_builtin(*param_1);
if (lVar5 != 0) {
pcVar4 = *param_1;
uVar3 = gettext("`%s\': is a special builtin");
internal_error(uVar3,pcVar4);
last_command_exit_value = 2;
if (interactive_shell == 0) {
uVar2 = 4;
}
else {
uVar2 = 2;
}
jump_to_top_level(uVar2);
}
}
puVar6 = (undefined8 *)find_function(*param_1);
if ((puVar6 == (undefined8 *)0x0) ||
(((*(uint *)(puVar6 + 5) & 2) == 0 && ((*(uint *)(puVar6 + 5) & 0x4000) == 0)))) {
bind_function_def(*param_1,param_2,1);
bind_function(*param_1,*(undefined8 *)(param_2 + 0x10));
uVar3 = 0;
}
else {
if ((*(uint *)(puVar6 + 5) & 2) != 0) {
uVar3 = *puVar6;
uVar7 = gettext("%s: readonly function");
internal_error(uVar7,uVar3);
}
uVar3 = 1;
}
}
return uVar3;
}
|
static int
hostkeys_find_by_key_cb(struct hostkey_foreach_line *l, void *_ctx)
{
struct find_by_key_ctx *ctx = (struct find_by_key_ctx *)_ctx;
char *path;
if ((l->match & (1)) != 0)
return 0;
if (l->marker != MRK_NONE)
return 0;
if (l->key ==
((void *)0)
|| !sshkey_equal(ctx->key, l->key))
return 0;
path = try_tilde_unexpand(l->path);
sshlog("sshconnect.c", __func__, 729, 1, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "found matching key in %s:%lu", path, l->linenum);
ctx->names = xrecallocarray(ctx->names,
ctx->nnames, ctx->nnames + 1, sizeof(*ctx->names));
xasprintf(&ctx->names[ctx->nnames], "%s:%lu: %s", path, l->linenum,
strncmp(l->hosts, "|1|", strlen("|1|")) == 0 ?
"[hashed name]" : l->hosts);
ctx->nnames++;
free(path);
return 0;
}
| long long hostkeys_find_by_key_cb(struct_0 *a0, struct_1 *a1) {
unsigned long v0;
unsigned long v1;
void* v2;
unsigned long long v5;
if (!(a0->field_14 & 1) && a0->field_20 == 1 && a0->field_40 && sshkey_equal(a1->field_10, a0->field_40, a0->field_40)) {
v2 = try_tilde_unexpand(a0->field_0);
v1 = a0->field_8;
v0 = v2;
sshlog("sshconnect.c", "hostkeys_find_by_key_cb", 0x2d9, 0x1, 0x5, 0x0, "found matching key in %s:%lu");
a1->field_18 = xrecallocarray(a1->field_18, a1->field_20, a1->field_20 + 1, 0x8);
v5 = strncmp(a0->field_28, "|1|", strlen("|1|"));
xasprintf(a1->field_18 + a1->field_20 * 8, "%s:%lu: %s", v2);
a1->field_20 = a1->field_20 + 1;
free(v2);
}
return 0;
}
|
int
glue_strings(char *buffer, size_t buffer_size, const char *a, const char *b,
char separator) {
char *buf;
char *buf_end;
if (buffer_size <= 0)
return (0);
buf_end = buffer + buffer_size;
buf = buffer;
for ( ; buf < buf_end && *a != '\0'; buf++, a++)
*buf = *a;
if (buf == buf_end)
return (0);
if (separator != '/' || buf == buffer || buf[-1] != '/')
*buf++ = separator;
if (buf == buf_end)
return (0);
for ( ; buf < buf_end && *b != '\0'; buf++, b++)
*buf = *b;
if (buf == buf_end)
return (0);
*buf = '\0';
return (1);
}
| long long glue_strings(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) {
char *v0;
char *v1;
char *v2;
unsigned long v3;
unsigned long long v5;
char *v6;
v1 = a2;
v0 = a3;
if (!a1) {
v5 = 0;
} else {
v3 = a1 + a0;
for (v2 = a0; v2 < v3; v1 += 1) {
if (!*(v1))
break;
*(v2) = *(v1);
v2 += 1;
}
if (v2 == v3) {
v5 = 0;
} else {
if (v2 == a0 || a4 != 47 || v2[1] != 47) {
v6 = v2;
v2 += 1;
*(v6) = a4;
}
if (v2 == v3) {
v5 = 0;
} else {
for (; v2 < v3; v0 += 1) {
if (!*(v0))
break;
*(v2) = *(v0);
v2 += 1;
}
if (v2 == v3) {
v5 = 0;
} else {
*(v2) = 0;
v5 = 1;
}
}
}
}
return v5;
}
|
void crypto_sign_ed25519_ref_fe25519_cmov(crypto_sign_ed25519_ref_fe25519 *r, const crypto_sign_ed25519_ref_fe25519 *x, unsigned char b)
{
int i;
crypto_uint32 mask = b;
mask = -mask;
for(i=0;i<32;i++) r->v[i] ^= mask & (x->v[i] ^ r->v[i]);
}
| long long crypto_sign_ed25519_ref_fe25519_cmov(unsigned int *a0, unsigned int *a1, unsigned long a2) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned long long v4;
v0 = a2;
v4 = v0;
v2 = v0;
v2 = -(v2);
for (v1 = 0; v1 <= 31; v1 = v4) {
a0[v1] = a0[v1] ^ (a0[v1] ^ a1[v1]) & v2;
v4 = __addvsi3(v1, 0x1, v1);
}
return v4;
}
|
static int xfrm_policy_get_or_delete(int argc, char **argv, int delete,
struct nlmsghdr **answer)
{
struct rtnl_handle rth;
struct {
struct nlmsghdr n;
struct xfrm_userpolicy_id xpid;
char buf[2048];
} req = {
.n.nlmsg_len = ((sizeof(req.xpid)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))),
.n.nlmsg_flags = 0x01,
.n.nlmsg_type = delete ? XFRM_MSG_DELPOLICY
: XFRM_MSG_GETPOLICY,
};
char *dirp =
((void *)0)
;
char *selp =
((void *)0)
;
char *indexp =
((void *)0)
;
char *ptypep =
((void *)0)
;
char *sctxp =
((void *)0)
;
struct xfrm_userpolicy_type upt = {};
struct xfrm_mark mark = {0, 0};
struct {
struct xfrm_user_sec_ctx sctx;
char str[256];
} ctx = {};
_Bool
is_if_id_set =
0
;
__u32 if_id = 0;
while (argc > 0) {
if (strcmp(*argv, "dir") == 0) {
if (dirp)
duparg("dir", *argv);
dirp = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_dir_parse(&req.xpid.dir, &argc, &argv);
} else if (strcmp(*argv, "ctx") == 0) {
char *context;
if (sctxp)
duparg("ctx", *argv);
sctxp = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
context = *argv;
xfrm_sctx_parse((char *)&ctx.str, context, &ctx.sctx);
} else if (strcmp(*argv, "mark") == 0) {
xfrm_parse_mark(&mark, &argc, &argv);
} else if (strcmp(*argv, "index") == 0) {
if (indexp)
duparg("index", *argv);
indexp = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&req.xpid.index, *argv, 0))
invarg("INDEX value is invalid", *argv);
} else if (strcmp(*argv, "ptype") == 0) {
if (ptypep)
duparg("ptype", *argv);
ptypep = *argv;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
xfrm_policy_ptype_parse(&upt.type, &argc, &argv);
} else if (strcmp(*argv, "if_id") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
if (get_u32(&if_id, *argv, 0))
invarg("IF_ID value is invalid", *argv);
is_if_id_set =
1
;
} else {
if (selp)
invarg("unknown", *argv);
selp = *argv;
xfrm_selector_parse(&req.xpid.sel, &argc, &argv);
if (preferred_family ==
0
)
preferred_family = req.xpid.sel.family;
}
argc--; argv++;
}
if (!dirp) {
fprintf(
stderr
, "Not enough information: DIR is required.\n");
exit(1);
}
if (ptypep) {
addattr_l(&req.n, sizeof(req), XFRMA_POLICY_TYPE,
(void *)&upt, sizeof(upt));
}
if (!selp && !indexp) {
fprintf(
stderr
, "Not enough information: either SELECTOR or INDEX is required.\n");
exit(1);
}
if (selp && indexp)
duparg2("SELECTOR", "INDEX");
if (rtnl_open_byproto(&rth, 0, 6) < 0)
exit(1);
if (req.xpid.sel.family ==
0
)
req.xpid.sel.family =
2
;
if (mark.m & mark.v) {
int r = addattr_l(&req.n, sizeof(req.buf), XFRMA_MARK,
(void *)&mark, sizeof(mark));
if (r < 0) {
fprintf(
stderr
, "%s: XFRMA_MARK failed\n", __func__);
exit(1);
}
}
if (sctxp) {
addattr_l(&req.n, sizeof(req), XFRMA_SEC_CTX,
(void *)&ctx, ctx.sctx.len);
}
if (is_if_id_set)
addattr32(&req.n, sizeof(req.buf), XFRMA_IF_ID, if_id);
if (rtnl_talk(&rth, &req.n, answer) < 0)
exit(2);
rtnl_close(&rth);
return 0;
}
| void xfrm_policy_get_or_delete(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned long long v0;
unsigned long long *v1;
unsigned int v2;
char v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned short v7;
void* v8;
void* v9;
void* v10;
unsigned long v11;
void* v12;
void* v13;
unsigned int v14;
unsigned int v15;
char v16;
void* v17;
char v18;
char v19;
unsigned short v20;
unsigned short v21;
char v22;
unsigned short v23;
char v24;
char v25;
unsigned long long v27;
unsigned long long *v28;
unsigned long v29;
unsigned short v30;
unsigned long long v31;
unsigned long long *v32;
unsigned long long v36;
unsigned long long v37;
void* v43;
v2 = a0;
v1 = a1;
v0 = a3;
v27 = 266;
for (v28 = &v19; v27; v28 = &v28[v29]) {
v27 -= 1;
v19 = 0;
}
v19 = 80;
if (a2)
v30 = 20;
else
v30 = 21;
v20 = v30;
v21 = 1;
v8 = 0;
v9 = 0;
v10 = 0;
v11 = 0;
v12 = 0;
v6 = 0;
v7 = 0;
v14 = 0;
v15 = 0;
v31 = 33;
for (v32 = &v17; v31; v32 = &v32[v29]) {
v31 -= 1;
v17 = 0;
}
v3 = 0;
for (v4 = 0; v2 > 0; v1 += 1) {
if (!strcmp(*(v1), "dir")) {
if (v8)
duparg("dir", *(v1));
v8 = *(v1);
v1 = v1 + 1;
v2 -= 1;
if (v2 <= 0)
incomplete_command();
xfrm_policy_dir_parse(&v25, &v2, &v1);
} else if (!strcmp(*(v1), "ctx")) {
if (v12)
duparg("ctx", *(v1));
v12 = *(v1);
v1 = v1 + 1;
v2 -= 1;
if (v2 <= 0)
incomplete_command();
v13 = *(v1);
xfrm_sctx_parse(&v18, v13, &v17);
} else if (!strcmp(*(v1), "mark")) {
xfrm_parse_mark(&v14, &v2, &v1, &v2);
} else {
v36 = strcmp(*(v1), "index");
if (!v36) {
if (v10)
duparg("index", *(v1));
v10 = *(v1);
v1 = v1 + 1;
v2 -= 1;
if (v2 <= 0)
incomplete_command();
v37 = get_u32(&v24, *(v1), 0x0, &v24);
if (v37)
invarg("INDEX value is invalid", *(v1));
}
if (v36 || v37) {
if (!strcmp(*(v1), "ptype")) {
if (v11)
duparg("ptype", *(v1));
v11 = *(v1);
v1 = v1 + 1;
v2 -= 1;
if (v2 <= 0)
incomplete_command();
xfrm_policy_ptype_parse(&v6, &v2, &v1);
} else if (!strcmp(*(v1), "if_id")) {
v1 += 1;
v2 -= 1;
if (v2 <= 0)
incomplete_command();
if (get_u32(&v4, *(v1), 0x0, *(v1)))
invarg("IF_ID value is invalid", *(v1));
v3 = 1;
} else {
if (v9)
invarg("unknown", *(v1));
v9 = *(v1);
xfrm_selector_parse(&v22, &v2, &v1, &v22);
if (!preferred_family)
preferred_family = *(&v23);
}
}
}
v2 -= 1;
}
if (!v8) {
fprintf(*(&stderr), "Not enough information: DIR is required.\n");
exit(0x1);
}
if (v11)
addattr_l(&v19, 0x850, 0x10, &v6, 0x6);
if (!v9 && !v10) {
fprintf(*(&stderr), "Not enough information: either SELECTOR or INDEX is required.\n");
exit(0x1);
}
if (v9 || v10) {
if (v9 && v10)
duparg2("SELECTOR", "INDEX");
if (rtnl_open_byproto(&v16, 0x0, 0x6) < 0)
exit(0x1);
if (!*(&v23))
v23 = 2;
if ((v14 & v15)) {
v5 = addattr_l(&v19, 0x800, 0x15, &v14, 0x8);
if (v5 < 0) {
fprintf(*(&stderr), "%s: XFRMA_MARK failed\n", &__func__.9323);
exit(0x1);
}
}
if (!(v14 & v15) || v5 >= 0) {
if (v12)
addattr_l(&v19, 0x850, 0x8, &v17, v17);
if (v3)
addattr32(&v19, 0x800, 0x1f, v4);
if (rtnl_talk(&v16, &v19, v0, &v19) < 0)
exit(0x2);
rtnl_close(&v16);
v43 = 0;
return;
}
}
}
|
int
hash_bucket (string, table)
const char *string;
HASH_TABLE *table;
{
unsigned int h;
return ((((h) = hash_string (string)) & ((table)->nbuckets - 1)));
}
| long long hash_bucket(unsigned int a0, struct_0 *a1) {
unsigned int v0;
v0 = hash_string(a0);
return a1->field_8 - 1 & v0;
}
|
int
rl_vi_overstrike (int count, int key)
{
if (_rl_vi_doing_insert == 0)
{
_rl_vi_doing_insert = 1;
rl_begin_undo_group ();
}
if (count > 0)
{
if (_rl_overwrite_char (count, key) != 0)
return (1);
vi_replace_count += count;
}
return (0);
}
| long rl_vi_overstrike(unsigned int a1, unsigned int a2)
{
if ( !rl_vi_doing_insert )
{
rl_vi_doing_insert = 1;
rl_begin_undo_group();
}
if ( (int)a1 > 0 )
{
if ( (unsigned int)rl_overwrite_char(a1, a2) )
return 1LL;
vi_replace_count += a1;
}
return 0LL;
}
|
static gnutls_x509_trust_list_t load_tl(common_info_st * cinfo)
{
gnutls_x509_trust_list_t list;
int ret;
ret = gnutls_x509_trust_list_init(&list, 0);
if (ret < 0) {
fprintf(
stderr
, "gnutls_x509_trust_list_init: %s\n",
gnutls_strerror(ret));
app_exit(1);
}
if (cinfo->ca ==
((void *)0)
) {
ret = gnutls_x509_trust_list_add_system_trust(list, 0, 0);
if (ret < 0) {
fprintf(
stderr
, "Error loading system trust: %s\n",
gnutls_strerror(ret));
app_exit(1);
}
fprintf(
stderr
, "Loaded system trust (%d CAs available)\n", ret);
} else if (cinfo->ca !=
((void *)0)
) {
ret = gnutls_x509_trust_list_add_trust_file(list, cinfo->ca, cinfo->crl, cinfo->incert_format, 0, 0);
if (ret < 0) {
int ret2 = gnutls_x509_trust_list_add_trust_file(list, cinfo->ca, cinfo->crl, GNUTLS_X509_FMT_PEM, 0, 0);
if (ret2 >= 0)
ret = ret2;
}
if (ret < 0) {
fprintf(
stderr
, "gnutls_x509_trust_add_trust_file: %s\n",
gnutls_strerror(ret));
app_exit(1);
}
fprintf(
stderr
, "Loaded CAs (%d available)\n", ret);
}
return list;
}
| long load_tl(long a1)
{
const char *v1;
const char *v2;
const char *v3;
int v5;
int v6;
int v7;
int v8;
long v9[2];
v9[1] = __readfsqword(0x28u);
v5 = gnutls_x509_trust_list_init(v9, 0LL);
if ( v5 < 0 )
{
v1 = (const char *)gnutls_strerror((unsigned int)v5);
fprintf(stderr, "gnutls_x509_trust_list_init: %s\n", v1);
app_exit(1);
}
if ( *(_QWORD *)(a1 + 64) )
{
v7 = gnutls_x509_trust_list_add_trust_file(
v9[0],
*(_QWORD *)(a1 + 64),
*(_QWORD *)(a1 + 56),
*(unsigned int *)(a1 + 28),
0LL,
0LL);
if ( v7 < 0 )
{
v8 = gnutls_x509_trust_list_add_trust_file(v9[0], *(_QWORD *)(a1 + 64), *(_QWORD *)(a1 + 56), 1LL, 0LL, 0LL);
if ( v8 >= 0 )
v7 = v8;
}
if ( v7 < 0 )
{
v3 = (const char *)gnutls_strerror((unsigned int)v7);
fprintf(stderr, "gnutls_x509_trust_add_trust_file: %s\n", v3);
app_exit(1);
}
fprintf(stderr, "Loaded CAs (%d available)\n", (unsigned int)v7);
}
else
{
v6 = gnutls_x509_trust_list_add_system_trust(v9[0], 0LL, 0LL);
if ( v6 < 0 )
{
v2 = (const char *)gnutls_strerror((unsigned int)v6);
fprintf(stderr, "Error loading system trust: %s\n", v2);
app_exit(1);
}
fprintf(stderr, "Loaded system trust (%d CAs available)\n", (unsigned int)v6);
}
return v9[0];
}
|
static
_Bool
parse_nogroup (const struct parser_table* entry, char **argv, int *arg_ptr)
{
struct predicate *our_pred;
(void) &argv;
(void) &arg_ptr;
our_pred = insert_primary (entry,
((void *)0)
);
our_pred->est_success_rate = 1e-4;
return
1
;
}
| long long parse_nogroup(unsigned long long a0, unsigned long a1, unsigned long long a2) {
unsigned long v0;
unsigned long v1;
struct_0 *v2;
v1 = a1;
v0 = a2;
v2 = insert_primary(a0, 0x0, a2);
v2->field_24 = 3615207938321397527;
return 1;
}
|
static int skiploop(void)
{
int skip = evalskip;
switch (skip) {
case 0:
break;
case (1 << 0):
case (1 << 1):
if (__builtin_expect(!!(--skipcount <= 0),1)) {
evalskip = 0;
break;
}
skip = (1 << 0);
break;
}
return skip;
}
| int skiploop() {
unsigned int v0;
v0 = 17905618636109546312;
if (v0 && v0 >= 0 && v0 - 1 <= 1) {
skipcount = skipcount - 1;
if (skipcount <= 0)
inps4 = 0;
else
v0 = 1;
}
return v0;
}
|
static void
process_lock_agent(SocketEntry *e, int lock)
{
int r, success = 0, delay;
char *passwd;
u_char passwdhash[32];
static u_int fail_count = 0;
size_t pwlen;
sshlog("ssh-agent.c", __func__, 1313, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "entering");
if ((r = sshbuf_get_cstring(e->request, &passwd, &pwlen)) != 0)
sshfatal("ssh-agent.c", __func__, 1320, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse");
if (pwlen == 0) {
sshlog("ssh-agent.c", __func__, 1322, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "empty password not supported");
} else if (locked && !lock) {
if (bcrypt_pbkdf(passwd, pwlen, lock_salt, sizeof(lock_salt),
passwdhash, sizeof(passwdhash), 1) < 0)
sshfatal("ssh-agent.c", __func__, 1326, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bcrypt_pbkdf");
if (timingsafe_bcmp(passwdhash, lock_pwhash, 32) == 0) {
sshlog("ssh-agent.c", __func__, 1328, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "agent unlocked");
locked = 0;
fail_count = 0;
explicit_bzero(lock_pwhash, sizeof(lock_pwhash));
success = 1;
} else {
if (fail_count < 100)
fail_count++;
delay = 100000 * fail_count;
sshlog("ssh-agent.c", __func__, 1338, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "unlock failed, delaying %0.1lf seconds", (double)delay/1000000)
;
usleep(delay);
}
explicit_bzero(passwdhash, sizeof(passwdhash));
} else if (!locked && lock) {
sshlog("ssh-agent.c", __func__, 1344, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "agent locked");
locked = 1;
arc4random_buf(lock_salt, sizeof(lock_salt));
if (bcrypt_pbkdf(passwd, pwlen, lock_salt, sizeof(lock_salt),
lock_pwhash, sizeof(lock_pwhash), 1) < 0)
sshfatal("ssh-agent.c", __func__, 1349, 0, SYSLOG_LEVEL_FATAL,
((void *)0)
, "bcrypt_pbkdf");
success = 1;
}
freezero(passwd, pwlen);
send_status(e, success);
}
| void process_lock_agent(struct_0 *a0, unsigned long a1) {
char v0;
char v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
char v6;
char v7;
char v8;
unsigned long long v9;
char v10;
unsigned long long v11;
char v12;
char v13;
char v14;
unsigned long long *v15;
unsigned long long v16;
v3 = 0;
sshlog("ssh-agent.c", "process_lock_agent", 0x521, 0x1, 0x6, 0x0, "entering", *(&v0), *(&v1), a0, *(&v2));
v4 = sshbuf_get_cstring(a0->field_18, &v6, &v7, &v6);
if (v4)
sshfatal("ssh-agent.c", "process_lock_agent", 0x528, 0x1, 0x1, ssh_err(v4));
if (!*(&v7)) {
v9 = "empty password not supported";
sshlog("ssh-agent.c", "process_lock_agent", 0x52a, 0x0, 0x5, 0x0, *(&v10), v11, *(&v12), *(&v13), *(&v14));
} else {
if (locked && !a1) {
v9 = 1;
if (bcrypt_pbkdf(*(&v6), *(&v7), &lock_salt, 0x10, &v8, 0x20) < 0) {
v9 = "bcrypt_pbkdf";
sshfatal("ssh-agent.c", "process_lock_agent", 0x52e, 0x0, 0x1, 0x0);
}
if (!timingsafe_bcmp(&v8, &lock_pwhash, 0x20)) {
v9 = "agent unlocked";
sshlog("ssh-agent.c", "process_lock_agent", 0x530, 0x0, 0x5, 0x0, *(&v10), v11, *(&v12), *(&v13), *(&v14));
locked = 0;
fail_count.19035 = 0;
explicit_bzero(&lock_pwhash, 0x20);
v3 = 1;
} else {
if (fail_count.19035 <= 99)
fail_count.19035 = fail_count.19035 + 1;
v5 = fail_count.19035 * 100000;
v9 = "unlock failed, delaying %0.1lf seconds";
sshlog("ssh-agent.c", "process_lock_agent", 0x53a, 0x0, 0x5, 0x0, *(&v10), v11, *(&v12), *(&v13), *(&v14));
usleep(v5);
}
explicit_bzero(&v8, 0x20);
goto LABEL_404803;
}
if (!locked && a1) {
v9 = "agent locked";
sshlog("ssh-agent.c", "process_lock_agent", 0x540, 0x0, 0x5, 0x0, *(&v10), v11, *(&v12), *(&v13), *(&v14));
locked = 1;
arc4random_buf(&lock_salt, 0x10);
v9 = 1;
if (bcrypt_pbkdf(*(&v6), *(&v7), &lock_salt, 0x10, &lock_pwhash, 0x20) < 0) {
v9 = "bcrypt_pbkdf";
sshfatal("ssh-agent.c", "process_lock_agent", 0x545, 0x0, 0x1, 0x0);
}
v3 = 1;
}
}
LABEL_404803:
freezero(*(&v6), *(&v7), *(&v7));
send_status(a0, (&v2)[1]);
v16 = v9 ^ v15[5];
return;
}
|
char *
print_comsub (command)
COMMAND *command;
{
char *ret;
printing_comsub++;
ret = make_command_string (command);
printing_comsub--;
return ret;
}
| undefined8 print_comsub(undefined8 param_1)
{
undefined8 uVar1;
printing_comsub = printing_comsub + 1;
uVar1 = make_command_string(param_1);
printing_comsub = printing_comsub + -1;
return uVar1;
}
|
static visfun_t
getvisfun(int flags)
{
if (flags & 0x0080)
return do_hvis;
if (flags & 0x0100)
return do_mvis;
return do_svis;
}
| wint_t *( * getvisfun(
short a1))(wint_t *a1, wint_t a2, short a3, unsigned char a4, const wchar_t *a5)
{
if ( (a1 & 0x80) != 0 )
return do_hvis;
if ( (a1 & 0x100) != 0 )
return (wint_t *( *)(wint_t *, wint_t, short, unsigned char, const wchar_t *))do_mvis;
return do_svis;
}
|
static void
lbuf_flush (void)
{
size_t size = lbuf.end - lbuf.buf;
if (full_write (
1
, lbuf.buf, size) != size)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", gettext (\"write error\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, "%s", gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, "%s", gettext ("write error")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
lbuf.end = lbuf.buf;
}
| long long lbuf_flush() {
unsigned long long v0;
unsigned long long v2;
v0 = g_405318 - lbuf;
if (v0 == full_write(0x1, lbuf, v0)) {
g_405318 = lbuf;
return lbuf;
}
v2 = gettext("write error");
error(0x1, *(__errno_location()), "%s");
}
|
static
_Bool
pipe_lines (char const *pretty_filename, int fd, uintmax_t n_lines,
uintmax_t *read_pos)
{
struct linebuffer
{
char buffer[
8192
];
size_t nbytes;
size_t nlines;
struct linebuffer *next;
};
typedef struct linebuffer LBUFFER;
LBUFFER *first, *last, *tmp;
size_t total_lines = 0;
_Bool
ok =
1
;
size_t n_read;
first = last = xmalloc (sizeof (LBUFFER));
first->nbytes = first->nlines = 0;
first->next =
((void *)0)
;
tmp = xmalloc (sizeof (LBUFFER));
while (
1
)
{
n_read = safe_read (fd, tmp->buffer,
8192
);
if (n_read == 0 || n_read == ((size_t) -1))
break;
tmp->nbytes = n_read;
*read_pos += n_read;
tmp->nlines = 0;
tmp->next =
((void *)0)
;
{
char const *buffer_end = tmp->buffer + n_read;
char const *p = tmp->buffer;
while ((p = memchr (p, line_end, buffer_end - p)))
{
++p;
++tmp->nlines;
}
}
total_lines += tmp->nlines;
if (tmp->nbytes + last->nbytes <
8192
)
{
memcpy (&last->buffer[last->nbytes], tmp->buffer, tmp->nbytes);
last->nbytes += tmp->nbytes;
last->nlines += tmp->nlines;
}
else
{
last = last->next = tmp;
if (total_lines - first->nlines > n_lines)
{
tmp = first;
total_lines -= first->nlines;
first = first->next;
}
else
tmp = xmalloc (sizeof (LBUFFER));
}
}
free (tmp);
if (n_read == ((size_t) -1))
{
error (0,
(*__errno_location ())
, gettext ("error reading %s"), quotearg_style (shell_escape_always_quoting_style, pretty_filename));
ok =
0
;
goto free_lbuffers;
}
if (last->nbytes == 0)
goto free_lbuffers;
if (n_lines == 0)
goto free_lbuffers;
if (last->buffer[last->nbytes - 1] != line_end)
{
++last->nlines;
++total_lines;
}
for (tmp = first; total_lines - tmp->nlines > n_lines; tmp = tmp->next)
total_lines -= tmp->nlines;
{
char const *beg = tmp->buffer;
char const *buffer_end = tmp->buffer + tmp->nbytes;
if (total_lines > n_lines)
{
size_t j;
for (j = total_lines - n_lines; j; --j)
{
beg = rawmemchr (beg, line_end);
++beg;
}
}
xwrite_stdout (beg, buffer_end - beg);
}
for (tmp = tmp->next; tmp; tmp = tmp->next)
xwrite_stdout (tmp->buffer, tmp->nbytes);
free_lbuffers:
while (first)
{
tmp = first->next;
free (first);
first = tmp;
}
return ok;
}
| void pipe_lines(unsigned long long a0, unsigned long a1, unsigned long a2, unsigned long long *a3) {
unsigned long long *v0;
char v1;
struct_0 *v2;
struct_0 *v3;
struct_0 *v4;
void* v5;
struct_0 *v6;
struct_0 *v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
unsigned long v11;
unsigned long long v12;
unsigned long long v13;
char v14;
unsigned long long v16;
unsigned long long v17;
unsigned long long v18;
unsigned long long v19;
unsigned long long v20;
unsigned long long v21;
unsigned long long v22;
v13 = v16;
v12 = v17;
v0 = a3;
v5 = 0;
v1 = 1;
v3 = xmalloc(0x2018);
v2 = v3;
v2->field_2008 = 0;
v2->field_2000 = v2->field_2008;
v2->field_2010 = 0;
v4 = xmalloc(0x2018);
while (true) {
v9 = safe_read(a1, v4, 0x2000, v4);
if (!(v9) || !(v9 != -1))
break;
v4->field_2000 = v9;
*(a3) = *(a3) + v9;
v4->field_2008 = 0;
v4->field_2010 = 0;
v10 = &(&v4->field_0)[v9];
v6 = v4;
while (true) {
v6 = memchr(v6, line_end, v10 + -0x1 * v6);
if (!v6)
break;
v6 += 1;
v4->field_2008 = v4->field_2008 + 1;
}
v5 += v4->field_2008;
if (v3->field_2000 + v4->field_2000 <= 8191) {
memcpy(&(&v3->field_0)[v3->field_2000], v4, v4->field_2000);
v3->field_2000 = v3->field_2000 + v4->field_2000;
v3->field_2008 = v3->field_2008 + v4->field_2008;
} else {
v3->field_2010 = v4;
v3 = v3->field_2010;
if (a2 < v5 - v2->field_2008) {
v4 = v2;
v5 -= v2->field_2008;
v2 = v2->field_2010;
} else {
v4 = xmalloc(0x2018);
}
}
}
free(v4);
if (v9 == -1) {
v18 = quotearg_style(0x4, a0);
error(0x0, *(__errno_location()), gettext("error reading %s"));
v1 = 0;
} else if (a2) {
if (v3->padding_1[v3->field_2000] != line_end) {
v3->field_2008 = v3->field_2008 + 1;
v5 += 1;
}
for (v4 = v2; a2 < v5 - v4->field_2008; v4 = v4->field_2010) {
v5 -= v4->field_2008;
}
v7 = v4;
v11 = &(&v4->field_0)[v4->field_2000];
if (v5 > a2) {
for (v8 = v5 - a2; v8; v8 -= 1) {
v7 = rawmemchr(v7, line_end);
v7 += 1;
}
}
xwrite_stdout(v7, (v11 + -0x1 * v7));
for (v4 = v4->field_2010; v4; v4 = v4->field_2010) {
xwrite_stdout(v4, v4->field_2000);
}
}
for (; v2; v2 = v4) {
v4 = v2->field_2010;
free(v2);
}
v19 = v1;
v20 = v12;
v21 = v13;
v22 = *(&v14);
return;
}
|
static void *
internal_memalign (alignment, size, file, line, flags)
size_t alignment;
size_t size;
const char *file;
int line, flags;
{
register char *ptr;
register char *aligned;
register union mhead *p;
ptr = internal_malloc (size + alignment, file, line, 0x02);
if (ptr == 0)
return 0;
if (((long) ptr & (alignment - 1)) == 0)
return ptr;
aligned = (char *) (((long) ptr + alignment - 1) & (~alignment + 1));
p = (union mhead *) aligned - 1;
p->minfo.mi_nbytes = aligned - ptr;
p->minfo.mi_alloc = ((char) 0xd6);
return aligned;
}
| ulong internal_memalign(long param_1,long param_2,undefined8 param_3,undefined4 param_4,
undefined4 param_5,undefined8 param_6)
{
ulong uVar1;
ulong uVar2;
uVar1 = internal_malloc(param_2 + param_1,param_3,param_4,2,param_5,param_6,param_5);
if (uVar1 == 0) {
uVar1 = 0;
}
else if ((param_1 - 1U & uVar1) != 0) {
uVar2 = -param_1 & (param_1 + uVar1) - 1;
*(int *)(uVar2 - 0xc) = (int)uVar2 - (int)uVar1;
*(undefined *)(uVar2 - 0x10) = 0xd6;
uVar1 = uVar2;
}
return uVar1;
}
|
static int
xstrcoll_df_version (V a, V b)
{
return dirfirst_check (a, b, xstrcoll_version);
}
| long long xstrcoll_df_version(void* a0, void* a1) {
return dirfirst_check(a0, a1, xstrcoll_version);
}
|
map_set_editor(EditLine *el, wchar_t *editor)
{
if (wcscmp(editor, L"emacs") == 0) {
map_init_emacs(el);
return 0;
}
if (wcscmp(editor, L"vi") == 0) {
map_init_vi(el);
return 0;
}
return -1;
}
| undefined8 map_set_editor(undefined8 param_1,wchar_t *param_2)
{
int iVar1;
undefined8 uVar2;
iVar1 = wcscmp(param_2,L"emacs");
if (iVar1 == 0) {
map_init_emacs(param_1);
uVar2 = 0;
}
else {
iVar1 = wcscmp(param_2,L"vi");
if (iVar1 == 0) {
map_init_vi(param_1);
uVar2 = 0;
}
else {
uVar2 = 0xffffffff;
}
}
return uVar2;
}
|
_Bool
hash_table_ok (const Hash_table *table)
{
struct hash_entry const *bucket;
size_t n_buckets_used = 0;
size_t n_entries = 0;
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
struct hash_entry const *cursor = bucket;
n_buckets_used++;
n_entries++;
while (cursor = cursor->next, cursor)
n_entries++;
}
}
if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries)
return
1
;
return
0
;
}
| long long hash_table_ok(unsigned long long a0[5]) {
unsigned long long v0[2];
void* v1;
void* v2;
unsigned long long v3[2];
unsigned long long v5;
v1 = 0;
v2 = 0;
for (v0[0] = a0[0]; v0 < a0[1]; v0[0] = v0 + 1) {
if (v0[0]) {
v3[0] = v0;
v1 += 1;
v2 += 1;
while (true) {
v3[0] = v3[1];
if (!v3)
break;
v2 += 1;
}
}
}
if (v1 != a0[3]) {
v5 = 0;
return v5;
} else if (v2 != a0[4]) {
v5 = 0;
return v5;
} else {
v5 = 1;
return v5;
}
}
|
void
sshbuf_reset(struct sshbuf *buf)
{
u_char *d;
if (buf->readonly || buf->refcount > 1) {
buf->off = buf->size;
return;
}
if (sshbuf_check_sanity(buf) != 0)
return;
buf->off = buf->size = 0;
if (buf->alloc != 256) {
if ((d = recallocarray(buf->d, buf->alloc, 256,
1)) !=
((void *)0)
) {
buf->cd = buf->d = d;
buf->alloc = 256;
}
}
explicit_bzero(buf->d, buf->alloc);
}
| void sshbuf_reset(long *param_1)
{
int iVar1;
long lVar2;
if ((*(int *)(param_1 + 6) == 0) && (*(uint *)(param_1 + 7) < 2)) {
iVar1 = sshbuf_check_sanity(param_1);
if (iVar1 == 0) {
param_1[3] = 0;
param_1[2] = param_1[3];
if (param_1[5] != 0x100) {
lVar2 = recallocarray(*param_1,param_1[5],0x100,1);
if (lVar2 != 0) {
*param_1 = lVar2;
param_1[1] = *param_1;
param_1[5] = 0x100;
}
}
explicit_bzero(*param_1,param_1[5]);
}
}
else {
param_1[2] = param_1[3];
}
return;
}
|
static void
tryexec(char *cmd, char **argv, char **envp)
{
char *const path_bshell =
"/bin/sh"
;
repeat:
execve(cmd, argv, envp);
if (cmd != path_bshell && (*dash_errno) ==
8
) {
*argv-- = cmd;
*argv = cmd = path_bshell;
goto repeat;
}
}
| unsigned long tryexec(char *a1, char **a2, char *const *a3)
{
unsigned long result;
char **v4;
while ( 1 )
{
execve(a1, a2, a3);
result = (unsigned long)a1;
if ( a1 == "/bin/sh" )
break;
result = (unsigned int)*dash_errno;
if ( (_DWORD)result != 8 )
break;
v4 = a2--;
*v4 = a1;
a1 = "/bin/sh";
*a2 = "/bin/sh";
}
return result;
}
|
static void macvlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
{
__u32 mode;
__u16 flags;
__u32 count;
unsigned char *addr;
int len;
struct rtattr *rta;
if (!tb)
return;
if (!tb[IFLA_MACVLAN_MODE] ||
((int)((tb[IFLA_MACVLAN_MODE])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(__u32))
return;
mode = rta_getattr_u32(tb[IFLA_MACVLAN_MODE]);
print_string(PRINT_ANY,
"mode",
"mode %s ",
mode == MACVLAN_MODE_PRIVATE ? "private"
: mode == MACVLAN_MODE_VEPA ? "vepa"
: mode == MACVLAN_MODE_BRIDGE ? "bridge"
: mode == MACVLAN_MODE_PASSTHRU ? "passthru"
: mode == MACVLAN_MODE_SOURCE ? "source"
: "unknown");
if (!tb[IFLA_MACVLAN_FLAGS] ||
((int)((tb[IFLA_MACVLAN_FLAGS])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(__u16))
flags = 0;
else
flags = rta_getattr_u16(tb[IFLA_MACVLAN_FLAGS]);
if (flags & 1)
print_bool(PRINT_ANY, "nopromisc", "nopromisc ",
1
);
if (flags & 2)
print_bool(PRINT_ANY, "nodst", "nodst ",
1
);
if (tb[IFLA_MACVLAN_BC_QUEUE_LEN] &&
((int)((tb[IFLA_MACVLAN_BC_QUEUE_LEN])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) >= sizeof(__u32)) {
__u32 bc_queue_len = rta_getattr_u32(tb[IFLA_MACVLAN_BC_QUEUE_LEN]);
print_luint(PRINT_ANY, "bcqueuelen", "bcqueuelen %lu ", bc_queue_len);
}
if (tb[IFLA_MACVLAN_BC_QUEUE_LEN_USED] &&
((int)((tb[IFLA_MACVLAN_BC_QUEUE_LEN_USED])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) >= sizeof(__u32)) {
__u32 bc_queue_len = rta_getattr_u32(tb[IFLA_MACVLAN_BC_QUEUE_LEN_USED]);
print_luint(PRINT_ANY, "usedbcqueuelen", "usedbcqueuelen %lu ", bc_queue_len);
}
if (mode != MACVLAN_MODE_SOURCE)
return;
if (!tb[IFLA_MACVLAN_MACADDR_COUNT] ||
((int)((tb[IFLA_MACVLAN_MACADDR_COUNT])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(__u32))
return;
count = rta_getattr_u32(tb[IFLA_MACVLAN_MACADDR_COUNT]);
print_int(PRINT_ANY, "macaddr_count", "remotes (%d) ", count);
if (!tb[IFLA_MACVLAN_MACADDR_DATA])
return;
rta = ((void*)(((char*)(tb[IFLA_MACVLAN_MACADDR_DATA])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
len = ((int)((tb[IFLA_MACVLAN_MACADDR_DATA])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)));
open_json_array(PRINT_JSON, "macaddr_data");
for (; ((len) >= (int)sizeof(struct rtattr) && (rta)->rta_len >= sizeof(struct rtattr) && (rta)->rta_len <= (len)); rta = ((len) -= ( (((rta)->rta_len)+4U -1) & ~(4U -1) ), (struct rtattr*)(((char*)(rta)) + ( (((rta)->rta_len)+4U -1) & ~(4U -1) )))) {
if (rta->rta_type != IFLA_MACVLAN_MACADDR ||
((int)((rta)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < 6)
continue;
addr = ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
if (is_json_context()) {
char b1[64];
snprintf(b1, sizeof(b1),
"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", addr[0],
addr[1], addr[2], addr[3], addr[4], addr[5]);
print_string(PRINT_JSON,
((void *)0)
,
((void *)0)
, b1);
} else {
fprintf(f, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x ", addr[0],
addr[1], addr[2], addr[3], addr[4], addr[5]);
}
}
close_json_array(PRINT_JSON,
((void *)0)
);
}
| long long macvlan_print_opt(unsigned long a0, void* a1, struct struct_0 *a2[9]) {
unsigned long v0;
unsigned short v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
unsigned short v7[2];
char v8[6];
char v9;
unsigned long long v11;
v0 = a0;
if (a2 && a2[1] && a2[1]->field_0 - 4 > 3) {
v3 = rta_getattr_u32(a2[1]);
if (v3 == 1) {
v11 = "private";
} else if (v3 == 2) {
v11 = "vepa";
} else if (v3 == 4) {
v11 = "bridge";
} else if (v3 == 8) {
v11 = "passthru";
} else if (v3 == 16) {
v11 = "source";
} else {
v11 = "unknown";
}
print_string(0x4, "mode", "mode %s ", v11);
if (a2[2] && a2[2]->field_0 - 4 > 1)
v1 = rta_getattr_u16(a2[2]);
if (!a2[2] || a2[2]->field_0 - 4 <= 1)
v1 = 0;
if ((v1 & 1))
print_bool(0x4, "nopromisc", "nopromisc ", 0x1);
if ((v1 & 2))
print_bool(0x4, "nodst", "nodst ", 0x1);
if (a2[7] && a2[7]->field_0 - 4 > 3) {
v4 = rta_getattr_u32(a2[7]);
print_luint(0x4, "bcqueuelen", "bcqueuelen %lu ", v4);
}
if (a2[8] && a2[8]->field_0 - 4 > 3) {
v5 = rta_getattr_u32(a2[8]);
print_luint(0x4, "usedbcqueuelen", "usedbcqueuelen %lu ", v5);
}
if (v3 == 16 && a2[6] && a2[6]->field_0 - 4 > 3) {
v6 = rta_getattr_u32(a2[6]);
print_int(0x4, "macaddr_count", "remotes (%d) ", v6);
if (a2[5]) {
*(&v7) = a2[5] + 2;
v2 = a2[5]->field_0 - 4;
open_json_array(0x2, "macaddr_data");
for (; v2 > 3; *(&v7) = v7 + (v7[0] + 3 & 0xfffffffc)) {
if (v7[0] <= 3)
break;
if (v7[0] > 3) {
if (v2 < v7[0])
break;
if (v2 >= v7[0] && v7[1] == 4 && v7[0] - 4 > 5) {
*(&v8) = v7 + 1;
if (is_json_context()) {
snprintf(&v9, 0x40, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", v8[0], v8[1], v8[2], v8[3], v8[4], v8[5]);
print_string(0x2, 0x0, 0x0, &v9);
} else {
fprintf(a1, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x ", v8[0], v8[1], v8[2], v8[3], v8[4], v8[5]);
}
}
}
v2 -= v7[0] + 3 & 0xfffffffc;
}
close_json_array(0x2, 0x0);
}
}
}
return 0;
}
|
static char *
hist_error(char *s, int start, int current, int errtype)
{
char *temp;
const char *emsg;
int ll, elen;
ll = current - start;
switch (errtype)
{
case 0:
emsg = "event not found";
elen = 15;
break;
case 1:
emsg = "bad word specifier";
elen = 18;
break;
case 2:
emsg = "substitution failed";
elen = 19;
break;
case 3:
emsg = "unrecognized history modifier";
elen = 29;
break;
case 4:
emsg = "no previous substitution";
elen = 24;
break;
default:
emsg = "unknown expansion error";
elen = 23;
break;
}
temp = (char *)xmalloc (ll + elen + 3);
if (s[start])
strncpy (temp, s + start, ll);
else
ll = 0;
temp[ll] = ':';
temp[ll + 1] = ' ';
strcpy (temp + ll + 2, emsg);
return (temp);
}
| char * hist_error(long a1, int a2, int a3, int a4)
{
int v5;
int v6;
char *src;
char *dest;
v5 = a3 - a2;
switch ( a4 )
{
case 0:
src = "event not found";
v6 = 15;
break;
case 1:
src = "bad word specifier";
v6 = 18;
break;
case 2:
src = "substitution failed";
v6 = 19;
break;
case 3:
src = "unrecognized history modifier";
v6 = 29;
break;
case 4:
src = "no previous substitution";
v6 = 24;
break;
default:
src = "unknown expansion error";
v6 = 23;
break;
}
dest = (char *)xmalloc(v5 + v6 + 3);
if ( *(_BYTE *)(a2 + a1) )
strncpy(dest, (const char *)(a1 + a2), v5);
else
v5 = 0;
dest[v5] = 58;
dest[v5 + 1] = 32;
strcpy(&dest[v5 + 2], src);
return dest;
}
|
terminal_init(EditLine *el)
{
el->el_terminal.t_buf = calloc(((size_t)2048), sizeof(*el->el_terminal.t_buf))
;
if (el->el_terminal.t_buf ==
((void *)0)
)
goto fail1;
el->el_terminal.t_cap = calloc(((size_t)2048), sizeof(*el->el_terminal.t_cap))
;
if (el->el_terminal.t_cap ==
((void *)0)
)
goto fail2;
el->el_terminal.t_fkey = calloc(7, sizeof(*el->el_terminal.t_fkey))
;
if (el->el_terminal.t_fkey ==
((void *)0)
)
goto fail3;
el->el_terminal.t_loc = 0;
el->el_terminal.t_str = calloc(39, sizeof(*el->el_terminal.t_str))
;
if (el->el_terminal.t_str ==
((void *)0)
)
goto fail4;
el->el_terminal.t_val = calloc(8, sizeof(*el->el_terminal.t_val))
;
if (el->el_terminal.t_val ==
((void *)0)
)
goto fail5;
(void) terminal_set(el,
((void *)0)
);
terminal_init_arrow(el);
return 0;
fail5:
free(el->el_terminal.t_str);
el->el_terminal.t_str =
((void *)0)
;
fail4:
free(el->el_terminal.t_fkey);
el->el_terminal.t_fkey =
((void *)0)
;
fail3:
free(el->el_terminal.t_cap);
el->el_terminal.t_cap =
((void *)0)
;
fail2:
free(el->el_terminal.t_buf);
el->el_terminal.t_buf =
((void *)0)
;
fail1:
return -1;
}
| undefined8 terminal_init(long param_1)
{
void *pvVar1;
pvVar1 = calloc(0x800,1);
*(void **)(param_1 + 0xa0) = pvVar1;
if (*(long *)(param_1 + 0xa0) != 0) {
pvVar1 = calloc(0x800,1);
*(void **)(param_1 + 0xc0) = pvVar1;
if (*(long *)(param_1 + 0xc0) != 0) {
pvVar1 = calloc(7,0x20);
*(void **)(param_1 + 200) = pvVar1;
if (*(long *)(param_1 + 200) != 0) {
*(undefined8 *)(param_1 + 0xa8) = 0;
pvVar1 = calloc(0x27,8);
*(void **)(param_1 + 0xb0) = pvVar1;
if (*(long *)(param_1 + 0xb0) != 0) {
pvVar1 = calloc(8,4);
*(void **)(param_1 + 0xb8) = pvVar1;
if (*(long *)(param_1 + 0xb8) != 0) {
terminal_set(param_1,0);
terminal_init_arrow(param_1);
return 0;
}
free(*(void **)(param_1 + 0xb0));
*(undefined8 *)(param_1 + 0xb0) = 0;
}
free(*(void **)(param_1 + 200));
*(undefined8 *)(param_1 + 200) = 0;
}
free(*(void **)(param_1 + 0xc0));
*(undefined8 *)(param_1 + 0xc0) = 0;
}
free(*(void **)(param_1 + 0xa0));
*(undefined8 *)(param_1 + 0xa0) = 0;
}
return 0xffffffff;
}
|
static void
print_group_command (group_command)
GROUP_COM *group_command;
{
group_command_nesting++;
cprintf ("{ ");
if (inside_function_def == 0)
skip_this_indent++;
else
{
cprintf ("\n");
indentation += indentation_amount;
}
make_command_string_internal (group_command->command);
do { if (deferred_heredocs) print_deferred_heredocs (""); } while (0);
if (inside_function_def)
{
cprintf ("\n");
indentation -= indentation_amount;
indent (indentation);
}
else
{
semicolon ();
cprintf (" ");
}
cprintf ("}");
group_command_nesting--;
}
| long print_group_command(long a1, char *a2, long a3, long a4, long a5, long a6)
{
long v6;
long v7;
long v8;
long v9;
unsigned int *v10;
long v11;
long v12;
long v13;
long v14;
long v15;
long v16;
long v17;
long v18;
long v19;
long v20;
long v21;
long v22;
long v23;
long v24;
long v25;
++group_command_nesting;
cprintf("{ ", (long)a2, a3, a4, a5, a6);
if ( inside_function_def )
{
cprintf("\n", (long)a2, v6, v7, v8, v9);
v6 = (unsigned int)indentation;
indentation += indentation_amount;
}
else
{
++skip_this_indent;
}
v10 = *(unsigned int **)(a1 + 8);
make_command_string_internal(v10, (long)a2, v6, v7, v8, v9);
if ( deferred_heredocs )
{
v10 = (unsigned int *)&unk_3583;
print_deferred_heredocs(&unk_3583, a2, v11, v12, v13, v14);
}
if ( inside_function_def )
{
cprintf("\n", (long)a2, v11, v12, v13, v14);
indentation -= indentation_amount;
indent(indentation, (long)a2, (unsigned int)indentation, v15, v16, v17);
}
else
{
semicolon((long)v10, (long)a2, v11, v12, v13, v14);
cprintf(" ", (long)a2, v22, v23, v24, v25);
}
cprintf("}", (long)a2, v18, v19, v20, v21);
return (unsigned int)--group_command_nesting;
}
|
1
, 0, gettext ("cannot set target context and preserve it")), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
if (x.require_preserve_context && ! selinux_enabled)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"cannot preserve security context \" \"without an SELinux-enabled kernel\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
| void gettext(void)
{
halt_baddata();
}
|
static int xfrm_policy_get(int argc, char **argv)
{
struct nlmsghdr *n =
((void *)0)
;
xfrm_policy_get_or_delete(argc, argv, 0, &n);
if (xfrm_policy_print(n, (void *)
stdout
) < 0) {
fprintf(
stderr
, "An error :-)\n");
exit(1);
}
free(n);
return 0;
}
| long xfrm_policy_get(int a1, const char **a2)
{
void *ptr[2];
ptr[1] = (void *)__readfsqword(0x28u);
ptr[0] = 0LL;
xfrm_policy_get_or_delete(a1, a2, 0, (long)ptr);
if ( (int)xfrm_policy_print((unsigned int *)ptr[0], stdout) < 0 )
{
fprintf(stderr, "An error :-)\n");
exit(1);
}
free(ptr[0]);
return 0LL;
}
|
int
sshkey_load_public(const char *filename, struct sshkey **keyp, char **commentp)
{
char *pubfile =
((void *)0)
;
int r, oerrno;
if (keyp !=
((void *)0)
)
*keyp =
((void *)0)
;
if (commentp !=
((void *)0)
)
*commentp =
((void *)0)
;
if ((r = sshkey_try_load_public(keyp, filename, commentp)) == 0)
goto out;
if (asprintf(&pubfile, "%s.pub", filename) == -1)
return -2;
if ((r = sshkey_try_load_public(keyp, pubfile, commentp)) == 0)
goto out;
if ((r = sshkey_load_pubkey_from_private(filename, keyp)) == 0)
goto out;
r = -24;
(*__errno_location ())
=
2
;
out:
oerrno =
(*__errno_location ())
;
free(pubfile);
(*__errno_location ())
= oerrno;
return r;
}
| long long sshkey_load_public(char *a0, unsigned long long *a1, unsigned long long *a2) {
unsigned int v0;
unsigned int v1;
void* v2;
unsigned long long v4;
v2 = 0;
if (a1)
*(a1) = 0;
if (a2)
*(a2) = 0;
v0 = sshkey_try_load_public(a1, a0, a2);
if (v0) {
if (asprintf(&v2, "%s.pub", a0) != -1) {
v0 = sshkey_try_load_public(a1, v2, a2);
if (v0) {
v0 = sshkey_load_pubkey_from_private(a0, a1, a1);
if (v0) {
v0 = -24;
*(__errno_location()) = 2;
}
}
} else {
v4 = 4294967294;
return v4;
}
}
v1 = *(__errno_location());
free(v2);
*(__errno_location()) = v1;
v4 = v0;
return v4;
}
|
void cu_fileslist(int argc, void **argv) {
tar_pool_release();
}
| long long cu_fileslist(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned int v1;
v1 = a0;
v0 = a1;
return tar_pool_release();
}
|
static int mptcp_addr_modify(int argc, char **argv, int cmd)
{
struct { struct nlmsghdr n; struct genlmsghdr g; char buf[( ((0)+4U -1) & ~(4U -1) ) + (4096)]; } req = { .n = { .nlmsg_type = (genl_family), .nlmsg_flags = (0x01), .nlmsg_len = ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ) + (0)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), }, .g = { .cmd = (cmd), .version = (0x1), }, };
int ret;
ret = mptcp_parse_opt(argc, argv, &req.n, cmd);
if (ret)
return ret;
if (rtnl_talk(&genl_rth, &req.n,
((void *)0)
) < 0)
return -2;
return 0;
}
| int mptcp_addr_modify(undefined4 param_1,undefined8 param_2,undefined4 param_3)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
long in_FS_OFFSET;
undefined8 local_1028;
undefined local_1018;
undefined local_1017;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
puVar3 = &local_1028;
for (lVar2 = 0x202; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
*(undefined4 *)puVar3 = 0;
local_1028._0_4_ = 0x14;
local_1028._4_2_ = (undefined2)genl_family;
local_1028._6_2_ = 1;
local_1018 = (undefined)param_3;
local_1017 = 1;
iVar1 = mptcp_parse_opt(param_1,param_2,&local_1028,param_3);
if (iVar1 == 0) {
iVar1 = rtnl_talk(genl_rth,&local_1028,0);
if (iVar1 < 0) {
iVar1 = -2;
}
else {
iVar1 = 0;
}
}
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar1;
}
__stack_chk_fail();
}
|
static void wwan_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
print_explain(f);
}
| int wwan_print_help(long a1, long a2, long a3, FILE *a4)
{
return print_explain(a4);
}
|
char *
quote_rhs (string)
const char *string;
{
return (quote_escapes_internal (string, 0x04));
}
| int quote_rhs(unsigned long long a0) {
return quote_escapes_internal(a0, 0x4);
}
|
int main(int argc, char **argv)
{
int ret, mtu, port;
char name[256];
int cert_set = 0;
unsigned use_static_dh_params = 0;
unsigned i;
cmd_parser(argc, argv);
signal(
1
,
((__sighandler_t) 1)
);
signal(
15
, terminate);
if (signal(
2
, terminate) ==
((__sighandler_t) 1)
)
signal(
2
,
((__sighandler_t) 1)
);
sockets_init();
listener_list = gl_list_create_empty(&gl_linked_list_implementation,
((void *)0)
,
((void *)0)
, listener_free,
1
);
if (nodb == 0)
wrap_db_init();
if (gnutls_serv_options.present.udp)
strcpy(name, "UDP ");
else
name[0] = 0;
if (http == 1) {
strcat(name, "HTTP Server");
} else {
strcat(name, "Echo Server");
}
gnutls_global_set_log_function(tls_log_func);
gnutls_global_set_audit_log_function(tls_audit_log_func);
gnutls_global_set_log_level(debug);
if ((ret = gnutls_global_init()) < 0) {
fprintf(
stderr
, "global_init: %s\n", gnutls_strerror(ret));
exit(1);
}
if (gnutls_serv_options.present.provider) {
ret = gnutls_pkcs11_init(0,
((void *)0)
);
if (ret < 0)
fprintf(
stderr
, "pkcs11_init: %s",
gnutls_strerror(ret));
else {
ret =
gnutls_pkcs11_add_provider(gnutls_serv_options.arg.provider,
((void *)0)
);
if (ret < 0) {
fprintf(
stderr
, "pkcs11_add_provider: %s",
gnutls_strerror(ret));
exit(1);
}
}
}
pkcs11_common(
((void *)0)
);
if (generate != 0) {
generate_dh_primes();
} else if (dh_params_file) {
read_dh_params();
} else {
use_static_dh_params = 1;
}
if (gnutls_certificate_allocate_credentials(&cert_cred) < 0) {
fprintf(
stderr
, "memory error\n");
exit(1);
}
if (x509_cafile !=
((void *)0)
) {
if ((ret = gnutls_certificate_set_x509_trust_file
(cert_cred, x509_cafile, x509ctype)) < 0) {
fprintf(
stderr
, "Error reading '%s'\n",
x509_cafile);
fprintf(
stderr
, "Error: %s\n", safe_strerror(ret));
exit(1);
} else {
printf("Processed %d CA certificate(s).\n", ret);
}
}
if (x509_crlfile !=
((void *)0)
) {
if ((ret = gnutls_certificate_set_x509_crl_file
(cert_cred, x509_crlfile, x509ctype)) < 0) {
fprintf(
stderr
, "Error reading '%s'\n",
x509_crlfile);
fprintf(
stderr
, "Error: %s\n", safe_strerror(ret));
exit(1);
} else {
printf("Processed %d CRL(s).\n", ret);
}
}
if (x509_certfile_size > 0 && x509_keyfile_size > 0) {
for (i = 0; i < x509_certfile_size; i++) {
ret = gnutls_certificate_set_x509_key_file
(cert_cred, x509_certfile[i], x509_keyfile[i], x509ctype);
if (ret < 0) {
fprintf(
stderr
,
"Error reading '%s' or '%s'\n",
x509_certfile[i], x509_keyfile[i]);
fprintf(
stderr
, "Error: %s\n", safe_strerror(ret));
exit(1);
} else
cert_set = 1;
}
}
if (rawpk_file_size > 0 && rawpk_keyfile_size > 0) {
for (i = 0; i < rawpk_keyfile_size; i++) {
ret = gnutls_certificate_set_rawpk_key_file(cert_cred, rawpk_file[i],
rawpk_keyfile[i],
x509ctype,
((void *)0)
, 0,
((void *)0)
, 0,
0, 0);
if (ret < 0) {
fprintf(
stderr
, "Error reading '%s' or '%s'\n",
rawpk_file[i], rawpk_keyfile[i]);
fprintf(
stderr
, "Error: %s\n", safe_strerror(ret));
exit(1);
} else {
cert_set = 1;
}
}
}
if (cert_set == 0) {
fprintf(
stderr
,
"Warning: no private key and certificate pairs were set.\n");
}
if (gnutls_serv_options.present.ignore_ocsp_response_errors)
gnutls_certificate_set_flags(cert_cred, GNUTLS_CERTIFICATE_SKIP_OCSP_RESPONSE_CHECK);
for (i = 0; i < ocsp_responses_size; i++ ) {
ret = gnutls_certificate_set_ocsp_status_request_file
(cert_cred, ocsp_responses[i], 0);
if (ret < 0) {
fprintf(
stderr
,
"Cannot set OCSP status request file: %s: %s\n",
ocsp_responses[i],
gnutls_strerror(ret));
exit(1);
}
}
if (use_static_dh_params) {
ret = gnutls_certificate_set_known_dh_params(cert_cred, GNUTLS_SEC_PARAM_MEDIUM);
if (ret < 0) {
fprintf(
stderr
, "Error while setting DH parameters: %s\n", gnutls_strerror(ret));
exit(1);
}
} else {
gnutls_certificate_set_params_function(cert_cred, get_params);
}
if (srp_passwd !=
((void *)0)
) {
gnutls_srp_allocate_server_credentials(&srp_cred);
if ((ret =
gnutls_srp_set_server_credentials_file(srp_cred,
srp_passwd,
srp_passwd_conf))
< 0) {
fprintf(
stderr
,
"Error while setting SRP parameters\n");
fprintf(
stderr
, "Error: %s\n", safe_strerror(ret));
}
}
if (psk_passwd !=
((void *)0)
) {
gnutls_psk_allocate_server_credentials(&psk_cred);
if ((ret =
gnutls_psk_set_server_credentials_file(psk_cred,
psk_passwd)) <
0) {
fprintf(
stderr
,
"Error while setting PSK parameters\n");
fprintf(
stderr
, "Error: %s\n", safe_strerror(ret));
}
if (gnutls_serv_options.present.pskhint) {
ret =
gnutls_psk_set_server_credentials_hint
(psk_cred, gnutls_serv_options.arg.pskhint);
if (ret) {
fprintf(
stderr
,
"Error setting PSK identity hint.\n");
fprintf(
stderr
, "Error: %s\n", safe_strerror(ret));
}
}
if (use_static_dh_params) {
ret = gnutls_psk_set_server_known_dh_params(psk_cred, GNUTLS_SEC_PARAM_MEDIUM);
if (ret < 0) {
fprintf(
stderr
, "Error while setting DH parameters: %s\n", gnutls_strerror(ret));
exit(1);
}
} else {
gnutls_psk_set_server_params_function(psk_cred,
get_params);
}
}
gnutls_anon_allocate_server_credentials(&dh_cred);
if (use_static_dh_params) {
ret = gnutls_anon_set_server_known_dh_params(dh_cred, GNUTLS_SEC_PARAM_MEDIUM);
if (ret < 0) {
fprintf(
stderr
, "Error while setting DH parameters: %s\n", gnutls_strerror(ret));
exit(1);
}
} else {
gnutls_anon_set_server_params_function(dh_cred, get_params);
}
if (noticket == 0)
gnutls_session_ticket_key_generate(&session_ticket_key);
if (earlydata) {
ret = gnutls_anti_replay_init(&anti_replay);
if (ret < 0) {
fprintf(
stderr
, "Error while initializing anti-replay: %s\n", gnutls_strerror(ret));
exit(1);
}
gnutls_anti_replay_set_add_function(anti_replay, anti_replay_db_add);
gnutls_anti_replay_set_ptr(anti_replay,
((void *)0)
);
}
if (gnutls_serv_options.present.mtu)
mtu = gnutls_serv_options.value.mtu;
else
mtu = 1300;
if (gnutls_serv_options.present.port)
port = gnutls_serv_options.value.port;
else
port = 5556;
if (gnutls_serv_options.present.udp)
udp_server(name, port, mtu);
else
tcp_server(name, port);
return 0;
}
| int main(unsigned long long a0, unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long long a5) {
void* v0;
unsigned int v1;
unsigned int v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int v6;
char v7;
v3 = 0;
v4 = 0;
cmd_parser(a0, a1);
signal(0x1, 0x1);
signal(0xf, terminate);
if (signal(0x2, terminate) == 1)
signal(0x2, 0x1);
sockets_init();
listener_list = gl_list_create_empty(0x500378, 0x0, 0x0, listener_free, 0x1);
if (!nodb)
wrap_db_init();
if (!g_5000cf)
v7 = 0;
else
strcpy(&v7, "UDP ");
if (http != 1)
strcat(&v7, "Echo Server");
else
strcat(&v7, "HTTP Server");
gnutls_global_set_log_function(tls_log_func);
gnutls_global_set_audit_log_function(tls_audit_log_func);
gnutls_global_set_log_level(debug);
v6 = gnutls_global_init(a0, a1, 0x0, listener_free, 0x1, a5);
if (v6 < 0) {
fprintf(*(&stderr), "global_init: %s\n", gnutls_strerror(v6));
exit(0x1);
}
if (g_5000e9) {
v6 = gnutls_pkcs11_init(0x0, 0x0);
if (v6 < 0) {
fprintf(*(&stderr), "pkcs11_init: %s", gnutls_strerror(v6));
} else {
v6 = gnutls_pkcs11_add_provider(gnutls_credentials_set, 0x0);
if (v6 < 0) {
fprintf(*(&stderr), "pkcs11_add_provider: %s", gnutls_strerror(v6));
exit(0x1);
}
}
}
pkcs11_common(0x0);
if (generate) {
generate_dh_primes();
} else if (!dh_params_file) {
v4 = 1;
} else {
read_dh_params();
}
if (gnutls_certificate_allocate_credentials(&cert_cred) < 0) {
fprintf(*(&stderr), "memory error\n");
exit(0x1);
}
if (x509_cafile) {
v6 = gnutls_certificate_set_x509_trust_file(cert_cred, x509_cafile, x509ctype, x509_cafile);
if (v6 < 0) {
fprintf(*(&stderr), "Error reading '%s'\n", x509_cafile);
fprintf(*(&stderr), "Error: %s\n", safe_strerror(v6));
exit(0x1);
}
printf("Processed %d CA certificate(s).\n", v6);
}
if (x509_crlfile) {
v6 = gnutls_certificate_set_x509_crl_file(cert_cred, x509_crlfile, x509ctype, x509_crlfile);
if (v6 < 0) {
fprintf(*(&stderr), "Error reading '%s'\n", x509_crlfile);
fprintf(*(&stderr), "Error: %s\n", safe_strerror(v6));
exit(0x1);
}
printf("Processed %d CRL(s).\n", v6);
}
if (x509_certfile_size && x509_keyfile_size) {
for (v5 = 0; v5 < x509_certfile_size; v5 += 1) {
v6 = gnutls_certificate_set_x509_key_file(cert_cred, *((x509_certfile + v5 * 8)), *((x509_keyfile + v5 * 8)), x509ctype);
if (v6 < 0) {
fprintf(*(&stderr), "Error reading '%s' or '%s'\n", *((x509_certfile + v5 * 8)), *((x509_keyfile + v5 * 8)));
fprintf(*(&stderr), "Error: %s\n", safe_strerror(v6));
exit(0x1);
}
v3 = 1;
}
}
if (rawpk_file_size && rawpk_keyfile_size) {
for (v5 = 0; v5 < rawpk_keyfile_size; v5 += 1) {
v0 = 0;
v6 = gnutls_certificate_set_rawpk_key_file(cert_cred, *((rawpk_file + v5 * 8)), *((rawpk_keyfile + v5 * 8)), x509ctype, 0x0, 0x0, 0x0, 0x0, 0x0);
if (v6 < 0) {
fprintf(*(&stderr), "Error reading '%s' or '%s'\n", *((rawpk_file + v5 * 8)), *((rawpk_keyfile + v5 * 8)));
fprintf(*(&stderr), "Error: %s\n", safe_strerror(v6));
exit(0x1);
}
v3 = 1;
}
}
if (!v3)
fprintf(*(&stderr), "Warning: no private key and certificate pairs were set.\n");
if (g_5000e6)
gnutls_certificate_set_flags(cert_cred, 0x4);
for (v5 = 0; v5 < ocsp_responses_size; v5 += 1) {
v6 = gnutls_certificate_set_ocsp_status_request_file(cert_cred, *((ocsp_responses + v5 * 8)), 0x0, *((ocsp_responses + v5 * 8)));
if (v6 < 0) {
fprintf(*(&stderr), "Cannot set OCSP status request file: %s: %s\n", *((ocsp_responses + v5 * 8)), gnutls_strerror(v6));
exit(0x1);
}
}
if (!v4) {
gnutls_certificate_set_params_function(cert_cred, get_params);
} else {
v6 = gnutls_certificate_set_known_dh_params(cert_cred, 0x23);
if (v6 < 0) {
fprintf(*(&stderr), "Error while setting DH parameters: %s\n", gnutls_strerror(v6));
exit(0x1);
}
}
if (srp_passwd) {
gnutls_srp_allocate_server_credentials(&srp_cred);
v6 = gnutls_srp_set_server_credentials_file(srp_cred, srp_passwd, srp_passwd_conf, srp_passwd);
if (v6 < 0) {
fprintf(*(&stderr), "Error while setting SRP parameters\n");
fprintf(*(&stderr), "Error: %s\n", safe_strerror(v6));
}
}
if (psk_passwd) {
gnutls_psk_allocate_server_credentials(&psk_cred);
v6 = gnutls_psk_set_server_credentials_file(psk_cred, psk_passwd, psk_passwd);
if (v6 < 0) {
fprintf(*(&stderr), "Error while setting PSK parameters\n");
fprintf(*(&stderr), "Error: %s\n", safe_strerror(v6));
}
if (g_5000e4) {
v6 = gnutls_psk_set_server_credentials_hint(psk_cred, gnutls_priority_set_direct, gnutls_priority_set_direct);
if (v6) {
fprintf(*(&stderr), "Error setting PSK identity hint.\n");
fprintf(*(&stderr), "Error: %s\n", safe_strerror(v6));
}
}
if (!v4) {
gnutls_psk_set_server_params_function(psk_cred, get_params);
} else {
v6 = gnutls_psk_set_server_known_dh_params(psk_cred, 0x23);
if (v6 < 0) {
fprintf(*(&stderr), "Error while setting DH parameters: %s\n", gnutls_strerror(v6));
exit(0x1);
}
}
}
gnutls_anon_allocate_server_credentials(&dh_cred);
if (!v4) {
gnutls_anon_set_server_params_function(dh_cred, get_params);
} else {
v6 = gnutls_anon_set_server_known_dh_params(dh_cred, 0x23);
if (v6 < 0) {
fprintf(*(&stderr), "Error while setting DH parameters: %s\n", gnutls_strerror(v6));
exit(0x1);
}
}
if (!noticket)
gnutls_session_ticket_key_generate(&session_ticket_key);
if (earlydata) {
v6 = gnutls_anti_replay_init(&anti_replay);
if (v6 < 0) {
fprintf(*(&stderr), "Error while initializing anti-replay: %s\n", gnutls_strerror(v6));
exit(0x1);
}
gnutls_anti_replay_set_add_function(anti_replay, anti_replay_db_add);
gnutls_anti_replay_set_ptr(anti_replay, 0x0);
}
if (!gnutls_alert_send)
v1 = 1300;
else
v1 = strcpy;
if (!g_5000e7)
v2 = 5556;
else
v2 = g_5001ac;
if (g_5000cf) {
udp_server(&v7, v2, v1, v2);
return 0;
}
tcp_server(&v7, v2);
}
|
terminal__putc(EditLine *el, wint_t c)
{
char buf[
16
+1];
ssize_t i;
if (c == ((wint_t)-1))
return 0;
if (c & ((wint_t)0x80000000))
return fputs(literal_get(el, c), el->el_outfile);
i = ct_encode_char(buf, (size_t)
16
, c);
if (i <= 0)
return (int)i;
buf[i] = '\0';
return fputs(buf, el->el_outfile);
}
| void terminal__putc(struct_0 *a0, unsigned long a1) {
char *v0;
char v1;
void* v3;
unsigned long long v5;
char *v6;
unsigned long long v7;
if (a1 == -1) {
v3 = 0;
return;
} else if (a1 < 0) {
v5 = fputs(literal_get(a0, a1, a1), a0->field_10);
return;
} else {
*(&v0) = ct_encode_char(&v1, 0x10, a1);
if (v0 <= 0) {
v6 = v0;
return;
}
*((v0 + &v1)) = 0;
v7 = fputs(&v1, a0->field_10);
return;
}
}
|
static void print_tx_sc(const char *prefix, __u64 sci, __u8 encoding_sa,
struct rtattr *txsc_stats, struct rtattr *secy_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",
"TXSC: %016llx", ((1==ntohl(1)) ? (sci) : ((uint64_t)ntohl((sci) & 0xFFFFFFFF) << 32) | ntohl((sci) >> 32)));
print_uint(PRINT_ANY, "encoding_sa",
" on SA %d\n", encoding_sa);
print_secy_stats(prefix, secy_stats);
print_txsc_stats(prefix, txsc_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", "%d:",
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_txsa_stats(prefix, sa_attr[MACSEC_SA_ATTR_STATS]);
close_json_object();
}
close_json_array(PRINT_JSON,
((void *)0)
);
}
| void print_tx_sc(undefined8 param_1,undefined8 param_2,undefined param_3,undefined8 param_4,
undefined8 param_5,ushort *param_6)
{
char cVar1;
undefined uVar2;
uint32_t uVar3;
uint32_t uVar4;
undefined4 uVar5;
long in_FS_OFFSET;
int local_84;
ushort *local_80;
undefined local_78 [8];
undefined8 local_70;
undefined8 local_68;
undefined8 local_60;
undefined8 local_50;
undefined8 local_48;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
print_string(1,0,&DAT_00104836,param_1);
uVar3 = ntohl(1);
if (uVar3 != 1) {
uVar3 = ntohl((uint32_t)param_2);
uVar4 = ntohl((uint32_t)((ulong)param_2 >> 0x20));
param_2 = CONCAT44(uVar3,uVar4);
}
print_0xhex(4,&DAT_001044bf,"TXSC: %016llx",param_2);
print_uint(4,"encoding_sa"," on SA %d\n",param_3);
print_secy_stats(param_1,param_5);
print_txsc_stats(param_1,param_4);
open_json_array(2,"sa_list");
local_84 = *param_6 - 4;
for (local_80 = param_6 + 2;
((3 < local_84 && (3 < *local_80)) && ((int)(uint)*local_80 <= local_84));
local_80 = (ushort *)((long)local_80 + (ulong)(*local_80 + 3 & 0xfffffffc))) {
open_json_object(0);
parse_rtattr_flags(local_78,9,local_80 + 2,*local_80 - 4,0x8000);
cVar1 = rta_getattr_u8(local_68);
print_string(1,0,&DAT_00104836,param_1);
print_string(1,0,&DAT_00104836,param_1);
uVar2 = rta_getattr_u8(local_70);
print_uint(4,&DAT_0010486a,&DAT_00104866,uVar2);
uVar5 = rta_getattr_u32(local_60);
print_uint(4,&DAT_00104450," PN %u,",uVar5);
print_bool(2,"active",0,cVar1 != '\0');
print_string(1,0," state %s,");
print_key(local_50);
print_txsa_stats(param_1,local_48);
close_json_object();
local_84 = local_84 - (*local_80 + 3 & 0xfffffffc);
}
close_json_array(2,0);
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
void
put_u32(void *vp, u_int32_t v)
{
u_char *p = (u_char *)vp;
p[0] = (u_char)(v >> 24) & 0xff;
p[1] = (u_char)(v >> 16) & 0xff;
p[2] = (u_char)(v >> 8) & 0xff;
p[3] = (u_char)v & 0xff;
}
| long long put_u32(char a0[4], unsigned long a1) {
a0[0] = a1 >> 24;
a0[1] = a1 >> 16;
a0[2] = a1 >> 8;
a0[3] = a1;
return &a0[3];
}
|
static intmax_t
subexpr (expr)
char *expr;
{
intmax_t val;
char *p;
for (p = expr; p && *p && ((((*p) == ' ') || ((*p) == '\t')) || ((*p) == '\n')); p++)
;
if (p ==
((void *)0)
|| *p == '\0')
return (0);
pushexp ();
expression = (char *)strcpy (sh_xmalloc((1 + strlen (expr)), "expr.c", 464), (expr));
tp = expression;
curtok = lasttok = 0;
tokstr = (char *)
((void *)0)
;
tokval = 0;
init_lvalue (&curlval);
lastlval = curlval;
readtok ();
val = expcomma ();
if (curtok != 0)
evalerror (gettext("syntax error in expression"));
do { if (tokstr) sh_xfree((tokstr), "expr.c", 481); } while (0);
do { if (expression) sh_xfree((expression), "expr.c", 482); } while (0);
popexp ();
return val;
}
| int subexpr(char *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3) {
char *v0;
unsigned long v1;
unsigned int v3;
unsigned long long v4;
unsigned long long v5;
v0 = a0;
while (true) {
if (!v0)
break;
switch (*(v0)) {
case 9: case 10: case 32:
v0 += 1;
break;
default:
goto LABEL_400bad;
}
}
LABEL_400bad:
if (!v0) {
v3 = 0;
return v3;
} else if (!*(v0)) {
v3 = 0;
return v3;
} else {
pushexp();
expression = strcpy(sh_xmalloc(strlen(a0) + 1, "expr.c", 0x1d0), a0);
tp = expression;
lasttok = 0;
curtok = lasttok;
tokstr = 0;
tokval = 0;
init_lvalue(&curlval);
lastlval = curlval;
g_402ba8 = g_402b88;
g_402bb0 = g_402b90;
g_402bb8 = g_402b98;
readtok(&curlval, a1, g_402b98, a3, v4, v5);
v1 = expcomma(&curlval, a1, a2, a3);
if (curtok)
evalerror(gettext("syntax error in expression"));
if (tokstr)
sh_xfree(tokstr, "expr.c", 0x1e1, a3);
if (expression)
sh_xfree(expression, "expr.c", 0x1e2, a3);
popexp();
v3 = v1;
return v3;
}
}
|
static int new_fields (void)
{
char buf[200];
(void) puts (gettext ("Enter the new value, or press ENTER for the default"));
(void) puts ("");
(void) snprintf (buf, sizeof buf, "%ld", mindays);
change_field (buf, sizeof buf, gettext ("Minimum Password Age"));
if ( (getlong (buf, &mindays) == 0)
|| (mindays < -1)) {
return 0;
}
(void) snprintf (buf, sizeof buf, "%ld", maxdays);
change_field (buf, sizeof buf, gettext ("Maximum Password Age"));
if ( (getlong (buf, &maxdays) == 0)
|| (maxdays < -1)) {
return 0;
}
if (-1 == lstchgdate || lstchgdate > 0x7fffffffffffffffL / (24L*3600L)) {
strcpy (buf, "-1");
} else {
date_to_str (sizeof(buf), buf, lstchgdate * (24L*3600L));
}
change_field (buf, sizeof buf, gettext ("Last Password Change (YYYY-MM-DD)"));
if (strcmp (buf, "-1") == 0) {
lstchgdate = -1;
} else {
lstchgdate = strtoday (buf);
if (lstchgdate <= -1) {
return 0;
}
}
(void) snprintf (buf, sizeof buf, "%ld", warndays);
change_field (buf, sizeof buf, gettext ("Password Expiration Warning"));
if ( (getlong (buf, &warndays) == 0)
|| (warndays < -1)) {
return 0;
}
(void) snprintf (buf, sizeof buf, "%ld", inactdays);
change_field (buf, sizeof buf, gettext ("Password Inactive"));
if ( (getlong (buf, &inactdays) == 0)
|| (inactdays < -1)) {
return 0;
}
if (-1 == expdate || 0x7fffffffffffffffL / (24L*3600L) < expdate) {
strcpy (buf, "-1");
} else {
date_to_str (sizeof(buf), buf, expdate * (24L*3600L));
}
change_field (buf, sizeof buf,
gettext ("Account Expiration Date (YYYY-MM-DD)"));
if (strcmp (buf, "-1") == 0) {
expdate = -1;
} else {
expdate = strtoday (buf);
if (expdate <= -1) {
return 0;
}
}
return 1;
}
| int new_fields() {
char v0;
unsigned int v2;
puts(gettext("Enter the new value, or press ENTER for the default"));
puts(&g_404394);
snprintf(&v0, 0xc8, "%ld", mindays);
change_field(&v0, 0xc8, gettext("Minimum Password Age"));
if (!getlong(&v0, &mindays)) {
v2 = 0;
return v2;
} else if (mindays < -1) {
v2 = 0;
return v2;
} else {
snprintf(&v0, 0xc8, "%ld", maxdays);
change_field(&v0, 0xc8, gettext("Maximum Password Age"));
if (!getlong(&v0, &maxdays)) {
v2 = 0;
return v2;
} else if (maxdays >= -1) {
if (lstchgdate == -1 || lstchgdate > 106751991167300)
strcpy(&v0, "-1");
else
date_to_str(0xc8, &v0, lstchgdate * 86400);
change_field(&v0, 0xc8, gettext("Last Password Change (YYYY-MM-DD)"));
if (!strcmp(&v0, "-1")) {
lstchgdate = -1;
} else {
lstchgdate = strtoday(&v0);
if (lstchgdate < 0) {
v2 = 0;
return v2;
}
}
snprintf(&v0, 0xc8, "%ld", warndays);
change_field(&v0, 0xc8, gettext("Password Expiration Warning"));
if (!getlong(&v0, &warndays)) {
v2 = 0;
return v2;
} else if (warndays < -1) {
v2 = 0;
return v2;
} else {
snprintf(&v0, 0xc8, "%ld", inactdays);
change_field(&v0, 0xc8, gettext("Password Inactive"));
if (!getlong(&v0, &inactdays)) {
v2 = 0;
return v2;
} else if (inactdays >= -1) {
if (expdate == -1 || expdate > 106751991167300)
strcpy(&v0, "-1");
else
date_to_str(0xc8, &v0, expdate * 86400);
change_field(&v0, 0xc8, gettext("Account Expiration Date (YYYY-MM-DD)"));
if (!strcmp(&v0, "-1")) {
expdate = -1;
v2 = 1;
return v2;
}
expdate = strtoday(&v0);
if (expdate < 0) {
v2 = 0;
return v2;
}
v2 = 1;
return v2;
} else {
v2 = 0;
return v2;
}
}
} else {
v2 = 0;
return v2;
}
}
}
|
static int
confirm_overwrite(const char *filename)
{
char yesno[3];
struct stat st;
if (stat(filename, &st) != 0)
return 1;
printf("%s already exists.\n", filename);
printf("Overwrite (y/n)? ");
fflush(
stdout
);
if (fgets(yesno, sizeof(yesno),
stdin
) ==
((void *)0)
)
return 0;
if (yesno[0] != 'y' && yesno[0] != 'Y')
return 0;
return 1;
}
| undefined8 confirm_overwrite(char *param_1)
{
int iVar1;
undefined8 uVar2;
char *pcVar3;
long in_FS_OFFSET;
stat local_a8;
char local_13 [3];
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
iVar1 = stat(param_1,&local_a8);
if (iVar1 == 0) {
printf("%s already exists.\n",param_1);
printf("Overwrite (y/n)? ");
fflush(stdout);
pcVar3 = fgets(local_13,3,stdin);
if (pcVar3 == (char *)0x0) {
uVar2 = 0;
}
else if ((local_13[0] == 'y') || (local_13[0] == 'Y')) {
uVar2 = 1;
}
else {
uVar2 = 0;
}
}
else {
uVar2 = 1;
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar2;
}
|
void
init() {
{
basepf.nextc = basepf.buf = basebuf;
basepf.linno = 1;
}
{
sigmode[
17
- 1] = 1;
setsignal(
17
);
}
{
}
{
char **envp;
static char ppid[32] = "PPID=";
const char *p;
struct stat64 st1, st2;
initvar();
for (envp = environ ; *envp ; envp++) {
p = endofname(*envp);
if (p != *envp && *p == '=') {
setvareq(*envp, 0x01|0x08);
}
}
setvareq(defifsvar, 0x08);
setvareq(defoptindvar, 0x08);
fmtstr(ppid + 5, sizeof(ppid) - 5, "%ld", (long) getppid());
setvareq(ppid, 0x08);
p = lookupvar("PWD");
if (p)
if (*p != '/' || stat64(p, &st1) || stat64(".", &st2) ||
st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino)
p = 0;
setpwd(p, 0);
}
}
| long long init(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long *v0;
void* v1;
char v2;
char v3;
char v4;
char v5;
environ = &basebuf;
*(&initvar) = environ;
sigmode = 1;
initvar = 1;
setsignal(0x11);
initvar(0x11, a1, a2, a3, a4, a5);
for (v0 = environ; *(v0); v0 += 1) {
v1 = endofname(*(v0));
if (v1 != *(v0) && *(v1) == 61)
setvareq(*(v0), 0x9);
}
setvareq(0x500040, 0x8);
setvareq(0x500048, 0x8);
fmtstr(&g_4003c5, 0x1b, "%ld", getppid());
setvareq("PPID=", 0x8);
v1 = lookupvar("PWD");
if (v1) {
if (*(v1) == 47 && !stat64(v1, &v2) && !stat64(".", &v4) && *(&v2) == *(&v4) && *(&v3) == *(&v5))
goto LABEL_4001bf;
v1 = 0;
}
LABEL_4001bf:
setpwd(v1, 0x0);
return 0;
}
|
inline void
gl_list_node_set_value (gl_list_t list, gl_list_node_t node, const void *elt)
{
int result = gl_list_node_nx_set_value (list, node, elt);
if (result < 0)
xalloc_die ();
}
| void gl_list_node_set_value(void)
{
halt_baddata();
}
|
static int cfg_kernel_matches(const struct cfg *cfg, const char *pattern)
{
regex_t re;
int status;
if ((strcmp((pattern), ("*")) == 0))
return 1;
if (regcomp(&re, pattern,
1
|
(1 << 3)
) != 0)
return 0;
status = regexec(&re, cfg->kversion, 0,
((void *)0)
, 0);
regfree(&re);
return status == 0;
}
| int cfg_kernel_matches(unsigned long long *a0, char *a1) {
unsigned int v0;
char v1;
unsigned int v3;
if (!strcmp(a1, "*")) {
v3 = 1;
return v3;
} else if (!regcomp(&v1, a1, 0x9, a1)) {
v0 = regexec(&v1, *(a0), 0x0, 0x0, 0x0);
regfree(&v1);
v3 = !v0;
return v3;
} else {
v3 = 0;
return v3;
}
}
|
int
ssh_packet_process_read(struct ssh *ssh, int fd)
{
struct session_state *state = ssh->state;
int r;
size_t rlen;
if ((r = sshbuf_read(fd, state->input, (256 * 1024), &rlen)) != 0)
return r;
if (state->packet_discard) {
if ((r = sshbuf_consume_end(state->input, rlen)) != 0)
return r;
state->keep_alive_timeouts = 0;
if (rlen >= state->packet_discard) {
if ((r = ssh_packet_stop_discard(ssh)) != 0)
return r;
}
state->packet_discard -= rlen;
return 0;
}
return 0;
}
| long long ssh_packet_process_read(unsigned long long *a0, unsigned long a1) {
unsigned int v0;
char v1;
struct_0 *v2;
void* v4;
v2 = *(a0);
v0 = sshbuf_read(a1, v2->field_20, 0x40000, &v1);
if (v0) {
v4 = v0;
} else if (v2->field_1c4) {
v0 = sshbuf_consume_end(v2->field_20, *(&v1), *(&v1));
if (v0) {
v4 = v0;
} else {
v2->field_14c = 0;
if (v2->field_1c4 <= *(&v1)) {
v0 = ssh_packet_stop_discard(a0);
if (v0)
v4 = v0;
}
if (!v0 || v2->field_1c4 > *(&v1)) {
v2->field_1c4 = v2->field_1c4 - *(&v1);
v4 = 0;
}
}
} else {
v4 = 0;
}
return v4;
}
|
COMMAND *
clean_simple_command (command)
COMMAND *command;
{
if (command->type != cm_simple)
command_error ("clean_simple_command", 1, command->type, 0);
else
{
command->value.Simple->words =
((command->value.Simple->words && command->value.Simple->words->next) ? (WORD_LIST *)list_reverse ((GENERIC_LIST *)command->value.Simple->words) : (WORD_LIST *)(command->value.Simple->words));
command->value.Simple->redirects =
((command->value.Simple->redirects && command->value.Simple->redirects->next) ? (REDIRECT *)list_reverse ((GENERIC_LIST *)command->value.Simple->redirects) : (REDIRECT *)(command->value.Simple->redirects));
}
parser_state &= ~0x080000;
return (command);
}
| unsigned int * clean_simple_command(unsigned int *a1)
{
long v1;
long v2;
if ( *a1 == 4 )
{
if ( *(_QWORD *)(*((_QWORD *)a1 + 3) + 8LL) && **(_QWORD **)(*((_QWORD *)a1 + 3) + 8LL) )
v1 = list_reverse(*(_QWORD *)(*((_QWORD *)a1 + 3) + 8LL));
else
v1 = *(_QWORD *)(*((_QWORD *)a1 + 3) + 8LL);
*(_QWORD *)(*((_QWORD *)a1 + 3) + 8LL) = v1;
if ( *(_QWORD *)(*((_QWORD *)a1 + 3) + 16LL) && **(_QWORD **)(*((_QWORD *)a1 + 3) + 16LL) )
v2 = list_reverse(*(_QWORD *)(*((_QWORD *)a1 + 3) + 16LL));
else
v2 = *(_QWORD *)(*((_QWORD *)a1 + 3) + 16LL);
*(_QWORD *)(*((_QWORD *)a1 + 3) + 16LL) = v2;
}
else
{
command_error("clean_simple_command", 1LL, *a1, 0LL);
}
parser_state &= ~0x80000u;
return a1;
}
|
static void help(void)
{
printf("Usage:\n"
"\t%s [options] [-i] [-b] modulename\n"
"\t%s [options] -a [-i] [-b] modulename [modulename...]\n"
"\t%s [options] -r [-i] modulename\n"
"\t%s [options] -r -a [-i] modulename [modulename...]\n"
"\t%s [options] -c\n"
"\t%s [options] --dump-modversions filename\n"
"Management Options:\n"
"\t-a, --all Consider every non-argument to\n"
"\t be a module name to be inserted\n"
"\t or removed (-r)\n"
"\t-r, --remove Remove modules instead of inserting\n"
"\t --remove-dependencies Deprecated: use --remove-holders\n"
"\t --remove-holders Also remove module holders (use together with -r)\n"
"\t-w, --wait <MSEC> When removing a module, wait up to MSEC for\n"
"\t module's refcount to become 0 so it can be\n"
"\t removed (use together with -r)\n"
"\t --first-time Fail if module already inserted or removed\n"
"\t-i, --ignore-install Ignore install commands\n"
"\t-i, --ignore-remove Ignore remove commands\n"
"\t-b, --use-blacklist Apply blacklist to resolved alias.\n"
"\t-f, --force Force module insertion or removal.\n"
"\t implies --force-modversions and\n"
"\t --force-vermagic\n"
"\t --force-modversion Ignore module's version\n"
"\t --force-vermagic Ignore module's version magic\n"
"\n"
"Query Options:\n"
"\t-R, --resolve-alias Only lookup and print alias and exit\n"
"\t-D, --show-depends Only print module dependencies and exit\n"
"\t-c, --showconfig Print out known configuration and exit\n"
"\t-c, --show-config Same as --showconfig\n"
"\t --show-modversions Dump module symbol version and exit\n"
"\t --dump-modversions Same as --show-modversions\n"
"\t --show-exports Only print module exported symbol versions and exit\n"
"\n"
"General Options:\n"
"\t-n, --dry-run Do not execute operations, just print out\n"
"\t-n, --show Same as --dry-run\n"
"\t-C, --config=FILE Use FILE instead of default search paths\n"
"\t-d, --dirname=DIR Use DIR as filesystem root for /lib/modules\n"
"\t-S, --set-version=VERSION Use VERSION instead of `uname -r`\n"
"\t-s, --syslog print to syslog, not stderr\n"
"\t-q, --quiet disable messages\n"
"\t-v, --verbose enables more messages\n"
"\t-V, --version show version\n"
"\t-h, --help show this help\n",
program_invocation_short_name, program_invocation_short_name,
program_invocation_short_name, program_invocation_short_name,
program_invocation_short_name, program_invocation_short_name);
}
| void help(void)
{
printf("Usage:\n\t%s [options] [-i] [-b] modulename\n\t%s [options] -a [-i] [-b] modulename [modulename...]\n\t%s [options] -r [-i] modulename\n\t%s [options] -r -a [-i] modulename [modulename...]\n\t%s [options] -c\n\t%s [options] --dump-modversions filename\nManagement Options:\n\t-a, --all Consider every non-argument to\n\t be a module name to be inserted\n\t or removed (-r)\n\t-r, --remove Remove modules instead of inserting\n\t --remove-dependencies Deprecated: use --remove-holders\n\t --remove-holders Also remove module holders (use together with -r)\n\t-w, --wait <MSEC> When removing a module, wait up to MSEC for\n\t module\'s refcount to become 0 so it can be\n\t removed (use together with -r)\n\t --first-time Fail if module already inserted or removed\n\t-i, --ignore-install Ignore install commands\n\t-i, --ignore-remove Ignore remove commands\n\t-b, --use-blacklist Apply blacklist to resolved alias.\n\t-f, --force Force module insertion or removal.\n\t implies --force-modversions and\n\t --force-vermagic\n\t --force-modversion Ignore module\'s version\n\t --force-vermagic Ignore module\'s version magic\n\nQuery Options:\n\t-R, --resolve-alias Only lookup and print alias and exit\n\t-D, --show-depends Only print module dependencies and exit\n\t-c, --showconfig Print out known configuration and exit\n\t-c, --show-config Same as --showconfig\n\t --show-modversions Dump module symbol version and exit\n\t --dump-modversions Same as --show-modversions\n\t --show-exports Only print module exported symbol versions and exit\n\nGeneral Options:\n\t-n, --dry-run Do not execute operations, just print out\n\t-n, --show Same as --dry-run\n\t-C, --config=FILE Use FILE instead of default search paths\n\t-d, --dir..."
,program_invocation_short_name,program_invocation_short_name,program_invocation_short_name,
program_invocation_short_name,program_invocation_short_name,program_invocation_short_name);
return;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long v0;
unsigned long long v1[2];
char *v2;
unsigned long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long *v21;
unsigned long long v22;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
for (v1[0] = &v4; v1[0] && strcmp(a0, v1[0]); v1[0] = v1 + 1);
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
*(&v3) = (!strcmp(a0, "[") ? a0 : "test");
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v22 = *(&v18) ^ v21[5];
return;
}
|
, "Could not format address for name %.100s: %s", name, ssh_gai_strerror(gaierr))
;
goto fail;
}
if (strlcpy(caddr, addr, clen) >= clen) {
sshlog("ssh.c", __func__, 364, 1, SYSLOG_LEVEL_ERROR,
((void *)0)
, "host \"%s\" addr \"%s\" too long (max %lu)", name, addr, (u_long)clen)
;
if (clen > 0)
*caddr = '\0';
fail:
freeaddrinfo(res);
return
((void *)0)
;
}
| void ssh_gai_strerror(void)
{
halt_baddata();
}
|
static void
set_xattr_option (int value)
{
if (value == 1)
set_archive_format ("posix");
xattrs_option = value;
}
| void set_xattr_option(unsigned long a0) {
unsigned int v0;
unsigned long v2;
v0 = a0;
if (a0 == 1)
set_archive_format("posix");
v2 = a0;
savedir_sort_order = a0;
return;
}
|
static int
_is_multiop (c)
int c;
{
switch (c)
{
case 1:
case 2:
case 3:
case 4:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
return 1;
default:
return 0;
}
}
| int _is_multiop(unsigned long a0) {
unsigned int v1;
if (a0 <= 4 && a0 > 0 || a0 - 7 <= 10 && a0 > 4)
v1 = 1;
if (a0 <= 0 && a0 <= 4 || a0 > 4 && a0 - 7 > 10)
v1 = 0;
return v1;
}
|
__explicit_bzero_hook(void *buf, size_t len)
{
}
| void __explicit_bzero_hook(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned long v1;
char v2;
unsigned long long v4;
v1 = a0;
v0 = a1;
v4 = *(&v2);
return;
}
|
int
bsd_getopt(int argc, char * const argv[], const char *shortopts)
{
if (optreset == 1) {
optreset = 0;
optind = 0;
}
return (getopt)(argc, argv, shortopts);
}
| long long bsd_getopt(unsigned long a0, char **a1, char *a2) {
if (*(got.optreset) == 1) {
*(got.optreset) = 0;
*(got.optind) = 0;
}
return getopt(a0, a1, a2);
}
|
void
_rl_standout_on (void)
{
if (_rl_term_so && _rl_term_se)
tputs (_rl_term_so, 1, _rl_output_character_function);
}
| long long _rl_standout_on() {
unsigned long long v1;
v1 = _rl_term_so;
if (_rl_term_so) {
v1 = _rl_term_se;
if (_rl_term_se)
v1 = tputs(_rl_term_so, 0x1, _rl_output_character_function);
}
return v1;
}
|
WORD_DESC *
make_word (string)
const char *string;
{
WORD_DESC *temp;
temp = make_bare_word (string);
return (make_word_flags (temp, string));
}
| void make_word(undefined8 param_1)
{
undefined8 uVar1;
uVar1 = make_bare_word(param_1);
make_word_flags(uVar1,param_1);
return;
}
|
static void
pr_unidiff_hunk (struct change *hunk)
{
lin first0, last0, first1, last1;
lin i, j, k;
struct change *next;
char const *function;
FILE *out;
if (! analyze_hunk (hunk, &first0, &last0, &first1, &last1))
return;
i = - files[0].prefix_lines;
first0 = ((first0 - context) >= (i) ? (first0 - context) : (i));
first1 = ((first1 - context) >= (i) ? (first1 - context) : (i));
if (last0 < files[0].valid_lines - context)
last0 += context;
else
last0 = files[0].valid_lines - 1;
if (last1 < files[1].valid_lines - context)
last1 += context;
else
last1 = files[1].valid_lines - 1;
function =
((void *)0)
;
if (function_regexp.fastmap)
function = find_function (files[0].linbuf, first0);
begin_output ();
out = outfile;
set_color_context (LINE_NUMBER_CONTEXT);
fputs_unlocked ("@@ -",out);
print_unidiff_number_range (&files[0], first0, last0);
fputs_unlocked (" +",out);
print_unidiff_number_range (&files[1], first1, last1);
fputs_unlocked (" @@",out);
set_color_context (RESET_CONTEXT);
if (function)
print_context_function (out, function);
putc_unlocked ('\n',out);
next = hunk;
i = first0;
j = first1;
while (i <= last0 || j <= last1)
{
if (!next || i < next->line0)
{
char const *const *line = &files[0].linbuf[i++];
if (! (suppress_blank_empty && **line == '\n'))
putc_unlocked (initial_tab ? '\t' : ' ',out);
print_1_line (
((void *)0)
, line);
j++;
}
else
{
k = next->deleted;
while (k--)
{
char const * const *line = &files[0].linbuf[i++];
set_color_context (DELETE_CONTEXT);
putc_unlocked ('-',out);
if (initial_tab && ! (suppress_blank_empty && **line == '\n'))
putc_unlocked ('\t',out);
print_1_line_nl (
((void *)0)
, line,
1
);
set_color_context (RESET_CONTEXT);
if (line[1][-1] == '\n')
putc_unlocked ('\n',out);
}
k = next->inserted;
while (k--)
{
char const * const *line = &files[1].linbuf[j++];
set_color_context (ADD_CONTEXT);
putc_unlocked ('+',out);
if (initial_tab && ! (suppress_blank_empty && **line == '\n'))
putc_unlocked ('\t',out);
print_1_line_nl (
((void *)0)
, line,
1
);
set_color_context (RESET_CONTEXT);
if (line[1][-1] == '\n')
putc_unlocked ('\n',out);
}
next = next->link;
}
}
}
| long long pr_unidiff_hunk(unsigned long long a0) {
void* v0;
int tmp_20;
int tmp_25;
unsigned long long v1;
unsigned long long v2;
unsigned long long v3;
unsigned long v4;
unsigned long v5;
unsigned long long v6;
unsigned long long v7[4];
void* v8;
void* v9;
struct_0 *v10;
struct_0 *v11;
char **v12;
void* v15;
void* v16;
unsigned long long v17;
unsigned long long v18;
unsigned int v19;
if (analyze_hunk(a0, &v0, &v1, &v2, &v3)) {
v4 = -(*(5243216));
v15 = *(&v0) - context;
if (*(&v0) - context <= v4)
v15 = v4;
v0 = v15;
v16 = *(&v2) - context;
if (*(&v2) - context <= v4)
v16 = v4;
v2 = v16;
if (*(5243192) - context > *(&v1))
v1 = context + *(&v1);
else
v1 = *(5243192) - 1;
if (*(5243496) - context > *(&v3))
v3 = context + *(&v3);
else
v3 = *(5243496) - 1;
v8 = 0;
if (suppress_blank_empty)
v8 = find_function(*(5243168), v0);
begin_output();
v9 = outfile;
set_color_context(0x4);
fputs_unlocked("@@ -", v9);
print_unidiff_number_range(0x500068, v0, v1);
fputs_unlocked(" +", v9);
print_unidiff_number_range(0x500198, v2, v3);
fputs_unlocked(" @@", v9);
set_color_context(0x3);
if (v8)
print_context_function(v9, v8);
putc_unlocked(0xa, v9);
v7[0] = a0;
v4 = v0;
v5 = v2;
while (true) {
if (v4 > v1) {
if (v5 > v3)
break;
}
if (v7 && v4 >= v7[3]) {
v6 = v7[2];
while (true) {
v17 = v6;
v6 -= 1;
if (v17) {
tmp_20 = v4;
v4 += 1;
v11 = tmp_20 * 8 + *(5243168);
set_color_context(0x2);
putc_unlocked(0x2d, v9);
if (initial_tab && (v11->field_0->field_0 != 10 || (suppress_blank_empty ^ 1)))
putc_unlocked(0x9, v9);
print_1_line_nl(0x0, v11, 0x1, &v2);
set_color_context(0x3);
if (*((v11->field_8 - 1)) != 10)
continue;
putc_unlocked(0xa, v9);
} else {
v6 = v7[1];
while (true) {
v18 = v6;
v6 -= 1;
if (v18) {
tmp_20 = v5;
v5 += 1;
v10 = tmp_20 * 8 + *(5243472);
set_color_context(0x1);
putc_unlocked(0x2b, v9);
if (initial_tab && (v10->field_0->field_0 != 10 || (suppress_blank_empty ^ 1)))
putc_unlocked(0x9, v9);
print_1_line_nl(0x0, v10, 0x1, &v2);
set_color_context(0x3);
if (*((v10->field_8 - 1)) != 10)
continue;
putc_unlocked(0xa, v9);
} else {
v7 = v7[0];
break;
}
}
}
}
}
if (!v7 || v4 < v7[3]) {
tmp_25 = v4;
v4 += 1;
v12 = tmp_25 * 8 + *(5243168);
if ((suppress_blank_empty ^ 1) || *(*(v12)) != 10) {
if (initial_tab)
v19 = 9;
else
v19 = 32;
putc_unlocked(v19, v9);
}
print_1_line(0x0, v12);
v5 += 1;
}
}
}
return 0;
}
|
static
_Bool
apply_suffix (double *x, char suffix_char)
{
int multiplier;
switch (suffix_char)
{
case 0:
case 's':
multiplier = 1;
break;
case 'm':
multiplier = 60;
break;
case 'h':
multiplier = 60 * 60;
break;
case 'd':
multiplier = 60 * 60 * 24;
break;
default:
return
0
;
}
*x *= multiplier;
return
1
;
}
| int apply_suffix(unsigned long long *a0, unsigned long a1) {
unsigned int v0;
unsigned int v2;
unsigned long long v3;
int v4;
if (a1 == 115) {
LABEL_400384:
v0 = 1;
goto LABEL_4003af;
} else {
if (a1 > 115) {
LABEL_4003a8:
v2 = 0;
goto LABEL_4003cd;
}
if (a1 == 109) {
v0 = 60;
goto LABEL_4003af;
}
if (!(a1 <= 109))
goto LABEL_4003a8;
if (a1 == 104) {
v0 = 3600;
goto LABEL_4003af;
}
if (!(a1 <= 104))
goto LABEL_4003a8;
if (!a1)
goto LABEL_400384;
if (!(a1 == 100))
goto LABEL_4003a8;
v0 = 86400;
LABEL_4003af:
v3 = v0;
STORE(addr=rdi<8>, data=Conv(128->64, (xmm0<16> * Conv(64->128, Load(addr=rdi<8>, size=8, endness=Iend_LE)))), size=8, endness=Iend_LE, guard=None)
v2 = 1;
}
LABEL_4003cd:
return v2;
}
|
static char *
format_date (struct timespec ts, int kind)
{
enum {
NS_BUF_LEN = 32,
DATE_LEN_PERCENT_APLUS=21
};
static char buf[128u+10u + ((DATE_LEN_PERCENT_APLUS) > (((((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3) + 2) > (NS_BUF_LEN+64+200) ? (((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3) + 2) : (NS_BUF_LEN+64+200))) ? (DATE_LEN_PERCENT_APLUS) : (((((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3) + 2) > (NS_BUF_LEN+64+200) ? (((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3) + 2) : (NS_BUF_LEN+64+200))))
];
char ns_buf[NS_BUF_LEN];
int charsprinted, need_ns_suffix;
struct tm *tm;
char fmt[12];
_Static_assert (sizeof (buf) >= ((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (
16
+ 1) -
16
+ 1 + 3), "verify (" "sizeof (buf) >= LONGEST_HUMAN_READABLE" ")");
charsprinted = 0;
need_ns_suffix = 0;
if (kind == '+')
{
strcpy (fmt, "%Y-%m-%d+%T");
need_ns_suffix = 1;
}
else
{
fmt[0] = '%';
fmt[1] = kind;
fmt[2] = '\0';
switch (kind)
{
case 'S':
case 'T':
case 'X':
case '@':
need_ns_suffix = 1;
break;
default:
need_ns_suffix = 0;
break;
}
}
if (need_ns_suffix)
{
charsprinted = snprintf (ns_buf, NS_BUF_LEN, ".%09ld0", (long int)ts.tv_nsec);
((void) sizeof ((
charsprinted < NS_BUF_LEN
) ? 1 : 0), __extension__ ({ if (
charsprinted < NS_BUF_LEN
) ; else __assert_fail (
"charsprinted < NS_BUF_LEN"
, "print.c", 665, __extension__ __PRETTY_FUNCTION__); }))
;
}
else
{
charsprinted = 0;
ns_buf[0] = 0;
}
if (kind != '@')
{
tm = localtime (&ts.tv_sec);
if (tm)
{
char *s = do_time_format (fmt, tm, ns_buf, charsprinted);
if (s)
return s;
}
}
if (1)
{
uintmax_t w = ts.tv_sec;
size_t used, len, remaining;
char *p = human_readable (ts.tv_sec < 0 ? -w : w, buf + 1,
human_ceiling, 1, 1);
((void) sizeof ((
p > buf
) ? 1 : 0), __extension__ ({ if (
p > buf
) ; else __assert_fail (
"p > buf"
, "print.c", 697, __extension__ __PRETTY_FUNCTION__); }))
;
((void) sizeof ((
p < (buf + (sizeof buf))
) ? 1 : 0), __extension__ ({ if (
p < (buf + (sizeof buf))
) ; else __assert_fail (
"p < (buf + (sizeof buf))"
, "print.c", 698, __extension__ __PRETTY_FUNCTION__); }))
;
if (ts.tv_sec < 0)
*--p = '-';
if (need_ns_suffix)
{
len = strlen (p);
used = (p-buf) + len;
((void) sizeof ((
sizeof buf > used
) ? 1 : 0), __extension__ ({ if (
sizeof buf > used
) ; else __assert_fail (
"sizeof buf > used"
, "print.c", 711, __extension__ __PRETTY_FUNCTION__); }))
;
remaining = sizeof buf - used - 1u;
if (strlen (ns_buf) >= remaining)
{
error (0, 0,
"charsprinted=%ld but remaining=%lu: ns_buf=%s",
(long)charsprinted, (unsigned long)remaining, ns_buf);
}
((void) sizeof ((
strlen (ns_buf) < remaining
) ? 1 : 0), __extension__ ({ if (
strlen (ns_buf) < remaining
) ; else __assert_fail (
"strlen (ns_buf) < remaining"
, "print.c", 720, __extension__ __PRETTY_FUNCTION__); }))
;
strcat (p, ns_buf);
}
return p;
}
}
| int format_date(unsigned long long a0, unsigned long a1, unsigned long a2) {
char v0;
unsigned int v1;
unsigned int v2;
char *v3;
void* v4;
unsigned long v5;
unsigned long long v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
char v10;
char v11;
char v12;
char v13;
unsigned long long v15;
v1 = 0;
v2 = 0;
if (a2 == 43) {
strcpy(&v10, "%Y-%m-%d+%T");
v2 = 1;
} else {
v10 = 37;
v11 = a2;
v12 = 0;
if (24 >= a2 - 64 && ((1 << ((a2 - 64) & 63)) & 18350081))
v2 = 1;
if (!((1 << ((a2 - 64) & 63)) & 18350081) || 24 < a2 - 64)
v2 = 0;
}
if (v2) {
v1 = snprintf(&v13, 0x20, ".%09ld0", a1);
if (v1 > 31)
__assert_fail();
} else {
v1 = 0;
v13 = 0;
}
if (v1 <= 31 || !v2) {
if (a2 != 64) {
v4 = localtime(&v0);
if (v4) {
v5 = do_time_format(&v10, v4, &v13, v1);
if (v5)
v15 = v5;
}
}
if (!v5 || a2 == 64 || !v4) {
v6 = a0;
if (a0 < 0)
v15 = -(v6);
else
v15 = a0;
v3 = human_readable(v15);
if (v3 <= 4204864) {
__assert_fail();
} else if (v3 >= 4205655) {
__assert_fail();
} else {
if (a0 < 0) {
v3 += 1;
*(v3) = 45;
}
if (v2) {
v7 = strlen(v3);
v8 = v7 + v3 - &buf.10503;
if (v8 > 790)
__assert_fail();
v9 = 790 - v8;
if (v9 <= strlen(&v13))
error(0x0, 0x0, "charsprinted=%ld but remaining=%lu: ns_buf=%s");
v15 = strlen(&v13);
if (v9 <= v15)
__assert_fail();
strcat(v3, &v13);
}
if ((v8 <= 790 || !v2) && (!v2 || v9 > v15))
*(&v15) = v3;
}
}
if ((v3 < 4205655 || v5) && (v3 < 4205655 || a2 != 64) && (v3 < 4205655 || v4) && (v5 || v3 > 4204864) && (a2 != 64 || v3 > 4204864) && (v3 > 4204864 || v4) && (v8 <= 790 || !v2 || v5) && (v8 <= 790 || !v2 || a2 != 64) && (v8 <= 790 || !v2 || v4) && (!v2 || v5 || v9 > v15) && (!v2 || a2 != 64 || v9 > v15) && (!v2 || v4 || v9 > v15))
return v15;
}
}
|
int
bind_builtin (list)
WORD_LIST *list;
{
int return_code;
Keymap kmap, saved_keymap;
int flags, opt;
char *initfile, *map_name, *fun_name, *unbind_name, *remove_seq, *cmd_seq, *t;
if (no_line_editing)
{
builtin_warning (gettext("line editing not enabled"));
}
kmap = saved_keymap = (Keymap)
((void *)0)
;
flags = 0;
initfile = map_name = fun_name = unbind_name = remove_seq = cmd_seq = (char *)
((void *)0)
;
return_code = 0;
if (bash_readline_initialized == 0)
initialize_readline ();
begin_unwind_frame ("bind_builtin");
unwind_protect_mem ((char *)&(rl_outstream), sizeof (rl_outstream));
rl_outstream =
stdout
;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "lvpVPsSXf:q:u:m:r:x:")) != -1)
{
switch (opt)
{
case 'l':
flags |= 0x0001;
break;
case 'v':
flags |= 0x0008;
break;
case 'p':
flags |= 0x0002;
break;
case 'f':
flags |= 0x0004;
initfile = list_optarg;
break;
case 'm':
flags |= 0x0020;
map_name = list_optarg;
break;
case 'q':
flags |= 0x0010;
fun_name = list_optarg;
break;
case 'u':
flags |= 0x0800;
unbind_name = list_optarg;
break;
case 'r':
flags |= 0x0040;
remove_seq = list_optarg;
break;
case 'V':
flags |= 0x0100;
break;
case 'P':
flags |= 0x0080;
break;
case 's':
flags |= 0x0200;
break;
case 'S':
flags |= 0x0400;
break;
case 'x':
flags |= 0x1000;
cmd_seq = list_optarg;
break;
case 'X':
flags |= 0x2000;
break;
case -99:
default:
builtin_usage ();
do { return_code = 258; goto bind_exit; } while (0);
}
}
list = loptend;
if ((flags & 0x0020) && map_name)
{
kmap = rl_get_keymap_by_name (map_name);
if (kmap == 0)
{
builtin_error (gettext("`%s': invalid keymap name"), map_name);
do { return_code = 1; goto bind_exit; } while (0);
}
}
if (kmap)
{
saved_keymap = rl_get_keymap ();
rl_set_keymap (kmap);
}
if (flags & 0x0001)
rl_list_funmap_names ();
if (flags & 0x0002)
rl_function_dumper (1);
if (flags & 0x0080)
rl_function_dumper (0);
if (flags & 0x0200)
rl_macro_dumper (1);
if (flags & 0x0400)
rl_macro_dumper (0);
if (flags & 0x0008)
rl_variable_dumper (1);
if (flags & 0x0100)
rl_variable_dumper (0);
if ((flags & 0x0004) && initfile)
{
if (rl_read_init_file (initfile) != 0)
{
t = printable_filename (initfile, 0);
builtin_error (gettext("%s: cannot read: %s"), t, strerror (
(*__errno_location ())
));
if (t != initfile)
sh_xfree((t), "./bind.def", 254);
do { return_code = 1; goto bind_exit; } while (0);
}
}
if ((flags & 0x0010) && fun_name)
return_code = query_bindings (fun_name);
if ((flags & 0x0800) && unbind_name)
return_code = unbind_command (unbind_name);
if ((flags & 0x0040) && remove_seq)
{
opt = unbind_keyseq (remove_seq);
do { return_code = opt; goto bind_exit; } while (0);
}
if (flags & 0x1000)
return_code = bind_keyseq_to_unix_command (cmd_seq);
if (flags & 0x2000)
return_code = print_unix_command_map ();
while (list)
{
int olen, nlen, d, i;
char **obindings, **nbindings;
obindings = rl_invoking_keyseqs (bash_execute_unix_command);
olen = obindings ? strvec_len (obindings) : 0;
rl_parse_and_bind (list->word->word);
nbindings = rl_invoking_keyseqs (bash_execute_unix_command);
nlen = nbindings ? strvec_len (nbindings) : 0;
if (nlen < olen)
for (d = olen - nlen, i = 0; i < olen && d > 0; i++)
if (nlen == 0 || strvec_search (nbindings, obindings[i]) < 0)
{
unbind_unix_command (obindings[i]);
d--;
}
strvec_dispose (obindings);
strvec_dispose (nbindings);
list = list->next;
}
bind_exit:
if (saved_keymap)
rl_set_keymap (saved_keymap);
run_unwind_frame ("bind_builtin");
if (return_code < 0)
return_code = 1;
return (sh_chkwrite (return_code));
}
| long bind_builtin(long a1)
{
char *v1;
char *v2;
int *v3;
char *v4;
char *v5;
int v6;
int v7;
long **v10;
int bindings;
int v12;
int v13;
int i;
int v15;
int v16;
int v17;
long keymap_by_name;
long keymap;
long v20;
long v21;
long v22;
long v23;
const char *v24;
long v25;
long v26;
long v27;
long v28;
if ( no_line_editing )
{
v1 = gettext("line editing not enabled");
builtin_warning(v1);
}
keymap = 0LL;
keymap_by_name = 0LL;
v12 = 0;
v25 = 0LL;
v24 = 0LL;
v23 = 0LL;
v22 = 0LL;
v21 = 0LL;
v20 = 0LL;
bindings = 0;
if ( !bash_readline_initialized )
initialize_readline();
begin_unwind_frame("bind_builtin");
unwind_protect_mem(&rl_outstream, 8LL);
rl_outstream = stdout;
reset_internal_getopt();
while ( 2 )
{
v15 = internal_getopt(a1, "lvpVPsSXf:q:u:m:r:x:");
if ( v15 == -1 )
{
v10 = (long **)loptend;
if ( (v12 & 0x20) != 0 && v21 && (keymap_by_name = rl_get_keymap_by_name(v21)) == 0 )
{
v2 = gettext("`%s': invalid keymap name");
builtin_error(v2, v21, v2);
bindings = 1;
}
else
{
if ( keymap_by_name )
{
keymap = rl_get_keymap();
rl_set_keymap(keymap_by_name);
}
if ( (v12 & 1) != 0 )
rl_list_funmap_names();
if ( (v12 & 2) != 0 )
rl_function_dumper(1LL);
if ( (v12 & 0x80) != 0 )
rl_function_dumper(0LL);
if ( (v12 & 0x200) != 0 )
rl_macro_dumper(1LL);
if ( (v12 & 0x400) != 0 )
rl_macro_dumper(0LL);
if ( (v12 & 8) != 0 )
rl_variable_dumper(1LL);
if ( (v12 & 0x100) != 0 )
rl_variable_dumper(0LL);
if ( (v12 & 4) != 0 && v20 && (unsigned int)rl_read_init_file(v20) )
{
v26 = printable_filename(v20, 0LL);
v3 = _errno_location();
v4 = strerror(*v3);
v5 = gettext("%s: cannot read: %s");
builtin_error(v5, v26, v4);
if ( v26 != v20 )
sh_xfree(v26, "./bind.def", 254LL);
bindings = 1;
}
else
{
if ( (v12 & 0x10) != 0 && v22 )
bindings = query_bindings(v22);
if ( (v12 & 0x800) != 0 && v23 )
bindings = unbind_command(v23);
if ( (v12 & 0x40) != 0 && v24 )
{
bindings = unbind_keyseq(v24);
}
else
{
if ( (v12 & 0x1000) != 0 )
bindings = bind_keyseq_to_unix_command(v25);
if ( (v12 & 0x2000) != 0 )
bindings = print_unix_command_map();
while ( v10 )
{
v27 = rl_invoking_keyseqs(&bash_execute_unix_command);
if ( v27 )
v6 = strvec_len(v27);
else
v6 = 0;
v16 = v6;
rl_parse_and_bind(*v10[1]);
v28 = rl_invoking_keyseqs(&bash_execute_unix_command);
if ( v28 )
v7 = strvec_len(v28);
else
v7 = 0;
v17 = v7;
if ( v7 < v16 )
{
v13 = v16 - v7;
for ( i = 0; i < v16 && v13 > 0; ++i )
{
if ( !v17 || (int)strvec_search(v28, *(_QWORD *)(8LL * i + v27)) < 0 )
{
unbind_unix_command(*(_QWORD *)(8LL * i + v27));
--v13;
}
}
}
strvec_dispose(v27);
strvec_dispose(v28);
v10 = (long **)*v10;
}
}
}
}
}
else
{
switch ( v15 )
{
case 'P':
v12 |= 0x80u;
continue;
case 'S':
v12 |= 0x400u;
continue;
case 'V':
v12 |= 0x100u;
continue;
case 'X':
v12 |= 0x2000u;
continue;
case 'f':
v12 |= 4u;
v20 = list_optarg;
continue;
case 'l':
v12 |= 1u;
continue;
case 'm':
v12 |= 0x20u;
v21 = list_optarg;
continue;
case 'p':
v12 |= 2u;
continue;
case 'q':
v12 |= 0x10u;
v22 = list_optarg;
continue;
case 'r':
v12 |= 0x40u;
v24 = (const char *)list_optarg;
continue;
case 's':
v12 |= 0x200u;
continue;
case 'u':
v12 |= 0x800u;
v23 = list_optarg;
continue;
case 'v':
v12 |= 8u;
continue;
case 'x':
v12 |= 0x1000u;
v25 = list_optarg;
continue;
default:
builtin_usage();
bindings = 258;
break;
}
}
break;
}
if ( keymap )
rl_set_keymap(keymap);
run_unwind_frame("bind_builtin");
if ( bindings < 0 )
bindings = 1;
return sh_chkwrite((unsigned int)bindings);
}
|
int
rl_vi_search_again (int count, int key)
{
switch (key)
{
case 'n':
rl_noninc_reverse_search_again (count, key);
break;
case 'N':
rl_noninc_forward_search_again (count, key);
break;
}
return (0);
}
| long long rl_vi_search_again(unsigned long a0, unsigned long a1) {
if (a1 == 78) {
rl_noninc_forward_search_again(a0, a1, a1);
} else if (a1 == 110) {
rl_noninc_reverse_search_again(a0, a1, a1);
}
return 0;
}
|
int
ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
{
struct session_state *state = ssh->state;
u_int reason, seqnr;
int r;
u_char *msg;
for (;;) {
msg =
((void *)0)
;
r = ssh_packet_read_poll2(ssh, typep, seqnr_p);
if (r != 0)
return r;
if (*typep) {
state->keep_alive_timeouts = 0;
;
}
switch (*typep) {
case 2:
sshlog("packet.c", __func__, 1725, 0, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "Received SSH2_MSG_IGNORE");
break;
case 4:
if ((r = sshpkt_get_u8(ssh,
((void *)0)
)) != 0 ||
(r = sshpkt_get_string(ssh, &msg,
((void *)0)
)) != 0 ||
(r = sshpkt_get_string(ssh,
((void *)0)
,
((void *)0)
)) != 0) {
free(msg);
return r;
}
sshlog("packet.c", __func__, 1734, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Remote: %.900s", msg);
free(msg);
break;
case 1:
if ((r = sshpkt_get_u32(ssh, &reason)) != 0 ||
(r = sshpkt_get_string(ssh, &msg,
((void *)0)
)) != 0)
return r;
sshlog("packet.c", __func__, 1742, 0, ssh->state->server_side && reason == 11 ? SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR,
((void *)0)
, "Received disconnect from %s port %d:" "%u: %.400s", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), reason, msg)
;
free(msg);
return -29;
case 3:
if ((r = sshpkt_get_u32(ssh, &seqnr)) != 0)
return r;
sshlog("packet.c", __func__, 1753, 0, SYSLOG_LEVEL_DEBUG1,
((void *)0)
, "Received SSH2_MSG_UNIMPLEMENTED for %u", seqnr)
;
break;
default:
return 0;
}
}
}
| int ssh_packet_read_poll_seqnr(unsigned int *a0[84], char *a1, unsigned long long a2) {
unsigned long long v0;
unsigned int v1;
unsigned long v2;
unsigned long v3;
unsigned long long v4;
unsigned long v5;
unsigned long long v6;
char v7;
char v8;
unsigned int v9;
void* v10;
unsigned int v11[84];
unsigned int v13;
unsigned long long v14;
unsigned long long v15;
unsigned long long v16;
v6 = a2;
*(&v11[0]) = *(a0);
while (true) {
v10 = 0;
v9 = ssh_packet_read_poll2(a0, a1, v6);
if (v9) {
v13 = v9;
return v13;
}
if (*(a1))
v11[83] = 0;
switch (*(a1)) {
case 4:
v9 = sshpkt_get_u8(a0, 0x0);
if (!v9) {
v9 = sshpkt_get_string(a0, &v10, 0x0);
if (!v9) {
v9 = sshpkt_get_string(a0, 0x0, 0x0);
if (!v9) {
v5 = v10;
v4 = "Remote: %.900s";
sshlog("packet.c", "ssh_packet_read_poll_seqnr", 0x6c6, 0x0, 0x5, 0x0);
}
}
}
free(v10);
if (v9 || v9 || v9) {
v13 = v9;
return v13;
}
break;
case 3:
v9 = sshpkt_get_u32(a0, &v8);
if (v9) {
v13 = v9;
return v13;
}
v5 = *(&v8);
v4 = "Received SSH2_MSG_UNIMPLEMENTED for %u";
sshlog("packet.c", "ssh_packet_read_poll_seqnr", 0x6d9, 0x0, 0x5, 0x0);
break;
case 1:
v9 = sshpkt_get_u32(a0, &v7);
if (!v9) {
v9 = sshpkt_get_string(a0, &v10, 0x0);
if (!v9) {
v14 = *(&v7);
v15 = ssh_remote_port(a0);
v13 = ssh_remote_ipaddr(a0);
if ((*(a0))[81] && *(&v7) == 11) {
v16 = 3;
v4 = v10;
v3 = v14;
v2 = v15;
v1 = v13;
v0 = "Received disconnect from %s port %d:%u: %.400s";
sshlog("packet.c", "ssh_packet_read_poll_seqnr", 0x6ce, 0x0, v16, 0x0);
free(v10);
v13 = -29;
return v13;
}
v16 = 2;
v4 = v10;
v3 = v14;
v2 = v15;
v1 = v13;
v0 = "Received disconnect from %s port %d:%u: %.400s";
sshlog("packet.c", "ssh_packet_read_poll_seqnr", 0x6ce, 0x0, v16, 0x0);
free(v10);
v13 = -29;
return v13;
}
}
v13 = v9;
return v13;
case 2:
v4 = "Received SSH2_MSG_IGNORE";
sshlog("packet.c", "ssh_packet_read_poll_seqnr", 0x6bd, 0x0, 0x7, 0x0);
break;
default:
v13 = 0;
return v13;
}
}
}
|
static
_Bool
compare_line_list (char * const list1[], size_t const lengths1[],
char * const list2[], size_t const lengths2[],
lin nl)
{
char * const *l1 = list1;
char * const *l2 = list2;
size_t const *lgths1 = lengths1;
size_t const *lgths2 = lengths2;
while (nl--)
if (!*l1 || !*l2 || *lgths1 != *lgths2++
|| memcmp (*l1++, *l2++, *lgths1++) != 0)
return
0
;
return
1
;
}
| int compare_line_list(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long long a4) {
unsigned long long v0;
int tmp_15;
int tmp_16;
int tmp_25;
int tmp_34;
unsigned long v1;
unsigned long v2;
unsigned long v3;
unsigned long long *v4;
unsigned long long *v5;
unsigned long long *v6;
unsigned long long *v7;
unsigned int v9;
unsigned long v10;
v3 = a0;
v2 = a1;
v1 = a2;
v0 = a4;
v4 = v3;
v5 = v1;
v6 = v2;
v7 = a3;
while (!v9) {
LABEL_401824:
v9 = v0;
v0 -= 1;
v9 = 1;
return v9;
}
if (!*(v4)) {
v9 = 0;
return v9;
}
if (!*(v5)) {
v9 = 0;
return v9;
}
tmp_15 = v7;
v7 += 1;
if (*(v6) != *(tmp_15)) {
v9 = 0;
return v9;
}
tmp_16 = v6;
v6 += 1;
v10 = *(tmp_16);
tmp_25 = v5;
v5 += 1;
tmp_34 = v4;
v4 += 1;
if (memcmp(*(tmp_34), *(tmp_25), v10)) {
v9 = 0;
return v9;
}
goto LABEL_401824;
}
|
void
removerecordregions(int endoff)
{
if (ifslastp ==
((void *)0)
)
return;
if (ifsfirst.endoff > endoff) {
while (ifsfirst.next !=
((void *)0)
) {
struct ifsregion *ifsp;
({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; });
ifsp = ifsfirst.next->next;
free((pointer)(ifsfirst.next));
ifsfirst.next = ifsp;
({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; });
}
if (ifsfirst.begoff > endoff)
ifslastp =
((void *)0)
;
else {
ifslastp = &ifsfirst;
ifsfirst.endoff = endoff;
}
return;
}
ifslastp = &ifsfirst;
while (ifslastp->next && ifslastp->next->begoff < endoff)
ifslastp=ifslastp->next;
while (ifslastp->next !=
((void *)0)
) {
struct ifsregion *ifsp;
({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; });
ifsp = ifslastp->next->next;
free((pointer)(ifslastp->next));
ifslastp->next = ifsp;
({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; });
}
if (ifslastp->endoff > endoff)
ifslastp->endoff = endoff;
}
| long removerecordregions(int a1)
{
long result;
long v2;
void *v3;
result = ifslastp;
if ( ifslastp )
{
if ( a1 >= dword_2AAC )
{
for ( ifslastp = (long)&ifsfirst;
*(_QWORD *)ifslastp && a1 > *(_DWORD *)(*(_QWORD *)ifslastp + 8LL);
ifslastp = *(_QWORD *)ifslastp )
{
;
}
while ( *(_QWORD *)ifslastp )
{
++suppressint;
v2 = **(_QWORD **)ifslastp;
free(*(void **)ifslastp);
*(_QWORD *)ifslastp = v2;
if ( !--suppressint && intpending )
onint();
}
result = *(unsigned int *)(ifslastp + 12);
if ( a1 < (int)result )
{
result = ifslastp;
*(_DWORD *)(ifslastp + 12) = a1;
}
}
else
{
while ( ifsfirst )
{
++suppressint;
v3 = *(void **)ifsfirst;
free(ifsfirst);
ifsfirst = v3;
if ( !--suppressint && intpending )
onint();
}
result = (unsigned int)dword_2AA8;
if ( a1 >= dword_2AA8 )
{
ifslastp = (long)&ifsfirst;
result = (unsigned int)a1;
dword_2AAC = a1;
}
else
{
ifslastp = 0LL;
}
}
}
return result;
}
|
static int
ipstats_enable_recursively(const struct ipstats_stat_desc *desc,
struct ipstats_stat_enabled *enabled,
const struct ipstats_sel *sel)
{
_Bool
found =
0
;
size_t i;
int err;
if (desc->kind == IPSTATS_STAT_DESC_KIND_LEAF) {
struct ipstats_stat_enabled_one en[] = {{
.desc = desc,
.sel = *sel,
}};
return ipstats_add_enabled(en, (sizeof(en) / sizeof((en)[0])), enabled);
}
for (i = 0; i < desc->nsubs; i++) {
struct ipstats_sel subsel = *sel;
ipstats_select_push(&subsel, desc->subs[i]->name);
err = ipstats_enable_recursively(desc->subs[i], enabled,
&subsel);
if (err == -
2
)
continue;
if (err != 0)
return err;
found =
1
;
}
return found ? 0 : -
2
;
}
| long ipstats_enable_recursively(long a1, void **a2, long *a3)
{
long v3;
long v5;
char v7;
unsigned int v8;
unsigned long i;
long v10;
long v11;
long v12;
long v13;
unsigned long v14;
v14 = __readfsqword(0x28u);
v7 = 0;
if ( *(_DWORD *)(a1 + 8) )
{
for ( i = 0LL; i < *(_QWORD *)(a1 + 24); ++i )
{
v5 = a3[1];
v10 = *a3;
v11 = v5;
v12 = a3[2];
ipstats_select_push((long)&v10, **(_QWORD **)(8 * i + *(_QWORD *)(a1 + 16)));
v8 = ipstats_enable_recursively(*(_QWORD *)(8 * i + *(_QWORD *)(a1 + 16)), a2, &v10);
if ( v8 != -2 )
{
if ( v8 )
return v8;
v7 = 1;
}
}
if ( v7 )
return 0LL;
else
return 4294967294LL;
}
else
{
v10 = a1;
v3 = a3[1];
v11 = *a3;
v12 = v3;
v13 = a3[2];
return ipstats_add_enabled(&v10, 1LL, a2);
}
}
|
void
clean_itemlist (itp)
ITEMLIST *itp;
{
STRINGLIST *sl;
sl = itp->slist;
if (sl)
{
if ((itp->flags & (0x020|0x010)) == 0)
strvec_flush (sl->list);
if ((itp->flags & 0x010) == 0)
sh_xfree((sl->list), "pcomplete.c", 249);
sh_xfree((sl), "pcomplete.c", 250);
}
itp->slist = (STRINGLIST *)
((void *)0)
;
itp->flags &= ~(0x010|0x020|0x004|0x002);
}
| long clean_itemlist(long a1)
{
long result;
_QWORD *v2;
v2 = *(_QWORD **)(a1 + 16);
if ( v2 )
{
if ( (*(_DWORD *)a1 & 0x30) == 0 )
strvec_flush(*v2);
if ( (*(_DWORD *)a1 & 0x10) == 0 )
sh_xfree(*v2, "pcomplete.c", 249LL);
sh_xfree(v2, "pcomplete.c", 250LL);
}
*(_QWORD *)(a1 + 16) = 0LL;
result = a1;
*(_DWORD *)a1 &= 0xFFFFFFC9;
return result;
}
|
int
rl_insert_comment (int count, int key)
{
char *rl_comment_text;
int rl_comment_len;
rl_beg_of_line (1, key);
rl_comment_text = _rl_comment_begin ? _rl_comment_begin : "#";
if (rl_explicit_arg == 0)
rl_insert_text (rl_comment_text);
else
{
rl_comment_len = strlen (rl_comment_text);
if ((((rl_comment_len) == 0) ? (1) : ((rl_comment_text)[0] == (rl_line_buffer)[0]) && (strncmp ((rl_comment_text), (rl_line_buffer), (rl_comment_len)) == 0)))
rl_delete_text (rl_point, rl_point + rl_comment_len);
else
rl_insert_text (rl_comment_text);
}
(*rl_redisplay_function) ();
rl_newline (1, '\n');
return (0);
}
| long long rl_insert_comment(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
char *v2;
v0 = a0;
rl_beg_of_line(0x1, a1);
*(&v2) = (!_rl_comment_begin ? _rl_comment_begin : "#");
if (rl_explicit_arg) {
v1 = strlen(v2);
if (!v1 || *(v2) == *(rl_line_buffer) && !strncmp(v2, rl_line_buffer, v1))
rl_delete_text(rl_point, rl_point + v1);
else
rl_insert_text(v2);
} else {
rl_insert_text(v2);
}
*(5243408)();
rl_newline(0x1, 0xa);
return 0;
}
|
static crypto_uint16 int32_mod_uint14(crypto_int32 x,crypto_uint16 m)
{
crypto_int32 q;
crypto_uint16 r;
int32_divmod_uint14(&q,&r,x,m);
return r;
}
| long int32_mod_uint14(int a1, unsigned short a2)
{
unsigned short v3;
int v4;
unsigned long v5;
v5 = __readfsqword(0x28u);
int32_divmod_uint14(&v4, &v3, a1, a2);
return v3;
}
|
static
_Bool
have_same_content (int a_fd, int b_fd)
{
enum { CMP_BLOCK_SIZE = 4096 };
static char a_buff[CMP_BLOCK_SIZE];
static char b_buff[CMP_BLOCK_SIZE];
size_t size;
while (0 < (size = full_read (a_fd, a_buff, sizeof a_buff))) {
if (size != full_read (b_fd, b_buff, sizeof b_buff))
return
0
;
if (memcmp (a_buff, b_buff, size) != 0)
return
0
;
}
return size == 0;
}
| long have_same_content(unsigned int a1, unsigned int a2)
{
long n;
while ( 1 )
{
n = full_read(a1, &a_buff_6846, 4096LL);
if ( !n )
break;
if ( n != full_read(a2, &b_buff_6847, 4096LL) )
return 0LL;
if ( memcmp(&a_buff_6846, &b_buff_6847, n) )
return 0LL;
}
return 1LL;
}
|
void
rl_tty_unset_default_bindings (Keymap kmap)
{
if ((rl_readline_state & (0x0040000)) == 0)
return;
if (_rl_tty_chars.t_erase != (unsigned char)
'\0'
&& kmap[_rl_tty_chars.t_erase].type == 0) kmap[_rl_tty_chars.t_erase].function = rl_insert;;
if (_rl_tty_chars.t_kill != (unsigned char)
'\0'
&& kmap[_rl_tty_chars.t_kill].type == 0) kmap[_rl_tty_chars.t_kill].function = rl_insert;;
if (_rl_tty_chars.t_lnext != (unsigned char)
'\0'
&& kmap[_rl_tty_chars.t_lnext].type == 0) kmap[_rl_tty_chars.t_lnext].function = rl_insert;;
if (_rl_tty_chars.t_werase != (unsigned char)
'\0'
&& kmap[_rl_tty_chars.t_werase].type == 0) kmap[_rl_tty_chars.t_werase].function = rl_insert;;
}
| long rl_tty_unset_default_bindings(long a1)
{
long result;
result = rl_readline_state & 0x40000;
if ( (rl_readline_state & 0x40000) != 0 )
{
if ( BYTE3(rl_tty_chars) && !*(_BYTE *)(16LL * BYTE3(rl_tty_chars) + a1) )
*(_QWORD *)(16LL * BYTE3(rl_tty_chars) + a1 + 8) = &rl_insert;
if ( BYTE5(rl_tty_chars) && !*(_BYTE *)(16LL * BYTE5(rl_tty_chars) + a1) )
*(_QWORD *)(16LL * BYTE5(rl_tty_chars) + a1 + 8) = &rl_insert;
if ( BYTE5(qword_E18) && !*(_BYTE *)(16LL * BYTE5(qword_E18) + a1) )
*(_QWORD *)(16LL * BYTE5(qword_E18) + a1 + 8) = &rl_insert;
result = BYTE4(rl_tty_chars);
if ( BYTE4(rl_tty_chars) )
{
result = *(unsigned char *)(16LL * BYTE4(rl_tty_chars) + a1);
if ( !(_BYTE)result )
{
result = 16LL * BYTE4(rl_tty_chars) + a1;
*(_QWORD *)(result + 8) = &rl_insert;
}
}
}
return result;
}
|
void
ssh_packet_set_mux(struct ssh *ssh)
{
ssh->state->mux = 1;
ssh->state->rekeying = 0;
kex_free(ssh->kex);
ssh->kex =
((void *)0)
;
}
| long long ssh_packet_set_mux(struct_0 *a0) {
a0->field_0->field_1e0 = 1;
a0->field_0->field_1dc = 0;
kex_free(a0->field_8);
a0->field_8 = 0;
return a0;
}
|
static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
{
if (!tb)
return;
if (tb[IFLA_BR_FORWARD_DELAY])
print_uint(PRINT_ANY,
"forward_delay",
"forward_delay %u ",
rta_getattr_u32(tb[IFLA_BR_FORWARD_DELAY]));
if (tb[IFLA_BR_HELLO_TIME])
print_uint(PRINT_ANY,
"hello_time",
"hello_time %u ",
rta_getattr_u32(tb[IFLA_BR_HELLO_TIME]));
if (tb[IFLA_BR_MAX_AGE])
print_uint(PRINT_ANY,
"max_age",
"max_age %u ",
rta_getattr_u32(tb[IFLA_BR_MAX_AGE]));
if (tb[IFLA_BR_AGEING_TIME])
print_uint(PRINT_ANY,
"ageing_time",
"ageing_time %u ",
rta_getattr_u32(tb[IFLA_BR_AGEING_TIME]));
if (tb[IFLA_BR_STP_STATE])
print_uint(PRINT_ANY,
"stp_state",
"stp_state %u ",
rta_getattr_u32(tb[IFLA_BR_STP_STATE]));
if (tb[IFLA_BR_PRIORITY])
print_uint(PRINT_ANY,
"priority",
"priority %u ",
rta_getattr_u16(tb[IFLA_BR_PRIORITY]));
if (tb[IFLA_BR_VLAN_FILTERING])
print_uint(PRINT_ANY,
"vlan_filtering",
"vlan_filtering %u ",
rta_getattr_u8(tb[IFLA_BR_VLAN_FILTERING]));
if (tb[IFLA_BR_VLAN_PROTOCOL]) {
char b1[64];
print_string(PRINT_ANY,
"vlan_protocol",
"vlan_protocol %s ",
ll_proto_n2a(rta_getattr_u16(tb[IFLA_BR_VLAN_PROTOCOL]),
b1, sizeof(b1)));
}
if (tb[IFLA_BR_BRIDGE_ID]) {
char bridge_id[32];
br_dump_bridge_id(((void*)(((char*)(tb[IFLA_BR_BRIDGE_ID])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), bridge_id,
sizeof(bridge_id));
print_string(PRINT_ANY,
"bridge_id",
"bridge_id %s ",
bridge_id);
}
if (tb[IFLA_BR_ROOT_ID]) {
char root_id[32];
br_dump_bridge_id(((void*)(((char*)(tb[IFLA_BR_BRIDGE_ID])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), root_id,
sizeof(root_id));
print_string(PRINT_ANY,
"root_id",
"designated_root %s ",
root_id);
}
if (tb[IFLA_BR_ROOT_PORT])
print_uint(PRINT_ANY,
"root_port",
"root_port %u ",
rta_getattr_u16(tb[IFLA_BR_ROOT_PORT]));
if (tb[IFLA_BR_ROOT_PATH_COST])
print_uint(PRINT_ANY,
"root_path_cost",
"root_path_cost %u ",
rta_getattr_u32(tb[IFLA_BR_ROOT_PATH_COST]));
if (tb[IFLA_BR_TOPOLOGY_CHANGE])
print_uint(PRINT_ANY,
"topology_change",
"topology_change %u ",
rta_getattr_u8(tb[IFLA_BR_TOPOLOGY_CHANGE]));
if (tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED])
print_uint(PRINT_ANY,
"topology_change_detected",
"topology_change_detected %u ",
rta_getattr_u8(tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED]));
if (tb[IFLA_BR_HELLO_TIMER])
_bridge_print_timer(f, "hello_timer", tb[IFLA_BR_HELLO_TIMER]);
if (tb[IFLA_BR_TCN_TIMER])
_bridge_print_timer(f, "tcn_timer", tb[IFLA_BR_TCN_TIMER]);
if (tb[IFLA_BR_TOPOLOGY_CHANGE_TIMER])
_bridge_print_timer(f, "topology_change_timer",
tb[IFLA_BR_TOPOLOGY_CHANGE_TIMER]);
if (tb[IFLA_BR_GC_TIMER])
_bridge_print_timer(f, "gc_timer", tb[IFLA_BR_GC_TIMER]);
if (tb[IFLA_BR_VLAN_DEFAULT_PVID])
print_uint(PRINT_ANY,
"vlan_default_pvid",
"vlan_default_pvid %u ",
rta_getattr_u16(tb[IFLA_BR_VLAN_DEFAULT_PVID]));
if (tb[IFLA_BR_VLAN_STATS_ENABLED])
print_uint(PRINT_ANY,
"vlan_stats_enabled",
"vlan_stats_enabled %u ",
rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_ENABLED]));
if (tb[IFLA_BR_VLAN_STATS_PER_PORT])
print_uint(PRINT_ANY,
"vlan_stats_per_port",
"vlan_stats_per_port %u ",
rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_PER_PORT]));
if (tb[IFLA_BR_GROUP_FWD_MASK])
print_0xhex(PRINT_ANY,
"group_fwd_mask",
"group_fwd_mask %#llx ",
rta_getattr_u16(tb[IFLA_BR_GROUP_FWD_MASK]));
if (tb[IFLA_BR_GROUP_ADDR]) {
char mac[64];
print_string(PRINT_ANY,
"group_addr",
"group_address %s ",
ll_addr_n2a(((void*)(((char*)(tb[IFLA_BR_GROUP_ADDR])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))),
((int)((tb[IFLA_BR_GROUP_ADDR])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))),
1 , mac, sizeof(mac)));
}
if (tb[IFLA_BR_MCAST_SNOOPING])
print_uint(PRINT_ANY,
"mcast_snooping",
"mcast_snooping %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_SNOOPING]));
if (tb[IFLA_BR_MULTI_BOOLOPT]) {
__u32 mcvl_bit = 1 << BR_BOOLOPT_MCAST_VLAN_SNOOPING;
struct br_boolopt_multi *bm;
bm = ((void*)(((char*)(tb[IFLA_BR_MULTI_BOOLOPT])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
if (bm->optmask & mcvl_bit)
print_uint(PRINT_ANY,
"mcast_vlan_snooping",
"mcast_vlan_snooping %u ",
!!(bm->optval & mcvl_bit));
}
if (tb[IFLA_BR_MCAST_ROUTER])
print_uint(PRINT_ANY,
"mcast_router",
"mcast_router %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_ROUTER]));
if (tb[IFLA_BR_MCAST_QUERY_USE_IFADDR])
print_uint(PRINT_ANY,
"mcast_query_use_ifaddr",
"mcast_query_use_ifaddr %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_QUERY_USE_IFADDR]));
if (tb[IFLA_BR_MCAST_QUERIER])
print_uint(PRINT_ANY,
"mcast_querier",
"mcast_querier %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_QUERIER]));
if (tb[IFLA_BR_MCAST_HASH_ELASTICITY])
print_uint(PRINT_ANY,
"mcast_hash_elasticity",
"mcast_hash_elasticity %u ",
rta_getattr_u32(tb[IFLA_BR_MCAST_HASH_ELASTICITY]));
if (tb[IFLA_BR_MCAST_HASH_MAX])
print_uint(PRINT_ANY,
"mcast_hash_max",
"mcast_hash_max %u ",
rta_getattr_u32(tb[IFLA_BR_MCAST_HASH_MAX]));
if (tb[IFLA_BR_MCAST_LAST_MEMBER_CNT])
print_uint(PRINT_ANY,
"mcast_last_member_cnt",
"mcast_last_member_count %u ",
rta_getattr_u32(tb[IFLA_BR_MCAST_LAST_MEMBER_CNT]));
if (tb[IFLA_BR_MCAST_STARTUP_QUERY_CNT])
print_uint(PRINT_ANY,
"mcast_startup_query_cnt",
"mcast_startup_query_count %u ",
rta_getattr_u32(tb[IFLA_BR_MCAST_STARTUP_QUERY_CNT]));
if (tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL])
print_lluint(PRINT_ANY,
"mcast_last_member_intvl",
"mcast_last_member_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL]));
if (tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL])
print_lluint(PRINT_ANY,
"mcast_membership_intvl",
"mcast_membership_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL]));
if (tb[IFLA_BR_MCAST_QUERIER_INTVL])
print_lluint(PRINT_ANY,
"mcast_querier_intvl",
"mcast_querier_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_QUERIER_INTVL]));
if (tb[IFLA_BR_MCAST_QUERY_INTVL])
print_lluint(PRINT_ANY,
"mcast_query_intvl",
"mcast_query_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_QUERY_INTVL]));
if (tb[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL])
print_lluint(PRINT_ANY,
"mcast_query_response_intvl",
"mcast_query_response_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL]));
if (tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL])
print_lluint(PRINT_ANY,
"mcast_startup_query_intvl",
"mcast_startup_query_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL]));
if (tb[IFLA_BR_MCAST_STATS_ENABLED])
print_uint(PRINT_ANY,
"mcast_stats_enabled",
"mcast_stats_enabled %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_STATS_ENABLED]));
if (tb[IFLA_BR_MCAST_IGMP_VERSION])
print_uint(PRINT_ANY,
"mcast_igmp_version",
"mcast_igmp_version %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_IGMP_VERSION]));
if (tb[IFLA_BR_MCAST_MLD_VERSION])
print_uint(PRINT_ANY,
"mcast_mld_version",
"mcast_mld_version %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_MLD_VERSION]));
if (tb[IFLA_BR_NF_CALL_IPTABLES])
print_uint(PRINT_ANY,
"nf_call_iptables",
"nf_call_iptables %u ",
rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
if (tb[IFLA_BR_NF_CALL_IP6TABLES])
print_uint(PRINT_ANY,
"nf_call_ip6tables",
"nf_call_ip6tables %u ",
rta_getattr_u8(tb[IFLA_BR_NF_CALL_IP6TABLES]));
if (tb[IFLA_BR_NF_CALL_ARPTABLES])
print_uint(PRINT_ANY,
"nf_call_arptables",
"nf_call_arptables %u ",
rta_getattr_u8(tb[IFLA_BR_NF_CALL_ARPTABLES]));
}
| long long bridge_print_opt(unsigned long a0, void* a1, struct_0 *a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
unsigned int v1;
unsigned int v2[2];
char v3;
v0 = a0;
if (a2) {
if (a2->field_8)
print_uint(0x4, "forward_delay", "forward_delay %u ", rta_getattr_u32(a2->field_8));
if (a2->field_10)
print_uint(0x4, "hello_time", "hello_time %u ", rta_getattr_u32(a2->field_10));
if (a2->field_18)
print_uint(0x4, "max_age", "max_age %u ", rta_getattr_u32(a2->field_18));
if (a2->field_20)
print_uint(0x4, "ageing_time", "ageing_time %u ", rta_getattr_u32(a2->field_20));
if (a2->field_28)
print_uint(0x4, "stp_state", "stp_state %u ", rta_getattr_u32(a2->field_28));
if (a2->field_30)
print_uint(0x4, "priority", "priority %u ", rta_getattr_u16(a2->field_30));
if (a2->field_38)
print_uint(0x4, "vlan_filtering", "vlan_filtering %u ", rta_getattr_u8(a2->field_38));
if (a2->field_40)
print_string(0x4, "vlan_protocol", "vlan_protocol %s ", ll_proto_n2a(rta_getattr_u16(a2->field_40), &v3, 0x40, &v3));
if (a2->field_58) {
br_dump_bridge_id(a2->field_58 + 4, &v3, 0x20);
print_string(0x4, "bridge_id", "bridge_id %s ", &v3);
}
if (a2->field_50) {
br_dump_bridge_id(a2->field_58 + 4, &v3, 0x20);
print_string(0x4, "root_id", "designated_root %s ", &v3);
}
if (a2->field_60)
print_uint(0x4, "root_port", "root_port %u ", rta_getattr_u16(a2->field_60));
if (a2->field_68)
print_uint(0x4, "root_path_cost", "root_path_cost %u ", rta_getattr_u32(a2->field_68));
if (a2->field_70)
print_uint(0x4, "topology_change", "topology_change %u ", rta_getattr_u8(a2->field_70));
if (a2->field_78)
print_uint(0x4, "topology_change_detected", "topology_change_detected %u ", rta_getattr_u8(a2->field_78));
if (a2[49060489557738168].padding_140)
_bridge_print_timer(a1, "hello_timer", a2[49060489557738168].padding_140, a3, a4, a5);
if (a2->field_88)
_bridge_print_timer(a1, "tcn_timer", a2->field_88, a3, a4, a5);
if (a2->field_90)
_bridge_print_timer(a1, "topology_change_timer", a2->field_90, a3, a4, a5);
if (a2->field_98)
_bridge_print_timer(a1, "gc_timer", a2->field_98, a3, a4, a5);
if (a2->field_138)
print_uint(0x4, "vlan_default_pvid", "vlan_default_pvid %u ", rta_getattr_u16(a2->field_138));
if (a2->field_148)
print_uint(0x4, "vlan_stats_enabled", "vlan_stats_enabled %u ", rta_getattr_u8(a2->field_148));
if (a2->field_168)
print_uint(0x4, "vlan_stats_per_port", "vlan_stats_per_port %u ", rta_getattr_u8(a2->field_168));
if (a2->field_48)
print_0xhex(0x4, "group_fwd_mask", "group_fwd_mask %#llx ", rta_getattr_u16(a2->field_48));
if (a2->field_a0)
print_string(0x4, "group_addr", "group_address %s ", ll_addr_n2a(a2->field_a0 + 2, a2->field_a0->field_0 - 4, 0x1, &v3, 0x40));
if (a2->field_b8)
print_uint(0x4, "mcast_snooping", "mcast_snooping %u ", rta_getattr_u8(a2->field_b8));
if (a2->field_170) {
v1 = 2;
*(&v2[0]) = a2->field_170 + 4;
if ((v2[1] & v1))
print_uint(0x4, "mcast_vlan_snooping", "mcast_vlan_snooping %u ", (v2[0] & v1));
}
if (a2->field_b0)
print_uint(0x4, "mcast_router", "mcast_router %u ", rta_getattr_u8(a2->field_b0));
if (a2->field_c0)
print_uint(0x4, "mcast_query_use_ifaddr", "mcast_query_use_ifaddr %u ", rta_getattr_u8(a2->field_c0));
if (a2->field_c8)
print_uint(0x4, "mcast_querier", "mcast_querier %u ", rta_getattr_u8(a2->field_c8));
if (a2->field_d0)
print_uint(0x4, "mcast_hash_elasticity", "mcast_hash_elasticity %u ", rta_getattr_u32(a2->field_d0));
if (a2->field_d8)
print_uint(0x4, "mcast_hash_max", "mcast_hash_max %u ", rta_getattr_u32(a2->field_d8));
if (a2->field_e0)
print_uint(0x4, "mcast_last_member_cnt", "mcast_last_member_count %u ", rta_getattr_u32(a2->field_e0));
if (a2->field_e8)
print_uint(0x4, "mcast_startup_query_cnt", "mcast_startup_query_count %u ", rta_getattr_u32(a2->field_e8));
if (a2->field_f0)
print_lluint(0x4, "mcast_last_member_intvl", "mcast_last_member_interval %llu ", rta_getattr_u64(a2->field_f0));
if (a2->field_f8)
print_lluint(0x4, "mcast_membership_intvl", "mcast_membership_interval %llu ", rta_getattr_u64(a2->field_f8));
if (a2->field_100)
print_lluint(0x4, "mcast_querier_intvl", "mcast_querier_interval %llu ", rta_getattr_u64(a2->field_100));
if (a2->field_108)
print_lluint(0x4, "mcast_query_intvl", "mcast_query_interval %llu ", rta_getattr_u64(a2->field_108));
if (a2->field_110)
print_lluint(0x4, "mcast_query_response_intvl", "mcast_query_response_interval %llu ", rta_getattr_u64(a2->field_110));
if (a2->field_118)
print_lluint(0x4, "mcast_startup_query_intvl", "mcast_startup_query_interval %llu ", rta_getattr_u64(a2->field_118));
if (a2->field_150)
print_uint(0x4, "mcast_stats_enabled", "mcast_stats_enabled %u ", rta_getattr_u8(a2->field_150));
if (a2->field_158)
print_uint(0x4, "mcast_igmp_version", "mcast_igmp_version %u ", rta_getattr_u8(a2->field_158));
if (a2->field_160)
print_uint(0x4, "mcast_mld_version", "mcast_mld_version %u ", rta_getattr_u8(a2->field_160));
if (a2->field_120)
print_uint(0x4, "nf_call_iptables", "nf_call_iptables %u ", rta_getattr_u8(a2->field_120));
if (a2->field_128)
print_uint(0x4, "nf_call_ip6tables", "nf_call_ip6tables %u ", rta_getattr_u8(a2->field_128));
if (a2->field_130)
print_uint(0x4, "nf_call_arptables", "nf_call_arptables %u ", rta_getattr_u8(a2->field_130));
}
return 0;
}
|
hist_end(EditLine *el)
{
free(el->el_history.buf);
el->el_history.buf =
((void *)0)
;
}
| long hist_end(long a1)
{
long result;
free(*(void **)(a1 + 1112));
result = a1;
*(_QWORD *)(a1 + 1112) = 0LL;
return result;
}
|
static int
set_fstype_devno (struct mount_entry *p)
{
struct stat stbuf;
if (p->me_dev == (dev_t)-1)
{
set_stat_placeholders (&stbuf);
if (0 == (options.xstat)(p->me_mountdir, &stbuf))
{
p->me_dev = stbuf.st_dev;
return 0;
}
else
{
return -1;
}
}
return 0;
}
| int set_fstype_devno(unsigned long long a0[5]) {
char v0;
unsigned int v2;
if (a0[4] != -1) {
v2 = 0;
} else {
set_stat_placeholders(&v0);
if (*(5243000)(a0[1], &v0, &v0, *(5243000))) {
v2 = -1;
} else {
a0[4] = *(&v0);
v2 = 0;
}
}
return v2;
}
|
static int
compare_random (char *__restrict__ texta, size_t lena,
char *__restrict__ textb, size_t lenb)
{
int xfrm_diff = 0;
char stackbuf[4000];
char *buf = stackbuf;
size_t bufsize = sizeof stackbuf;
void *allocated =
((void *)0)
;
uint32_t dig[2][16 / sizeof (uint32_t)];
struct md5_ctx s[2];
s[0] = s[1] = random_md5_state;
if (hard_LC_COLLATE)
{
char const *lima = texta + lena;
char const *limb = textb + lenb;
while (
1
)
{
size_t guess_bufsize = 3 * (lena + lenb) + 2;
if (bufsize < guess_bufsize)
{
bufsize =
(((
guess_bufsize
)>(
bufsize * 3 / 2
))?(
guess_bufsize
):(
bufsize * 3 / 2
))
;
free (allocated);
buf = allocated = malloc (bufsize);
if (! buf)
{
buf = stackbuf;
bufsize = sizeof stackbuf;
}
}
size_t sizea =
(texta < lima ? xstrxfrm (buf, texta, bufsize) + 1 : 0);
_Bool
a_fits = sizea <= bufsize;
size_t sizeb =
(textb < limb
? (xstrxfrm ((a_fits ? buf + sizea :
((void *)0)
), textb,
(a_fits ? bufsize - sizea : 0))
+ 1)
: 0);
if (! (a_fits && sizea + sizeb <= bufsize))
{
bufsize = sizea + sizeb;
if (bufsize <
(18446744073709551615UL)
/ 3)
bufsize = bufsize * 3 / 2;
free (allocated);
buf = allocated = xmalloc (bufsize);
if (texta < lima)
strxfrm (buf, texta, sizea);
if (textb < limb)
strxfrm (buf + sizea, textb, sizeb);
}
if (texta < lima)
texta += strlen (texta) + 1;
if (textb < limb)
textb += strlen (textb) + 1;
if (! (texta < lima || textb < limb))
{
lena = sizea; texta = buf;
lenb = sizeb; textb = buf + sizea;
break;
}
md5_process_bytes (buf, sizea, &s[0]);
md5_process_bytes (buf + sizea, sizeb, &s[1]);
if (! xfrm_diff)
{
xfrm_diff = memcmp (buf, buf + sizea,
(((
sizea
)<(
sizeb
))?(
sizea
):(
sizeb
))
);
if (! xfrm_diff)
xfrm_diff = (sizea > sizeb) - (sizea < sizeb);
}
}
}
md5_process_bytes (texta, lena, &s[0]); md5_finish_ctx (&s[0], dig[0]);
md5_process_bytes (textb, lenb, &s[1]); md5_finish_ctx (&s[1], dig[1]);
int diff = memcmp (dig[0], dig[1], sizeof dig[0]);
if (! diff)
{
if (! xfrm_diff)
{
xfrm_diff = memcmp (texta, textb,
(((
lena
)<(
lenb
))?(
lena
):(
lenb
))
);
if (! xfrm_diff)
xfrm_diff = (lena > lenb) - (lena < lenb);
}
diff = xfrm_diff;
}
free (allocated);
return diff;
}
| long compare_random(char *a1, size_t a2, char *a3, size_t a4)
{
unsigned long v4;
size_t v5;
size_t v6;
char *v7;
size_t v8;
size_t v9;
size_t v10;
size_t v12;
char *s;
size_t v14;
char *src;
bool v16;
int v17;
unsigned int v18;
char *dest;
unsigned long size;
void *ptr;
char *v22;
char *v23;
size_t v24;
size_t n;
size_t v26;
char s1[16];
_BYTE v28[16];
long v29[2];
__int128 v30;
long v31;
long v32;
long v33;
long v34;
long v35;
long v36;
long v37;
int v38;
long v39[2];
__int128 v40;
long v41;
long v42;
long v43;
long v44;
long v45;
long v46;
long v47;
int v48;
char v49[4008];
unsigned long v50;
src = a1;
v14 = a2;
s = a3;
v12 = a4;
v50 = __readfsqword(0x28u);
v17 = 0;
dest = v49;
size = 4000LL;
ptr = 0LL;
v39[0] = random_md5_state;
v39[1] = qword_B888;
v40 = xmmword_B890;
v41 = qword_B8A0;
v42 = qword_B8A8;
v43 = qword_B8B0;
v44 = qword_B8B8;
v45 = qword_B8C0;
v46 = qword_B8C8;
v47 = qword_B8D0;
v48 = dword_B8D8;
v29[0] = random_md5_state;
v29[1] = qword_B888;
v30 = xmmword_B890;
v31 = qword_B8A0;
v32 = qword_B8A8;
v33 = qword_B8B0;
v34 = qword_B8B8;
v35 = qword_B8C0;
v36 = qword_B8C8;
v37 = qword_B8D0;
v38 = dword_B8D8;
if ( hard_LC_COLLATE )
{
v22 = &a1[a2];
v23 = &a3[a4];
while ( 1 )
{
v24 = 3 * (v12 + a2) + 2;
if ( size < v24 )
{
v4 = (3 * size) >> 1;
if ( v24 >= v4 )
v4 = 3 * (v12 + a2) + 2;
size = v4;
free(ptr);
ptr = malloc(size);
dest = (char *)ptr;
if ( !ptr )
{
dest = v49;
size = 4000LL;
}
}
if ( src >= v22 )
v5 = 0LL;
else
v5 = xstrxfrm(dest, src, size) + 1;
n = v5;
v16 = v5 <= size;
if ( s >= v23 )
{
v8 = 0LL;
}
else
{
if ( v5 > size )
v6 = 0LL;
else
v6 = size - v5;
if ( v16 )
v7 = &dest[n];
else
v7 = 0LL;
v8 = xstrxfrm(v7, s, v6) + 1;
}
v26 = v8;
if ( !v16 || size < n + v8 )
{
size = n + v8;
if ( n + v8 <= 0x5555555555555554LL )
size = (3 * size) >> 1;
free(ptr);
ptr = (void *)xmalloc(size);
dest = (char *)ptr;
if ( src < v22 )
strxfrm((char *)ptr, src, n);
if ( s < v23 )
strxfrm((char *)ptr + n, s, v26);
}
if ( src < v22 )
src += strlen(src) + 1;
if ( s < v23 )
s += strlen(s) + 1;
if ( src >= v22 && s >= v23 )
break;
md5_process_bytes(dest, n, v29);
md5_process_bytes(&dest[n], v26, v39);
if ( !v17 )
{
v9 = n;
if ( v26 <= n )
v9 = v26;
v17 = memcmp(dest, &dest[n], v9);
if ( !v17 )
v17 = (n > v26) - (n < v26);
}
}
v14 = n;
src = dest;
v12 = v26;
s = &dest[n];
md5_process_bytes(dest, n, v29);
}
else
{
md5_process_bytes(a1, a2, v29);
}
md5_finish_ctx(v29, s1);
md5_process_bytes(s, v12, v39);
md5_finish_ctx(v39, v28);
v18 = memcmp(s1, v28, 0x10uLL);
if ( !v18 )
{
if ( !v17 )
{
v10 = v14;
if ( v12 <= v14 )
v10 = v12;
v17 = memcmp(src, s, v10);
if ( !v17 )
v17 = (v14 > v12) - (v14 < v12);
}
v18 = v17;
}
free(ptr);
return v18;
}
|
void
termsig_sighandler (sig)
int sig;
{
if (
sig !=
1
&&
sig !=
2
&&
sig !=
13
&&
sig !=
14
&&
sig !=
15
&&
sig !=
24
&&
sig !=
25
&&
sig !=
26
&&
sig !=
10
&&
sig !=
12
&&
sig == terminating_signal)
terminate_immediately = 1;
terminating_signal = sig;
if (terminate_immediately)
{
if (interactive_shell == 0 || interactive == 0 || (sig !=
1
&& sig !=
15
) || no_line_editing || ((rl_readline_state & (0x0000008)) == 0))
history_lines_this_session = 0;
terminate_immediately = 0;
termsig_handler (sig);
}
if ((rl_readline_state & (0x0008000)) || (rl_readline_state & (0x0000004)))
bashline_set_event_hook ();
return;
}
| long long termsig_sighandler(unsigned long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v1;
switch (a0) {
case 1: case 2: case 10: case 12: case 13: case 14: case 15: case 24: case 25: case 26:
break;
default:
if (a0 == terminating_signal) {
terminate_immediately = 1;
break;
}
}
terminating_signal = a0;
if (terminate_immediately) {
if (!interactive_shell) {
history_lines_this_session = 0;
} else if (!interactive) {
history_lines_this_session = 0;
} else {
switch (a0) {
case 1: case 15:
if (no_line_editing || !(rl_readline_state & 8))
goto LABEL_4008b8;
else
goto LABEL_4008c2;
default:
LABEL_4008b8:
history_lines_this_session = 0;
break;
}
}
LABEL_4008c2:
terminate_immediately = 0;
termsig_handler(a0, a1, a2, a3, a4, a5);
}
if (!(rl_readline_state & 0x8000)) {
v1 = rl_readline_state & 4;
if (!(rl_readline_state & 4))
return v1;
}
v1 = bashline_set_event_hook();
return v1;
}
|
void
_rl_ttymsg (const char *format, ...)
{
va_list args;
__builtin_va_start(
args
,
format
)
;
fprintf (
stderr
, "readline: ");
vfprintf (
stderr
, format, args);
fprintf (
stderr
, "\n");
fflush (
stderr
);
__builtin_va_end(
args
)
;
rl_forced_update_display ();
}
| long long _rl_ttymsg() {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned long v3;
unsigned long v4;
char v5;
unsigned long v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
unsigned long v19;
unsigned long v20;
unsigned long v21;
unsigned long long v22;
unsigned long long v23;
unsigned long long v24;
char v25;
int v26;
int v27;
int v28;
int v29;
int v30;
int v31;
int v32;
int v33;
unsigned long long *v34;
char *v35;
v6 = v20;
v7 = v21;
v8 = v22;
v9 = v23;
v10 = v24;
if (v25) {
v11 = v26;
v12 = v27;
v13 = v28;
v14 = v29;
v15 = v30;
v16 = v31;
v17 = v32;
v18 = v33;
}
v4 = v34[5];
v0 = 8;
v1 = 48;
v2 = &v19;
v3 = &v5;
fprintf(stderr, "readline: ");
vfprintf(stderr, v35, &v0);
fprintf(stderr, "\n");
fflush(stderr);
rl_forced_update_display(v35, "\n", &v0, v22, v23, v24);
if (!(v4 ^ v34[5]))
return 0;
__stack_chk_fail();
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.