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 |
|---|---|---|---|---|---|---|---|
user_t *alloc_user(utmp *entry) {
char *name;
int ppid;
user_t *u;
u = (user_t *)calloc(1u, 0x170u);
if (!u)
errx(1, "Cannot allocate memory.");
strncpy(u->name, entry->ut_user, 0x20u);
strncpy(u->tty, entry->ut_line, 0x20u);
strncpy(u->host, entry->ut_host, 0x100u);
u->pid = entry->ut_pid;
ppi... | struct user_t *alloc_user(struct utmp *entry) {
struct user_t *u;
int ppid;
u = calloc(1, sizeof *u);
if (!u)
errx(1, "Cannot allocate memory.");
strncpy(u->name, entry->ut_user, UT_NAMESIZE);
strncpy(u->tty, entry->ut_line, UT_LINESIZE);
strncpy(u->host, entry->ut_host, UT_HOSTSIZE);
#ifdef HAVE_UTP... | alloc_user | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void allocate_error() {
curses_end();
fwrite("Cannot allocate memory.\n", 1u, 0x18u, stderr);
exit(1);
} | void allocate_error() {
curses_end();
fprintf(stderr, "Cannot allocate memory.\n");
exit(1);
} | allocate_error | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void boldoff() { wattrset((WINDOW *)exti->wd, 0); } | void boldoff(void) { wattrset((WINDOW *)exti->wd, A_NORMAL); } | boldoff | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void boldon() { wattrset((WINDOW *)exti->wd, 0x200000); } | void boldon(void) { wattrset((WINDOW *)exti->wd, A_BOLD); } | boldon | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void change_parent(proc_t *p, proc_t *q) {
if (p->broth.ppv) {
*p->broth.ppv = p->broth.nx;
if (p->broth.nx)
p->broth.nx->broth.ppv = p->broth.ppv;
}
p->broth.nx = q->child;
p->broth.ppv = &q->child;
if (q->child)
q->child->broth.ppv = &p->broth.nx;
q->child = p;
p->parent = q;
} | static inline void change_parent(struct proc_t *p, struct proc_t *q) {
if (is_on_list(p, broth))
list_del(p, broth);
list_add(q->child, p, broth);
p->parent = q;
} | change_parent | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void clear_list() {
process *p;
process *q;
for (p = begin; p; p = q) {
q = p->next;
proc_del(p);
}
} | static void clear_list(void) {
struct process *p, *q;
for (p = begin; p; p = q) {
q = p->next;
proc_del(p);
}
} | clear_list | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char *count_idle(char *tty) {
time_t idle_time;
stat st;
unsigned long v4;
v4 = __readfsqword(0x28u);
sprintf(buf_0, "/dev/%s", tty);
if (stat(buf_0, &st) == -1)
return "?";
idle_time = time(0) - st.st_atim.tv_sec;
if (idle_time <= 86399) {
if (idle_time <= 3599) {
if (idle_time <= 59)
... | char *count_idle(char *tty) {
struct stat st;
static char buf[32];
time_t idle_time;
sprintf(buf, "/dev/%s", tty);
if (stat(buf, &st) == -1)
return "?";
idle_time = time(0) - st.st_atime;
if (idle_time >= 3600 * 24)
sprintf(buf, "%ldd", (long)idle_time / (3600 * 24));
else if (idle_time >= 36... | count_idle | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void crsr_move(wdgt *w, int from, int to) {
crsr_off(w, from);
crsr_on(w, to);
w->crsr = to;
} | static void crsr_move(struct wdgt *w, int from, int to) {
crsr_off(w, from);
crsr_on(w, to);
w->crsr = to;
} | crsr_move | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void crsr_off(wdgt *w, int line) {
int i;
wattrset((WINDOW *)w->wd, 0);
for (i = 0; curs_buf[i]; ++i)
waddch((WINDOW *)w->wd, curs_buf[i]);
} | static void crsr_off(struct wdgt *w, int line) {
int i;
DBG("DISABLING cursor on line %d", line);
wattrset(CWND(w), A_NORMAL);
for (i = 0; curs_buf[i]; i++)
waddch(CWND(w), curs_buf[i]);
} | crsr_off | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void crsr_on(wdgt *w, int line) {
if (wmove((WINDOW *)w->wd, line, 0) != -1)
winchnstr((WINDOW *)w->wd, curs_buf, w->xsize + 1);
if (wmove((WINDOW *)w->wd, line, 0) != -1)
wchgat((WINDOW *)w->wd, w->xsize + 1, 0x40000u, 0, 0);
wattrset((WINDOW *)w->wd, 0);
} | static void crsr_on(struct wdgt *w, int line) {
DBG("ENABLING in %s on line %d", w->name, line);
mvwinchnstr(CWND(w), line, 0, curs_buf, w->xsize + 1);
mvwchgat(CWND(w), line, 0, w->xsize + 1, A_REVERSE, 0, 0);
wattrset(CWND(w), A_NORMAL);
} | crsr_on | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
pid_t crsr_pid(int line) {
process *p;
for (p = begin; p; p = p->next) {
if (line == p->line)
return p->proc->pid;
}
return 0;
} | static pid_t crsr_pid(int line) {
struct process *p;
for (p = begin; p; p = p->next) {
if (p->line == line)
return p->proc->pid;
}
return 0;
} | crsr_pid | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int csiss3(int c) {
int m;
int v;
int va;
m = seq_0.arg[0];
v = 0;
if (seq_0.type == 79) {
if ((unsigned int)(c - 64) <= 0x39)
v = ss3tbl[c - 64];
ready:
if (m)
m = (((_WORD)m - 1) << 12) & 0x7000;
if (seq_0.mod == 27)
m |= 0x2000u;
return m | v;
}
if (seq_0.mod == 9... | static int csiss3(int c) {
int m = seq.arg[0], v = 0;
if (SS3SEQ) {
c -= 0x40;
if (c < elemof(ss3tbl))
v = ss3tbl[c];
goto ready;
}
if (seq.mod == '[') {
c -= 'A';
if (c < 12)
v = KBD_F1 + c;
goto ready;
}
if (seq.mod == '?') {
if (c == 'c') {
v = KBD_DECID;
... | csiss3 | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void curses_end() {
term_rest();
endwin();
curs_set(old_curs_vis);
} | void curses_end() {
term_rest();
endwin();
curs_set(old_curs_vis);
} | curses_end | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void curses_init() {
initscr();
old_curs_vis = curs_set(0);
start_color();
scr_color_init();
cbreak();
noecho();
term_raw();
} | void curses_init(void) {
initscr();
old_curs_vis = curs_set(0);
start_color();
scr_color_init();
cbreak();
noecho();
term_raw();
} | curses_init | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
user_t *cursor_user(int line) {
user_t *h;
for (h = (user_t *)users_l.next; h != (user_t *)&users_l;
h = (user_t *)h->head.next) {
if (line == h->line)
return h;
}
return 0;
} | struct user_t *cursor_user(int line) {
struct user_t *u;
struct list_head *h;
DBG("looking for user on line %d", line);
list_for_each(h, &users_l) {
u = list_entry(h, struct user_t, head);
if (u->line == line)
return u;
}
return 0;
} | cursor_user | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void delete_tree_lines(wdgt *w) {
process *u;
process *ua;
process *p;
p = begin;
while (p) {
if (is_marked(p)) {
scr_ldeleted(w, p->line);
for (u = p; u; u = u->next)
--u->line;
ua = p->next;
proc_del(p);
p = ua;
} else {
p = p->next;
}
}
} | static void delete_tree_lines(struct wdgt *w) {
struct process *u, *p;
p = begin;
while (p) {
if (!is_marked(p)) {
p = p->next;
continue;
}
scr_ldeleted(w, p->line);
u = p;
while (u) {
u->line--;
u = u->next;
}
u = p->next;
proc_del(p);
p = u;
}
} | delete_tree_lines | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int do_exti_keyh(wdgt *w, int k) {
if (w->wrefresh)
return scr_keyh(w, k);
else
return 0;
} | static int do_exti_keyh(struct wdgt *w, int k) {
if (WIN_HIDDEN(w))
return KEY_SKIPPED;
return scr_keyh(w, k);
} | do_exti_keyh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int do_search(wdgt *w, char *s, int type) {
int err;
int ret;
err = regcomp(&cur_reg, s, 11);
if (err) {
regerror(err, &cur_reg, errbuf_1, 0x40u);
return 0;
} else {
ret = (unsigned int)wmsg_send(w, 9, (void *)type);
regfree(&cur_reg);
return ret;
}
} | static int do_search(struct wdgt *w, char *s, int type) {
int err;
void *ret;
static char errbuf[64];
DBG("Searching text %s", s);
err = regcomp(&cur_reg, s, REG_EXTENDED | REG_ICASE | REG_NOSUB);
if (err) {
regerror(err, &cur_reg, errbuf, sizeof errbuf);
return 0;
}
ret = wmsg_send(w, MSND_SEA... | do_search | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void do_signal(wdgt *w, int sig, int pid) {
send_signal(sig, pid);
ptree_periodic(w);
w->flags |= 4u;
} | void do_signal(struct wdgt *w, int sig, int pid) {
send_signal(sig, pid);
ptree_periodic(w);
WNEED_REDRAW(w);
} | do_signal | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void dolog(const char *t, ...) {
long v1;
long v2;
long v3;
long v4;
long v5;
size_t v6;
time_t tm;
char *c;
va_list ap;
unsigned long v10;
long v11;
long v12;
long v13;
long v14;
long v15;
va_start(ap, t);
v3 = va_arg(ap, _QWORD);
v1 = va_arg(ap, _QWORD);
v2 = va_arg(ap, _QWORD);... | void dolog(const char *t, ...) {
va_list ap;
static FILE *logfile;
char *c;
time_t tm = time(0);
if (!logfile) {
logfile = fopen("/var/log/whowatch.log", "a");
if (!logfile)
return;
fprintf(logfile, " #############\n");
}
c = ctime(&tm);
*(c + strlen(c) - 1) = 0;
fprintf(logfile, "%... | dolog | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void draw_tree(wdgt *w) {
u32 line;
char *v2;
process *p;
scr_output_start(w);
if (begin) {
for (p = begin; p; p = p->next) {
if (p->proc) {
line = p->line;
v2 = prepare_line(w, p);
scr_addfstr(w, v2, line, 0);
}
}
scr_output_end(w);
} else {
scr_maddstr(... | static void draw_tree(struct wdgt *w) {
struct process *p;
scr_output_start(w);
if (!begin) {
scr_maddstr(w, "User has logged out", 0, 0, 20);
return;
}
for (p = begin; p; p = p->next) {
if (!p->proc)
continue;
scr_addfstr(w, prepare_line(w, p), p->line, 0);
}
scr_output_end(w);
} | draw_tree | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void eproc(void *p) {
int v1;
int i;
unsigned int pid;
proc_detail_t *t;
if (p)
v1 = *(_DWORD *)p;
else
v1 = 1;
pid = v1;
plgn_out_start();
for (i = 0; i < 6; ++i) {
t = &proc_details_t[i];
title("%s", t->title);
t->fn(pid, t->name);
}
} | void eproc(void *p) {
int i;
int pid = !p ? 1 : *(u32 *)p;
struct proc_detail_t *t;
int size;
plgn_out_start();
size = sizeof proc_details_t / sizeof(struct proc_detail_t);
for (i = 0; i < size; i++) {
t = &proc_details_t[i];
title("%s", t->title);
t->fn(pid, t->name);
}
} | eproc | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void err_exit(int scr, char *s) { errx(1, "%s", s); } | void err_exit(int scr, char *s) { errx(1, "%s", s); } | err_exit | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void esys(void *unused) {
int c;
int ca;
plgn_out_start();
title("BOOT TIME: ");
print_boot_time();
title("CPU: ");
get_cpu_info();
title("MEMORY:");
newln();
read_proc_file("/proc/meminfo", "MemTotal:", 0);
title("USED FILES: ");
c = read_file_pos("/proc/sys/fs/file-nr", 2);
if (c == -1)
... | void esys(void *unused) {
int c;
plgn_out_start();
title("BOOT TIME: ");
print_boot_time();
title("CPU: ");
get_cpu_info();
title("MEMORY:");
newln();
read_proc_file("/proc/meminfo", "MemTotal:", NULL);
title("USED FILES: ");
;
c = read_file_pos("/proc/sys/fs/file-nr", 2);
if (c == -1)
n... | esys | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void euser(void *p) {
struct passwd *pw;
if (p) {
pw = getpwnam((const char *)p);
if (pw) {
title("NAME: ");
println("%s\n", pw->pw_name);
title("HOME: ");
println("%s\n", pw->pw_dir);
title("UID: ");
println("%d\n", pw->pw_uid);
title("GID: ");
println("%d\n... | void euser(void *p) {
struct passwd *pw;
if (!p) {
println("Invalid user");
return;
}
pw = getpwnam((char *)p);
if (!pw) {
println("Error - user not found.");
return;
}
title("NAME: ");
println("%s\n", pw->pw_name);
title("HOME: ");
println("%s\n", pw->pw_dir);
title("UID: ");
pr... | euser | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int exti_disable(wdgt *w) {
w->wrefresh = 0;
w->redraw = 0;
wmsg_send(w, 6, 0);
return 1;
} | static int exti_disable(struct wdgt *w) {
DBG("DISABLING EXTI");
w->wrefresh = 0;
w->redraw = 0;
wmsg_send(w, MALL_CRSR_UNREG, 0);
return 1;
} | exti_disable | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void exti_enable(wdgt *w) {
scr_werase(w);
w->wrefresh = (void (*)(wdgt *))scr_wrefresh;
w->redraw = (void (*)(wdgt *))exti_redraw;
w->flags |= 4u;
} | static void exti_enable(struct wdgt *w) {
DBG("ENABLING EXTI");
scr_werase(w);
w->wrefresh = scr_wrefresh;
w->redraw = exti_redraw;
WNEED_REDRAW(w);
} | exti_enable | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int exti_keyh(wdgt *w, int key) {
unsigned int i;
for (i = 0; i <= 2; ++i) {
if (key == dss[i].key) {
exti_switch(w, &dss[i], key, pkey_0_1);
pkey_0_1 = key;
return 1;
}
}
if (!w->wrefresh)
return 0;
if (cur_ds->keyh)
cur_ds->keyh(key);
if (key <= 261) {
if (key >= 260... | static int exti_keyh(struct wdgt *w, int key) {
int i, ret = KEY_SKIPPED;
static int pkey;
for (i = 0; i < sizeof dss / sizeof(struct dsource); i++) {
if (dss[i].key != key)
continue;
exti_switch(w, &dss[i], key, pkey);
pkey = key;
return KEY_HANDLED;
}
if (WIN_HIDDEN(w))
return ret... | exti_keyh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void *exti_msgh(wdgt *w, int type, wdgt *s, void *v) {
dsource *v4;
if (type != 7)
return 0;
w->vy = 0;
w->vx = w->vy;
v4 = mainw;
mainw->f = (void (*)(void *))v;
return v4->f;
} | static void *exti_msgh(struct wdgt *w, int type, struct wdgt *s, void *v) {
if (type == MSND_ESOURCE) {
DBG("Received data source from '%s'", s->name);
w->vx = w->vy = 0;
return mainw->f = (void (*)(void *))v;
}
return 0;
} | exti_msgh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void exti_redraw(wdgt *w) {
scr_werase(w);
scr_box(w, ehint, w->color);
get_crsr(w);
if (cur_ds->f)
cur_ds->f(cur_val);
scr_output_end(w);
} | static void exti_redraw(struct wdgt *w) {
scr_werase(w);
scr_box(w, ehint, w->color);
get_crsr(w);
if (cur_ds->f)
cur_ds->f(cur_val);
scr_output_end(w);
DBG("EXTI NOW HAS %d lines", w->nlines);
} | exti_redraw | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void exti_reg(wdgt *w) {
exti = w;
w->keyh = (int (*)(wdgt *, int))exti_keyh;
w->msgh = (void *(*)(wdgt *, int, wdgt *, void *))exti_msgh;
mwin_msg_on(w);
} | void exti_reg(struct wdgt *w) {
exti = w;
w->keyh = exti_keyh;
w->msgh = exti_msgh;
mwin_msg_on(w);
} | exti_reg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void exti_switch(wdgt *w, dsource *ds_0, int k, int p) {
cur_ds = ds_0;
if (w->wrefresh) {
if (k == p) {
exti_disable(w);
} else {
w->flags |= 4u;
w->vx = 0;
w->vy = w->vx;
}
} else {
exti_enable(w);
}
} | static void exti_switch(struct wdgt *w, struct dsource *ds, int k, int p) {
cur_ds = ds;
if (!WIN_HIDDEN(w)) {
if (k == p) {
exti_disable(w);
return;
}
WNEED_REDRAW(w);
w->vy = w->vx = 0;
} else
exti_enable(w);
} | exti_switch | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void exti_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize, u32 pxsize,
u8_0 c) {
wdgt *w;
w = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "exti", c);
exti_reg(w);
} | static void exti_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, "exti", c);
exti_reg(w);
} | exti_wdgt | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int fill_cpu_info() {
int i;
FILE *f;
cpu_info_t *tmp;
char buf[72];
unsigned long v5;
v5 = __readfsqword(0x28u);
snprintf(buf, 0x40u, "/proc/stat");
f = fopen(buf, "r");
if (!f)
return -1;
do {
if (!fgets(buf, 64, f)) {
fclose(f);
return -1;
}
} while (strncmp(buf, "cpu "... | static int fill_cpu_info(void) {
char buf[64];
FILE *f;
struct cpu_info_t *tmp;
int i = 0;
snprintf(buf, sizeof buf, "/proc/stat");
f = fopen(buf, "r");
if (!f)
return -1;
while (fgets(buf, sizeof buf, f))
if (!strncmp(buf, "cpu ", 4))
goto FOUND;
fclose(f);
return -1;
FOUND:
tmp = p... | fill_cpu_info | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
proc_t *find_by_pid(int n) {
proc_t *p;
if (n <= 1)
return &proc_special[n];
for (p = hash_table[hash_fun(n)]; p && n != p->pid; p = p->hash.nx)
;
return p;
} | struct proc_t *find_by_pid(int n) {
struct proc_t *p;
if (n <= 1)
return &proc_special[n];
p = hash_table[hash_fun(n)];
while (p) {
if (p->pid == n)
break;
p = p->hash.nx;
}
return p;
} | find_by_pid | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
owner *find_by_uid(int n) {
owner *p;
for (p = hash_table_0[hash_fun_0(n)]; p && n != p->uid; p = p->next)
;
return p;
} | static struct owner *find_by_uid(int n) {
struct owner *p;
p = hash_table[hash_fun(n)];
while (p) {
if (p->uid == n)
break;
p = p->next;
}
return p;
} | find_by_uid | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int free_entry(void *p, int size, list_head *h) {
int i;
list_head *t;
i = 0;
for (t = h->next;; t = t->next) {
if (t == h)
return -1;
if (p >= t[1].next && p < &t[1].next[2 * size])
break;
++i;
}
LODWORD(t[1].prev) &=
~(1 << ((signed long)((long)p - (unsigned long)t[1].next) ... | int free_entry(void *p, int size, struct list_head *h) {
struct _block_tbl_t *tmp;
struct list_head *t;
int i = 0;
list_for_each(t, h) {
tmp = list_entry(t, struct _block_tbl_t, head);
if (p >= tmp->_block_t && p < (tmp->_block_t + size * TBL_SIZE))
goto FOUND;
i++;
}
return -1;
FOUND:
t... | free_entry | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
time_t get_boot_time() {
FILE *f;
char buf[40];
unsigned long v3;
v3 = __readfsqword(0x28u);
if (boot_time_0)
return boot_time_0;
f = fopen("/proc/stat", "r");
if (!f)
return boot_time_0;
do {
if (!fgets(buf, 32, f)) {
fclose(f);
return boot_time_0;
}
} while (strncmp(buf,... | static time_t get_boot_time(void) {
char buf[32];
static time_t boot_time;
FILE *f;
if (boot_time)
return boot_time;
if (!(f = fopen("/proc/stat", "r")))
return boot_time;
while (fgets(buf, sizeof buf, f))
if (!strncmp(buf, "btime ", 6))
goto FOUND;
fclose(f);
return boot_time;
FOUND:... | get_boot_time | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void get_cpu_info() {
double v0;
double v1;
double v2;
double v3;
unsigned long z;
char buf[72];
unsigned long v6;
v6 = __readfsqword(0x28u);
if (fill_cpu_info() == -1)
no_info();
z = eff_info.s_mode + eff_info.nice + eff_info.u_mode + eff_info.idle;
v3 = prcnt(eff_info.idle, z);
v2 = prcnt... | static void get_cpu_info() {
char buf[64];
unsigned long z;
if (fill_cpu_info() == -1)
no_info();
z = eff_info.u_mode + eff_info.nice + eff_info.s_mode + eff_info.idle;
snprintf(buf, sizeof buf, "%.1f%% user %.1f%% sys %.1f%% nice %.1f%% idle\n",
prcnt(eff_info.u_mode, z), prcnt(eff_info.s_mode... | get_cpu_info | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void get_crsr(wdgt *w) {
if (cur_ds->want_crsr) {
cur_val = wmsg_send(w, 1, 0);
w->flags |= 4u;
}
} | static void get_crsr(struct wdgt *w) {
if (!cur_ds->want_crsr)
return;
cur_val = wmsg_send(w, MWANT_CRSR_VAL, 0);
WNEED_REDRAW(w);
} | get_crsr | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void *get_empty(int size, list_head *h) {
unsigned int i;
int nr;
_block_tbl_t *tmp;
list_head *t;
nr = 0;
for (t = h->next; t != h; t = t->next) {
tmp = (_block_tbl_t *)t;
if (LODWORD(t[1].prev) != -1) {
for (i = 0; i <= 0x1F; ++i) {
if (((LODWORD(t[1].prev) >> i) & 1) == 0)
... | void *get_empty(int size, struct list_head *h) {
int i;
int nr = 0;
struct _block_tbl_t *tmp;
struct list_head *t;
list_for_each(t, h) {
tmp = list_entry(t, struct _block_tbl_t, head);
if (tmp->map == ~0)
continue;
for (i = 0; i < TBL_SIZE; i++) {
if ((1U << i & tmp->map) == NOT_USED)
... | get_empty | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char *get_load() {
double d[4];
*(_QWORD *)&d[3] = __readfsqword(0x28u);
memset(d, 0, 24);
if (proc_getloadavg(d, 3) == -1)
return (char *)&unk_D5DE;
snprintf(buf_0_0, 0x20u, "load: %.2f, %.2f, %.2f", d[0], d[1], d[2]);
return buf_0_0;
} | static char *get_load() {
double d[3] = {0, 0, 0};
static char buf[32];
if (proc_getloadavg(d, 3) == -1)
return "";
snprintf(buf, sizeof buf, "load: %.2f, %.2f, %.2f", d[0], d[1], d[2]);
return buf;
} | get_load | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char *get_name(int pid) {
get_info(pid, &p_1);
return p_1.exec_file;
} | char *get_name(int pid) {
static struct procinfo p;
get_info(pid, &p);
return p.exec_file;
} | get_name | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char *get_owner_name(int u) {
owner *p;
p = find_by_uid(u);
if (!p)
return (char *)new_owner(u);
return p->name;
} | char *get_owner_name(int u) {
struct owner *p;
p = find_by_uid(u);
if (!p)
p = new_owner(u);
return p->name;
} | get_owner_name | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int get_pinfo(pinfo *i, DIR *d) {
char *v3;
int f;
int n;
struct dirent *e;
char buf[72];
unsigned long v8;
v8 = __readfsqword(0x28u);
i->state = 63;
while (1) {
e = readdir(d);
if (!e)
return 0;
if (((*__ctype_b_loc())[e->d_name[0]] & 0x800) != 0) {
i->state = 63;
sprin... | static inline int get_pinfo(struct pinfo *i, DIR *d) {
static char name[32] = PROCDIR "/";
struct dirent *e;
i->state = '?';
for (;;) {
int f, n;
char buf[64], *p;
e = readdir(d);
if (!e)
return 0;
if (!isdigit(e->d_name[0]))
continue;
i->state = '?';
sprintf(name + size... | get_pinfo | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int get_ppid(int pid) {
get_info(pid, &p_3);
return p_3.ppid;
} | int get_ppid(int pid) {
static struct procinfo p;
get_info(pid, &p);
return p.ppid;
} | get_ppid | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void get_scrsize(u32 *y, u32 *x) {
winsize win;
unsigned long v3;
v3 = __readfsqword(0x28u);
if (ioctl(1, 0x5413u, &win) == -1)
err_exit(1, "ioctl error: cannot read screen size");
*y = win.ws_row - 1;
*x = win.ws_col - 1;
} | static void get_scrsize(u32 *y, u32 *x) {
struct winsize win;
if (ioctl(1, TIOCGWINSZ, &win) == -1)
err_exit(1, "ioctl error: cannot read screen size");
*y = win.ws_row - 1;
*x = win.ws_col - 1;
} | get_scrsize | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char get_state_color(char state) {
char *s;
s = strchr(m_3, state);
if (s)
return c_2[s - m_3];
else
return 3;
} | static char get_state_color(char state) {
static char m[] = "R DZT?", c[] = "\5\2\6\4\7\7";
char *s = strchr(m, state);
if (!s)
return '\3';
return c[s - m];
} | get_state_color | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
char *get_w(int pid) {
procinfo p;
unsigned long v3;
v3 = __readfsqword(0x28u);
get_info(pid, &p);
return get_cmdline(p.tpgid);
} | char *get_w(int pid) {
struct procinfo p;
get_info(pid, &p);
return get_cmdline(p.tpgid);
} | get_w | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int getkey() {
int v0;
u8 *v2;
u8 *v3;
u8 v4;
u8 *v5;
int v;
int va;
int c;
int l;
u8 *q;
while (1) {
if (p != e)
goto LABEL_10;
l = &unk_14CA4 - (_UNKNOWN *)p;
if (l) {
v = read(0, p, l);
if (v > 0) {
e = &p[v];
LABEL_10:
v2 = p++;
c = ... | int getkey() {
int v, c;
again:
if (p == e) {
int l = endof(buf) - p;
if (l == 0)
goto nomore;
v = read(0, p, l);
if (v <= 0) {
if (waitdata) {
nomore:
c = KBD_MORE;
goto key;
}
return v < 0 ? KBD_NOKEY : KBD_ERROR;
}
e = p + v;
}
c = *p++;
... | getkey | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int getprocbyname(wdgt *w, int t) {
char *owner_name;
int l;
process *p;
const char *tmp;
char buf[8];
unsigned long v8;
v8 = __readfsqword(0x28u);
l = w->crsr;
for (p = begin;; p = p->next) {
if (!p)
return 2;
if (p->proc && (t || l < p->line) && (t != 1 || l <= p->line)) {
snpri... | static int getprocbyname(struct wdgt *w, int t) {
struct process *p;
char *tmp, buf[8];
int l = w->crsr;
for (p = begin; p; p = p->next) {
if (!p->proc)
continue;
if (!t && p->line <= l)
continue;
if (t == 1 && p->line < l)
continue;
snprintf(buf, sizeof buf, "%d", p->proc->pi... | getprocbyname | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int hash(int n) { return n & 0x7F; } | static inline int hash(int n) { return n & (HASH_SIZE - 1); } | hash | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void hash_init(list_head *hash) {
int i;
i = 128;
do {
hash->next = hash;
hash->prev = hash;
++hash;
--i;
} while (i);
} | static void hash_init(struct list_head *hash) {
int i = HASH_SIZE;
do {
INIT_LIST_HEAD(hash);
hash++;
i--;
} while (i);
} | hash_init | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void *hlp_msgh(wdgt *w, int type, wdgt *sndr, void *s) {
if (type != 3)
return 0;
w->flags |= 4u;
cur_hlp = (char *)s;
return s;
} | static void *hlp_msgh(struct wdgt *w, int type, struct wdgt *sndr, void *s) {
if (type != MCUR_HLP)
return 0;
WNEED_REDRAW(w);
return cur_hlp = s;
} | hlp_msgh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void hlp_redraw(wdgt *w) { scr_addfstr(w, cur_hlp, 0, 0); } | static void hlp_redraw(struct wdgt *w) { scr_addfstr(w, cur_hlp, 0, 0); } | hlp_redraw | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void hlp_reg(wdgt *w) {
w->wrefresh = (void (*)(wdgt *))hlp_wrefresh;
w->redraw = (void (*)(wdgt *))hlp_redraw;
w->msgh = (void *(*)(wdgt *, int, wdgt *, void *))hlp_msgh;
} | void hlp_reg(struct wdgt *w) {
w->wrefresh = hlp_wrefresh;
w->redraw = hlp_redraw;
w->msgh = hlp_msgh;
} | hlp_reg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void hlp_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize, u32 pxsize,
u8_0 c) {
wdgt *w;
w = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "help", c);
list_add(&w->msg_l, &mwin->msg);
w->flags |= 1u;
hlp_reg(w);
} | static void hlp_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, "help", c);
MWADD_TO_LIST(w, msg);
w->flags |= WDGT_NO_YRESIZE;
hlp_reg(w);
} | hlp_wdgt | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void hlp_wrefresh(wdgt *w) {
pnoutrefresh((WINDOW *)w->wd, 0, 0, w->mwin->sy, 0, w->mwin->sy, w->mwin->sx);
} | static void hlp_wrefresh(struct wdgt *w) {
pnoutrefresh(w->wd, 0, 0, w->mwin->sy, 0, w->mwin->sy, w->mwin->sx);
} | hlp_wrefresh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ido_search(wdgt *w, int type) {
u8_0 v2;
unsigned int i;
for (i = 0; dword_14308 - cxs > i; ++i) {
if (wmove((WINDOW *)w->wd, 0, i + cxs) == -1)
v2 = -1;
else
v2 = winch((WINDOW *)w->wd);
w->mwin->gbuf[i] = v2;
}
w->mwin->gbuf[i] = 0;
if (do_search(w, (char *)w->mwin->gbuf, typ... | static void ido_search(struct wdgt *w, int type) {
int i;
for (i = 0; i < cx - cxs; i++) {
w->mwin->gbuf[i] = mvwinch(CWND(w), 0, i + cxs) & A_CHARTEXT;
DBG("%d %c", i, w->mwin->gbuf[i]);
}
w->mwin->gbuf[i] = 0;
if (do_search(w, w->mwin->gbuf, type) == 2 && !type) {
do_search(w, w->mwin->gbuf, 2);... | ido_search | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void ihide(wdgt *w) {
w->wrefresh = 0;
w->redraw = 0;
curs_set(0);
} | static void ihide(struct wdgt *w) {
w->wrefresh = 0;
w->redraw = 0;
curs_set(0);
} | ihide | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int ikbd(wdgt *w, int key) {
if (key == 257) {
if (dword_14308 == cxs) {
return 2;
} else {
if (wmove((WINDOW *)w->wd, 0, --dword_14308) != -1)
wdelch((WINDOW *)w->wd);
return 2;
}
} else if ((key & 0xFFFFFF80) != 0) {
return 0;
} else {
if (!nc++) {
dword_14308... | static int ikbd(struct wdgt *w, int key) {
if (key == KBD_BS) {
if (cx == cxs)
return KEY_FINAL;
mvwdelch((WINDOW *)w->wd, 0, --cx);
return KEY_FINAL;
}
if (!isascii(key))
return KEY_SKIPPED;
if (!nc++) {
cx = cxs;
wmove(CWND(w), 0, cx);
wclrtoeol(CWND(w));
}
waddch((WINDO... | ikbd | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int ikeyh(wdgt *w, int key) {
if (w->wrefresh) {
if (key == 256) {
if (dword_14308 != cxs)
ido_search(w, 0);
} else {
if (key != 259)
return ikbd(w, key);
ihide(w);
}
return 2;
} else if (key == 47) {
input_unhide(w);
return 2;
} else {
return 0;
}
} | static int ikeyh(struct wdgt *w, int key) {
if (WIN_HIDDEN(w)) {
if (key == '/') {
input_unhide(w);
return KEY_FINAL;
}
return KEY_SKIPPED;
}
switch (key) {
case KBD_ESC:
ihide(w);
break;
case KBD_ENTER:
if (cx != cxs) {
ido_search(w, 0);
}
break;
default:... | ikeyh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int incomplete() {
u8 *v0;
int result;
u8 *v2;
u8 *v3;
unsigned int l;
l = (_DWORD)e - (unsigned int)buf_0;
p = buf_0;
if (l == 1) {
v0 = p++;
return ordkey(*v0);
} else {
if (l <= 0x13)
buf_0[l] = 0;
if (!memcmp(p, "\x1B[M", 3u)) {
p += 3;
return 288;
} else if ... | static int incomplete() {
int l = e - buf;
p = buf;
if (l == 1)
return ordkey(*p++);
if (l < sizeof(buf))
buf[l] = 0;
if (!memcmp(p, "\33[M", 3)) {
p += 3;
return KBD_F1;
} else if (!memcmp(p, "\0x9BM", 2)) {
p += 2;
return KBD_F1;
}
if (*p++ == 27)
return ordkey(*p++) | KBD... | incomplete | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void info_reg(wdgt *w) {
w->periodic = (void (*)(wdgt *))infopr;
w->wrefresh = (void (*)(wdgt *))scr_wrefresh;
w->msgh = (void *(*)(wdgt *, int, wdgt *, void *))infomsg;
} | void info_reg(struct wdgt *w) {
w->periodic = infopr;
w->wrefresh = scr_wrefresh;
w->msgh = infomsg;
} | info_reg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void info_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize, u32 pxsize,
u8_0 c) {
wdgt *w;
w = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "info", c);
list_add(&w->msg_l, &mwin->msg);
info_reg(w);
w->flags |= 1u;
} | static void info_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, "info", c);
MWADD_TO_LIST(w, msg);
info_reg(w);
w->flags |= WDGT_NO_YRESIZE;
} | info_wdgt | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void *infomsg(wdgt *w, int type, wdgt *s, void *d) {
u32 v5;
if (type != 8)
return 0;
if (d) {
scr_attr_set(w, 0x200000);
v5 = strlen((const char *)d) + 1;
scr_maddstr(w, (char *)d, 1u, w->x, v5);
scr_attr_set(w, 0);
} else {
wmove((WINDOW *)w->wd, 1, 0);
wclrtoeol((WINDOW *)w->wd);... | static void *infomsg(struct wdgt *w, int type, struct wdgt *s, void *d) {
if (type != MSND_INFO)
return 0;
if (!d) {
wmove((WINDOW *)w->wd, 1, 0);
wclrtoeol((WINDOW *)w->wd);
scr_wrefresh(w);
return (void *)1;
}
scr_attr_set(w, A_BOLD);
scr_maddstr(w, d, 1, w->x, strlen(d) + 1);
scr_attr... | infomsg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void infopr(wdgt *w) {
char *v1;
int n;
char *s;
s = get_load();
n = strlen(s);
scr_werase(w);
v1 = proc_ucount();
scr_addfstr(w, v1, 0, 0);
scr_maddstr(w, s, 0, w->xsize - n + 1, n);
} | static void infopr(struct wdgt *w) {
char *s;
int n;
s = get_load();
n = strlen(s);
scr_werase(w);
scr_addfstr(w, proc_ucount(), 0, 0);
scr_maddstr(w, s, 0, w->xsize - n + 1, n);
} | infopr | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void inpt_rfr(wdgt *w) {
pnoutrefresh((WINDOW *)w->wd, 0, 0, w->mwin->sy, 0, w->mwin->sy, w->mwin->sx);
} | static void inpt_rfr(struct wdgt *w) {
pnoutrefresh(w->wd, 0, 0, w->mwin->sy, 0, w->mwin->sy, w->mwin->sx);
} | inpt_rfr | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void input_reg(wdgt *w) {
u32 v1;
w->keyh = (int (*)(wdgt *, int))ikeyh;
cxs = strlen(hint);
dword_14308 = cxs;
v1 = strlen(hint) + 1;
scr_maddstr(w, hint, 0, 0, v1);
} | void input_reg(struct wdgt *w) {
w->keyh = ikeyh;
cx = cxs = strlen(hint);
scr_maddstr(w, hint, 0, 0, strlen(hint) + 1);
} | input_reg | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void input_unhide(wdgt *w) {
curs_set(1);
w->wrefresh = (void (*)(wdgt *))inpt_rfr;
nc = 0;
} | static void input_unhide(struct wdgt *w) {
curs_set(1);
w->wrefresh = inpt_rfr;
nc = 0;
} | input_unhide | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void input_wdgt(u32 y, u32 x, u32 ysize, u32 xsize, u32 pysize, u32 pxsize,
u8_0 c) {
wdgt *w;
w = wdgt_new(y, x, ysize, xsize, pysize, pxsize, "input", c);
list_add(&w->msg_l, &mwin->msg);
w->flags |= 1u;
input_reg(w);
} | static void input_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, "input", c);
MWADD_TO_LIST(w, msg);
w->flags |= WDGT_NO_YRESIZE;
input_reg(w);
} | input_wdgt | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void int_handler(int i) {
curses_end();
exit(0);
} | static void int_handler(int i) {
curses_end();
exit(0);
} | int_handler | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int is_marked(process *p) { return p->proc == 0; } | static inline int is_marked(struct process *p) { return p->proc ? 0 : 1; } | is_marked | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_down(wdgt *w) {
int nleft;
nleft = s_nleft(w);
if (w->crsr == -1) {
if (nleft > 0)
++w->vy;
return 0;
} else {
if (w->crsr - w->vy == w->ysize - w->y) {
if (nleft <= 0)
return 0;
++w->vy;
}
if (w->crsr < w->nlines)
crsr_move(w, w->crsr, w->crsr + 1);
... | static int kbd_down(struct wdgt *w) {
int nleft = s_nleft(w);
if (w->crsr == -1) {
if (nleft > 0)
w->vy++;
return 0;
}
if (w->crsr - w->vy == w->ysize - w->y) {
if (nleft > 0)
w->vy++;
else
return 0;
}
if (w->crsr < w->nlines)
crsr_move(w, w->crsr, w->crsr + 1);
re... | kbd_down | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_end(wdgt *w) {
int nleft;
nleft = s_nleft(w);
if (nleft > 0)
w->vy += nleft;
if (w->crsr >= w->nlines)
return 0;
crsr_move(w, w->crsr, nleft + w->crsr);
return 1;
} | static int kbd_end(struct wdgt *w) {
int nleft = s_nleft(w);
if (nleft > 0)
w->vy += nleft;
if (w->crsr < w->nlines) {
crsr_move(w, w->crsr, w->crsr + nleft);
return KEY_HANDLED;
}
return KEY_SKIPPED;
} | kbd_end | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_home(wdgt *w) {
if (!w->vy && !w->crsr)
return 0;
w->vy = 0;
crsr_move(w, w->crsr, 0);
return 1;
} | static int kbd_home(struct wdgt *w) {
if (!w->vy && !w->crsr)
return KEY_SKIPPED;
w->vy = 0;
crsr_move(w, w->crsr, 0);
return KEY_HANDLED;
} | kbd_home | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_left(wdgt *w) {
if (w->crsr == -1 && w->vx)
--w->vx;
return 0;
} | static int kbd_left(struct wdgt *w) {
if (w->crsr == -1 && w->vx)
w->vx--;
return 0;
} | kbd_left | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_page_down(wdgt *w) {
unsigned int v1;
int nleft;
v1 = s_nleft(w);
nleft = v1;
if (w->ysize - w->y <= v1)
v1 = w->ysize - w->y;
if (nleft <= 0) {
crsr_move(w, w->crsr, w->nlines);
return 0;
} else {
w->vy += v1;
if (w->crsr != -1)
crsr_move(w, w->crsr, v1 + w->crsr);
... | static int kbd_page_down(struct wdgt *w) {
int nleft = s_nleft(w);
int n = MIN(nleft, w->ysize - w->y);
if (nleft > 0)
w->vy += n;
else {
crsr_move(w, w->crsr, w->nlines);
return 0;
}
if (w->crsr != -1)
crsr_move(w, w->crsr, w->crsr + n);
return 0;
} | kbd_page_down | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_page_up(wdgt *w) {
u32 v1;
signed int left;
left = w->vy;
v1 = left;
if (w->ysize - w->y <= left)
v1 = w->ysize - w->y;
if (left <= 0) {
crsr_move(w, w->crsr, 0);
} else {
w->vy -= v1;
crsr_move(w, w->crsr, w->crsr - v1);
}
return 0;
} | static int kbd_page_up(struct wdgt *w) {
int left = w->vy;
int n = MIN(left, w->ysize - w->y);
if (left > 0)
w->vy -= n;
else {
crsr_move(w, w->crsr, 0);
return 0;
}
crsr_move(w, w->crsr, w->crsr - n);
return 0;
} | kbd_page_up | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_right(wdgt *w) {
if (w->crsr == -1 && w->vx < w->pxsize - w->x - w->xsize)
++w->vx;
return 0;
} | static int kbd_right(struct wdgt *w) {
if (w->crsr == -1 && w->vx < w->pxsize - w->x - w->xsize)
w->vx++;
return 0;
} | kbd_right | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int kbd_up(wdgt *w) {
int vy;
if (w->crsr == -1)
vy = w->vy;
else
vy = w->crsr;
if (w->crsr == -1) {
if (w->vy)
--w->vy;
return 0;
} else {
if (w->vy && w->vy == vy)
--w->vy;
if (vy > 0)
crsr_move(w, w->crsr, w->crsr - 1);
return 0;
}
} | static int kbd_up(struct wdgt *w) {
int crsr = (w->crsr == -1) ? w->vy : w->crsr;
if (w->crsr == -1) {
if (w->vy)
w->vy--;
return 0;
}
if (w->vy && crsr == w->vy)
w->vy--;
if (crsr > 0)
crsr_move(w, w->crsr, w->crsr - 1);
return 0;
} | kbd_up | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void key_action(int key) {
if (mwin_keyh(key) != 2 && (key == 113 || key == 259)) {
curses_end();
exit(0);
}
mwin_redraw(mwin->need_redraw);
mwin->need_redraw = 0;
mwin_wrefresh();
} | static void key_action(int key) {
int ret = mwin_keyh(key);
if (ret != KEY_FINAL && (key == 'q' || key == KBD_ESC)) {
curses_end();
exit(0);
}
mwin_redraw(mwin->need_redraw);
mwin->need_redraw = 0;
mwin_wrefresh();
} | key_action | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int key;
unsigned int __i;
timeval tv;
fd_set rfds;
unsigned long v8;
v8 = __readfsqword(0x28u);
main_init();
main_start();
tv.tv_sec = 3;
tv.tv_usec = 0;
while (1) {
for (__i = 0; __i <= 0xF; ++__i)
rfds.__fds_bits[__i] = 0;
... | int main(int argc, char **argv) {
struct timeval tv;
#ifndef RETURN_TV_IN_SELECT
struct timeval before;
struct timeval after;
#endif
fd_set rfds;
int retval;
#ifdef HAVE_LIBKVM
if (kvm_init())
can_use_kvm = 1;
#endif
main_init();
main_start();
tv.tv_sec = TIMEOUT;
tv.tv_usec = 0;
for (;;) {
... | main | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void main_init() {
get_scrsize(&mwin->sy, &mwin->sx);
mwin_init();
scrlib_init();
wdgts_create(mwin->sy, mwin->sx);
users_init();
set_sig();
} | static void main_init(void) {
get_scrsize(&mwin->sy, &mwin->sx);
mwin_init();
scrlib_init();
wdgts_create(mwin->sy, mwin->sx);
users_init();
set_sig();
} | main_init | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void main_periodic() {
mwin_periodic();
mwin_redraw(1);
mwin_wrefresh();
} | static void main_periodic(void) {
mwin_periodic();
mwin_redraw(1);
mwin_wrefresh();
} | main_periodic | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void main_start() { main_periodic(); } | static void main_start(void) { main_periodic(); } | main_start | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void mark_del(void *vp) {
proc_t *q;
for (q = *(proc_t **)(*((_QWORD *)vp + 5) + 16LL); q; q = q->broth.nx) {
if (q->priv)
mark_del(q->priv);
}
pstat_update((process *)vp, -1);
*(_QWORD *)(*((_QWORD *)vp + 5) + 72LL) = 0;
*((_QWORD *)vp + 5) = 0;
} | static void mark_del(void *vp) {
struct process *p = (struct process *)vp;
struct proc_t *q;
q = p->proc;
for (q = q->child; q; q = q->broth.nx)
if (q->priv)
mark_del(q->priv);
pstat_update(p, -1);
p->proc->priv = 0;
p->proc = 0;
} | mark_del | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void mwin_init() {
mwin->wdgts.next = &mwin->wdgts;
mwin->wdgts.prev = &mwin->wdgts;
mwin->msg.next = &mwin->msg;
mwin->msg.prev = &mwin->msg;
mwin->gbsize = 256;
} | static void mwin_init(void) {
DBG("Initializing main window structure");
INIT_LIST_HEAD(&mwin->wdgts);
INIT_LIST_HEAD(&mwin->msg);
mwin->gbsize = sizeof(mwin->gbuf);
} | mwin_init | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
int mwin_keyh(int key) {
int ret;
list_head *l;
ret = 0;
for (l = mwin->wdgts.next; l != (list_head *)mwin; l = l->next) {
if (l[5].next) {
ret = ((long (*)(list_head *, _QWORD))l[5].next)(l, (unsigned int)key);
if (ret == 2)
return 2;
}
}
return ret;
} | static int mwin_keyh(int key) {
struct wdgt *w;
struct list_head *l;
int ret = KEY_SKIPPED;
list_for_each(l, &mwin->wdgts) {
w = list_entry(l, struct wdgt, wdgts_l);
if (!w->keyh)
continue;
DBG("Calling keyh for '%s', key '%c'", w->name, key);
ret = w->keyh(w, key);
if (ret == KEY_FINA... | mwin_keyh | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void mwin_msg_on(wdgt *w) { list_add(&w->msg_l, &mwin->msg); } | void mwin_msg_on(struct wdgt *w) { MWADD_TO_LIST(w, msg); } | mwin_msg_on | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void mwin_redraw(int f) {
list_head *l;
for (l = mwin->wdgts.prev; l != (list_head *)mwin; l = l->prev) {
if (l[4].prev && (f || ((long)l[2].prev & 4) != 0)) {
LOBYTE(l[2].prev) &= ~4u;
((void (*)(list_head *))l[4].prev)(l);
}
}
} | void mwin_redraw(int f) {
struct wdgt *w;
struct list_head *l;
list_for_each_r(l, &mwin->wdgts) {
w = list_entry(l, struct wdgt, wdgts_l);
if (!w->redraw)
continue;
if (!f && !(w->flags & WDGT_NEED_REDRAW))
continue;
DBG("REDRAWing %s, flags %d", w->name, w->flags);
w->flags &= ~WD... | mwin_redraw | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
_block_tbl_t *new_block(int size, list_head *h) {
_block_tbl_t *tmp;
tmp = (_block_tbl_t *)calloc(1u, 0x20u);
if (!tmp)
exit(0);
tmp->_block_t = calloc(1u, 32LL * size);
if (!tmp->_block_t)
exit(0);
list_add_0(&tmp->head, h);
return tmp;
} | static struct _block_tbl_t *new_block(int size, struct list_head *h) {
struct _block_tbl_t *tmp;
tmp = calloc(1, sizeof *tmp);
if (!tmp)
exit(0);
tmp->_block_t = calloc(1, size * TBL_SIZE);
if (!tmp->_block_t)
exit(0);
list_add(&tmp->head, h);
return tmp;
} | new_block | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
netconn_t *new_netconn(unsigned int inode, netconn_t *src) {
netconn_t *t;
t = (netconn_t *)get_empty(64, &tcp_blocks);
memcpy(t, src, sizeof(netconn_t));
t->inode = inode;
add_to_hash(t, inode);
list_add_2(&t->n_list, &tcp_l);
return t;
} | static struct netconn_t *new_netconn(unsigned int inode,
struct netconn_t *src) {
struct netconn_t *t = 0;
t = get_empty(sizeof *t, &tcp_blocks);
memcpy(t, src, sizeof *t);
t->inode = inode;
add_to_hash(t, inode);
list_add(&t->n_list, &tcp_l);
return t;
} | new_netconn | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
owner *new_owner(int n) {
owner *p;
struct passwd *u;
p = (owner *)malloc(0x18u);
if (!p)
allocate_error();
memset(p, 0, sizeof(owner));
u = getpwuid(n);
if (u) {
strncpy(p->name, u->pw_name, 8u);
p->name[8] = 0;
} else {
sprintf(p->name, "%d", n);
}
p->uid = n;
p->next = hash_tab... | static struct owner *new_owner(int n) {
struct owner *p;
struct passwd *u;
p = (struct owner *)malloc(sizeof *p);
if (!p)
allocate_error();
memset(p, 0, sizeof *p);
u = getpwuid(n);
if (!u)
sprintf(p->name, "%d", n);
else {
strncpy(p->name, u->pw_name, NAME_SIZE);
p->name[NAME_SIZE] = 0;... | new_owner | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
proc_t *new_proc(int n, char state) {
proc_t *p;
p = cache;
cache = 0;
if (!p)
p = (proc_t *)malloc(0x50u);
memset(p, 0, sizeof(proc_t));
p->pid = n;
p->state = state;
p->hash.nx = hash_table[hash_fun(n)];
p->hash.ppv = &hash_table[hash_fun(n)];
if (hash_table[hash_fun(n)])
hash_table[hash_... | static inline struct proc_t *new_proc(int n, char state) {
struct proc_t *p = cache;
cache = 0;
if (!p)
p = (struct proc_t *)malloc(sizeof *p);
memset(p, 0, sizeof *p);
p->pid = n;
p->state = state;
list_add(hash_table[hash_fun(n)], p, hash);
num_proc++;
return p;
} | new_proc | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
user_t *new_user(utmp *ut) {
user_t *u;
u = alloc_user(ut);
list_add_1(&u->head, &users_l);
u_count(u->parent, 1);
return u;
} | static struct user_t *new_user(struct utmp *ut) {
struct user_t *u;
u = alloc_user(ut);
list_add(&u->head, &users_l);
u_count(u->parent, LOGIN);
return u;
} | new_user | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void newln() { scr_addstr(exti, "\n", 1u); } | void newln(void) { scr_addstr(exti, "\n", 1); } | newln | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void no_info() { println("Information unavailable.\n"); } | static inline void no_info(void) { println("Information unavailable.\n"); } | no_info | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void open_fds(int pid, char *name) {
DIR *d;
struct dirent *dn;
char *s;
char buf[40];
unsigned long v6;
v6 = __readfsqword(0x28u);
snprintf(buf, 0x20u, "/proc/%d/fd", pid);
d = opendir(buf);
if (d) {
if (!count_1 || ticks - count_1 > 1) {
read_tcp_conn();
count_1 = ticks;
}
w... | void open_fds(int pid, char *name) {
DIR *d;
char *s;
char buf[32];
struct dirent *dn;
static long long count = 0;
snprintf(buf, sizeof buf, "/proc/%d/fd", pid);
d = opendir(buf);
if (!d) {
no_info();
return;
}
if (!count || ticks - count >= 2) {
read_tcp_conn();
count = ticks;
}
... | open_fds | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
void open_wtmp(int *wtmp_fd) {
*wtmp_fd = open("/var/log/wtmp", 0);
if (*wtmp_fd == -1)
err_exit(1, "Cannot open wtmp");
if (lseek(*wtmp_fd, 0, 2) == -1)
err_exit(1, "Cannot seek end wtmp");
} | static void open_wtmp(int *wtmp_fd) {
if ((*wtmp_fd = open(WTMP_FILE, O_RDONLY)) == -1)
err_exit(1, "Cannot open wtmp");
if (lseek(*wtmp_fd, 0, SEEK_END) == -1)
err_exit(1, "Cannot seek end wtmp");
} | open_wtmp | whowatch-1.8.6 | app-admin | O0/app-admin/whowatch-1.8.6/whowatch | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.