How to use xarchive to unrar protected files?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
pp4mnklinux
Posts: 375
Joined: Fri 23 Aug 2013, 06:56

How to use xarchive to unrar protected files?

#1 Post by pp4mnklinux »

Hello:

I downloaded a protected compresed file and with xarchive I dont know how to write the rar password.

Can u tell me what must I do?

THANKS A LOT.
Distro: xenialpup64 7.5 XXL
Desktop Panel: JWM ~ FbBox 5.0

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#2 Post by Keef »

You probably need to install rar. If it is not in the PPM, you can download a binary from here: https://www.rarlab.com/download.htm
If xarchive does not behave, then

Code: Select all

rar -e name-of-your-file.rar 
in a terminal will prompt you for the password.

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

#3 Post by mikeslr »

Doesn't your Puppy have UExtract builtin? If not, it's available here, http://www.murga-linux.com/puppy/viewto ... 357#717357. UExtract will extract rar packages. And, as far I know, will prompt for a password.

User avatar
pp4mnklinux
Posts: 375
Joined: Fri 23 Aug 2013, 06:56

Uextract included

#4 Post by pp4mnklinux »

Thanks for your answers (BOTH)

Yes, Mike, I have Uextract SO I try to join it to open compresed files so I can use it when unextracting files.


Can u, plz, tell me what program do u use to compress files? (The easiest the better ;)


THANKS A LOT (Have a nice day)
Distro: xenialpup64 7.5 XXL
Desktop Panel: JWM ~ FbBox 5.0

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

Hi pp4mnklinux.

Console apps --
The zip utility is probably the easiest AND best compressor to use
You use like so:

Code: Select all

zip -CompressionLevel name-of-zip-file.zip name-of-original-file
Example:

Code: Select all

[~/my-documents]>zip -9 everything-is-relative.msg.zip everything-is-relative.msg
  adding: everything-is-relative.msg (deflated 45%).
(-9 specifies the highest compression)

lzop's syntax is simpler
lzop everything-is-relative.msg
but it does not compress as much as zip.

-- GUI apps
SFR's PackIt is the best! (It's in every Puppy.)
In a ROX window, right-click on the file you wish to compress and then click on PackIt,
and specify your choices.

IHTH
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
pp4mnklinux
Posts: 375
Joined: Fri 23 Aug 2013, 06:56

thanks

#6 Post by pp4mnklinux »

.
Distro: xenialpup64 7.5 XXL
Desktop Panel: JWM ~ FbBox 5.0

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

#7 Post by mikeslr »

Some time ago I discovered that if you use pzip to create a "pea" archive, then delete the "pea" ending, it effectively creates an file you can't decompress using, as far a I know, any application. The resulting file looks like a binary. You can name it anything; and put it anywhere --quickly camouflaged and undecipherable even without a password: well, until knowing what the file really is, you return the pea ending. http://murga-linux.com/puppy/viewtopic. ... 424#815424

So pzip has been in my toolkit ever since. There are both Linux and Windows versions which run under wine. But, frankly, I only use pzip to decompress those files where UExtract doesn't work well.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#8 Post by rufwoof »

Look at a pea file in mc's view (F3) and press F4 whilst in that view shows the hexdump of the file, and most (non textual) files have a 'magic' value at/towards the start of file to indicate what the file contains (file type signature).

For casual "hiding", simply compressing it and then swapping the first 100 bytes (or whatever) of the file with the last 100 bytes will generally suffice.

Compressing a file normalises it - produces a file with around equal numbers of occurrences of all byte values. Shift the header (start of file, that contains the magic value) to the end of file and replace it with what was at the end of file, and its content is somewhat hidden. And there's no need to remember any password.

This script will do that swapping (the target file should be prepared by compressing it first, but if you run this script against a text file you'll see how the content was moved around). As part of exchanging the first 100 bytes of the file with the last 100 bytes, each pair of bytes in both of those are swapped around (using dd's conv=swab).

Code: Select all

#!/bin/ash

# Basic/crude method to disguise the content of
# a file from casual inspection.
# The concept is that you first compress the
# file with gzip or whatever and then use this 
# script to swap the first 100 bytes of that
# compressed files content with the last 100 bytes
# file (the head and tail 100 bytes of the file
# are exchanged). Also the script (by using
# uses dd's conv=swab) swaps each pair of byte
# values around in both the head and tail bytes. 

# Run again to reverse it back to as-before

# Rufwoof Nov 2019

FILENAME=$1

if [ ! -f $1 ]; then
   echo File $1 not found
   exit
fi

FILESIZE=`ls -l "${FILENAME}" | awk '{print $5}'`

if [ ${FILESIZE} -lt 200 ]; then
   echo "file is too small to process - needs to be 200 bytes or more"
   exit
fi

# Extract the first 100 bytes of file
dd if=${FILENAME} of=/tmp/header bs=100 count=1 conv=swab

# Extract the last 100 bytes of file
BS=`expr ${FILESIZE} - 100`
dd if=${FILENAME} of=/tmp/tail status=none skip=1 bs=$BS count=1 conv=swab

# Insert the tail bytes at the start of file
# and the start bytes at the end of file

# Replace start of file with end of file content
cat /tmp/tail 1<> ${FILENAME}
rm /tmp/tail

# Replace end of file with start of file content
truncate -s $BS ${FILENAME}
cat /tmp/header >>${FILENAME}
rm /tmp/header
To restore it again, just re-run the script to revert its content back to before, and then gzip -d (uncompress) it. Try and uncompress it whilst its in its 'reversed' form and gzip will complain that its not a gzip file.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

Post Reply