##################################################################
# Packers

# Unpack statement describes archives' 'fingerprints' and appropriate
# calls for unpacking it. Note that "zipinternal" as a call has
# a special meaning.
# Unpack "<call>" <offset> <matchcode>

# Pack statement declares packer's id and defines appropriate command line.
# Pack zip|tgz|rar|arc|arj|..... <call>

#### ZIP
#Unpack "unzip -joLqq $a -d $p" 0 504b0304
#Pack   zip zip -9jgq $a $f
#Pack   zip zip -9 -j -q $a $f
#Unpack "\path\pkzipc -ext -dir=none -over=all -nozip -silent $a $p $f" 0 504b0304
#Unpack "pkunzip -njCL $a -d $p $f" 0 504b0304

# Use external pkzip25
#Unpack "pkzip25 -ext -silent -over=all -nofix -nozip $a $p $f" 0 504b0304
#Pack  zip pkzip25.exe -add -nozip -lev=9 $a $f

# Use built-in zip engine
Unpack "zipInternal" 0 504b0304
Pack  zip zipInternal

#### RAR
Unpack "C:\Utils\WinRAR\UnRAR.exe e -y -c- -o+ -inul $a $p $f"   0 52617221
# rar-sfx/DOS
Unpack "C:\Utils\WinRAR\UnRAR.exe e -y -c- -o+ -inul $a $p $f"  28 52534658
# rar 2.90 R sfxs
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 23040 52617221  # Default.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f"  9573 52617221  # DOS.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f"  9493 52617221  # Dos_US.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 25099 52617221  # Os2.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 13312 52617221  # WinCon.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 13824 52617221  # WinConUS.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 25088 52617221  # Zip.sfx
# Rar 3.0 R sfxs
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 46592 52617221  # Default.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 93816 52617221  # Dos.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 37376 52617221  # WinCon.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 31232 52617221  # Zip.sfx
# Rar 3.0 sfxs
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 47104 52617221  # Default.sfx
# Rar 3.1b1 sfxs
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 50688 52617221  # Default.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 94128 52617221  # Dos.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 34816 52617221  # Zip.sfx
# Rar 3.1b2 sfxs
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 49152 52617221  # Default.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 94016 52617221  # Dos.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 34304 52617221  # Zip.sfx
# Rar 3.1b3 sfxs
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 49664 52617221  # Default.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 93932 52617221  # Dos.sfx
Unpack "C:\Utils\WinRAR\Rar.exe e -y -c- -o+ -inul $a $p $f" 37888 52617221  # WinCon.sfx

#Pack    rar rar a -ep -md1024 -m5 -mm -inul -s $a $f
Pack  rar C:\Utils\WinRAR\rar a -std -ep $a $f

#### ARJ
Unpack  "arj e -+ -y $a $p >nul" 0 60ea
Pack  arj arj a -+ -e -y $a $f >nul

#### ACE
Unpack "unace e -y -c- $a $p $f" 7 2a2a414345
