input
stringlengths
28
169k
output
stringlengths
20
317k
void __attribute__((visibility ("hidden"))) _tr_flush_bits(s) deflate_state *s; { bi_flush(s); }
long long _tr_flush_bits(unsigned long long a0) { return bi_flush(a0); }
static int monitor_read(struct ssh *ssh, struct monitor *pmonitor, struct mon_table *ent, struct mon_table **pent) { struct sshbuf *m; int r, ret; u_char type; struct pollfd pfd[2]; for (;;) { memset(&pfd, 0, sizeof(pfd)); pfd[0].fd = pmonitor->m_sendfd; pfd[0].events = 0x001 ; pfd[1].fd = pmonitor->m_log_recvfd; pfd[1].events = pfd[1].fd == -1 ? 0 : 0x001 ; if (poll(pfd, pfd[1].fd == -1 ? 1 : 2, -1) == -1) { if ( (*__errno_location ()) == 4 || (*__errno_location ()) == 11 ) continue; sshfatal("monitor.c", __func__, 484, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "poll: %s", strerror( (*__errno_location ()) )); } if (pfd[1].revents) { monitor_read_log(pmonitor); continue; } if (pfd[0].revents) break; } if ((m = sshbuf_new()) == ((void *)0) ) sshfatal("monitor.c", __func__, 499, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new"); mm_request_receive(pmonitor->m_sendfd, m); if ((r = sshbuf_get_u8(m, &type)) != 0) sshfatal("monitor.c", __func__, 503, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse type"); sshlog("monitor.c", __func__, 505, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "checking request %d", type); while (ent->f != ((void *)0) ) { if (ent->type == type) break; ent++; } if (ent->f != ((void *)0) ) { if (!(ent->flags & 0x1000)) sshfatal("monitor.c", __func__, 515, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "unpermitted request %d", type); ret = (*ent->f)(ssh, pmonitor->m_sendfd, m); sshbuf_free(m); if (ent->flags & 0x0010) { sshlog("monitor.c", __func__, 521, 1, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "%d used once, disabling now", type); ent->flags &= ~0x1000; } if (pent != ((void *)0) ) *pent = ent; return ret; } sshfatal("monitor.c", __func__, 531, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "unsupported request: %d", type); return (-1); }
long monitor_read(long a1, long a2, long a3, _QWORD *a4) { nfds_t v4; int *v5; char *v6; long v7; int v8; unsigned char v12; unsigned int u8; unsigned int v14; long v15; struct pollfd s[4]; s[3] = (struct pollfd)__readfsqword(0x28u); do { while ( 1 ) { while ( 1 ) { memset(s, 0, 0x10uLL); s[0].fd = *(_DWORD *)(a2 + 4); s[0].events = 1; s[1].fd = *(_DWORD *)(a2 + 8); s[1].events = s[1].fd != -1; v4 = s[1].fd == -1 ? 1LL : 2LL; if ( poll(s, v4, -1) != -1 ) break; if ( *_errno_location() != 4 && *_errno_location() != 11 ) { v5 = _errno_location(); v6 = strerror(*v5); sshfatal("monitor.c", "monitor_read", 484LL, 1LL, 1LL, 0LL, "poll: %s", v6); break; } } if ( !s[1].revents ) break; monitor_read_log(a2); } } while ( !s[0].revents ); v15 = sshbuf_new(); if ( !v15 ) sshfatal("monitor.c", "monitor_read", 499LL, 1LL, 1LL, 0LL, "sshbuf_new"); mm_request_receive(*(unsigned int *)(a2 + 4), v15); u8 = sshbuf_get_u8(v15, &v12); if ( u8 ) { v7 = ssh_err(u8); sshfatal("monitor.c", "monitor_read", 503LL, 1LL, 1LL, v7, "parse type"); } sshlog("monitor.c", "monitor_read", 505LL, 1LL, 7LL, 0LL, "checking request %d", v12); while ( *(_QWORD *)(a3 + 8) && *(_DWORD *)a3 != v12 ) a3 += 16LL; if ( !*(_QWORD *)(a3 + 8) ) sshfatal("monitor.c", "monitor_read", 531LL, 1LL, 1LL, 0LL, "unsupported request: %d", v12); if ( (*(_DWORD *)(a3 + 4) & 0x1000) == 0 ) sshfatal("monitor.c", "monitor_read", 515LL, 1LL, 1LL, 0LL, "unpermitted request %d", v12); v14 = (*(long ( **)(long, _QWORD, long))(a3 + 8))(a1, *(unsigned int *)(a2 + 4), v15); sshbuf_free(v15); if ( (*(_DWORD *)(a3 + 4) & 0x10) != 0 ) { sshlog("monitor.c", "monitor_read", 521LL, 1LL, 6LL, 0LL, "%d used once, disabling now", v12); v8 = *(_DWORD *)(a3 + 4); BYTE1(v8) &= ~0x10u; *(_DWORD *)(a3 + 4) = v8; } if ( a4 ) *a4 = a3; return v14; }
static const char *validate_to_str(__u8 validate) { if (validate >= (sizeof(validate_str) / sizeof((validate_str)[0]))) return "(unknown)"; return validate_str[validate]; }
const char * validate_to_str(unsigned char a1) { if ( a1 <= 2u ) return validate_str[a1]; else return "(unknown)"; }
struct var *setvar(const char *name, const char *val, int flags) { char *p, *q; size_t namelen; char *nameeq; size_t vallen; struct var *vp; q = endofname(name); p = strchrnul(q, '='); namelen = p - name; if (!namelen || p != q) sh_error("%.*s: bad variable name", namelen, name); vallen = 0; if (val == ((void *)0) ) { flags |= 0x20; } else { vallen = strlen(val); } ({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; }); p = mempcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen); if (val) { *p++ = '='; p = mempcpy(p, val, vallen); } *p = '\0'; vp = setvareq(nameeq, flags | 0x100); ({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; }); return vp; }
int setvar(void* a0, void* a1, unsigned long a2) { unsigned int v0; int tmp_11; int tmp_19; void* v1; char *v2; void* v3; char *v4; unsigned long v5; void* v6; unsigned long v7; unsigned long v9; v1 = a1; v0 = a2; v4 = endofname(a0); v2 = strchrnul(v4, 0x3d); v5 = v2 - a0; if (v5 && v2 == v4) goto LABEL_400153; sh_error("%.*s: bad variable name", v5, a0); LABEL_400153: v3 = 0; if (!v1) v0 |= 32; else v3 = strlen(v1); suppressint = suppressint + 1; v6 = ckmalloc(v3 + v5 + 2); v2 = mempcpy(v6, a0, v5); if (v1) { tmp_11 = v2; v2 += 1; *(tmp_11) = 61; v2 = mempcpy(v2, v1, v3); } *(v2) = 0; v9 = v0; *(&v9) = (v0 >> 8) | 1; tmp_19 = v9; v7 = setvareq(v6, tmp_19); suppressint = suppressint - 1; if (!suppressint && intpending) onint(); return v7; }
static int bond_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { __u8 mode, use_carrier, primary_reselect, fail_over_mac; __u8 xmit_hash_policy, num_peer_notif, all_slaves_active; __u8 lacp_active, lacp_rate, ad_select, tlb_dynamic_lb; __u16 ad_user_port_key, ad_actor_sys_prio; __u32 miimon, updelay, downdelay, peer_notify_delay, arp_interval, arp_validate; __u32 arp_all_targets, resend_igmp, min_links, lp_interval; __u32 packets_per_slave; __u8 missed_max; unsigned int ifindex; while (argc > 0) { if (matches(*argv, "mode") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(mode_tbl, *argv) < 0) invarg("invalid mode", *argv); mode = get_index(mode_tbl, *argv); addattr8(n, 1024, IFLA_BOND_MODE, mode); } else if (matches(*argv, "active_slave") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); ifindex = ll_name_to_index(*argv); if (!ifindex) return nodev(*argv); addattr32(n, 1024, IFLA_BOND_ACTIVE_SLAVE, ifindex); } else if (matches(*argv, "clear_active_slave") == 0) { addattr32(n, 1024, IFLA_BOND_ACTIVE_SLAVE, 0); } else if (matches(*argv, "miimon") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&miimon, *argv, 0)) invarg("invalid miimon", *argv); addattr32(n, 1024, IFLA_BOND_MIIMON, miimon); } else if (matches(*argv, "updelay") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&updelay, *argv, 0)) invarg("invalid updelay", *argv); addattr32(n, 1024, IFLA_BOND_UPDELAY, updelay); } else if (matches(*argv, "downdelay") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&downdelay, *argv, 0)) invarg("invalid downdelay", *argv); addattr32(n, 1024, IFLA_BOND_DOWNDELAY, downdelay); } else if (matches(*argv, "peer_notify_delay") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&peer_notify_delay, *argv, 0)) invarg("invalid peer_notify_delay", *argv); addattr32(n, 1024, IFLA_BOND_PEER_NOTIF_DELAY, peer_notify_delay); } else if (matches(*argv, "use_carrier") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&use_carrier, *argv, 0)) invarg("invalid use_carrier", *argv); addattr8(n, 1024, IFLA_BOND_USE_CARRIER, use_carrier); } else if (matches(*argv, "arp_interval") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&arp_interval, *argv, 0)) invarg("invalid arp_interval", *argv); addattr32(n, 1024, IFLA_BOND_ARP_INTERVAL, arp_interval); } else if (matches(*argv, "arp_ip_target") == 0) { struct rtattr *nest = addattr_nest(n, 1024, IFLA_BOND_ARP_IP_TARGET); if ((argc - 1 > 0)) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); char *targets = (__extension__ ({ const char *__old = ( *argv ); size_t __len = strlen (__old) + 1; char *__new = (char *) __builtin_alloca (__len); (char *) memcpy (__new, __old, __len); })) ; char *target = strtok(targets, ","); int i; for (i = 0; target && i < 16; i++) { __u32 addr = get_addr32(target); addattr32(n, 1024, i, addr); target = strtok( ((void *)0) , ","); } addattr_nest_end(n, nest); } addattr_nest_end(n, nest); } else if (strcmp(*argv, "ns_ip6_target") == 0) { struct rtattr *nest = addattr_nest(n, 1024, IFLA_BOND_NS_IP6_TARGET); if ((argc - 1 > 0)) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); char *targets = (__extension__ ({ const char *__old = ( *argv ); size_t __len = strlen (__old) + 1; char *__new = (char *) __builtin_alloca (__len); (char *) memcpy (__new, __old, __len); })) ; char *target = strtok(targets, ","); int i; for (i = 0; target && i < 16; i++) { inet_prefix ip6_addr; get_addr(&ip6_addr, target, 10 ); addattr_l(n, 1024, i, ip6_addr.data, sizeof(struct in6_addr)); target = strtok( ((void *)0) , ","); } addattr_nest_end(n, nest); } addattr_nest_end(n, nest); } else if (matches(*argv, "arp_validate") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(arp_validate_tbl, *argv) < 0) invarg("invalid arp_validate", *argv); arp_validate = get_index(arp_validate_tbl, *argv); addattr32(n, 1024, IFLA_BOND_ARP_VALIDATE, arp_validate); } else if (matches(*argv, "arp_all_targets") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(arp_all_targets_tbl, *argv) < 0) invarg("invalid arp_all_targets", *argv); arp_all_targets = get_index(arp_all_targets_tbl, *argv); addattr32(n, 1024, IFLA_BOND_ARP_ALL_TARGETS, arp_all_targets); } else if (strcmp(*argv, "arp_missed_max") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&missed_max, *argv, 0)) invarg("invalid arp_missed_max", *argv); addattr8(n, 1024, IFLA_BOND_MISSED_MAX, missed_max); } else if (matches(*argv, "primary") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); ifindex = ll_name_to_index(*argv); if (!ifindex) return nodev(*argv); addattr32(n, 1024, IFLA_BOND_PRIMARY, ifindex); } else if (matches(*argv, "primary_reselect") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(primary_reselect_tbl, *argv) < 0) invarg("invalid primary_reselect", *argv); primary_reselect = get_index(primary_reselect_tbl, *argv); addattr8(n, 1024, IFLA_BOND_PRIMARY_RESELECT, primary_reselect); } else if (matches(*argv, "fail_over_mac") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(fail_over_mac_tbl, *argv) < 0) invarg("invalid fail_over_mac", *argv); fail_over_mac = get_index(fail_over_mac_tbl, *argv); addattr8(n, 1024, IFLA_BOND_FAIL_OVER_MAC, fail_over_mac); } else if (matches(*argv, "xmit_hash_policy") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(xmit_hash_policy_tbl, *argv) < 0) invarg("invalid xmit_hash_policy", *argv); xmit_hash_policy = get_index(xmit_hash_policy_tbl, *argv); addattr8(n, 1024, IFLA_BOND_XMIT_HASH_POLICY, xmit_hash_policy); } else if (matches(*argv, "resend_igmp") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&resend_igmp, *argv, 0)) invarg("invalid resend_igmp", *argv); addattr32(n, 1024, IFLA_BOND_RESEND_IGMP, resend_igmp); } else if (matches(*argv, "num_grat_arp") == 0 || matches(*argv, "num_unsol_na") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&num_peer_notif, *argv, 0)) invarg("invalid num_grat_arp|num_unsol_na", *argv); addattr8(n, 1024, IFLA_BOND_NUM_PEER_NOTIF, num_peer_notif); } else if (matches(*argv, "all_slaves_active") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&all_slaves_active, *argv, 0)) invarg("invalid all_slaves_active", *argv); addattr8(n, 1024, IFLA_BOND_ALL_SLAVES_ACTIVE, all_slaves_active); } else if (matches(*argv, "min_links") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&min_links, *argv, 0)) invarg("invalid min_links", *argv); addattr32(n, 1024, IFLA_BOND_MIN_LINKS, min_links); } else if (matches(*argv, "lp_interval") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&lp_interval, *argv, 0)) invarg("invalid lp_interval", *argv); addattr32(n, 1024, IFLA_BOND_LP_INTERVAL, lp_interval); } else if (matches(*argv, "packets_per_slave") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u32(&packets_per_slave, *argv, 0)) invarg("invalid packets_per_slave", *argv); addattr32(n, 1024, IFLA_BOND_PACKETS_PER_SLAVE, packets_per_slave); } else if (matches(*argv, "lacp_rate") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(lacp_rate_tbl, *argv) < 0) invarg("invalid lacp_rate", *argv); lacp_rate = get_index(lacp_rate_tbl, *argv); addattr8(n, 1024, IFLA_BOND_AD_LACP_RATE, lacp_rate); } else if (strcmp(*argv, "lacp_active") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(lacp_active_tbl, *argv) < 0) invarg("invalid lacp_active", *argv); lacp_active = get_index(lacp_active_tbl, *argv); addattr8(n, 1024, IFLA_BOND_AD_LACP_ACTIVE, lacp_active); } else if (matches(*argv, "ad_select") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_index(ad_select_tbl, *argv) < 0) invarg("invalid ad_select", *argv); ad_select = get_index(ad_select_tbl, *argv); addattr8(n, 1024, IFLA_BOND_AD_SELECT, ad_select); } else if (matches(*argv, "ad_user_port_key") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&ad_user_port_key, *argv, 0)) invarg("invalid ad_user_port_key", *argv); addattr16(n, 1024, IFLA_BOND_AD_USER_PORT_KEY, ad_user_port_key); } else if (matches(*argv, "ad_actor_sys_prio") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u16(&ad_actor_sys_prio, *argv, 0)) invarg("invalid ad_actor_sys_prio", *argv); addattr16(n, 1024, IFLA_BOND_AD_ACTOR_SYS_PRIO, ad_actor_sys_prio); } else if (matches(*argv, "ad_actor_system") == 0) { int len; char abuf[32]; do { argv++; if (--argc <= 0) incomplete_command(); } while(0); len = ll_addr_a2n(abuf, sizeof(abuf), *argv); if (len < 0) return -1; addattr_l(n, 1024, IFLA_BOND_AD_ACTOR_SYSTEM, abuf, len); } else if (matches(*argv, "tlb_dynamic_lb") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); if (get_u8(&tlb_dynamic_lb, *argv, 0)) { invarg("invalid tlb_dynamic_lb", *argv); return -1; } addattr8(n, 1024, IFLA_BOND_TLB_DYNAMIC_LB, tlb_dynamic_lb); } else if (matches(*argv, "help") == 0) { explain(); return -1; } else { fprintf( stderr , "bond: unknown command \"%s\"?\n", *argv); explain(); return -1; } argc--, argv++; } return 0; }
long bond_parse_opt(long a1, int a2, const char **a3, long a4) { size_t v5; unsigned long v6; void *v7; size_t v8; unsigned long v9; void *v10; long v11; const char **v12; int v13; long v14; unsigned char v15; unsigned char v16; unsigned char v17; unsigned char v18; unsigned char v19; unsigned char v20; unsigned char v21; unsigned char v22; unsigned char v23; unsigned char v24; unsigned char v25; unsigned char index; unsigned short v27; unsigned short v28; unsigned int v29; unsigned int v30; unsigned int v31; unsigned int v32; unsigned int v33; unsigned int v34; unsigned int v35; unsigned int v36; unsigned int v37; unsigned int i; unsigned int j; unsigned int v40; unsigned int v41; unsigned int v42; unsigned int v43; unsigned int addr32; char *v45; char *v46; long v47; char *v48; size_t v49; void *v50; char *v51; long v52; char *s; size_t n; void *dest; char *v56; char v57[8]; long v58; char v59[40]; unsigned long v60; v14 = a1; v13 = a2; v12 = a3; v11 = a4; v60 = __readfsqword(0x28u); while ( 1 ) { if ( v13 <= 0 ) return 0LL; if ( (unsigned char)matches(*v12, "mode") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)mode_tbl, *v12) < 0 ) invarg("invalid mode", *v12); index = get_index((long)mode_tbl, *v12); addattr8(v11, 1024LL, 1LL, index); goto LABEL_203; } if ( (unsigned char)matches(*v12, "active_slave") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); v41 = ll_name_to_index(*v12); if ( !v41 ) return nodev(*v12); addattr32(v11, 1024LL, 2LL, v41); goto LABEL_203; } if ( (unsigned char)matches(*v12, "clear_active_slave") != 1 ) { addattr32(v11, 1024LL, 2LL, 0LL); goto LABEL_203; } if ( (unsigned char)matches(*v12, "miimon") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v29, *v12, 0LL) ) invarg("invalid miimon", *v12); addattr32(v11, 1024LL, 3LL, v29); goto LABEL_203; } if ( (unsigned char)matches(*v12, "updelay") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v30, *v12, 0LL) ) invarg("invalid updelay", *v12); addattr32(v11, 1024LL, 4LL, v30); goto LABEL_203; } if ( (unsigned char)matches(*v12, "downdelay") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v31, *v12, 0LL) ) invarg("invalid downdelay", *v12); addattr32(v11, 1024LL, 5LL, v31); goto LABEL_203; } if ( (unsigned char)matches(*v12, "peer_notify_delay") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v32, *v12, 0LL) ) invarg("invalid peer_notify_delay", *v12); addattr32(v11, 1024LL, 28LL, v32); goto LABEL_203; } if ( (unsigned char)matches(*v12, "use_carrier") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u8(&v15, *v12, 0LL) ) invarg("invalid use_carrier", *v12); addattr8(v11, 1024LL, 6LL, v15); goto LABEL_203; } if ( (unsigned char)matches(*v12, "arp_interval") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v33, *v12, 0LL) ) invarg("invalid arp_interval", *v12); addattr32(v11, 1024LL, 7LL, v33); goto LABEL_203; } if ( (unsigned char)matches(*v12, "arp_ip_target") != 1 ) { v52 = addattr_nest(v11, 1024LL, 8LL); if ( v13 > 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); s = (char *)*v12; v5 = strlen(s); n = v5 + 1; v6 = 16 * ((v5 + 24) / 0x10); while ( &v11 != (long *)((char *)&v11 - (v6 & 0xFFFFFFFFFFFFF000LL)) ) ; v7 = alloca(v6 & 0xFFF); if ( (v6 & 0xFFF) != 0 ) *(long *)((char *)&v11 + (v6 & 0xFFF) - 8) = *(long *)((char *)&v11 + (v6 & 0xFFF) - 8); dest = &v11; v56 = (char *)memcpy(&v11, s, n); v45 = strtok(v56, ","); for ( i = 0; v45 && (int)i <= 15; ++i ) { addr32 = get_addr32(v45); addattr32(v11, 1024LL, i, addr32); v45 = strtok(0LL, ","); } addattr_nest_end(v11, v52); } addattr_nest_end(v11, v52); goto LABEL_203; } if ( !strcmp(*v12, "ns_ip6_target") ) { v47 = addattr_nest(v11, 1024LL, 31LL); if ( v13 > 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); v48 = (char *)*v12; v8 = strlen(v48); v49 = v8 + 1; v9 = 16 * ((v8 + 24) / 0x10); while ( &v11 != (long *)((char *)&v11 - (v9 & 0xFFFFFFFFFFFFF000LL)) ) ; v10 = alloca(v9 & 0xFFF); if ( (v9 & 0xFFF) != 0 ) *(long *)((char *)&v11 + (v9 & 0xFFF) - 8) = *(long *)((char *)&v11 + (v9 & 0xFFF) - 8); v50 = &v11; v51 = (char *)memcpy(&v11, v48, v49); v46 = strtok(v51, ","); for ( j = 0; v46 && (int)j <= 15; ++j ) { get_addr(v57, v46, 10LL); addattr_l(v11, 1024LL, j, &v58, 16LL); v46 = strtok(0LL, ","); } addattr_nest_end(v11, v47); } addattr_nest_end(v11, v47); goto LABEL_203; } if ( (unsigned char)matches(*v12, "arp_validate") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)arp_validate_tbl, *v12) < 0 ) invarg("invalid arp_validate", *v12); v43 = get_index((long)arp_validate_tbl, *v12); addattr32(v11, 1024LL, 9LL, v43); goto LABEL_203; } if ( (unsigned char)matches(*v12, "arp_all_targets") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)arp_all_targets_tbl, *v12) < 0 ) invarg("invalid arp_all_targets", *v12); v42 = get_index((long)arp_all_targets_tbl, *v12); addattr32(v11, 1024LL, 10LL, v42); goto LABEL_203; } if ( !strcmp(*v12, "arp_missed_max") ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u8(&v19, *v12, 0LL) ) invarg("invalid arp_missed_max", *v12); addattr8(v11, 1024LL, 30LL, v19); goto LABEL_203; } if ( (unsigned char)matches(*v12, "primary") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); v41 = ll_name_to_index(*v12); if ( !v41 ) return nodev(*v12); addattr32(v11, 1024LL, 11LL, v41); goto LABEL_203; } if ( (unsigned char)matches(*v12, "primary_reselect") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)primary_reselect_tbl, *v12) < 0 ) invarg("invalid primary_reselect", *v12); v25 = get_index((long)primary_reselect_tbl, *v12); addattr8(v11, 1024LL, 12LL, v25); goto LABEL_203; } if ( (unsigned char)matches(*v12, "fail_over_mac") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)fail_over_mac_tbl, *v12) < 0 ) invarg("invalid fail_over_mac", *v12); v24 = get_index((long)fail_over_mac_tbl, *v12); addattr8(v11, 1024LL, 13LL, v24); goto LABEL_203; } if ( (unsigned char)matches(*v12, "xmit_hash_policy") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)xmit_hash_policy_tbl, *v12) < 0 ) invarg("invalid xmit_hash_policy", *v12); v23 = get_index((long)xmit_hash_policy_tbl, *v12); addattr8(v11, 1024LL, 14LL, v23); goto LABEL_203; } if ( (unsigned char)matches(*v12, "resend_igmp") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v34, *v12, 0LL) ) invarg("invalid resend_igmp", *v12); addattr32(v11, 1024LL, 15LL, v34); goto LABEL_203; } if ( (unsigned char)matches(*v12, "num_grat_arp") != 1 || (unsigned char)matches(*v12, "num_unsol_na") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u8(&v16, *v12, 0LL) ) invarg("invalid num_grat_arp|num_unsol_na", *v12); addattr8(v11, 1024LL, 16LL, v16); goto LABEL_203; } if ( (unsigned char)matches(*v12, "all_slaves_active") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u8(&v17, *v12, 0LL) ) invarg("invalid all_slaves_active", *v12); addattr8(v11, 1024LL, 17LL, v17); goto LABEL_203; } if ( (unsigned char)matches(*v12, "min_links") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v35, *v12, 0LL) ) invarg("invalid min_links", *v12); addattr32(v11, 1024LL, 18LL, v35); goto LABEL_203; } if ( (unsigned char)matches(*v12, "lp_interval") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v36, *v12, 0LL) ) invarg("invalid lp_interval", *v12); addattr32(v11, 1024LL, 19LL, v36); goto LABEL_203; } if ( (unsigned char)matches(*v12, "packets_per_slave") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u32(&v37, *v12, 0LL) ) invarg("invalid packets_per_slave", *v12); addattr32(v11, 1024LL, 20LL, v37); goto LABEL_203; } if ( (unsigned char)matches(*v12, "lacp_rate") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)lacp_rate_tbl, *v12) < 0 ) invarg("invalid lacp_rate", *v12); v22 = get_index((long)lacp_rate_tbl, *v12); addattr8(v11, 1024LL, 21LL, v22); goto LABEL_203; } if ( !strcmp(*v12, "lacp_active") ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)lacp_active_tbl, *v12) < 0 ) invarg("invalid lacp_active", *v12); v21 = get_index((long)lacp_active_tbl, *v12); addattr8(v11, 1024LL, 29LL, v21); goto LABEL_203; } if ( (unsigned char)matches(*v12, "ad_select") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (int)get_index((long)ad_select_tbl, *v12) < 0 ) invarg("invalid ad_select", *v12); v20 = get_index((long)ad_select_tbl, *v12); addattr8(v11, 1024LL, 22LL, v20); goto LABEL_203; } if ( (unsigned char)matches(*v12, "ad_user_port_key") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u16(&v27, *v12, 0LL) ) invarg("invalid ad_user_port_key", *v12); addattr16(v11, 1024LL, 25LL, v27); goto LABEL_203; } if ( (unsigned char)matches(*v12, "ad_actor_sys_prio") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u16(&v28, *v12, 0LL) ) invarg("invalid ad_actor_sys_prio", *v12); addattr16(v11, 1024LL, 24LL, v28); goto LABEL_203; } if ( (unsigned char)matches(*v12, "ad_actor_system") == 1 ) break; ++v12; if ( --v13 <= 0 ) incomplete_command(); v40 = ll_addr_a2n(v59, 32LL, *v12); if ( (v40 & 0x80000000) != 0 ) return 0xFFFFFFFFLL; addattr_l(v11, 1024LL, 26LL, v59, v40); LABEL_203: --v13; ++v12; } if ( (unsigned char)matches(*v12, "tlb_dynamic_lb") != 1 ) { ++v12; if ( --v13 <= 0 ) incomplete_command(); if ( (unsigned int)get_u8(&v18, *v12, 0LL) ) invarg("invalid tlb_dynamic_lb", *v12); addattr8(v11, 1024LL, 27LL, v18); goto LABEL_203; } if ( (unsigned char)matches(*v12, "help") == 1 ) fprintf(stderr, "bond: unknown command \"%s\"?\n", *v12); explain(); return 0xFFFFFFFFLL; }
int unbind_nameref (name) const char *name; { SHELL_VAR *v; v = var_lookup (name, shell_variables); if (v && ((((v)->attributes) & (0x0000800)))) return makunbound (name, shell_variables); return 0; }
undefined8 unbind_nameref(undefined8 param_1) { long lVar1; undefined8 uVar2; lVar1 = var_lookup(param_1,shell_variables); if ((lVar1 == 0) || ((*(uint *)(lVar1 + 0x28) & 0x800) == 0)) { uVar2 = 0; } else { uVar2 = makunbound(param_1,shell_variables); } return uVar2; }
static int do_show(int argc, char **argv) { if (rtnl_linkdump_req_filter_fn(&rth, 0 , tuntap_filter_req) < 0) { perror("Cannot send dump request\n"); return -1; } new_json_obj(json); if (rtnl_dump_filter_nc(&rth, print_tuntap, ((void *)0) , 0) < 0) { fprintf( stderr , "Dump terminated\n"); return -1; } delete_json_obj(); fflush( stdout ); return 0; }
undefined8 do_show(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4, undefined8 param_5,undefined8 param_6) { int iVar1; undefined8 uVar2; iVar1 = rtnl_linkdump_req_filter_fn(&rth,0,tuntap_filter_req); if (iVar1 < 0) { perror("Cannot send dump request\n"); uVar2 = 0xffffffff; } else { new_json_obj(json); iVar1 = rtnl_dump_filter_nc(&rth,print_tuntap,0,0,param_5,param_6,param_2); if (iVar1 < 0) { fprintf(stderr,"Dump terminated\n"); uVar2 = 0xffffffff; } else { delete_json_obj(); fflush(stdout); uVar2 = 0; } } return uVar2; }
static inline void emit_mandatory_arg_note (void) { fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout ) ; }
void emit_mandatory_arg_note(void) { char *__s; FILE *__stream; __stream = stdout; __s = (char *)gettext( "\nMandatory arguments to long options are mandatory for short options too.\n" ); fputs_unlocked(__s,__stream); return; }
static void check_format_conv_type (char *format, int flags) { unsigned char ch = *format; int compatible_flags = FLAG_THOUSANDS; switch (ch) { case 'd': case 'i': break; case 'u': *format = 'd'; break; case 'o': case 'x': case 'X': compatible_flags = FLAG_ALTERNATIVE; break; case 0: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"missing conversion specifier in suffix\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("missing conversion specifier in suffix")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("missing conversion specifier in suffix")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); default: if ( ((*__ctype_b_loc ())[(int) (( ch ))] & (unsigned short int) _ISprint) ) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid conversion specifier in suffix: %c\"), ch), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid conversion specifier in suffix: %c"), ch), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid conversion specifier in suffix: %c"), ch), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; else ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid conversion specifier in suffix: \\\\%.3o\"), ch), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid conversion specifier in suffix: \\%.3o"), ch), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid conversion specifier in suffix: \\%.3o"), ch), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; } if (flags & ~ compatible_flags) ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, gettext (\"invalid flags in conversion specification: %%%c%c\"), (flags & ~ compatible_flags & FLAG_ALTERNATIVE ? '#' : '\\''), ch), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, gettext ("invalid flags in conversion specification: %%%c%c"), (flags & ~ compatible_flags & FLAG_ALTERNATIVE ? '#' : '\''), ch), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, gettext ("invalid flags in conversion specification: %%%c%c"), (flags & ~ compatible_flags & FLAG_ALTERNATIVE ? '#' : '\''), ch), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; }
void check_format_conv_type(unsigned char *a1, int a2) { char *v2; char *v3; char *v4; unsigned int v5; char *v6; unsigned char v7; int v8; v7 = *a1; v8 = 1; if ( !*a1 ) { v2 = gettext("missing conversion specifier in suffix"); error(1, 0, v2); LABEL_8: if ( ((*_ctype_b_loc())[v7] & 0x4000) != 0 ) { v3 = gettext("invalid conversion specifier in suffix: %c"); error(1, 0, v3, v7); } v4 = gettext("invalid conversion specifier in suffix: \\%.3o"); error(1, 0, v4, v7); goto LABEL_11; } if ( *a1 > 0x78u || *a1 < 0x58u ) goto LABEL_8; switch ( *a1 ) { case 'X': case 'o': case 'x': v8 = 2; break; case 'd': case 'i': break; case 'u': *a1 = 100; break; default: goto LABEL_8; } LABEL_11: if ( (a2 & ~v8) != 0 ) { if ( ((unsigned char)a2 & (unsigned char)~(_BYTE)v8 & 2) != 0 ) v5 = 35; else v5 = 39; v6 = gettext("invalid flags in conversion specification: %%%c%c"); error(1, 0, v6, v5, v7); } }
static void get_header (void) { size_t col; alloc_table_row (); for (col = 0; col < ncolumns; col++) { char *cell = ((void *)0) ; char const *header = gettext (columns[col]->caption); if (columns[col]->field == SIZE_FIELD && (header_mode == DEFAULT_MODE || (header_mode == OUTPUT_MODE && !(human_output_opts & human_autoscale)))) { char buf[((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * ( 16 + 1) - 16 + 1 + 3) + 1]; int opts = (human_suppress_point_zero | human_autoscale | human_SI | (human_output_opts & (human_group_digits | human_base_1024 | human_B))); uintmax_t q1000 = output_block_size; uintmax_t q1024 = output_block_size; _Bool divisible_by_1000; _Bool divisible_by_1024; do { divisible_by_1000 = q1000 % 1000 == 0; q1000 /= 1000; divisible_by_1024 = q1024 % 1024 == 0; q1024 /= 1024; } while (divisible_by_1000 & divisible_by_1024); if (divisible_by_1000 < divisible_by_1024) opts |= human_base_1024; if (divisible_by_1024 < divisible_by_1000) opts &= ~human_base_1024; if (! (opts & human_base_1024)) opts |= human_B; char *num = human_readable (output_block_size, buf, opts, 1, 1); header = gettext ("blocks"); if (asprintf (&cell, gettext ("%s-%s"), num, header) == -1) cell = ((void *)0) ; } else if (header_mode == POSIX_MODE && columns[col]->field == SIZE_FIELD) { char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)]; char *num = umaxtostr (output_block_size, buf); if (asprintf (&cell, gettext ("%s-%s"), num, header) == -1) cell = ((void *)0) ; } else cell = strdup (header); if (!cell) xalloc_die (); replace_problematic_chars (cell); table[nrows - 1][col] = cell; size_t cell_width = gnu_mbswidth (cell, 0); columns[col]->width = ((( columns[col]->width )>( cell_width ))?( columns[col]->width ):( cell_width )) ; } }
void get_header() { char v0; char v1; unsigned int v2; void* v3; void* v4; unsigned long long v5; unsigned long long v6; char *v7; unsigned long v8; unsigned long v9; unsigned long long v10; char v11; char v12; unsigned int v14; unsigned long long v17; unsigned long long *v18; unsigned long long v19; alloc_table_row(); v4 = 0; while (true) { if (v4 < ncolumns) { v3 = 0; v7 = gettext(*((*((columns + v4 * 8)) + 24))); if (*(*((columns + (v4 << 3)))) == 2 && (!header_mode || header_mode == 4) && (!header_mode || !(human_output_opts & 16))) { v14 = human_output_opts & 292; *(&v14) = (human_output_opts & 292) | 152; v2 = v14; v5 = *(&output_block_size); v6 = *(&output_block_size); do { v0 = !v5 - ((v5 >> 3) * 2361183241434822607 >> 64 >> 4) * 1000; v5 = (v5 >> 3) * 2361183241434822607 >> 64 >> 4; v1 = !(v6 & 1023); v6 >>= 10; } while ((v1 & v0)); if (v0 < v1) v2 |= 32; if (v1 < v0) v2 &= -33; if (!(v2 & 32)) v2 |= 0x100; v8 = human_readable(*(&output_block_size), &v11, v2, 0x1, 0x1); v7 = gettext("blocks"); if (asprintf(&v3, gettext("%s-%s")) == -1) v3 = 0; } if (*(*((columns + (v4 << 3)))) != 2 || header_mode && header_mode != 4 || header_mode && (human_output_opts & 16)) { if (header_mode == 3 && *(*((columns + (v4 << 3)))) == 2) { v9 = umaxtostr(*(&output_block_size), &v11, &v11); if (asprintf(&v3, gettext("%s-%s")) == -1) v3 = 0; } if (*(*((columns + (v4 << 3)))) != 2 || header_mode != 3) v3 = strdup(v7); } if (!v3) xalloc_die(); replace_problematic_chars(v3); *((v4 * 8 + *((table + nrows * 8 - 8)))) = v3; v10 = gnu_mbswidth(v3, 0x0, v4 * 8 + *((table + nrows * 8 - 8))); v17 = *((*((columns + v4 * 8)) + 32)); if (*((*((columns + (v4 << 3))) + 32)) <= v10) v17 = v10; *((*((columns + v4 * 8)) + 32)) = v17; v4 += 1; } else { v19 = *(&v12) ^ v18[5]; return; } } }
tty_quotemode(EditLine *el) { if (el->el_tty.t_mode == 2) return 0; el->el_tty.t_ts = el->el_tty.t_ed; tty_setup_flags(el, &el->el_tty.t_ts, 2); if (tty_setty(el, 1 , &el->el_tty.t_ts) == -1) { return -1; } el->el_tty.t_mode = 2; return 0; }
long long tty_quotemode(struct_0 *a0) { struct_0 *v0; int tmp_34; int tmp_46; unsigned long long v2; unsigned long long v3; v0 = a0; if (a0->padding_2fc[4] == 2) { v2 = 0; } else { tmp_34 = *((&a0->field_284 + 4)); *(&a0->field_2bc) = *(&(&a0->padding_0)[1]); a0->field_2c0 = tmp_34; tmp_46 = *((&a0->field_294 + 4)); a0->field_2c8 = *((&a0->field_28c + 4)); a0->field_2d0 = tmp_46; v3 = *((&a0->field_2a4 + 4)); a0->field_2d8 = *((&a0->field_29c + 4)); a0->field_2e0 = v3; a0->field_2e8 = *((&a0->field_2ac + 4)); *(&a0->field_2f0) = *((&a0->field_2b4 + 4)); tty_setup_flags(a0, &a0->field_2bc, 0x2); if (tty_setty(a0, 0x1, &a0->field_2bc) == -1) { v2 = 4294967295; } else { a0->padding_2fc[4] = 2; v2 = 0; } } return v2; }
static void parse_cert_times(char *timespec) { char *from, *to; time_t now = time( ((void *)0) ); int64_t secs; if (*timespec == '+' && strchr(timespec, ':') == ((void *)0) ) { if ((secs = convtime(timespec + 1)) == -1) sshfatal("ssh-keygen.c", __func__, 1944, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Invalid relative certificate life %s", timespec); cert_valid_to = now + secs; cert_valid_from = ((now - 59)/ 60) * 60; return; } from = xstrdup(timespec); to = strchr(from, ':'); if (to == ((void *)0) || from == to || *(to + 1) == '\0') sshfatal("ssh-keygen.c", __func__, 1962, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Invalid certificate life specification %s", timespec); *to++ = '\0'; if (*from == '-' || *from == '+') cert_valid_from = parse_relative_time(from, now); else if (strcmp(from, "always") == 0) cert_valid_from = 0; else if (strncmp(from, "0x", 2) == 0) parse_hex_u64(from, &cert_valid_from); else if (parse_absolute_time(from, &cert_valid_from) != 0) sshfatal("ssh-keygen.c", __func__, 1972, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Invalid from time \"%s\"", from); if (*to == '-' || *to == '+') cert_valid_to = parse_relative_time(to, now); else if (strcmp(to, "forever") == 0) cert_valid_to = ~(u_int64_t)0; else if (strncmp(from, "0x", 2) == 0) parse_hex_u64(to, &cert_valid_to); else if (parse_absolute_time(to, &cert_valid_to) != 0) sshfatal("ssh-keygen.c", __func__, 1981, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Invalid to time \"%s\"", to); if (cert_valid_to <= cert_valid_from) sshfatal("ssh-keygen.c", __func__, 1984, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Empty certificate validity interval"); free(from); }
void parse_cert_times(char *a0) { char *v0; int tmp_11; unsigned long v1; unsigned long long v2; char *v3; unsigned long long v4; unsigned long long v5; char v6; unsigned long long v8; unsigned long long v10; v1 = time(NULL); if (*(a0) == 43 && !strchr(a0, 0x3a)) { v2 = convtime(a0 + 1); if (v2 == -1) { v0 = a0; sshfatal("ssh-keygen.c", "parse_cert_times", 0x798, 0x0, 0x1, 0x0, "Invalid relative certificate life %s"); } cert_valid_to = __addvdi3(v1, v2); v8 = __addvdi3(v1, 0xffffffffffffffc5); *(&cert_valid_from) = __mulvdi3(((v8 * 9838263505978427529 >> 64) + v8 >> 5) - (v8 >> 63), 0x3c); return; } v3 = xstrdup(a0); *(&v4) = strchr(v3, 0x3a); if (!v4 || v3 == v4 || !v4[1]) { v0 = a0; sshfatal("ssh-keygen.c", "parse_cert_times", 0x7aa, 0x0, 0x1, 0x0, "Invalid certificate life specification %s"); } tmp_11 = v4; v4 = &v4[1]; *(tmp_11) = 0; switch (*(v3)) { case 43: case 45: cert_valid_from = parse_relative_time(v3, v1); break; default: if (!strcmp(v3, "always")) { cert_valid_from = 0; break; } else if (!strncmp(v3, "0x", 0x2)) { parse_hex_u64(v3, &cert_valid_from); break; } else if (parse_absolute_time(v3, &cert_valid_from)) { v5 = v3; v4 = "Invalid from time \"%s\""; sshfatal("ssh-keygen.c", "parse_cert_times", 0x7b4, 0x0, 0x1, 0x0, *(&v6)); } } switch (*(v4)) { case 43: case 45: cert_valid_to = parse_relative_time(v4, v1); break; default: if (!strcmp(v4, "forever")) { cert_valid_to = -1; break; } else if (!strncmp(v3, "0x", 0x2)) { parse_hex_u64(v4, &cert_valid_to); break; } else if (parse_absolute_time(v4, &cert_valid_to)) { v5 = v4; v4 = "Invalid to time \"%s\""; sshfatal("ssh-keygen.c", "parse_cert_times", 0x7bd, 0x0, 0x1, 0x0, *(&v6)); } } if (cert_valid_to <= cert_valid_from) { v4 = "Empty certificate validity interval"; sshfatal("ssh-keygen.c", "parse_cert_times", 0x7c0, 0x0, 0x1, 0x0, *(&v6)); } v10 = free(v3); return; }
int main(argc, argv) int argc; char **argv; { struct utmp *ut; char prev; int status, runlevel; if (argc > 1) utmpname(argv[1]); setutent(); while ((ut = getutent()) != ((void *)0) ) { if (ut->ut_type == 1 ) { prev = ut->ut_pid / 256; if (prev == 0) prev = 'N'; printf("%c %c\n", prev, ut->ut_pid % 256); endutent(); exit(0); } } endutent(); status = Read_Runlevel_Log(&runlevel); if (status) { printf("N %c\n", runlevel); return 0; } printf("unknown\n"); return(1); }
int main(unsigned long a0, struct_0 *a1) { char v0; char v1; unsigned int v2; struct_1 *v3; unsigned int v6; if (a0 > 1) utmpname(a1->field_8); setutent(); while (true) { v3 = &getutent()->ut_type; if (v3) { if (v3->field_0 != 1) continue; v0 = (v3->field_4 < 0 ? v3->field_4 + 255 : v3->field_4) >> 8; if (!v0) v0 = 78; printf("%c %c\n", v0, v3->field_4 + (v3->field_4 >> 31 >> 24) - (v3->field_4 >> 31 >> 24)); endutent(); exit(0x0); } else { endutent(); v2 = Read_Runlevel_Log(&v1); if (v2) { printf("N %c\n", *(&v1)); v6 = 0; } else { printf("unknown\n"); v6 = 1; } break; } } return v6; }
static wchar_t cval (s, i, l) char *s; int i, l; { size_t tmp; wchar_t wc; mbstate_t mps; if ( (__ctype_get_mb_cur_max ()) == 1 || is_basic (s[i])) return ((wchar_t)s[i]); if (i >= (l - 1)) return ((wchar_t)s[i]); memset (&mps, 0, sizeof (mbstate_t)); tmp = mbrtowc (&wc, s + i, l - i, &mps); if (((tmp) == (size_t)-1 || (tmp) == (size_t)-2) || ((tmp) == 0)) return ((wchar_t)s[i]); return wc; }
long cval(long a1, int a2, int a3) { wchar_t pwc; size_t v6; mbstate_t s[2]; s[1] = (mbstate_t)__readfsqword(0x28u); if ( _ctype_get_mb_cur_max() == 1 || (unsigned int)is_basic(*(_BYTE *)(a2 + a1)) ) return (unsigned int)*(char *)(a2 + a1); if ( a2 >= a3 - 1 ) return (unsigned int)*(char *)(a2 + a1); memset(s, 0, 8uLL); v6 = mbrtowc(&pwc, (const char *)(a2 + a1), a3 - a2, s); if ( v6 == -1LL || v6 == -2LL || !v6 ) return (unsigned int)*(char *)(a2 + a1); else return (unsigned int)pwc; }
int deflateInit_(strm, level, version, stream_size) z_streamp strm; int level; const char *version; int stream_size; { return deflateInit2_(strm, level, 8, 15, 8, 0, version, stream_size); }
void deflateInit_(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined4 param_4) { deflateInit2_(param_1,param_2,8,0xf,8,0,param_3,param_4); return; }
static char get_type_indicator ( _Bool stat_ok, mode_t mode, enum filetype type) { char c; if (stat_ok ? (((( mode )) & 0170000) == (0100000)) : type == normal) { if (stat_ok && indicator_style == classify && (mode & (0100 | (0100 >> 3) | ((0100 >> 3) >> 3)) )) c = '*'; else c = 0; } else { if (stat_ok ? (((( mode )) & 0170000) == (0040000)) : type == directory || type == arg_directory) c = '/'; else if (indicator_style == slash) c = 0; else if (stat_ok ? (((( mode )) & 0170000) == (0120000)) : type == symbolic_link) c = '@'; else if (stat_ok ? (((( mode )) & 0170000) == (0010000)) : type == fifo) c = '|'; else if (stat_ok ? (((( mode )) & 0170000) == (0140000)) : type == sock) c = '='; else if (stat_ok && 0 ) c = '>'; else c = 0; } return c; }
int get_type_indicator(unsigned long a0, unsigned long a1, unsigned long a2) { char v0; char v2; unsigned int v3; if (a0) v2 = (a1 & 0xf000) == 0x8000; else v2 = a2 == 5; if (v2) { if (a0 && *(&indicator_style) == 3 && (a1 & 73)) v0 = 42; if (!a0 || !(a1 & 73) || *(&indicator_style) != 3) v0 = 0; } else { if (a0) { v3 = (a1 & 0xf000) == 0x4000; } else { if (a2 != 3 && a2 != 9) v3 = 0; if (a2 == 9 || a2 == 3) v3 = 1; *(&v3) = v3 & 1; } if (v3) { v0 = 47; } else if (*(&indicator_style) == 1) { v0 = 0; } else { if (a0) *(&v3) = (a1 & 0xf000) == 0xa000; else *(&v3) = a2 == 6; if (v3) { v0 = 64; } else { if (a0) *(&v3) = (a1 & 0xf000) == 0x1000; else *(&v3) = a2 == 1; if (v3) { v0 = 124; } else { if (a0) *(&v3) = (a1 & 0xf000) == 0xc000; else *(&v3) = a2 == 7; if (v3) v0 = 61; else v0 = 0; } } } } return v0; }
static uchar* getDfltTpl(void) { if(loadModConf != ((void *)0) && loadModConf->tplName != ((void *)0) ) return loadModConf->tplName; else if(pszFileDfltTplName == ((void *)0) ) return (uchar*)"RSYSLOG_FileFormat"; else return pszFileDfltTplName; }
const char *getDfltTpl() { if ( loadModConf && *(_QWORD *)(loadModConf + 8) ) return *(const char **)(loadModConf + 8); if ( pszFileDfltTplName ) return (const char *)pszFileDfltTplName; return "RSYSLOG_FileFormat"; }
int ssh_ecdsa_verify(const struct sshkey *key, const u_char *signature, size_t signaturelen, const u_char *data, size_t datalen, u_int compat) { ECDSA_SIG *sig = ((void *)0) ; BIGNUM *sig_r = ((void *)0) , *sig_s = ((void *)0) ; int hash_alg; u_char digest[64]; size_t dlen; int ret = -1; struct sshbuf *b = ((void *)0) , *sigbuf = ((void *)0) ; char *ktype = ((void *)0) ; if (key == ((void *)0) || key->ecdsa == ((void *)0) || sshkey_type_plain(key->type) != KEY_ECDSA || signature == ((void *)0) || signaturelen == 0) return -10; if ((hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1 || (dlen = ssh_digest_bytes(hash_alg)) == 0) return -1; if ((b = sshbuf_from(signature, signaturelen)) == ((void *)0) ) return -2; if (sshbuf_get_cstring(b, &ktype, ((void *)0) ) != 0 || sshbuf_froms(b, &sigbuf) != 0) { ret = -4; goto out; } if (strcmp(sshkey_ssh_name_plain(key), ktype) != 0) { ret = -13; goto out; } if (sshbuf_len(b) != 0) { ret = -23; goto out; } if (sshbuf_get_bignum2(sigbuf, &sig_r) != 0 || sshbuf_get_bignum2(sigbuf, &sig_s) != 0) { ret = -4; goto out; } if ((sig = ECDSA_SIG_new()) == ((void *)0) ) { ret = -2; goto out; } if (!ECDSA_SIG_set0(sig, sig_r, sig_s)) { ret = -22; goto out; } sig_r = sig_s = ((void *)0) ; if (sshbuf_len(sigbuf) != 0) { ret = -23; goto out; } if ((ret = ssh_digest_memory(hash_alg, data, datalen, digest, sizeof(digest))) != 0) goto out; switch (ECDSA_do_verify(digest, dlen, sig, key->ecdsa)) { case 1: ret = 0; break; case 0: ret = -21; goto out; default: ret = -22; goto out; } out: explicit_bzero(digest, sizeof(digest)); sshbuf_free(sigbuf); sshbuf_free(b); ECDSA_SIG_free(sig); BN_clear_free(sig_r); BN_clear_free(sig_s); free(ktype); return ret; }
long long ssh_ecdsa_verify(struct_0 *a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long a5) { unsigned int v0; unsigned int v1; unsigned int v2; void* v3; void* v4; void* v5; void* v6; void* v7; unsigned long long v8; unsigned long long v9; char v10; unsigned long long v12; unsigned long long v13; unsigned long long v14; unsigned long long v15; unsigned long long v18; unsigned long long v19; unsigned long long v22; v0 = a5; v7 = 0; v3 = 0; v4 = 0; v1 = -1; v8 = 0; v5 = 0; v6 = 0; if (a0 && a0->field_20) { v12 = sshkey_type_plain(a0->field_0); if (v12 == 2 && a1 && a2) { v2 = sshkey_ec_nid_to_hash_alg(a0->field_18); if (v2 != -1) { v9 = ssh_digest_bytes(v2); if (v9) { v8 = sshbuf_from(a1, a2, a2); if (!v8) { v13 = 4294967294; } else { v14 = sshbuf_get_cstring(v8, &v6, 0x0, &v6); if (!v14) { v15 = sshbuf_froms(v8, &v5, &v5); if (!v15) { if (strcmp(sshkey_ssh_name_plain(a0), v6)) { v1 = -13; } else if (sshbuf_len(v8)) { v1 = -23; } else { v18 = sshbuf_get_bignum2(v5, &v3, &v3); if (!v18) { v19 = sshbuf_get_bignum2(v5, &v4, &v4); if (!v19) { v7 = ECDSA_SIG_new(); if (!v7) { v1 = -2; } else if (!ECDSA_SIG_set0(v7, v3, v4, v3)) { v1 = -22; } else { v4 = 0; v3 = v4; if (sshbuf_len(v5)) { v1 = -23; } else { v1 = ssh_digest_memory(v2, a3, a4, &v10, 0x40); if (!v1) { v22 = ECDSA_do_verify(&v10, v9, v7, a0->field_20); if (!v22) { v1 = -21; } else if (v22 == 1) { v1 = 0; } else { v1 = -22; } } } } } } if (v19 || v18) v1 = -0x4; } } } if (v15 || v14) v1 = -0x4; explicit_bzero(&v10, 0x40); sshbuf_free(v5); sshbuf_free(v8); ECDSA_SIG_free(v7); BN_clear_free(v3); BN_clear_free(v4); free(v6); v13 = v1; } } } if (v2 == -1 || !v9) v13 = 4294967295; } } if (!a0 || !a0->field_20 || !a2 || !a1 || v12 != 2) v13 = 4294967286; return v13; }
static long parse_number (const char *arg) { char *endptr = ((void *)0) ; (*__errno_location ()) = 0; long result; if (strncmp (arg, "0x", 2) == 0) result = strtol (arg + 2, &endptr, 16); else if (strncmp (arg, "0", 1) == 0 && strspn (arg, "012345678") == strlen (optarg)) result = strtol (arg + 1, &endptr, 8); else result = strtol (arg, &endptr, 10); if ( (*__errno_location ()) != 0 || (endptr && *endptr != '\0')) error ( 1 , (*__errno_location ()) , "'%s' is not a recognizable number.", arg); return result; }
int parse_number(char *a0) { void* v0; unsigned long v1; unsigned long long v3; unsigned long long v4; v0 = 0; *(__errno_location()) = 0; v3 = strncmp(a0, "0x", 0x2); if (!v3) { v1 = strtol(a0 + 2, &v0, 0x10); } else { v3 = strncmp(a0, "0", 0x1); if (!v3) { v4 = strspn(a0, "012345678"); v3 = strlen(*(got.optarg)); if (v4 == v3) v1 = strtol(a0 + 1, &v0, 0x8); } if (v3 || v4 != v3) v1 = strtol(a0, &v0, 0xa); } *(&v3) = *(__errno_location()); if (!v3 && (!*(v0) || !v0)) return v1; if (v3 || *(v0) && v0) error(0x1, *(__errno_location()), "'%s' is not a recognizable number."); }
int _rl_reset_region_color (int which, const char *value) { int len; if (which == 0) { xfree (_rl_active_region_start_color); if (value && *value) { _rl_active_region_start_color = (char *)xmalloc (2 * strlen (value) + 1); rl_translate_keyseq (value, _rl_active_region_start_color, &len); _rl_active_region_start_color[len] = '\0'; } else _rl_active_region_start_color = ((void *)0) ; } else { xfree (_rl_active_region_end_color); if (value && *value) { _rl_active_region_end_color = (char *)xmalloc (2 * strlen (value) + 1); rl_translate_keyseq (value, _rl_active_region_end_color, &len); _rl_active_region_end_color[len] = '\0'; } else _rl_active_region_end_color = ((void *)0) ; } return 0; }
undefined8 _rl_reset_region_color(int param_1,char *param_2) { size_t sVar1; long in_FS_OFFSET; int local_14; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); if (param_1 == 0) { xfree(_rl_active_region_start_color); if ((param_2 == (char *)0x0) || (*param_2 == '\0')) { _rl_active_region_start_color = 0; } else { sVar1 = strlen(param_2); _rl_active_region_start_color = xmalloc(sVar1 * 2 + 1); rl_translate_keyseq(param_2,_rl_active_region_start_color,&local_14); *(undefined *)(local_14 + _rl_active_region_start_color) = 0; } } else { xfree(_rl_active_region_end_color); if ((param_2 == (char *)0x0) || (*param_2 == '\0')) { _rl_active_region_end_color = 0; } else { sVar1 = strlen(param_2); _rl_active_region_end_color = xmalloc(sVar1 * 2 + 1); rl_translate_keyseq(param_2,_rl_active_region_end_color,&local_14); *(undefined *)(local_14 + _rl_active_region_end_color) = 0; } } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return 0; }
static int channel_decode_socks5(Channel *c, struct sshbuf *input, struct sshbuf *output) { struct { u_int8_t version; u_int8_t command; u_int8_t reserved; u_int8_t atyp; } s5_req, s5_rsp; u_int16_t dest_port; char dest_addr[255+1], ntop[ 46 ]; const u_char *p; u_int have, need, i, found, nmethods, addrlen, af; int r; sshlog("channels.c", __func__, 1407, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: decode socks5", c->self); p = sshbuf_ptr(input); if (p[0] != 0x05) return -1; have = sshbuf_len(input); if (!(c->flags & 0x1000)) { if (have < 2) return 0; nmethods = p[1]; if (have < nmethods + 2) return 0; for (found = 0, i = 2; i < nmethods + 2; i++) { if (p[i] == 0x00) { found = 1; break; } } if (!found) { sshlog("channels.c", __func__, 1427, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "channel %d: method SSH_SOCKS5_NOAUTH not found", c->self) ; return -1; } if ((r = sshbuf_consume(input, nmethods + 2)) != 0) sshfatal("channels.c", __func__, 1432, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %d: consume", c->self); if ((r = sshbuf_put_u8(output, 0x05)) != 0 || (r = sshbuf_put_u8(output, 0x00)) != 0) sshfatal("channels.c", __func__, 1436, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %d: append reply", c->self); c->flags |= 0x1000; sshlog("channels.c", __func__, 1438, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: socks5 auth done", c->self); return 0; } sshlog("channels.c", __func__, 1441, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: socks5 post auth", c->self); if (have < sizeof(s5_req)+1) return 0; memcpy(&s5_req, p, sizeof(s5_req)); if (s5_req.version != 0x05 || s5_req.command != 0x01 || s5_req.reserved != 0x00) { sshlog("channels.c", __func__, 1448, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: only socks5 connect supported", c->self); return -1; } switch (s5_req.atyp){ case 0x01: addrlen = 4; af = 2 ; break; case 0x03: addrlen = p[sizeof(s5_req)]; af = -1; break; case 0x04: addrlen = 16; af = 10 ; break; default: sshlog("channels.c", __func__, 1465, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: bad socks5 atyp %d", c->self, s5_req.atyp); return -1; } need = sizeof(s5_req) + addrlen + 2; if (s5_req.atyp == 0x03) need++; if (have < need) return 0; if ((r = sshbuf_consume(input, sizeof(s5_req))) != 0) sshfatal("channels.c", __func__, 1474, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %d: consume", c->self); if (s5_req.atyp == 0x03) { if ((r = sshbuf_consume(input, 1)) != 0) sshfatal("channels.c", __func__, 1478, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %d: consume", c->self); } if ((r = sshbuf_get(input, &dest_addr, addrlen)) != 0 || (r = sshbuf_get(input, &dest_port, 2)) != 0) { sshlog("channels.c", __func__, 1482, 0, SYSLOG_LEVEL_DEBUG1, ssh_err(r), "channel %d: parse addr/port", c->self); return -1; } dest_addr[addrlen] = '\0'; free(c->path); c->path = ((void *)0) ; if (s5_req.atyp == 0x03) { if (addrlen >= 1025 ) { sshlog("channels.c", __func__, 1490, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "channel %d: dynamic request: socks5 hostname " "\"%.100s\" too long", c->self, dest_addr) ; return -1; } c->path = xstrdup(dest_addr); } else { if (inet_ntop(af, dest_addr, ntop, sizeof(ntop)) == ((void *)0) ) return -1; c->path = xstrdup(ntop); } c->host_port = ntohs(dest_port); sshlog("channels.c", __func__, 1502, 0, SYSLOG_LEVEL_DEBUG2, ((void *)0) , "channel %d: dynamic request: socks5 host %s port %u command %u", c->self, c->path, c->host_port, s5_req.command) ; s5_rsp.version = 0x05; s5_rsp.command = 0x00; s5_rsp.reserved = 0; s5_rsp.atyp = 0x01; dest_port = 0; if ((r = sshbuf_put(output, &s5_rsp, sizeof(s5_rsp))) != 0 || (r = sshbuf_put_u32(output, ntohl( ((in_addr_t) 0x00000000) ))) != 0 || (r = sshbuf_put(output, &dest_port, sizeof(dest_port))) != 0) sshfatal("channels.c", __func__, 1514, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "channel %d: append reply", c->self); return 1; }
undefined8 channel_decode_socks5(long param_1,undefined8 param_2,undefined8 param_3) { uint uVar1; uint uVar2; void *__ptr; uint16_t uVar3; uint32_t uVar4; undefined8 uVar5; char *pcVar6; char **ppcVar7; char **ppcVar8; undefined *puVar9; undefined *puVar10; long in_FS_OFFSET; char *apcStackY528 [2]; ulong uStackY512; char *pcStackY504; ulong uStackY496; char *pcStackY488; ulong uStackY480; char *pcStack456; ulong uStack448; undefined auStack440 [8]; undefined8 local_1b0; undefined8 local_1a8; long local_1a0; uint16_t local_18a; uint local_188; uint local_184; int local_180; uint local_17c; int local_178; int local_174; uint local_170; uint local_16c; char local_168; byte local_167; char local_166; byte local_165; undefined local_164; undefined local_163; undefined local_162; undefined local_161; char *local_160; char local_158 [48]; undefined local_128 [264]; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); uStack448 = (ulong)*(uint *)(param_1 + 4); pcStack456 = "channel %d: decode socks5"; local_1b0 = param_3; local_1a8 = param_2; local_1a0 = param_1; sshlog("channels.c","channel_decode_socks5",0x57f,0,6,0); ppcVar7 = (char **)auStack440; ppcVar8 = (char **)auStack440; uStack448 = 0x103c11; local_160 = (char *)sshbuf_ptr(local_1a8); if (*local_160 != '\x05') { uVar5 = 0xffffffff; puVar10 = auStack440; goto LAB_001044e8; } uStack448 = 0x103c3f; local_170 = sshbuf_len(local_1a8); if ((*(uint *)(local_1a0 + 0x18) & 0x1000) != 0) { uStack448 = (ulong)*(uint *)(local_1a0 + 4); pcStack456 = "channel %d: socks5 post auth"; sshlog("channels.c","channel_decode_socks5",0x5a1,0,6,0); if (local_170 < 5) { uVar5 = 0; puVar10 = auStack440; goto LAB_001044e8; } uStack448 = 0x103f30; memcpy(&local_168,local_160,4); if (((local_168 != '\x05') || (local_167 != 1)) || (local_166 != '\0')) { uStack448 = (ulong)*(uint *)(local_1a0 + 4); pcStack456 = "channel %d: only socks5 connect supported"; sshlog("channels.c","channel_decode_socks5",0x5a8,0,6,0); uVar5 = 0xffffffff; puVar10 = auStack440; goto LAB_001044e8; } if (local_165 == 4) { local_17c = 0x10; local_178 = 10; } else { if (4 < local_165) { LAB_00104012: pcStack456 = (char *)(ulong)local_165; sshlog("channels.c","channel_decode_socks5",0x5b9,0,6,0,"channel %d: bad socks5 atyp %d", *(undefined4 *)(local_1a0 + 4)); uVar5 = 0xffffffff; puVar10 = auStack440; goto LAB_001044e8; } if (local_165 == 1) { local_17c = 4; local_178 = 2; } else { if (local_165 != 3) goto LAB_00104012; local_17c = (uint)(byte)local_160[4]; local_178 = -1; } } local_188 = local_17c + 6; if (local_165 == 3) { local_188 = local_17c + 7; } if (local_170 < local_188) { uVar5 = 0; puVar10 = auStack440; goto LAB_001044e8; } uStack448 = 0x1040bd; local_174 = sshbuf_consume(local_1a8,4); if (local_174 != 0) { uVar1 = *(uint *)(local_1a0 + 4); uStack448 = 0x1040e3; uVar5 = ssh_err(local_174); ppcVar8 = &pcStack456; pcStack456 = "channel %d: consume"; uStack448 = (ulong)uVar1; sshfatal("channels.c","channel_decode_socks5",0x5c2,1,1,uVar5); } puVar10 = (undefined *)ppcVar8; if (local_165 == 3) { *(undefined8 *)((long)ppcVar8 + -8) = 0x104136; local_174 = sshbuf_consume(local_1a8,1); if (local_174 != 0) { uVar1 = *(uint *)(local_1a0 + 4); *(undefined8 *)((long)ppcVar8 + -8) = 0x10415c; uVar5 = ssh_err(local_174); *(ulong *)((long)ppcVar8 + -8) = (ulong)uVar1; puVar10 = (undefined *)((long)ppcVar8 + -0x10); *(char **)((long)ppcVar8 + -0x10) = "channel %d: consume"; *(undefined8 *)((long)ppcVar8 + -0x18) = 0x104190; sshfatal("channels.c","channel_decode_socks5",0x5c6,1,1,uVar5); } } *(undefined8 *)(puVar10 + -8) = 0x1041af; local_174 = sshbuf_get(local_1a8,local_128,local_17c); if (local_174 == 0) { *(undefined8 *)(puVar10 + -8) = 0x1041dc; local_174 = sshbuf_get(local_1a8,&local_18a,2); if (local_174 == 0) { local_128[local_17c] = 0; __ptr = *(void **)(local_1a0 + 0x80); *(undefined8 *)(puVar10 + -8) = 0x104268; free(__ptr); *(undefined8 *)(local_1a0 + 0x80) = 0; if (local_165 == 3) { if (0x400 < local_17c) { uVar1 = *(uint *)(local_1a0 + 4); *(undefined **)(puVar10 + -0x10) = local_128; *(ulong *)(puVar10 + -0x18) = (ulong)uVar1; *(char **)(puVar10 + -0x20) = "channel %d: dynamic request: socks5 hostname \"%.100s\" too long"; *(undefined8 *)(puVar10 + -0x28) = 0x1042e2; sshlog("channels.c","channel_decode_socks5",0x5d2,0,2,0); uVar5 = 0xffffffff; goto LAB_001044e8; } *(undefined8 *)(puVar10 + -8) = 0x1042ff; uVar5 = xstrdup(); *(undefined8 *)(local_1a0 + 0x80) = uVar5; } else { *(undefined8 *)(puVar10 + -8) = 0x10432f; pcVar6 = inet_ntop(local_178,local_128,local_158,0x2e); if (pcVar6 == (char *)0x0) { uVar5 = 0xffffffff; goto LAB_001044e8; } *(undefined8 *)(puVar10 + -8) = 0x10434d; uVar5 = xstrdup(); *(undefined8 *)(local_1a0 + 0x80) = uVar5; } *(undefined8 *)(puVar10 + -8) = 0x10436c; uVar3 = ntohs(local_18a); *(uint *)(local_1a0 + 0x98) = (uint)uVar3; uVar1 = *(uint *)(local_1a0 + 0x98); uVar5 = *(undefined8 *)(local_1a0 + 0x80); uVar2 = *(uint *)(local_1a0 + 4); *(ulong *)(puVar10 + -0x10) = (ulong)local_167; *(ulong *)(puVar10 + -0x18) = (ulong)uVar1; *(undefined8 *)(puVar10 + -0x20) = uVar5; *(ulong *)(puVar10 + -0x28) = (ulong)uVar2; *(char **)(puVar10 + -0x30) = "channel %d: dynamic request: socks5 host %s port %u command %u"; *(undefined8 *)(puVar10 + -0x38) = 0x1043e9; sshlog("channels.c","channel_decode_socks5",0x5de,0,6,0); local_164 = 5; local_163 = 0; local_162 = 0; local_161 = 1; local_18a = 0; *(undefined8 *)(puVar10 + -8) = 0x104430; local_174 = sshbuf_put(local_1b0,&local_164,4); if (local_174 == 0) { *(undefined8 *)(puVar10 + -8) = 0x104449; uVar4 = ntohl(0); *(undefined8 *)(puVar10 + -8) = 0x10445c; local_174 = sshbuf_put_u32(local_1b0,uVar4); if (local_174 != 0) goto LAB_00104498; *(undefined8 *)(puVar10 + -8) = 0x104489; local_174 = sshbuf_put(local_1b0,&local_18a,2); puVar9 = puVar10; if (local_174 != 0) goto LAB_00104498; } else { LAB_00104498: uVar1 = *(uint *)(local_1a0 + 4); *(undefined8 *)(puVar10 + -8) = 0x1044af; uVar5 = ssh_err(local_174); *(ulong *)(puVar10 + -8) = (ulong)uVar1; puVar9 = puVar10 + -0x10; *(char **)(puVar10 + -0x10) = "channel %d: append reply"; *(undefined8 *)(puVar10 + -0x18) = 0x1044e3; sshfatal("channels.c","channel_decode_socks5",0x5ea,1,1,uVar5); } uVar5 = 1; puVar10 = puVar9; goto LAB_001044e8; } } uVar1 = *(uint *)(local_1a0 + 4); *(undefined8 *)(puVar10 + -8) = 0x104202; uVar5 = ssh_err(local_174); *(ulong *)(puVar10 + -8) = (ulong)uVar1; *(char **)(puVar10 + -0x10) = "channel %d: parse addr/port"; *(undefined8 *)(puVar10 + -0x18) = 0x104236; sshlog("channels.c","channel_decode_socks5",0x5ca,0,5,uVar5); uVar5 = 0xffffffff; goto LAB_001044e8; } if (local_170 < 2) { uVar5 = 0; puVar10 = auStack440; goto LAB_001044e8; } local_16c = (uint)(byte)local_160[1]; if (local_170 < local_16c + 2) { uVar5 = 0; puVar10 = auStack440; goto LAB_001044e8; } local_180 = 0; for (local_184 = 2; local_184 < local_16c + 2; local_184 = local_184 + 1) { if (local_160[local_184] == '\0') { local_180 = 1; break; } } if (local_180 == 0) { uStack448 = (ulong)*(uint *)(local_1a0 + 4); pcStack456 = "channel %d: method SSH_SOCKS5_NOAUTH not found"; sshlog("channels.c","channel_decode_socks5",0x593,0,5,0); uVar5 = 0xffffffff; puVar10 = auStack440; goto LAB_001044e8; } uStack448 = 0x103d67; local_174 = sshbuf_consume(local_1a8,local_16c + 2); if (local_174 != 0) { uVar1 = *(uint *)(local_1a0 + 4); uStack448 = 0x103d8d; uVar5 = ssh_err(local_174); ppcVar7 = &pcStack456; pcStack456 = "channel %d: consume"; uStack448 = (ulong)uVar1; sshfatal("channels.c","channel_decode_socks5",0x598,1,1,uVar5); } *(undefined8 *)((long)ppcVar7 + -8) = 0x103dd5; local_174 = sshbuf_put_u8(local_1b0,5); if (local_174 == 0) { *(undefined8 *)((long)ppcVar7 + -8) = 0x103df8; local_174 = sshbuf_put_u8(local_1b0,0); puVar10 = (undefined *)ppcVar7; if (local_174 != 0) goto LAB_00103e07; } else { LAB_00103e07: uVar1 = *(uint *)(local_1a0 + 4); *(undefined8 *)((long)ppcVar7 + -8) = 0x103e1e; uVar5 = ssh_err(local_174); *(ulong *)((long)ppcVar7 + -8) = (ulong)uVar1; puVar10 = (undefined *)((long)ppcVar7 + -0x10); *(char **)((long)ppcVar7 + -0x10) = "channel %d: append reply"; *(undefined8 *)((long)ppcVar7 + -0x18) = 0x103e52; sshfatal("channels.c","channel_decode_socks5",0x59c,1,1,uVar5); } *(uint *)(local_1a0 + 0x18) = *(uint *)(local_1a0 + 0x18) | 0x1000; *(ulong *)(puVar10 + -8) = (ulong)*(uint *)(local_1a0 + 4); *(char **)(puVar10 + -0x10) = "channel %d: socks5 auth done"; *(undefined8 *)(puVar10 + -0x18) = 0x103eac; sshlog("channels.c","channel_decode_socks5",0x59e,0,6,0); uVar5 = 0; LAB_001044e8: if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) { return uVar5; } *(undefined8 *)(puVar10 + -8) = 0x1044fc; __stack_chk_fail(); }
static int xfrm_state_flush_print(struct nlmsghdr *n, void *arg) { FILE *fp = (FILE *)arg; struct xfrm_usersa_flush *xsf = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )))); int len = n->nlmsg_len; const char *str; len -= ( ((((sizeof(*xsf)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))))+4U -1) & ~(4U -1) ); if (len < 0) { fprintf( stderr , "BUG: wrong nlmsg len %d\n", len); return -1; } fprintf(fp, "Flushed state "); str = strxf_xfrmproto(xsf->proto); if (str) fprintf(fp, "proto %s", str); else fprintf(fp, "proto %u", xsf->proto); fprintf(fp, "%s", _SL_); if (oneline) fprintf(fp, "\n"); fflush(fp); return 0; }
void xfrm_state_flush_print(unsigned int *a0, void* a1) { unsigned int v0; char *v1; unsigned long v2; unsigned long long v4; void* v5; v1 = &a0[4]; v0 = *(a0); v0 -= 20; if (v0 < 0) { fprintf(stderr, "BUG: wrong nlmsg len %d\n", v0); v4 = 4294967295; } else { fprintf(a1, "Flushed state "); v2 = strxf_xfrmproto(*(v1)); if (v2) fprintf(a1, "proto %s", v2); else fprintf(a1, "proto %u", *(v1)); fprintf(a1, "%s", _SL_); if (oneline) fprintf(a1, "\n"); fflush(a1); v5 = 0; } return; }
BZFILE * BZ2_bzopen ( const char *path, const char *mode ) { return bzopen_or_bzdopen(path,-1,mode, 0); }
void BZ2_bzopen(undefined8 param_1,undefined8 param_2) { bzopen_or_bzdopen(param_1,0xffffffff,param_2,0); return; }
char * _rl_make_prompt_for_search (int pchar) { int len; char *pmt, *p; rl_save_prompt (); p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; if (p == 0) { len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; pmt = (char *)xmalloc (len + 2); if (len) strcpy (pmt, rl_prompt); pmt[len] = pchar; pmt[len+1] = '\0'; } else { p++; len = strlen (p); pmt = (char *)xmalloc (len + 2); if (len) strcpy (pmt, p); pmt[len] = pchar; pmt[len+1] = '\0'; } prompt_physical_chars = saved_physical_chars + 1; return pmt; }
long long _rl_make_prompt_for_search(unsigned long a0) { unsigned int v0; char *v1; unsigned long v2; unsigned long v4; rl_save_prompt(); if (rl_prompt) v4 = strrchr(rl_prompt, 0xa); else v4 = 0; v2 = v4; if (!v2) { if (rl_prompt && *(rl_prompt)) v4 = strlen(rl_prompt); if (!rl_prompt || !*(rl_prompt)) *(&v4) = 0; v0 = v4; v1 = xmalloc(v0 + 2); if (v0) strcpy(v1, rl_prompt); v1[v0] = a0; v1[1 + v0] = 0; } else { v2 += 1; v0 = strlen(v2); v1 = xmalloc(v0 + 2); if (v0) strcpy(v1, v2); v1[v0] = a0; v1[1 + v0] = 0; } prompt_physical_chars = saved_physical_chars + 1; return v1; }
test_code_t test_ecdhe(gnutls_session_t session) { int ret; if (tls_ext_ok == 0) return TEST_IGNORE; sprintf(prio_str, "NONE:" "+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC" ":+GOST28147-TC26Z-CNT" ":" "+COMP-NULL" ":%s:" "+MAC-ALL:+MD5:+SHA1" ":+GOST28147-TC26Z-IMIT" ":+ECDHE-RSA:+ECDHE-ECDSA:+CURVE-ALL:%s", protocol_all_str, rest); { int _ret; if ((_ret=__gnutls_priority_set_direct(session, prio_str, 266)) != TEST_SUCCEED) { return _ret; } }; gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred); ret = test_do_handshake(session); if (ret < 0) return TEST_FAILED; return ret; }
long test_ecdhe(long a1) { unsigned int v2; int v3; if ( !tls_ext_ok ) return 3LL; sprintf( prio_str, "NONE:+CIPHER-ALL:+ARCFOUR-128:+3DES-CBC:+GOST28147-TC26Z-CNT:+COMP-NULL:%s:+MAC-ALL:+MD5:+SHA1:+GOST28147-TC26Z-IMIT" ":+ECDHE-RSA:+ECDHE-ECDSA:+CURVE-ALL:%s", protocol_all_str, rest); v2 = _gnutls_priority_set_direct(a1, prio_str, 0x10Au); if ( v2 ) return v2; gnutls_credentials_set(a1, 1LL, xcred); v3 = test_do_handshake(a1); if ( v3 >= 0 ) return (unsigned int)v3; else return 1LL; }
static int delete_file(int agent_fd, const char *filename, int key_only, int qflag) { struct sshkey *public, *cert = ((void *)0) ; char *certpath = ((void *)0) , *comment = ((void *)0) ; int r, ret = -1; if (strcmp(filename, "-") == 0) return delete_stdin(agent_fd, qflag); if ((r = sshkey_load_public(filename, &public, &comment)) != 0) { printf("Bad key file %s: %s\n", filename, ssh_err(r)); return -1; } if (delete_one(agent_fd, public, comment, filename, qflag) == 0) ret = 0; if (key_only) goto out; free(comment); comment = ((void *)0) ; xasprintf(&certpath, "%s-cert.pub", filename); if ((r = sshkey_load_public(certpath, &cert, &comment)) != 0) { if (r != -24 || (*__errno_location ()) != 2 ) sshlog("ssh-add.c", __func__, 189, 0, SYSLOG_LEVEL_ERROR, ssh_err(r), "Failed to load certificate \"%s\"", certpath); goto out; } if (!sshkey_equal_public(cert, public)) sshfatal("ssh-add.c", __func__, 194, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "Certificate %s does not match private key %s", certpath, filename) ; if (delete_one(agent_fd, cert, comment, certpath, qflag) == 0) ret = 0; out: sshkey_free(cert); sshkey_free(public); free(certpath); free(comment); return ret; }
long delete_file(unsigned int a1, const char *a2, int a3, int a4) { const char *v5; long *v6; const char *v7; long v8; unsigned int v12; unsigned int v13; unsigned int v14; long *v15; long *v16; void *v17; void *ptr[3]; ptr[1] = (void *)__readfsqword(0x28u); v16 = 0LL; v17 = 0LL; ptr[0] = 0LL; v12 = -1; if ( !strcmp(a2, "-") ) return delete_stdin(a1, a4); v13 = sshkey_load_public(a2, &v15, ptr); if ( v13 ) { v5 = (const char *)ssh_err(v13); printf("Bad key file %s: %s\n", a2, v5); return 0xFFFFFFFFLL; } else { v6 = v15; if ( !(unsigned int)delete_one(a1, (long)v15, (const char *)ptr[0], a2, a4) ) v12 = 0; if ( !a3 ) { free(ptr[0]); ptr[0] = 0LL; xasprintf(&v17, "%s-cert.pub", a2); v6 = (long *)&v16; v14 = sshkey_load_public(v17, &v16, ptr); if ( v14 ) { if ( v14 != -24 || *_errno_location() != 2 ) { v7 = (const char *)v17; v8 = ssh_err(v14); v6 = (long *)"delete_file"; sshlog("ssh-add.c", "delete_file", 189LL, 0LL, 2LL, v8, "Failed to load certificate \"%s\"", v7); } } else { if ( !(unsigned int)sshkey_equal_public(v16, v15) ) sshfatal( "ssh-add.c", "delete_file", 194LL, 0LL, 1LL, 0LL, "Certificate %s does not match private key %s", (const char *)v17, a2); v6 = v16; if ( !(unsigned int)delete_one(a1, (long)v16, (const char *)ptr[0], (const char *)v17, a4) ) v12 = 0; } } sshkey_free(v16, v6); sshkey_free(v15, v6); free(v17); free(ptr[0]); return v12; } }
static void print_ifdef_lines (register FILE *out, char const *format, struct group const *group) { struct file_data const *file = group->file; char const * const *linbuf = file->linbuf; lin from = group->from, upto = group->upto; if (!out) return; if (!expand_tabs && format[0] == '%') { if (format[1] == 'l' && format[2] == '\n' && !format[3] && from < upto) { fwrite_unlocked (linbuf[from],sizeof (char),linbuf[upto] + (linbuf[upto][-1] != '\n') - linbuf[from],out) ; return; } if (format[1] == 'L' && !format[2]) { fwrite_unlocked (linbuf[from],sizeof (char),linbuf[upto] - linbuf[from],out) ; return; } } for (; from < upto; from++) { register char c; register char const *f = format; while ((c = *f++) != 0) { char const *f1 = f; if (c == '%') switch ((c = *f++)) { case '%': break; case 'l': output_1_line (linbuf[from], (linbuf[from + 1] - (linbuf[from + 1][-1] == '\n')), 0, 0); continue; case 'L': output_1_line (linbuf[from], linbuf[from + 1], 0, 0); continue; default: f = do_printf_spec (out, f - 2, file, from, 0); if (f) continue; c = '%'; f = f1; break; } putc_unlocked (c,out); } } }
void print_ifdef_lines(FILE *param_1,char *param_2,long *param_3) { char *pcVar1; long lVar2; long lVar3; long lVar4; char *pcVar5; char *pcVar6; char cVar7; long local_50; lVar2 = *param_3; lVar3 = *(long *)(lVar2 + 0xb8); local_50 = param_3[1]; lVar4 = param_3[2]; if (param_1 == (FILE *)0x0) { return; } if ((expand_tabs != '\x01') && (*param_2 == '%')) { if ((param_2[1] == 'l') && (((param_2[2] == '\n' && (param_2[3] == '\0')) && (local_50 < lVar4)))) { fwrite_unlocked(*(void **)(lVar3 + local_50 * 8),1, (*(long *)(lVar3 + lVar4 * 8) + (ulong)(*(char *)(*(long *)(lVar3 + lVar4 * 8) + -1) != '\n')) - *(long *)(lVar3 + local_50 * 8),param_1); return; } if ((param_2[1] == 'L') && (param_2[2] == '\0')) { fwrite_unlocked(*(void **)(lVar3 + local_50 * 8),1, *(long *)(lVar3 + lVar4 * 8) - *(long *)(lVar3 + local_50 * 8),param_1); return; } } do { pcVar5 = param_2; if (lVar4 <= local_50) { return; } while( true ) { pcVar1 = pcVar5 + 1; cVar7 = *pcVar5; if (cVar7 == '\0') break; pcVar6 = pcVar1; if (cVar7 == '%') { pcVar6 = pcVar5 + 2; cVar7 = *pcVar1; if (cVar7 == 'l') { output_1_line(*(undefined8 *)(lVar3 + local_50 * 8), *(long *)(lVar3 + (local_50 + 1) * 8) - (ulong)(*(char *)(*(long *)(lVar3 + (local_50 + 1) * 8) + -1) == '\n'),0,0); pcVar5 = pcVar6; } else if (cVar7 < 'm') { if (cVar7 == '%') goto LAB_0010095a; if (cVar7 != 'L') goto LAB_00100920; output_1_line(*(undefined8 *)(lVar3 + local_50 * 8), *(undefined8 *)(lVar3 + (local_50 + 1) * 8),0,0); pcVar5 = pcVar6; } else { LAB_00100920: pcVar5 = (char *)do_printf_spec(param_1,pcVar5,lVar2,local_50,0); if (pcVar5 == (char *)0x0) { cVar7 = '%'; pcVar6 = pcVar1; goto LAB_0010095a; } } } else { LAB_0010095a: putc_unlocked((int)cVar7,param_1); pcVar5 = pcVar6; } } local_50 = local_50 + 1; } while( true ); }
static void ipstats_stat_desc_pack_afstats(struct ipstats_stat_dump_filters *filters, const struct ipstats_stat_desc *desc) { ipstats_stat_desc_enable_bit(filters, IFLA_STATS_AF_SPEC, 0); }
long long ipstats_stat_desc_pack_afstats(unsigned int *a0, unsigned long a1) { unsigned long v0; v0 = a1; return ipstats_stat_desc_enable_bit(a0, 0x5, 0x0); }
static void sort (char *const *files, size_t nfiles, char const *output_file, size_t nthreads) { struct buffer buf; size_t ntemps = 0; _Bool output_file_created = 0 ; buf.alloc = 0; while (nfiles) { char const *temp_output; char const *file = *files; FILE *fp = xfopen (file, "r"); FILE *tfp; size_t bytes_per_line; if (nthreads > 1) { size_t tmp = 1; size_t mult = 1; while (tmp < nthreads) { tmp *= 2; mult++; } bytes_per_line = (mult * sizeof (struct line)); } else bytes_per_line = sizeof (struct line) * 3 / 2; if (! buf.alloc) initbuf (&buf, bytes_per_line, sort_buffer_size (&fp, 1, files, nfiles, bytes_per_line)); buf.eof = 0 ; files++; nfiles--; while (fillbuf (&buf, fp, file)) { struct line *line; if (buf.eof && nfiles && (bytes_per_line + 1 < (buf.alloc - buf.used - bytes_per_line * buf.nlines))) { buf.left = buf.used; break; } saved_line.text = ((void *)0) ; line = buffer_linelim (&buf); if (buf.eof && !nfiles && !ntemps && !buf.left) { xfclose (fp, file); tfp = xfopen (output_file, "w"); temp_output = output_file; output_file_created = 1 ; } else { ++ntemps; temp_output = create_temp (&tfp)->name; } if (1 < buf.nlines) { struct merge_node_queue queue; queue_init (&queue, nthreads); struct merge_node *merge_tree = merge_tree_init (nthreads, buf.nlines, line); sortlines (line, nthreads, buf.nlines, merge_tree + 1, &queue, tfp, temp_output); merge_tree_destroy (nthreads, merge_tree); queue_destroy (&queue); } else write_unique (line - 1, tfp, temp_output); xfclose (tfp, temp_output); if (output_file_created) goto finish; } xfclose (fp, file); } finish: free (buf.buf); if (! output_file_created) { struct tempnode *node = temphead; struct sortfile *tempfiles = xnmalloc (ntemps, sizeof *tempfiles); for (size_t i = 0; node; i++) { tempfiles[i].name = node->name; tempfiles[i].temp = node; node = node->next; } merge (tempfiles, ntemps, ntemps, output_file); free (tempfiles); } reap_all (); }
void sort(void* a0, unsigned int a1, char *a2, unsigned long a3) { unsigned int v0; unsigned long long *v1; char v2; void* v3; void* v4; void* v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long *v10; void* v11; unsigned long long v12; void* v13; void* v14; void* v15; char v16; char v17; char v18; void* v19; unsigned long long v20; char v21; char v22; char v23; unsigned long long v25; unsigned long long *v27; unsigned long long v28; v1 = a0; v0 = a1; v5 = 0; v2 = 0; v19 = 0; while (*(&v0)) { v12 = *(v1); v3 = xfopen(v12, "r"); if (a3 > 1) { v8 = 1; for (v9 = 1; v8 < a3; v9 += 1) { v8 *= 2; } v7 = v9 * 32; } else { v7 = 48; } if (!v19) initbuf(&v16, v7, sort_buffer_size(&v3, 0x1, v1, *(&v0), v7)); v21 = 0; v1 += 1; *(&v0) = *(&v0) - 1; while (true) { v25 = fillbuf(&v16, v3, v12); if (v25) { if (v21 && *(&v0) && v7 + 1 < v19 - *(&v17) - v7 * *(&v18)) v20 = *(&v17); if (!*(&v0) || !v21 || v7 + 1 >= v19 - *(&v17) - v7 * *(&v18)) { saved_line = 0; v13 = buffer_linelim(&v16); if (v21 && !*(&v0) && !v5 && !*(&v20)) { xfclose(v3, v12); v4 = xfopen(a2, "w"); v6 = a2; v2 = 1; } if (!v21 || *(&v0) || *(&v20) || v5) { v5 += 1; v6 = create_temp(&v4) + 13; } if (*(&v18) > 1) { queue_init(&v22, a3); v14 = merge_tree_init(a3, *(&v18), v13); sortlines(v13, a3, *(&v18), v14 + 128, &v22, v4, v6); merge_tree_destroy(a3, v14); queue_destroy(&v22); } else { write_unique(v13 - 32, v4, v6); } xfclose(v4, v6); if (v2) break; } } if (!v25 || v7 + 1 < v19 - *(&v17) - v7 * *(&v18) && *(&v0) && v21) { xfclose(v3, v12); break; } } if (v2 && (!*(&v0) || !v21 || v7 + 1 >= v19 - *(&v17) - v7 * *(&v18))) break; } free(*(&v16)); if ((v2 ^ 1)) { v10 = temphead; v15 = xnmalloc(v5, 0x10); for (v11 = 0; v10; v11 += 1) { *((v15 + 0x10 * v11)) = &v10[1] + 5; *((8 + 0x10 * v11 + v15)) = v10; v10 = *(v10); } merge(v15, v5, v5, a2); free(v15); } reap_all(); v28 = *(&v23) ^ v27[5]; return; }
int tun_open(int tun, int mode, char **ifname) { return (sys_tun_open(tun, mode, ifname)); }
long long tun_open(unsigned long a0, unsigned long a1, unsigned long long a2) { return sys_tun_open(a0, a1, a2, a1); }
struct sshkey * get_hostkey_public_by_index(int ind, struct ssh *ssh) { if (ind < 0 || (u_int)ind >= options.num_host_key_files) return ( ((void *)0) ); return (sensitive_data.host_pubkeys[ind]); }
int get_hostkey_public_by_index(unsigned long a0, unsigned long a1) { unsigned long v0; unsigned int v2; v0 = a1; if (a0 >= 0 && 1221591368 > a0) v2 = *((0xcde8c78902048b00 + a0 * 8)); if (1221591368 <= a0 || a0 < 0) v2 = 0; return v2; }
static void beyond (void) { test_syntax_error (gettext ("missing argument after %s"), quote (argv[argc - 1])); }
void beyond() { long v0; char *v1; long v2; long v3; long v4; long v5; v0 = quote(*(_QWORD *)(8LL * argc - 8 + argv)); v1 = gettext("missing argument after %s"); test_syntax_error((long)v1, v0, v2, v3, v4, v5); }
static void reserve_stdio_fds(void) { int fd = 0; while (fd <= 2) { fd = open("/dev/null", 02 ); if (fd < 0) { fprintf( stderr , (gettext ("ERROR: Couldn't open " "/dev/null (%s)\n")) , strerror( (*__errno_location ()) )); return; } } (void) close(fd); }
int reserve_stdio_fds() { int *v0; char *v1; char *v2; int fd; fd = 0; while ( fd <= 2 ) { fd = open("/dev/null", 2); if ( fd < 0 ) { v0 = _errno_location(); v1 = strerror(*v0); v2 = gettext("ERROR: Couldn't open /dev/null (%s)\n"); return fprintf(stderr, v2, v1); } } return close(fd); }
int zip(in, out) int in, out; { uch flags = 0; ush attr = 0; ush deflate_flags = 0; ulg stamp; ifd = in; ofd = out; outcnt = 0; method = 8; {outbuf[outcnt++]=(uch)("\037\213"[0]); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)("\037\213"[1]); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)(8); if (outcnt==0x40000) flush_outbuf();}; if (save_orig_name) { flags |= 0x08; } {outbuf[outcnt++]=(uch)(flags); if (outcnt==0x40000) flush_outbuf();}; if (time_stamp.tv_nsec < 0) stamp = 0; else if (0 < time_stamp.tv_sec && time_stamp.tv_sec <= 0xffffffff) stamp = time_stamp.tv_sec; else { warning ("file timestamp out of range for gzip format"); stamp = 0; } { { if (outcnt < 0x40000 -2) { outbuf[outcnt++] = (uch) (((stamp) & 0xffff) & 0xff); outbuf[outcnt++] = (uch) ((ush)((stamp) & 0xffff) >> 8); } else { {outbuf[outcnt++]=(uch)((uch)(((stamp) & 0xffff) & 0xff)); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)((uch)((ush)((stamp) & 0xffff) >> 8)); if (outcnt==0x40000) flush_outbuf();}; } }; { if (outcnt < 0x40000 -2) { outbuf[outcnt++] = (uch) ((((ulg)(stamp)) >> 16) & 0xff); outbuf[outcnt++] = (uch) ((ush)(((ulg)(stamp)) >> 16) >> 8); } else { {outbuf[outcnt++]=(uch)((uch)((((ulg)(stamp)) >> 16) & 0xff)); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)((uch)((ush)(((ulg)(stamp)) >> 16) >> 8)); if (outcnt==0x40000) flush_outbuf();}; } }; }; updcrc ( ((void *)0) , 0); bi_init(out); ct_init(&attr, &method); if (level == 1) deflate_flags |= FAST; else if (level == 9) deflate_flags |= SLOW; {outbuf[outcnt++]=(uch)((uch)deflate_flags); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)(0x03); if (outcnt==0x40000) flush_outbuf();}; if (save_orig_name) { char *p = gzip_base_name (ifname); do { {outbuf[outcnt++]=(uch)(*p); if (outcnt==0x40000) flush_outbuf();}; } while (*p++); } header_bytes = (off_t)outcnt; deflate (level); if (ifile_size != -1L && bytes_in != ifile_size) { fprintf( stderr , "%s: %s: file size changed while zipping\n", program_name, ifname); } { { if (outcnt < 0x40000 -2) { outbuf[outcnt++] = (uch) (((getcrc ()) & 0xffff) & 0xff); outbuf[outcnt++] = (uch) ((ush)((getcrc ()) & 0xffff) >> 8); } else { {outbuf[outcnt++]=(uch)((uch)(((getcrc ()) & 0xffff) & 0xff)); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)((uch)((ush)((getcrc ()) & 0xffff) >> 8)); if (outcnt==0x40000) flush_outbuf();}; } }; { if (outcnt < 0x40000 -2) { outbuf[outcnt++] = (uch) ((((ulg)(getcrc ())) >> 16) & 0xff); outbuf[outcnt++] = (uch) ((ush)(((ulg)(getcrc ())) >> 16) >> 8); } else { {outbuf[outcnt++]=(uch)((uch)((((ulg)(getcrc ())) >> 16) & 0xff)); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)((uch)((ush)(((ulg)(getcrc ())) >> 16) >> 8)); if (outcnt==0x40000) flush_outbuf();}; } }; }; { { if (outcnt < 0x40000 -2) { outbuf[outcnt++] = (uch) ((((ulg)bytes_in) & 0xffff) & 0xff); outbuf[outcnt++] = (uch) ((ush)(((ulg)bytes_in) & 0xffff) >> 8); } else { {outbuf[outcnt++]=(uch)((uch)((((ulg)bytes_in) & 0xffff) & 0xff)); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)((uch)((ush)(((ulg)bytes_in) & 0xffff) >> 8)); if (outcnt==0x40000) flush_outbuf();}; } }; { if (outcnt < 0x40000 -2) { outbuf[outcnt++] = (uch) ((((ulg)((ulg)bytes_in)) >> 16) & 0xff); outbuf[outcnt++] = (uch) ((ush)(((ulg)((ulg)bytes_in)) >> 16) >> 8); } else { {outbuf[outcnt++]=(uch)((uch)((((ulg)((ulg)bytes_in)) >> 16) & 0xff)); if (outcnt==0x40000) flush_outbuf();}; {outbuf[outcnt++]=(uch)((uch)((ush)(((ulg)((ulg)bytes_in)) >> 16) >> 8)); if (outcnt==0x40000) flush_outbuf();}; } }; }; header_bytes += 2*4; flush_outbuf(); return 0; }
long long zip(unsigned long a0, unsigned long a1) { char v0; int tmp_73; int tmp_10; int tmp_9; int tmp_19; int tmp_58; int tmp_34; int tmp_46; int tmp_88; int tmp_30; int tmp_50; int tmp_17; int tmp_8; int tmp_26; int tmp_24; int tmp_42; int tmp_20; int tmp_51; int tmp_11; int tmp_32; int tmp_44; int tmp_84; int tmp_28; int tmp_48; unsigned short v1; unsigned short v2; void* v3; char *v4; char v6; char v7; unsigned long long v10; unsigned long long v11; v0 = 0; v1 = 0; v2 = 0; ifd = a0; ofd = a1; outcnt = 0; method = 8; tmp_73 = outcnt; outcnt = outcnt + 1; *(tmp_73 + &outbuf) = 31; if (outcnt == 0x40000) flush_outbuf(); tmp_10 = outcnt; outcnt = outcnt + 1; *(tmp_10 + &outbuf) = 139; if (outcnt == 0x40000) flush_outbuf(); tmp_9 = outcnt; outcnt = outcnt + 1; *(tmp_9 + &outbuf) = 8; if (outcnt == 0x40000) flush_outbuf(); if (save_orig_name) v0 |= 8; tmp_10 = outcnt; outcnt = outcnt + 1; *(tmp_10 + &outbuf) = v0; if (outcnt == 0x40000) flush_outbuf(); if (warning < 0) { v3 = 0; } else { if (time_stamp > 0 && time_stamp <= 4294967295) v3 = time_stamp; if (time_stamp <= 0 || time_stamp > 4294967295) { warning("file timestamp out of range for gzip format"); v3 = 0; } } if (outcnt <= 262141) { tmp_19 = outcnt; outcnt = outcnt + 1; *(tmp_19 + &outbuf) = v3; tmp_58 = outcnt; outcnt = outcnt + 1; *(tmp_58 + &outbuf) = v3 >> 8; } else { tmp_10 = outcnt; outcnt = outcnt + 1; *(tmp_10 + &outbuf) = v3; if (outcnt == 0x40000) flush_outbuf(); tmp_34 = outcnt; outcnt = outcnt + 1; *(tmp_34 + &outbuf) = v3 >> 8; if (outcnt == 0x40000) flush_outbuf(); } if (outcnt <= 262141) { tmp_46 = outcnt; outcnt = outcnt + 1; *(tmp_46 + &outbuf) = v3 >> 16; tmp_88 = outcnt; outcnt = outcnt + 1; *(tmp_88 + &outbuf) = v3 >> 24; } else { tmp_30 = outcnt; outcnt = outcnt + 1; *(tmp_30 + &outbuf) = v3 >> 16; if (outcnt == 0x40000) flush_outbuf(); tmp_50 = outcnt; outcnt = outcnt + 1; *(tmp_50 + &outbuf) = v3 >> 24; if (outcnt == 0x40000) flush_outbuf(); } updcrc(0x0, 0x0); bi_init(a1); ct_init(&v1, 0x500018); if (level == 1) { v2 |= 4; } else if (level == 9) { v2 |= 2; } tmp_10 = outcnt; outcnt = outcnt + 1; *(tmp_10 + &outbuf) = v2; if (outcnt == 0x40000) flush_outbuf(); tmp_9 = outcnt; outcnt = outcnt + 1; *(tmp_9 + &outbuf) = 3; if (outcnt == 0x40000) flush_outbuf(); if (save_orig_name) { v4 = gzip_base_name(0x500068); do { v6 = *(v4); tmp_17 = outcnt; outcnt = outcnt + 1; *(tmp_17 + &outbuf) = v6; if (outcnt == 0x40000) flush_outbuf(); tmp_9 = v4; v4 += 1; v7 = *(tmp_9); } while (v7); } header_bytes = outcnt; deflate(level); if (ifile_size != -1 && bytes_in != ifile_size) fprintf(stderr, "%s: %s: file size changed while zipping\n", program_name, &ifname); if (outcnt <= 262141) { tmp_8 = outcnt; outcnt = outcnt + 1; *(tmp_8 + &outbuf) = getcrc(); tmp_26 = outcnt; outcnt = outcnt + 1; *(tmp_26 + &outbuf) = getcrc() >> 8; } else { tmp_10 = outcnt; outcnt = outcnt + 1; *(tmp_10 + &outbuf) = getcrc(); if (outcnt == 0x40000) flush_outbuf(); tmp_30 = outcnt; outcnt = outcnt + 1; *(tmp_30 + &outbuf) = getcrc() >> 8; if (outcnt == 0x40000) flush_outbuf(); } if (outcnt <= 262141) { tmp_24 = outcnt; outcnt = outcnt + 1; *(tmp_24 + &outbuf) = getcrc() >> 16; v10 = getcrc() >> 16; *(&v10) = v10 >> 8; tmp_42 = outcnt; outcnt = outcnt + 1; *(tmp_42 + &outbuf) = v10; } else { tmp_26 = outcnt; outcnt = outcnt + 1; *(tmp_26 + &outbuf) = getcrc() >> 16; if (outcnt == 0x40000) flush_outbuf(); v11 = getcrc() >> 16; *(&v11) = v11 >> 8; tmp_46 = outcnt; outcnt = outcnt + 1; *(tmp_46 + &outbuf) = v11; if (outcnt == 0x40000) flush_outbuf(); } if (outcnt <= 262141) { tmp_20 = outcnt; outcnt = outcnt + 1; *(tmp_20 + &outbuf) = bytes_in; tmp_51 = outcnt; outcnt = outcnt + 1; *(tmp_51 + &outbuf) = bytes_in >> 8; } else { tmp_11 = outcnt; outcnt = outcnt + 1; *(tmp_11 + &outbuf) = bytes_in; if (outcnt == 0x40000) flush_outbuf(); tmp_32 = outcnt; outcnt = outcnt + 1; *(tmp_32 + &outbuf) = bytes_in >> 8; if (outcnt == 0x40000) flush_outbuf(); } if (outcnt <= 262141) { tmp_44 = outcnt; outcnt = outcnt + 1; *(tmp_44 + &outbuf) = bytes_in >> 16; tmp_84 = outcnt; outcnt = outcnt + 1; *(tmp_84 + &outbuf) = bytes_in >> 24; } else { tmp_28 = outcnt; outcnt = outcnt + 1; *(tmp_28 + &outbuf) = bytes_in >> 16; if (outcnt == 0x40000) flush_outbuf(); tmp_48 = outcnt; outcnt = outcnt + 1; *(tmp_48 + &outbuf) = bytes_in >> 24; if (outcnt == 0x40000) flush_outbuf(); } header_bytes = 9933952906257269584; flush_outbuf(); return 0; }
static char * print_line_tail (char *beg, const char *lim, const char *line_color) { idx_t eol_size; idx_t tail_size; eol_size = (lim > beg && lim[-1] == eolbyte); eol_size += (lim - eol_size > beg && lim[-(1 + eol_size)] == '\r'); tail_size = lim - eol_size - beg; if (tail_size > 0) { pr_sgr_start (line_color); fwrite_errno (beg, 1, tail_size); beg += tail_size; pr_sgr_end (line_color); } return beg; }
int print_line_tail(void* a0, unsigned long long a1, char *a2) { void* v0; unsigned long long v1; unsigned long v2; unsigned long long v4; unsigned long long v5; v0 = a0; if (a1 > v0 && *((a1 - 1)) == eolbyte) v4 = 1; if (a1 <= v0 || *((a1 - 1)) != eolbyte) v4 = 0; v1 = v4; if (v0 < a1 + !(v1) && *((a1 + !(v1))) == 13) v5 = 1; if (v0 >= a1 + !(v1) || *((a1 + !(v1))) != 13) v5 = 0; v1 += v5; v2 = a1 + -(v1) - v0; if (v2 > 0) { pr_sgr_start(a2); fwrite_errno(v0, 0x1, v2); v0 += v2; pr_sgr_end(a2); } return v0; }
int _rl_any_typein (void) { return (push_index != pop_index); }
long long _rl_any_typein() { return push_index != pop_index; }
static void ask_server(const char *url) { gnutls_datum_t resp_data; int ret, v = 0, total_v = 0; unsigned char noncebuf[23]; gnutls_datum_t nonce = { noncebuf, sizeof(noncebuf) }; gnutls_datum_t *n; gnutls_x509_crt_t chain[8]; unsigned chain_size, counter; unsigned idx = 0; common_info_st info; chain_size = load_chain(chain); if (chain_size > 2 && ocsptool_options.present.outfile) { if (outcert_format != GNUTLS_X509_FMT_PEM) { fprintf( stderr , "error: You cannot combine --outfile when more than 2 certificates are found in a chain\n"); fprintf( stderr , "Did you mean to use --outpem?\n"); app_exit(1); } } counter = chain_size; while(counter > 1) { if (ocsptool_options.enabled.nonce) { ret = gnutls_rnd(GNUTLS_RND_NONCE, nonce.data, nonce.size); if (ret < 0) { fprintf( stderr , "gnutls_rnd: %s\n", gnutls_strerror(ret)); app_exit(1); } n = &nonce; } else { n = ((void *)0) ; } ret = send_ocsp_request(url, chain[idx], chain[idx+1], &resp_data, n); if (ret < 0) { fprintf( stderr , "Cannot send OCSP request\n"); app_exit(1); } _response_info(&resp_data, 1); if (ocsptool_options.present.load_trust) { v = _verify_response(&resp_data, n, ((void *)0) , 0); } else if (ocsptool_options.present.load_signer) { memset(&info, 0, sizeof(info)); info.verbose = verbose; info.cert = ocsptool_options.arg.load_signer; v = _verify_response(&resp_data, n, load_cert(1, &info), 0); } else { if (!ocsptool_options.present.load_chain) fprintf( stderr , "\nAssuming response's signer = issuer (use --load-signer to override).\n"); v = _verify_response(&resp_data, n, chain[idx+1], 0); } total_v += v; free(resp_data.data); idx++; counter--; printf("\n"); } for (idx = 0;idx<chain_size;idx++) { gnutls_x509_crt_deinit(chain[idx]); } if (total_v && !ocsptool_options.present.ignore_errors) app_exit(1); }
void ask_server(undefined8 param_1) { uint uVar1; int iVar2; undefined8 uVar3; long in_FS_OFFSET; int local_188; int local_184; uint local_180; uint local_17c; undefined **local_170; void *local_168 [2]; undefined *local_158; undefined4 local_150; undefined local_148 [40]; undefined8 local_120; undefined4 local_84; undefined8 local_68 [8]; undefined local_28 [24]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_184 = 0; local_158 = local_28; local_150 = 0x17; local_17c = 0; uVar1 = load_chain(local_68); local_180 = uVar1; if (((2 < uVar1) && (DAT_0010303b != '\0')) && (outcert_format != 1)) { fprintf(stderr, "error: You cannot combine --outfile when more than 2 certificates are found in a chain\n" ); fprintf(stderr,"Did you mean to use --outpem?\n"); app_exit(1); } while (1 < local_180) { if (stdout._5_1_ == '\0') { local_170 = (undefined **)0x0; } else { iVar2 = gnutls_rnd(0,local_158,local_150); if (iVar2 < 0) { uVar3 = gnutls_strerror(iVar2); fprintf(stderr,"gnutls_rnd: %s\n",uVar3); app_exit(1); } local_170 = &local_158; } iVar2 = send_ocsp_request(param_1,local_68[local_17c],local_68[local_17c + 1],local_168, local_170); if (iVar2 < 0) { fprintf(stderr,"Cannot send OCSP request\n"); app_exit(1); } _response_info(local_168,1); if (DAT_00103045 == '\0') { if (DAT_00103046 == '\0') { if (DAT_00103042 != '\x01') { fprintf(stderr,"\nAssuming response\'s signer = issuer (use --load-signer to override).\n" ); } local_188 = _verify_response(local_168,local_170,local_68[local_17c + 1],0); } else { memset(local_148,0,0xd8); local_84 = verbose; local_120 = _gnutls_ocsp_resp_init; uVar3 = load_cert(1,local_148); local_188 = _verify_response(local_168,local_170,uVar3,0); } } else { local_188 = _verify_response(local_168,local_170,0,0); } local_184 = local_184 + local_188; free(local_168[0]); local_17c = local_17c + 1; printf("\n"); local_180 = local_180 - 1; } for (local_17c = 0; local_17c < uVar1; local_17c = local_17c + 1) { gnutls_x509_crt_deinit(local_68[local_17c]); } if ((local_184 != 0) && (DAT_0010304c != '\x01')) { app_exit(1); } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return; } __stack_chk_fail(); }
int addr_pton_cidr(const char *p, struct xaddr *n, u_int *l) { struct xaddr tmp; long unsigned int masklen = 999; char addrbuf[64], *mp, *cp; if (p == ((void *)0) || strlcpy(addrbuf, p, sizeof(addrbuf)) >= sizeof(addrbuf)) return -1; if ((mp = strchr(addrbuf, '/')) != ((void *)0) ) { *mp = '\0'; mp++; masklen = strtoul(mp, &cp, 10); if (*mp < '0' || *mp > '9' || *cp != '\0' || masklen > 128) return -1; } if (addr_pton(addrbuf, &tmp) == -1) return -1; if (mp == ((void *)0) ) masklen = addr_unicast_masklen(tmp.af); if (masklen_valid(tmp.af, masklen) == -1) return -2; if (addr_host_is_all0s(&tmp, masklen) != 0) return -2; if (n != ((void *)0) ) memcpy(n, &tmp, sizeof(*n)); if (l != ((void *)0) ) *l = masklen; return 0; }
long long addr_pton_cidr(unsigned long long a0, void* a1, unsigned int *a2) { char v0; unsigned int v1; char *v2; char v3; char v4; unsigned long long v6; v1 = 999; if (!a0) { v6 = 4294967295; return v6; } else if (strlcpy(&v4, a0, 0x40, a0) > 63) { v6 = 4294967295; return v6; } else { v2 = strchr(&v4, 0x2f); if (v2) { *(v2) = 0; v2 += 1; v1 = strtoul(v2, &v0, 0xa, &v0); if (*(v2) <= 47) { v6 = 4294967295; return v6; } else if (*(v2) > 57) { v6 = 4294967295; return v6; } else if (*(*(&v0))) { v6 = 4294967295; return v6; } else if (v1 > 128) { v6 = 4294967295; return v6; } } if (addr_pton(&v4, &v3) == -1) { v6 = 4294967295; return v6; } if (!v2) *(&v1) = addr_unicast_masklen(*(&v3)); if (masklen_valid(*(&v3), *(&v1)) == -1) { v6 = 4294967294; return v6; } else if (!addr_host_is_all0s(&v3, *(&v1))) { if (a1) memcpy(a1, &v3, 0x18); if (a2) *(a2) = *(&v1); v6 = 0; return v6; } else { v6 = 4294967294; return v6; } } }
static void check_output_alive (void) { if (! monitor_output) return; struct pollfd pfd; pfd.fd = 1 ; pfd.events = pfd.revents = 0; if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & ( 0x008 | 0x010 ))) die_pipe (); }
void check_output_alive() { unsigned int v0; unsigned short v1; unsigned short v2; char v3; unsigned long long *v5; unsigned long long v6; if (!(monitor_output ^ 1)) { v0 = 1; v2 = 0; v1 = v2; if (poll(&v0, 0x1, 0x0) >= 0 && (v2 & 24)) die_pipe(); } v6 = *(&v3) ^ v5[5]; return; }
int bitmap_from_string(struct bitmap *b, const void *p, size_t l) { int r; size_t i, offset, shift; const u_char *s = (const u_char *)p; if (l > (1<<24) / 8) return -1; if ((r = reserve(b, l * 8)) != 0) return r; bitmap_zero(b); if (l == 0) return 0; b->top = offset = ((l + ((sizeof(u_int)) - 1)) / (sizeof(u_int))) - 1; shift = ((l + ((sizeof(u_int)) - 1)) % (sizeof(u_int))) * 8; for (i = 0; i < l; i++) { b->d[offset] |= (u_int)s[i] << shift; if (shift == 0) { offset--; shift = (sizeof(u_int) * 8) - 8; } else shift -= 8; } retop(b); return 0; }
long long bitmap_from_string(unsigned long long a0[3], void* a1, unsigned int a2) { unsigned int v0; void* v1; unsigned int *v2; unsigned long v3; unsigned long long v5; if (a2 > 0x200000) { v5 = 4294967295; } else { v0 = reserve(a0, a2 * 8); if (v0) { v5 = v0; } else { bitmap_zero(a0); if (!a2) { v5 = 0; } else { v2 = (a2 + 3 >> 2) - 1; a0[2] = v2; v3 = (a2 + 3 & 3) * 8; for (v1 = 0; v1 < a2; v1 += 1) { *((a0[0] + v2 * 4)) = *((a0[0] + v2 * 4)) | (*((v1 + a1)) << (v3 & 31)); if (!v3) { v2 = v2 + 1; v3 = 24; } else { v3 -= 8; } } retop(a0); v5 = 0; } } } return v5; }
static void netns_restore(void) { if (saved_netns == -1) return; if (setns(saved_netns, 0x40000000 )) { perror("setns"); exit(1); } close(saved_netns); saved_netns = -1; }
void netns_restore() { unsigned long long v1; unsigned long long v2; v1 = saved_netns; if (saved_netns == -1) { return; } else if (!setns(saved_netns, 0x40000000)) { v2 = close(saved_netns); saved_netns = -1; return; } else { perror("setns"); exit(0x1); } }
int main (int argc, char **argv) { int c, exit_status; size_t words_per_buffer; exit_failure = 2; ; set_program_name (argv[0]); setlocale ( 6 , ""); bindtextdomain ("diffutils", "/usr/local/share/locale"); textdomain ("diffutils"); c_stack_action (0); xstdopen (); while ((c = getopt_long (argc, argv, "bci:ln:sv", long_options, 0)) != -1) switch (c) { case 'b': case 'c': opt_print_bytes = 1 ; break; case 'i': specify_ignore_initial (0, &optarg, ':'); if (*optarg++ == ':') specify_ignore_initial (1, &optarg, 0); else if (ignore_initial[1] < ignore_initial[0]) ignore_initial[1] = ignore_initial[0]; break; case 'l': specify_comparison_type (type_all_diffs); break; case 'n': { intmax_t n; if (xstrtoimax (optarg, 0, 0, &n, valid_suffixes) != LONGINT_OK || n < 0) try_help ("invalid --bytes value '%s'", optarg); if (! (0 <= bytes && bytes < n)) bytes = n; } break; case 's': specify_comparison_type (type_status); break; case 'v': version_etc ( stdout , "cmp", "GNU diffutils", Version, proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), proper_name ("David MacKenzie"), (char *) ((void *)0) ); check_stdout (); return 0 ; case HELP_OPTION: usage (); check_stdout (); return 0 ; default: try_help (0, 0); } if (optind == argc) try_help ("missing operand after '%s'", argv[argc - 1]); file[0] = argv[optind++]; file[1] = optind < argc ? argv[optind++] : "-"; for (int f = 0; f < 2 && optind < argc; f++) { char *arg = argv[optind++]; specify_ignore_initial (f, &arg, 0); } if (optind < argc) try_help ("extra operand '%s'", argv[optind]); for (int f = 0; f < 2; f++) { if (f && ignore_initial[0] == ignore_initial[1] && strcmp (file[0], file[1]) == 0) return 0 ; if ((strcmp (file[f], "-") == 0)) { file_desc[f] = 0 ; if ( 0 && ! isatty ( 0 )) set_binary_mode ( 0 , 0 ); } else file_desc[f] = open (file[f], 00 | 0 , 0); if (file_desc[f] < 0 || fstat (file_desc[f], stat_buf + f) != 0) { if (file_desc[f] < 0 && comparison_type == type_status) exit (2); else ((!!sizeof (struct { _Static_assert (2, "verify_expr (" "2" ", " "(error (2, (*__errno_location ()), \"%s\", file[f]), assume (false))" ")"); int _gl_dummy; })) ? ((error (2, (*__errno_location ()) , "%s", file[f]), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (2, (*__errno_location ()) , "%s", file[f]), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); } } if (0 < ((((&stat_buf[0])->st_ino == (&stat_buf[1])->st_ino) && ((&stat_buf[0])->st_dev == (&stat_buf[1])->st_dev)) || ((( (((( (&stat_buf[0])->st_mode )) & 0170000) == (0060000)) && (((( (&stat_buf[1])->st_mode )) & 0170000) == (0060000)) ) || ( (((( (&stat_buf[0])->st_mode )) & 0170000) == (0020000)) && (((( (&stat_buf[1])->st_mode )) & 0170000) == (0020000)) )) && (&stat_buf[0])->st_rdev == (&stat_buf[1])->st_rdev)) && ((&stat_buf[0])->st_mode == (&stat_buf[1])->st_mode && (&stat_buf[0])->st_nlink == (&stat_buf[1])->st_nlink && (&stat_buf[0])->st_uid == (&stat_buf[1])->st_uid && (&stat_buf[0])->st_gid == (&stat_buf[1])->st_gid && (&stat_buf[0])->st_size == (&stat_buf[1])->st_size && (&stat_buf[0])-> st_mtim.tv_sec == (&stat_buf[1])-> st_mtim.tv_sec && (&stat_buf[0])-> st_ctim.tv_sec == (&stat_buf[1])-> st_ctim.tv_sec ) && file_position (0) == file_position (1)) return 0 ; if (comparison_type != type_status) { struct stat outstat, nullstat; if (fstat ( 1 , &outstat) == 0 && stat ("/dev/null", &nullstat) == 0 && 0 < ((((&outstat)->st_ino == (&nullstat)->st_ino) && ((&outstat)->st_dev == (&nullstat)->st_dev)) || ((( (((( (&outstat)->st_mode )) & 0170000) == (0060000)) && (((( (&nullstat)->st_mode )) & 0170000) == (0060000)) ) || ( (((( (&outstat)->st_mode )) & 0170000) == (0020000)) && (((( (&nullstat)->st_mode )) & 0170000) == (0020000)) )) && (&outstat)->st_rdev == (&nullstat)->st_rdev))) comparison_type = type_no_stdout; } if (comparison_type == type_status && (((( stat_buf[0].st_mode )) & 0170000) == (0100000)) && (((( stat_buf[1].st_mode )) & 0170000) == (0100000)) ) { off_t s0 = stat_buf[0].st_size - file_position (0); off_t s1 = stat_buf[1].st_size - file_position (1); if (s0 < 0) s0 = 0; if (s1 < 0) s1 = 0; if (s0 != s1 && (bytes < 0 || ((s0) <= (s1) ? (s0) : (s1)) < bytes)) exit ( 1 ); } buf_size = buffer_lcm (((stat_buf[0]).st_blksize), ((stat_buf[1]).st_blksize), (9223372036854775807L) - sizeof (size_t)); words_per_buffer = (buf_size + 2 * sizeof (size_t) - 1) / sizeof (size_t); buffer[0] = xmalloc (2 * sizeof (size_t) * words_per_buffer); buffer[1] = buffer[0] + words_per_buffer; exit_status = cmp (); for (int f = 0; f < 2; f++) if (close (file_desc[f]) != 0) ((!!sizeof (struct { _Static_assert (2, "verify_expr (" "2" ", " "(error (2, (*__errno_location ()), \"%s\", file[f]), assume (false))" ")"); int _gl_dummy; })) ? ((error (2, (*__errno_location ()) , "%s", file[f]), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (2, (*__errno_location ()) , "%s", file[f]), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); if (exit_status != 0 && comparison_type < type_no_stdout) check_stdout (); exit (exit_status); return exit_status; }
int main(unsigned int a0, unsigned long long *a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) { void* v0; int tmp_15; int tmp_9; int tmp_14; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; char v6; void* v7; void* v8; unsigned long long v9; char v10; char v11; char v12; char v13; char v14; char v15; char v16; char v17; unsigned long v19; void* v20; exit_failure = 2; set_program_name(*(a1)); setlocale(0x6, &g_4021fe); bindtextdomain("diffutils", "/usr/local/share/locale"); textdomain("diffutils"); c_stack_action(0x0); xstdopen(0x0, "/usr/local/share/locale", a2, a3, a4, a5); while (true) { v4 = getopt_long(a0, a1, "bci:ln:sv", &long_options, NULL); if (v4 != -1) { switch (v4) { case 98: case 99: opt_print_bytes = 1; continue; case 105: specify_ignore_initial(0x0, &optarg, 0x3a); optarg = optarg + 1; if (*(optarg) == 58) { specify_ignore_initial(0x1, &optarg, 0x0); break; } else { if (g_401c28 < ignore_initial) g_401c28 = ignore_initial; } continue; case 108: specify_comparison_type(0x1); continue; case 110: if (xstrtoimax(optarg, 0x0, 0x0, &v6, "kKMGTPEZY0")) { LABEL_4004dc: try_help("invalid --bytes value '%s'", optarg); } if (*(&v6) < 0) goto LABEL_4004dc; if (bytes >= 0 && bytes < *(&v6)) continue; bytes = *(&v6); break; case 115: specify_comparison_type(0x3); continue; case 118: v0 = 0; version_etc(stdout, "cmp", "GNU diffutils", Version, proper_name_utf8("Torbjorn Granlund", &g_40224c), proper_name("David MacKenzie")); check_stdout(); goto LABEL_400d6b; case 128: usage(a0, a1, &g_4022c8, &long_options, 0x0, a5); check_stdout(); goto LABEL_400d6b; default: try_help(NULL, 0x0); } } else if (a0 == optind) { try_help("missing operand after '%s'", a1[1 + a0]); } else { tmp_15 = optind; optind = optind + 1; file[0] = a1[tmp_15]; if (a0 > optind) { tmp_9 = optind; optind = optind + 1; v19 = a1[tmp_9]; } else { v19 = "-"; } g_401ac8 = v19; v1 = 0; while (true) { if (v1 > 1) break; if (a0 <= optind) break; tmp_14 = optind; optind = optind + 1; v6 = a1[tmp_14]; specify_ignore_initial(v1, &v6, 0x0); v1 += 1; } if (a0 > optind) try_help("extra operand '%s'", a1[optind]); v2 = 0; while (true) { if (v2 > 1) { if (g_401ae8 == g_401b78 && stat_buf == g_401b70) goto LABEL_4009b9; if ((g_401af8 & 0xf000) == 0x6000 && (g_401b88 & 0xf000) == 0x6000) goto LABEL_4009a6; if ((g_401af8 & 0xf000) != 0x2000) { LABEL_4009c0: *(&v19) = 0; LABEL_4009c5: if (v19 > 0 && g_401af8 == g_401b88 && g_401af0 == g_401b80 && g_401afc == g_401b8c && g_401b00 == g_401b90 && g_401b10 == g_401ba0 && g_401b38 == g_401bc8 && g_401b48 == g_401bd8 && file_position(0x0) == file_position(0x1)) break; if (comparison_type == 3) { LABEL_400b57: if (comparison_type == 3 && (g_401af8 & 0xf000) == 0x8000 && (g_401b88 & 0xf000) == 0x8000) { v7 = g_401b10 - file_position(0x0); v8 = g_401ba0 - file_position(0x1); if ((v7 - 0 >> 63)) v7 = 0; if ((v8 - 0 >> 63)) v8 = 0; if (v7 != v8) { if (bytes >= 0) { v20 = v8; if (v7 <= v8) v20 = v7; if (!(v20 < v20)) goto LABEL_400c43; } exit(0x1); } } LABEL_400c43: buf_size = buffer_lcm(g_401b18, g_401ba8, 0x7ffffffffffffff7, g_401ba8); v9 = buf_size + 15 >> 3; buffer = xmalloc(v9 * 16); g_401c08 = buffer + v9 * 8; v5 = cmp(); v3 = 0; while (v3 <= 1) { if (close(file_desc[v3])) error(0x2, *(__errno_location()), "%s"); v3 += 1; } if (v5 && comparison_type <= 1) check_stdout(); exit(v5); } if (!(!fstat(0x1, &v10))) goto LABEL_400b57; if (!(!stat("/dev/null", &v14))) goto LABEL_400b57; if (*(&v11) == *(&v15) && *(&v10) == *(&v14)) goto LABEL_400b3d; if ((*(&v12) & 0xf000) == 0x6000 && (*(&v16) & 0xf000) == 0x6000) goto LABEL_400b2a; if ((*(&v12) & 0xf000) != 0x2000) { LABEL_400b44: *(&v19) = 0; LABEL_400b49: if (v19 > 0) { comparison_type = 2; goto LABEL_400b57; } } else { if (!((*(&v16) & 0xf000) == 0x2000)) goto LABEL_400b44; } LABEL_400b2a: if (!(*(&v13) == *(&v17))) goto LABEL_400b44; LABEL_400b3d: *(&v19) = 1; goto LABEL_400b49; } else if (!((g_401b88 & 0xf000) == 0x2000)) { goto LABEL_4009c0; } LABEL_4009a6: if (!(g_401b08 == g_401b98)) goto LABEL_4009c0; LABEL_4009b9: *(&v19) = 1; goto LABEL_4009c5; } if (v2 && ignore_initial == g_401c28 && !strcmp(file, g_401ac8)) break; if (strcmp(file[v2], "-")) file_desc[v2] = open(file[v2], 0x0, 0x0); else file_desc[v2] = 0; if (file_desc[v2] < 0) { LABEL_4008b4: if (file_desc[v2] < 0 && comparison_type == 3) exit(0x2); error(0x2, *(__errno_location()), "%s"); } else { if (!(!fstat(file_desc[v2], &(&stat_buf)[16 * v2 + 2 * v2]))) goto LABEL_4008b4; v2 += 1; } } } } LABEL_400d6b: return 0; }
int inflateBackEnd(strm) z_streamp strm; { if (strm == 0 || strm->state == 0 || strm->zfree == (free_func)0) return (-2); (*((strm)->zfree))((strm)->opaque, (voidpf)(strm->state)); strm->state = 0; ; return 0; }
long long inflateBackEnd(unsigned long long a0[11]) { unsigned long long v1; if (!a0) { v1 = 4294967294; return v1; } else if (!a0[7]) { v1 = 4294967294; return v1; } else if (!a0[9]) { v1 = 4294967294; return v1; } else { a0[9](a0[10], a0[7], a0[7], a0[9]); a0[7] = 0; v1 = 0; return v1; } }
char * expand_string_to_string (string, quoted) char *string; int quoted; { return (expand_string_to_string_internal (string, quoted, expand_string)); }
long long expand_string_to_string(char *a0, unsigned long a1) { return expand_string_to_string_internal(a0, a1, expand_string); }
void cu_preinstupgrade(int argc, void **argv) { struct pkginfo *pkg= (struct pkginfo*)argv[0]; char *cidir= (char*)argv[1]; char *cidirrest= (char*)argv[2]; enum pkgstatus *oldstatusp= (enum pkgstatus*)argv[3]; if (cleanup_pkg_failed++) return; maintscript_new(pkg, "postrm", "post-removal", cidir, cidirrest, "abort-upgrade", versiondescribe(&pkg->installed.version, vdew_nonambig), versiondescribe(&pkg->available.version, vdew_nonambig), ((void *)0) ); pkg_set_status(pkg, *oldstatusp); pkg_clear_eflags(pkg, PKG_EFLAG_REINSTREQ); modstatdb_note(pkg); cleanup_pkg_failed--; }
long long cu_preinstupgrade(unsigned long a0, unsigned long long a1[4]) { unsigned long v0; unsigned long v1; void* v2; unsigned int v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned int *v7; unsigned long long v9; v3 = a0; v4 = a1[0]; v5 = a1[1]; v6 = a1[2]; v7 = a1[3]; v9 = cleanup_pkg_failed; cleanup_pkg_failed = cleanup_pkg_failed + 1; if (!v9) { v2 = 0; v1 = versiondescribe(v4 + 272, 0x1); v0 = versiondescribe(v4 + 152, 0x1); maintscript_new(v4, "postrm", "post-removal", v5, v6, "abort-upgrade"); pkg_set_status(v4, *(v7)); pkg_clear_eflags(v4, 0x1); modstatdb_note(v4); v9 = cleanup_pkg_failed - 1; cleanup_pkg_failed = cleanup_pkg_failed - 1; } return v9; }
static int get_sci_portaddr(struct sci *sci, int *argcp, char ***argvp, _Bool port_only, _Bool optional) { int argc = *argcp; char **argv = *argvp; int ret; _Bool p = 0 , a = 0 , s = 0 ; while (argc > 0) { if (strcmp(*argv, "sci") == 0) { if (p) invarg("expected address", *argv); if (a) invarg("expected port", *argv); do { argv++; if (--argc <= 0) incomplete_command(); } while(0); ret = get_sci(&sci->sci, *argv); if (ret) invarg("expected sci", *argv); s = 1 ; } else if (strcmp(*argv, "port") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); ret = get_port(&sci->port, *argv); if (ret) invarg("expected port", *argv); if (sci->port == 0) invarg("expected port != 0", *argv); p = 1 ; } else if (strcmp(*argv, "address") == 0) { do { argv++; if (--argc <= 0) incomplete_command(); } while(0); ret = ll_addr_a2n(sci->abuf, sizeof(sci->abuf), *argv); if (ret < 0) invarg("expected lladdr", *argv); a = 1 ; } else if (optional) { break; } else { invarg("expected sci, port, or address", *argv); } argv++; argc--; if (sci_complete(s, p, a, port_only)) break; } if (!optional && !sci_complete(s, p, a, port_only)) return -1; if (p && a) sci->sci = make_sci(sci->abuf, sci->port); *argvp = argv; *argcp = argc; return p || a || s; }
int get_sci_portaddr(struct_0 *a0, unsigned int *a1, unsigned long long *a2, unsigned long a3, unsigned long a4) { char v0; char v1; char v2; unsigned int v3; unsigned int v4; unsigned long long *v5; unsigned int v8; v3 = *(a1); v5 = *(a2); v0 = 0; v1 = 0; v2 = 0; while (true) { if (v3 <= 0) break; if (!strcmp(*(v5), "sci")) { if (v0) invarg("expected address", *(v5)); if (v1) invarg("expected port", *(v5)); v5 = v5 + 1; v3 -= 1; if (v3 <= 0) incomplete_command(); v4 = get_sci(a0, *(v5)); if (v4) invarg("expected sci", *(v5)); v2 = 1; } else if (!strcmp(*(v5), "port")) { v5 = v5 + 1; v3 -= 1; if (v3 <= 0) incomplete_command(); v4 = get_port(&a0->field_8, *(v5)); if (v4) invarg("expected port", *(v5)); if (!a0->field_8) invarg("expected port != 0", *(v5)); v0 = 1; } else if (!strcmp(*(v5), "address")) { v5 = v5 + 1; v3 -= 1; if (v3 <= 0) incomplete_command(); v4 = ll_addr_a2n(a0 + 1, 0x6, *(v5), a0 + 1); if (v4 < 0) invarg("expected lladdr", *(v5)); v1 = 1; } else { if (a4) break; invarg("expected sci, port, or address", *(v5)); } v5 = v5 + 1; v3 -= 1; if (sci_complete(v2, v0, v1, a3)) break; } if ((a4 ^ 1) && (sci_complete(v2, v0, v1, a3) ^ 1)) { v8 = -1; return v8; } if (v0 && v1) a0->field_0 = make_sci(a0 + 1, a0->field_8); *(a2) = v5; *(a1) = v3; if (v0) { v8 = 1; return v8; } else if (v1) { v8 = 1; return v8; } else if (v2) { v8 = 1; return v8; } else { v8 = 0; return v8; } }
int rl_newline(int count __attribute__((__unused__)), int c __attribute__((__unused__))) { return rl_insert(1, '\n'); }
long long rl_newline(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; v1 = a0; v0 = a1; return rl_insert(0x1, 0xa); }
gl_linked_next_node (gl_list_t list, gl_list_node_t node) { return (node->next != &list->root ? node->next : ((void *)0) ); }
long gl_linked_next_node(long param_1,long *param_2) { long lVar1; if (*param_2 == param_1 + 0x28) { lVar1 = 0; } else { lVar1 = *param_2; } return lVar1; }
static void skip_read (COLUMN *p, int column_number) { int c; FILE *f = p->fp; int i; _Bool single_ff = 0 ; COLUMN *q; if ((c = getc_unlocked (f)) == '\f' && p->full_page_printed) if ((c = getc_unlocked (f)) == '\n') c = getc_unlocked (f); p->full_page_printed = 0 ; if (c == '\f') single_ff = 1 ; if (last_line) p->full_page_printed = 1 ; while (c != '\n') { if (c == '\f') { if (last_line) { if (!parallel_files) for (q = column_vector, i = columns; i; ++q, --i) q->full_page_printed = 0 ; else p->full_page_printed = 0 ; } if ((c = getc_unlocked (f)) != '\n') ungetc (c, f); hold_file (p); break; } else if (c == (-1) ) { close_file (p); break; } c = getc_unlocked (f); } if (skip_count) if ((!parallel_files || column_number == 1) && !single_ff) ++line_count; }
void skip_read(struct_0 *a0, unsigned long a1) { char v0; unsigned int v1; unsigned int v2; struct_1 *v3; void* v4; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; v4 = a0->field_0; v0 = 0; v1 = getc_unlocked(v4); if (v1 == 12 && a0->field_39) { v1 = getc_unlocked(v4); if (v1 == 10) v1 = getc_unlocked(v4); } a0->field_39 = 0; if (v1 == 12) v0 = 1; if (last_line) a0->field_39 = 1; while (true) { if (v1 == 10) break; if (v1 == 12) { if (last_line) { if (!(parallel_files ^ 1)) { a0->field_39 = 0; } else { v3 = column_vector; for (v2 = columns; v2; v2 -= 1) { v3->field_39 = 0; v3 = &v3[1].padding_0[6]; } } } v1 = getc_unlocked(v4); if (v1 != 10) ungetc(v1, v4); hold_file(a0); break; } else if (v1 != -1) { v1 = getc_unlocked(v4); } else { close_file(a0); break; } } v6 = skip_count; if (skip_count) { v7 = parallel_files ^ 1; if (!(parallel_files ^ 1) && !(a1 == 1)) goto LABEL_402b6d; v8 = v0 ^ 1; if ((v0 ^ 1)) { v9 = line_count + 1; line_count = line_count + 1; } } LABEL_402b6d: return; }
static inline _Bool is_smack_enabled (void) { return 0 ; }
int is_smack_enabled() { return 0; }
static void add_range_pair (uintmax_t lo, uintmax_t hi) { if (n_frp == n_frp_allocated) frp = ((!!sizeof (struct { _Static_assert (sizeof *(frp) != 1, "verify_expr (" "sizeof *(frp) != 1" ", " "x2nrealloc (frp, &n_frp_allocated, sizeof *(frp))" ")"); int _gl_dummy; })) ? (x2nrealloc (frp, &n_frp_allocated, sizeof *(frp))) : (x2nrealloc (frp, &n_frp_allocated, sizeof *(frp)))); frp[n_frp].lo = lo; frp[n_frp].hi = hi; ++n_frp; }
void add_range_pair(unsigned long long a0, unsigned long long a1) { unsigned long long v1; if (n_frp_allocated == -881757763951783940) n_frp = x2nrealloc(0xf3c35dfc45b60ffc, &n_frp_allocated, 0x10); g_2ff93dc0a1170fbc = a0; g_2ff93dc0a1170fc4 = a1; v1 = -881757763951783939; n_frp = -881757763951783939; return; }
static void conread(int s) { con *c = &fdcon[s]; size_t n; if (c->c_status == 1) { congreet(s); return; } n = atomicio(read, s, c->c_data + c->c_off, c->c_len - c->c_off); if (n == 0) { sshlog("ssh-keyscan.c", __func__, 571, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "read (%s): %s", c->c_name, strerror( (*__errno_location ()) )); confree(s); return; } c->c_off += n; if (c->c_off == c->c_len) switch (c->c_status) { case 2: c->c_plen = htonl(c->c_plen); c->c_len = c->c_plen + 8 - (c->c_plen & 7); c->c_off = 0; c->c_data = xmalloc(c->c_len); c->c_status = 3; break; default: sshfatal("ssh-keyscan.c", __func__, 587, 0, SYSLOG_LEVEL_FATAL, ((void *)0) , "conread: invalid status %d", c->c_status); break; } contouch(s); }
void conread(int param_1) { int iVar1; uint32_t uVar2; undefined4 uVar3; int *piVar4; undefined8 uVar5; char **ppcVar6; char *pcStack56; ulong uStack48; undefined auStack40 [12]; int local_1c; byte *local_18; long local_10; local_18 = (byte *)((long)param_1 * 0x70 + fdcon); local_1c = param_1; if (*local_18 == 1) { uStack48 = 0x101bf3; congreet(param_1); } else { uStack48 = 0x101c0f; iVar1 = __subvsi3(*(undefined4 *)(local_18 + 0xc),*(undefined4 *)(local_18 + 0x10)); uStack48 = 0x101c41; local_10 = atomicio(uRam0000000000101c39,local_1c, *(long *)(local_18 + 0x40) + (long)*(int *)(local_18 + 0x10),(long)iVar1); if (local_10 == 0) { uStack48 = 0x101c51; piVar4 = __errno_location(); uStack48 = 0x101c5a; pcStack56 = strerror(*piVar4); sshlog("ssh-keyscan.c","conread",0x23b,0,2,0,"read (%s): %s",*(undefined8 *)(local_18 + 0x28)) ; uStack48 = 0x101cac; confree(local_1c); } else { *(int *)(local_18 + 0x10) = (int)local_10 + *(int *)(local_18 + 0x10); ppcVar6 = (char **)auStack40; if (*(int *)(local_18 + 0x10) == *(int *)(local_18 + 0xc)) { if (*local_18 == 2) { uStack48 = 0x101cfc; uVar2 = htonl(*(uint32_t *)(local_18 + 8)); *(uint32_t *)(local_18 + 8) = uVar2; uStack48 = 0x101d18; uVar3 = __addvsi3(*(undefined4 *)(local_18 + 8),8); uStack48 = 0x101d2d; uVar3 = __subvsi3(uVar3,*(uint *)(local_18 + 8) & 7); *(undefined4 *)(local_18 + 0xc) = uVar3; *(undefined4 *)(local_18 + 0x10) = 0; uStack48 = 0x101d52; uVar5 = xmalloc((long)*(int *)(local_18 + 0xc)); *(undefined8 *)(local_18 + 0x40) = uVar5; *local_18 = 3; ppcVar6 = (char **)auStack40; } else { uStack48 = (ulong)*local_18; ppcVar6 = &pcStack56; pcStack56 = "conread: invalid status %d"; sshfatal("ssh-keyscan.c","conread",0x24b,0,1,0); } } *(undefined8 *)((long)ppcVar6 + -8) = 0x101daf; contouch(local_1c); } } return; }
static _Bool parse_ilname (const struct parser_table* entry, char **argv, int *arg_ptr) { const char *name; if (collect_arg (argv, arg_ptr, &name)) { struct predicate *our_pred = insert_primary (entry, name); our_pred->args.str = name; our_pred->est_success_rate = 0.1f * estimate_pattern_match_rate (name, 0); return 1 ; } else { return 0 ; } }
bool parse_ilname(undefined8 param_1,undefined8 param_2,undefined8 param_3) { char cVar1; long in_FS_OFFSET; float fVar2; undefined8 local_20; long local_18; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); cVar1 = collect_arg(param_2,param_3,&local_20); if (cVar1 != '\0') { local_18 = insert_primary(param_1,local_20); *(undefined8 *)(local_18 + 0x38) = local_20; fVar2 = (float)estimate_pattern_match_rate(local_20,0); *(float *)(local_18 + 0x24) = fVar2 * DAT_00106e38; } if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) { return cVar1 != '\0'; } __stack_chk_fail(); }
static _Bool head (char const *filename, int fd, uintmax_t n_units, _Bool count_lines, _Bool elide_from_end) { if (print_headers) write_header (filename); if (elide_from_end) { off_t current_pos = -1; struct stat st; if (fstat (fd, &st) != 0) { error (0, (*__errno_location ()) , gettext ("cannot fstat %s"), quotearg_style (shell_escape_always_quoting_style, filename)); return 0 ; } if (! presume_input_pipe && usable_st_size (&st)) { current_pos = elseek (fd, 0, 1 , filename); if (current_pos < 0) return 0 ; } if (count_lines) return elide_tail_lines_file (filename, fd, n_units, &st, current_pos); else return elide_tail_bytes_file (filename, fd, n_units, &st, current_pos); } if (count_lines) return head_lines (filename, fd, n_units); else return head_bytes (filename, fd, n_units); }
long head(const char *a1, unsigned int a2, size_t a3, char a4, char a5) { long v5; char *v6; int *v7; long v12; struct stat buf; unsigned long v14; v14 = __readfsqword(0x28u); if ( print_headers ) write_header(a1); if ( a5 ) { v12 = -1LL; if ( fstat(a2, &buf) ) { v5 = quotearg_style(4LL, a1); v6 = gettext("cannot fstat %s"); v7 = _errno_location(); error(0, *v7, v6, v5); return 0LL; } else if ( presume_input_pipe != 1 && usable_st_size((long)&buf) && (v12 = elseek(a2, 0LL, 1, (long)a1), v12 < 0) ) { return 0LL; } else if ( a4 ) { return elide_tail_lines_file((long)a1, a2, a3, (long)&buf, v12); } else { return elide_tail_bytes_file((long)a1, a2, a3, (long)&buf, v12); } } else if ( a4 ) { return head_lines((long)a1, a2, a3); } else { return head_bytes((long)a1, a2, a3); } }
static void check_punctuation (WORD *w) { char const *start = w->text; char const *finish = start + (w->length - 1); unsigned char fin = *finish; w->paren = (strchr ("(['`\"", *start) != ((void *)0) ); w->punct = !! ((*__ctype_b_loc ())[(int) (( fin ))] & (unsigned short int) _ISpunct) ; while (start < finish && (strchr (")]'\"", *finish) != ((void *)0) )) finish--; w->period = (strchr (".?!", *finish) != ((void *)0) ); }
void check_punctuation(struct_0 *a0, unsigned long long a1, unsigned long a2, unsigned long a3, unsigned long long a4, unsigned long long a5) { char v0; char v1; char *v2; char *v3; unsigned long long v6; unsigned long long *v7; struct_0 *v9; v3 = a0->field_0; v2 = &v3[1 + a0->field_8]; v1 = *(v2); *(&a1) = *(v3); *(&a2) = strchr("([\'`\"", *(v3)); v6 = a0->field_10 & 4294967294 | a2 & 1; a0->field_10 = v6; v7 = __ctype_b_loc("([\'`\"", a1, v6, a2 & 1, a4, a5, *(&v0)); *(&v6) = v1 * 2; *(&v6) = (*((*(v7) + v1 * 2)) & 4); *(&v6) = a0->field_10 & 4294967291 | ((v6 & 1) * 4); for (a0->field_10 = v6; v3 < v2 && strchr(")]\'\"", *(v2)); v2 += 1); *(&v6) = strchr(".?!", *(v2)); v9 = a0; *(&v6) = a0->field_10 & 4294967293 | ((v6 & 1) * 2); a0->field_10 = v6; return; }
static void print_heredoc_body (redirect) REDIRECT *redirect; { cprintf ("%s%s", redirect->redirectee.filename->word, redirect->here_doc_eof); }
void print_heredoc_body(unsigned long a0) { unsigned long v0; unsigned long long v2; v0 = a0; v2 = cprintf("%s%s"); return; }
const char *strxf_proto(__u8 proto) { static char buf[32]; struct protoent *pp; const char *p; pp = getprotobynumber(proto); if (pp) p = pp->p_name; else { sprintf(buf, "%u", proto); p = buf; } return p; }
int strxf_proto(unsigned long a0) { char v0; unsigned long long v1; unsigned long long *v2; v2 = &getprotobynumber(a0)->p_name; if (v2) { v1 = *(v2); } else { sprintf(&buf.9287, "%u", v0); v1 = &buf.9287; } return v1; }
void initialize_flags () { register int i; for (i = 0; shell_flags[i].name; i++) optflags[i+1] = shell_flags[i].name; optflags[++i] = 'o'; optflags[++i] = ';'; optflags[i+1] = '\0'; }
long long initialize_flags() { void* v1; for (v1 = 0; *((0x400600 + 0x10 * v1)); v1 = v1 + 1) { *((v1 + &g_400581)) = *((0x400600 + 0x10 * v1)); } *((v1 + &g_400581)) = 111; *((v1 + &g_400582)) = 59; *((v1 + &g_400583)) = 0; return v1 + 3; }
static int input_kex_dh_gex_init(int type, u_int32_t seq, struct ssh *ssh) { struct kex *kex = ssh->kex; BIGNUM *dh_client_pub = ((void *)0) ; const BIGNUM *pub_key, *dh_p, *dh_g; struct sshbuf *shared_secret = ((void *)0) ; struct sshbuf *server_host_key_blob = ((void *)0) ; struct sshkey *server_host_public, *server_host_private; u_char *signature = ((void *)0) ; u_char hash[64]; size_t slen, hashlen; int r; sshlog("kexgexs.c", __func__, 141, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "SSH2_MSG_KEX_DH_GEX_INIT received"); ssh_dispatch_set(ssh, 32, &kex_protocol_error); if ((r = kex_load_hostkey(ssh, &server_host_private, &server_host_public)) != 0) goto out; if ((r = sshpkt_get_bignum2(ssh, &dh_client_pub)) != 0 || (r = sshpkt_get_end(ssh)) != 0) goto out; if ((shared_secret = sshbuf_new()) == ((void *)0) ) { r = -2; goto out; } if ((r = kex_dh_compute_key(kex, dh_client_pub, shared_secret)) != 0) goto out; if ((server_host_key_blob = sshbuf_new()) == ((void *)0) ) { r = -2; goto out; } if ((r = sshkey_putb(server_host_public, server_host_key_blob)) != 0) goto out; DH_get0_key(kex->dh, &pub_key, ((void *)0) ); DH_get0_pqg(kex->dh, &dh_p, ((void *)0) , &dh_g); hashlen = sizeof(hash); if ((r = kexgex_hash( kex->hash_alg, kex->client_version, kex->server_version, kex->peer, kex->my, server_host_key_blob, kex->min, kex->nbits, kex->max, dh_p, dh_g, dh_client_pub, pub_key, sshbuf_ptr(shared_secret), sshbuf_len(shared_secret), hash, &hashlen)) != 0) goto out; if ((r = kex->sign(ssh, server_host_private, server_host_public, &signature, &slen, hash, hashlen, kex->hostkey_alg)) < 0) goto out; if ((r = sshpkt_start(ssh, 33)) != 0 || (r = sshpkt_put_stringb(ssh, server_host_key_blob)) != 0 || (r = sshpkt_put_bignum2(ssh, pub_key)) != 0 || (r = sshpkt_put_string(ssh, signature, slen)) != 0 || (r = sshpkt_send(ssh)) != 0) goto out; if ((r = kex_derive_keys(ssh, hash, hashlen, shared_secret)) != 0 || (r = kex_send_newkeys(ssh)) != 0) goto out; if (kex->initial_hostkey == ((void *)0) && (r = sshkey_from_private(server_host_public, &kex->initial_hostkey)) != 0) goto out; out: explicit_bzero(hash, sizeof(hash)); DH_free(kex->dh); kex->dh = ((void *)0) ; BN_clear_free(dh_client_pub); sshbuf_free(shared_secret); sshbuf_free(server_host_key_blob); free(signature); return r; }
long long input_kex_dh_gex_init(unsigned long a0, unsigned long a1, struct_0 *a2) { unsigned long v0; unsigned int v1; unsigned int v2; unsigned int v3; unsigned int v4; unsigned int v5; void* v6; char v7; char v8; char v9; char v10; char v11; void* v12; char v13; unsigned long long v14; void* v15; void* v16; struct_1 *v17; char v18; v4 = a0; v3 = a1; v17 = a2->field_8; v6 = 0; v15 = 0; v16 = 0; v12 = 0; sshlog("kexgexs.c", "input_kex_dh_gex_init", 0x8d, 0x0, 0x5, 0x0); ssh_dispatch_set(a2, 0x20, got.kex_protocol_error); v5 = kex_load_hostkey(a2, &v11, &v10, &v11); if (!v5) { v5 = sshpkt_get_bignum2(a2, &v6, &v6); if (!(v5 || (v5 = sshpkt_get_end(a2), v5))) { v15 = sshbuf_new(); if (!v15) { v5 = -2; } else { v5 = kex_dh_compute_key(v17, v6, v15, v6); if (!v5) { v16 = sshbuf_new(); if (!v16) { v5 = -2; } else { v5 = sshkey_putb(*(&v10), v16, v16); if (!v5) { DH_get0_key(v17->field_118, &v7, 0x0, &v7); DH_get0_pqg(v17->field_118, &v8, 0x0, &v9); v14 = 64; v2 = v17->field_124; v1 = v17->field_128; v5 = kexgex_hash(v17->field_90, v17->field_60, v17->field_68, v17->field_58, v17->field_50, v16, v17->field_120, v1, v2, *(&v8), *(&v9), v6, *(&v7), sshbuf_ptr(v15), sshbuf_len(v15), &v18); if (!v5) { v0 = v17->field_28; v5 = *(((stack_base)[144] + 192))(a2, *(&v11), *(&v10), &v12, &v13, &v18, v14); if (v5 >= 0) { v5 = sshpkt_start(a2, 0x21); if (!v5) { v5 = sshpkt_put_stringb(a2, v16, v16); if (!v5) { v5 = sshpkt_put_bignum2(a2, *(&v7), *(&v7)); if (!v5) { v5 = sshpkt_put_string(a2, v12, *(&v13), v12); if (!v5) { v5 = sshpkt_send(a2); if (!v5) { v5 = kex_derive_keys(a2, &v18, v14, v15); if (!(v5 || (v5 = kex_send_newkeys(a2), v5)) && !v17->field_80) v5 = sshkey_from_private(*(&v10), &v17->field_80, &v17->field_80); } } } } } } } } } } } } } explicit_bzero(&v18, 0x40); DH_free(v17->field_118); v17->field_118 = 0; BN_clear_free(v6); sshbuf_free(v15); sshbuf_free(v16); free(v12); return v5; }
_Bool find_command(const char *prog) { struct varbuf filename = { 0, 0, ((void *)0) }; struct stat stab; const char *path_list; const char *path, *path_end; size_t path_len; path_list = getenv("PATH"); if (!path_list) ohshit(gettext("PATH is not set")); for (path = path_list; path; path = *path_end ? path_end + 1 : ((void *)0) ) { path_end = strchrnul(path, ':'); path_len = (size_t)(path_end - path); varbuf_reset(&filename); varbuf_add_buf(&filename, path, path_len); if (path_len) varbuf_add_char(&filename, '/'); varbuf_add_buf(&filename, prog, strlen(prog)); varbuf_end_str(&filename); if (stat(filename.buf, &stab) == 0 && (stab.st_mode & 0111)) { varbuf_destroy(&filename); return 1 ; } } varbuf_destroy(&filename); return 0 ; }
int find_command(char *a0) { unsigned long v0; char *v1; char *v2; unsigned long long v3; void* v4; void* v5; void* v6; char v7; char v8; unsigned long v10; v4 = 0; v5 = 0; v6 = 0; v1 = getenv("PATH"); if (!v1) ohshit(gettext("PATH is not set")); v0 = v1; while (true) { if (v0) { v2 = strchrnul(v0, 0x3a); v3 = &v2[-1 * v0]; varbuf_reset(&v4); varbuf_add_buf(&v4, v0, v3, v0); if (v3) varbuf_add_char(&v4, 0x2f); varbuf_add_buf(&v4, a0, strlen(a0), a0); varbuf_end_str(&v4); v10 = stat(v6, &v7); if (!v10 && (*(&v8) & 73)) { varbuf_destroy(&v4); *(&v10) = 1; break; } if (!(*(&v8) & 73) || v10) { if (*(v2)) v10 = v2 + 1; else v10 = 0; v0 = v10; } } else { varbuf_destroy(&v4); *(&v10) = 0; break; } } return v10; }
static void print_flags(long flags) { open_json_array(PRINT_JSON, "flags"); if (flags & 0x0001) print_string(PRINT_ANY, ((void *)0) , " %s", "tun"); if (flags & 0x0002) print_string(PRINT_ANY, ((void *)0) , " %s", "tap"); if (!(flags & 0x1000)) print_string(PRINT_ANY, ((void *)0) , " %s", "pi"); if (flags & 0x2000) print_string(PRINT_ANY, ((void *)0) , " %s", "one_queue"); if (flags & 0x0100) print_string(PRINT_ANY, ((void *)0) , " %s", "multi_queue"); if (flags & 0x4000) print_string(PRINT_ANY, ((void *)0) , " %s", "vnet_hdr"); if (flags & 0x0800) print_string(PRINT_ANY, ((void *)0) , " %s", "persist"); if (!(flags & 0x1000)) print_string(PRINT_ANY, ((void *)0) , " %s", "filter"); flags &= ~(0x0001 | 0x0002 | 0x1000 | 0x2000 | 0x0100 | 0x4000 | 0x0800 | 0x1000); if (flags) print_0xhex(PRINT_ANY, ((void *)0) , " %#llx", flags); close_json_array(PRINT_JSON, ((void *)0) ); }
void print_flags(unsigned long long a0) { unsigned long long v0; unsigned long long v2; v0 = a0; open_json_array(0x2, "flags"); if ((v0 & 1)) print_string(0x4, 0x0, " %s", "tun"); if ((v0 & 2)) print_string(0x4, 0x0, " %s", "tap"); if (!(v0 & 0x1000)) print_string(0x4, 0x0, " %s", "pi"); if ((v0 & 0x2000)) print_string(0x4, 0x0, " %s", "one_queue"); if ((v0 & 0x100)) print_string(0x4, 0x0, " %s", "multi_queue"); if ((v0 & 0x4000)) print_string(0x4, 0x0, " %s", "vnet_hdr"); if ((v0 & 0x800)) print_string(0x4, 0x0, " %s", "persist"); if (!(v0 & 0x1000)) print_string(0x4, 0x0, " %s", "filter"); v0 &= -30980; if (v0) print_0xhex(0x4, 0x0, " %#llx", v0); v2 = close_json_array(0x2, 0x0); return; }
void quote_compound_array_list (list, type) WORD_LIST *list; int type; { char *s, *t; WORD_LIST *l; for (l = list; l; l = l->next) { if (l->word == 0 || l->word->word == 0) continue; if ((l->word->flags & (1 << 2)) == 0) { s = (strchr (l->word->word, '\001')) ? quote_escapes (l->word->word) : l->word->word; t = sh_single_quote (s); if (s != l->word->word) sh_xfree((s), "arrayfunc.c", 1069); } else t = quote_compound_array_word (l->word->word, type); sh_xfree((l->word->word), "arrayfunc.c", 1073); l->word->word = t; } }
long long quote_compound_array_list(unsigned long long a0, unsigned long a1) { unsigned long v0; struct_0 *v1; unsigned long long v2; unsigned long long v4; char *v5; v4 = a0; for (v1 = a0; v1; v1 = v1->field_0) { if (!(!v1->field_8 || !v1->field_8->field_0)) { if ((v1->field_8->field_8 & 4)) { v0 = quote_compound_array_word(v1->field_8->field_0, a1); } else { if (strchr(v1->field_8->field_0, 0x1)) v5 = quote_escapes(v1->field_8->field_0); else v5 = v1->field_8->field_0; v2 = v5; v0 = sh_single_quote(v2); if (v2 != v1->field_8->field_0) sh_xfree(v2, "arrayfunc.c", 0x42d); } sh_xfree(v1->field_8->field_0, "arrayfunc.c", 0x431); v1->field_8->field_0 = v0; } v4 = v1->field_0; } return v4; }
static inline void emit_blocksize_note (char const *program) { printf (gettext ("\nDisplay values are in units of the first available SIZE from --block-size,\nand the %s_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\nOtherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\n") , program); }
void emit_blocksize_note(unsigned long a0) { unsigned long v0; unsigned long long v2; v0 = a0; v2 = printf(gettext("\nDisplay values are in units of the first available SIZE from --block-size,\nand the %s_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\nOtherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\n")); return; }
static void check_perms (void) { }
void check_perms() { char v0; unsigned long long v2; v2 = *(&v0); return; }
static int rangecmp_wc (c1, c2, forcecoll) wint_t c1, c2; int forcecoll; { int r; r = charcmp_wc (c1, c2, forcecoll); if (r != 0 || forcecoll) return r; return ((int)(c1 - c2)); }
int rangecmp_wc(unsigned long a0, unsigned long a1, unsigned long a2) { unsigned int v0; unsigned int v2; v0 = charcmp_wc(a0, a1, a2); if (!v0 && !a2) v2 = a0 - a1; if (v0 || a2) v2 = v0; return v2; }
static int huft_free(struct huft *t) { register struct huft *p, *q; p = t; while (p != (struct huft *) ((void *)0) ) { q = (--p)->v.t; free(p); p = q; } return 0; }
void huft_free(unsigned long long a0) { unsigned long long v1; struct_0 *v2; void* v3; for (v1 = a0; v1; v1 = v2->field_8) { v2 = v1 - 16; free(v2); } v3 = 0; return; }
char * utf8_mbschr (s, c) const char *s; int c; { return strchr (s, c); }
long long utf8_mbschr(char *a0, unsigned long a1) { return strchr(a0, a1); }
size_t ssh_digest_bytes(int alg) { const struct ssh_digest *digest = ssh_digest_by_alg(alg); return digest == ((void *)0) ? 0 : digest->digest_len; }
undefined8 ssh_digest_bytes(undefined4 param_1) { long lVar1; undefined8 uVar2; lVar1 = ssh_digest_by_alg(param_1); if (lVar1 == 0) { uVar2 = 0; } else { uVar2 = *(undefined8 *)(lVar1 + 0x10); } return uVar2; }
static KbdintAuthctxt * kbdint_alloc(const char *devs) { KbdintAuthctxt *kbdintctxt; struct sshbuf *b; int i, r; kbdintctxt = xcalloc(1, sizeof(KbdintAuthctxt)); if (strcmp(devs, "") == 0) { if ((b = sshbuf_new()) == ((void *)0) ) sshfatal("auth2-chall.c", __func__, 115, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_new failed"); for (i = 0; devices[i]; i++) { if ((r = sshbuf_putf(b, "%s%s", sshbuf_len(b) ? "," : "", devices[i]->name)) != 0) sshfatal("auth2-chall.c", __func__, 119, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "buffer error"); } if ((kbdintctxt->devices = sshbuf_dup_string(b)) == ((void *)0) ) sshfatal("auth2-chall.c", __func__, 122, 1, SYSLOG_LEVEL_FATAL, ((void *)0) , "sshbuf_dup_string failed"); sshbuf_free(b); } else { kbdintctxt->devices = xstrdup(devs); } sshlog("auth2-chall.c", __func__, 127, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "kbdint_alloc: devices '%s'", kbdintctxt->devices); kbdintctxt->ctxt = ((void *)0) ; kbdintctxt->device = ((void *)0) ; kbdintctxt->nreq = 0; return kbdintctxt; }
int kbdint_alloc(char *a0) { unsigned long long v0; unsigned int v1; unsigned int v2; struct_0 *v3; unsigned long long v4; unsigned long long v5; unsigned long v6; char v7; v3 = xcalloc(0x1, 0x20); if (strcmp(a0, &g_400f60)) { v3->field_0 = xstrdup(a0); } else { v4 = sshbuf_new(); if (!v4) { v0 = "sshbu"; sshfatal("auth2-c", "kbdint_alloc", 0x73, 0x1, 0x1, 0x0); } for (v1 = 0; devices[v1]; v1 = __addvsi3(v1, 0x1)) { v2 = sshbuf_putf(v4, "%s%s", (!sshbuf_len(v4) ? "," : &g_400f60), *(devices[v1])); if (v2) { v5 = "buffer error"; sshfatal("auth2-c", "kbdint_alloc", 0x77, 0x1, 0x1, ssh_err(v2)); } } v3->field_0 = sshbuf_dup_string(v4); if (!v3->field_0) { v5 = "sshbuf_dup_string failed"; sshfatal("auth2-c", "kbdint_alloc", 0x7a, 0x1, 0x1, 0x0); } sshbuf_free(v4); } v6 = v3->field_0; v5 = "kbdint_alloc: devices '%s'"; sshlog("auth2-c", "kbdint_alloc", 0x7f, 0x0, 0x5, 0x0, *(&v7)); v3->field_8 = 0; v3->field_10 = 0; v3->field_18 = 0; return v3; }
static void cpl_fdchk (fd) int fd; { struct cpelement *cpe; for (cpe = coproc_list.head; cpe; cpe = cpe->next) coproc_checkfd (cpe->coproc, fd); }
_QWORD * cpl_fdchk(int a1) { _QWORD *result; _QWORD *i; result = (_QWORD *)coproc_list; for ( i = (_QWORD *)coproc_list; i; i = (_QWORD *)*i ) { coproc_checkfd(i[1], a1); result = (_QWORD *)*i; } return result; }
int main (int argc, char **argv) { const char *tmptty; char tty[ 8192 ]; char ptime[80]; unsigned int delay; unsigned int retries; _Bool subroot = 0 ; _Bool is_console; int err; unsigned int timeout; const char *cp; const char *tmp; char fromhost[512]; struct passwd *pwd = ((void *)0) ; char **envp = environ; const char *failent_user; struct utmp *utent; struct spwd *spwd = ((void *)0) ; sanitize_env (); (void) setlocale ( 6 , ""); (void) bindtextdomain ("shadow", "/usr/share/locale"); (void) textdomain ("shadow"); initenv (); amroot = (getuid () == 0); Prog = Basename (argv[0]); log_set_progname(Prog); log_set_logfd( stderr ); if (geteuid() != 0) { fprintf ( stderr , gettext ("%s: Cannot possibly work without effective root\n"), Prog); exit (1); } process_flags (argc, argv); if ((isatty (0) == 0) || (isatty (1) == 0) || (isatty (2) == 0)) { exit (1); } utent = get_current_utmp (); if (!amroot && ( ((void *)0) == utent)) { (void) puts (gettext ("No utmp entry. You must exec \"login\" from the lowest level \"sh\"")); exit (1); } tmptty = ttyname (0); if ( ((void *)0) == tmptty) { tmptty = "UNKNOWN"; } (strncpy((tty), (tmptty), sizeof(tty) - 1), (tty)[sizeof(tty) - 1] = '\0'); is_console = console (tty); if ( 0 || hflg) { addenv ("REMOTEHOST", hostname); } if (fflg) { preauth_flag = 1 ; } if (hflg) { reason = 202; } openlog("login", ( 0x01 ), (10<<3) ); setup_tty (); (void) umask (getdef_num ("UMASK", 022)); { long limit = getdef_long ("ULIMIT", -1L); if (limit != -1) { set_filesize_limit (limit); } } if (pflg) { while ( ((void *)0) != *envp) { addenv (*envp, ((void *)0) ); envp++; } } { if (!pflg) { tmp = getenv ("TERM"); if ( ((void *)0) != tmp) { addenv ("TERM", tmp); } } } init_env (); if (optind < argc) { set_env (argc - optind, &argv[optind]); } if ( 0 || hflg) { cp = hostname; } else if (( ((void *)0) != utent) && ('\0' != utent->ut_host[0])) { cp = utent->ut_host; } else { cp = ""; } if ('\0' != *cp) { snprintf (fromhost, sizeof fromhost, " on '%.100s' from '%.200s'", tty, cp); } else { snprintf (fromhost, sizeof fromhost, " on '%.100s'", tty); } top: timeout = getdef_unum ("LOGIN_TIMEOUT", 60); snprintf (tmsg, sizeof tmsg, gettext ("\nLogin timed out after %u seconds.\n"), timeout); (void) signal ( 14 , alarm_handler); if (timeout > 0) { (void) alarm (timeout); } environ = newenvp; delay = getdef_unum ("FAIL_DELAY", 1); retries = getdef_unum ("LOGIN_RETRIES", 3); while ( 1 ) { _Bool failed; const char *user_passwd = "!"; if ( ((void *)0) != pwd) { pw_free (pwd); pwd = ((void *)0) ; } if ( ((void *)0) != spwd) { spw_free (spwd); spwd = ((void *)0) ; } failed = 0 ; if ( ((void *)0) == username) { if (subroot) { closelog (); exit (1); } preauth_flag = 0 ; username = xmalloc ((sizeof (((struct utmpx *) ((void *)0) )->ut_user)) + 1); username[(sizeof (((struct utmpx *) ((void *)0) )->ut_user))] = '\0'; login_prompt (gettext ("\n%s login: "), username, (sizeof (((struct utmpx *) ((void *)0) )->ut_user))); if ('\0' == username[0]) { free (username); username = ((void *)0) ; continue; } } failent_user = get_failent_user (username); pwd = xgetpwnam (username); if ( ((void *)0) == pwd) { preauth_flag = 0 ; failed = 1 ; } else { user_passwd = pwd->pw_passwd; if ( ('!' == user_passwd[0]) || ('*' == user_passwd[0])) { failed = 1 ; } if (strcmp (user_passwd, "") == 0) { char *prevent_no_auth = getdef_str("PREVENT_NO_AUTH"); if (prevent_no_auth == ((void *)0) ) { prevent_no_auth = "superuser"; } if (strcmp(prevent_no_auth, "yes") == 0) { failed = 1 ; } else if ((pwd->pw_uid == 0) && (strcmp(prevent_no_auth, "superuser") == 0)) { failed = 1 ; } } } if (strcmp (user_passwd, "x") == 0) { spwd = xgetspnam (username); if ( ((void *)0) != spwd) { user_passwd = spwd->sp_pwdp; } else { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "no shadow password for '%s'%s", username, fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; } } if (preauth_flag) { goto auth_ok; } if (pw_auth (user_passwd, username, reason, (char *) 0) == 0) { goto auth_ok; } do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "invalid password for '%s' %s", failent_user, fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; failed = 1 ; auth_ok: if ( !failed && ( ((void *)0) != pwd) && (0 == pwd->pw_uid) && !is_console) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 2 , "ILLEGAL ROOT LOGIN %s", fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); failed = 1 ; } if ( !failed && !login_access (username, ('\0' != *hostname) ? hostname : tty)) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "LOGIN '%s' REFUSED %s", username, fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; failed = 1 ; } if ( ( ((void *)0) != pwd) && getdef_bool ("FAILLOG_ENAB") && !failcheck (pwd->pw_uid, &faillog, failed)) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 2 , "exceeded failure limit for '%s' %s", username, fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; failed = 1 ; } if (!failed) { break; } if (( ((void *)0) != pwd) && getdef_bool ("FAILLOG_ENAB")) { failure (pwd->pw_uid, tty, &faillog); } if (getdef_str ("FTMP_FILE") != ((void *)0) ) { struct utmp *failent = prepare_utmp (failent_user, tty, hostname, utent); failtmp (failent_user, failent); free (failent); } retries--; if (retries <= 0) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 2 , "REPEATED login failures%s", fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; } if (user_passwd[0] == '\0') { pw_auth ("!", username, reason, (char *) 0); } free (username); username = ((void *)0) ; if (delay > 0) { (void) sleep (delay); } (void) puts (gettext ("Login incorrect")); if ( 0 || fflg || (retries <= 0)) { closelog (); exit (1); } } ((void) sizeof ((((void *)0) != username ) ? 1 : 0), __extension__ ({ if (((void *)0) != username ) ; else __assert_fail ( "NULL != username" , "login.c", 1098, __extension__ __PRETTY_FUNCTION__); })) ; ((void) sizeof ((((void *)0) != pwd ) ? 1 : 0), __extension__ ({ if (((void *)0) != pwd ) ; else __assert_fail ( "NULL != pwd" , "login.c", 1099, __extension__ __PRETTY_FUNCTION__); })) ; (void) alarm (0); if ( getdef_bool ("PORTTIME_CHECKS_ENAB") && !isttytime (username, tty, time ((time_t *) 0))) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "invalid login time for '%s'%s", username, fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; closelog (); bad_time_notify (); exit (1); } check_nologin (pwd->pw_uid == 0); if (getenv ("IFS")) { addenv ("IFS= \t\n", ((void *)0) ); } if (pwd->pw_shell[0] == '*') { pwd->pw_shell++; subsystem (pwd); subroot = 1 ; endpwent (); endgrent (); endspent (); endsgent (); goto top; } if ( getdef_bool ("LASTLOG_ENAB") && pwd->pw_uid <= (uid_t) getdef_ulong ("LASTLOG_UID_MAX", 0xFFFFFFFFUL)) { dolastlog (&ll, pwd, tty, hostname); } if ( ((void *)0) != spwd) { if (expire (pwd, spwd)) { pw_free (pwd); pwd = xgetpwnam (username); if ( ((void *)0) == pwd) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 3 , "cannot find user %s after update of expired password", username) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; exit (1); } spw_free (spwd); spwd = xgetspnam (username); } } setup_limits (pwd); chown_tty (pwd); if (getppid() == 1) { setsid(); if (ioctl(0, 0x540E , 1) != 0) { fprintf ( stderr , gettext ("TIOCSCTTY failed on %s"), tty); } } update_utmp (username, tty, hostname, utent); endpwent (); endgrent (); endspent (); endsgent (); if (setup_uid_gid (pwd, is_console)) { exit (1); } setup_env (pwd); (void) setlocale ( 6 , ""); (void) bindtextdomain ("shadow", "/usr/share/locale"); (void) textdomain ("shadow"); if (!hushed (username)) { addenv ("HUSHLOGIN=FALSE", ((void *)0) ); motd (); if ( getdef_bool ("FAILLOG_ENAB") && (0 != faillog.fail_cnt)) { failprint (&faillog); if ( (0 != faillog.fail_max) && (faillog.fail_cnt >= faillog.fail_max)) { (void) puts (gettext ("Warning: login re-enabled after temporary lockout.")); do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 4 , "login '%s' re-enabled after temporary lockout (%d failures)", username, (int) faillog.fail_cnt) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ) ; } } if ( getdef_bool ("LASTLOG_ENAB") && pwd->pw_uid <= (uid_t) getdef_ulong ("LASTLOG_UID_MAX", 0xFFFFFFFFUL) && (ll.ll_time != 0)) { time_t ll_time = ll.ll_time; (void) strftime (ptime, sizeof (ptime), "%a %b %e %H:%M:%S %z %Y", localtime (&ll_time)); printf (gettext ("Last login: %s on %s"), ptime, ll.ll_line); if ('\0' != ll.ll_host[0]) { printf (gettext (" from %.*s"), (int) sizeof ll.ll_host, ll.ll_host); } printf (".\n"); } agecheck (spwd); mailcheck (); } else { addenv ("HUSHLOGIN=TRUE", ((void *)0) ); } ttytype (tty); (void) signal ( 3 , ((__sighandler_t) 0) ); (void) signal ( 15 , ((__sighandler_t) 0) ); (void) signal ( 14 , ((__sighandler_t) 0) ); (void) signal ( 1 , ((__sighandler_t) 0) ); (void) signal ( 2 , ((__sighandler_t) 0) ); if (0 == pwd->pw_uid) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 5 , "ROOT LOGIN %s", fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } else if (getdef_bool ("LOG_OK_LOGINS")) { do { char *old_locale = setlocale ( 6 , ((void *)0) ); char *saved_locale = ((void *)0) ; if ( ((void *)0) != old_locale) { saved_locale = strdup (old_locale); } if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , "C"); } syslog ( 6 , "'%s' logged in %s", username, fromhost) ; if ( ((void *)0) != saved_locale) { (void) setlocale ( 6 , saved_locale); free (saved_locale); } } while ( 0 ); } closelog (); tmp = getdef_str ("FAKE_SHELL"); if ( ((void *)0) != tmp) { err = shell (tmp, pwd->pw_shell, newenvp); } else { err = shell (pwd->pw_shell, (char *) 0, newenvp); } return ((err == 2 ) ? 127 : 126); }
int main(unsigned long long a0, char **a1, unsigned long long a2, char *a3, unsigned long long a4, unsigned long long a5) { unsigned long long *v0; char v1; char v2; char v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned long v8; unsigned long long v9; unsigned long v10; void* v11; unsigned long v12; struct_0 *v13; unsigned long long v14; unsigned long long v15; void* v16; void* v17; void* v18; void* v19; void* v20; void* v21; void* v22; void* v23; void* v24; void* v25; void* v26; struct_1 *v27; unsigned long long v28; unsigned long long v29; unsigned long long v30; char *v31; char *v32; char *v33; char *v34; char *v35; void* v36; char *v37; char *v38; char *v39; char *v40; char *v41; char *v42; char v43; char v44; char v45; char v46; unsigned long long v47; char v48; unsigned long v50; v47 = *(&v47); v46 = *(&v46); v0 = a1; v1 = 0; v11 = 0; v12 = environ; v13 = 0; sanitize_env(); setlocale(0x6, &g_402180); bindtextdomain("shadow", "/usr/share/locale"); textdomain("shadow"); initenv("shadow", "/usr/share/locale", a2, a3, a4, a5); amroot = !getuid(); Prog = Basename(*(v0)); log_set_progname(0x1d8b4808ec834853); log_set_logfd(stderr); if (geteuid()) { fprintf(stderr, gettext("%s: Cannot possibly work without effective root\n")); exit(0x1); } process_flags(a0, v0); if (isatty(0x0) && isatty(0x1) && isatty(0x2)) { v27 = get_current_utmp(); if ((amroot ^ 1) && !v27) { puts(gettext("No utmp entry. You must exec \"login\" from the lowest level \"sh\"")); exit(0x1); } v9 = ttyname(0x0); if (!v9) v9 = "UNKNOWN"; strncpy(&v45, v9, 0x1fff); v48 = 0; v3 = console(&v45); if (hflg) addenv("REMOTEHOST", hostname); if (fflg) preauth_flag = 1; if (hflg) reason = 202; openlog("login", 0x1, 0x50); setup_tty(); umask(getdef_num("UMASK", 0x12)); v28 = getdef_long("ULIMIT", 0xffffffffffffffff); if (v28 != -1) set_filesize_limit(v28); if (pflg) { for (; *(v12); v12 += 8) { addenv(*(v12), 0x0); } } if ((pflg ^ 1)) { v29 = getenv("TERM"); if (v29) addenv("TERM", v29); } init_env(); if (a0 > optind) set_env(a0 - optind, &v0[optind], &v0[optind], a0 - optind); if (hflg) { v10 = hostname; } else { if (v27 && v27->field_4c) { v10 = &v27->field_4c; goto LABEL_400b33; } v10 = &g_402180; } LABEL_400b33: if (!*(v10)) snprintf(&v44, 0x200, " on '%.100s'", &v45); else snprintf(&v44, 0x200, " on '%.100s' from '%.200s'", &v45, v10); while (true) { v6 = getdef_unum("LOGIN_TIMEOUT", 0x3c); snprintf(&tmsg, 0x100, gettext("\nLogin timed out after %u seconds.\n")); signal(0xe, alarm_handler); if (v6) alarm(v6); *(&environ[0]) = newenvp; v7 = getdef_unum("FAIL_DELAY", 0x1); v4 = getdef_unum("LOGIN_RETRIES", 0x3); while (true) { v14 = "!"; if (v11) { pw_free(v11); v11 = 0; } if (v13) { spw_free(v13); v13 = 0; } v2 = 0; if (!username) { if (v1) { closelog(); exit(0x1); } preauth_flag = 0; username = xmalloc(0x21); *(&username[32]) = 0; login_prompt(gettext("\n%s login: "), username, 0x20); if (!*(username)) { free(username); username = 0; continue; } } v30 = get_failent_user(username); v11 = xgetpwnam(username); if (!v11) { preauth_flag = 0; v2 = 1; goto LABEL_400e58; } v14 = v11[8]; if (*(v14) != 33 && !(*(v14) == 42)) goto LABEL_400dc1; v2 = 1; LABEL_400dc1: if (!strcmp(v14, &g_402180)) { v15 = getdef_str("PREVENT_NO_AUTH"); if (!v15) v15 = "superuser"; if (!strcmp(v15, "yes")) { v2 = 1; } else if (!v11[16] && !strcmp(v15, "superuser")) { v2 = 1; } } LABEL_400e58: if (!strcmp(v14, "x")) { v13 = xgetspnam(username); if (v13) { v14 = v13->field_8; } else { v31 = setlocale(0x6, NULL); v16 = 0; if (v31) v16 = strdup(v31); if (v16) setlocale(0x6, "C"); syslog(0x4, "no shadow password for '%s'%s"); if (v16) { setlocale(0x6, v16); free(v16); } } } if (!preauth_flag && pw_auth(v14, username, reason, 0x0)) { v32 = setlocale(0x6, NULL); v17 = 0; if (v32) v17 = strdup(v32); if (v17) setlocale(0x6, "C"); syslog(0x4, "invalid password for '%s' %s"); if (v17) { setlocale(0x6, v17); free(v17); } v2 = 1; } if ((v2 ^ 1) && v11 && !v11[16] && (v3 ^ 1)) { v33 = setlocale(0x6, NULL); v18 = 0; if (v33) v18 = strdup(v33); if (v18) setlocale(0x6, "C"); syslog(0x2, "ILLEGAL ROOT LOGIN %s"); if (v18) { setlocale(0x6, v18); free(v18); } v2 = 1; } if ((v2 ^ 1)) { if (!*(hostname)) v50 = &v45; else v50 = hostname; if (!login_access(username, v50, username)) { v34 = setlocale(0x6, NULL); v19 = 0; if (v34) v19 = strdup(v34); if (v19) setlocale(0x6, "C"); syslog(0x4, "LOGIN '%s' REFUSED %s"); if (v19) { setlocale(0x6, v19); free(v19); } v2 = 1; } } if (v11 && getdef_bool("FAILLOG_ENAB") && !failcheck(v11[16], &faillog, v2)) { v35 = setlocale(0x6, NULL); v20 = 0; if (v35) v20 = strdup(v35); if (v20) setlocale(0x6, "C"); syslog(0x2, "exceeded failure limit for '%s' %s"); if (v20) { setlocale(0x6, v20); free(v20); } v2 = 1; } if ((v2 ^ 1)) { if (!username) { __assert_fail(); } else if (!v11) { __assert_fail(); } else { alarm(0x0); if (getdef_bool("PORTTIME_CHECKS_ENAB")) { *(&v50) = isttytime(username, &v45, time(NULL), &v45) ^ 1; if (v50) { v38 = setlocale(0x6, NULL); v22 = 0; if (v38) v22 = strdup(v38); if (v22) setlocale(0x6, "C"); syslog(0x4, "invalid login time for '%s'%s"); if (v22) { setlocale(0x6, v22); free(v22); } closelog(); bad_time_notify(); exit(0x1); } } check_nologin(!v11[16]); if (getenv("IFS")) addenv("IFS= \t\n", 0x0); if (*(v11[40]) == 42) { *(&v11[40]) = v11[40] + 1; subsystem(v11); v1 = 1; endpwent(); endgrent(); endspent(a0, a1, a2, a3, a4, a5); endsgent(a0, a1, a2, a3, a4, a5); break; } else { if (getdef_bool("LASTLOG_ENAB") && v11[16] <= getdef_ulong("LASTLOG_UID_MAX", 0xffffffff)) dolastlog(&ll, v11, &v45, hostname); if (v13 && expire(v11, v13, v13)) { pw_free(v11); v11 = xgetpwnam(username); if (v11) { spw_free(v13); v13 = xgetspnam(username); } else { v39 = setlocale(0x6, NULL); v23 = 0; if (v39) v23 = strdup(v39); if (v23) setlocale(0x6, "C"); syslog(0x3, "cannot find user %s after update of expired password"); if (v23) { setlocale(0x6, v23); free(v23); } exit(0x1); } } setup_limits(v11); chown_tty(v11); if (getppid() == 1) { setsid(); if (ioctl(0x0, 0x540e)) fprintf(stderr, gettext("TIOCSCTTY failed on %s")); } update_utmp(username, &v45, hostname, v27); endpwent(); endgrent(); endspent(a0, &v45, a2, a3, a4, a5); endsgent(a0, &v45, a2, a3, a4, a5); if (setup_uid_gid(v11, v3, v3)) exit(0x1); setup_env(v11); setlocale(0x6, &g_402180); bindtextdomain("shadow", "/usr/share/locale"); textdomain("shadow"); *(&v50) = hushed(username) ^ 1; if (!v50) { addenv("HUSHLOGIN=TRUE", 0x0); } else { addenv("HUSHLOGIN=FALSE", 0x0); motd("HUSHLOGIN=FALSE", 0x0, a2, a3, a4, a5); if (getdef_bool("FAILLOG_ENAB") && faillog) { failprint(&faillog); if (g_402162 && faillog >= g_402162) { puts(gettext("Warning: login re-enabled after temporary lockout.")); v40 = setlocale(0x6, NULL); v24 = 0; if (v40) v24 = strdup(v40); if (v24) setlocale(0x6, "C"); a3 = faillog; a2 = username; syslog(0x4, "login '%s' re-enabled after temporary lockout (%d failures)"); if (v24) { setlocale(0x6, v24); free(v24); } } } if (getdef_bool("LASTLOG_ENAB") && v11[16] <= getdef_ulong("LASTLOG_UID_MAX", 0xffffffff) && ll) { v8 = ll; strftime(&v43, 0x50, "%a %b %e %H:%M:%S %z %Y", localtime(&v8)); a3 = gettext("Last login: %s on %s"); a2 = &g_401f24; a1 = &v43; printf(a3); if (g_401f44) { a2 = &g_401f44; a1 = 0x100; printf(gettext(" from %.*s")); } printf(".\n"); } agecheck(v13); mailcheck(a0, a1, a2, a3, a4, a5); } ttytype(&v45); signal(0x3, 0x0); signal(0xf, 0x0); signal(0xe, 0x0); signal(0x1, 0x0); signal(0x2, 0x0); if (!v11[16]) { v42 = setlocale(0x6, NULL); v25 = 0; if (v42) v25 = strdup(v42); if (v25) setlocale(0x6, "C"); syslog(0x5, "ROOT LOGIN %s"); if (v25) { setlocale(0x6, v25); free(v25); } } else if (getdef_bool("LOG_OK_LOGINS")) { v41 = setlocale(0x6, NULL); v26 = 0; if (v41) v26 = strdup(v41); if (v26) setlocale(0x6, "C"); syslog(0x6, "'%s' logged in %s"); if (v26) { setlocale(0x6, v26); free(v26); } } closelog(); v29 = getdef_str("FAKE_SHELL"); if (v29) v5 = shell(v29, v11[40], newenvp, v11[40]); else v5 = shell(v11[40], 0x0, newenvp, a3); if (v5 == 2) *(&v50) = 127; else *(&v50) = 126; return v50; } } } if (v11 && getdef_bool("FAILLOG_ENAB")) failure(v11[16], &v45, &faillog, &v45); if (getdef_str("FTMP_FILE")) { v36 = prepare_utmp(v30, &v45, hostname, v27); failtmp(v30, v36, v36); free(v36); } v4 -= 1; if (!v4) { v37 = setlocale(0x6, NULL); v21 = 0; if (v37) v21 = strdup(v37); if (v21) setlocale(0x6, "C"); syslog(0x2, "REPEATED login failures%s"); if (v21) { setlocale(0x6, v21); free(v21); } } if (!*(v14)) pw_auth("!", username, reason, 0x0); free(username); username = 0; if (v7) sleep(v7); puts(gettext("Login incorrect")); if (fflg) { LABEL_40154d: closelog(); exit(0x1); } else if (!v4) { goto LABEL_40154d; } } } } exit(0x1); }
void chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes) { u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; u8 *ctarget = ((void *)0) ; u8 tmp[64]; u_int i; if (!bytes) return; j0 = x->input[0]; j1 = x->input[1]; j2 = x->input[2]; j3 = x->input[3]; j4 = x->input[4]; j5 = x->input[5]; j6 = x->input[6]; j7 = x->input[7]; j8 = x->input[8]; j9 = x->input[9]; j10 = x->input[10]; j11 = x->input[11]; j12 = x->input[12]; j13 = x->input[13]; j14 = x->input[14]; j15 = x->input[15]; for (;;) { if (bytes < 64) { for (i = 0;i < bytes;++i) tmp[i] = m[i]; m = tmp; ctarget = c; c = tmp; } x0 = j0; x1 = j1; x2 = j2; x3 = j3; x4 = j4; x5 = j5; x6 = j6; x7 = j7; x8 = j8; x9 = j9; x10 = j10; x11 = j11; x12 = j12; x13 = j13; x14 = j14; x15 = j15; for (i = 20;i > 0;i -= 2) { x0 = (((u32)((x0) + (x4)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x0))) << (16)) & (0xFFFFFFFFU)) | ((((x12) ^ (x0))) >> (32 - (16))))); x8 = (((u32)((x8) + (x12)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x8))) << (12)) & (0xFFFFFFFFU)) | ((((x4) ^ (x8))) >> (32 - (12))))); x0 = (((u32)((x0) + (x4)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x0))) << (8)) & (0xFFFFFFFFU)) | ((((x12) ^ (x0))) >> (32 - (8))))); x8 = (((u32)((x8) + (x12)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x8))) << (7)) & (0xFFFFFFFFU)) | ((((x4) ^ (x8))) >> (32 - (7))))); x1 = (((u32)((x1) + (x5)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x1))) << (16)) & (0xFFFFFFFFU)) | ((((x13) ^ (x1))) >> (32 - (16))))); x9 = (((u32)((x9) + (x13)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x9))) << (12)) & (0xFFFFFFFFU)) | ((((x5) ^ (x9))) >> (32 - (12))))); x1 = (((u32)((x1) + (x5)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x1))) << (8)) & (0xFFFFFFFFU)) | ((((x13) ^ (x1))) >> (32 - (8))))); x9 = (((u32)((x9) + (x13)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x9))) << (7)) & (0xFFFFFFFFU)) | ((((x5) ^ (x9))) >> (32 - (7))))); x2 = (((u32)((x2) + (x6)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x2))) << (16)) & (0xFFFFFFFFU)) | ((((x14) ^ (x2))) >> (32 - (16))))); x10 = (((u32)((x10) + (x14)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x10))) << (12)) & (0xFFFFFFFFU)) | ((((x6) ^ (x10))) >> (32 - (12))))); x2 = (((u32)((x2) + (x6)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x2))) << (8)) & (0xFFFFFFFFU)) | ((((x14) ^ (x2))) >> (32 - (8))))); x10 = (((u32)((x10) + (x14)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x10))) << (7)) & (0xFFFFFFFFU)) | ((((x6) ^ (x10))) >> (32 - (7))))); x3 = (((u32)((x3) + (x7)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x3))) << (16)) & (0xFFFFFFFFU)) | ((((x15) ^ (x3))) >> (32 - (16))))); x11 = (((u32)((x11) + (x15)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x11))) << (12)) & (0xFFFFFFFFU)) | ((((x7) ^ (x11))) >> (32 - (12))))); x3 = (((u32)((x3) + (x7)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x3))) << (8)) & (0xFFFFFFFFU)) | ((((x15) ^ (x3))) >> (32 - (8))))); x11 = (((u32)((x11) + (x15)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x11))) << (7)) & (0xFFFFFFFFU)) | ((((x7) ^ (x11))) >> (32 - (7))))); x0 = (((u32)((x0) + (x5)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x0))) << (16)) & (0xFFFFFFFFU)) | ((((x15) ^ (x0))) >> (32 - (16))))); x10 = (((u32)((x10) + (x15)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x10))) << (12)) & (0xFFFFFFFFU)) | ((((x5) ^ (x10))) >> (32 - (12))))); x0 = (((u32)((x0) + (x5)) & (0xFFFFFFFFU))); x15 = ((((u32)((((x15) ^ (x0))) << (8)) & (0xFFFFFFFFU)) | ((((x15) ^ (x0))) >> (32 - (8))))); x10 = (((u32)((x10) + (x15)) & (0xFFFFFFFFU))); x5 = ((((u32)((((x5) ^ (x10))) << (7)) & (0xFFFFFFFFU)) | ((((x5) ^ (x10))) >> (32 - (7))))); x1 = (((u32)((x1) + (x6)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x1))) << (16)) & (0xFFFFFFFFU)) | ((((x12) ^ (x1))) >> (32 - (16))))); x11 = (((u32)((x11) + (x12)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x11))) << (12)) & (0xFFFFFFFFU)) | ((((x6) ^ (x11))) >> (32 - (12))))); x1 = (((u32)((x1) + (x6)) & (0xFFFFFFFFU))); x12 = ((((u32)((((x12) ^ (x1))) << (8)) & (0xFFFFFFFFU)) | ((((x12) ^ (x1))) >> (32 - (8))))); x11 = (((u32)((x11) + (x12)) & (0xFFFFFFFFU))); x6 = ((((u32)((((x6) ^ (x11))) << (7)) & (0xFFFFFFFFU)) | ((((x6) ^ (x11))) >> (32 - (7))))); x2 = (((u32)((x2) + (x7)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x2))) << (16)) & (0xFFFFFFFFU)) | ((((x13) ^ (x2))) >> (32 - (16))))); x8 = (((u32)((x8) + (x13)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x8))) << (12)) & (0xFFFFFFFFU)) | ((((x7) ^ (x8))) >> (32 - (12))))); x2 = (((u32)((x2) + (x7)) & (0xFFFFFFFFU))); x13 = ((((u32)((((x13) ^ (x2))) << (8)) & (0xFFFFFFFFU)) | ((((x13) ^ (x2))) >> (32 - (8))))); x8 = (((u32)((x8) + (x13)) & (0xFFFFFFFFU))); x7 = ((((u32)((((x7) ^ (x8))) << (7)) & (0xFFFFFFFFU)) | ((((x7) ^ (x8))) >> (32 - (7))))); x3 = (((u32)((x3) + (x4)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x3))) << (16)) & (0xFFFFFFFFU)) | ((((x14) ^ (x3))) >> (32 - (16))))); x9 = (((u32)((x9) + (x14)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x9))) << (12)) & (0xFFFFFFFFU)) | ((((x4) ^ (x9))) >> (32 - (12))))); x3 = (((u32)((x3) + (x4)) & (0xFFFFFFFFU))); x14 = ((((u32)((((x14) ^ (x3))) << (8)) & (0xFFFFFFFFU)) | ((((x14) ^ (x3))) >> (32 - (8))))); x9 = (((u32)((x9) + (x14)) & (0xFFFFFFFFU))); x4 = ((((u32)((((x4) ^ (x9))) << (7)) & (0xFFFFFFFFU)) | ((((x4) ^ (x9))) >> (32 - (7))))); } x0 = (((u32)((x0) + (j0)) & (0xFFFFFFFFU))); x1 = (((u32)((x1) + (j1)) & (0xFFFFFFFFU))); x2 = (((u32)((x2) + (j2)) & (0xFFFFFFFFU))); x3 = (((u32)((x3) + (j3)) & (0xFFFFFFFFU))); x4 = (((u32)((x4) + (j4)) & (0xFFFFFFFFU))); x5 = (((u32)((x5) + (j5)) & (0xFFFFFFFFU))); x6 = (((u32)((x6) + (j6)) & (0xFFFFFFFFU))); x7 = (((u32)((x7) + (j7)) & (0xFFFFFFFFU))); x8 = (((u32)((x8) + (j8)) & (0xFFFFFFFFU))); x9 = (((u32)((x9) + (j9)) & (0xFFFFFFFFU))); x10 = (((u32)((x10) + (j10)) & (0xFFFFFFFFU))); x11 = (((u32)((x11) + (j11)) & (0xFFFFFFFFU))); x12 = (((u32)((x12) + (j12)) & (0xFFFFFFFFU))); x13 = (((u32)((x13) + (j13)) & (0xFFFFFFFFU))); x14 = (((u32)((x14) + (j14)) & (0xFFFFFFFFU))); x15 = (((u32)((x15) + (j15)) & (0xFFFFFFFFU))); x0 = ((x0) ^ ((((u32)((m + 0)[0]) ) | ((u32)((m + 0)[1]) << 8) | ((u32)((m + 0)[2]) << 16) | ((u32)((m + 0)[3]) << 24)))); x1 = ((x1) ^ ((((u32)((m + 4)[0]) ) | ((u32)((m + 4)[1]) << 8) | ((u32)((m + 4)[2]) << 16) | ((u32)((m + 4)[3]) << 24)))); x2 = ((x2) ^ ((((u32)((m + 8)[0]) ) | ((u32)((m + 8)[1]) << 8) | ((u32)((m + 8)[2]) << 16) | ((u32)((m + 8)[3]) << 24)))); x3 = ((x3) ^ ((((u32)((m + 12)[0]) ) | ((u32)((m + 12)[1]) << 8) | ((u32)((m + 12)[2]) << 16) | ((u32)((m + 12)[3]) << 24)))); x4 = ((x4) ^ ((((u32)((m + 16)[0]) ) | ((u32)((m + 16)[1]) << 8) | ((u32)((m + 16)[2]) << 16) | ((u32)((m + 16)[3]) << 24)))); x5 = ((x5) ^ ((((u32)((m + 20)[0]) ) | ((u32)((m + 20)[1]) << 8) | ((u32)((m + 20)[2]) << 16) | ((u32)((m + 20)[3]) << 24)))); x6 = ((x6) ^ ((((u32)((m + 24)[0]) ) | ((u32)((m + 24)[1]) << 8) | ((u32)((m + 24)[2]) << 16) | ((u32)((m + 24)[3]) << 24)))); x7 = ((x7) ^ ((((u32)((m + 28)[0]) ) | ((u32)((m + 28)[1]) << 8) | ((u32)((m + 28)[2]) << 16) | ((u32)((m + 28)[3]) << 24)))); x8 = ((x8) ^ ((((u32)((m + 32)[0]) ) | ((u32)((m + 32)[1]) << 8) | ((u32)((m + 32)[2]) << 16) | ((u32)((m + 32)[3]) << 24)))); x9 = ((x9) ^ ((((u32)((m + 36)[0]) ) | ((u32)((m + 36)[1]) << 8) | ((u32)((m + 36)[2]) << 16) | ((u32)((m + 36)[3]) << 24)))); x10 = ((x10) ^ ((((u32)((m + 40)[0]) ) | ((u32)((m + 40)[1]) << 8) | ((u32)((m + 40)[2]) << 16) | ((u32)((m + 40)[3]) << 24)))); x11 = ((x11) ^ ((((u32)((m + 44)[0]) ) | ((u32)((m + 44)[1]) << 8) | ((u32)((m + 44)[2]) << 16) | ((u32)((m + 44)[3]) << 24)))); x12 = ((x12) ^ ((((u32)((m + 48)[0]) ) | ((u32)((m + 48)[1]) << 8) | ((u32)((m + 48)[2]) << 16) | ((u32)((m + 48)[3]) << 24)))); x13 = ((x13) ^ ((((u32)((m + 52)[0]) ) | ((u32)((m + 52)[1]) << 8) | ((u32)((m + 52)[2]) << 16) | ((u32)((m + 52)[3]) << 24)))); x14 = ((x14) ^ ((((u32)((m + 56)[0]) ) | ((u32)((m + 56)[1]) << 8) | ((u32)((m + 56)[2]) << 16) | ((u32)((m + 56)[3]) << 24)))); x15 = ((x15) ^ ((((u32)((m + 60)[0]) ) | ((u32)((m + 60)[1]) << 8) | ((u32)((m + 60)[2]) << 16) | ((u32)((m + 60)[3]) << 24)))); j12 = ((((u32)(((j12)) + (1)) & (0xFFFFFFFFU)))); if (!j12) { j13 = ((((u32)(((j13)) + (1)) & (0xFFFFFFFFU)))); } do { (c + 0)[0] = ((u8)((x0)) & (0xFFU)); (c + 0)[1] = ((u8)((x0) >> 8) & (0xFFU)); (c + 0)[2] = ((u8)((x0) >> 16) & (0xFFU)); (c + 0)[3] = ((u8)((x0) >> 24) & (0xFFU)); } while (0); do { (c + 4)[0] = ((u8)((x1)) & (0xFFU)); (c + 4)[1] = ((u8)((x1) >> 8) & (0xFFU)); (c + 4)[2] = ((u8)((x1) >> 16) & (0xFFU)); (c + 4)[3] = ((u8)((x1) >> 24) & (0xFFU)); } while (0); do { (c + 8)[0] = ((u8)((x2)) & (0xFFU)); (c + 8)[1] = ((u8)((x2) >> 8) & (0xFFU)); (c + 8)[2] = ((u8)((x2) >> 16) & (0xFFU)); (c + 8)[3] = ((u8)((x2) >> 24) & (0xFFU)); } while (0); do { (c + 12)[0] = ((u8)((x3)) & (0xFFU)); (c + 12)[1] = ((u8)((x3) >> 8) & (0xFFU)); (c + 12)[2] = ((u8)((x3) >> 16) & (0xFFU)); (c + 12)[3] = ((u8)((x3) >> 24) & (0xFFU)); } while (0); do { (c + 16)[0] = ((u8)((x4)) & (0xFFU)); (c + 16)[1] = ((u8)((x4) >> 8) & (0xFFU)); (c + 16)[2] = ((u8)((x4) >> 16) & (0xFFU)); (c + 16)[3] = ((u8)((x4) >> 24) & (0xFFU)); } while (0); do { (c + 20)[0] = ((u8)((x5)) & (0xFFU)); (c + 20)[1] = ((u8)((x5) >> 8) & (0xFFU)); (c + 20)[2] = ((u8)((x5) >> 16) & (0xFFU)); (c + 20)[3] = ((u8)((x5) >> 24) & (0xFFU)); } while (0); do { (c + 24)[0] = ((u8)((x6)) & (0xFFU)); (c + 24)[1] = ((u8)((x6) >> 8) & (0xFFU)); (c + 24)[2] = ((u8)((x6) >> 16) & (0xFFU)); (c + 24)[3] = ((u8)((x6) >> 24) & (0xFFU)); } while (0); do { (c + 28)[0] = ((u8)((x7)) & (0xFFU)); (c + 28)[1] = ((u8)((x7) >> 8) & (0xFFU)); (c + 28)[2] = ((u8)((x7) >> 16) & (0xFFU)); (c + 28)[3] = ((u8)((x7) >> 24) & (0xFFU)); } while (0); do { (c + 32)[0] = ((u8)((x8)) & (0xFFU)); (c + 32)[1] = ((u8)((x8) >> 8) & (0xFFU)); (c + 32)[2] = ((u8)((x8) >> 16) & (0xFFU)); (c + 32)[3] = ((u8)((x8) >> 24) & (0xFFU)); } while (0); do { (c + 36)[0] = ((u8)((x9)) & (0xFFU)); (c + 36)[1] = ((u8)((x9) >> 8) & (0xFFU)); (c + 36)[2] = ((u8)((x9) >> 16) & (0xFFU)); (c + 36)[3] = ((u8)((x9) >> 24) & (0xFFU)); } while (0); do { (c + 40)[0] = ((u8)((x10)) & (0xFFU)); (c + 40)[1] = ((u8)((x10) >> 8) & (0xFFU)); (c + 40)[2] = ((u8)((x10) >> 16) & (0xFFU)); (c + 40)[3] = ((u8)((x10) >> 24) & (0xFFU)); } while (0); do { (c + 44)[0] = ((u8)((x11)) & (0xFFU)); (c + 44)[1] = ((u8)((x11) >> 8) & (0xFFU)); (c + 44)[2] = ((u8)((x11) >> 16) & (0xFFU)); (c + 44)[3] = ((u8)((x11) >> 24) & (0xFFU)); } while (0); do { (c + 48)[0] = ((u8)((x12)) & (0xFFU)); (c + 48)[1] = ((u8)((x12) >> 8) & (0xFFU)); (c + 48)[2] = ((u8)((x12) >> 16) & (0xFFU)); (c + 48)[3] = ((u8)((x12) >> 24) & (0xFFU)); } while (0); do { (c + 52)[0] = ((u8)((x13)) & (0xFFU)); (c + 52)[1] = ((u8)((x13) >> 8) & (0xFFU)); (c + 52)[2] = ((u8)((x13) >> 16) & (0xFFU)); (c + 52)[3] = ((u8)((x13) >> 24) & (0xFFU)); } while (0); do { (c + 56)[0] = ((u8)((x14)) & (0xFFU)); (c + 56)[1] = ((u8)((x14) >> 8) & (0xFFU)); (c + 56)[2] = ((u8)((x14) >> 16) & (0xFFU)); (c + 56)[3] = ((u8)((x14) >> 24) & (0xFFU)); } while (0); do { (c + 60)[0] = ((u8)((x15)) & (0xFFU)); (c + 60)[1] = ((u8)((x15) >> 8) & (0xFFU)); (c + 60)[2] = ((u8)((x15) >> 16) & (0xFFU)); (c + 60)[3] = ((u8)((x15) >> 24) & (0xFFU)); } while (0); if (bytes <= 64) { if (bytes < 64) { for (i = 0;i < bytes;++i) ctarget[i] = c[i]; } x->input[12] = j12; x->input[13] = j13; return; } bytes -= 64; c += 64; m += 64; } }
long long chacha_encrypt_bytes(unsigned int a0[16], unsigned long a1, unsigned long a2, unsigned long a3) { unsigned int v0; int tmp_234; int tmp_267; int tmp_324; int tmp_357; int tmp_414; int tmp_447; int tmp_504; int tmp_537; int tmp_594; int tmp_627; int tmp_684; int tmp_170; int tmp_203; int tmp_260; int tmp_293; int tmp_350; int tmp_383; int tmp_440; void* v1; char v2[64]; unsigned int v3; unsigned int v4; unsigned int v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int v10; unsigned int v11; unsigned int v12; unsigned int v13; unsigned int v14; unsigned int v15; unsigned int v16; unsigned int v17; unsigned int v18; unsigned int v19; unsigned int v20; unsigned int v21; unsigned int v22; unsigned int v23; unsigned int v24; unsigned int v25; unsigned int v26; unsigned int v27; unsigned int v28; unsigned int v29; unsigned int v30; unsigned int v31; unsigned int v32; unsigned int v33; unsigned int v34; unsigned int v35; void* v36; char v37; unsigned long v39; unsigned long v40; unsigned long v41; *(&v2[0]) = a1; v1 = a2; v0 = a3; v36 = 0; if (v0) { v22 = a0[0]; v23 = a0[1]; v24 = a0[2]; v25 = a0[3]; v26 = a0[4]; v27 = a0[5]; v28 = a0[6]; v29 = a0[7]; v30 = a0[8]; v31 = a0[9]; v32 = a0[10]; v33 = a0[11]; v19 = a0[12]; v20 = a0[13]; v34 = a0[14]; v35 = a0[15]; while (true) { if (v0 <= 63) { for (v21 = 0; v21 < v0; v21 += 1) { (&v37)[v21] = v2[v21]; } *(&v2[0]) = &v37; v36 = v1; v1 = &v37; } v3 = v22; v4 = v23; v5 = v24; v6 = v25; v7 = v26; v8 = v27; v9 = v28; v10 = v29; v11 = v30; v12 = v31; v13 = v32; v14 = v33; v15 = v19; v16 = v20; v17 = v34; v18 = v35; for (v21 = 20; v21; v21 -= 2) { v3 += v7; tmp_234 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, cc_ndep<8>); v15 = (v15 ^ v3) * 0x10000 | (v15 ^ v3) >> 16; v11 += v15; tmp_267 = v7 ^ v11; v7 = (v7 ^ v11) * 0x1000 | (v7 ^ v11) >> 20; v3 += v7; tmp_324 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v15 = (v15 ^ v3) * 0x100 | (v15 ^ v3) >> 24; v11 += v15; tmp_357 = v7 ^ v11; v7 = (v7 ^ v11) * 128 | (v7 ^ v11) >> 25; v4 += v8; tmp_414 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v16 = (v16 ^ v4) * 0x10000 | (v16 ^ v4) >> 16; v12 += v16; tmp_447 = v8 ^ v12; v8 = (v8 ^ v12) * 0x1000 | (v8 ^ v12) >> 20; v4 += v8; tmp_504 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v16 = (v16 ^ v4) * 0x100 | (v16 ^ v4) >> 24; v12 += v16; tmp_537 = v8 ^ v12; v8 = (v8 ^ v12) * 128 | (v8 ^ v12) >> 25; v5 += v9; tmp_594 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v17 = (v17 ^ v5) * 0x10000 | (v17 ^ v5) >> 16; v13 += v17; tmp_627 = v9 ^ v13; v9 = (v9 ^ v13) * 0x1000 | (v9 ^ v13) >> 20; v5 += v9; tmp_684 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v17 = (v17 ^ v5) * 0x100 | (v17 ^ v5) >> 24; v13 += v17; v39 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-204, size=4, endness=Iend_LE) ^ Load(addr=stack_base-188, size=4, endness=Iend_LE))), 0x0<64>, t684); v9 = (v9 ^ v13) * 128 | (v9 ^ v13) >> 25; v6 += v10; tmp_234 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, cc_ndep<8>); v18 = (v18 ^ v6) * 0x10000 | (v18 ^ v6) >> 16; v14 += v18; tmp_267 = v10 ^ v14; v10 = (v10 ^ v14) * 0x1000 | (v10 ^ v14) >> 20; v6 += v10; tmp_324 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v18 = (v18 ^ v6) * 0x100 | (v18 ^ v6) >> 24; v14 += v18; tmp_357 = v10 ^ v14; v10 = (v10 ^ v14) * 128 | (v10 ^ v14) >> 25; v3 += v8; tmp_414 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v18 = (v18 ^ v3) * 0x10000 | (v18 ^ v3) >> 16; v13 += v18; tmp_447 = v8 ^ v13; v8 = (v8 ^ v13) * 0x1000 | (v8 ^ v13) >> 20; v3 += v8; tmp_504 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-168, size=4, endness=Iend_LE) ^ Load(addr=stack_base-228, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v18 = (v18 ^ v3) * 0x100 | (v18 ^ v3) >> 24; v13 += v18; tmp_537 = v8 ^ v13; v8 = (v8 ^ v13) * 128 | (v8 ^ v13) >> 25; v4 += v9; tmp_594 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v15 = (v15 ^ v4) * 0x10000 | (v15 ^ v4) >> 16; v14 += v15; tmp_627 = v9 ^ v14; v9 = (v9 ^ v14) * 0x1000 | (v9 ^ v14) >> 20; v4 += v9; tmp_684 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-180, size=4, endness=Iend_LE) ^ Load(addr=stack_base-224, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v15 = (v15 ^ v4) * 0x100 | (v15 ^ v4) >> 24; v14 += v15; v40 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-204, size=4, endness=Iend_LE) ^ Load(addr=stack_base-184, size=4, endness=Iend_LE))), 0x0<64>, t684); v9 = (v9 ^ v14) * 128 | (v9 ^ v14) >> 25; v5 += v10; tmp_170 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, cc_ndep<8>); v16 = (v16 ^ v5) * 0x10000 | (v16 ^ v5) >> 16; v11 += v16; tmp_203 = v10 ^ v11; v10 = (v10 ^ v11) * 0x1000 | (v10 ^ v11) >> 20; v5 += v10; tmp_260 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-176, size=4, endness=Iend_LE) ^ Load(addr=stack_base-220, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v16 = (v16 ^ v5) * 0x100 | (v16 ^ v5) >> 24; v11 += v16; tmp_293 = v10 ^ v11; v10 = (v10 ^ v11) * 128 | (v10 ^ v11) >> 25; v6 += v7; tmp_350 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v17 = (v17 ^ v6) * 0x10000 | (v17 ^ v6) >> 16; v12 += v17; tmp_383 = v7 ^ v12; v7 = (v7 ^ v12) * 0x1000 | (v7 ^ v12) >> 20; v6 += v7; tmp_440 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-172, size=4, endness=Iend_LE) ^ Load(addr=stack_base-216, size=4, endness=Iend_LE))), 0x0<64>, DirtyExpression (<class 'ailment.expression.VEXCCallExpression'>)); v17 = (v17 ^ v6) * 0x100 | (v17 ^ v6) >> 24; v12 += v17; v41 = [D] amd64g_calculate_rflags_all(0x13<64>, Conv(32->64, (Load(addr=stack_base-212, size=4, endness=Iend_LE) ^ Load(addr=stack_base-192, size=4, endness=Iend_LE))), 0x0<64>, t440); v7 = (v7 ^ v12) * 128 | (v7 ^ v12) >> 25; } v3 += v22; v4 += v23; v5 += v24; v6 += v25; v7 += v26; v8 += v27; v9 += v28; v10 += v29; v11 += v30; v12 += v31; v13 += v32; v14 += v33; v15 += v19; v16 += v20; v17 += v34; v18 += v35; v3 ^= (v2[3] * 0x1000000) | (v2[1] * 0x100) | v2[0] | (v2[2] * 0x10000); v4 ^= (v2[7] * 0x1000000) | (v2[5] * 0x100) | v2[4] | (v2[6] * 0x10000); v5 ^= (v2[11] * 0x1000000) | (v2[9] * 0x100) | v2[8] | (v2[10] * 0x10000); v6 ^= (v2[15] * 0x1000000) | (v2[13] * 0x100) | v2[12] | (v2[14] * 0x10000); v7 ^= (v2[19] * 0x1000000) | (v2[17] * 0x100) | v2[16] | (v2[18] * 0x10000); v8 ^= (v2[23] * 0x1000000) | (v2[21] * 0x100) | v2[20] | (v2[22] * 0x10000); v9 ^= (v2[27] * 0x1000000) | (v2[25] * 0x100) | v2[24] | (v2[26] * 0x10000); v10 ^= (v2[31] * 0x1000000) | (v2[29] * 0x100) | v2[28] | (v2[30] * 0x10000); v11 ^= (v2[35] * 0x1000000) | (v2[33] * 0x100) | v2[32] | (v2[34] * 0x10000); v12 ^= (v2[39] * 0x1000000) | (v2[37] * 0x100) | v2[36] | (v2[38] * 0x10000); v13 ^= (v2[43] * 0x1000000) | (v2[41] * 0x100) | v2[40] | (v2[42] * 0x10000); v14 ^= (v2[47] * 0x1000000) | (v2[45] * 0x100) | v2[44] | (v2[46] * 0x10000); v15 ^= (v2[51] * 0x1000000) | (v2[49] * 0x100) | v2[48] | (v2[50] * 0x10000); v16 ^= (v2[55] * 0x1000000) | (v2[53] * 0x100) | v2[52] | (v2[54] * 0x10000); v17 ^= (v2[59] * 0x1000000) | (v2[57] * 0x100) | v2[56] | (v2[58] * 0x10000); v18 ^= (v2[63] * 0x1000000) | (v2[61] * 0x100) | v2[60] | (v2[62] * 0x10000); v19 += 1; if (!v19) v20 += 1; *(v1) = v3; *(&v1[1]) = v3 >> 8; *(&v1[2]) = v3 >> 16; *(&v1[3]) = v3 >> 24; *(&v1[4]) = v4; *(&v1[5]) = v4 >> 8; *(&v1[6]) = v4 >> 16; *(&v1[7]) = v4 >> 24; *(&v1[8]) = v5; *(&v1[9]) = v5 >> 8; *(&v1[10]) = v5 >> 16; *(&v1[11]) = v5 >> 24; *(&v1[12]) = v6; *(&v1[13]) = v6 >> 8; *(&v1[14]) = v6 >> 16; *(&v1[15]) = v6 >> 24; *(&v1[16]) = v7; *(&v1[17]) = v7 >> 8; *(&v1[18]) = v7 >> 16; *(&v1[19]) = v7 >> 24; *(&v1[20]) = v8; *(&v1[21]) = v8 >> 8; *(&v1[22]) = v8 >> 16; *(&v1[23]) = v8 >> 24; *(&v1[24]) = v9; *(&v1[25]) = v9 >> 8; *(&v1[26]) = v9 >> 16; *(&v1[27]) = v9 >> 24; *(&v1[28]) = v10; *(&v1[29]) = v10 >> 8; *(&v1[30]) = v10 >> 16; *(&v1[31]) = v10 >> 24; *(&v1[32]) = v11; *(&v1[33]) = v11 >> 8; *(&v1[34]) = v11 >> 16; *(&v1[35]) = v11 >> 24; *(&v1[36]) = v12; *(&v1[37]) = v12 >> 8; *(&v1[38]) = v12 >> 16; *(&v1[39]) = v12 >> 24; *(&v1[40]) = v13; *(&v1[41]) = v13 >> 8; *(&v1[42]) = v13 >> 16; *(&v1[43]) = v13 >> 24; *(&v1[44]) = v14; *(&v1[45]) = v14 >> 8; *(&v1[46]) = v14 >> 16; *(&v1[47]) = v14 >> 24; *(&v1[48]) = v15; *(&v1[49]) = v15 >> 8; *(&v1[50]) = v15 >> 16; *(&v1[51]) = v15 >> 24; *(&v1[52]) = v16; *(&v1[53]) = v16 >> 8; *(&v1[54]) = v16 >> 16; *(&v1[55]) = v16 >> 24; *(&v1[56]) = v17; *(&v1[57]) = v17 >> 8; *(&v1[58]) = v17 >> 16; *(&v1[59]) = v17 >> 24; *(&v1[60]) = v18; *(&v1[61]) = v18 >> 8; *(&v1[62]) = v18 >> 16; *(&v1[63]) = v18 >> 24; if (v0 <= 64) break; v0 = v0 - 64; v1 += 64; v2 += 1; } if (v0 <= 63) { for (v21 = 0; v21 < v0; v21 += 1) { *(v36 + v21) = *(v1 + v21); } } a0[12] = v19; a0[13] = v20; } return 0; }
static char * read_quoted_value(struct parser_st *parser) { struct buffer_st buffer; int c, quote_char; memset(&buffer, 0, sizeof(buffer)); c = parser_getc(parser); if (c == (-1) ) { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ( "false" , "cfg.c", 240, __extension__ __PRETTY_FUNCTION__); })) ; return ((void *)0) ; } if (c == '"' || c == '\'') { quote_char = c; } else { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ( "false" , "cfg.c", 247, __extension__ __PRETTY_FUNCTION__); })) ; return ((void *)0) ; } for (;;) { c = parser_getc(parser); if (c == (-1) ) { break; } if (c == '\\') { c = parser_getc(parser); if (c == (-1) ) { free(buffer.data); return ((void *)0) ; } if (c == '\n') { buffer_append(&buffer, ' '); } else if (c == quote_char) { buffer_append(&buffer, c); } } else if (c == quote_char) { break; } else { buffer_append(&buffer, c); } } buffer_append(&buffer, '\0'); return buffer.data; }
void read_quoted_value(void* a0) { unsigned int v0; unsigned int v1; char v2; unsigned long long v4; void* v5; memset(&v2, 0x0, 0x18); v0 = parser_getc(a0); if (v0 == -1) __assert_fail(); if (v0 != 34 && v0 != 39) __assert_fail(); v1 = v0; while (true) { v0 = parser_getc(a0); if (v0 == -1) { LABEL_400699: buffer_append(&v2, 0x0); v4 = *(&v2); break; } else if (v0 == 92) { v0 = parser_getc(a0); if (v0 == -1) { free(*(&v2)); v5 = 0; break; } else if (v0 == 10) { buffer_append(&v2, 0x20); } else if (v0 == v1) { buffer_append(&v2, v0); } } else { if (v0 != v1) { buffer_append(&v2, v0); continue; } goto LABEL_400699; } } return; }
static void map_print_key(EditLine *el, el_action_t *map, const wchar_t *in) { char outbuf[((size_t)1024)]; el_bindings_t *bp, *ep; if (in[0] == '\0' || in[1] == '\0') { (void) keymacro__decode_str(in, outbuf, sizeof(outbuf), ""); ep = &el->el_map.help[el->el_map.nfunc]; for (bp = el->el_map.help; bp < ep; bp++) if (bp->func == map[(unsigned char) *in]) { (void) fprintf(el->el_outfile, "%s\t->\t%ls\n", outbuf, bp->name); return; } } else keymacro_print(el, in); }
void map_print_key(unsigned long long a0[136], char *a1, unsigned int a2[2]) { struct_0 *v0; unsigned long v1; char v2; char v3; unsigned long long *v5; unsigned long long v6; if (!a2[0]) { LABEL_4007b3: keymacro__decode_str(a2, &v2, 0x400, &g_4076e4); v1 = a0[135] * 24 + a0[133]; v0 = a0[133]; while (true) { if (v0 >= v1) break; if (v0->field_8 != a1[a2[0]]) { v0 += 2; } else { fprintf(a0[2], "%s\t->\t%ls\n", &v2); break; } } } else { if (!a2[1]) goto LABEL_4007b3; keymacro_print(a0, a2, a2); } v6 = *(&v3) ^ v5[5]; return; }
int zcatfd (fd, ofd, fn) int fd, ofd; char *fn; { ssize_t nr; int rval; char lbuf[4096]; rval = 0; while (1) { nr = zread (fd, lbuf, sizeof (lbuf)); if (nr == 0) break; else if (nr < 0) { rval = -1; break; } else if (zwrite (ofd, lbuf, nr) < 0) { rval = -1; break; } } return rval; }
long zcatfd(unsigned int a1, unsigned int a2) { unsigned int v3; long v4; char v5[16]; unsigned long v6; v6 = __readfsqword(0x28u); v3 = 0; while ( 1 ) { v4 = zread(a1, v5, 4096LL); if ( !v4 ) break; if ( v4 < 0 ) return (unsigned int)-1; if ( (int)zwrite(a2, v5, v4) < 0 ) return (unsigned int)-1; } return v3; }
void pkcs7_info(common_info_st *cinfo, unsigned display_data) { gnutls_pkcs7_t pkcs7; int ret; size_t size; gnutls_datum_t data, str; ret = gnutls_pkcs7_init(&pkcs7); if (ret < 0) { fprintf( stderr , "p7_init: %s\n", gnutls_strerror(ret)); app_exit(1); } data.data = (void *) _gnutls_fread_file(infile, 0, &size); data.size = size; if (!data.data) { fprintf( stderr , "%s", infile ? "file" : "standard input"); app_exit(1); } ret = gnutls_pkcs7_import(pkcs7, &data, incert_format); free(data.data); if (ret < 0) { fprintf( stderr , "import error: %s\n", gnutls_strerror(ret)); app_exit(1); } if (display_data) { gnutls_datum_t tmp; ret = gnutls_pkcs7_get_embedded_data(pkcs7, 0, &tmp); if (ret != -56) { if (ret < 0) { fprintf( stderr , "error getting embedded data: %s\n", gnutls_strerror(ret)); app_exit(1); } fwrite(tmp.data, 1, tmp.size, outfile); gnutls_free((void *) (tmp.data)), tmp.data= ((void *)0) ; } else { fprintf( stderr , "no embedded data are available\n"); app_exit(1); } } else { if (cinfo->outtext) { ret = gnutls_pkcs7_print(pkcs7, GNUTLS_CRT_PRINT_FULL, &str); if (ret < 0) { fprintf( stderr , "printing error: %s\n", gnutls_strerror(ret)); app_exit(1); } fprintf(outfile, "%s", str.data); gnutls_free((void *) (str.data)), str.data= ((void *)0) ; } size = lbuffer_size; ret = gnutls_pkcs7_export(pkcs7, outcert_format, lbuffer, &size); if (ret < 0) { fprintf( stderr , "export error: %s\n", gnutls_strerror(ret)); app_exit(1); } fwrite(lbuffer, 1, size, outfile); } gnutls_pkcs7_deinit(pkcs7); }
void pkcs7_info(long param_1,int param_2) { int iVar1; undefined8 uVar2; char *pcVar3; long in_FS_OFFSET; undefined8 local_48; size_t local_40; void *local_38; undefined4 local_30; void *local_28; uint local_20; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); iVar1 = gnutls_pkcs7_init(&local_48); if (iVar1 < 0) { uVar2 = gnutls_strerror(iVar1); fprintf(stderr,"p7_init: %s\n",uVar2); app_exit(1); } local_38 = (void *)_gnutls_fread_file(infile,0,&local_40); local_30 = (undefined4)local_40; if (local_38 == (void *)0x0) { if (infile == 0) { pcVar3 = "standard input"; } else { pcVar3 = "file"; } fprintf(stderr,"%s",pcVar3); app_exit(1); } iVar1 = gnutls_pkcs7_import(local_48,&local_38,incert_format); free(local_38); if (iVar1 < 0) { uVar2 = gnutls_strerror(iVar1); fprintf(stderr,"import error: %s\n",uVar2); app_exit(1); } if (param_2 == 0) { if (*(int *)(param_1 + 0x24) != 0) { iVar1 = gnutls_pkcs7_print(local_48,0,&local_28); if (iVar1 < 0) { uVar2 = gnutls_strerror(iVar1); fprintf(stderr,"printing error: %s\n",uVar2); app_exit(1); } fprintf(outfile,"%s",local_28); (*gnutls_free)(local_28); local_28 = (void *)0x0; } local_40 = lbuffer_size; iVar1 = gnutls_pkcs7_export(local_48,outcert_format,lbuffer,&local_40); if (iVar1 < 0) { uVar2 = gnutls_strerror(iVar1); fprintf(stderr,"export error: %s\n",uVar2); app_exit(1); } fwrite(lbuffer,1,local_40,outfile); } else { iVar1 = gnutls_pkcs7_get_embedded_data(local_48,0,&local_28); if (iVar1 == -0x38) { fprintf(stderr,"no embedded data are available\n"); app_exit(1); } if (iVar1 < 0) { uVar2 = gnutls_strerror(iVar1); fprintf(stderr,"error getting embedded data: %s\n",uVar2); app_exit(1); } fwrite(local_28,1,(ulong)local_20,outfile); (*gnutls_free)(local_28); local_28 = (void *)0x0; } gnutls_pkcs7_deinit(local_48); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
HIST_ENTRY * next_history(void) { HistEvent ev; if (history_offset >= history_length) return ((void *)0) ; if (history(h, &ev, 4) != 0) return ((void *)0) ; history_offset++; return current_history(); }
long *next_history() { char v1[24]; unsigned long v2; v2 = __readfsqword(0x28u); if ( history_offset >= history_length ) return 0LL; if ( (unsigned int)history(h, v1, 4LL, v1) ) return 0LL; ++history_offset; return current_history(); }
void pidof_usage(void) { printf("pidof usage: [options] <program-name>\n\n"); printf(" -c Return PIDs with the same root directory\n"); printf(" -d <sep> Use the provided character as output separator\n"); printf(" -h Display this help text\n"); printf(" -n Avoid using stat system function on network shares\n"); printf(" -o <pid> Omit results with a given PID\n"); printf(" -q Quiet mode. Do not display output\n"); printf(" -s Only return one PID\n"); printf(" -x Return PIDs of shells running scripts with a matching name\n"); printf(" -z List zombie and I/O waiting processes. May cause pidof to hang.\n"); printf("\n"); }
void pidof_usage() { unsigned long long v1; printf("pidof usage: [options] <program-name>\n\n"); printf(" -c Return PIDs with the same root directory\n"); printf(" -d <sep> Use the provided character as output separator\n"); printf(" -h Display this help text\n"); printf(" -n Avoid using stat system function on network shares\n"); printf(" -o <pid> Omit results with a given PID\n"); printf(" -q Quiet mode. Do not display output\n"); printf(" -s Only return one PID\n"); printf(" -x Return PIDs of shells running scripts with a matching name\n"); printf(" -z List zombie and I/O waiting processes. May cause pidof to hang.\n"); v1 = printf("\n"); return; }
void arc4random_stir(void) { pthread_mutex_lock(&arc4random_mtx); _rs_stir(); pthread_mutex_unlock(&arc4random_mtx); }
long long arc4random_stir() { pthread_mutex_lock(&arc4random_mtx); _rs_stir(); return pthread_mutex_unlock(&arc4random_mtx); }
static void can_print_tdc_const_opt(FILE *f, struct rtattr *tdc_attr) { struct rtattr *tb[IFLA_CAN_TDC_MAX + 1]; (parse_rtattr_flags((tb), (IFLA_CAN_TDC_MAX), ((void*)(((char*)(tdc_attr)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((tdc_attr)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); open_json_object("tdc"); can_print_nl_indent(); if (tb[IFLA_CAN_TDC_TDCV_MIN] && tb[IFLA_CAN_TDC_TDCV_MAX]) { __u32 *tdcv_min = ((void*)(((char*)(tb[IFLA_CAN_TDC_TDCV_MIN])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); __u32 *tdcv_max = ((void*)(((char*)(tb[IFLA_CAN_TDC_TDCV_MAX])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); can_print_timing_min_max("tdcv", " tdcv", *tdcv_min, *tdcv_max); } if (tb[IFLA_CAN_TDC_TDCO_MIN] && tb[IFLA_CAN_TDC_TDCO_MAX]) { __u32 *tdco_min = ((void*)(((char*)(tb[IFLA_CAN_TDC_TDCO_MIN])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); __u32 *tdco_max = ((void*)(((char*)(tb[IFLA_CAN_TDC_TDCO_MAX])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); can_print_timing_min_max("tdco", " tdco", *tdco_min, *tdco_max); } if (tb[IFLA_CAN_TDC_TDCF_MIN] && tb[IFLA_CAN_TDC_TDCF_MAX]) { __u32 *tdcf_min = ((void*)(((char*)(tb[IFLA_CAN_TDC_TDCF_MIN])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); __u32 *tdcf_max = ((void*)(((char*)(tb[IFLA_CAN_TDC_TDCF_MAX])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); can_print_timing_min_max("tdcf", " tdcf", *tdcf_min, *tdcf_max); } close_json_object(); }
unsigned long can_print_tdc_const_opt(long a1, unsigned short *a2) { long v2; unsigned short *v3; const char *v4; const char *v5; long v6; long v7; long v8; long v9; char v11[8]; long v12; long v13; long v14; long v15; long v16; long v17; unsigned long v18; v18 = __readfsqword(0x28u); v2 = (unsigned int)*a2 - 4; v3 = a2 + 2; v4 = (_BYTE *)(&loc_8 + 1); parse_rtattr_flags(v11, 9LL, v3, v2, 0x8000LL); v5 = "tdc"; open_json_object("tdc"); can_print_nl_indent(); if ( v12 && v13 ) { v4 = " tdcv"; v5 = "tdcv"; can_print_timing_min_max((long)"tdcv", (long)" tdcv", *(_DWORD *)(v12 + 4), *(_DWORD *)(v13 + 4)); } if ( v14 && v15 ) { v4 = " tdco"; v5 = "tdco"; can_print_timing_min_max((long)"tdco", (long)" tdco", *(_DWORD *)(v14 + 4), *(_DWORD *)(v15 + 4)); } if ( v16 && v17 ) { v4 = " tdcf"; v5 = "tdcf"; can_print_timing_min_max((long)"tdcf", (long)" tdcf", *(_DWORD *)(v16 + 4), *(_DWORD *)(v17 + 4)); } close_json_object(v5, v4, v6, v7, v8, v9); return __readfsqword(0x28u) ^ v18; }
static inline _Bool is_empty_dir (int fd_cwd, char const *dir) { DIR *dirp; struct dirent const *dp; int saved_errno; int fd = openat (fd_cwd, dir, ( 00 | 0200000 | 0400 | 0400000 | 04000 )); if (fd < 0) return 0 ; dirp = fdopendir (fd); if (dirp == ((void *)0) ) { close (fd); return 0 ; } (*__errno_location ()) = 0; dp = readdir_ignoring_dot_and_dotdot (dirp); saved_errno = (*__errno_location ()) ; closedir (dirp); (*__errno_location ()) = saved_errno; if (dp != ((void *)0) ) return 0 ; return saved_errno == 0 ? 1 : 0 ; }
int is_empty_dir(unsigned long a0, unsigned long long a1) { unsigned int v0; unsigned int v1; unsigned long long v2; unsigned long v3; unsigned long v5; v0 = openat(a0, a1, 0x30900, a1); if (v0 < 0) { v5 = 0; } else { v2 = fdopendir(v0); if (!v2) { close(v0); v5 = 0; } else { *(__errno_location()) = 0; v3 = readdir_ignoring_dot_and_dotdot(v2); v1 = *(__errno_location()); closedir(v2); v5 = __errno_location(); *(v5) = v1; if (v3) *(&v5) = 0; else *(&v5) = !v1; } } return v5; }
static void store_columns (void) { int i, j; unsigned int line = 0; unsigned int buff_start; int last_col; COLUMN *p; buff_current = 0; buff_start = 0; if (balance_columns) last_col = columns; else last_col = columns - 1; for (i = 1, p = column_vector; i <= last_col; ++i, ++p) p->lines_stored = 0; for (i = 1, p = column_vector; i <= last_col && files_ready_to_read; ++i, ++p) { p->current_line = line; for (j = lines_per_body; j && files_ready_to_read; --j) if (p->status == OPEN) { input_position = 0; if (!read_line (p)) read_rest_of_line (p); if (p->status == OPEN || buff_start != buff_current) { ++p->lines_stored; line_vector[line] = buff_start; end_vector[line++] = input_position; buff_start = buff_current; } } } line_vector[line] = buff_start; if (balance_columns) balance (line); }
long store_columns() { unsigned int v0; long result; int v2; int v3; int i; unsigned int v5; int v6; int v7; _DWORD *v8; FILE **v9; v5 = 0; buff_current = 0; v6 = 0; if ( balance_columns ) v7 = columns; else v7 = columns - 1; v2 = 1; v8 = column_vector; while ( v2 <= v7 ) { v8[11] = 0; ++v2; v8 += 16; } v3 = 1; v9 = (FILE **)column_vector; while ( v3 <= v7 && files_ready_to_read ) { *((_DWORD *)v9 + 10) = v5; for ( i = lines_per_body; i && files_ready_to_read; --i ) { if ( !*((_DWORD *)v9 + 4) ) { input_position = 0; if ( (unsigned char)read_line((long)v9) != 1 ) read_rest_of_line(v9); if ( !*((_DWORD *)v9 + 4) || v6 != buff_current ) { ++*((_DWORD *)v9 + 11); *((_DWORD *)line_vector + v5) = v6; v0 = v5++; *((_DWORD *)end_vector + v0) = input_position; v6 = buff_current; } } } ++v3; v9 += 8; } *((_DWORD *)line_vector + v5) = v6; result = (unsigned char)balance_columns; if ( balance_columns ) return balance(v5); return result; }
static void channel_post_mux_listener(struct ssh *ssh, Channel *c) { Channel *nc; struct sockaddr_storage addr; socklen_t addrlen; int newsock; uid_t euid; gid_t egid; if ((c->io_ready & 0x10) == 0) return; sshlog("channels.c", __func__, 2310, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "multiplexing control connection"); memset(&addr, 0, sizeof(addr)); addrlen = sizeof(addr); if ((newsock = accept(c->sock, (struct sockaddr*)&addr, &addrlen)) == -1) { sshlog("channels.c", __func__, 2319, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "accept: %s", strerror( (*__errno_location ()) )); if ( (*__errno_location ()) == 24 || (*__errno_location ()) == 23 ) c->notbefore = monotime() + 1; return; } if (getpeereid(newsock, &euid, &egid) == -1) { sshlog("channels.c", __func__, 2326, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "getpeereid failed: %s", strerror( (*__errno_location ()) )); close(newsock); return; } if ((euid != 0) && (getuid() != euid)) { sshlog("channels.c", __func__, 2331, 0, SYSLOG_LEVEL_ERROR, ((void *)0) , "multiplex uid mismatch: peer euid %u != uid %u", (u_int)euid, (u_int)getuid()) ; close(newsock); return; } nc = channel_new(ssh, "multiplex client", 16, newsock, newsock, -1, c->local_window_max, c->local_maxpacket, 0, "mux-control", 1); nc->mux_rcb = c->mux_rcb; sshlog("channels.c", __func__, 2340, 1, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "new mux channel %d fd %d", nc->self, nc->sock); nc->mux_rcb(ssh, nc); nc->flags |= 0x10; }
long long channel_post_mux_listener(void* a0, struct_0 *a1) { unsigned long v0; unsigned int v1; char v2; char v3; unsigned int v4; struct_1 *v5; char v6; if ((a1->field_30 & 16)) { sshlog("channels.c", "channel_post_mux_listener", 0x906, 0x0, 0x5, 0x0, "multiplexing control connection"); memset(&v6, 0x0, 0x80); v1 = 128; v4 = accept(a1->field_28, &v6, &v1); if (v4 == -1) { v0 = strerror(*(__errno_location())); sshlog("channels.c", "channel_post_mux_listener", 0x90f, 0x1, 0x2, 0x0, "accept: %s"); if (*(__errno_location()) != 24 && !(*(__errno_location()) == 23)) goto LABEL_407d01; a1->field_58 = __addvdi3(monotime(), 0x1); LABEL_407d01: } else if (getpeereid(v4, &v2, &v3, &v2) == -1) { v0 = strerror(*(__errno_location())); sshlog("channels.c", "channel_post_mux_listener", 0x916, 0x1, 0x2, 0x0, "getpeereid failed: %s"); close(v4); } else { if (*(&v2) && getuid() != *(&v2)) { getuid(); sshlog("channels.c", "channel_post_mux_listener", 0x91b, 0x0, 0x2, 0x0, "multiplex uid mismatch: peer euid %u != uid %u"); close(v4); goto LABEL_407d02; } v5 = channel_new(a0, "multiplex client", 0x10, v4, v4, 0xffffffff, a1->field_b4, a1->field_bc, 0x0, "mux-control", 0x1); v5->field_148 = a1->field_148; sshlog("channels.c", "channel_post_mux_listener", 0x924, 0x1, 0x7, 0x0, "new mux channel %d fd %d"); v5->field_148(a0, v5, v5, v5->field_148); v5->field_18 = v5->field_18 | 16; } } LABEL_407d02: return 0; }
static int ssh_session2(struct ssh *ssh, const struct ssh_conn_info *cinfo) { int r, id = -1; char *cp, *tun_fwd_ifname = ((void *)0) ; if (!options.control_persist) ssh_init_stdio_forwarding(ssh); ssh_init_forwarding(ssh, &tun_fwd_ifname); if (options.local_command != ((void *)0) ) { sshlog("ssh.c", __func__, 2121, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "expanding LocalCommand: %s", options.local_command); cp = options.local_command; options.local_command = percent_expand(cp, "C", cinfo->conn_hash_hex, "L", cinfo->shorthost, "i", cinfo->uidstr, "k", cinfo->keyalias, "l", cinfo->thishost, "n", cinfo->host_arg, "p", cinfo->portstr, "d", cinfo->homedir, "h", cinfo->remhost, "r", cinfo->remuser, "u", cinfo->locuser, "T", tun_fwd_ifname == ((void *)0) ? "NONE" : tun_fwd_ifname, (char *) ((void *)0) ); sshlog("ssh.c", __func__, 2127, 0, SYSLOG_LEVEL_DEBUG3, ((void *)0) , "expanded LocalCommand: %s", options.local_command); free(cp); } if (!ssh_packet_get_mux(ssh)) muxserver_listen(ssh); if (options.control_persist && muxserver_sock != -1) { ostdin_null_flag = options.stdin_null; osession_type = options.session_type; orequest_tty = options.request_tty; otty_flag = tty_flag; options.stdin_null = 1; options.session_type = 0; tty_flag = 0; if (!options.fork_after_authentication && (osession_type != 0 || options.stdio_forward_host != ((void *)0) )) need_controlpersist_detach = 1; options.fork_after_authentication = 1; } if (options.control_persist && muxserver_sock == -1) ssh_init_stdio_forwarding(ssh); if (options.session_type != 0) id = ssh_session2_open(ssh); else { ssh_packet_set_interactive(ssh, options.control_master == 0, options.ip_qos_interactive, options.ip_qos_bulk); } if (options.control_master == 0 && (ssh->compat & 0x04000000)) { sshlog("ssh.c", __func__, 2176, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "Requesting no-more-sessions@openssh.com"); if ((r = sshpkt_start(ssh, 80)) != 0 || (r = sshpkt_put_cstring(ssh, "no-more-sessions@openssh.com")) != 0 || (r = sshpkt_put_u8(ssh, 0)) != 0 || (r = sshpkt_send(ssh)) != 0) sshfatal("ssh.c", __func__, 2182, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "send packet"); } if (options.local_command != ((void *)0) && options.permit_local_command) ssh_local_cmd(options.local_command); if (!need_controlpersist_detach && stdfd_devnull(0, 1, 0) == -1) sshlog("ssh.c", __func__, 2197, 1, SYSLOG_LEVEL_ERROR, ((void *)0) , "stdfd_devnull failed"); if (options.fork_after_authentication) { if (options.exit_on_forward_failure && options.num_remote_forwards > 0) { sshlog("ssh.c", __func__, 2206, 0, SYSLOG_LEVEL_DEBUG1, ((void *)0) , "deferring postauth fork until remote forward " "confirmation received") ; } else fork_postauth(); } return client_loop(ssh, tty_flag, tty_flag ? options.escape_char : -2, id); }
int ssh_session2(struct_0 *a0, unsigned long long a1[11]) { unsigned int v0; unsigned int v1; void* v2; unsigned long long v3; unsigned long long v4; char v5; unsigned long long v6; v1 = -1; v2 = 0; if (false) ssh_init_stdio_forwarding(a0); ssh_init_forwarding(a0, &v2); sshlog("ssh.c", "ssh_session2", 0x849, 0x0, 0x7, 0x0, "expanding LocalCommand: %s", 0xed4ee8c789fc458b); v3 = 17099860778883499403; g_4013a8 = percent_expand(v3, "C", a1[0], "L", a1[1], "i", a1[2], "k", a1[3], "l", a1[4], "n", a1[5], "p", a1[6], "d", a1[9], "h", a1[7], "r", a1[8], "u", a1[10], "T", (!v2 ? v2 : "NONE")); sshlog("ssh.c", "ssh_session2", 0x84f, 0x0, 0x7, 0x0, "expanded LocalCommand: %s", 0xed4ee8c789fc458b); free(v3); if (!ssh_packet_get_mux(a0)) muxserver_listen(a0); if (muxserver_sock != -1) { orequest_tty = 0x1aba00000000b900; orequest_tty = 203409651139000; orequest_tty = 1890888812873; orequest_tty = tty_flag; g_4013cc = 1; g_4013c8 = 0; tty_flag = 0; if (false && true) need_controlpersist_detach = 1; g_4013d0 = 1; } if (muxserver_sock == -1) ssh_init_stdio_forwarding(a0); if (false) ssh_packet_set_interactive(a0, !39205218558887968, 0x48f4458b000fff98, 0xc5148d48f4458b); else v1 = ssh_session2_open(a0, a1, 0x84f); if (false && (a0->field_83c & 0x4000000)) { sshlog("ssh.c", "ssh_session2", 0x880, 0x0, 0x5, 0x0, "Requesting no-more-sessions@openssh.com", 0xed4ee8c789fc458b); v0 = sshpkt_start(a0, 0x50); if (!(!v0) || !((v0 = sshpkt_put_cstring(a0, "no-more-sessions@openssh.com"), !v0))) { LABEL_4079f7: sshfatal("ssh.c", "ssh_session2", 0x886, 0x1, 0x1, ssh_err(v0)); } else { v0 = sshpkt_put_u8(a0, 0x0); if (v0 || (v0 = sshpkt_send(a0), v0)) goto LABEL_4079f7; } } if (true) ssh_local_cmd(0xed4ee8c789fc458b); if (!need_controlpersist_detach && stdfd_devnull(0x0, 0x1, 0x0) == -1) { v4 = "stdfd_devnull failed"; sshlog("ssh.c", "ssh_session2", 0x895, 0x1, 0x2, 0x0, *(&v5), v6); } if (true) { fork_postauth(); } else { v4 = "deferring postauth fork until remote forward confirmation received"; sshlog("ssh.c", "ssh_session2", 0x89e, 0x0, 0x5, 0x0, *(&v5), v6); } return client_loop(a0, tty_flag, (!tty_flag ? 10036500766703231096 : 4294967294), v1); }
const char *raw_to_string(const unsigned char *raw, size_t raw_size) { static char buf[1024]; size_t i; if (raw_size == 0) return "(empty)"; if (raw_size * 3 + 1 >= sizeof(buf)) return "(too large)"; for (i = 0; i < raw_size; i++) { sprintf(&(buf[i * 3]), "%02X%s", raw[i], (i == raw_size - 1) ? "" : ":"); } buf[sizeof(buf) - 1] = '\0'; return buf; }
int raw_to_string(void* a0, unsigned long a1) { void* v0; unsigned int v2; unsigned int v3; if (!a1) { v2 = &g_40466a; } else if ((a1 << 1) + a1 + 1 > 1023) { v2 = &g_404672; } else { for (v0 = 0; v0 < a1; v0 += 1) { if (v0 != a1 - 1) v3 = &g_40467f; else v3 = &g_40467e; sprintf(&buf.11883 + 0x3 * v0, "%02X%s", *((v0 + a0)), v3); } g_403d3f = 0; v2 = &buf.11883; } return v2; }
void pty_release(const char *tty) { }
long long pty_release(unsigned long a0) { unsigned long v0; unsigned long v2; v0 = a0; return v2; }
static void tcfinal(struct console *con) { struct termios *tio = &con->tio; int fd = con->fd; (*__errno_location ()) = 0; if ((con->flags & 0x0001) == 0) { setenv("TERM", "linux", 1); return; } if (con->flags & 0x0002) return; setenv("TERM", "vt100", 1); tio->c_iflag |= ( 0002000 | 0010000 ); tio->c_lflag |= ( 0000002 | 0000001 | 0000010 | 0000020 | 0000040 | 0004000 ); tio->c_oflag |= 0000001 ; tio->c_cc[ 0 ] = ('c'&037) ; tio->c_cc[ 1 ] = 034 ; tio->c_cc[ 2 ] = con->cp.erase; tio->c_cc[ 3 ] = con->cp.kill; tio->c_cc[ 4 ] = ('d'&037) ; tio->c_cc[ 7 ] = '\0' ; tio->c_cc[ 8 ] = ('q'&037) ; tio->c_cc[ 9 ] = ('s'&037) ; tio->c_cc[ 10 ] = ('z'&037) ; tio->c_cc[ 11 ] = '\0' ; if (con->cp.eol == ( 'm' &037) ) { tio->c_iflag |= 0000400 ; tio->c_iflag &= ~( 0000100 | 0000200 ); tio->c_oflag |= 0000004 ; tio->c_oflag &= ~( 0000010 | 0000040 ); } switch (con->cp.parity) { default: case 0: tio->c_cflag &= ~( 0001000 | 0000400 ); tio->c_iflag &= ~( 0000020 | 0000040 ); break; case 1: tio->c_cflag |= 0001000 ; case 2: tio->c_cflag |= 0000400 ; tio->c_iflag |= ( 0000020 | 0000040 ); case (1 | 2): tio->c_cflag &= ~ 0000060 ; tio->c_cflag |= 0000040 ; break; } (void)tcsetattr(fd, 0 , tio); }
void tcfinal(struct_0 *a0) { unsigned int v0; int tmp_58; int tmp_36; int tmp_17; int tmp_24; struct_1 *v1; unsigned long long v3; unsigned long long v4; unsigned long long v5; unsigned long long v6; unsigned long long v7; unsigned long long v8; unsigned long long v9; unsigned long long v10; v1 = &a0[1].padding_0; v0 = a0->field_14; *(__errno_location()) = 0; if (!(a0->field_10 & 1)) { v3 = setenv("TERM", "linux", 0x1); } else { v4 = a0->field_10 & 2; if (!(a0->field_10 & 2)) { setenv("TERM", "vt100", 0x1); v5 = v1->field_0; *(&v5) = (v1->field_0 >> 8) | 20; tmp_58 = v5; v1->field_0 = tmp_58; v1->field_c = v1->field_c | 2107; v1->field_4 = v1->field_4 | 1; v1->field_11 = 3; v1->field_12 = 28; v1->field_13 = a0->field_20; v1->field_14 = a0->field_21; v1->field_15 = 4; v1->field_18 = 0; v1->field_19 = 17; v1->field_1a = 19; v1->field_1b = 26; v1->field_1c = 0; if (a0->field_22 == 13) { v6 = v1->field_0; *(&v6) = (v1->field_0 >> 8) | 1; tmp_36 = v6; v1->field_0 = tmp_36; *(&v6) = v1->field_0; *(&v6) = v1->field_0 & 63; v1->field_0 = v6; v1->field_4 = v1->field_4 | 4; v1->field_4 = v1->field_4 & -41; } if (a0->field_23 != 3) { if (a0->field_23 <= 3) { if (a0->field_23 == 1) { v7 = v1->field_8; *(&v7) = (v1->field_8 >> 8) | 2; tmp_17 = v7; v1->field_8 = tmp_17; } if (a0->field_23 == 2 || a0->field_23 == 1) { v9 = v1->field_8; *(&v9) = (v1->field_8 >> 8) | 1; tmp_24 = v9; v1->field_8 = tmp_24; v1->field_0 = v1->field_0 | 48; } } if ((a0->field_23 > 3 || a0->field_23 != 2) && (a0->field_23 > 3 || a0->field_23 != 1)) { v8 = v1->field_8; *(&v8) = (v1->field_8 >> 8) & 252; tmp_24 = v8; v1->field_8 = tmp_24; v1->field_0 = v1->field_0 & -49; } } if (a0->field_23 <= 3 || a0->field_23 == 2) { v1->field_8 = v1->field_8 & -49; v1->field_8 = v1->field_8 | 32; } v10 = tcsetattr(v0, 0x0, v1); } } return; }
void sh_set_lines_and_columns (int lines, int cols) { sprintf (setenv_buf, "%d", lines); setenv ("LINES", setenv_buf, 1); sprintf (setenv_buf, "%d", cols); setenv ("COLUMNS", setenv_buf, 1); }
void sh_set_lines_and_columns(uint param_1,uint param_2) { sprintf(setenv_buf,"%d",(ulong)param_1); setenv("LINES",setenv_buf,1); sprintf(setenv_buf,"%d",(ulong)param_2); setenv("COLUMNS",setenv_buf,1); return; }
void namebuf_free (namebuf_t buf) { free (buf->buffer); free (buf); }
long long namebuf_free(unsigned long long *a0) { free(*(a0)); return free(a0); }
static int wscompare (p, pe, s, se) wchar_t *p, *pe, *s, *se; { int ret; wchar_t c1, c2; int l1, l2; l1 = pe - p; l2 = se - s; if (l1 != l2) return (1); c1 = *pe; c2 = *se; if (c1 != 0) *pe = '\0'; if (c2 != 0) *se = '\0'; ret = wcscoll(((wchar_t *)p), ((wchar_t *)s)); if (c1 != 0) *pe = c1; if (c2 != 0) *se = c2; return (ret == 0 ? ret : 1); }
bool wscompare(wchar_t *param_1,int *param_2,wchar_t *param_3,int *param_4) { int iVar1; int iVar2; int iVar3; bool bVar4; if ((int)((long)param_2 - (long)param_1 >> 2) == (int)((long)param_4 - (long)param_3 >> 2)) { iVar1 = *param_2; iVar2 = *param_4; if (iVar1 != 0) { *param_2 = 0; } if (iVar2 != 0) { *param_4 = 0; } iVar3 = wcscoll(param_1,param_3); if (iVar1 != 0) { *param_2 = iVar1; } if (iVar2 != 0) { *param_4 = iVar2; } bVar4 = iVar3 != 0; } else { bVar4 = true; } return bVar4; }
static int kex_ecdh_dec_key_group(struct kex *kex, const struct sshbuf *ec_blob, EC_KEY *key, const EC_GROUP *group, struct sshbuf **shared_secretp) { struct sshbuf *buf = ((void *)0) ; BIGNUM *shared_secret = ((void *)0) ; EC_POINT *dh_pub = ((void *)0) ; u_char *kbuf = ((void *)0) ; size_t klen = 0; int r; *shared_secretp = ((void *)0) ; if ((buf = sshbuf_new()) == ((void *)0) ) { r = -2; goto out; } if ((r = sshbuf_put_stringb(buf, ec_blob)) != 0) goto out; if ((dh_pub = EC_POINT_new(group)) == ((void *)0) ) { r = -2; goto out; } if ((r = sshbuf_get_ec(buf, dh_pub, group)) != 0) { goto out; } sshbuf_reset(buf); if (sshkey_ec_validate_public(group, dh_pub) != 0) { r = -3; goto out; } klen = (EC_GROUP_get_degree(group) + 7) / 8; if ((kbuf = malloc(klen)) == ((void *)0) || (shared_secret = BN_new()) == ((void *)0) ) { r = -2; goto out; } if (ECDH_compute_key(kbuf, klen, dh_pub, key, ((void *)0) ) != (int)klen || BN_bin2bn(kbuf, klen, shared_secret) == ((void *)0) ) { r = -22; goto out; } if ((r = sshbuf_put_bignum2(buf, shared_secret)) != 0) goto out; *shared_secretp = buf; buf = ((void *)0) ; out: EC_POINT_clear_free(dh_pub); BN_clear_free(shared_secret); freezero(kbuf, klen); sshbuf_free(buf); return r; }
int kex_ecdh_dec_key_group(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long *a4, unsigned long long a5) { unsigned long v0; unsigned int v1; void* v2; void* v3; void* v4; void* v5; unsigned long long v6; unsigned long long v8; v0 = a0; v2 = 0; v3 = 0; v4 = 0; v5 = 0; v6 = 0; *(a4) = 0; v2 = sshbuf_new(a0, a1, a2, a3, a4, a5); if (!v2) { v1 = -2; } else { v1 = sshbuf_put_stringb(v2, a1, a1); if (!v1) { v4 = EC_POINT_new(a3); if (!v4) { v1 = -2; } else { v1 = sshbuf_get_ec(v2, v4, a3, v4); if (!v1) { sshbuf_reset(v2); if (sshkey_ec_validate_public(a3, v4, v4)) { v1 = -3; } else { v8 = __addvsi3(EC_GROUP_get_degree(a3), 0x7); v6 = (v8 < 0 ? (v8 + 7) : v8) >> 3; v5 = malloc(v6); if (!v5 || (v3 = BN_new(), !v3)) { v1 = -2; } else if (ECDH_compute_key(v5, v6, v4, a2, 0x0) != v6 || !BN_bin2bn(v5, v6, v3, v6)) { v1 = -22; } else { v1 = sshbuf_put_bignum2(v2, v3, v3); if (!v1) { *(a4) = v2; v2 = 0; } } } } } } } EC_POINT_clear_free(v4); BN_clear_free(v3); freezero(v5, v6, v6); sshbuf_free(v2); return v1; }
void get_dn_crt_set(gnutls_x509_crt_t crt) { int ret; const char *err; if (batch) { if (!cfg.dn) return; ret = gnutls_x509_crt_set_dn(crt, cfg.dn, &err); if (ret < 0) { fprintf( stderr , "set_dn: %s at: %s\n", gnutls_strerror(ret), err); exit(1); } } }
long long get_dn_crt_set(unsigned long long a0) { unsigned int v0; char v1; if (*(got.batch) && *((got.cfg + 32))) { v0 = gnutls_x509_crt_set_dn(a0, *((got.cfg + 32)), &v1, *((got.cfg + 32))); if (v0 < 0) { fprintf(*(got.stderr), "set_dn: %s at: %s\n", gnutls_strerror(v0), *(&v1)); exit(0x1); } } if (!*((got.cfg + 32)) || !*(got.batch) || v0 >= 0) return 0; }
static _Bool advance_input_after_read_error (idx_t nbytes) { if (! input_seekable) { if (input_seek_errno == 29 ) return 1 ; (*__errno_location ()) = input_seek_errno; } else { off_t offset; advance_input_offset (nbytes); if (input_offset < 0) { nl_error (0, 0, gettext ("offset overflow while reading file %s"), quotearg_style (shell_escape_always_quoting_style, input_file)); return 0 ; } offset = lseek ( 0 , 0, 1 ); if (0 <= offset) { off_t diff; if (offset == input_offset) return 1 ; diff = input_offset - offset; if (! (0 <= diff && diff <= nbytes) && status_level != STATUS_NONE) nl_error (0, 0, gettext ("warning: invalid file offset after failed read")); if (0 <= lseek ( 0 , diff, 1 )) return 1 ; if ( (*__errno_location ()) == 0) nl_error (0, 0, gettext ("cannot work around kernel bug after all")); } } nl_error (0, (*__errno_location ()) , gettext ("%s: cannot seek"), quotearg_n_style_colon (0, shell_escape_quoting_style, input_file)); return 0 ; }
int advance_input_after_read_error(unsigned int a0, unsigned long a1, unsigned long a2, unsigned int a3, unsigned int a4, unsigned int a5) { unsigned long v0; unsigned int v1; unsigned int v3; if (!(input_seekable ^ 1)) { advance_input_offset(a0); if (input_offset < 0) { nl_error(0x0, 0x0, gettext("offset overflow while reading file %s"), quotearg_style(0x4, *(&input_file)), a4, a5); v3 = 0; goto LABEL_4033b7; } v0 = lseek(0x0, 0x0, 0x1); if (!((v0 - 0 >> 63))) { if (v0 == input_offset) { v3 = 1; goto LABEL_4033b7; } *(&v1) = input_offset - v0; if (!((*(&v1) - 0 >> 63)) && *(&v1) <= a0) goto LABEL_403319; if (status_level != 1) nl_error(0x0, 0x0, gettext("warning: invalid file offset after failed read"), a3, a4, a5); LABEL_403319: if (lseek(0x0, *(&v1), 0x1) >= 0) { v3 = 1; goto LABEL_4033b7; } else { if (!*(__errno_location())) nl_error(0x0, 0x0, gettext("cannot work around kernel bug after all"), a3, a4, a5); } } } else if (input_seek_errno == 29) { v3 = 1; goto LABEL_4033b7; } else { *(__errno_location()) = input_seek_errno; } nl_error(0x0, *(__errno_location()), gettext("%s: cannot seek"), quotearg_n_style_colon(0x0, 0x3, *(&input_file)), a4, a5); v3 = 0; LABEL_4033b7: return v3; }
int ssh_krl_revoke_cert_by_serial(struct ssh_krl *krl, const struct sshkey *ca_key, u_int64_t serial) { return ssh_krl_revoke_cert_by_serial_range(krl, ca_key, serial, serial); }
int ssh_krl_revoke_cert_by_serial(unsigned long long a0, unsigned long long a1, unsigned long long a2) { return ssh_krl_revoke_cert_by_serial_range(a0, a1, a2, a2); }
static void print_encap_seg6(FILE *fp, struct rtattr *encap) { struct rtattr *tb[(__SEG6_IPTUNNEL_MAX - 1)+1]; struct seg6_iptunnel_encap *tuninfo; (parse_rtattr_flags((tb), ((__SEG6_IPTUNNEL_MAX - 1)), ((void*)(((char*)(encap)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), ((int)((encap)->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))), (1 << 15))); if (!tb[SEG6_IPTUNNEL_SRH]) return; tuninfo = ((void*)(((char*)(tb[SEG6_IPTUNNEL_SRH])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))); print_string(PRINT_ANY, "mode", "mode %s ", format_seg6mode_type(tuninfo->mode)); print_srh(fp, tuninfo->srh); }
void print_encap_seg6(undefined8 param_1,ushort *param_2) { undefined8 uVar1; long in_FS_OFFSET; undefined local_28 [8]; long local_20; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); parse_rtattr_flags(local_28,1,param_2 + 2,*param_2 - 4,0x8000); if (local_20 != 0) { uVar1 = format_seg6mode_type(*(undefined4 *)(local_20 + 4)); print_string(4,&DAT_00106d6b,"mode %s ",uVar1); print_srh(param_1,local_20 + 8); } if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return; }
int rl_beg_of_line (int count, int key) { rl_point = 0; return 0; }
void rl_beg_of_line(unsigned long a0, unsigned long a1) { unsigned int v0; unsigned int v1; char v2; void* v4; unsigned long long v5; v1 = a0; v0 = a1; rl_point = 0; v4 = 0; v5 = *(&v2); return; }
int log_change_level(LogLevel new_log_level) { if (argv0 == ((void *)0) ) return 0; switch (new_log_level) { case SYSLOG_LEVEL_QUIET: case SYSLOG_LEVEL_FATAL: case SYSLOG_LEVEL_ERROR: case SYSLOG_LEVEL_INFO: case SYSLOG_LEVEL_VERBOSE: case SYSLOG_LEVEL_DEBUG1: case SYSLOG_LEVEL_DEBUG2: case SYSLOG_LEVEL_DEBUG3: log_level = new_log_level; return 0; default: return -1; } }
int log_change_level(unsigned long a0) { unsigned int v1; if (!argv0) { v1 = 0; } else if (a0 <= 7) { log_level = a0; v1 = 0; } else { v1 = -1; } return v1; }
static _Bool pax_dump_header_1 (struct tar_sparse_file *file) { off_t block_ordinal = current_block_ordinal (); union block *blk; char *p, *q; size_t i; char nbuf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)]; off_t size = 0; struct sp_array *map = file->stat_info->sparse_map; char *save_file_name = file->stat_info->file_name; p = umaxtostr (file->stat_info->sparse_map_avail, nbuf); size += strlen (p) + 1; for (i = 0; i < file->stat_info->sparse_map_avail; i++) { p = umaxtostr (map[i].offset, nbuf); size += strlen (p) + 1; p = umaxtostr (map[i].numbytes, nbuf); size += strlen (p) + 1; } size = (size + 512 - 1) / 512; file->stat_info->archive_file_size += size * 512; file->dumped_size += size * 512; xheader_store ("GNU.sparse.major", file->stat_info, ((void *)0) ); xheader_store ("GNU.sparse.minor", file->stat_info, ((void *)0) ); xheader_store ("GNU.sparse.name", file->stat_info, ((void *)0) ); xheader_store ("GNU.sparse.realsize", file->stat_info, ((void *)0) ); file->stat_info->file_name = xheader_format_name (file->stat_info, "%d/GNUSparseFile.%p/%f", 0); if (strlen (file->stat_info->file_name) > 100) file->stat_info->file_name[100] = 0; blk = pax_start_header (file->stat_info); finish_header (file->stat_info, blk, block_ordinal); free (file->stat_info->file_name); file->stat_info->file_name = save_file_name; blk = find_next_block (); q = blk->buffer; p = umaxtostr (file->stat_info->sparse_map_avail, nbuf); do { char *endp = blk->buffer + 512; char const *srcp = p; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0); do { char *endp = blk->buffer + 512; char const *srcp = "\n"; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0); for (i = 0; i < file->stat_info->sparse_map_avail; i++) { p = umaxtostr (map[i].offset, nbuf); do { char *endp = blk->buffer + 512; char const *srcp = p; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0); do { char *endp = blk->buffer + 512; char const *srcp = "\n"; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0); p = umaxtostr (map[i].numbytes, nbuf); do { char *endp = blk->buffer + 512; char const *srcp = p; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0); do { char *endp = blk->buffer + 512; char const *srcp = "\n"; while (*srcp) { if (q == endp) { set_next_block_after (blk); blk = find_next_block (); q = blk->buffer; endp = blk->buffer + 512; } *q++ = *srcp++; } } while (0); } memset (q, 0, 512 - (q - blk->buffer)); set_next_block_after (blk); return 1 ; }
int pax_dump_header_1(struct_0 *a0) { void* v0; int tmp_10; void* v1; void* v2; unsigned long v3; unsigned long v4; char *v5; unsigned long v6; unsigned long long v7; unsigned long v8; char *v9; unsigned long v10; unsigned long long v11; unsigned long v12; char *v13; unsigned long v14; unsigned long long v15; unsigned long long v16; void* v17; struct_3 *v18; char *v19; char v20; char *v24; char *v26; char *v28; char *v30; char *v32; char *v34; v16 = current_block_ordinal(); v3 = 0; v17 = a0->field_18->field_140; v18 = a0->field_18->field_8; v19 = umaxtostr(a0->field_18->field_130, &v20, &v20); v3 = strlen(v19) + v3 + 1; for (v2 = 0; v2 < a0->field_18->field_130; v2 += 1) { v19 = umaxtostr(*((v17 + 0x10 * v2)), &v20, *((v17 + 0x10 * v2))); v3 = strlen(v19) + v3 + 1; v19 = umaxtostr(*((8 + v17 + 0x10 * v2)), &v20, *((8 + v17 + 0x10 * v2))); v3 = strlen(v19) + v3 + 1; } *(&v3) = (v3 + 511 < 0 ? v3 + 1022 : v3 + 511) >> 9; a0->field_18->field_118 = a0->field_18->field_118 + v3 * 0x200; a0->field_10 = v3 * 0x200 + a0->field_10; xheader_store("GNU.sparse.major", a0->field_18, 0x0); xheader_store("GNU.sparse.minor", a0->field_18, 0x0); xheader_store("GNU.sparse.name", a0->field_18, 0x0); xheader_store("GNU.sparse.realsize", a0->field_18, 0x0); a0->field_18->field_8 = xheader_format_name(a0->field_18, "%d/GNUSparseFile.%p/%f", 0x0); if (strlen(a0->field_18->field_8) > 100) *((a0->field_18->field_8 + 100)) = 0; v0 = pax_start_header(a0->field_18); finish_header(a0->field_18, v0, v16, v0); free(a0->field_18->field_8); a0->field_18->field_8 = v18; v0 = find_next_block(); v1 = v0; v19 = umaxtostr(a0->field_18->field_130, &v20, &v20); v4 = v0 + 0x200; for (v5 = v19; *(v5); *(v24) = *(tmp_10)) { if (v1 == v4) { set_next_block_after(v0); v0 = find_next_block(); v1 = v0; v4 = v0 + 0x200; } tmp_10 = v5; v5 += 1; v24 = v1; v1 += 1; } v6 = v0 + 0x200; for (v7 = "\n"; *(v7); *(v26) = *(tmp_10)) { if (v1 == v6) { set_next_block_after(v0); v0 = find_next_block(); v1 = v0; v6 = v0 + 0x200; } tmp_10 = v7; v7 += 1; v26 = v1; v1 += 1; } for (v2 = 0; v2 < a0->field_18->field_130; v2 += 1) { v19 = umaxtostr(*((v17 + 0x10 * v2)), &v20, *((v17 + 0x10 * v2))); v8 = v0 + 0x200; for (v9 = v19; *(v9); *(v28) = *(tmp_10)) { if (v1 == v8) { set_next_block_after(v0); v0 = find_next_block(); v1 = v0; v8 = v0 + 0x200; } tmp_10 = v9; v9 += 1; v28 = v1; v1 += 1; } v10 = v0 + 0x200; for (v11 = "\n"; *(v11); *(v30) = *(tmp_10)) { if (v1 == v10) { set_next_block_after(v0); v0 = find_next_block(); v1 = v0; v10 = v0 + 0x200; } tmp_10 = v11; v11 += 1; v30 = v1; v1 += 1; } v19 = umaxtostr(*((8 + v17 + 0x10 * v2)), &v20, *((8 + v17 + 0x10 * v2))); v12 = v0 + 0x200; for (v13 = v19; *(v13); *(v32) = *(tmp_10)) { if (v1 == v12) { set_next_block_after(v0); v0 = find_next_block(); v1 = v0; v12 = v0 + 0x200; } tmp_10 = v13; v13 += 1; v32 = v1; v1 += 1; } v14 = v0 + 0x200; for (v15 = "\n"; *(v15); *(v34) = *(tmp_10)) { if (v1 == v14) { set_next_block_after(v0); v0 = find_next_block(); v1 = v0; v14 = v0 + 0x200; } tmp_10 = v15; v15 += 1; v34 = v1; v1 += 1; } } memset(v1, 0x0, 0x200 - (v1 - v0)); set_next_block_after(v0); return 1; }
HASH_TABLE * assoc_dequote (h) HASH_TABLE *h; { int i; BUCKET_CONTENTS *tlist; char *t; if (h == 0 || ((h)->nentries == 0)) return ((HASH_TABLE *) ((void *)0) ); for (i = 0; i < h->nbuckets; i++) for (tlist = ((h && (i < h->nbuckets)) ? h->bucket_array[i] : (BUCKET_CONTENTS *) ((void *)0) ); tlist; tlist = tlist->next) { t = dequote_string ((char *)tlist->data); do { if (tlist->data) sh_xfree((tlist->data), "assoc.c", 206); } while (0); tlist->data = t; } return h; }
long * assoc_dequote(long *param_1) { undefined8 uVar1; int local_1c; undefined8 *local_18; if ((param_1 == (long *)0x0) || (*(int *)((long)param_1 + 0xc) == 0)) { param_1 = (long *)0x0; } else { for (local_1c = 0; local_1c < *(int *)(param_1 + 1); local_1c = local_1c + 1) { if ((param_1 == (long *)0x0) || (*(int *)(param_1 + 1) <= local_1c)) { local_18 = (undefined8 *)0x0; } else { local_18 = *(undefined8 **)(*param_1 + (long)local_1c * 8); } for (; local_18 != (undefined8 *)0x0; local_18 = (undefined8 *)*local_18) { uVar1 = dequote_string(local_18[2]); if (local_18[2] != 0) { sh_xfree(local_18[2],"assoc.c",0xce); } local_18[2] = uVar1; } } } return param_1; }
static int hostspec_is_complex(const char *hosts) { char *cp; if (strchr(hosts, '*') != ((void *)0) || strchr(hosts, '?') != ((void *)0) ) return 1; if ((cp = strchr(hosts, ',')) == ((void *)0) ) return 0; if (strchr(cp + 1, ',') != ((void *)0) ) return 1; return 0; }
_BOOL8 hostspec_is_complex(const char *a1) { char *v2; if ( strchr(a1, 42) || strchr(a1, 63) ) return 1LL; v2 = strchr(a1, 44); return v2 && strchr(v2 + 1, 44) != 0LL; }