ssokolow / makeself_safeextract

Experimental tool to extract makeself archives without running untrusted code
12 stars 2 forks source link

This program is redundant #3

Closed lukateras closed 6 years ago

lukateras commented 6 years ago

Hi! Stumbled upon this while packaging some GOG games. This program is redundant, look into libarchive and bsdtar that comes with it. It just looks for gzip headers and extracts from that point, as suggested in your ideas list.

bsdtar xf <game>.sh will unpack the game into the following tree:

$ find . -mindepth 1 -maxdepth 4
./gog_jotun_2.3.0.5.sh
./data
./data/noarch
./data/noarch/start.sh
./data/noarch/gameinfo
./data/noarch/game
./data/noarch/game/Jotun.x86
./data/noarch/game/Jotun.x86_64
./data/noarch/game/Jotun_Data
./data/noarch/docs
./data/noarch/docs/End User License Agreement.txt
./data/noarch/docs/installer_readme.txt
./data/noarch/support
./data/noarch/support/gog_com.shlib
./data/noarch/support/support_notice.txt
./data/noarch/support/gog-system-report.sh
./data/noarch/support/icon.png
./data/noarch/support/xdg-utils
./data/options
./data/options/menu_item
./data/options/menu_item/.mojosetup
./data/options/desktop_icon
./data/options/desktop_icon/.mojosetup
./meta
./meta/xdg-utils
./meta/xdg-utils/xdg-open
./meta/xdg-utils/xdg-desktop-icon
./meta/xdg-utils/xdg-desktop-menu
./meta/splash.png
./meta/gtk-2.0
./meta/gtk-2.0/gtkrc
./meta/gtk-2.0/apps
./meta/gtk-2.0/apps/chromium.rc
./meta/gtk-2.0/apps/Caja
./meta/gtk-2.0/apps/combo_down.png
./meta/gtk-2.0/apps/stock_find.png
./meta/gtk-2.0/apps/pcmanfm.rc
./meta/gtk-2.0/apps/Null
./meta/gtk-2.0/apps/pluma.rc
./meta/gtk-2.0/apps/caja.rc
./meta/gtk-2.0/apps/stock_back.png
./meta/gtk-2.0/apps/stock_stop.png
./meta/gtk-2.0/apps/dummy.png
./meta/gtk-2.0/apps/Handles
./meta/gtk-2.0/apps/stock_refresh.png
./meta/gtk-2.0/apps/stock_forward.png
./meta/gtk-2.0/apps/Others
./meta/gtk-2.0/apps/stock_home.png
./meta/gtk-2.0/pixmaps
./meta/gtk-2.0/pixmaps/background.png
./meta/gtk-2.0/widgets
./meta/gtk-2.0/widgets/Panel
./meta/gtk-2.0/widgets/Scale
./meta/gtk-2.0/widgets/Null
./meta/gtk-2.0/widgets/panel.rc
./meta/gtk-2.0/widgets/Others
./scripts
./scripts/config.lua
./scripts/mojosetup_init.lua
./scripts/mojosetup_mainline.lua
./scripts/localization.lua
./scripts/app_localization.lua
ssokolow commented 6 years ago
  1. I wrote this a while ago and haven't touched it since.

  2. Your example unpacks the Zip file at the end of the archive, as the --mojo option does. A MojoSetup makeself archive also contains a tar archive sandwiched between the shellscript stub and the Zip file on the end. If you just want to unpack the Zip file with no concern for the rest, it's entirely possible to just use unzip <game>.sh.

lukateras commented 6 years ago

I see, thanks for clearing that up! unzip also works, although there are ignorable errors at least with some game installers, like use of BSD-only lchmod.