Rizin
unix-like reverse engineering framework and cli tools
|
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <zlib.h>
#include "getopt.h"
#include "zip.h"
#include "compat.h"
#include "diff_output.h"
Go to the source code of this file.
Classes | |
struct | archive |
struct | ef |
struct | entry |
struct | enum_map_t |
Macros | |
#define | PROGRAM "zipcmp" |
#define | USAGE "usage: %s [-hipqtVv] archive1 archive2\n" |
#define | OPTIONS "hVCipqstv" |
#define | BOTH_ARE_ZIPS(a) (a[0].za && a[1].za) |
#define | INC(k) (i[k]++, list[k] = ((const char *)list[k]) + element_size) |
#define | PRINT(k) |
Functions | |
static int | comment_compare (const char *c1, size_t l1, const char *c2, size_t l2) |
static int | compare_list (char *const name[2], const void *list[2], const zip_uint64_t list_length[2], int element_size, int(*cmp)(const void *a, const void *b), int(*ignore)(const void *list, int last, const void *other), int(*check)(char *const name[2], const void *a, const void *b), void(*print)(char side, const void *element), void(*start_file)(const void *element)) |
static int | compare_zip (char *const zn[]) |
static int | ef_compare (char *const name[2], const struct entry *e1, const struct entry *e2) |
static int | ef_order (const void *a, const void *b) |
static void | ef_print (char side, const void *p) |
static int | ef_read (zip_t *za, zip_uint64_t idx, struct entry *e) |
static int | entry_cmp (const void *p1, const void *p2) |
static int | entry_ignore (const void *p1, int last, const void *o) |
static int | entry_paranoia_checks (char *const name[2], const void *p1, const void *p2) |
static void | entry_print (char side, const void *p) |
static void | entry_start_file (const void *p) |
static const char * | map_enum (const enum_map_t *map, uint32_t value) |
static int | is_directory (const char *name) |
static int | list_zip (const char *name, struct archive *a) |
static int | test_file (zip_t *za, zip_uint64_t idx, const char *zipname, const char *filename, zip_uint64_t size, zip_uint32_t crc) |
int | main (int argc, char *const argv[]) |
Variables | |
const enum_map_t | comp_methods [] |
const enum_map_t | extra_fields [] |
const char * | progname |
char | help_head [] = PROGRAM " (" PACKAGE ") by Dieter Baron and Thomas Klausner\n\n" |
char | help [] |
char | version_string [] |
int | ignore_case |
int | test_files |
int | paranoid |
int | verbose |
int | have_directory |
int | check_consistency |
int | summary |
int | plus_count = 0 |
int | minus_count = 0 |
diff_output_t | output |
#define PRINT | ( | k | ) |
#define USAGE "usage: %s [-hipqtVv] archive1 archive2\n" |
Definition at line 585 of file zipcmp.c.
Referenced by compare_zip(), and entry_paranoia_checks().
|
static |
Definition at line 599 of file zipcmp.c.
References c, check, cmp(), diff_output_end_file(), i, INC, list(), output, and PRINT.
Referenced by compare_zip(), and ef_compare().
Definition at line 303 of file zipcmp.c.
References a, entry::comment, comment_compare(), entry::comment_length, compare_list(), diff_output_data(), diff_output_init(), e, entry_cmp(), entry_ignore(), entry_paranoia_checks(), entry_print(), entry_start_file(), test-lz4-list::exit, free(), have_directory, i, is_directory(), list_zip(), minus_count, n, NULL, output, paranoid, plus_count, printf(), progname, qsort(), summary, verbose, za, and zip_close().
Referenced by main().
|
static |
Definition at line 690 of file zipcmp.c.
References compare_list(), ef_order(), ef_print(), entry::extra_fields, n, entry::n_extra_fields, and NULL.
Referenced by entry_paranoia_checks().
|
static |
Definition at line 721 of file zipcmp.c.
References ef::data, diff_output_data(), extra_fields, ef::flags, ef::id, map_enum(), output, p, ef::size, and ZIP_FL_LOCAL.
Referenced by ef_compare().
|
static |
Definition at line 655 of file zipcmp.c.
References e, ef_order(), i, setup::idx, malloc(), NULL, qsort(), za, zip_file_extra_field_get(), zip_file_extra_fields_count(), ZIP_FL_CENTRAL, and ZIP_FL_LOCAL.
Referenced by list_zip().
Definition at line 729 of file zipcmp.c.
References c, entry::crc, ignore_case, int, entry::name, and entry::size.
Referenced by compare_zip().
Definition at line 752 of file zipcmp.c.
References e, length, entry::name, NULL, and p.
Referenced by compare_zip().
Definition at line 779 of file zipcmp.c.
References entry::comment, comment_compare(), entry::comment_length, entry::comp_method, comp_methods, diff_output(), diff_output_data(), ef_compare(), map_enum(), and output.
Referenced by compare_zip().
|
static |
Definition at line 808 of file zipcmp.c.
References diff_output_file(), e, output, and p.
Referenced by compare_zip().
|
static |
Definition at line 815 of file zipcmp.c.
References diff_output_start_file(), e, output, and p.
Referenced by compare_zip().
Definition at line 526 of file zipcmp.c.
References a, check_consistency, zip_stat::comp_method, zip_stat::crc, ef_read(), err, error(), test-lz4-list::exit, i, length, malloc(), zip_stat::name, NULL, paranoid, progname, zip_stat::size, SIZE_MAX, strdup(), test_file(), test_files, za, ZIP_CHECKCONS, zip_error_fini(), zip_error_init_with_code(), zip_error_strerror(), zip_file_get_comment(), zip_get_archive_comment(), zip_get_num_entries(), zip_open(), and zip_stat_index().
Referenced by compare_zip().
Definition at line 241 of file zipcmp.c.
References argv, c, check_consistency, compare_zip(), test-lz4-list::exit, getopt(), have_directory, help, help_head, ignore_case, optind, OPTIONS, paranoid, printf(), progname, summary, test_files, USAGE, verbose, and version_string.
|
static |
Definition at line 864 of file zipcmp.c.
References i, map(), snprintf, UINT32_MAX, and value.
Referenced by ef_print(), and entry_paranoia_checks().
|
static |
Definition at line 823 of file zipcmp.c.
References entry::crc, crc32(), setup::idx, int, n, NULL, PRId64, PRIu64, progname, za, zip_fclose(), zip_file_strerror(), zip_fopen_index(), zip_fread(), and zip_strerror().
Referenced by list_zip().
int check_consistency |
Definition at line 234 of file zipcmp.c.
Referenced by list_zip(), and main().
const enum_map_t comp_methods[] |
Definition at line 94 of file zipcmp.c.
Referenced by entry_paranoia_checks().
const enum_map_t extra_fields[] |
Definition at line 124 of file zipcmp.c.
Referenced by ef_print().
int have_directory |
Definition at line 234 of file zipcmp.c.
Referenced by compare_zip(), and main().
char help[] | ( | void | ) |
Definition at line 191 of file zipcmp.c.
Referenced by main().
char help_head[] = PROGRAM " (" PACKAGE ") by Dieter Baron and Thomas Klausner\n\n" |
int ignore_case |
Definition at line 234 of file zipcmp.c.
Referenced by entry_cmp(), main(), rz_search_keyword_new_str(), and rz_search_keyword_new_wide().
int minus_count = 0 |
Definition at line 235 of file zipcmp.c.
Referenced by compare_zip().
diff_output_t output |
Definition at line 237 of file zipcmp.c.
Referenced by __core_visual_view_graph_update(), __dumpSections(), _zip_crypto_pbkdf2(), avr_assembler(), compare_list(), compare_zip(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), des_decrypt(), des_encrypt(), diff_output(), diff_output_data(), diff_output_end_file(), diff_output_file(), diff_output_init(), diff_output_start_file(), ef_print(), encode_addr16(), encode_addr32(), encode_atype(), encode_const_pool16(), encode_const_pool16_ut8(), encode_const_pool8(), encode_only_bcode(), encode_st16(), encode_st8(), encode_ut8(), encode_ut8x2(), ensure_header(), entry_paranoia_checks(), entry_print(), entry_start_file(), execute_command(), FUZ_AddressOverflow(), go_string(), java_assembler(), kwajd_decompress(), lang_pipe_run(), lzxd_init(), main(), mpc_parse_run(), mpcf_escape_new(), mpcf_unescape_new(), mszipd_init(), oabd_decompress(), oabd_decompress_incremental(), print_diff(), qtmd_init(), rabin_do_operation(), rz_cmd_info_demangle_handler(), rz_cmd_shell_echo_handler(), rz_cons_newline(), rz_core_visual_analysis_refresh(), rz_core_visual_analysis_refresh_column(), rz_core_visual_view_rop(), rz_demangler_resolve(), rz_egg_Cfile_getCompiler(), rz_egg_Cfile_parser(), rz_egg_Cfile_set_cEnv(), rz_main_rz_bin(), rz_sys_cmd_str(), rz_sys_cmd_str_full(), rz_test_cmp_cmd_output(), sanitize_cab_filename(), system_exec(), system_exec_stdin(), szddd_decompress(), and update().
int paranoid |
Definition at line 234 of file zipcmp.c.
Referenced by compare_zip(), list_zip(), and main().
int plus_count = 0 |
Definition at line 235 of file zipcmp.c.
Referenced by compare_zip().
const char* progname |
Definition at line 183 of file zipcmp.c.
Referenced by compare_zip(), list_zip(), main(), and test_file().
int summary |
Definition at line 234 of file zipcmp.c.
Referenced by compare_zip(), do_print_child_help(), fill_argv_modes_help_strbuf(), main(), and ts_parser__recover().
int test_files |
Definition at line 234 of file zipcmp.c.
Referenced by list_zip(), and main().
int verbose |
Definition at line 234 of file zipcmp.c.
Referenced by compare_zip(), and main().