Advertisement
Guest User

CoKane's unzipper!

a guest
Aug 22nd, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.59 KB | None | 0 0
  1. #         USAGE: ./upx
  2. #
  3.  
  4. #   DESCRIPTION: Frontend to Various Unpacking Tools
  5.  
  6. #
  7.  
  8. #       OPTIONS: ---
  9.  
  10. #  REQUIREMENTS: ---
  11.  
  12. #          BUGS: ---
  13.  
  14. #         NOTES: ---
  15.  
  16. #        AUTHOR: Stephen Kane
  17.  
  18. #  ORGANIZATION:
  19.  
  20. #       CREATED: 16/02/12 21:35:59 GMT
  21.  
  22. #      REVISION: v0.1
  23.  
  24. #    This file has no explicitly declared licence, however the author must retain
  25. #    his default legal rights and therefore BLANKET.LICENCE does not apply here!
  26.  
  27. #===============================================================================
  28.  
  29.  
  30.  
  31. if [[ ! -f $1 ]]; then
  32. if [[ ! -f $1 ]]; then
  33.         echo "$0: first argument is not a file" >&2
  34.         echo "$0: first argument is not a file" >&2
  35.         exit
  36.         exit
  37. fi
  38.  
  39.  
  40.  
  41. FILE="$1"
  42. FILE="$1"
  43. FILETYPE=$(if file -b $FILE | grep -q "ACE archive"; then
  44. FILETYPE=$(if file -b $FILE | grep -q "ACE archive"; then
  45.         echo "ACE"
  46.         echo "ACE"
  47.         elif file -b $FILE | grep -q "RAR archive"; then
  48.         elif file -b $FILE | grep -q "RAR archive"; then
  49.         echo "RAR"
  50.         echo "RAR"
  51.         elif file -b $FILE | grep -q "Zip archive"; then
  52.         elif file -b $FILE | grep -q "Zip archive"; then
  53.         echo "ZIP"
  54.         echo "ZIP"
  55. fi)
  56. fi)
  57.  
  58.  
  59. if [[ $FILETYPE == "ACE" ]]; then
  60. if [[ $FILETYPE == "ACE" ]]; then
  61.         unace e "$FILE"
  62.         unace e "$FILE"
  63. elif [[ $FILETYPE == "RAR" ]]; then
  64. elif [[ $FILETYPE == "RAR" ]]; then
  65.         unrar x "$FILE"
  66.         unrar x "$FILE"
  67. elif [[ $FILETYPE == "ZIP" ]]; then
  68. elif [[ $FILETYPE == "ZIP" ]]; then
  69.         unzip "$FILE"
  70.         unzip "$FILE"
  71. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement