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
bool create_pthread(rzip_control *control, pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) { if (!pthread_create(thread, attr, start_routine, arg)) return 1; fatal_3(control, 0x7Eu, "stream.c", "create_pthread", "Failed to pth...
bool create_pthread(rzip_control *control, pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) { if (unlikely(pthread_create(thread, attr, start_routine, arg))) fatal_return(("Failed to pthread_create\n"), false); return true; }
create_pthread
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool decompress_file(rzip_control *control) { size_t v1; void *v2; size_t v3; void *v4; char *v5; size_t v6; void *v7; size_t v8; void *v9; size_t v10; size_t v11; char *v12; BOOL v14; BOOL v15; char v16[8]; rzip_control *controla; int fd_in; int fd_out; int fd_hist; i64 expected...
bool decompress_file(rzip_control *control) { char *tmp, *tmpoutfile, *infilecopy = NULL; int fd_in, fd_out = -1, fd_hist = -1; i64 expected_size = 0, free_space; struct statvfs fbuf; if (!STDIN && !IS_FROM_FILE) { struct stat fdin_stat; stat(control->infile, &fdin_stat); if (!S_ISREG(fdin_stat....
decompress_file
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool decrypt_header(rzip_control *control, unsigned char *head, unsigned char *c_type, i64 *c_len, i64 *u_len, i64 *last_head) { head[8] = *c_type; *(_QWORD *)(head + 9) = *c_len; *(_QWORD *)(head + 17) = *u_len; *(_QWORD *)(head + 25) = *last_head; if (!lrz_decrypt_0(c...
static bool decrypt_header(rzip_control *control, uchar *head, uchar *c_type, i64 *c_len, i64 *u_len, i64 *last_head) { uchar *buf = head + SALT_LEN; memcpy(buf, c_type, 1); memcpy(buf + 1, c_len, 8); memcpy(buf + 9, u_len, 8); memcpy(buf + 17, last_head, 8); if (unlikely(!lrz_d...
decrypt_header
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool detach_pthread(rzip_control *control, pthread_t *thread) { if (!pthread_detach(*thread)) return 1; fatal_3(control, 0x85u, "stream.c", "detach_pthread", "Failed to pthread_detach\n"); return 0; }
bool detach_pthread(rzip_control *control, pthread_t *thread) { if (unlikely(pthread_detach(*thread))) fatal_return(("Failed to pthread_detach\n"), false); return true; }
detach_pthread
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int dump_stdin(rzip_control *control) { if (!write_fdin(control)) return -1; if (!read_tmpinfile(control, control->fd_in)) return -1; close_tmpinbuf(control); return 0; }
static int dump_stdin(rzip_control *control) { if (unlikely(!write_fdin(control))) return -1; if (unlikely(!read_tmpinfile(control, control->fd_in))) return -1; close_tmpinbuf(control); return 0; }
dump_stdin
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool dump_tmpoutfile(rzip_control *control) { int fd_out; int tmpchar; FILE *tmpoutfp; fd_out = control->fd_out; if (fd_out == -1) { fatal_0(control, 0x189u, "lrzip.c", "dump_tmpoutfile", "Failed: No temporary outfile created, unable to do in ram\n"); return 0; } else { fsync(fd_out...
static bool dump_tmpoutfile(rzip_control *control) { int tmpchar, fd_out = control->fd_out; FILE *tmpoutfp; if (unlikely(fd_out == -1)) fatal_return( ("Failed: No temporary outfile created, unable to do in ram\n"), false); fsync(fd_out); tmpoutfp = fdopen(fd_out, "r"); if (unlikely(tmpoutfp ==...
dump_tmpoutfile
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool empty_hash(hash_entry *he) { return *he == 0; }
static inline bool empty_hash(struct hash_entry *he) { return !(he->offset | he->t); }
empty_hash
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 enc_loops(unsigned char b1, unsigned char b2) { return (unsigned long)b2 << b1; }
static inline i64 enc_loops(uchar b1, uchar b2) { return (i64)b2 << (i64)b1; }
enc_loops
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void fatal_exit(rzip_control *control) { int v1; int v2; termios termios_p; unsigned long v4; v4 = __readfsqword(0x28u); v1 = fileno(stdin); tcgetattr(v1, &termios_p); termios_p.c_lflag |= 8u; v2 = fileno(stdin); tcsetattr(v2, 0, &termios_p); unlink_files(control); if ((control->flags & 0x2000)...
void fatal_exit(rzip_control *control) { struct termios termios_p; tcgetattr(fileno(stdin), &termios_p); termios_p.c_lflag |= ECHO; tcsetattr(fileno(stdin), 0, &termios_p); unlink_files(control); if (!STDOUT && !TEST_ONLY && control->outfile) { if (!KEEP_BROKEN) { print_verbose("Deleting broken ...
fatal_exit
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int fd_seekto(rzip_control *control, stream_info *sinfo, i64 spos, i64 pos) { if (spos == lseek(sinfo->fd, spos, 0)) return 0; print_err_3(control, 0x32Bu, "stream.c", "fd_seekto", "Failed to seek to %lld in stream\n", pos); return -1; }
static int fd_seekto(rzip_control *control, struct stream_info *sinfo, i64 spos, i64 pos) { if (unlikely(lseek(sinfo->fd, spos, SEEK_SET) != spos)) { print_err("Failed to seek to %lld in stream\n", pos); return -1; } return 0; }
fd_seekto
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 fdout_seekto(rzip_control *control, i64 pos) { i64 posa; if ((control->flags & 0x200000) == 0) return lseek(control->fd_out, pos, 0); posa = pos - control->out_relofs; control->out_ofs = posa; if (posa <= control->out_len && posa >= 0) return 0; print_err_0(control, 0x44u, "lrzip.c", "fdout_see...
static i64 fdout_seekto(rzip_control *control, i64 pos) { if (TMP_OUTBUF) { pos -= control->out_relofs; control->out_ofs = pos; if (unlikely(pos > control->out_len || pos < 0)) { print_err("Trying to seek to %lld outside tmp outbuf in fdout_seekto\n", pos); return -1; } ...
fdout_seekto
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int fill_buffer(rzip_control *control, stream_info *sinfo, stream *s, int streamno) { i64 readseek; BOOL v6; BOOL v7; BOOL v8; BOOL v9; int v10; i64 v11; i64 v12; i64 v13; unsigned char c_type; u32 c_len32; u32 u_len32; int read_len; i64 u_len; i64 c_len; i64 last_head; ...
static int fill_buffer(rzip_control *control, struct stream_info *sinfo, struct stream *s, int streamno) { i64 u_len, c_len, last_head, padded_len, header_length, max_len; uchar enc_head[25 + SALT_LEN], blocksalt[SALT_LEN]; struct uncomp_thread *ucthreads = sinfo->ucthreads; pthread_t *th...
fill_buffer
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 find_best_match(rzip_control *control, rzip_state *st, tag t, i64 p, i64 end, i64 *offset, i64 *reverse) { i64 rev; hash_entry *he; i64 length; i64 h; i64 mlen; unsigned long v17; v17 = __readfsqword(0x28u); length = 0; rev = 0; *reverse = 0; h = primary_hash(st, t); for...
static inline i64 find_best_match(rzip_control *control, struct rzip_state *st, tag t, i64 p, i64 end, i64 *offset, i64 *reverse) { struct hash_entry *he; i64 length = 0; i64 rev; i64 h; rev = 0; *reverse = 0; h = primary_hash(st, t); ...
find_best_match
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void flush_buffer(rzip_control *control, stream_info *sinfo, int streamno) { clear_buffer(control, sinfo, streamno, 1); }
void flush_buffer(rzip_control *control, struct stream_info *sinfo, int streamno) { clear_buffer(control, sinfo, streamno, 1); }
flush_buffer
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool flush_tmpout(rzip_control *control) { if ((control->flags & 0x2000) == 0) return 1; if ((control->flags & 0x200000) != 0) return flush_tmpoutbuf(control); return dump_tmpoutfile(control); }
bool flush_tmpout(rzip_control *control) { if (!STDOUT) return true; if (TMP_OUTBUF) return flush_tmpoutbuf(control); return dump_tmpoutfile(control); }
flush_tmpout
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool flush_tmpoutbuf(rzip_control *control) { if ((control->flags & 4) == 0) { if ((control->flags & 0x800) != 0) print_stuff_0(control, 4, 0x174u, "lrzip.c", "flush_tmpoutbuf", "Dumping buffer to physical file.\n"); if ((control->flags & 0x2000) != 0) { if (!fwrite_stdout(cont...
static bool flush_tmpoutbuf(rzip_control *control) { if (!TEST_ONLY) { print_maxverbose("Dumping buffer to physical file.\n"); if (STDOUT) { if (unlikely( !fwrite_stdout(control, control->tmp_outbuf, control->out_len))) return false; } else { if (unlikely( !...
flush_tmpoutbuf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool fwrite_stdout(rzip_control *control, void *buf, i64 len) { i64 total; ssize_t ret; total = 0; while (len > 0) { ret = len; if (fwrite(buf, 1u, len, control->outFILE) != len) { fatal_0(control, 0x155u, "lrzip.c", "fwrite_stdout", "Failed to fwrite in fwrite_stdout\n"); ret...
static bool fwrite_stdout(rzip_control *control, void *buf, i64 len) { uchar *offset_buf = buf; ssize_t ret; i64 total; total = 0; while (len > 0) { ssize_t wrote; if (BITS32) ret = MIN(len, one_g); else ret = len; wrote = fwrite(offset_buf, 1, ret, control->outFILE); if (unl...
fwrite_stdout
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool get_fileinfo(rzip_control *control) { size_t v1; void *v2; size_t v3; void *v4; ssize_t v6; BOOL v8; i64 v9; i64 v10; double v11; ssize_t v12; i64 v13; double v14; double v15; i64 v16; double v17; double v18; i64 v19; rzip_control *controla; char chunk_byte; unsigned char ct...
bool get_fileinfo(rzip_control *control) { i64 u_len, c_len, second_last, last_head, utotal = 0, ctotal = 0, ofs = 25, stream_head[2]; i64 expected_size, infile_size, chunk_size = 0, chunk_total = 0; int header_length, stream = 0, chunk = 0; char *tmp, *infilecopy = N...
get_fileinfo
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool get_hash(rzip_control *control, int make_hash) { BOOL v2; BOOL v3; int v5; int v6; int v7; BOOL prompt; char *passphrase; char *testphrase; termios termios_p; unsigned long v12; v12 = __readfsqword(0x28u); prompt = control->passphrase == 0; passphrase = (char *)calloc(0x200u, 1u); test...
static bool get_hash(rzip_control *control, int make_hash) { char *passphrase, *testphrase; struct termios termios_p; int prompt = control->passphrase == NULL; passphrase = calloc(PASS_LEN, 1); testphrase = calloc(PASS_LEN, 1); control->salt_pass = calloc(PASS_LEN, 1); control->hash = calloc(HASH_LEN, 1)...
get_hash
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool get_header_info(rzip_control *control, int fd_in, unsigned char *ctype, i64 *c_len, i64 *u_len, i64 *last_head, int chunk_bytes) { u32 c_len32; u32 u_len32; u32 last_head32; int read_len; unsigned long v15; v15 = __readfsqword(0x28u); if (read(fd_in, ctype, 1u) != 1) { fatal...
bool get_header_info(rzip_control *control, int fd_in, uchar *ctype, i64 *c_len, i64 *u_len, i64 *last_head, int chunk_bytes) { if (unlikely(read(fd_in, ctype, 1) != 1)) fatal_return(("Failed to read in get_header_info\n"), false); *c_len = *u_len = *last_head = 0; if (control->major_ver...
get_header_info
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool get_magic(rzip_control *control, char *magic) { int i; i64 expected_sizea; __uint64_t expected_size; if (strncmp(magic, "LRZI", 4u)) { failure_0(control, 0xC1u, "lrzip.c", "get_magic", "Not an lrzip file\n"); return 0; } control->major_version = magic[4]; control->minor_version = magic[5]; ...
static bool get_magic(rzip_control *control, char *magic) { int encrypted, md5, i; i64 expected_size; uint32_t v; if (unlikely(strncmp(magic, "LRZI", 4))) failure_return(("Not an lrzip file\n"), false); memcpy(&control->major_version, &magic[4], 1); memcpy(&control->minor_version, &magic[5], 1); pr...
get_magic
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int get_pass(rzip_control *control, char *s) { int len; int lena; memset(s, 0, 0x1F8u); if (control->passphrase) { strncpy(s, control->passphrase, 0x1F7u); } else if (!fgets(s, 504, stdin)) { failure_0(control, 0x265u, "lrzip.c", "get_pass", "Failed to retrieve passphrase\n"); retur...
static int get_pass(rzip_control *control, char *s) { int len; memset(s, 0, PASS_LEN - SALT_LEN); if (control->passphrase) strncpy(s, control->passphrase, PASS_LEN - SALT_LEN - 1); else if (unlikely(fgets(s, PASS_LEN - SALT_LEN, stdin) == NULL)) failure_return(("Failed to retrieve passphrase\n"), -1); ...
get_pass
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool get_rand(rzip_control *control, unsigned char *buf, int len) { int i; int fd; fd = open("/dev/urandom", 0); if (fd == -1) { for (i = 0; i < len; ++i) buf[i] = random(); } else { if (read(fd, buf, len) != len) { fatal_4(control, 0xB7u, "util.c", "get_rand", "Failed to re...
bool get_rand(rzip_control *control, uchar *buf, int len) { int fd, i; fd = open("/dev/urandom", O_RDONLY); if (fd == -1) { for (i = 0; i < len; i++) buf[i] = (uchar)random(); } else { if (unlikely(read(fd, buf, len) != len)) fatal_return(("Failed to read fd in get_rand\n"), false); if ...
get_rand
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 get_readseek(rzip_control *control, int fd) { __off_t ret; if ((control->flags & 0x400000) != 0) return control->in_ofs; ret = lseek(fd, 0, 1); if (ret != -1) return ret; fatal_3(control, 0x373u, "stream.c", "get_readseek", "Failed to lseek in get_seek\n"); return -1; }
i64 get_readseek(rzip_control *control, int fd) { i64 ret; if (TMP_INBUF) return control->in_ofs; ret = lseek(fd, 0, SEEK_CUR); if (unlikely(ret == -1)) fatal_return(("Failed to lseek in get_seek\n"), -1); return ret; }
get_readseek
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 get_seek(rzip_control *control, int fd) { __off_t ret; if ((control->flags & 0x200000) != 0) return control->out_relofs + control->out_ofs; ret = lseek(fd, 0, 1); if (ret != -1) return ret; fatal_3(control, 0x367u, "stream.c", "get_seek", "Failed to lseek in get_seek\n"); return -1; }
static i64 get_seek(rzip_control *control, int fd) { i64 ret; if (TMP_OUTBUF) return control->out_relofs + control->out_ofs; ret = lseek(fd, 0, SEEK_CUR); if (unlikely(ret == -1)) fatal_return(("Failed to lseek in get_seek\n"), -1); return ret; }
get_seek
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int gzip_compress_buf(rzip_control *control, compress_thread *cthread) { int gzip_ret; unsigned long dlen; unsigned char *c_buf; unsigned long v6; v6 = __readfsqword(0x28u); dlen = round_up_page(control, cthread->s_len); c_buf = (unsigned char *)malloc(dlen); if (!c_buf) { print_err_3(control, 0xFA...
static int gzip_compress_buf(rzip_control *control, struct compress_thread *cthread) { unsigned long dlen = round_up_page(control, cthread->s_len); uchar *c_buf; int gzip_ret; c_buf = malloc(dlen); if (!c_buf) { print_err("Unable to allocate c_buf in gzip_compress_buf\n"); ...
gzip_compress_buf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int gzip_decompress_buf(rzip_control *control, uncomp_thread *ucthread) { size_t v2; int ret; int gzerr; unsigned long dlen; unsigned char *c_buf; unsigned long v8; v8 = __readfsqword(0x28u); dlen = ucthread->u_len; ret = 0; c_buf = ucthread->s_buf; v2 = round_up_page(control, dlen); ucthread->...
static int gzip_decompress_buf(rzip_control *control __UNUSED__, struct uncomp_thread *ucthread) { unsigned long dlen = ucthread->u_len; int ret = 0, gzerr; uchar *c_buf; c_buf = ucthread->s_buf; ucthread->s_buf = malloc(round_up_page(control, dlen)); if (unlikely(!ucthread->...
gzip_decompress_buf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void hash_search(rzip_control *control, rzip_state *st, double pct_base, double pct_multiple) { int v4; i64 page_size; int lastpct; int last_chunkpct; int pct; tag t; i64 reverse; i64 cksum_len; i64 cksum_limit; i64 p; i64 i; tag tag_mask; sliding_buffer *sb; i64 hashsize; ...
static inline void hash_search(rzip_control *control, struct rzip_state *st, double pct_base, double pct_multiple) { i64 cksum_limit = 0, p, end, cksum_chunks, cksum_remains, i; tag t = 0, tag_mask = (1 << st->level->initial_freq) - 1; struct sliding_buffer *sb = &control->sb; int...
hash_search
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
tag increase_mask(tag tag_mask) { return (2 * tag_mask) | 1; }
static inline tag increase_mask(tag tag_mask) { return (tag_mask << 1) | 1; }
increase_mask
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void init_hash_indexes(rzip_state *st) { long v1; int i; for (i = 0; i <= 255; ++i) { v1 = random() << 16; st->hash_index[i] = random() ^ v1; } }
static inline void init_hash_indexes(struct rzip_state *st) { int i; for (i = 0; i < 256; i++) st->hash_index[i] = ((random() << 16) ^ random()); }
init_hash_indexes
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool init_mutex(rzip_control *control, pthread_mutex_t *mutex) { if (!pthread_mutex_init(mutex, 0)) return 1; fatal_3(control, 0x5Au, "stream.c", "init_mutex", "Failed to pthread_mutex_init\n"); return 0; }
bool init_mutex(rzip_control *control, pthread_mutex_t *mutex) { if (unlikely(pthread_mutex_init(mutex, NULL))) fatal_return(("Failed to pthread_mutex_init\n"), false); return true; }
init_mutex
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void init_sliding_mmap(rzip_control *control, rzip_state *st, int fd_in, i64 offset) { if ((control->flags & 0x1000) == 0) { control->sb.high_length = control->page_size; control->sb.buf_high = (unsigned char *)mmap(0, control->sb.high_length, 1, 1, fd_in, offset); if (contr...
static inline void init_sliding_mmap(rzip_control *control, struct rzip_state *st, int fd_in, i64 offset) { struct sliding_buffer *sb = &control->sb; if (!STDIN) { sb->high_length = control->page_size; sb->buf_high = (uchar *)mmap(NU...
init_sliding_mmap
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool initialise_control(rzip_control *control) { long now_t; const char *eptr; size_t len; char localeptr[3]; unsigned long v6; v6 = __readfsqword(0x28u); strcpy(localeptr, "./"); memset(control, 0, sizeof(rzip_control)); control->msgout = stderr; control->msgerr = stderr; register_outputfile(con...
bool initialise_control(rzip_control *control) { time_t now_t, tdiff; char localeptr[] = "./", *eptr; size_t len; memset(control, 0, sizeof(rzip_control)); control->msgout = stderr; control->msgerr = stderr; register_outputfile(control, control->msgout); control->flags = FLAG_SHOW_PROGRESS | FLAG_KEEP_...
initialise_control
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void insert_hash(rzip_state *st, tag t, i64 offset) { i64 h; i64 victim_h; i64 round; hash_entry *he; victim_h = 0; round = 0; h = primary_hash(st, t); for (he = &st->hash_table[h]; !empty_hash(he); he = &st->hash_table[h]) { if (minimum_bitness(st, he->t)) { --st->hash_count; break; ...
static void insert_hash(struct rzip_state *st, tag t, i64 offset) { i64 h, victim_h = 0, round = 0; static i64 victim_round = 0; struct hash_entry *he; h = primary_hash(st, t); he = &st->hash_table[h]; while (!empty_hash(he)) { if (minimum_bitness(st, he->t)) { st->hash_count--; break; ...
insert_hash
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool join_pthread(rzip_control *control, pthread_t th, void **thread_return) { if (!pthread_join(th, thread_return)) return 1; fatal_3(control, 0x8Cu, "stream.c", "join_pthread", "Failed to pthread_join\n"); return 0; }
bool join_pthread(rzip_control *control, pthread_t th, void **thread_return) { if (pthread_join(th, thread_return)) fatal_return(("Failed to pthread_join\n"), false); return true; }
join_pthread
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool lesser_bitness(tag a, tag b) { int v2; v2 = ffsll(~a); return v2 < ffsll(~b); }
static inline bool lesser_bitness(tag a, tag b) { a ^= 0xffffffffffffffff; b ^= 0xffffffffffffffff; return (ffsll(a) < ffsll(b)); }
lesser_bitness
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool lock_mutex(rzip_control *control, pthread_mutex_t *mutex) { if (!pthread_mutex_lock(mutex)) return 1; fatal_3(control, 0x68u, "stream.c", "lock_mutex", "Failed to pthread_mutex_lock\n"); return 0; }
bool lock_mutex(rzip_control *control, pthread_mutex_t *mutex) { if (unlikely(pthread_mutex_lock(mutex))) fatal_return(("Failed to pthread_mutex_lock\n"), false); return true; }
lock_mutex
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool lrz_crypt(const rzip_control *control, unsigned char *buf, i64 len, const unsigned char *salt, int encrypt) { unsigned char *v5; long v6; char ret; size_t M; i64 N; aes_context aes_ctx; unsigned char tmp0[16]; unsigned char tmp1[16]; unsigned char key[64]; unsigned char iv[72]; ...
bool lrz_crypt(const rzip_control *control, uchar *buf, i64 len, const uchar *salt, int encrypt) { uchar key[HASH_LEN], iv[HASH_LEN]; uchar tmp0[CBC_LEN], tmp1[CBC_LEN]; aes_context aes_ctx; i64 N, M; bool ret = false; mlock(&aes_ctx, sizeof(aes_ctx)); mlock(key, HASH_LEN); mlock(iv, HA...
lrz_crypt
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void lrz_keygen(const rzip_control *control, const unsigned char *salt, unsigned char *key, unsigned char *iv) { unsigned char buf[584]; unsigned long v8; v8 = __readfsqword(0x28u); mlock(buf, 0x248u); memcpy(buf, control->hash, 0x40u); *(_QWORD *)&buf[64] = *(_QWORD *)salt; memcpy(&buf[7...
static void lrz_keygen(const rzip_control *control, const uchar *salt, uchar *key, uchar *iv) { uchar buf[HASH_LEN + SALT_LEN + PASS_LEN]; mlock(buf, HASH_LEN + SALT_LEN + PASS_LEN); memcpy(buf, control->hash, HASH_LEN); memcpy(buf + HASH_LEN, salt, SALT_LEN); memcpy(buf + HASH_LEN + S...
lrz_keygen
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void lrz_stretch(rzip_control *control) { i64 counter; i64 j; i64 n; sha4_context ctx; unsigned long v5; v5 = __readfsqword(0x28u); mlock(&ctx, 0x1D8u); sha4_starts(&ctx, 0); n = (control->encloops << 6) / (unsigned long)(control->salt_pass_len + 8LL); if ((control->flags & 0x800) != 0) print_s...
void lrz_stretch(rzip_control *control) { sha4_context ctx; i64 j, n, counter; mlock(&ctx, sizeof(ctx)); sha4_starts(&ctx, 0); n = control->encloops * HASH_LEN / (control->salt_pass_len + sizeof(i64)); print_maxverbose("Hashing passphrase %lld (%lld) times \n", control->encloops, n); ...
lrz_stretch
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int lz4_compresses(rzip_control *control, unsigned char *s_buf, i64 s_len) { int v4; int v5; int v6; int test_len; int ret; unsigned int workcounter; int best_dlen; int lz4_ret; int dlen; char *c_buf; ret = 0; workcounter = 0; best_dlen = 0x7FFFFFFF; if ((control->flags & 0x100000) == 0) ...
static int lz4_compresses(rzip_control *control, uchar *s_buf, i64 s_len) { int dlen, test_len; char *c_buf = NULL, *test_buf = (char *)s_buf; int ret = 0; int workcounter = 0; int best_dlen = INT_MAX; if (!LZ4_TEST) return 1; dlen = MIN(s_len, STREAM_BUFSIZE); test_len = MIN(dlen, STREAM_BUFSIZE ...
lz4_compresses
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int lzma_compress_buf(rzip_control *control, compress_thread *cthread) { int v3; int lzma_level; int lzma_ret; size_t prop_size; size_t dlen; unsigned char *c_buf; unsigned char lzma_properties[5]; unsigned long v10; v10 = __readfsqword(0x28u); prop_size = 5; if (!lz4_compresses(control, cthread-...
static int lzma_compress_buf(rzip_control *control, struct compress_thread *cthread) { unsigned char lzma_properties[5]; int lzma_level, lzma_ret; size_t prop_size = 5; uchar *c_buf; size_t dlen; if (!lz4_compresses(control, cthread->s_buf, cthread->s_len)) return 0; lzm...
lzma_compress_buf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int lzma_decompress_buf(rzip_control *control, uncomp_thread *ucthread) { size_t v2; int ret; int lzmaerr; size_t dlen; SizeT c_len; unsigned char *c_buf; unsigned long v9; v9 = __readfsqword(0x28u); dlen = ucthread->u_len; ret = 0; c_len = ucthread->c_len; c_buf = ucthread->s_buf; v2 = round...
static int lzma_decompress_buf(rzip_control *control, struct uncomp_thread *ucthread) { size_t dlen = ucthread->u_len; int ret = 0, lzmaerr; uchar *c_buf; SizeT c_len = ucthread->c_len; c_buf = ucthread->s_buf; ucthread->s_buf = malloc(round_up_page(control, dlen)); if (unl...
lzma_decompress_buf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int lzo_compress_buf(rzip_control *control, compress_thread *cthread) { int ret; lzo_uint dlen; lzo_uint in_len; unsigned char *wrkmem; unsigned char *c_buf; unsigned long v8; v8 = __readfsqword(0x28u); in_len = cthread->s_len; dlen = round_up_page(control, (in_len >> 4) + in_len + 67); ret = -1; ...
static int lzo_compress_buf(rzip_control *control, struct compress_thread *cthread) { lzo_uint in_len = cthread->s_len; lzo_uint dlen = round_up_page(control, in_len + in_len / 16 + 64 + 3); lzo_bytep wrkmem; uchar *c_buf; int ret = -1; wrkmem = (lzo_bytep)calloc(1, LZO1X_1_MEM_...
lzo_compress_buf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int lzo_decompress_buf(rzip_control *control, uncomp_thread *ucthread) { size_t v2; int ret; int lzerr; lzo_uint dlen; unsigned char *c_buf; unsigned long v8; v8 = __readfsqword(0x28u); dlen = ucthread->u_len; ret = 0; c_buf = ucthread->s_buf; v2 = round_up_page(control, dlen); ucthread->s_buf ...
static int lzo_decompress_buf(rzip_control *control __UNUSED__, struct uncomp_thread *ucthread) { lzo_uint dlen = ucthread->u_len; int ret = 0, lzerr; uchar *c_buf; c_buf = ucthread->s_buf; ucthread->s_buf = malloc(round_up_page(control, dlen)); if (unlikely(!ucthread->s_buf))...
lzo_decompress_buf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void *md5_finish_ctx(md5_ctx *ctx, void *resbuf) { long v2; uint32_t bytes; size_t size; bytes = ctx->buflen; if (bytes > 0x37) v2 = 32; else v2 = 16; size = v2; ctx->total[0] += bytes; if (bytes > ctx->total[0]) ++ctx->total[1]; ctx->total[v2 + 1] = _uint32_identity_3(8 * ctx->total[0]...
void *md5_finish_ctx(struct md5_ctx *ctx, void *resbuf) { uint32_t bytes = ctx->buflen; size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4; ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; ctx->buffer[size - 2] = htole32(ctx->total[0] << 3); ctx->buffer[size - 1] = htole32((ctx->tota...
md5_finish_ctx
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void md5_process_block(const void *buffer, size_t len, md5_ctx *ctx) { int v3; int v4; int v5; int v6; int v7; int v8; int v9; int v10; int v11; int v12; int v13; int v14; int v15; int v16; int v17; int v18; int v19; int v20; int v21; int v22; int v23; int v24; int v25; i...
void md5_process_block(const void *buffer, size_t len, struct md5_ctx *ctx) { uint32_t correct_words[16]; const uint32_t *words = buffer; size_t nwords = len / sizeof(uint32_t); const uint32_t *endp = words + nwords; uint32_t A = ctx->A; uint32_t B = ctx->B; uint32_t C = ctx->C; uint32_t D = ctx->D; u...
md5_process_block
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void md5_process_bytes(const void *buffer, size_t len, md5_ctx *ctx) { size_t v3; void *v4; size_t lena; char *buffera; size_t left_over_0a; size_t left_over_0; size_t left_over; size_t add; buffera = (char *)buffer; lena = len; if (ctx->buflen) { left_over = ctx->buflen; v3 = 128 - left_...
void md5_process_bytes(const void *buffer, size_t len, struct md5_ctx *ctx) { if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy(&((char *)ctx->buffer)[left_over], buffer, add); ctx->buflen += add; if (ctx->buflen > 64) { ...
md5_process_bytes
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void *md5_read_ctx(const md5_ctx *ctx, void *resbuf) { uint32_t v2; uint32_t v3; uint32_t v4; uint32_t v5; v2 = _uint32_identity_3(ctx->A); set_uint32((char *)resbuf, v2); v3 = _uint32_identity_3(ctx->B); set_uint32((char *)resbuf + 4, v3); v4 = _uint32_identity_3(ctx->C); set_uint32((char *)resbuf...
void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf) { char *r = resbuf; set_uint32(r + 0 * sizeof ctx->A, htole32(ctx->A)); set_uint32(r + 1 * sizeof ctx->B, htole32(ctx->B)); set_uint32(r + 2 * sizeof ctx->C, htole32(ctx->C)); set_uint32(r + 3 * sizeof ctx->D, htole32(ctx->D)); return resbuf; }
md5_read_ctx
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int md5_stream(FILE *stream, void *resblock) { size_t sum; char *buffer; size_t n; md5_ctx ctx; unsigned long v7; v7 = __readfsqword(0x28u); buffer = (char *)malloc(0x8048u); if (!buffer) return 1; md5_init_ctx(&ctx); LABEL_4: sum = 0; while (1) { n = fread(&buffer[sum], 1u, 0x8000 - sum,...
int md5_stream(FILE *stream, void *resblock) { struct md5_ctx ctx; size_t sum; char *buffer = malloc(BLOCKSIZE + 72); if (!buffer) return 1; md5_init_ctx(&ctx); while (1) { size_t n; sum = 0; while (1) { n = fread(buffer + sum, 1, BLOCKSIZE - sum, stream); sum += n; ...
md5_stream
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool minimum_bitness(rzip_state *st, tag t) { tag v2; v2 = increase_mask(st->minimum_tag_mask); return v2 != (v2 & t); }
static inline bool minimum_bitness(struct rzip_state *st, tag t) { tag better_than_min = increase_mask(st->minimum_tag_mask); if ((t & better_than_min) != better_than_min) return true; return false; }
minimum_bitness
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void mmap_stdin(rzip_control *control, unsigned char *buf, rzip_state *st) { long v3; size_t v4; int v5; unsigned char *bufa; long len; unsigned char *offset_buf; i64 total; long ret; len = st->chunk_size; offset_buf = buf; total = 0; while (len > 0) { v3 = 1048576000; if (len <= 104857...
static inline void mmap_stdin(rzip_control *control, uchar *buf, struct rzip_state *st) { i64 len = st->chunk_size; uchar *offset_buf = buf; ssize_t ret; i64 total; total = 0; while (len > 0) { ret = MIN(len, one_g); ret = read(fileno(control->inFILE), offset_buf, (siz...
mmap_stdin
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 nloops(i64 seconds, unsigned char *b1, unsigned char *b2) { unsigned char nbits; long v6; v6 = (unsigned int)(int)(pow(1.000000019249254, (double)(int)seconds) * 0.00001526505190377262); if ((unsigned long)v6 <= 0xF423F) v6 = 1000000; nbits = 0; while (v6 > 255) { v6 ...
i64 nloops(i64 seconds, uchar *b1, uchar *b2) { i64 nloops; int nbits; nloops = ARBITRARY_AT_EPOCH * pow(MOORE_TIMES_PER_SECOND, seconds); if (nloops < ARBITRARY) nloops = ARBITRARY; for (nbits = 0; nloops > 255; nbits++) nloops = nloops >> 1; *b1 = nbits; *b2 = nloops; return nloops << nbits; ...
nloops
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void *open_stream_in(rzip_control *control, int f, int n, char chunk_bytes) { int v5; i64 readseek; i64 v7; BOOL v8; i64 v9; i64 v10; BOOL v11; BOOL v12; BOOL v13; unsigned char c; u32 v132; u32 v232; u32 last_head32; int total_threads; int i; int read_len; i64 v1; i64 v2; i64 head...
void *open_stream_in(rzip_control *control, int f, int n, char chunk_bytes) { struct uncomp_thread *ucthreads; struct stream_info *sinfo; int total_threads, i; pthread_t *threads; i64 header_length; sinfo = calloc(sizeof(struct stream_info), 1); if (unlikely(!sinfo)) return NULL; if (control->thre...
open_stream_in
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_limit, char cbytes) { i64 v6; i64 v7; long v8; long v9; bool threadlimit; unsigned int i; unsigned int testbufs; long limit; i64 limita; stream_info *sinfo; i64 testsize; unsigned char *testmalloc...
void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_limit, char cbytes) { struct stream_info *sinfo; unsigned int i, testbufs; bool threadlimit = false; i64 testsize, limit; uchar *testmalloc; sinfo = calloc(sizeof(struct stream_info), 1); if (unlikely(!sin...
open_stream_out
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool open_tmpinbuf(rzip_control *control) { control->flags |= 0x400000u; control->in_maxlen = control->maxram; control->tmp_inbuf = (unsigned char *)malloc(control->maxram + control->page_size); if (control->tmp_inbuf) return 1; fatal_0(control, 0x242u, "lrzip.c", "open_tmpinbuf", "Failed ...
static bool open_tmpinbuf(rzip_control *control) { control->flags |= FLAG_TMP_INBUF; control->in_maxlen = control->maxram; control->tmp_inbuf = malloc(control->maxram + control->page_size); if (unlikely(!control->tmp_inbuf)) fatal_return(("Failed to malloc tmp_inbuf in open_tmpinbuf\n"), false); return tr...
open_tmpinbuf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int open_tmpinfile(rzip_control *control) { size_t v1; const char *v3; char v4; int fd_in; fd_in = -1; if (control->tmpdir) { v1 = strlen(control->tmpdir); control->infile = (char *)malloc(v1 + 15); if (!control->infile) { fatal_0(control, 0x1C6u, "lrzip.c", "open_tmpinfile", ...
int open_tmpinfile(rzip_control *control) { int fd_in = -1; if (control->tmpdir) { control->infile = malloc(strlen(control->tmpdir) + 15); if (unlikely(!control->infile)) fatal_return(("Failed to allocate infile name\n"), -1); strcpy(control->infile, control->tmpdir); strcat(control->infile, ...
open_tmpinfile
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool open_tmpoutbuf(rzip_control *control) { i64 maxlen; void *buf; unsigned long v4; v4 = __readfsqword(0x28u); maxlen = control->maxram; while (1) { round_to_page(&maxlen); buf = malloc(maxlen); if (buf) break; maxlen = 2 * (maxlen / 3); if (maxlen <= 99999999) { fatal_0(c...
static bool open_tmpoutbuf(rzip_control *control) { i64 maxlen = control->maxram; void *buf; while (42) { round_to_page(&maxlen); buf = malloc(maxlen); if (buf) { print_maxverbose("Malloced %" PRId64 " for tmp_outbuf\n", maxlen); break; } maxlen = maxlen / 3 * 2; if (maxlen < ...
open_tmpoutbuf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int open_tmpoutfile(rzip_control *control) { size_t v1; const char *v3; char v4; int fd_out; if ((control->flags & 0x2000) != 0 && (control->flags & 4) == 0 && (control->flags & 0xC00) != 0) print_stuff_0(control, 3, 0x132u, "lrzip.c", "open_tmpoutfile", "Outputting to stdout.\n")...
int open_tmpoutfile(rzip_control *control) { int fd_out; if (STDOUT && !TEST_ONLY) print_verbose("Outputting to stdout.\n"); if (control->tmpdir) { control->outfile = realloc(NULL, strlen(control->tmpdir) + 16); if (unlikely(!control->outfile)) fatal_return(("Failed to allocate outfile name\n")...
open_tmpoutfile
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
double percentage(i64 num, i64 den) { double d_num; double d_den; if (den > 99) { d_num = (double)(int)num; d_den = (double)(int)(den / 100); } else { d_num = (double)(100 * (int)num); d_den = (double)(int)den; if ((double)(int)den == 0.0) d_den = 1.0; } return d_num / d_den; }
static double percentage(i64 num, i64 den) { double d_num, d_den; if (den < 100) { d_num = num * 100; d_den = den; if (!d_den) d_den = 1; } else { d_num = num; d_den = den / 100; } return d_num / d_den; }
percentage
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool prepare_streamout_threads(rzip_control *control) { int i; pthread_t *threads; if (control->threads > 1) ++control->threads; if ((control->flags & 0x20) != 0) control->threads = 1; control->pthreads = (pthread_t *)calloc(8u, control->threads); threads = control->pthreads; if (threads) { c...
bool prepare_streamout_threads(rzip_control *control) { pthread_t *threads; int i; if (control->threads > 1) ++control->threads; if (NO_COMPRESS) control->threads = 1; threads = control->pthreads = calloc(sizeof(pthread_t), control->threads); if (unlikely(!threads)) fatal_return(("Unable to cal...
prepare_streamout_threads
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool preserve_perms(rzip_control *control, int fd_in, int fd_out) { stat st; unsigned long v6; v6 = __readfsqword(0x28u); if (fstat(fd_in, &st)) { fatal_0(control, 0x113u, "lrzip.c", "preserve_perms", "Failed to fstat input file\n"); return 0; } else { if (fchmod(fd_out, st.st_mode & ...
static bool preserve_perms(rzip_control *control, int fd_in, int fd_out) { struct stat st; if (unlikely(fstat(fd_in, &st))) fatal_return(("Failed to fstat input file\n"), false); if (unlikely(fchmod(fd_out, (st.st_mode & 0666)))) print_verbose("Warning, unable to set permissions on %s\n", ...
preserve_perms
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool preserve_times(rzip_control *control, int fd_in) { utimbuf times; stat st; unsigned long v5; v5 = __readfsqword(0x28u); if (fstat(fd_in, &st)) { fatal_0(control, 0x123u, "lrzip.c", "preserve_times", "Failed to fstat input file\n"); return 0; } else { times.actime = 0; times...
static bool preserve_times(rzip_control *control, int fd_in) { struct utimbuf times; struct stat st; if (unlikely(fstat(fd_in, &st))) fatal_return(("Failed to fstat input file\n"), false); times.actime = 0; times.modtime = st.st_mtime; if (unlikely(utime(control->outfile, &times))) print_verbose("W...
preserve_times
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 primary_hash(rzip_state *st, tag t) { return t & ((1 << st->hash_bits) - 1); }
static i64 primary_hash(struct rzip_state *st, tag t) { return t & ((1 << st->hash_bits) - 1); }
primary_hash
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
ssize_t put_fdout(rzip_control *control, void *offset_buf, ssize_t ret) { const char *v4; const char *v5; if ((control->flags & 0x200000) == 0) return write(control->fd_out, offset_buf, ret); if (ret + control->out_ofs <= control->out_maxlen) { memcpy(&control->tmp_outbuf[control->out_ofs], offset_buf,...
ssize_t put_fdout(rzip_control *control, void *offset_buf, ssize_t ret) { if (!TMP_OUTBUF) return write(control->fd_out, offset_buf, (size_t)ret); if (unlikely(control->out_ofs + ret > control->out_maxlen)) { print_verbose( "Unable to %scompress entirely in ram, will use physical files\n", ...
put_fdout
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void put_header(rzip_control *control, void *ss_0, unsigned char head, i64 len) { put_u8(control, ss_0, head); put_vchars(control, ss_0, len, 2); }
static void put_header(rzip_control *control, void *ss, uchar head, i64 len) { put_u8(control, ss, head); put_vchars(control, ss, len, 2); }
put_header
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void put_literal(rzip_control *control, rzip_state *st, i64 last, i64 p) { i64 len; do { len = p - last; if (p - last > 0xFFFF) len = 0xFFFF; ++st->stats.literals; st->stats.literal_bytes += len; put_header(control, st->ss, 0, len); if (len) write_sbstream(control, st->ss, 1, la...
static void put_literal(rzip_control *control, struct rzip_state *st, i64 last, i64 p) { do { i64 len = p - last; if (len > 0xFFFF) len = 0xFFFF; st->stats.literals++; st->stats.literal_bytes += len; put_header(control, st->ss, 0, len); if (len) write_sb...
put_literal
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void put_match(rzip_control *control, rzip_state *st, i64 p, i64 offset, i64 len) { i64 n; do { n = len; if (len > 0xFFFF) n = 0xFFFF; put_header(control, st->ss, 1u, n); put_vchars(control, st->ss, p - offset, st->chunk_bytes); ++st->stats.matches; st->stats.match_byte...
static inline void put_match(rzip_control *control, struct rzip_state *st, i64 p, i64 offset, i64 len) { do { i64 ofs; i64 n = len; if (n > 0xFFFF) n = 0xFFFF; ofs = (p - offset); put_header(control, st->ss, 1, n); put_vchars(control, st->ss, ofs, st->chunk_...
put_match
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void put_u32(rzip_control *control, void *ss_0, uint32_t s) { uint32_t sa; sa = _uint32_identity_0(s); write_stream(control, ss_0, 0, (unsigned char *)&sa, 4); }
static inline void put_u32(rzip_control *control, void *ss, uint32_t s) { s = htole32(s); write_stream(control, ss, 0, (uchar *)&s, 4); }
put_u32
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void put_u8(rzip_control *control, void *ss_0, unsigned char b) { unsigned char ba[4]; void *ss_0a; rzip_control *controla; controla = control; ss_0a = ss_0; ba[0] = b; write_stream(control, ss_0, 0, ba, 1); }
static inline void put_u8(rzip_control *control, void *ss, uchar b) { write_stream(control, ss, 0, &b, 1); }
put_u8
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void put_vchars(rzip_control *control, void *ss_0, i64 s, i64 length) { i64 sa; sa = _uint64_identity_0(s); write_stream(control, ss_0, 0, (unsigned char *)&sa, length); }
static void put_vchars(rzip_control *control, void *ss, i64 s, i64 length) { s = htole64(s); write_stream(control, ss, 0, (uchar *)&s, length); }
put_vchars
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
ssize_t read_1g(rzip_control *control, int fd, void *buf, i64 len) { const char *v4; long lena; unsigned char *offset_buf; ssize_t total; long ret; lena = len; offset_buf = (unsigned char *)buf; if ((control->flags & 0x400000) != 0 && fd == control->fd_in) { if (len + control->in_ofs <= control->in...
ssize_t read_1g(rzip_control *control, int fd, void *buf, i64 len) { uchar *offset_buf = buf; ssize_t ret; i64 total; if (TMP_INBUF && fd == control->fd_in) { if (unlikely(control->in_ofs + len > control->in_maxlen)) { if (dump_stdin(control)) { failure_return(("Inadequate ram to %scompress...
read_1g
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int read_buf(rzip_control *control, int f, unsigned char *p, i64 len) { int *v4; char *v5; ssize_t ret; ret = read_1g(control, f, p, len); if (ret == -1) { v4 = __errno_location(); v5 = strerror(*v4); print_err_3(control, 0x307u, "stream.c", "read_buf", "Read of length %lld failed...
static int read_buf(rzip_control *control, int f, uchar *p, i64 len) { ssize_t ret; ret = read_1g(control, f, p, (size_t)len); if (unlikely(ret == -1)) { print_err("Read of length %lld failed - %s\n", len, strerror(errno)); return -1; } if (unlikely(ret != (ssize_t)len)) { print_err("Partial read...
read_buf
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool read_config(rzip_control *control) { unsigned long flags; unsigned long v3; unsigned long v4; unsigned long v5; size_t v6; size_t v7; char *outdir; unsigned long v9; unsigned long v10; size_t v11; size_t v12; char *tmpdir; FILE *fp; const char *HOME; const char *parameter; const cha...
bool read_config(rzip_control *control) { char *HOME, homeconf[255]; char *parametervalue; char *parameter; char line[255]; FILE *fp; fp = fopen("lrzip.conf", "r"); if (fp) fprintf(control->msgout, "Using configuration file ./lrzip.conf\n"); if (fp == NULL) { HOME = getenv("HOME"); if (HOM...
read_config
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 read_fdhist(rzip_control *control, void *buf, i64 len) { if ((control->flags & 0x200000) == 0) return read_1g(control, control->fd_hist, buf, len); if (len + control->hist_ofs <= control->out_maxlen) { memcpy(buf, &control->tmp_outbuf[control->hist_ofs], len); return len; } else { print_err_2(...
static i64 read_fdhist(rzip_control *control, void *buf, i64 len) { if (!TMP_OUTBUF) return read_1g(control, control->fd_hist, buf, len); if (unlikely(len + control->hist_ofs > control->out_maxlen)) { print_err("Trying to read beyond end of tmpoutbuf in read_fdhist\n"); return -1; } memcpy(buf, cont...
read_fdhist
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool read_fdin(rzip_control *control, i64 len) { int tmpchar; i64 i; for (i = 0; i < len; ++i) { tmpchar = getchar(); if (tmpchar == -1) { failure_3(control, 0x29Eu, "stream.c", "read_fdin", "Reached end of file on STDIN prematurely on read_fdin, asked " "for %lld go...
static bool read_fdin(struct rzip_control *control, i64 len) { int tmpchar; i64 i; for (i = 0; i < len; i++) { tmpchar = getchar(); if (unlikely(tmpchar == EOF)) failure_return(("Reached end of file on STDIN prematurely on read_fdin, " "asked for %lld got %lld\n", ...
read_fdin
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 read_header(rzip_control *control, void *ss_0, unsigned char *head) { bool err; unsigned long v5; v5 = __readfsqword(0x28u); err = 0; *head = read_u8(control, ss_0, 0, &err); if (err) return -1; else return read_vchars(control, ss_0, 0, control->chunk_bytes); }
static i64 read_header(rzip_control *control, void *ss, uchar *head) { bool err = false; *head = read_u8(control, ss, 0, &err); if (err) return -1; return read_vchars(control, ss, 0, control->chunk_bytes); }
read_header
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool read_magic(rzip_control *control, int fd_in, i64 *expected_size) { char magic[24]; unsigned long v6; v6 = __readfsqword(0x28u); memset(magic, 0, sizeof(magic)); if (read(fd_in, magic, 0x18u) == 24) { if (!get_magic(control, magic)) { return 0; } else { *expected_size = control->st_si...
bool read_magic(rzip_control *control, int fd_in, i64 *expected_size) { char magic[MAGIC_LEN]; memset(magic, 0, sizeof(magic)); if (unlikely(read(fd_in, magic, 24) != 24)) fatal_return(("Failed to read magic header\n"), false); if (unlikely(!get_magic(control, magic))) return false; *expected_size ...
read_magic
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int read_seekto(rzip_control *control, stream_info *sinfo, i64 pos) { i64 spos; i64 len; spos = sinfo->initial_pos + pos; if ((control->flags & 0x400000) == 0) return fd_seekto(control, sinfo, spos, pos); if (spos > control->in_len) { len = spos - control->in_len; if (len + control->in_ofs > cont...
static int read_seekto(rzip_control *control, struct stream_info *sinfo, i64 pos) { i64 spos = pos + sinfo->initial_pos; if (TMP_INBUF) { if (spos > control->in_len) { i64 len = spos - control->in_len; if (control->in_ofs + len > control->in_maxlen) { if (unlikely(du...
read_seekto
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 read_stream(rzip_control *control, void *ss_0, int streamno, unsigned char *p, i64 len) { signed long v5; i64 ret; stream *s; i64 n; s = (stream *)(*(_QWORD *)ss_0 + 80LL * streamno); ret = 0; while (len) { v5 = s->buflen - s->bufp; if (len <= v5) v5 = len; n = v5; ...
i64 read_stream(rzip_control *control, void *ss, int streamno, uchar *p, i64 len) { struct stream_info *sinfo = ss; struct stream *s = &sinfo->s[streamno]; i64 ret = 0; while (len) { i64 n; n = MIN(s->buflen - s->bufp, len); if (n > 0) { if (unlikely(!s->buf)) failur...
read_stream
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool read_tmpinfile(rzip_control *control, int fd_in) { int tmpchar; FILE *tmpinfp; if (fd_in == -1) return 0; if ((control->flags & 1) != 0) fwrite("Copying from stdin.\n", 1u, 0x14u, control->msgout); tmpinfp = fdopen(fd_in, "w+"); if (tmpinfp) { while (1) { tmpchar = getchar(); i...
bool read_tmpinfile(rzip_control *control, int fd_in) { FILE *tmpinfp; int tmpchar; if (fd_in == -1) return false; if (control->flags & FLAG_SHOW_PROGRESS) fprintf(control->msgout, "Copying from stdin.\n"); tmpinfp = fdopen(fd_in, "w+"); if (unlikely(tmpinfp == NULL)) fatal_return(("Failed to f...
read_tmpinfile
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool read_tmpinmagic(rzip_control *control) { int i; int tmpchar; char magic[24]; unsigned long v5; v5 = __readfsqword(0x28u); memset(magic, 0, sizeof(magic)); for (i = 0; i <= 23; ++i) { tmpchar = getchar(); if (tmpchar == -1) { failure_0(control, 0x1F9u, "lrzip.c", "read_tmpinmagic", ...
static bool read_tmpinmagic(rzip_control *control) { char magic[MAGIC_LEN]; int i, tmpchar; memset(magic, 0, sizeof(magic)); for (i = 0; i < 24; i++) { tmpchar = getchar(); if (unlikely(tmpchar == EOF)) failure_return( ("Reached end of file on STDIN prematurely on v05 magic read\n"), ...
read_tmpinmagic
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int read_val(rzip_control *control, int f, i64 *v, int len) { *v = 0; return read_buf(control, f, (unsigned char *)v, len); }
static inline int read_val(rzip_control *control, int f, i64 *v, int len) { int ret; *v = 0; ret = read_buf(control, f, (uchar *)v, len); return ret; }
read_val
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 read_vchars(rzip_control *control, void *ss_0, int stream, int length) { i64 s[2]; s[1] = __readfsqword(0x28u); s[0] = 0; if (read_stream(control, ss_0, stream, (unsigned char *)s, length) == length) return _uint64_identity_1(s[0]); fatal_2(control, 0x50u, "runzip.c", "read_vchars", "Stream...
static inline i64 read_vchars(rzip_control *control, void *ss, int stream, int length) { i64 s = 0; if (unlikely(read_stream(control, ss, stream, (uchar *)&s, length) != length)) fatal_return(("Stream read of %d bytes failed\n", length), -1); s = le64toh(s); return s; }
read_vchars
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void register_infile(rzip_control *control, const char *name, char delete) { control->util_infile = name; control->delete_infile = delete; }
void register_infile(rzip_control *control, const char *name, char delete) { control->util_infile = name; control->delete_infile = delete; }
register_infile
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void register_outfile(rzip_control *control, const char *name, char delete) { control->util_outfile = name; control->delete_outfile = delete; }
void register_outfile(rzip_control *control, const char *name, char delete) { control->util_outfile = name; control->delete_outfile = delete; }
register_outfile
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void register_outputfile(rzip_control *control, FILE *f) { control->outputfile = f; }
void register_outputfile(rzip_control *control, FILE *f) { control->outputfile = f; }
register_outputfile
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void release_hashes(rzip_control *control) { memset(control->salt_pass, 0, 0x200u); memset(control->hash, 0, 8u); munlock(control->salt_pass, 0x200u); munlock(control->hash, 0x40u); free(control->salt_pass); control->salt_pass = 0; control->salt_pass = 0; free(control->hash); control->hash = 0; cont...
static void release_hashes(rzip_control *control) { memset(control->salt_pass, 0, PASS_LEN); memset(control->hash, 0, SALT_LEN); munlock(control->salt_pass, PASS_LEN); munlock(control->hash, HASH_LEN); dealloc(control->salt_pass); dealloc(control->hash); }
release_hashes
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void remap_high_sb(rzip_control *control, sliding_buffer *sb, i64 p) { if (munmap(sb->buf_high, sb->size_high)) failure_1(control, 0x7Au, "rzip.c", "remap_high_sb", "Failed to munmap in remap_high_sb\n"); sb->size_high = sb->high_length; sb->offset_high = p; sb->offset_high -= (sb->orig_offset...
static inline void remap_high_sb(rzip_control *control, struct sliding_buffer *sb, i64 p) { if (unlikely(munmap(sb->buf_high, sb->size_high))) failure("Failed to munmap in remap_high_sb\n"); sb->size_high = sb->high_length; sb->offset_high = p; sb->offset_high -= (sb->offse...
remap_high_sb
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void remap_low_sb(rzip_control *control, sliding_buffer *sb) { i64 new_offset[2]; new_offset[1] = __readfsqword(0x28u); new_offset[0] = sb->offset_search; round_to_page(new_offset); if ((control->flags & 0x800) != 0) print_stuff_1(control, 4, 0x6Cu, "rzip.c", "remap_low_sb", "Sliding ma...
static void remap_low_sb(rzip_control *control, struct sliding_buffer *sb) { i64 new_offset; new_offset = sb->offset_search; round_to_page(&new_offset); print_maxverbose("Sliding main buffer to offset %lld\n", new_offset); if (unlikely(munmap(sb->buf_low, sb->size_low))) failure("Failed to munmap in rema...
remap_low_sb
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
bool rewrite_encrypted(rzip_control *control, stream_info *sinfo, i64 ofs) { i64 cur_ofs; unsigned char *head; unsigned char *buf; cur_ofs = get_seek(control, sinfo->fd) - sinfo->initial_pos; if (cur_ofs == -1) return 0; head = (unsigned char *)malloc(0x21u); if (!head) { fatal_3(control, 0x4ECu,...
static bool rewrite_encrypted(rzip_control *control, struct stream_info *sinfo, i64 ofs) { uchar *buf, *head; i64 cur_ofs; cur_ofs = get_seek(control, sinfo->fd) - sinfo->initial_pos; if (unlikely(cur_ofs == -1)) return false; head = malloc(25 + SALT_LEN); if (unlikely(!he...
rewrite_encrypted
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void round_to_page(i64 *size) { i64 v1; v1 = *size; *size -= v1 % sysconf(30); if (!*size) *size = sysconf(30); }
void round_to_page(i64 *size) { *size -= *size % PAGE_SIZE; if (unlikely(!*size)) *size = PAGE_SIZE; }
round_to_page
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
size_t round_up_page(rzip_control *control, size_t len) { size_t lena; int rem; lena = len; rem = len % control->page_size; if (rem) return control->page_size - rem + len; return lena; }
size_t round_up_page(rzip_control *control, size_t len) { int rem = len % control->page_size; if (rem) len += control->page_size - rem; return len; }
round_up_page
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 runzip_chunk(rzip_control *control, int fd_in, i64 expected_size, i64 tally) { i64 readseek; long v6; double v7; unsigned long v8; char chunk_bytes; unsigned char head; bool err; unsigned int cksum; int l; int divisor_index; int p; unsigned int good_cksum; i64 total; dou...
static i64 runzip_chunk(rzip_control *control, int fd_in, i64 expected_size, i64 tally) { uint32 good_cksum, cksum = 0; i64 len, ofs, total = 0; int l = -1, p = 0; char chunk_bytes; struct stat st; uchar head; void *ss; bool err = false; unsigned long divisor[] = {1, 1024, 104...
runzip_chunk
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 runzip_fd(rzip_control *control, int fd_in, int fd_hist, i64 expected_size) { long v5; int i; int ia; int j; int ja; int i_0; int j_0; int j_0a; i64 total; double tdiff; long u; i64 fdinend; FILE *md5_fstream; timeval start; timeval end; unsigned char md5_stored[16]; ...
i64 runzip_fd(rzip_control *control, int fd_in, int fd_hist, i64 expected_size) { uchar md5_stored[MD5_DIGEST_SIZE]; struct timeval start, end; i64 total = 0, u; double tdiff; if (!NO_MD5) md5_init_ctx(&control->ctx); gettimeofday(&start, NULL); do { u = runzip_chunk(control, fd_in...
runzip_fd
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void rzip_chunk(rzip_control *control, rzip_state *st, int fd_in, int fd_out, i64 offset, double pct_base, double pct_multiple) { init_sliding_mmap(control, st, fd_in, offset); st->ss = open_stream_out(control, fd_out, 2u, st->chunk_size, st->chunk_bytes); if (!st->ss) failure_1(control,...
static inline void rzip_chunk(rzip_control *control, struct rzip_state *st, int fd_in, int fd_out, i64 offset, double pct_base, double pct_multiple) { struct sliding_buffer *sb = &control->sb; init_sliding_mmap(control, st, fd_in, offset); st->ss = ope...
rzip_chunk
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
void rzip_fd(rzip_control *control, int fd_in, int fd_out) { i64 v3; i64 max_chunk; i64 v5; long chunk_size; long mmap_size; unsigned int pass; unsigned int passes; int j; int bits; unsigned int elapsed_hours; unsigned int elapsed_minutes; unsigned int elapsed_seconds; unsigned int diff_second...
void rzip_fd(rzip_control *control, int fd_in, int fd_out) { struct sliding_buffer *sb = &control->sb; struct timeval current, start, last; i64 len = 0, last_chunk = 0; int pass = 0, passes, j; double chunkmbs, tdiff; struct rzip_state *st; struct statvfs fbuf; struct stat s, s2; i64 free_space; i...
rzip_fd
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 seekcur_fdin(rzip_control *control) { if ((control->flags & 0x400000) != 0) return control->in_ofs; else return lseek(control->fd_in, 0, 1); }
static i64 seekcur_fdin(rzip_control *control) { if (!TMP_INBUF) return lseek(control->fd_in, 0, SEEK_CUR); return control->in_ofs; }
seekcur_fdin
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
i64 seekcur_fdout(rzip_control *control) { if ((control->flags & 0x200000) != 0) return control->out_relofs + control->out_ofs; else return lseek(control->fd_out, 0, 1); }
static i64 seekcur_fdout(rzip_control *control) { if (!TMP_OUTBUF) return lseek(control->fd_out, 0, SEEK_CUR); return (control->out_relofs + control->out_ofs); }
seekcur_fdout
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0
int seekto(rzip_control *control, stream_info *sinfo, i64 pos) { i64 spos; long sposa; spos = sinfo->initial_pos + pos; if ((control->flags & 0x200000) == 0) return fd_seekto(control, sinfo, spos, pos); sposa = spos - control->out_relofs; control->out_ofs = sposa; if (sposa <= control->out_len && spo...
static int seekto(rzip_control *control, struct stream_info *sinfo, i64 pos) { i64 spos = pos + sinfo->initial_pos; if (TMP_OUTBUF) { spos -= control->out_relofs; control->out_ofs = spos; if (unlikely(spos > control->out_len || spos < 0)) { print_err("Trying to seek to %lld outside tmp outbuf in ...
seekto
lrzip-0.651
app-arch
O0/app-arch/lrzip-0.651/lrzip
ida
O0