Extracting data from a corrupted zip file with jar or repairing it
I received a zip file containing data captured with
tcpdump on
a Linux system. When I tried to open the zip file on my
MacBook Pro
laptop running OS X El Capitan by double-clicking on the file within the
Finder,
I saw an "unable to expand" error message stating "Error 2 - No such file or
directory." A Microsoft Windows user who downloaded the same zip file reported
that he was unable to open it, either. When I tried to unzip the file from
a
Terminal window using the
unzip utility, I saw an "End-of-central directory signature not found" error
message.
$ file AS2_Captures.zip
AS2_Captures.zip: Zip archive data, at least v2.0 to extract
$ unzip AS2_Captures.zip
Archive: AS2_Captures.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of AS2_Captures.zip or
AS2_Captures.zip.zip, and cannot find AS2_Captures.zip.ZIP, period.
$
[ More Info ]
[/software/utilities/file]
permanent link
Command line unrar utility for Microsoft Windows
If you need to extract files from a
.rar file on a Microsoft
Windows system,
RARLAB, which
procues the WinRAR program that provides a
GUI for dealing with RAR files on Microsoft
Windows systems, also provides a free utility,
unrar
,
which can be run from a command line on a Windows system. The utility
is available at
WinRAR and
RAR archiver addons.
To use the program, you need to extract the unRAR.exe
file from the file you download. You can do so by simply double-clicking
on the unrarw32.exe
file you downloaded. You will then be
prompted for a directory into which the unRAR.exe
file
should be extracted.
The default installation directory is C:\Program
Files(x86)\Unrar
. If you don't have access to install files
in that directory on a system, you can place it anywhere, e.g. in
"My Documents". So you don't need administrator level access to a
system to put the utility on a system or run it on a system.
There is only the one file, Unrar.exe
file that you need. to
use the software.
If you see a Program Compatibility Assistant window
appear stating "This program might not have installed correctly, you
can simply click on "This program installed correctly" to have the
Unrar.exe
file placed in the directory you chose, if
you have the appropriate access to place files in that directory..
You can see the options availble for the program by typing
unrar
at a command prompt in the directory in which you
extracted unrar.exe
.
C:\Users\joe\Documents\bin>unrar
UNRAR 5.00 freeware Copyright (c) 1993-2013 Alexander Roshal
Usage: unrar <command> -<switch 1> -<switch N> <archive> <files...>
<@listfiles...> <path_to_extract\>
<Commands>
e Extract files without archived paths
l[t[a],b] List archive contents [technical[all], bare]
p Print file to stdout
t Test archive files
v[t[a],b] Verbosely list archive contents [technical[all],bare]
x Extract files with full path
<Switches>
- Stop switches scanning
@[+] Disable [enable] file lists
ac Clear Archive attribute after compression or extraction
ad Append archive name to destination path
ag[format] Generate archive name using the current date
ai Ignore file attributes
ap<path> Set path inside archive
c- Disable comments show
cfg- Disable read configuration
cl Convert names to lower case
cu Convert names to upper case
dh Open shared files
ep Exclude paths from names
ep3 Expand paths to full including the drive letter
f Freshen files
id[c,d,p,q] Disable messages
ierr Send all messages to stderr
inul Disable all messages
ioff Turn PC off after completing an operation
kb Keep broken extracted files
n<file> Additionally filter included files
n@ Read additional filter masks from stdin
n@<list> Read additional filter masks from list file
o[+|-] Set the overwrite mode
oc Set NTFS Compressed attribute
or Rename files automatically
ow Save or restore file owner and group
p[password] Set password
p- Do not query password
r Recurse subdirectories
ri<P>[:<S>] Set priority (0-default,1-min..15-max) and sleep time in ms
sl<size> Process files with size less than specified
sm<size> Process files with size more than specified
ta<date> Process files modified after <date> in YYYYMMDDHHMMSS format
tb<date> Process files modified before <date> in YYYYMMDDHHMMSS format
tn<time> Process files newer than <time>
to<time> Process files older than <time>
ts<m,c,a>[N] Save or restore file time (modification, creation, access)
u Update files
v List all volumes
ver[n] File version control
vp Pause before each volume
x<file> Exclude specified file
x@ Read file names to exclude from stdin
x@<list> Exclude files listed in specified list file
y Assume Yes on all queries
C:\Users\joe\Documents\bin>
To extract the contents of a .rar file, use the e
argument to unrar followed by the name of the rar file.
C:\Users\joe\Documents\bin>unrar e %USERPROFILE%\Downloads\ST0044_9e8d3db5
2aa4e60904a3676eb33f763.rar
UNRAR 5.00 freeware Copyright (c) 1993-2013 Alexander Roshal
Extracting from C:\Users\joe\Downloads\ST0044_9e8d3db592aa4e60904a3676eb33763.rar
Extracting ST0044_BlacX Duet 5G Snow Editon_manual_12071201.pdf OK
All OK
[/software/utilities/file/rar]
permanent link
Hod - Octal and Hexadecimal Dump Program for Windows
Hex and
Octal dumper (hod) is a small (36,864 bytes for version 1.6) program,
written by Muhammad A Muquit, that can display the contents of a file
in
hexadecimal and
octal. It is available
for Linux/Unix, Microsoft Windows, and SimpleTech SimpleShare NAS systems.
For the Microsoft Windows version, simply extract
hod.exe
from
the
zip file
available on the author's website.
If you just type hod file
the contents of file will be displayed
in both hexadecimal and
ASCII.
C:\>"C:\Program Files\Utilities\hod.exe" temp.txt
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
0: 0d 0a 21 20 52 45 47 2e 45 58 45 20 56 45 52 53 ..! REG.EXE VERS
10: 49 4f 4e 20 33 2e 30 0d 0a 0d 0a 48 4b 45 59 5f ION 3.0....HKEY_
20: 43 55 52 52 45 4e 54 5f 55 53 45 52 5c 53 6f 66 CURRENT_USER\Sof
30: 74 77 61 72 65 5c 4d 69 63 72 6f 73 6f 66 74 5c tware\Microsoft\
40: 57 69 6e 64 6f 77 73 5c 43 75 72 72 65 6e 74 56 Windows\CurrentV
50: 65 72 73 69 6f 6e 5c 54 68 65 6d 65 73 5c 4c 61 ersion\Themes\La
60: 73 74 54 68 65 6d 65 0d 0a 20 20 20 20 57 61 6c stTheme.. Wal
70: 6c 70 61 70 65 72 09 52 45 47 5f 45 58 50 41 4e lpaper.REG_EXPAN
80: 44 5f 53 5a 09 25 53 79 73 74 65 6d 52 6f 6f 74 D_SZ.%SystemRoot
90: 25 5c 57 65 62 5c 57 61 6c 6c 70 61 70 65 72 5c %\Web\Wallpaper\
a0: 52 69 70 70 6c 65 2e 6a 70 67 0d 0a 0d 0a Ripple.jpg....
For help on using the program, use the -h
option.
C:\>"C:\Program Files\Utilities\hod.exe" -h
usage: C:\Program Files\Utilities\File\Analysis\hod.exe [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-o : dump in octal
-8 : show as block of 8 bytes
-x str : convert a hex input to decimal
-d : show offsets in decimal
-s : show identical output lines
-r : reverse hod hexdump to binary
-w : reverse regular hex bytes to binary
If no filename specified, it will read from stdin
Example:
$ hod file
$ hod < file
$ cat file | hod
$ cat file | hod -
$ hod < file
$ hod -o file
$ echo "hello" | hod
$ echo -n "hello" | hod
$ hod -x 1c0
1c0 : 448
$ echo "0a 01 ff ef 0b" | hod -w > bin.bin
$ hod bin.bin | hod -r > bin_again.bin
Note: -r and -w works with hexadecimal only.
If you want to convert an ASCII string, such as the word hello
,
to its hexadecimal equivalent, you can use the echo
command to
pipe the word to hod
, as below.
C:\>echo hello | "C:\Program Files\Utilities\hod.exe"
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
0: 68 65 6c 6c 6f 20 0a hello .
From the above output, you can see that the letters in hello
have the following hexadecimal equivalent representation.
ASCII | Hex | Note |
h | 68 | |
e | 65 | |
l | 6c | |
l | 6c | |
o | 6f | |
SP | 20 | space |
LF | 0a | line feed |
A space (hex 20) is listed after hello
, since there was a space
between the word and the |
pipe operator that feeds the output of
the echo
command to hod
. If I had placed the
|
immediately after hello
, i.e.
echo hello|
, it wouldn't have been listed. A line feed (hex 0a) is
shown after the space.
Download hod
Author's
website
[/software/utilities]
permanent link