input stringlengths 16 454k | output stringlengths 13 350k | function_name stringlengths 1 100 | repo_name stringlengths 6 43 | category stringclasses 76
values | sample_id stringlengths 22 88 | decompiler stringclasses 1
value | opt_level stringclasses 1
value |
|---|---|---|---|---|---|---|---|
int ordkey(int c) {
int k;
k = c;
if (c > 31) {
if (c > 126 && c <= 159) {
k = 0;
if (c == 127) {
if (seq_0.delf)
return 265;
else
return 257;
}
}
} else {
if (c == 8)
seq_0.delf = 1;
return lowtbl[c];
}
return k;
} | static int ordkey(int c) {
int k = c;
if (c < 32) {
if (ALLOW_DEL_CH && c == 8)
seq.delf = 1;
k = lowtbl[c];
} else if (c >= 127 && c < 0xA0) {
k = KBD_NOKEY;
if (c == 127)
k = seq.delf ? KBD_DEL : KBD_BS;
}
return k;
} | ordkey | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
unsigned long p_start_time(int pid) {
unsigned long v2;
int i;
int ia;
unsigned long c;
FILE *f;
char buf[40];
unsigned long v8;
v8 = __readfsqword(0x28u);
c = 0;
snprintf(buf, 0x20u, "/proc/%d/stat", pid);
f = fopen(buf, "r");
if (!f)
return -1;
do {
i = fgetc(f);
if (i == -1) {
... | static unsigned long p_start_time(int pid) {
char buf[32];
FILE *f;
int i;
unsigned long c = 0;
snprintf(buf, sizeof buf, "/proc/%d/stat", pid);
f = fopen(buf, "r");
if (!f)
return -1;
while ((i = fgetc(f)) != EOF) {
if (i == ' ')
c++;
if (c == START_TIME_POS)
goto FOUND;
}
f... | p_start_time | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int pkeyh(wdgt *w, int key) {
int ret;
int ctrl;
ret = 1;
ctrl = key & 0xFFF;
if (key == 116 || key == 256) {
pswitch(w, key, pkey_0);
pkey_0 = key;
return 1;
}
if (!w->wrefresh)
return 0;
if (ctrl == 73 || ctrl == 75 || ctrl == 85 || ctrl == 84) {
signal_keys(w, key);
return 1;... | static int pkeyh(struct wdgt *w, int key) {
int ret = KEY_HANDLED;
int ctrl = key & KBD_MASK;
static int pkey;
if (key == 't' || key == KBD_ENTER) {
pswitch(w, key, pkey);
pkey = key;
return KEY_HANDLED;
}
if (WIN_HIDDEN(w))
return KEY_SKIPPED;
if (ctrl == 'I' || ctrl == 'K' || ctrl == '... | pkeyh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void plgn_out_start() { scr_output_start(exti); } | void plgn_out_start(void) { scr_output_start(exti); } | plgn_out_start | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void *pmsgh(wdgt *w, int type, wdgt *s, void *d) {
if (type == 1) {
pid_1 = crsr_pid(w->crsr);
return &pid_1;
} else if (type == 9) {
return (void *)getprocbyname(w, (int)d);
} else {
return 0;
}
} | static void *pmsgh(struct wdgt *w, int type, struct wdgt *s, void *d) {
static u32 pid;
switch (type) {
case MWANT_CRSR_VAL:
pid = crsr_pid(w->crsr);
return &pid;
case MSND_SEARCH:
return (int *)(intptr_t)(getprocbyname(w, (int)d));
break;
}
return 0;
} | pmsgh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
float prcnt(unsigned long i, unsigned long v) {
unsigned long v3;
float v4;
float v5;
if (!v)
return 0.0;
v3 = 100 * i;
if (((100 * i) & 0x8000000000000000LL) != 0LL)
v4 = (float)(int)(v3 >> 1) + (float)(int)(v3 >> 1);
else
v4 = (float)(int)v3;
if ((v & 0x8000000000000000LL) != 0LL)
v5 ... | static inline float prcnt(unsigned long i, unsigned long v) {
if (!v)
return 0;
return ((float)(i * 100)) / (float)v;
} | prcnt | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char *prepare_line(wdgt *w, process *p) {
char *cmdline;
int v4;
char *owner_name;
char state_color;
char *v7;
char v8;
char state;
int offset;
char *tree;
state = p->proc->state;
offset = 0;
if (!p)
return 0;
tree = tree_string(tree_root, p->proc);
if (state == 83)
state = 32;
if... | static char *prepare_line(struct wdgt *w, struct process *p) {
char *tree, state = p->proc->state;
int offset = 0;
if (!p)
return 0;
tree = tree_string(tree_root, p->proc);
if (state == 'S')
state = ' ';
if (show_linenr)
offset = snprintf(w->mwin->gbuf, w->mwin->gbsize, "\x6%4d ", p->line + 1);
... | prepare_line | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void prg_exit(char *s) {
curses_end();
if (s)
puts(s);
exit(0);
} | void prg_exit(char *s) {
curses_end();
if (s)
printf("%s\n", s);
exit(0);
} | prg_exit | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void print(const char *t, ...) {
long v1;
long v2;
long v3;
long v4;
long v5;
va_list ap;
char buf[264];
unsigned long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
va_start(ap, t);
v3 = va_arg(ap, _QWORD);
v1 = va_arg(ap, _QWORD);
v2 = va_arg(ap, _QWORD);
v4 = va_arg(ap, _QW... | void print(const char *t, ...) {
int n;
char buf[SUBWIN_COLS];
va_list ap;
va_start(ap, t);
n = vsnprintf(buf, sizeof buf, t, ap);
waddstr((WINDOW *)exti->wd, buf);
va_end(ap);
} | print | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void print_boot_time() {
char *v0;
time_t btime;
unsigned long v2;
v2 = __readfsqword(0x28u);
btime = get_boot_time();
if (btime) {
v0 = ctime(&btime);
print("%s", v0);
} else {
no_info();
}
} | static inline void print_boot_time(void) {
time_t btime = get_boot_time();
if (btime)
print("%s", ctime(&btime));
else
no_info();
} | print_boot_time | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void print_net_conn(netconn_t *t) {
unsigned int s_port;
char *v2;
unsigned int d_port;
char *v4;
char buf[72];
unsigned long v6;
v6 = __readfsqword(0x28u);
s_port = t->s_port;
v2 = inet_ntoa((struct in_addr)t->s_addr);
snprintf(buf, 0x40u, "%s:%d", v2, s_port);
boldon();
print(buf);
if (t->d... | static void print_net_conn(struct netconn_t *t) {
char buf[64];
snprintf(buf, sizeof buf, "%s:%d", inet_ntoa(*((struct in_addr *)&t->s_addr)),
t->s_port);
boldon();
print(buf);
if (t->d_addr)
print(" -> %s:%d", inet_ntoa(*((struct in_addr *)&t->d_addr)), t->d_port);
print(" %s", tcp_state[t->... | print_net_conn | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void println(const char *t, ...) {
long v1;
long v2;
long v3;
long v4;
long v5;
u32 n;
va_list ap;
char buf[264];
unsigned long v9;
long v10;
long v11;
long v12;
long v13;
long v14;
va_start(ap, t);
v3 = va_arg(ap, _QWORD);
v1 = va_arg(ap, _QWORD);
v2 = va_arg(ap, _QWORD);
v4 = va... | void println(const char *t, ...) {
int n;
char buf[SUBWIN_COLS];
va_list ap;
va_start(ap, t);
n = vsnprintf(buf, sizeof buf, t, ap);
scr_addstr(exti, buf, n);
va_end(ap);
} | println | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void proc_del(process *p) {
*p->prev = p->next;
if (p->next)
p->next->prev = p->prev;
if (p->proc)
p->proc->priv = 0;
free(p);
} | static void proc_del(struct process *p) {
*p->prev = p->next;
if (p->next)
p->next->prev = p->prev;
if (p->proc)
p->proc->priv = 0;
free(p);
} | proc_del | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int proc_getloadavg(double *d, int l) { return getloadavg(d, l); } | int proc_getloadavg(double d[], int l) {
#ifndef HAVE_GETLOADAVG
FILE *f;
int ret = -1;
if (!(f = fopen("/proc/loadavg", "r")))
return ret;
if (fscanf(f, "%lf %lf %lf", &d[0], &d[1], &d[2]) == 3)
ret = 0;
fclose(f);
return ret;
#else
return getloadavg(d, l);
#endif
} | proc_getloadavg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int proc_pid_uid(u32 pid) {
stat s;
char buf[40];
unsigned long v4;
v4 = __readfsqword(0x28u);
snprintf(buf, 0x20u, "/proc/%d", pid);
if (stat(buf, &s) == -1)
return -1;
else
return s.st_uid;
} | int proc_pid_uid(u32 pid) {
char buf[32];
struct stat s;
snprintf(buf, sizeof buf, "/proc/%d", pid);
if (stat(buf, &s) == -1)
return -1;
return s.st_uid;
} | proc_pid_uid | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void proc_starttime(int pid, char *name) {
unsigned long sec;
time_t btime;
unsigned long i;
char *s;
unsigned long v6;
v6 = __readfsqword(0x28u);
btime = get_boot_time();
i = p_start_time(pid);
if (i != -1 && btime) {
sec = btime + i;
s = ctime((const time_t *)&sec);
print("%s", s);
} ... | static void proc_starttime(int pid, char *name) {
unsigned long i, sec;
char *s;
time_t btime = get_boot_time();
i = p_start_time(pid);
if (i == -1 || !btime) {
no_info();
return;
}
sec = btime + i;
s = ctime(&sec);
print("%s", s);
} | proc_starttime | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char *proc_ucount() {
snprintf(buf_4, 0x3Fu, &byte_D538, nusers, prot_tab[2].nr, prot_tab[1].nr,
prot_tab[0].nr,
nusers - prot_tab[2].nr - prot_tab[1].nr - prot_tab[0].nr);
return buf_4;
} | char *proc_ucount(void) {
static char buf[64];
int other =
nusers - prot_tab[LOCAL].nr - prot_tab[TELNET].nr - prot_tab[SSH].nr;
snprintf(buf, sizeof buf - 1,
"\x1%d users: %d local, %d telnet, %d ssh, %d other\x3", nusers,
prot_tab[LOCAL].nr, prot_tab[TELNET].nr, prot_tab[SSH].nr, ot... | proc_ucount | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void pstat_update(process *p, int n) {
int state;
pstat.nr += n;
if (p->proc) {
state = p->proc->state;
if (state == 90) {
pstat.zm += n;
} else if (state <= 90) {
if (state == 83) {
pstat.sl += n;
} else if (state <= 83) {
if (state == 68) {
pstat.st += n;... | static void pstat_update(struct process *p, int n) {
pstat.nr += n;
if (!p->proc)
return;
switch (p->proc->state) {
case 'S':
pstat.sl += n;
break;
case 'R':
pstat.rn += n;
break;
case 'Z':
pstat.zm += n;
break;
case 'D':
pstat.st += n;
break;
}
} | pstat_update | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void pswitch(wdgt *w, int k, int p) {
if (w->wrefresh) {
if (k == p || k == 256) {
if (k != 116)
ptree_hide(w);
} else if (k == 116) {
tree_root = 1;
ptree_periodic(w);
w->flags |= 4u;
}
} else {
if (k == 256) {
root_change(w);
} else if (k == 116) {
t... | static void pswitch(struct wdgt *w, int k, int p) {
if (!WIN_HIDDEN(w)) {
if (k == p || k == KBD_ENTER) {
if (k != 't')
ptree_hide(w);
return;
}
if (k == 't') {
tree_root = INIT_PID;
ptree_periodic(w);
WNEED_REDRAW(w);
return;
}
} else {
if (k == KBD_E... | pswitch | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptree_hide(wdgt *w) {
w->wrefresh = 0;
w->redraw = w->wrefresh;
clear_list();
w->periodic = 0;
w->msgh = 0;
ptreeinfo(w, 0);
*(_QWORD *)&pstat.nr = 0;
*(_QWORD *)&pstat.sl = 0;
pstat.zm = 0;
} | static void ptree_hide(struct wdgt *w) {
DBG("Deleting ptree from lists");
w->redraw = w->wrefresh = 0;
clear_list();
w->periodic = 0;
w->msgh = 0;
ptreeinfo(w, 0);
bzero(&pstat, sizeof pstat);
} | ptree_hide | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptree_hlp(wdgt *w) {
char *s;
s = hlp_init_pid;
if (tree_root != 1)
s = hlp;
wmsg_send(w, 3, s);
} | static void ptree_hlp(struct wdgt *w) {
char *s = hlp_init_pid;
if (tree_root != INIT_PID)
s = hlp;
wmsg_send(w, MCUR_HLP, s);
} | ptree_hlp | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptree_periodic(wdgt *w) {
update_tree((void (*)(void *))mark_del);
delete_tree_lines(w);
synchronize(w);
ptreeinfo(w, 1);
} | static void ptree_periodic(struct wdgt *w) {
DBG("**** building process tree root %d *****", tree_root);
update_tree(mark_del);
delete_tree_lines(w);
synchronize(w);
ptreeinfo(w, 1);
} | ptree_periodic | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptree_redraw(wdgt *w) {
scr_werase(w);
draw_tree(w);
} | static void ptree_redraw(struct wdgt *w) {
DBG("--- redraw tree");
scr_werase(w);
draw_tree(w);
} | ptree_redraw | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptree_reg(wdgt *w) {
w->keyh = (int (*)(wdgt *, int))pkeyh;
w->msgh = (void *(*)(wdgt *, int, wdgt *, void *))pmsgh;
mwin_msg_on(w);
} | void ptree_reg(struct wdgt *w) {
w->keyh = pkeyh;
w->msgh = pmsgh;
mwin_msg_on(w);
} | ptree_reg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptree_unhide(wdgt *w) {
ptree_hlp(w);
ptree_periodic(w);
w->periodic = (void (*)(wdgt *))ptree_periodic;
w->msgh = (void *(*)(wdgt *, int, wdgt *, void *))pmsgh;
w->redraw = (void (*)(wdgt *))ptree_redraw;
w->wrefresh = (void (*)(wdgt *))scr_wrefresh;
w->flags |= 4u;
w->crsr = 0;
w->vy = 0;
w->... | static void ptree_unhide(struct wdgt *w) {
ptree_hlp(w);
ptree_periodic(w);
w->periodic = ptree_periodic;
w->msgh = pmsgh;
w->redraw = ptree_redraw;
w->wrefresh = scr_wrefresh;
WNEED_REDRAW(w);
w->vy = w->vy = w->crsr = 0;
} | ptree_unhide | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptree_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize, u32 pxsize,
u8_0 c) {
wdgt *v7;
v7 = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "ptree", c);
v7->crsr = 0;
ptree_reg(v7);
} | static void ptree_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize,
u32 pxsize, u8 c) {
struct wdgt *w;
w = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "ptree", c);
w->crsr = 0;
ptree_reg(w);
} | ptree_wdgt | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ptreeinfo(wdgt *w, int i) {
int n;
signed int size;
char *buf;
size = w->mwin->gbsize;
buf = (char *)w->mwin->gbuf;
if (i) {
n = snprintf(buf, size, "%u tasks: %u running, %u sleeping", pstat.nr,
pstat.rn, pstat.sl);
if (pstat.st)
n += snprintf(&buf[n], size - n, ", %u s... | static void ptreeinfo(struct wdgt *w, int i) {
int n, size = w->mwin->gbsize;
char *buf = w->mwin->gbuf;
if (!i) {
wmsg_send(w, MSND_INFO, 0);
return;
}
n = snprintf(buf, size, "%u tasks: %u running, %u sleeping", pstat.nr,
pstat.rn, pstat.sl);
if (pstat.st)
n += snprintf(buf + n,... | ptreeinfo | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int read_file_pos(char *name, int pos) {
int c;
int i;
FILE *f;
unsigned long v6;
v6 = __readfsqword(0x28u);
c = 1;
f = fopen(name, "r");
if (!f)
return -1;
do {
i = fgetc(f);
if (i == -1) {
fclose(f);
return -1;
}
if (i == 32 || i == 9) {
++c;
do
i... | static int read_file_pos(char *name, int pos) {
FILE *f;
int i;
int c = 1;
f = fopen(name, "r");
if (!f)
return -1;
while ((i = fgetc(f)) != EOF) {
if (i == ' ' || i == '\t') {
c++;
while ((i = fgetc(f)) == ' ')
;
ungetc(i, f);
}
if (c == pos)
goto FOUND;
}
... | read_file_pos | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void read_meminfo(int pid, char *name) {
char buf[40];
unsigned long v3;
v3 = __readfsqword(0x28u);
snprintf(buf, 0x20u, "/proc/%d/status", pid);
read_proc_file(buf, "Uid", "VmLib");
} | static void read_meminfo(int pid, char *name) {
char buf[32];
snprintf(buf, sizeof buf, "/proc/%d/status", pid);
read_proc_file(buf, "Uid", "VmLib");
} | read_meminfo | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void read_proc_file(char *name, char *start, char *end) {
_BOOL4 ok;
int slen;
int elen;
FILE *f;
char buf[136];
unsigned long v9;
v9 = __readfsqword(0x28u);
ok = 0;
elen = 0;
slen = 0;
if (start)
slen = strlen(start);
if (end)
elen = strlen(end);
f = fopen(name, "r");
if (f) {
... | static void read_proc_file(char *name, char *start, char *end) {
char buf[128];
int ok = 0;
int slen, elen;
FILE *f;
slen = elen = 0;
if (start)
slen = strlen(start);
if (end)
elen = strlen(end);
f = fopen(name, "r");
if (!f) {
no_info();
return;
}
if (!start)
ok = 1;
while (... | read_proc_file | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void read_tcp_conn() { ; } | static void read_tcp_conn(void) {
FILE *f;
char buf[127], *tmp;
int i;
unsigned int inode;
static int flag = 0;
return;
if (!flag) {
hash_init(tcp_hashtable);
flag = 1;
}
if (!(f = fopen("/proc/net/tcp", "r")))
return;
tmp = fgets(buf, sizeof buf, f);
while (fgets(buf, sizeof buf, f))... | read_tcp_conn | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void read_utmp() {
int fd;
int i;
fd = open("/var/run/utmp", 0);
if (fd == -1)
err_exit(1, "Cannot open utmp");
while (1) {
i = read(fd, &entry_5, 0x180u);
if (i <= 0)
break;
if (i != 384)
errx(1, "Error reading /var/run/utmp");
if (entry_5.ut_type == 7)
new_user(&entry_... | void read_utmp(void) {
int fd, i;
static struct utmp entry;
struct user_t *u;
if ((fd = open(UTMP_FILE, O_RDONLY)) == -1)
err_exit(1, "Cannot open utmp");
while ((i = read(fd, &entry, sizeof entry)) > 0) {
if (i != sizeof entry)
errx(1, "Error reading " UTMP_FILE);
#ifdef HAVE_USER_PROCESS
... | read_utmp | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int reg_match(const char *s) { return regexec(&cur_reg, s, 0, 0, 2) == 0; } | inline int reg_match(const char *s) {
return !regexec(&cur_reg, s, 0, 0, REG_NOTEOL);
} | reg_match | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void remove_proc(proc_t *p) {
*p->hash.ppv = p->hash.nx;
if (p->hash.nx)
p->hash.nx->hash.ppv = p->hash.ppv;
if (cache)
free(cache);
cache = p;
--num_proc;
} | static inline void remove_proc(struct proc_t *p) {
list_del(p, hash);
if (cache)
free(cache);
cache = p;
num_proc--;
} | remove_proc | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void resize() {
u32 prev_sy;
u32 prev_sx;
list_head *l;
prev_sy = mwin->sy;
prev_sx = mwin->sx;
get_scrsize(&mwin->sy, &mwin->sx);
for (l = mwin->wdgts.prev; l != (list_head *)mwin; l = l->prev) {
if (HIDWORD(l[8].next) < mwin->sx) {
HIDWORD(l[8].next) = mwin->sx + 1;
scr_wresize((wdgt *)... | static void resize(void) {
struct wdgt *w;
struct list_head *l;
u32 prev_sy = mwin->sy;
u32 prev_sx = mwin->sx;
get_scrsize(&mwin->sy, &mwin->sx);
list_for_each_r(l, &mwin->wdgts) {
w = list_entry(l, struct wdgt, wdgts_l);
if (w->pxsize < mwin->sx) {
w->pxsize = mwin->sx + 1;
scr_wres... | resize | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void root_change(wdgt *w) {
pid_t *p;
p = (pid_t *)wmsg_send(w, 4, 0);
if (p)
tree_root = *p;
else
tree_root = 1;
} | static void root_change(struct wdgt *w) {
void *p;
p = wmsg_send(w, MWANT_UPID, 0);
if (p)
tree_root = *(pid_t *)p;
else
tree_root = INIT_PID;
} | root_change | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int s_nleft(wdgt *w) { return w->nlines - (w->ysize - w->y + w->vy); } | static inline int s_nleft(struct wdgt *w) {
int n = w->ysize - w->y;
return w->nlines - (w->vy + n);
} | s_nleft | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void sadd_box(wdgt *w) {
wborder((WINDOW *)w->decor, dword_12D80, dword_12D80, dword_12D64,
dword_12D64, 0, 0, 0, 0);
} | static inline void sadd_box(struct wdgt *w) {
box(w->decor, ACS_VLINE, ACS_HLINE);
} | sadd_box | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int scr_addfstr(wdgt *w, char *s, u32 y, u32 x) {
u32 i;
char *p;
char *q;
p = s;
q = s;
if (!s)
return 1;
wmove((WINDOW *)w->wd, y, x);
wclrtoeol((WINDOW *)w->wd);
for (i = 0; *p && w->xsize >= i; ++i) {
if (*p <= 16) {
--i;
if (p != q)
waddnstr((WINDOW *)w->wd, q, (_DWOR... | int scr_addfstr(struct wdgt *w, char *s, u32 y, u32 x) {
char *p = s, *q = s;
int i = 0;
if (!p)
return 1;
wmove(w->wd, y, x);
wclrtoeol(w->wd);
for (i = 0; *p && i <= w->xsize; p++, i++) {
if (*p >= 17)
continue;
i--;
if (p - q != 0)
waddnstr(CWND(w), q, p - q);
wattrset(CWN... | scr_addfstr | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_addstr(wdgt *w, char *s, u32 n) { scr_lecho(w, s, n); } | void scr_addstr(struct wdgt *w, char *s, u32 n) { scr_lecho(w, s, n); } | scr_addstr | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_attr_set(wdgt *w, int n) { wattrset((WINDOW *)w->wd, n); } | void scr_attr_set(struct wdgt *w, int n) { wattrset(CWND(w), n); } | scr_attr_set | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_box(wdgt *w, char *s, u8_0 c) {
if (w->decor) {
scr_box_text(w, s, c);
} else {
w->decor = newpad(w->ysize - w->y + 3, w->xsize - w->x + 3);
if (w->decor) {
sadd_box(w);
wbkgd((WINDOW *)w->decor, c << 8);
scr_box_text(w, s, c);
}
}
} | void scr_box(struct wdgt *w, char *s, u8 c) {
if (w->decor) {
scr_box_text(w, s, c);
return;
}
DBG("Creating box for '%s'", w->name);
w->decor = newpad(w->ysize - w->y + 3, w->xsize - w->x + 3);
if (!w->decor)
return;
sadd_box(w);
wbkgd(w->decor, COLOR_PAIR(c));
scr_box_text(w, s, c);
} | scr_box | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_box_text(wdgt *w, char *s, u8_0 c) {
int l;
if (s) {
l = strlen(s);
if (wmove((WINDOW *)w->decor, w->ysize - w->y + 2, w->xsize - w->x - l) !=
-1)
waddnstr((WINDOW *)w->decor, s, l);
}
} | static void scr_box_text(struct wdgt *w, char *s, u8 c) {
int l, pos;
if (!s)
return;
l = strlen(s);
pos = w->xsize - w->x - l;
mvwaddnstr((WINDOW *)w->decor, w->ysize - w->y + 2, pos, s, l);
} | scr_box_text | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_clr_set(wdgt *w, int n) {
wattrset((WINDOW *)w->wd, (unsigned short)((_WORD)n << 8));
} | void scr_clr_set(struct wdgt *w, int n) { wattrset(CWND(w), COLOR_PAIR(n)); } | scr_clr_set | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_color_init() {
init_pair(1, 6, 0);
init_pair(2, 2, 0);
init_pair(3, 7, 0);
init_pair(4, 5, 0);
init_pair(5, 1, 0);
init_pair(6, 3, 0);
init_pair(7, 1, 6);
init_pair(8, 0, 6);
init_pair(9, 0, 7);
} | static void scr_color_init(void) {
init_pair(1, COLOR_CYAN, COLOR_BLACK);
init_pair(2, COLOR_GREEN, COLOR_BLACK);
init_pair(3, COLOR_WHITE, COLOR_BLACK);
init_pair(4, COLOR_MAGENTA, COLOR_BLACK);
init_pair(5, COLOR_RED, COLOR_BLACK);
init_pair(6, COLOR_YELLOW, COLOR_BLACK);
init_pair(7, COLOR_RED, COLOR_C... | scr_color_init | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_crsr_jmp(wdgt *w, int l) {
int size;
size = w->ysize - w->y - 1;
crsr_move(w, w->crsr, l);
if (w->vy > l || size + w->vy <= l)
w->vy = w->crsr - size;
} | void scr_crsr_jmp(struct wdgt *w, int l) {
int size = w->ysize - w->y - 1;
crsr_move(w, w->crsr, l);
if (l >= w->vy && l < w->vy + size)
return;
w->vy = w->crsr - size;
} | scr_crsr_jmp | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_decor_resize(wdgt *w) {
wresize((WINDOW *)w->decor, w->ysize - w->y + 3, w->xsize - w->x + 3);
sadd_box(w);
} | void scr_decor_resize(struct wdgt *w) {
wresize(w->decor, w->ysize - w->y + 3, w->xsize - w->x + 3);
sadd_box(w);
} | scr_decor_resize | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_delline(wdgt *w, u32 l) {
wmove((WINDOW *)w->wd, l, 0);
winsdelln((WINDOW *)w->wd, -1);
} | void scr_delline(struct wdgt *w, u32 l) {
wmove(w->wd, l, 0);
wdeleteln(w->wd);
} | scr_delline | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_doupdate() { doupdate(); } | void scr_doupdate(void) {
DBG("--------- UPDATING SCREEN ----------");
doupdate();
} | scr_doupdate | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int scr_keyh(wdgt *w, int key) {
int ret;
ret = 1;
switch (key) {
case 260:
kbd_left(w);
break;
case 261:
kbd_right(w);
break;
case 262:
kbd_up(w);
break;
case 263:
kbd_down(w);
break;
case 266:
ret = kbd_home(w);
break;
case 267:
ret = kbd_end(w);
brea... | int scr_keyh(struct wdgt *w, int key) {
int ret = KEY_HANDLED;
DBG("calling key %c for %s", key, w->name);
switch (key) {
case KBD_DOWN:
kbd_down(w);
break;
case KBD_UP:
kbd_up(w);
break;
case KBD_PAGE_DOWN:
kbd_page_down(w);
break;
case KBD_PAGE_UP:
kbd_page_up(w);
break;
... | scr_keyh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_ldeleted(wdgt *w, int l) {
if (l < w->crsr) {
if (w->vy)
--w->vy;
--w->crsr;
}
} | void scr_ldeleted(struct wdgt *w, int l) {
if (l >= w->crsr)
return;
if (!w->vy)
w->crsr--;
else {
w->vy--;
w->crsr--;
}
} | scr_ldeleted | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_lecho(wdgt *w, char *s, int n) {
waddnstr((WINDOW *)w->wd, s, n);
++w->nlines;
} | static void scr_lecho(struct wdgt *w, char *s, int n) {
waddnstr(CWND(w), s, n);
w->nlines++;
} | scr_lecho | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_linserted(wdgt *w, int line) {
if ((w->vy || w->crsr) && line <= w->crsr) {
++w->vy;
++w->crsr;
}
} | void scr_linserted(struct wdgt *w, int line) {
if (!w->vy && !w->crsr)
return;
if (line <= w->crsr) {
w->vy++;
w->crsr++;
}
} | scr_linserted | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_maddstr(wdgt *w, char *s, u32 y, u32 x, u32 n) {
wmove((WINDOW *)w->wd, y, x);
scr_lecho(w, s, n);
} | void scr_maddstr(struct wdgt *w, char *s, u32 y, u32 x, u32 n) {
wmove(w->wd, y, x);
scr_lecho(w, s, n);
} | scr_maddstr | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void *scr_newwin(u32 x, u32 y, u32 xsize, u32 ysize) {
WINDOW *w;
w = newwin(ysize, xsize, y, x);
if (!w)
return 0;
wbkgd(w, 0x800u);
return w;
} | void *scr_newwin(u32 x, u32 y, u32 xsize, u32 ysize) {
WINDOW *w;
if (!(w = newwin(ysize, xsize, y, x)))
return 0;
wbkgd(w, COLOR_PAIR(8));
return w;
} | scr_newwin | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_output_end(wdgt *w) {
if (w->vy >= w->nlines) {
if (w->nlines <= w->ysize)
w->vy = 0;
else
w->vy = w->nlines - w->ysize;
}
if (w->crsr > w->nlines)
w->crsr = w->nlines;
if (w->crsr != -1)
crsr_on(w, w->crsr);
} | void scr_output_end(struct wdgt *w) {
if (w->vy >= w->nlines) {
if (w->nlines > w->ysize)
w->vy = w->nlines - w->ysize;
else
w->vy = 0;
}
if (w->crsr > w->nlines)
w->crsr = w->nlines;
if (w->crsr != -1)
crsr_on(w, w->crsr);
} | scr_output_end | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_output_start(wdgt *w) { w->nlines = -1; } | void scr_output_start(struct wdgt *w) { w->nlines = -1; } | scr_output_start | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_werase(wdgt *w) { werase((WINDOW *)w->wd); } | void scr_werase(struct wdgt *w) { werase(w->wd); } | scr_werase | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_wrefresh(wdgt *w) {
if (w->decor)
pnoutrefresh((WINDOW *)w->decor, 0, 0, w->y - 1, w->x - 1, w->ysize + 1,
w->xsize + 1);
srefresh(w);
} | void scr_wrefresh(struct wdgt *w) {
DBG("'%s', %d %d %d %d %d %d", w->name, w->vy, w->vx, w->y, w->x, w->ysize,
w->xsize);
if (w->decor)
pnoutrefresh(w->decor, 0, 0, w->y - 1, w->x - 1, w->ysize + 1,
w->xsize + 1);
srefresh(w);
} | scr_wrefresh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scr_wresize(wdgt *w, u32 y, u32 x) { wresize((WINDOW *)w->wd, y, x); } | void scr_wresize(struct wdgt *w, u32 y, u32 x) { wresize(CWND(w), y, x); } | scr_wresize | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void scrlib_init() { curses_init(); } | static void scrlib_init(void) { curses_init(); } | scrlib_init | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void send_signal(int sig, pid_t pid) {
int p;
char buf[72];
unsigned long v4;
v4 = __readfsqword(0x28u);
if (pid == 1)
p = -1;
else
p = kill(pid, sig);
signal_sent(1);
if (p == -1)
sprintf(buf, "Can't send signal %d to process %d", sig, pid);
else
sprintf(buf, "Signal %d was sent to p... | void send_signal(int sig, pid_t pid) {
int p;
char buf[64];
if (pid == INIT_PID)
p = -1;
else
p = kill(pid, sig);
signal_sent(1);
if (p == -1)
sprintf(buf, "Can't send signal %d to process %d", sig, pid);
else
sprintf(buf, "Signal %d was sent to process %d", sig, pid);
} | send_signal | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void set_sig() {
signal(2, (__sighandler_t)int_handler);
signal(28, (__sighandler_t)winch_handler);
} | static void set_sig(void) {
signal(SIGINT, int_handler);
signal(SIGWINCH, winch_handler);
} | set_sig | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int show_net_conn(char *s) { return 1; } | static int show_net_conn(char *s) {
struct netconn_t *t;
unsigned int inode = 0;
return 1;
if (sscanf(s, "%d", &inode) != 1)
return 1;
t = tcp_find(inode, tcp_hashtable);
if (!t) {
return 0;
}
print_net_conn(t);
return 1;
} | show_net_conn | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void siglist(void *p) { ; } | static void siglist(void *p) { return; } | siglist | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int signal_keys(wdgt *w, int key) {
pid_t v3;
int keya;
int signal;
signal = 0;
if ((key & 0x4000) == 0)
return 0;
keya = key & 0xFFF;
if (keya == 85) {
signal = 1;
} else if ((key & 0xFFFu) <= 0x55) {
switch (keya) {
case 'T':
signal = 15;
break;
case 'I':
signal ... | static int signal_keys(struct wdgt *w, int key) {
int signal = 0;
if (!(key & KBD_CTRL))
return KEY_SKIPPED;
key &= KBD_MASK;
switch (key) {
case 'I':
signal = SIGINT;
break;
case 'K':
signal = SIGKILL;
break;
case 'U':
signal = SIGHUP;
break;
case 'T':
signal = SIGTERM;... | signal_keys | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int signal_sent(int i) {
if (i == -1)
return signal_sent_0;
signal_sent_0 = i;
return i;
} | static int signal_sent(int i) {
static int signal_sent;
if (i == -1)
return signal_sent;
return signal_sent = i;
} | signal_sent | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void srefresh(wdgt *w) {
pnoutrefresh((WINDOW *)w->wd, w->vy, w->vx, w->y, w->x, w->ysize, w->xsize);
} | static inline void srefresh(struct wdgt *w) {
pnoutrefresh(CWND(w), w->vy, w->vx, w->y, w->x, w->ysize, w->xsize);
} | srefresh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int st_arg(int c) {
if (c == -1)
return -3;
if (c <= 47 || c > 57) {
if (c == 59) {
if (++seq_0.argp < &seq_0.arg[16]) {
*seq_0.argp = 0;
return -1;
} else {
return 0;
}
} else {
return csiss3(c);
}
} else {
*seq_0.argp = c + 10 * *seq_0.argp - 4... | static int st_arg(int c) {
if (c == KBD_MORE)
return KBD_INCOMPLETE;
if (c >= '0' && c <= '9') {
*seq.argp = 10 * *seq.argp + c - '0';
return KBD_MORE;
}
if (c == ';') {
if (++seq.argp >= endof(seq.arg))
return KBD_NOKEY;
*seq.argp = 0;
return KBD_MORE;
}
return csiss3(c);
} | st_arg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int st_csiss3(int c) {
if (c < 32)
return -3;
if ((c == 91 || c == 63) && seq_0.type == 91) {
if (seq_0.mod)
return -3;
seq_0.mod = c;
return -1;
}
if (c > 47 && c <= 57) {
seq_0.arg[0] = c - 48;
goarg:
seq_0.argf = 1;
state = (int (*)(int))st_arg;
return -1;
}
if (c ... | static int st_csiss3(int c) {
if (c == KBD_MORE || c < ' ')
return KBD_INCOMPLETE;
if ((c == '[' || c == '?') && CSISEQ) {
if (seq.mod)
return KBD_INCOMPLETE;
seq.mod = c;
return KBD_MORE;
}
if (c >= '0' && c <= '9') {
seq.arg[0] = c - '0';
goto goarg;
}
if (c == ';') {
*++... | st_csiss3 | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int st_esc(int c) {
int ca;
switch (c) {
case -1:
return -3;
case 91:
case 79:
seq_0.type = c;
state = (int (*)(int))st_csiss3;
return -1;
case 27:
if (seq_0.mod) {
return -3;
} else {
seq_0.mod = 27;
return -1;
}
default:
ca = ordkey(c);
if (ca)
... | static int st_esc(int c) {
if (c == KBD_MORE)
return KBD_INCOMPLETE;
if (c == '[' || c == 'O') {
seq.type = c;
state = st_csiss3;
return KBD_MORE;
}
if (c == 27) {
if (seq.mod)
return KBD_INCOMPLETE;
seq.mod = c;
return KBD_MORE;
}
c = ordkey(c);
if (c)
c |= KBD_ALT;... | st_esc | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int st_mouse(int c) {
int *v2;
if (c == -1)
return -3;
v2 = seq_0.argp++;
*v2 = c - 32;
if (seq_0.argp >= &seq_0.arg[3])
return ((LOWORD(seq_0.arg[0]) << 10) & 0xF000) + 2048;
else
return -1;
} | static int st_mouse(int c) {
if (c == KBD_MORE)
return KBD_INCOMPLETE;
*seq.argp++ = c - 0x20;
if (seq.argp < seq.arg + 3)
return KBD_MORE;
return MSE_RELEASE + (((seq.arg[0] & 3) | seq.arg[1] << 16 |
seq.arg[2] << 24 | seq.arg[0] << 10) &
0xF000);
} | st_mouse | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int st_start(int c) {
int ca;
int k;
int m;
if (c == 27 || c == 155 || c == 143) {
seq_0.mod = 0;
seq_0.type = 0;
seq_0.argp = seq_0.arg;
seq_0.arg[0] = 0;
seq_0.arg[1] = 0;
seq_0.argf = 0;
state = (int (*)(int))st_esc;
if ((c & 0x80) != 0) {
seq_0.type = c - 64;
sta... | static int st_start(int c) {
int k;
if (c == 27 || c == 0x9B || c == 0x8F) {
seq.type = seq.mod = 0;
seq.argp = seq.arg;
seq.arg[0] = 0;
seq.arg[1] = 0;
seq.argf = 0;
state = st_esc;
if (c & 0x80) {
seq.type = c - 64;
state = st_csiss3;
}
return KBD_MORE;
}
k = o... | st_start | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void synchronize(wdgt *w) {
int v1;
int v2;
int l;
proc_t *p;
process **current;
process *z;
l = 0;
p = tree_start(tree_root, tree_root);
current = &begin;
while (p) {
if (*current && p->priv) {
v1 = l++;
(*current)->line = v1;
(*current)->proc->priv = *current;
p = tree... | static void synchronize(struct wdgt *w) {
int l = 0;
struct proc_t *p = tree_start(tree_root, tree_root);
struct process **current = &begin, *z;
while (p) {
if (*current && p->priv) {
(*current)->line = l++;
(*current)->proc->priv = *current;
p = tree_next();
current = &((*current)->... | synchronize | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
netconn_t *tcp_find(unsigned int inode, list_head *head) {
list_head *h;
list_head *tmp;
tmp = &head[hash(inode)];
for (h = tmp->next; h != tmp; h = h->next) {
if (inode == HIDWORD(h[1].next))
return (netconn_t *)&h[-1];
}
return 0;
} | static struct netconn_t *tcp_find(unsigned int inode, struct list_head *head) {
struct list_head *h, *tmp;
struct netconn_t *t;
tmp = head + hash(inode);
list_for_each(h, tmp) {
t = list_entry(h, struct netconn_t, n_hash);
if (inode == t->inode) {
return t;
}
}
return 0;
} | tcp_find | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void term_raw() {
termios t;
unsigned long v1;
v1 = __readfsqword(0x28u);
tcgetattr(0, &tio);
*(_QWORD *)&t.c_iflag = *(_QWORD *)&tio.c_iflag;
t.c_cflag = tio.c_cflag;
*(_QWORD *)&t.c_line = *(_QWORD *)&tio.c_line;
*(_QWORD *)&t.c_cc[7] = *(_QWORD *)&tio.c_cc[7];
*(_QWORD *)&t.c_cc[15] = *(_QWORD *)&... | void term_raw() {
struct termios t;
tcgetattr(0, &tio);
t = tio;
t.c_lflag &= ~(ICANON | ECHO);
tcsetattr(0, TCSANOW, &t);
t_flags = fcntl(0, F_GETFL);
fcntl(0, F_SETFL, O_NONBLOCK);
} | term_raw | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void term_rest() {
fcntl(0, 4, (unsigned int)t_flags);
tcsetattr(0, 0, &tio);
} | void term_rest() {
fcntl(0, F_SETFL, t_flags);
tcsetattr(0, TCSANOW, &tio);
} | term_rest | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void title(const char *t, ...) {
long v1;
long v2;
long v3;
long v4;
long v5;
va_list ap;
char buf[264];
unsigned long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
va_start(ap, t);
v3 = va_arg(ap, _QWORD);
v1 = va_arg(ap, _QWORD);
v2 = va_arg(ap, _QWORD);
v4 = va_arg(ap, _QW... | void title(const char *t, ...) {
int n;
char buf[SUBWIN_COLS];
va_list ap;
boldon();
va_start(ap, t);
n = vsnprintf(buf, sizeof buf, t, ap);
waddstr((WINDOW *)exti->wd, buf);
va_end(ap);
boldoff();
} | title | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void u_count(char *name, int p) {
size_t v2;
unsigned int i;
prot_t *t;
nusers += p;
for (i = 0; i <= 2; ++i) {
t = &prot_tab[i];
v2 = strlen(t->s);
if (!strncmp(t->s, name, v2))
t->nr += p;
}
} | static void u_count(char *name, int p) {
int i;
struct prot_t *t;
nusers += p;
for (i = 0; i < sizeof prot_tab / sizeof(struct prot_t); i++) {
t = &prot_tab[i];
if (strncmp(t->s, name, strlen(t->s)))
continue;
t->nr += p;
}
} | u_count | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void udel(user_t *u, wdgt *w) {
scr_delline(w, u->line);
scr_ldeleted(w, u->line);
update_line(u->line);
u_count(u->parent, -1);
list_del(&u->head);
free(u);
} | static void udel(struct user_t *u, struct wdgt *w) {
scr_delline(w, u->line);
scr_ldeleted(w, u->line);
update_line(u->line);
u_count(u->parent, LOGOUT);
list_del(&u->head);
free(u);
} | udel | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ulist_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize, u32 pxsize,
u8_0 c) {
wdgt *v7;
v7 = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "ulist", c);
v7->crsr = 0;
ulist_reg(v7);
} | static void ulist_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize,
u32 pxsize, u8 c) {
struct wdgt *w;
w = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "ulist", c);
w->crsr = 0;
ulist_reg(w);
} | ulist_wdgt | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void update_line(int line) {
list_head *tmp;
for (tmp = users_l.next; tmp != &users_l; tmp = tmp->next) {
if (line < SHIDWORD(tmp[22].prev))
--HIDWORD(tmp[22].prev);
}
} | void update_line(int line) {
struct user_t *u;
struct list_head *tmp;
list_for_each(tmp, &users_l) {
u = list_entry(tmp, struct user_t, head);
if (u->line > line)
u->line--;
}
} | update_line | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void uprint(user_t *u, wdgt *w) {
char *v2;
u32 n;
scr_attr_set(w, 0x200000);
if (toggle)
v2 = count_idle(u->tty);
else
v2 = get_w(u->pid);
n = snprintf((char *)w->mwin->gbuf, w->mwin->gbsize,
"%-14.14s %-9.9s %-6.6s %-19.19s %s", u->parent, u->name, u->tty,
u->host, v... | static void uprint(struct user_t *u, struct wdgt *w) {
int n;
scr_attr_set(w, A_BOLD);
n = snprintf(w->mwin->gbuf, w->mwin->gbsize,
"%-14.14s %-9.9s %-6.6s %-19.19s %s", u->parent, u->name, u->tty,
u->host, toggle ? count_idle(u->tty) : get_w(u->pid));
scr_maddstr(w, w->mwin->gbuf,... | uprint | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void uredraw(wdgt *w) {
user_t *tmp;
scr_werase(w);
scr_output_start(w);
for (tmp = (user_t *)users_l.prev; tmp != (user_t *)&users_l;
tmp = (user_t *)tmp->head.prev)
uprint(tmp, w);
scr_output_end(w);
} | void uredraw(struct wdgt *w) {
struct list_head *tmp;
struct user_t *u;
scr_werase(w);
scr_output_start(w);
list_for_each_r(tmp, &users_l) {
u = list_entry(tmp, struct user_t, head);
uprint(u, w);
}
scr_output_end(w);
} | uredraw | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
netconn_t *validate(unsigned int inode, char *s) {
netconn_t *tmp;
netconn_t t;
unsigned long v5;
v5 = __readfsqword(0x28u);
memset(&t, 0, sizeof(t));
if ((unsigned int)__isoc99_sscanf(s, "%x:%x %x:%x %x", &t.s_addr, &t.s_port,
&t.d_addr, &t.d_port, &t.state) != 5)
r... | static struct netconn_t *validate(unsigned int inode, char *s) {
struct netconn_t t, *tmp;
int i, offset = 2 * sizeof(struct list_head) + sizeof(int) + sizeof(short);
bzero(&t, sizeof(t));
i = sscanf(s, "%x:%x %x:%x %x", &t.s_addr, &t.s_port, &t.d_addr, &t.d_port,
&t.state);
if (i != 5)
retur... | validate | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
proc_t *validate_proc(int pid, char state) {
proc_t *p;
p = find_by_pid(pid);
if (pid > 1) {
if (p) {
*p->mlist.ppv = p->mlist.nx;
if (p->mlist.nx)
p->mlist.nx->mlist.ppv = p->mlist.ppv;
} else {
p = new_proc(pid, state);
}
p->mlist.nx = main_list;
p->mlist.ppv = &ma... | static struct proc_t *validate_proc(int pid, char state) {
struct proc_t *p;
p = find_by_pid(pid);
if (pid <= 1) {
p->state = state;
return p;
}
if (p)
list_del(p, mlist);
else
p = new_proc(pid, state);
list_add(main_list, p, mlist);
return p;
} | validate_proc | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int wd_create(wdgt *w, u32 ysize, u32 xsize, u32 pysize, u32 pxsize, u8_0 c) {
w->wd = newpad(pysize + 1, pxsize + 1);
w->color = c;
w->pysize = pysize;
w->pxsize = pxsize;
wbkgd((WINDOW *)w->wd, c << 8);
return w->wd != 0;
} | static int wd_create(struct wdgt *w, u32 ysize, u32 xsize, u32 pysize,
u32 pxsize, u8 c) {
w->wd = newpad(pysize + 1, pxsize + 1);
w->color = c;
w->pysize = pysize;
w->pxsize = pxsize;
wbkgd((WINDOW *)w->wd, COLOR_PAIR(c));
if (!w->wd)
return 0;
return 1;
} | wd_create | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
wdgt *wdgt_alloc() { return (wdgt *)calloc(1u, 0xA8u); } | static inline struct wdgt *wdgt_alloc(void) {
return calloc(1, sizeof(struct wdgt));
} | wdgt_alloc | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void wdgt_init(wdgt *w) {
w->wdgts_l.next = &w->wdgts_l;
w->wdgts_l.prev = &w->wdgts_l;
w->msg_l.next = &w->msg_l;
w->msg_l.prev = &w->msg_l;
list_add(&w->wdgts_l, &mwin->wdgts);
} | static void wdgt_init(struct wdgt *w) {
INIT_LIST_HEAD(&w->wdgts_l);
INIT_LIST_HEAD(&w->msg_l);
MWADD_TO_LIST(w, wdgts);
} | wdgt_init | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
wdgt *wdgt_new(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize, u32 pxsize,
char *name, u8_0 c) {
wdgt *w;
w = wdgt_alloc();
if (!w)
err_exit(1, "Cannot allocate memory for a new widget");
wdgt_init(w);
memcpy(w->name, name, 7u);
w->x = x;
w->y = y;
w->xsize = xsize;
w->ysize = ysiz... | static struct wdgt *wdgt_new(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize,
u32 pxsize, char *name, u8 c) {
struct wdgt *w;
if (!(w = wdgt_alloc()))
err_exit(1, "Cannot allocate memory for a new widget");
wdgt_init(w);
memcpy(w->name, name, sizeof w->name - 1);
w->x = x;
w-... | wdgt_new | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void wdgts_create(int sy, int sx) {
info_wdgt(0, 0, 1u, sx, 1u, sx, 3u);
hlp_wdgt(sy, 0, sy, sx, sy, sx, 1u);
ulist_wdgt(3u, 0, sy - 1, sx, 0x100u, sx, 3u);
ptree_wdgt(3u, 0, sy - 1, sx, 0x100u, sx, 3u);
exti_wdgt(sy / 4, sx / 5, sy - sy / 4, sx / -5 + sx, 0x100u, 0x80u, 8u);
input_wdgt(sy, 0, sy, sx, 0, 0,... | static void wdgts_create(int sy, int sx) {
info_wdgt(0, 0, 1, sx, 1, sx, CLR_WHITE_BLACK);
hlp_wdgt(sy, 0, sy, sx, sy, sx, CLR_CYAN_BLACK);
ulist_wdgt(3, 0, sy - 1, sx, 256, sx, CLR_WHITE_BLACK);
ptree_wdgt(3, 0, sy - 1, sx, 256, sx, CLR_WHITE_BLACK);
exti_wdgt(sy / 4, sx / 5, sy - sy / 4, sx - sx / 5, 256, ... | wdgts_create | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void winch_handler() { ++size_changed; } | static void winch_handler() { size_changed++; } | winch_handler | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void *wmsg_send(wdgt *sndr, int type, void *data) {
win *l;
void *ret;
wdgt *w;
ret = 0;
for (l = (win *)mwin->msg.prev; l != (win *)&mwin->msg;
l = (win *)l->wdgts.prev) {
w = (wdgt *)&l[-1].cval;
if (&l[-1].cval != (void *(**)(void))sndr) {
if (w->msgh) {
ret = w->msgh(w, type,... | void *wmsg_send(struct wdgt *sndr, int type, void *data) {
struct wdgt *w;
struct list_head *l;
void *ret = 0;
DBG("Sending message %s [%d] from %s", _msg[type], type, sndr->name);
list_for_each_r(l, &mwin->msg) {
w = list_entry(l, struct wdgt, msg_l);
if (w == sndr || !w->msgh)
continue;
D... | wmsg_send | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
const char *get_mime_type_from_magic_numbers(char *buffer) {
int i;
for (i = 0; sniffer_data_0[i].mime_type; ++i) {
if (!memcmp((&off_40A8)[3 * i], &buffer[*((int *)&unk_40B0 + 6 * i)],
*((int *)&unk_40B4 + 6 * i)))
return sniffer_data_0[i].mime_type;
}
return 0;
} | static const char *get_mime_type_from_magic_numbers(char *buffer) {
static struct {
const char *mime_type;
const char *first_bytes;
int offset;
int len;
} sniffer_data[] = {{"application/x-bzip2", "BZh", 0, 3},
{"application/x-gzip", "\037\213", 0, 2},
{"a... | get_mime_type_from_magic_numbers | file-roller-3.42.0 | app-arch | O0/app-arch/file-roller-3.42.0/rpm2cpio | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
long v4;
long v5;
const char *str;
const char *v7;
int i;
int offset;
int offseta;
const char *archive_command;
const char *filename;
GString *cpio_args;
FILE *stream;
const char *mime_type;
char *command;
guchar bytes[8];
unsigned... | int main(int argc, char **argv) {
const char *filename;
GString *cpio_args;
int i;
FILE *stream;
guchar bytes[8];
int il, dl, sigsize, offset;
const char *mime_type;
const char *archive_command;
char *command;
if (argc < 3)
return 0;
filename = argv[1];
cpio_args = g_string_new(argv[2]);
... | main | file-roller-3.42.0 | app-arch | O0/app-arch/file-roller-3.42.0/rpm2cpio | ida | O0 |
int bsdcat_getopt(bsdcat *bsdcat) {
char **argv;
char *v3;
char *getopt_word;
unsigned int opt;
int required;
const bsdcat_option *popt;
const bsdcat_option *match;
const bsdcat_option *match2;
const char *long_prefix;
size_t optlength;
char *p;
char *pa;
match = 0;
match2 = 0;
long_prefi... | int bsdcat_getopt(struct bsdcat *bsdcat) {
enum {
state_start = 0,
state_old_tar,
state_next_word,
state_short,
state_long
};
const struct bsdcat_option *popt, *match = NULL, *match2 = NULL;
const char *p, *long_prefix = "--";
size_t optlength;
int opt = '?';
int required = 0;
bsdc... | bsdcat_getopt | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcat | ida | O0 |
void bsdcat_next() {
if (a) {
if ((unsigned int)archive_read_close(a))
bsdcat_print_error();
archive_read_free(a);
}
a = (archive *)archive_read_new();
archive_read_support_filter_all(a);
archive_read_support_format_empty(a);
archive_read_support_format_raw(a);
} | void bsdcat_next(void) {
if (a != NULL) {
if (archive_read_close(a) != ARCHIVE_OK)
bsdcat_print_error();
archive_read_free(a);
}
a = archive_read_new();
archive_read_support_filter_all(a);
archive_read_support_format_empty(a);
archive_read_support_format_raw(a);
} | bsdcat_next | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcat | ida | O0 |
void bsdcat_print_error() {
const char *v0;
v0 = (const char *)archive_error_string(a);
lafe_warnc(0, "%s: %s", bsdcat_current_path, v0);
exit_status = 1;
} | void bsdcat_print_error(void) {
lafe_warnc(0, "%s: %s", bsdcat_current_path, archive_error_string(a));
exit_status = 1;
} | bsdcat_print_error | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcat | ida | O0 |
void bsdcat_read_to_stdout(const char *filename) {
unsigned int r;
if ((unsigned int)archive_read_open_filename(a, filename, 10240) ||
(r = archive_read_next_header(a, &ae), r >= 2) ||
r != 1 && (unsigned int)archive_read_data_into_fd(a, 1)) {
bsdcat_print_error();
}
if ((unsigned int)archive_r... | void bsdcat_read_to_stdout(const char *filename) {
int r;
if (archive_read_open_filename(a, filename, BYTES_PER_BLOCK) != ARCHIVE_OK)
bsdcat_print_error();
else if (r = archive_read_next_header(a, &ae),
r != ARCHIVE_OK && r != ARCHIVE_EOF)
bsdcat_print_error();
else if (r == ARCHIVE_EOF)
... | bsdcat_read_to_stdout | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcat | ida | O0 |
const char *lafe_getprogname() { return lafe_progname; } | const char *lafe_getprogname(void) { return lafe_progname; } | lafe_getprogname | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcat | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.