Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include "zlib.h"
#include <direct.h>
#include <io.h>
#include <utime.h>
Go to the source code of this file.
Classes | |
struct | tar_header |
union | tar_buffer |
struct | attr_item |
Macros | |
#define | REGTYPE '0' /* regular file */ |
#define | AREGTYPE '\0' /* regular file */ |
#define | LNKTYPE '1' /* link */ |
#define | SYMTYPE '2' /* reserved */ |
#define | CHRTYPE '3' /* character special */ |
#define | BLKTYPE '4' /* block special */ |
#define | DIRTYPE '5' /* directory */ |
#define | FIFOTYPE '6' /* FIFO special */ |
#define | CONTTYPE '7' /* reserved */ |
#define | GNUTYPE_DUMPDIR 'D' /* file names from dumped directory */ |
#define | GNUTYPE_LONGLINK 'K' /* long link name */ |
#define | GNUTYPE_LONGNAME 'L' /* long file name */ |
#define | GNUTYPE_MULTIVOL 'M' /* continuation of file from another volume */ |
#define | GNUTYPE_NAMES 'N' /* file name that does not fit into main hdr */ |
#define | GNUTYPE_SPARSE 'S' /* sparse file */ |
#define | GNUTYPE_VOLHDR 'V' /* tape/volume header */ |
#define | BLOCKSIZE 512 |
#define | SHORTNAMESIZE 100 |
#define | ISSPECIAL(c) (((c) == '*') || ((c) == '/')) |
Enumerations | |
enum | { TGZ_EXTRACT , TGZ_LIST , TGZ_INVALID } |
Functions | |
char *TGZfname | OF ((const char *)) |
int getoct | OF ((char *, int)) |
char *strtime | OF ((time_t *)) |
void push_attr | OF ((struct attr_item **, char *, int, time_t)) |
void restore_attr | OF ((struct attr_item **)) |
int ExprMatch | OF ((char *, char *)) |
int makedir | OF ((char *)) |
int matchname | OF ((int, int, char **, char *)) |
int tar | OF ((gzFile, int, int, int, char **)) |
void help | OF ((int)) |
int main | OF ((int, char **)) |
char * | TGZfname (const char *arcname) |
void | TGZnotfound (const char *arcname) |
int | getoct (char *p, int width) |
char * | strtime (time_t *t) |
int | setfiletime (char *fname, time_t ftime) |
void | push_attr (struct attr_item **list, char *fname, int mode, time_t time) |
void | restore_attr (struct attr_item **list) |
int | ExprMatch (char *string, char *expr) |
int | makedir (char *newdir) |
int | matchname (int arg, int argc, char **argv, char *fname) |
int | tar (gzFile in, int action, int arg, int argc, char **argv) |
void | help (int exitval) |
void | error (const char *msg) |
int | main (int argc, char **argv) |
Variables | |
char * | prog |
const char * | TGZsuffix [] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL } |
void error | ( | const char * | msg | ) |
Definition at line 593 of file untgz.c.
References test-lz4-list::exit, msg, and prog.
Referenced by __core_analysis_fcn(), _zip_allocate_new(), _zip_buffer_new_from_source(), _zip_cdir_grow(), _zip_cdir_new(), _zip_checkcons(), _zip_cp437_to_utf8(), _zip_crypto_aes_new(), _zip_crypto_hmac_new(), _zip_dirent_process_winzip_aes(), _zip_dirent_read(), _zip_dirent_size(), _zip_ef_clone(), _zip_ef_get_by_id(), _zip_ef_parse(), _zip_ef_utf8(), _zip_file_exists(), _zip_file_get_end(), _zip_file_get_offset(), _zip_find_central_dir(), _zip_get_dirent(), _zip_get_name(), _zip_hash_add(), _zip_hash_delete(), _zip_hash_lookup(), _zip_hash_new(), _zip_hash_reserve_capacity(), _zip_hash_revert(), _zip_memdup(), _zip_name_locate(), _zip_new(), _zip_open(), _zip_read(), _zip_read_cdir(), _zip_read_data(), _zip_read_eocd(), _zip_read_eocd64(), _zip_read_string(), _zip_source_new(), _zip_source_window_new(), _zip_source_zip_new(), _zip_string_get(), _zip_string_new(), _zip_win32_named_op_stat(), _zip_winzip_aes_new(), add_from_zip(), allocate(), basefind_create_array_of_addresses(), bin_pe_dotnet_init_clr(), bin_pe_parse_imports(), buffer_clone(), buffer_from_file(), buffer_grow_fragments(), buffer_new(), buffer_read_file(), buffer_seek(), buffer_to_file(), buffer_write(), cabd_extract(), cabd_open(), cabd_read_string(), cat(), check_token_coverage(), chmd_real_open(), coder_loop(), compress_allocate(), construct_rop_gadget(), decompress_allocate(), do_io_reply(), file_error(), file_error_core(), fs__create_junction(), fs__mkdtemp_func(), fs__mkstemp_func(), fs__open(), fs__opendir(), fs__read(), fs__readdir(), fs__stat_impl(), fs__unlink(), fs__utime_impl(), get_ascii_interned_object(), get_ascii_object(), get_atomic_type(), get_binary_complex_object(), get_binary_float_object(), get_callable_type(), get_code_object(), get_complex_object(), get_enum_type(), get_float64(), get_float_object(), get_int64_object(), get_int_object(), get_interned_object(), get_ivar_list_t(), get_list_object(), get_long_object(), get_method_list_t(), get_objc_property_list(), get_object(), get_ref_object(), get_set_object(), get_short_ascii_interned_object(), get_short_ascii_object(), get_small_tuple_object(), get_st32(), get_st64(), get_string_object(), get_stringref_object(), get_struct_type(), get_tuple_object(), get_typedef_type(), get_unicode_object(), get_union_type(), get_ut16(), get_ut32(), get_ut8(), hash_resize(), hole_new(), indx(), io_open_src(), io_open_src_real(), kwajd_decompress(), list_zip(), LLVMFuzzerTestOneInput(), LZ4_decompress_generic(), LZMA_API(), lzma_lzma_props_decode(), magic_int_within(), main(), make_program_args(), merge_zip(), meta_load_cb(), mpc_parse_run(), mszipd_decompress(), mszipd_decompress_kwaj(), open_compressed(), open_file(), Operand_ar0_encode(), Operand_ar12_encode(), Operand_ar4_encode(), Operand_ar8_encode(), Operand_arr_encode(), Operand_ars_encode(), Operand_ars_entry_encode(), Operand_art_encode(), Operand_br16_encode(), Operand_br2_encode(), Operand_br4_encode(), Operand_br8_encode(), Operand_br_encode(), Operand_brall_encode(), Operand_bs16_encode(), Operand_bs2_encode(), Operand_bs4_encode(), Operand_bs8_encode(), Operand_bs_encode(), Operand_bt16_encode(), Operand_bt2_encode(), Operand_bt4_encode(), Operand_bt8_encode(), Operand_bt_encode(), Operand_frr_encode(), Operand_frs_encode(), Operand_frt_encode(), Operand_mr0_encode(), Operand_mr1_encode(), Operand_mr2_encode(), Operand_mr3_encode(), Operand_mw_encode(), Operand_mx_encode(), Operand_my_encode(), parse_categories(), parse_indexes(), parse_symtab(), parse_type_fieldlist(), parse_type_methodlist(), parse_type_pointer(), parser__repair_error(), parser__skip_preceding_trees(), pdb7_extract_msf_stream_directory(), pdb7_parse(), printerr(), push_attr(), rabin_do_operation(), read_from_file(), read_hole(), read_image_metadata_tilde_header(), read_to_memory(), read_variable_length(), rz_analysis_cc_error(), rz_analysis_cc_get(), rz_analysis_cc_set_error(), rz_analysis_esil_trace_new(), rz_analysis_rzil_trace_new(), rz_axml_decode(), rz_bin_pdb_parse_from_buf(), rz_heap_tcache_content(), rz_regs_fpu_handler(), rz_socket_connect(), rz_socket_is_connected(), rz_socket_proc_open(), rz_subprocess_start_opt(), rz_uleb128(), scandir(), session_sdb_load(), set_error(), set_other_error(), set_out_of_range_error(), set_syntax_error(), source_hole_create(), str_to_uint64(), szddd_decompress(), tar(), trad_pkware_new(), ts_parser__recover_to_state(), uv__create_stdio_pipe_pair(), uv__fast_poll_create_peer_socket(), uv__fast_poll_process_poll_req(), uv__fs_opendir(), uv__fs_readdir(), uv__pipe_getname(), uv__pipe_read_ipc(), uv__stdio_create(), uv__stream_connect(), uv__stream_flush_write_queue(), uv__tty_try_write(), uv__write(), uv_barrier_init(), uv_cond_init(), uv_cpu_info(), uv_exepath(), uv_fs_event_start(), uv_fs_poll_start(), uv_getaddrinfo(), uv_msafd_poll(), uv_os_uname(), uv_pipe_bind(), uv_pipe_chmod(), uv_pipe_connect(), uv_pipe_queue_read(), uv_pipe_read_error(), uv_pipe_read_error_or_eof(), uv_poll_close(), uv_resident_set_memory(), uv_spawn(), uv_stdio_pipe_server(), uv_tty_clear(), uv_tty_emit_text(), uv_tty_move_caret(), uv_tty_reset(), uv_tty_restore_state(), uv_tty_save_state(), uv_tty_set_cursor_shape(), uv_tty_set_cursor_visibility(), uv_tty_set_style(), uv_tty_write(), uv_tty_write_bufs(), uv_wsarecv_workaround(), uv_wsarecvfrom_workaround(), win32_error_file_func(), win32_read_file_func(), win32_seek64_file_func(), win32_seek_file_func(), win32_tell64_file_func(), win32_tell_file_func(), win32_write_file_func(), windows_open(), winzip_aes_new(), xnu_generate_corefile(), xnu_write_mem_maps_to_buffer(), xrefs_load_cb(), zip_close(), zip_error_code_system(), zip_error_code_zip(), zip_error_init_with_code(), zip_error_strerror(), zip_error_system_type(), zip_error_to_data(), zip_fdopen(), zip_open(), zip_open_from_source(), zip_source_buffer_create(), zip_source_buffer_fragment_create(), zip_source_buffer_fragment_with_attributes_create(), zip_source_buffer_with_attributes_create(), zip_source_crc_create(), zip_source_file_common_new(), zip_source_file_create(), zip_source_filep_create(), zip_source_function_create(), zip_source_layered_create(), zip_source_seek_compute_offset(), zip_source_win32a_create(), zip_source_win32handle_create(), zip_source_win32w_create(), zip_source_window_create(), zip_source_zip_create(), and ziptool_open().
int ExprMatch | ( | char * | string, |
char * | expr | ||
) |
Definition at line 290 of file untgz.c.
References expr(), and ISSPECIAL.
Referenced by matchname().
void help | ( | int | exitval | ) |
Definition at line 581 of file untgz.c.
References test-lz4-list::exit, printf(), and zlibVersion().
Referenced by main().
Definition at line 606 of file untgz.c.
References test-lz4-speed::action, arg(), argv, error(), test-lz4-list::exit, f, gzopen(), help(), NULL, prog, tar(), TGZ_EXTRACT, TGZ_LIST, TGZfname(), and TGZnotfound().
int makedir | ( | char * | newdir | ) |
Definition at line 328 of file untgz.c.
References ENOENT, free(), len, mkdir, p, prog, and strdup().
Referenced by tar().
Definition at line 371 of file untgz.c.
References argv, ExprMatch(), and create_tags_rz::fname.
Referenced by tar().
void restore_attr OF | ( | (struct attr_item **) | ) |
Definition at line 253 of file untgz.c.
References error(), attr_item::fname, create_tags_rz::fname, list(), malloc(), attr_item::mode, attr_item::next, NULL, strdup(), time, and attr_item::time.
Referenced by tar().
void restore_attr | ( | struct attr_item ** | list | ) |
Definition at line 270 of file untgz.c.
References chmod, attr_item::fname, free(), list(), attr_item::mode, attr_item::next, NULL, setfiletime(), and attr_item::time.
Referenced by tar().
Definition at line 206 of file untgz.c.
References create_tags_rz::fname, HANDLE, if(), INVALID_HANDLE_VALUE, NULL, and utime.
Referenced by restore_attr().
char* strtime | ( | time_t * | t | ) |
Definition at line 386 of file untgz.c.
References test-lz4-speed::action, AREGTYPE, argv, BLOCKSIZE, bytes, DIRTYPE, err, error(), benchmark::FILE, create_tags_rz::fname, getoct(), GNUTYPE_LONGLINK, GNUTYPE_LONGNAME, gzclose(), gzerror(), gzread(), in, len, makedir(), matchname(), NULL, outfile, p, printf(), prog, push_attr(), REGTYPE, restore_attr(), SHORTNAMESIZE, buffer::size, strtime(), TGZ_EXTRACT, TGZ_INVALID, TGZ_LIST, and Z_OK.
Referenced by file_is_tar(), and main().
char* TGZfname | ( | const char * | arcname | ) |
Definition at line 132 of file untgz.c.
References access, F_OK, i, NULL, and TGZsuffix.
Referenced by main().
void TGZnotfound | ( | const char * | arcname | ) |
char* prog |
Definition at line 125 of file untgz.c.
Referenced by error(), main(), makedir(), tar(), TGZnotfound(), usage(), and uv__search_path().
const char* TGZsuffix[] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL } |
Definition at line 127 of file untgz.c.
Referenced by TGZfname(), and TGZnotfound().