29 # define mkdir(dirname,mode) _mkdir(dirname)
31 # define access(path,mode) _access(path,mode)
32 # define chmod(path,mode) _chmod(path,mode)
33 # define strdup(str) _strdup(str)
54 #define GNUTYPE_DUMPDIR 'D'
55 #define GNUTYPE_LONGLINK 'K'
56 #define GNUTYPE_LONGNAME 'L'
57 #define GNUTYPE_MULTIVOL 'M'
58 #define GNUTYPE_NAMES 'N'
59 #define GNUTYPE_SPARSE 'S'
60 #define GNUTYPE_VOLHDR 'V'
66 #define SHORTNAMESIZE 100
127 const char *
TGZsuffix[] = {
"\0",
".tar",
".tar.gz",
".taz",
".tgz",
NULL };
156 fprintf(stderr,
"%s: Couldn't find ",
prog);
158 fprintf(stderr,(
TGZsuffix[
i+1]) ?
"%s%s, " :
"or %s%s\n",
180 if (c < '0' || c >
'7')
182 result = result * 8 + (
c -
'0');
194 static char result[32];
196 local = localtime(t);
197 sprintf(result,
"%4d/%02d/%02d %02d:%02d:%02d",
209 static int isWinNT = -1;
211 FILETIME locft, modft;
216 loctm = localtime(&ftime);
220 st.wYear = (WORD)loctm->tm_year + 1900;
221 st.wMonth = (WORD)loctm->tm_mon + 1;
222 st.wDayOfWeek = (WORD)loctm->tm_wday;
223 st.wDay = (WORD)loctm->tm_mday;
224 st.wHour = (WORD)loctm->tm_hour;
225 st.wMinute = (WORD)loctm->tm_min;
226 st.wSecond = (WORD)loctm->tm_sec;
227 st.wMilliseconds = 0;
228 if (!SystemTimeToFileTime(&st, &locft) ||
229 !LocalFileTimeToFileTime(&locft, &modft))
233 isWinNT = (GetVersion() < 0x80000000) ? 1 : 0;
234 hFile = CreateFile(
fname, GENERIC_WRITE, 0,
NULL, OPEN_EXISTING,
235 (isWinNT ? FILE_FLAG_BACKUP_SEMANTICS : 0),
239 result = SetFileTime(hFile,
NULL,
NULL, &modft) ? 0 : -1;
245 settime.actime = settime.modtime = ftime;
259 error(
"Out of memory");
288 #define ISSPECIAL(c) (((c) == '*') || ((c) == '/'))
298 if (*
string !=
'\\' && *
string !=
'/')
302 else if (*
expr ==
'*')
306 while (*++
string != *
expr)
313 if (*
string != *
expr)
352 while(*
p && *
p !=
'\\' && *
p !=
'/')
358 fprintf(stderr,
"%s: Couldn't create directory %s\n",
prog,
buffer);
400 printf(
" date time size file\n"
401 " ---------- -------- --------- -------------------------------------\n");
427 if (
len == 0 ||
buffer.header.name[0] == 0)
432 if (tarmode == -1 || tartime == (
time_t)-1)
434 buffer.header.name[0] = 0;
450 error(
"bad long name");
457 switch (
buffer.header.typeflag)
485 char *
p = strrchr(
fname,
'/');
496 fprintf(stderr,
"%s: Couldn't create %s",
prog,
fname);
506 if (remaining < 0 || remaining >=
BLOCKSIZE)
536 "%s: Error writing %s -- skipping\n",
prog,
fname);
562 error(
"broken archive");
573 error(
"failed gzclose");
583 printf(
"untgz version 0.2.1\n"
584 " using zlib version %s\n\n",
586 printf(
"Usage: untgz file.tgz extract all files\n"
587 " untgz file.tgz fname ... extract selected files\n"
588 " untgz -l file.tgz list archive contents\n"
589 " untgz -h display this help\n");
595 fprintf(stderr,
"%s: %s\n",
prog,
msg);
602 #if defined(WIN32) && defined(__GNUC__)
634 if (strcmp(
argv[
arg],
"-l") == 0)
640 else if (strcmp(
argv[
arg],
"-h") == 0)
662 fprintf(stderr,
"%s: Couldn't gzopen %s\n",
prog,TGZfile);
669 error(
"Unknown option");
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
const lzma_allocator const uint8_t * in
static RzNumCalcValue expr(RzNum *, RzNumCalc *, int)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static fork const void static count static fd const char const char static newpath const char static path chmod
int ZEXPORT gzclose(gzFile file)
gzFile ZEXPORT gzopen(char *path, const char *mode) const
const char *ZEXPORT gzerror(gzFile file, int *errnum)
int ZEXPORT gzread(gzFile file, voidp buf, unsigned len)
RZ_API void Ht_() free(HtName_(Ht) *ht)
#define INVALID_HANDLE_VALUE
static void list(RzEgg *egg)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig mkdir
static static fork const void static count static fd const char const char static newpath char char char static envp time
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds utime
static static fork const void static count static fd const char const char static newpath char char argv
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause access
static struct sockaddr static addrlen static backlog const void msg
void TGZnotfound(const char *arcname)
int setfiletime(char *fname, time_t ftime)
int main(int argc, char **argv)
int getoct(char *p, int width)
void error(const char *msg)
int tar(gzFile in, int action, int arg, int argc, char **argv)
int makedir(char *newdir)
char *TGZfname OF((const char *))
void restore_attr(struct attr_item **list)
int matchname(int arg, int argc, char **argv, char *fname)
char * TGZfname(const char *arcname)
int ExprMatch(char *string, char *expr)
void push_attr(struct attr_item **list, char *fname, int mode, time_t time)
char * strtime(time_t *t)
if(dbg->bits==RZ_SYS_BITS_64)
const char *ZEXPORT zlibVersion()