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
crc_t multmodp(crc_t a, crc_t b) { crc_t v2; crc_t m; crc_t p; m = 0x80000000; p = 0; while (1) { if ((m & a) != 0) { p ^= b; if ((a & (m - 1)) == 0) break; } m >>= 1; if ((b & 1) != 0) v2 = (b >> 1) ^ 0xEDB88320; else v2 = b >> 1; b = v2; } retur...
local crc_t multmodp(crc_t a, crc_t b) { crc_t m = (crc_t)1 << 31; crc_t p = 0; for (;;) { if (a & m) { p ^= b; if ((a & (m - 1)) == 0) break; } m >>= 1; b = b & 1 ? (b >> 1) ^ POLY : b >> 1; } return p; }
multmodp
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void *my_malloc(size_t size, const char *file, long line) { void *block; block = my_malloc_f(size); if (!block) fail(12, file, line, "malloc"); return block; }
local void *my_malloc(size_t size, char const *file, long line) { void *block; if ((block = my_malloc_f(size)) == NULL) fail(ENOMEM, file, line, "malloc"); return block; }
my_malloc
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
lock *new_lock_(long initial, const char *file, long line) { int ret; int reta; lock *bolt; bolt = (lock *)my_malloc(0x60u, file, line); ret = pthread_mutex_init(&bolt->mutex, 0); if (ret) fail(ret, file, line, "mutex_init"); reta = pthread_cond_init(&bolt->cond, 0); if (reta) fail(reta, file, ...
lock *new_lock_(long initial, char const *file, long line) { lock *bolt = my_malloc(sizeof(struct lock_s), file, line); int ret = pthread_mutex_init(&(bolt->mutex), NULL); if (ret) fail(ret, file, line, "mutex_init"); ret = pthread_cond_init(&(bolt->cond), NULL); if (ret) fail(ret, file, line, "cond_i...
new_lock_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void new_opts() { single_compress(1); finish_jobs(); }
local void new_opts(void) { single_compress(1); #ifndef NOTHREAD finish_jobs(); #endif }
new_opts
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void new_pool(pool *pool, size_t size, int limit) { pool->have = new_lock_(0, "pigz.c", 1457); pool->head = 0; pool->size = size; pool->limit = limit; pool->made = 0; }
local void new_pool(struct pool *pool, size_t size, int limit) { pool->have = new_lock(0); pool->head = NULL; pool->size = size; pool->limit = limit; pool->made = 0; }
new_pool
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
int nprocs(int n) { return sysconf(84); }
local int nprocs(int n) { #ifdef _SC_NPROCESSORS_ONLN n = (int)sysconf(_SC_NPROCESSORS_ONLN); #else #ifdef _SC_NPROC_ONLN n = (int)sysconf(_SC_NPROC_ONLN); #else #ifdef __hpux struct pst_dynamic psd; if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) != -1) n = psd.psd_proc_cnt; #endif #endif #endif r...
nprocs
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
size_t num(char *arg) { char *str; unsigned long val; str = arg; val = 0; if (!*arg) try_throw_(22, "internal error: empty parameter", 0); do { if (*str <= 47 || *str > 57 || val && ~(long)(*str - 48) / val <= 9) try_throw_(22, "invalid numeric parameter: %s", arg); val = 10 * val + *str+...
local size_t num(char *arg) { char *str = arg; size_t val = 0; if (*str == 0) throw(EINVAL, "internal error: empty parameter"); do { if (*str < '0' || *str > '9' || (val && ((~(size_t)0) - (size_t)(*str - '0')) / val < 10)) throw(EINVAL, "invalid numeric parameter: %s", arg); val = va...
num
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
int option(char *arg) { int result; const char *v2; char *arga; int j; size_t n; size_t na; char bad[3]; unsigned long v8; arga = arg; v8 = __readfsqword(0x28u); strcpy(bad, "-X"); if (get_1 && (!arg || *arg == 45)) { bad[1] = aBpsijac[get_1 - 1]; try_throw_(22, "missing parameter after...
local int option(char *arg) { static int get = 0; char bad[3] = "-X"; if (get && (arg == NULL || *arg == '-')) { bad[1] = "bpSIJAC"[get - 1]; throw(EINVAL, "missing parameter after %s", bad); } if (arg == NULL) return 1; if (*arg == '-') { if (*++arg == 0) return 0; if (*arg ==...
option
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void out_push() { int *v0; char *v1; char *outf; int *v3; if (g.outd != -1 && fsync(g.outd) == -1) { v0 = __errno_location(); v1 = strerror(*v0); outf = g.outf; v3 = __errno_location(); try_throw_(*v3, "sync error on %s (%s)", outf, v1); } }
local void out_push(void) { if (g.outd == -1) return; #if defined(F_FULLSYNC) int ret = fcntl(g.outd, F_FULLSYNC); #elif defined(_WIN32) int ret = _commit(g.outd); #else int ret = fsync(g.outd); #endif if (ret == -1) throw(errno, "sync error on %s (%s)", g.outf, strerror(errno)); }
out_push
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
int outb(void *desc, unsigned char *buf, unsigned int len) { unsigned long v4; if (g.procs <= 1) { if (len) { if (g.decode == 1) writen(g.outd, buf, len); if (g.form == 1) v4 = adler32z(g.out_check, buf, len); else v4 = crc32z(g.out_check, buf, len); g.out_check ...
local int outb(void *desc, unsigned char *buf, unsigned len) { (void)desc; #ifndef NOTHREAD static thread *wr, *ch; if (g.procs > 1) { if (outb_write_more == NULL) { outb_write_more = new_lock(0); outb_check_more = new_lock(0); wr = launch(outb_write, NULL); ch = launch(outb_check, ...
outb
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void outb_check(void *dummy) { unsigned long v1; size_t len; int err_4; int err_8; char *err_16; try_t_ try_this_; unsigned long v7; v7 = __readfsqword(0x28u); try_this_.ball.ret = 0; try_this_.ball.code = 0; try_this_.ball.free = 0; try_this_.ball.why = 0; try_setup_(); try_this_.next = (t...
local void outb_check(void *dummy) { size_t len; ball_t err; (void)dummy; Trace(("-- launched decompress check thread")); try { do { possess(outb_check_more); wait_for(outb_check_more, TO_BE, 1); len = out_len; g.out_check = CHECK(g.out_check, out_copy, len); Trace(("-- dec...
outb_check
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void outb_write(void *dummy) { size_t len; int err_4; int err_8; char *err_16; try_t_ try_this_; unsigned long v6; v6 = __readfsqword(0x28u); try_this_.ball.ret = 0; try_this_.ball.code = 0; try_this_.ball.free = 0; try_this_.ball.why = 0; try_setup_(); try_this_.next = (try_t_ *)pthread_gets...
local void outb_write(void *dummy) { size_t len; ball_t err; (void)dummy; Trace(("-- launched decompress write thread")); try { do { possess(outb_write_more); wait_for(outb_write_more, TO_BE, 1); len = out_len; if (len && g.decode == 1) writen(g.outd, out_copy, len); ...
outb_write
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void parallel_compress() { unsigned char *v0; unsigned char *v1; unsigned char *v2; unsigned int hash; _BOOL4 more; long seq; space *next; space *hold; space *dict; unsigned char *scan; unsigned char *last; unsigned char *lasta; size_t left; size_t len; size_t lenb; size_t lena; long l...
local void parallel_compress(void) { long seq; struct space *curr; struct space *next; struct space *hold; struct space *dict; struct job *job; int more; unsigned hash; unsigned char *scan; unsigned char *end; unsigned char *last; size_t left; size_t len; setup_jobs(); writeth = launch(w...
parallel_compress
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
long peek_lock(lock *bolt) { return bolt->value; }
long peek_lock(lock *bolt) { return bolt->value; }
peek_lock
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void possess_(lock *bolt, const char *file, long line) { int ret; ret = pthread_mutex_lock(&bolt->mutex); if (ret) fail(ret, file, line, "mutex_lock"); }
void possess_(lock *bolt, char const *file, long line) { int ret = pthread_mutex_lock(&(bolt->mutex)); if (ret) fail(ret, file, line, "mutex_lock"); }
possess_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void process(char *path) { time_t v1; void **v2; size_t v3; size_t v4; char *v5; char *inf; size_t v7; int *v8; char *v9; char *v10; int *v11; char *v12; time_t tv_sec; _QWORD *v14; long v15; struct __jmp_buf_tag *v16; char *v17; size_t v18; int v19; int *v20; char *v21; char...
local void process(char *path) { volatile int method = -1; size_t len; struct stat st; ball_t err; static char *sufs[] = {".z", "-z", "_z", ".Z", ".gz", "-gz", ".zz", "-zz", ".zip", ".ZIP", ".tgz", NULL}; if (path == NULL) { vstrcpy(&g.inf, &g.inz, 0, "<stdin>"); g....
process
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
unsigned int put(int out, ...) { int *v1; long v2; val_t *v3; long v4; unsigned char *v5; unsigned char *v6; int *v7; long v8; unsigned int count; int n; int na; unsigned char *next; val_t val; unsigned char *wrap; va_list ap; va_start(ap, out); for (count = 0;; count += abs32(*v1)) {...
local unsigned put(int out, ...) { unsigned count = 0; int n; va_list ap; va_start(ap, out); while ((n = va_arg(ap, int)) != 0) { va_arg(ap, val_t); count += (unsigned)abs(n); } va_end(ap); unsigned char *wrap = alloc(NULL, count); unsigned char *next = wrap; va_start(ap, out); while ((...
put
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
length_t put_header() { char *name; size_t v1; unsigned long v2; char *alias; size_t v4; char *v5; unsigned int v6; long v7; int v8; int v9; size_t v10; size_t v11; length_t len; length_t lenb; length_t lena; if (g.form <= 1) { if (g.form) { if (g.comment) complain("ca...
local length_t put_header(void) { length_t len; if (g.form > 1) { len = put( g.outd, 4, (val_t)0x04034b50, 2, (val_t)45, 2, (val_t)8, 2, (val_t)8, 4, (val_t)time2dos(g.mtime), 4, (val_t)0, 4, (val_t)LOW32, 4, (val_t)LOW32, 2, (val_t)(strlen(g.name == NULL ? g.alias : g.name)), 2, (val_...
put_header
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void put_trailer(length_t ulen, length_t clen, unsigned long check, length_t head) { _BOOL4 v4; size_t v5; long v6; char *name; size_t v8; length_t v9; length_t v10; unsigned long v11; char *alias; size_t v13; char *v14; size_t v15; unsigned long v16; long v17; long v18; ...
local void put_trailer(length_t ulen, length_t clen, unsigned long check, length_t head) { if (g.form > 1) { length_t desc = put(g.outd, 4, (val_t)0x08074b50, 4, (val_t)check, 8, (val_t)clen, 8, (val_t)ulen, 0); int zip64 = ulen >= LOW32 || clen >= LOW32; ...
put_trailer
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
int read_extra(unsigned int len, int save) { unsigned char *v2; unsigned int v3; unsigned char *v4; int v5; unsigned char *v6; unsigned int v7; unsigned char *v8; int v9; unsigned char *v11; unsigned int v12; unsigned char *v13; int v14; unsigned char *v15; unsigned int v16; unsigned char ...
local int read_extra(unsigned len, int save) { unsigned id, size, tmp2; unsigned long tmp4; while (len >= 4) { id = GET2(); size = GET2(); if (g.in_eof) return -1; len -= 4; if (size > len) break; len -= size; if (id == 0x0001) { g.zip64 = 1; if (g.zip_ulen ==...
read_extra
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
size_t readn(int desc, unsigned char *buf, size_t len) { int *v3; char *v4; char *inf; int *v6; size_t got; long ret; for (got = 0; len; got += ret) { ret = read(desc, buf, len); if (ret < 0) { v3 = __errno_location(); v4 = strerror(*v3); inf = g.inf; v6 = __errno_location...
local size_t readn(int desc, unsigned char *buf, size_t len) { ssize_t ret; size_t got; got = 0; while (len) { ret = read(desc, buf, len); if (ret < 0) throw(errno, "read error on %s (%s)", g.inf, strerror(errno)); if (ret == 0) break; buf += ret; len -= (size_t)ret; got += ...
readn
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void reenter(void *arg) { thread **prior; pthread_t me; thread *match; me = pthread_self(); possess_(&threads_lock, *((const char **)arg + 2), *((_QWORD *)arg + 3)); for (prior = &threads;; prior = &match->next) { match = *prior; if (!*prior || pthread_equal(match->id, me)) break; } if (!...
local void reenter(void *arg) { struct capsule *capsule = arg; pthread_t me = pthread_self(); possess_(&(threads_lock), capsule->file, capsule->line); thread **prior = &(threads); thread *match; while ((match = *prior) != NULL) { if (pthread_equal(match->id, me)) break; prior = &(match->next)...
reenter
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void release_(lock *bolt, const char *file, long line) { int ret; ret = pthread_mutex_unlock(&bolt->mutex); if (ret) fail(ret, file, line, "mutex_unlock"); }
void release_(lock *bolt, char const *file, long line) { int ret = pthread_mutex_unlock(&(bolt->mutex)); if (ret) fail(ret, file, line, "mutex_unlock"); }
release_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void setup_jobs() { if (!compress_have) { compress_have = new_lock_(0, "pigz.c", 1609); compress_head = 0; compress_tail = &compress_head; write_first = new_lock_(-1, "pigz.c", 1612); write_head = 0; new_pool(&in_pool, g.block, 2 * g.procs + 3); new_pool(&out_pool, g.block + (g.block >> 4)...
local void setup_jobs(void) { if (compress_have != NULL) return; compress_have = new_lock(0); compress_head = NULL; compress_tail = &compress_head; write_first = new_lock(-1); write_head = NULL; new_pool(&in_pool, g.block, INBUFS(g.procs)); new_pool(&out_pool, OUTPOOL(g.block), -1); new_pool(&d...
setup_jobs
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void show_info(int method, unsigned long check, length_t len, int cont) { size_t v4; size_t v5; size_t v6; char *v7; char *v8; double v9; double in_tot_low; double v11; double v12; time_t now; size_t max; size_t n; double red; char mod[32]; char tag[56]; unsigned long v21; v21 = __rea...
local void show_info(int method, unsigned long check, length_t len, int cont) { size_t max; size_t n; time_t now; char mod[26]; char tag[NAMEMAX1 + 1]; max = g.verbosity > 1 ? NAMEMAX2 : NAMEMAX1; memset(tag, 0, max + 1); if (cont) strncpy(tag, "<...>", max + 1); else if (g.hname == NULL) { n...
show_info
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void single_compress(int reset) { unsigned int block; unsigned long v2; size_t v3; unsigned char *v4; unsigned long v5; size_t v6; unsigned long v7; size_t v8; size_t v9; size_t v10; size_t v11; size_t v12; size_t v13; _BOOL4 v14; unsigned long v15; unsigned long v16; unsigned char bit...
while (0) local void single_compress(int reset) { size_t got; size_t more; size_t start; size_t have; size_t hist; int fresh; unsigned hash; unsigned char *scan; size_t left; unsigned long head; length_t ulen; length_t clen; unsigned long check; static unsigned...
single_compress
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
unsigned long time2dos(time_t t) { time_t ta; tm *tm; unsigned long dos; ta = t; if (!t) ta = time(0); tm = localtime(&ta); if (tm->tm_year <= 79 || tm->tm_year > 207) return 0; dos = (long)(tm->tm_year - 80) << 25; dos += (long)(tm->tm_mon + 1) << 21; dos += (long)tm->tm_mday << 16; dos ...
local unsigned long time2dos(time_t t) { struct tm *tm; unsigned long dos; if (t == 0) t = time(NULL); tm = localtime(&t); if (tm->tm_year < 80 || tm->tm_year > 207) return 0; dos = (unsigned long)(tm->tm_year - 80) << 25; dos += (unsigned long)(tm->tm_mon + 1) << 21; dos += (unsigned long)tm->...
time2dos
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
long tolong(unsigned long val) { return (val & 0x7FFFFFFF) - ((unsigned int)val & 0x80000000); }
local long tolong(unsigned long val) { return (long)(val & 0x7fffffffUL) - (long)(val & 0x80000000UL); }
tolong
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void touch(char *path, time_t t) { timeval times[2]; unsigned long v3; v3 = __readfsqword(0x28u); times[0].tv_sec = t; times[0].tv_usec = 0; times[1].tv_sec = t; times[1].tv_usec = 0; utimes(path, times); }
local void touch(char *path, time_t t) { struct timeval times[2]; times[0].tv_sec = t; times[0].tv_usec = 0; times[1].tv_sec = t; times[1].tv_usec = 0; (void)utimes(path, times); }
touch
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void try_create_() { if (pthread_key_create(&try_key_, 0)) __assert_fail("ret == 0 && \"try: pthread_key_create() failed\"", "try.c", 0x16u, "try_create_"); }
static void try_create_(void) { int ret = pthread_key_create(&try_key_, NULL); assert(ret == 0 && "try: pthread_key_create() failed"); }
try_create_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void try_setup_() { if (pthread_once(&try_once_, try_create_)) __assert_fail("ret == 0 && \"try: pthread_once() failed\"", "try.c", 0x1Bu, "try_setup_"); }
void try_setup_(void) { int ret = pthread_once(&try_once_, try_create_); assert(ret == 0 && "try: pthread_once() failed"); }
try_setup_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void try_throw_(int code, char *fmt, ...) { long v2; long v3; long v4; long v5; __int128 v6; __int128 v7; __int128 v8; __int128 v9; __int128 v10; __int128 v11; __int128 v12; __int128 v13; struct __jmp_buf_tag *v14; size_t len; char *why; __va_list_tag ap1[1]; __va_list_tag ap2[1]; ch...
void try_throw_(int code, char *fmt, ...) { try_setup_(); assert(try_stack_ != NULL && "try: naked throw"); try_stack_->ball.ret = 1; try_stack_->ball.code = code; try_stack_->ball.free = 0; try_stack_->ball.why = fmt; if (fmt != NULL && strchr(fmt, '%') != NULL) { char *why, nul[1]; size_t len;...
try_throw_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void twist_(lock *bolt, twist_op op, long val, const char *file, long line) { int ret; int reta; if (op) { if (op == twist_op_BY) bolt->value += val; } else { bolt->value = val; } ret = pthread_cond_broadcast(&bolt->cond); if (ret) fail(ret, file, line, "cond_broadcast"); reta = pthre...
void twist_(lock *bolt, enum twist_op op, long val, char const *file, long line) { if (op == TO) bolt->value = val; else if (op == BY) bolt->value += val; int ret = pthread_cond_broadcast(&(bolt->cond)); if (ret) fail(ret, file, line, "cond_broadcast"); ret = pthread_mutex_unlock(&(bol...
twist_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void unlzw() { unsigned char *v0; int v1; unsigned char *v2; unsigned char *v3; unsigned char *v4; unsigned char *v5; unsigned int v6; unsigned int v7; unsigned int v8; unsigned int v9; unsigned int bits; unsigned int mask; unsigned int left; unsigned int lefta; unsigned int code; unsign...
local void unlzw(void) { unsigned bits; unsigned mask; bits_t buf; unsigned left; length_t mark; unsigned code; unsigned max; unsigned flags; unsigned end; unsigned prev; unsigned final; unsigned stack; unsigned outcnt; index_t prefix[65536]; unsigned char suffix[65536]; unsigned char m...
unlzw
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void use_space(space *space) { possess_(space->use, "pigz.c", 1519); if (!peek_lock(space->use)) __assert_fail("use != 0", "pigz.c", 0x5F1u, "use_space"); twist_(space->use, twist_op_BY, 1, "pigz.c", 1522); }
local void use_space(struct space *space) { long use; possess(space->use); use = peek_lock(space->use); assert(use != 0); twist(space->use, BY, +1); }
use_space
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
size_t vmemcpy(char **mem, size_t *size, size_t off, void *cpy, size_t len) { size_t need; size_t needa; need = off + len; if (off + len < off) try_throw_(34, "overflow", 0); if (need > *size) { needa = grow(need); if (!off) { if (*mem) { free(*mem); *mem = 0; } ...
local inline size_t vmemcpy(char **mem, size_t *size, size_t off, void *cpy, size_t len) { size_t need; need = off + len; if (need < off) throw(ERANGE, "overflow"); if (need > *size) { need = grow(need); if (off == 0) { RELEASE(*mem); *size = 0; } *me...
vmemcpy
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
size_t vstrcpy(char **str, size_t *size, size_t off, void *cpy) { size_t v4; v4 = strlen((const char *)cpy) + 1; return vmemcpy(str, size, off, cpy, v4); }
local inline size_t vstrcpy(char **str, size_t *size, size_t off, void *cpy) { return vmemcpy(str, size, off, cpy, strlen(cpy) + 1); }
vstrcpy
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void wait_for_(lock *bolt, wait_op op, long val, const char *file, long line) { int ret_2; int ret_1; int ret_0; int ret; if (op == wait_op_TO_BE_LESS_THAN) { while (val <= bolt->value) { ret_2 = pthread_cond_wait(&bolt->cond, &bolt->mutex); if (ret_2) fail(ret_2, file, line, "cond_wa...
void wait_for_(lock *bolt, enum wait_op op, long val, char const *file, long line) { switch (op) { case TO_BE: until(bolt->value == val) { int ret = pthread_cond_wait(&(bolt->cond), &(bolt->mutex)); if (ret) fail(ret, file, line, "cond_wait"); } break; case NOT_TO_BE...
wait_for_
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void write_thread(void *dummy) { unsigned long v1; long v2; unsigned long v3; int more; long seq; length_t ulen; length_t clen; unsigned long check; length_t head; job *job; size_t len; int err_4; int err_8; char *err_16; try_t_ try_this_; unsigned long v16; v16 = __readfsqword(0x28u)...
local void write_thread(void *dummy) { long seq; struct job *job; size_t len; int more; length_t head; length_t ulen; length_t clen; unsigned long check; ball_t err; (void)dummy; try { Trace(("-- write thread running")); head = put_header(); ulen = clen = 0; check = CHECK(0L, Z...
write_thread
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
size_t writen(int desc, const void *buf, size_t len) { size_t v3; int *v4; char *v5; char *outf; int *v7; size_t left; long ret; for (left = len; left; left -= ret) { v3 = 0x7FFFFFFFFFFFFFFFLL; if (left <= 0x7FFFFFFFFFFFFFFFLL) v3 = left; ret = write(desc, buf, v3); if (ret <= 0) ...
local size_t writen(int desc, void const *buf, size_t len) { char const *next = buf; size_t left = len; while (left) { size_t const max = SSIZE_MAX; ssize_t ret = write(desc, next, left > max ? max : left); if (ret < 1) throw(errno, "write error on %s (%s)", g.outf, strerror(errno)); next +...
writen
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
crc_t x2nmodp(size_t n, unsigned int k) { char ka; crc_t p; ka = k; p = 0x80000000; while (n) { if ((n & 1) != 0) p = multmodp(x2n_table[ka & 0x1F], p); n >>= 1; ++ka; } return p; }
local crc_t x2nmodp(size_t n, unsigned k) { crc_t p = (crc_t)1 << 31; while (n) { if (n & 1) p = multmodp(x2n_table[k & 31], p); n >>= 1; k++; } return p; }
x2nmodp
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
void yarn_mem(malloc_t lease, free_t vacate) { my_malloc_f = lease; my_free = vacate; }
void yarn_mem(malloc_t lease, free_t vacate) { my_malloc_f = lease; my_free = vacate; }
yarn_mem
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
long zlib_vernum() { int v0; int left; int comp; const char *ver; long num; ver = (const char *)zlibVersion(); num = 0; left = 4; comp = 0; while (*ver > 47 && *ver <= 57) { comp = 10 * comp + *ver - 48; LABEL_9: ++ver; if (!left) goto LABEL_10; } v0 = 15; if (comp <= 15) ...
local long zlib_vernum(void) { char const *ver = zlibVersion(); long num = 0; int left = 4; int comp = 0; do { if (*ver >= '0' && *ver <= '9') comp = 10 * comp + *ver - '0'; else { num = (num << 4) + (comp > 0xf ? 0xf : comp); left--; if (*ver != '.') break; comp ...
zlib_vernum
pigz-2.7
app-arch
O0/app-arch/pigz-2.7/pigz
ida
O0
int cardpch_close_device(DEVBLK *dev) { int fd; fd = dev->fd; if (fd >= 0) close(fd); dev->fd = -1; return 0; }
static int cardpch_close_device(DEVBLK *dev) { if (dev->fd >= 0) close(dev->fd); dev->fd = -1; return 0; }
cardpch_close_device
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3525.so
ida
O0
void cardpch_execute_ccw(DEVBLK *dev, BYTE code, BYTE flags, BYTE chained, U16 count, BYTE prevcode, int ccwseq, BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual) { BYTE *v13; BYTE *v14; U16 *v15; bool v16; int v17; U32 numsense; size_t v19; int ca...
static void cardpch_execute_ccw(DEVBLK *dev, BYTE code, BYTE flags, BYTE chained, U16 count, BYTE prevcode, int ccwseq, BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual) { int rc; int i; int num; int open_flags...
cardpch_execute_ccw
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3525.so
ida
O0
int cardpch_init_handler(DEVBLK *dev, int argc, char **argv) { char *v3; size_t v6; char *typname; const char **v8; char **v9; const char *v10; U16 devtype; if (argc) { v3 = *argv; v6 = strlen(*argv); if (v6 <= 0x1000) { __memcpy_chk(dev->filename, v3, v6 + 1, 4097); *((_BYTE *)...
static int cardpch_init_handler(DEVBLK *dev, int argc, char *argv[]) { int i; if (argc == 0 || strlen(argv[0]) > sizeof(dev->filename) - 1) { logmsg(_("HHCPU001E File name missing or invalid\n")); return -1; } strcpy(dev->filename, argv[0]); dev->fd = -1; dev->ascii = 0; dev->crlf = 0; dev->c...
cardpch_init_handler
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3525.so
ida
O0
void cardpch_query_device(DEVBLK *dev, char **a2, int buflen, char *buffer) { const char *v5; const char *v6; const char *v7; if (a2) { *a2 = "PCH"; if (dev) { if (buflen && buffer) { v5 = ""; v6 = " notrunc"; v7 = " ebcdic"; if ((*((_BYTE *)dev + 5812) & 0x20) == ...
static void cardpch_query_device(DEVBLK *dev, char **class, int buflen, char *buffer) { BEGIN_DEVICE_CLASS_QUERY("PCH", dev, class, buflen, buffer); snprintf(buffer, buflen, "%s%s%s%s", dev->filename, (dev->ascii ? " ascii" : " ebcdic"), ((dev->ascii && dev->...
cardpch_query_device
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3525.so
ida
O0
char *hdt_device_type_equates(char *typname) { char *name; DTEQ *v2; char *(*v4)(char *); name = dteq[0].name; if (dteq[0].name) { v2 = dteq; while (strcasecmp(v2->alias, typname)) { name = v2[1].name; ++v2; if (!name) goto LABEL_6; } return name; } else { LABEL_...
static char *hdt_device_type_equates(char *typname) { DTEQ *device_type; char *(*nextcall)(char *); for (device_type = dteq; device_type->name; device_type++) if (!strcasecmp(device_type->alias, typname)) return device_type->name; if ((nextcall = HDL_FINDNXT(hdt_device_type_equates))) return nex...
hdt_device_type_equates
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdteq.so
ida
O0
int main(int argc, const char **argv, const char **envp) { const char *v3; char *v4; int v5; const char *v6; __pid_t v7; int *v8; char *v9; size_t v10; const char *v11; int *v12; int v13; char *v14; size_t v15; int *v16; char *v17; char *pOp; unsigned long v20; int *v21; int fd[4];...
int main(int argc, char **argv) { char *pszProgName = NULL; char *pOp = NULL; char *pIF = NULL; void *pArg = NULL; CTLREQ ctlreq; int sockfd; int fd; int rc; pid_t ppid; int answer; char szMsgBuffer[255]; UNREFERENCED(argc); DROP_PRIVILEGES(CAP_NET_ADMIN); pszProgName = strdup(argv[0]); ...
main
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hercifc
ida
O0
int qeth_close_device(DEVBLK *dev) { return 0; }
static int qeth_close_device(DEVBLK *dev) { UNREFERENCED(dev); return 0; }
qeth_close_device
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdtqeth.so
ida
O0
void qeth_execute_ccw(DEVBLK *dev, BYTE code, BYTE flags, BYTE chained, U16 count, BYTE prevcode, int ccwseq, BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual) { int v11; int devnum; U32 numsense; size_t v15; void *v16; unsigned int v17; U16 v18; U16 v19...
static void qeth_execute_ccw(DEVBLK *dev, BYTE code, BYTE flags, BYTE chained, U16 count, BYTE prevcode, int ccwseq, BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual) { int rc = 0; int num; int blocksize = 1024; #define CONFIG_DATA_SIZE 1024 UNREF...
qeth_execute_ccw
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdtqeth.so
ida
O0
int qeth_init_handler(DEVBLK *dev, int argc, char **argv) { int v3; __m128i si128; int v5; DEVGRP *group; long v7; logmsg("qeth.c:40:dev(%4.4x) experimental driver\n", dev->devnum); dev->numdevid = 20; logmsg("qeth.c:43:senseidnum=%d\n", 20); v3 = *(_DWORD *)&sense_id_bytes[16]; si128 = _mm_load_si...
static int qeth_init_handler(DEVBLK *dev, int argc, char *argv[]) { UNREFERENCED(argc); UNREFERENCED(argv); logmsg(D_("dev(%4.4x) experimental driver\n"), dev->devnum); dev->numdevid = sizeof(sense_id_bytes); logmsg(D_("senseidnum=%d\n"), dev->numdevid); memcpy(dev->devid, sense_id_bytes, sizeof(sense_id_...
qeth_init_handler
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdtqeth.so
ida
O0
int qeth_initiate_input(DEVBLK *dev, U32 qmask) { int v2; logmsg("qeth.c:273:SIGA-r dev(%4.4x) qmask(%8.8x)\n", dev->devnum, v2); return 0; }
static int qeth_initiate_input(DEVBLK *dev, U32 qmask) { UNREFERENCED(qmask); logmsg(D_("SIGA-r dev(%4.4x) qmask(%8.8x)\n"), dev->devnum); return 0; }
qeth_initiate_input
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdtqeth.so
ida
O0
int qeth_initiate_output(DEVBLK *dev, U32 qmask) { int v2; logmsg("qeth.c:285:SIGA-w dev(%4.4x) qmask(%8.8x)\n", dev->devnum, v2); return 0; }
static int qeth_initiate_output(DEVBLK *dev, U32 qmask) { UNREFERENCED(qmask); logmsg(D_("SIGA-w dev(%4.4x) qmask(%8.8x)\n"), dev->devnum); return 0; }
qeth_initiate_output
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdtqeth.so
ida
O0
void qeth_query_device(DEVBLK *dev, char **a2, int buflen, char *buffer) { if (a2) { *a2 = "QETH"; if (dev) { if (buflen) { if (buffer) snprintf(buffer, buflen, "\n"); } } } }
static void qeth_query_device(DEVBLK *dev, char **class, int buflen, char *buffer) { BEGIN_DEVICE_CLASS_QUERY("QETH", dev, class, buflen, buffer); snprintf(buffer, buflen, "\n"); }
qeth_query_device
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdtqeth.so
ida
O0
void het_string_to_upper(char *source) { long v1; char *v2; const __int32_t **v3; v1 = *source; if ((_BYTE)v1) { v2 = source; v3 = __ctype_toupper_loc(); do { *v2++ = (*v3)[v1]; v1 = *v2; } while ((_BYTE)v1); } }
void het_string_to_upper(char *source) { int i; for (i = 0; source[i] != '\0'; i++) source[i] = toupper(source[i]); }
het_string_to_upper
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetinit
ida
O0
int main(int argc, const char **argv, const char **envp) { int v3; const char **v5; char v6; int v7; int v8; int v9; int v10; FILE *v12; int v13; const char *v14; long v15; int v16; int v17; long v18; long v19; int v20; int v21; const char *v22; long v23; char *o_owner; char *o...
int main(int argc, char *argv[]) { int rc; SLLABEL lab; HETB *hetb; int o_iehinitt; int o_nl; int o_compress; char *o_filename; char *o_owner; char *o_volser; INITIALIZE_UTILITY("hetinit"); hetb = NULL; o_filename = NULL; o_iehinitt = TRUE; o_nl = FALSE; o_compress = TRUE; o_owner = N...
main
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetinit
ida
O0
int dadsm_setup(CIFBLK *cif, char **pdsn, DADSM *dadsm, int verbose) { int F4dscb; __m128i v8; short v9; int v10; int ds1noepv; DADSM *v12; BYTE *ds1ptrds; int F3dscb; F4dscb = getlabel(cif, &dadsm->volrec, verbose); if (!F4dscb) { F4dscb = getF4dscb(cif, &dadsm->f4buf, &dadsm->volrec, ...
int dadsm_setup(CIFBLK *cif, char *pdsn[], DADSM *dadsm, int verbose) { DSXTENT *f1x; BYTE *pcchhr; int numx = MAX_EXTENTS; int rc; rc = getlabel(cif, &dadsm->volrec, verbose); if (rc) return rc; rc = getF4dscb(cif, &dadsm->f4buf, &dadsm->volrec, &dadsm->f4ext, verbose); if (rc) return rc; ...
dadsm_setup
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int fbcopy(FILE *fout, CIFBLK *cif, DADSM *dadsm, int tran, int verbose) { FORMAT1_DSCB *p_f1buf; int v6; void *v7; int v8; int v9; int v10; int v11; int v12; bool v13; long i; int *v16; char *v17; BYTE v18; unsigned int rec; int v22; unsigned int trkconv; BYTE *v24; int rc_copy; i...
int fbcopy(FILE *fout, CIFBLK *cif, DADSM *dadsm, int tran, int verbose) { FORMAT1_DSCB *f1dscb = &dadsm->f1buf; DSXTENT extent[MAX_EXTENTS]; int rc, trk = 0, trkconv = 999, rec = 1; int cyl = 0, head = 0, rc_rb, len, offset; int rc_copy = 0; int recs_written = 0, lrecl, num_extents; int lstartrack = 0, ...
fbcopy
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int getF1dscb(CIFBLK *cif, char **pdsn, FORMAT1_DSCB *f1dscb, DSXTENT **vtocext, int verbose) { char *v8; int v9; int v10; _QWORD *v12; const __m128i *v13; const __m128i *v14; const __m128i *v15; int ds1fmtid; int v17; int f1kl; int f1dl; int cyl; int head; int rec; void *f1k...
int getF1dscb(CIFBLK *cif, char *pdsn[], FORMAT1_DSCB *f1dscb, DSXTENT *vtocext[], int verbose) { char zdsn[sizeof(f1dscb->ds1dsnam) + 1]; BYTE edsn[sizeof(f1dscb->ds1dsnam)]; void *f1key, *f1data; int f1kl, f1dl; int cyl, head, rec, rc; int vtocextents = 1; memset(zdsn, 0, sizeof(zdsn)); ...
getF1dscb
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int getF3dscb(CIFBLK *cif, BYTE *f3cchhr, FORMAT3_DSCB *f3dscb, int verbose) { short v6; short v7; unsigned int v8; unsigned short v9; unsigned short v10; int v11; _QWORD *v13; const __m128i *v14; const __m128i *v15; const __m128i *v16; int ds3fmtid; int v18; int f3kl; int f3dl; void *f3ke...
int getF3dscb(CIFBLK *cif, BYTE *f3cchhr, FORMAT3_DSCB *f3dscb, int verbose) { int cyl, head, rec, rc; void *f3key, *f3data; int f3kl, f3dl; cyl = (f3cchhr[0] << 8) | f3cchhr[1]; head = (f3cchhr[2] << 8) | f3cchhr[3]; rec = f3cchhr[4]; if (verbose) fprintf(stderr, "getF3dscb reading F3 D...
getF3dscb
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int getF4dscb(CIFBLK *cif, FORMAT4_DSCB *f4dscb, DASD_VOL_LABEL *volrec, DSXTENT *vtocx, int verbose) { short v7; short v8; unsigned int v9; unsigned short v10; unsigned short v11; int v12; int v13; _QWORD *v15; const __m128i *v16; const __m128i *v17; const __m128i *v18; __m128i v1...
int getF4dscb(CIFBLK *cif, FORMAT4_DSCB *f4dscb, DASD_VOL_LABEL *volrec, DSXTENT *vtocx, int verbose) { char vtockey[sizeof(f4dscb->ds4keyid)]; void *f4key, *f4data; int f4kl, f4dl; int cyl, head, rec, rc; cyl = (volrec->volvtoc[0] << 8) | volrec->volvtoc[1]; head = (volrec->volvtoc[2] << 8)...
getF4dscb
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int getlabel(CIFBLK *cif, DASD_VOL_LABEL *glbuf, int verbose) { int v4; const __m128i *v5; const __m128i *v6; int v8; int len; void *plabel[5]; plabel[1] = (void *)__readfsqword(0x28u); if (verbose) fwrite("getlabel reading volume label\n", 1u, 0x1Eu, _TMC_END__); v4 = read_block(cif, 0, 0, 3, 0,...
int getlabel(CIFBLK *cif, DASD_VOL_LABEL *glbuf, int verbose) { int len, rc; void *plabel; if (verbose) fprintf(stderr, "getlabel reading volume label\n"); rc = read_block(cif, 0, 0, 3, NULL, NULL, (void *)&plabel, &len); if (rc) { fprintf(stderr, "getlabel error reading volume label, rc %d\n", rc);...
getlabel
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int main(int argc, const char **argv, const char **envp) { int v3; CIFBLK *v4; CIFBLK *v5; const char *v6; FILE *v7; int v8; int v10; int *v11; char *v12; DADSM dadsm; char pathname[4104]; unsigned long v15; v15 = __readfsqword(0x28u); __fprintf_chk(_TMC_END__, 1, "dasdseq %...
int main(int argc, char **argv) { DADSM dadsm; FILE *fout = NULL; CIFBLK *cif; int dsn_recs_written = 0, bail, dsorg, rc; char pathname[MAX_PATH]; fprintf(stderr, "dasdseq %s (C) Copyright 1999-2010 Roger Bowler\n" "Portions (C) Copyright 2001-2010 James M. Morrison\n", VERSI...
main
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
void makext(int i, int heads, DSXTENT *extent, int startcyl, int starttrk, int size) { int v7; int v8; DSXTENT *v9; v8 = (starttrk + heads * startcyl + size - 1) % heads; v7 = (starttrk + heads * startcyl + size - 1) / heads; if (i > 122) { __fprintf_chk(_TMC_END__, 1, "makext extent # parm...
void makext(int i, int heads, DSXTENT *extent, int startcyl, int starttrk, int size) { int endcyl = ((startcyl * heads) + starttrk + size - 1) / heads; int endtrk = ((startcyl * heads) + starttrk + size - 1) % heads; if (i > (MAX_EXTENTS - 1)) { fprintf(stderr, "makext extent # parm invalid %d, ...
makext
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int parsecmd(int argc, char **argv, DADSM *dadsm) { char **v4; const char *v5; int v6; char *v7; char **v8; char *v9; const char *v10; const char *v11; const char *v12; uint8_t v13; uint8_t v14; const char *v15; int v16; const char *v17; int v18; const char *v19; int v20; int v21; ...
int parsecmd(int argc, char **argv, DADSM *dadsm) { int util_verbose = 0; int heads = 15; int extnum = 0; int abscyl = 0; int abshead = 0; int abstrk = 1; int lrecl = 80; argv++; if ((*argv) && (strcasecmp(*argv, "-debug") == 0)) { argv++; debug = 1; fprintf(stderr, "Command line DEBUG s...
parsecmd
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
void sayext(int max, DSXTENT *extent) { DSXTENT *v2; short v3; short v4; int xtseqn; int xttype; v2 = extent; fwrite(" EXTENT --begin-- ---end---\n", 1u, 0x20u, _TMC_END__); fwrite("TYPE NUMBER CCCC HHHH CCCC HHHH\n", 1u, 0x20u, _TMC_END__); if (max > 0) { do { v3 = *(_WORD *)v2->xtetrk...
void sayext(int max, DSXTENT *extent) { int i; fprintf(stderr, " EXTENT --begin-- ---end---\n"); fprintf(stderr, "TYPE NUMBER CCCC HHHH CCCC HHHH\n"); for (i = 0; i < max; i++) { int bcyl = (extent[i].xtbcyl[0] << 8) | extent[i].xtbcyl[1]; int btrk = (extent[i].xtbtrk[0] << 8) | extent[i].xtbtrk[1];...
sayext
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
void showf1(FILE *fmsg, FORMAT1_DSCB *f1dscb, DSXTENT *extent, int verbose) { unsigned short v4; int v5; short v6; signed char ds1recfm; unsigned short v8; int v9; DSXTENT *v10; short v11; short v12; int xtseqn; int xttype; int v15; int v18; BYTE ds1noepv; char txtdsorg[5]; char txtrecfm...
void showf1(FILE *fmsg, FORMAT1_DSCB *f1dscb, DSXTENT extent[], int verbose) { int i, dsorg, lrecl, blksize, volseq, x, y, num_extents; char volser[sizeof(f1dscb->ds1dssn) + 1]; char dsn[sizeof(f1dscb->ds1dsnam) + 1]; char txtcredt[9]; char txtexpdt[9] = "(n/a)"; char txtscr[20]; char txtsyscd[14]; cha...
showf1
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
void showhelp() { const char *v0; v0 = "Usage: dasdseq [-debug] [-expert] [-ascii] image [sf=shadow] [attr] " "filespec\n" " -debug optional - Enables debug mode, additional debug help " "appears\n"; if (!expert) v0 = "Usage: dasdseq [-expert] [-ascii] image [sf=shadow] filespec\n"; ...
void showhelp() { fprintf( stderr, (expert) ? "Usage: dasdseq [-debug] [-expert] [-ascii] image [sf=shadow] " "[attr] filespec\n" " -debug optional - Enables debug mode, additional debug help " "appears\n" : "Usage: dasdseq [-expert] [-ascii] im...
showhelp
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/dasdseq
ida
O0
int bdw_length(const unsigned char *ptr) { int v1; int v2; v1 = *ptr; v2 = ptr[1]; if ((v1 & 0x80u) != 0) return ((v2 << 16) + (v1 << 24) + ptr[3] + (ptr[2] << 8)) & 0x7FFFFFFF; else return (v1 << 8) + (unsigned char)v2; }
int bdw_length(const unsigned char *ptr) { unsigned int len; if (ptr[0] & 0x80) { len = ptr[0] << 24; len += ptr[1] << 16; len += ptr[2] << 8; len += ptr[3]; len &= 0x7fffffff; } else { len = ptr[0] << 8; len += ptr[1]; } return (len); }
bdw_length
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
int get_sl(HETB *hetb, SLLABEL *lab) { unsigned char *v3; unsigned int v4; const char *v6; v3 = blkptr; v4 = het_read(hetb, blkptr); if ((v4 & 0x80000000) == 0) return -((unsigned int)sl_islabel(lab, blkptr, v4) != 1); v6 = (const char *)het_error(v4, v3, v4); __printf_chk(1, "%s while reading bloc...
int get_sl(HETB *hetb, SLLABEL *lab) { int rc; rc = het_read(hetb, blkptr); if (rc >= 0) { if (sl_islabel(lab, blkptr, rc) == TRUE) { return (0); } } else { printf("%s while reading block\n", het_error(rc)); } return (-1); }
get_sl
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
int getblock(HETB *hetb) { int result; result = het_read(hetb, blkptr); if (result >= 0) blklen = result; return result; }
int getblock(HETB *hetb) { int rc; rc = het_read(hetb, blkptr); if (rc < 0) { return (rc); } blklen = rc; return (rc); }
getblock
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
int getfile(HETB *hetb, FILE *outf) { FILE *v2; int fileno; long v4; int v5; int v6; __off_t v7; __off_t v8; unsigned char *v9; size_t v10; int v11; int v12; const char *v13; int v15; int v16; long v17; const char *v18; SLLABEL lab; SLFMT fmt; unsigned long v21; v2 = outf; fil...
int getfile(HETB *hetb, FILE *outf) { SLFMT fmt; SLLABEL lab; unsigned char *ptr; int fileno; int rc; if (opts.flags & O_NL) { fileno = opts.fileno; while (--fileno) { rc = het_fsf(hetb); if (rc < 0) { printf("%s while positioning to file #%d\n", het_error(rc), ...
getfile
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
int getrecord(HETB *hetb) { int v1; int result; unsigned char *v3; int v4; if (recptr && (recidx += reclen, v1 = recidx, recidx < blklen)) { v3 = &blkptr[recidx]; recptr = v3; if ((opts.recfm & 0x40) != 0) goto LABEL_7; v4 = blklen; if ((opts.recfm & 0x20) == 0) { reclen = blk...
int getrecord(HETB *hetb) { int rc; if (recptr != NULL) { recidx += reclen; } if ((recptr == NULL) || (recidx >= blklen)) { rc = getblock(hetb); if (rc < 0) { return (rc); } recidx = 0; if (opts.recfm & O_VARIABLE) { if (rc < 8) { return (-1); } recid...
getrecord
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
int main(int argc, const char **argv, const char **envp) { int v4; const char **v5; int v6; int v7; int v8; const const struct __attribute__((aligned(8))) { char *recfm; int fmt; } *v9; int v10; const char *recfm; long v12; const char *v13; long v14; char *ifile; int v16; long v17;...
int main(int argc, char *argv[]) { HETB *hetb; FILE *outf; int rc; int i; INITIALIZE_UTILITY("hetget"); display_version(stderr, "Hercules HET extract files program ", FALSE); while (TRUE) { rc = getopt(argc, argv, "abhnsu"); if (rc == -1) { break; } switch (rc) { case 'a': ...
main
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
void merge(SLLABEL *lab) { const const struct __attribute__((aligned(8))) { char *recfm; int fmt; } *v1; const char *recfm; int v3; const const struct __attribute__((aligned(8))) { char *recfm; int fmt; } *v4; const char *v5; int v6; SLFMT fmt; unsigned long v8; v8 = __readfsqword...
void merge(SLLABEL *lab) { SLFMT fmt; int i; sl_fmtlab(&fmt, lab); if (opts.recfm == 0) { opts.recfm = O_UNDEFINED; for (i = 0; i < (int)VALFMCNT; i++) { if (strcasecmp(fmt.slds2.recfm, valfm[i].recfm) == 0) { opts.recfm = valfm[i].fmt; break; } } } if (opts.lrecl ...
merge
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
int rdw_length(const unsigned char *ptr) { return (*ptr << 8) + ptr[1]; }
int rdw_length(const unsigned char *ptr) { unsigned int len; len = ptr[0] << 8; len += ptr[1]; return (len); }
rdw_length
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
void usage(char *name) { __printf_chk( 1, "%s - Extract files from an HET file\n" "\n" "Usage: %s [options] hetfile outfile fileno [recfm lrecl blksize]\n" "\n" "Options:\n" " -a convert to ASCII (implies -u)\n" " -h display usage summary\n" " -n file is an ...
void usage(char *name) { printf(help, name, name); }
usage
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetget
ida
O0
int main(int argc, const char **argv, const char **envp) { int v4; const char *v5; char *v6; char *v7; int v8; int v9; int v10; const char **v11; int v12; int v13; uint32_t v14; uint32_t v15; uint32_t v16; uint32_t v17; int v18; int v19; uint32_t ublksize; uint32_t cblksize; __off_...
int main(int argc, char *argv[]) { char buf[HETMAX_BLOCKSIZE]; HETB *hetb; int rc; int fileno; U32 blocks; U32 uminsz; U32 umaxsz; U32 ubytes; U32 cminsz; U32 cmaxsz; U32 cbytes; U32 totblocks; U32 totubytes; U32 totcbytes; U32 opts = 0; char pgmpath[MAX_PATH]; char *pgm; #define O_AL...
main
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetmap
ida
O0
void printdataset(char *buf, int len, int fileno) { int v4; int v5; int v6; const char *v7; const char *v8; int v9; int v10; SLLABEL lab; SLFMT fmt; char crtdt[9]; char recfm[9]; unsigned long v15; v15 = __readfsqword(0x28u); if ((unsigned int)sl_islabel(&lab, buf, (unsigned int)len)) { ...
void printdataset(char *buf, int len, int fileno) { SLLABEL lab; SLFMT fmt; char crtdt[9]; char expdt[9]; char recfm[4]; if (sl_islabel(&lab, buf, len) == FALSE) { return; } sl_fmtlab(&fmt, &lab); if (sl_isvol(buf, 1)) { printf("vol=%-17.17s owner=%s\n\n", fmt.slvol.volser, fmt.slvol.owner...
printdataset
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetmap
ida
O0
void printlabel(char *buf, int len) { char *v2; char **v3; char *v4; SLLABEL lab; SLFMT fmt; unsigned long vars198; vars198 = __readfsqword(0x28u); if ((unsigned int)sl_islabel(&lab, buf, (unsigned int)len)) { sl_fmtlab(&fmt, &lab); puts("---------------------"); v2 = fmt.key[0]; if (fm...
void printlabel(char *buf, int len) { SLLABEL lab; SLFMT fmt; int i; if (sl_islabel(&lab, buf, len) == FALSE) { return; } sl_fmtlab(&fmt, &lab); printf(sep); for (i = 0; fmt.key[i] != NULL; i++) { printf("%-20.20s: '%s'\n", fmt.key[i], fmt.val[i]); } return; }
printlabel
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetmap
ida
O0
void printlabeltapemap(char *buf, int len) { long i; SLLABEL lab; char s[88]; unsigned long v5; v5 = __readfsqword(0x28u); if ((unsigned int)sl_islabel(&lab, buf, (unsigned int)len)) { for (i = 0; i != 80; ++i) s[i] = guest_to_host((unsigned char)buf[i]); s[80] = 0; puts(s); } }
void printlabeltapemap(char *buf, int len) { SLLABEL lab; BYTE labelrec[81]; int i; if (sl_islabel(&lab, buf, len) == FALSE) { return; } for (i = 0; i < 80; i++) { labelrec[i] = guest_to_host(buf[i]); } labelrec[i] = '\0'; printf("%s\n", labelrec); }
printlabeltapemap
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetmap
ida
O0
void usage(char *name) { if (!strcmp(name, "tapemap") || !strcmp(name, "TAPEMAP")) __printf_chk( 1, "%s - Print a map of an HET or AWS tape file\n\nUsage: %s filename\n\n", name, name); else __printf_chk( 1, "%s - Print a map of an HET or AWS tape file\n" "\n"...
void usage(char *name) { if ((strcmp(name, "tapemap") == 0) || (strcmp(name, "TAPEMAP") == 0)) { printf(help_tapemap, name, name); } else { printf(help_hetmap, name, name); } }
usage
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetmap
ida
O0
int copytape() { int v0; int v1; __off_t v3; int v4; int rc; int rca; int rcb; char buf[65535]; unsigned long v10; v10 = __readfsqword(0x28u); while (1) { while (1) { if (extgui) { v3 = ftello(s_hetb->fd); if (((v3 ^ prevpos) & 0xFFFFFFFFFFFC0000LL) != 0) { pre...
static int copytape(void) { int rc; char buf[HETMAX_BLOCKSIZE]; while (TRUE) { #ifdef EXTERNALGUI if (extgui) { off_t curpos = ftell(s_hetb->fd); if ((curpos & PROGRESS_MASK) != (prevpos & PROGRESS_MASK)) { prevpos = curpos; fprintf(stderr, "IPOS=%" I64_FMT "d\n", (U64)curpos); ...
copytape
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetupd
ida
O0
int main(int argc, const char **argv, const char **envp) { int v3; const char **v4; int v5; long v6; int v7; int v8; int v9; unsigned int v10; int v12; long v13; FILE *v14; int v15; const char *v16; int v17; const char *v18; int v19; int v20; long v21; char toname[4096]; unsigned...
int main(int argc, char *argv[]) { char toname[PATH_MAX]; HETB *s_hetb; HETB *d_hetb; int rc; INITIALIZE_UTILITY("hetupd"); s_hetb = NULL; d_hetb = NULL; display_version(stderr, "Hercules HET copy/update program ", FALSE); while (TRUE) { #if defined(HET_BZIP2) rc = getopt(argc, argv, "bc:dhrsv...
main
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hetupd
ida
O0
int add_socket_devices_to_fd_set(int maxfd, fd_set *readset) { _LIST_ENTRY *i; long Flink_low; long v5; int Flink; ptt_pthread_mutex_lock(&bind_lock, "sockdev.c:218"); for (i = bind_head.Flink; i != &bind_head; i = i->Flink) { Flink_low = SLODWORD(i[2].Flink); if ((_DWORD)Flink_low != -1) { v...
int add_socket_devices_to_fd_set(int maxfd, fd_set *readset) { DEVBLK *dev; bind_struct *bs; LIST_ENTRY *pListEntry; obtain_lock(&bind_lock); pListEntry = bind_head.Flink; while (pListEntry != &bind_head) { bs = CONTAINING_RECORD(pListEntry, bind_struct, bind_link); if (bs->sd != -1) { dev...
add_socket_devices_to_fd_set
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int bind_device_ex(DEVBLK *dev, char *spec, ONCONNECT fn, void *arg) { int v6; bind_struct *bs; bind_struct *v9; bind_struct *v10; char *v11; int v12; _LIST_ENTRY *Blink; LIST_ENTRY *Flink; int *v15; int v16; char *v17; _LIST_ENTRY *v18; _LIST_ENTRY *v19; int sd; BYTE c; unsigned long v2...
int bind_device_ex(DEVBLK *dev, char *spec, ONCONNECT fn, void *arg) { bind_struct *bs; int was_list_empty; if (!init_done) init_sockdev(); if (sysblk.shutdown) return 0; logdebug("bind_device (%4.4X, %s)\n", dev->devnum, spec); if (dev->bs) { logmsg(_("HHCSD001E Device %4.4X already bound t...
bind_device_ex
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int cardrdr_close_device(DEVBLK *dev) { bind_struct *bs; int fd; const char *clientip; const char *clientname; FILE *fh; int *v8; char *v9; bs = dev->bs; if (bs) { fd = dev->fd; if (fd < 0) { LABEL_3: clientip = bs->clientip; clientname = bs->clientname; if (clientip || ...
static int cardrdr_close_device(DEVBLK *dev) { if (0 || (dev->bs && dev->fd >= 0 && close_socket(dev->fd) < 0) || (!dev->bs && dev->fh != NULL && fclose(dev->fh) != 0)) { int errnum = dev->bs ? get_HSO_errno() : errno; logmsg(_("HHCRD011E Close error on file \"%s\": %s\n"), dev->filename, st...
cardrdr_close_device
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
void cardrdr_execute_ccw(DEVBLK *dev, BYTE code, BYTE flags, BYTE chained, U16 count, BYTE prevcode, int ccwseq, BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual) { U32 numdevid; size_t v13; int v14; BYTE *buf; __m128i si128; int v17; char v18; int...
static void cardrdr_execute_ccw(DEVBLK *dev, BYTE code, BYTE flags, BYTE chained, U16 count, BYTE prevcode, int ccwseq, BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual) { int rc; int num; UNREFERENCED(flags); ...
cardrdr_execute_ccw
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int cardrdr_init_handler(DEVBLK *dev, int argc, char **argv) { char *typname; char **more_files; char **v6; int v7; int v8; const char **v9; char **v10; long v11; int v12; char **v13; long v14; char **v15; const char *v16; char v17; char *v18; U16 devtype; int *v21; char *v22; int ...
static int cardrdr_init_handler(DEVBLK *dev, int argc, char *argv[]) { int i; int fc; int sockdev = 0; if (dev->bs) { if (!unbind_device(dev)) { return -1; } } dev->fd = -1; dev->fh = NULL; dev->multifile = 0; dev->ebcdic = 0; dev->ascii = 0; dev->trunc = 0; dev->cardpos = 0; ...
cardrdr_init_handler
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
void cardrdr_query_device(DEVBLK *dev, char **a2, int buflen, char *buffer) { char v5; const char *v6; const char *v7; const char *v8; const char *v9; const char *v10; const char *v11; const char *v12; char *filename; if (a2) { *a2 = "RDR"; if (dev) { if (buflen && buffer) { v...
static void cardrdr_query_device(DEVBLK *dev, char **class, int buflen, char *buffer) { BEGIN_DEVICE_CLASS_QUERY("RDR", dev, class, buflen, buffer); snprintf(buffer, buflen, "%s%s%s%s%s%s%s%s", ((dev->filename[0] == '\0') ? "*" : (char *)dev->filename), (dev->...
cardrdr_query_device
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
void check_socket_devices_for_connections(fd_set *readset) { bind_struct *Flink; long sd; ptt_pthread_mutex_lock(&bind_lock, "sockdev.c:363"); Flink = (bind_struct *)bind_head.Flink; if (bind_head.Flink == &bind_head) { LABEL_5: ptt_pthread_mutex_unlock(&bind_lock, "sockdev.c:385"); } else { whil...
void check_socket_devices_for_connections(fd_set *readset) { bind_struct *bs; LIST_ENTRY *pListEntry; obtain_lock(&bind_lock); pListEntry = bind_head.Flink; while (pListEntry != &bind_head) { bs = CONTAINING_RECORD(pListEntry, bind_struct, bind_link); if (bs->sd != -1 && FD_ISSET(bs->sd, readset))...
check_socket_devices_for_connections
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int clear_cardrdr(DEVBLK *dev) { int v1; char **current_file; char *v4; if (cardrdr_close_device(dev)) return -1; v1 = 0; if (dev->bs) return v1; current_file = dev->current_file; dev->filename[0] = 0; if (current_file && (v4 = *current_file) != 0) { dev->current_file = current_file + 1; ...
static int clear_cardrdr(DEVBLK *dev) { if (cardrdr_close_device(dev) != 0) return -1; if (dev->bs) return 0; dev->filename[0] = '\0'; if (dev->current_file && *(dev->current_file)) { strcpy(dev->filename, *(dev->current_file++)); } else { dev->multifile = 0; dev->ascii = 0; dev->...
clear_cardrdr
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int inet_socket(char *spec) { char *v1; char *v2; struct hostent *v3; struct servent *v4; int v5; int v6; int *v8; char *v9; int *v10; char *v11; const char *v12; int one; sockaddr_in sin; char buf[4104]; unsigned long v16; v16 = __readfsqword(0x28u); sin = 0; one = 1; sin.sin_fam...
int inet_socket(char *spec) { char buf[sizeof(((DEVBLK *)0)->filename)]; char *colon; char *node; char *service; int sd; int one = 1; struct sockaddr_in sin; logdebug("inet_socket(%s)\n", spec); memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; strcpy(buf, spec); colon = strchr(buf, ':'...
inet_socket
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int open_cardrdr(DEVBLK *dev, BYTE *unitstat) { char *filename; int v5; FILE *v6; int v7; BYTE *v8; BYTE *v9; BYTE v10; int *v11; char *v12; int *v13; char *v14; int *v15; char *v16; BYTE buf[160]; char pathname[4096]; unsigned long v19; v19 = __readfsqword(0x28u); if (dev->filename...
static int open_cardrdr(DEVBLK *dev, BYTE *unitstat) { int rc; int i; int len; BYTE buf[160]; char pathname[MAX_PATH]; *unitstat = 0; if (dev->bs) { if (dev->fd == -1) { if (dev->rdreof) { *unitstat = CSW_CE | CSW_DE | CSW_UX; return -1; } dev->sense[0] = SENSE_IR;...
open_cardrdr
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
void socket_device_connection_handler(bind_struct *bs) { DEVBLK *dev; int sd; int v4; int v5; const char *h_name; char *v7; char *clientip; char *clientname; ONCONNECT fn; struct hostent *v11; int *v12; char *v13; int devnum; char *spec; socklen_t namelen; sockaddr_in client; unsigned ...
void socket_device_connection_handler(bind_struct *bs) { struct sockaddr_in client; struct hostent *pHE; socklen_t namelen; char *clientip; char *clientname; DEVBLK *dev; int csock; dev = bs->dev; logdebug("socket_device_connection_handler(dev=%4.4X)\n", dev->devnum); csock = accept(bs->sd, 0, 0)...
socket_device_connection_handler
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
void *socket_thread(void *arg) { __pid_t v1; pthread_t v2; int *v3; int v4; long v5; int v6; int v7; int v8; int v9; char *v11; BYTE c; fd_set sockset; unsigned long v14; v14 = __readfsqword(0x28u); v1 = getpid(); v2 = pthread_self(); logmsg("HHCSD020I Socketdevice listener thread sta...
void *socket_thread(void *arg) { int rc; fd_set sockset; int maxfd = 0; int select_errno; int exit_now; UNREFERENCED(arg); logmsg(_("HHCSD020I Socketdevice listener thread started: " "tid=" TIDPAT ", pid=%d\n"), thread_id(), getpid()); for (;;) { FD_ZERO(&sockset); maxfd ...
socket_thread
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
void term_sockdev(void *arg) { int *v1; int v2; int *v3; BYTE c; unsigned long v5; v5 = __readfsqword(0x28u); if (!init_done) { bind_head.Blink = &bind_head; bind_head.Flink = &bind_head; ptt_pthread_mutex_init(&bind_lock, 0, "sockdev.c:47"); hdl_adsc("term_sockdev", term_sockdev, 0); ...
static void term_sockdev(void *arg) { UNREFERENCED(arg); if (!init_done) init_sockdev(); SIGNAL_SOCKDEV_THREAD(); join_thread(sysblk.socktid, NULL); detach_thread(sysblk.socktid); }
term_sockdev
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int unbind_device_ex(DEVBLK *dev, int forced) { bind_struct *bs; int fd; bind_struct *v5; int devnum; _LIST_ENTRY *Flink; _LIST_ENTRY *Blink; int *v9; int v10; int *v11; int sd; char *clientname; char *clientip; BYTE c; unsigned long v17; bs = dev->bs; v17 = __readfsqword(0x28u); if (...
int unbind_device_ex(DEVBLK *dev, int forced) { bind_struct *bs; logdebug("unbind_device(%4.4X)\n", dev->devnum); if (!(bs = dev->bs)) { logmsg(_("HHCSD005E Device %4.4X not bound to any socket\n"), dev->devnum); return 0; } if (dev->fd != -1) { if (forced) { close_socket(dev->fd); ...
unbind_device_ex
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0
int unix_socket(char *path) { size_t v1; int v2; int *v4; char *v5; int *v6; char *v7; sockaddr_un addr; unsigned long v9; v9 = __readfsqword(0x28u); v1 = strlen(path); if (v1 > 0x6B) { v2 = -1; logmsg("HHCSD008E Socket pathname \"%s\" exceeds limit of %d\n", path, 107); } else { ad...
int unix_socket(char *path) { #if !defined(HAVE_SYS_UN_H) UNREFERENCED(path); logmsg(_("HHCSD024E This build does not support Unix domain sockets.\n")); return -1; #else struct sockaddr_un addr; int sd; logdebug("unix_socket(%s)\n", path); if (strlen(path) > sizeof(addr.sun_path) - 1) { logmsg(_("H...
unix_socket
hercules-3.13-r1
app-emulation
O0/app-emulation/hercules-3.13-r1/hdt3505.so
ida
O0