HLLib: Difference between revisions
m (→File formats)  | 
				No edit summary  | 
				||
| Line 1: | Line 1: | ||
HLLib is a LGPL open source programming library, which abstracts several Half-Life and Half-Life 2 package formats and provides a simple interface for all of them. HLLib works natively in both {{Windows|4}} and {{Linux|4}}.  | |||
HLLib is written in native [[C++]] but exposes both a [[C]] and C++ interface which can be used in any C or C++ application (additional languages may also use the library with Win32 imports).    | |||
Created by [[User:Nem|Ryan "Nemesis" Gregg]].  | |||
== File formats ==  | == File formats ==  | ||
Revision as of 05:56, 1 May 2023
HLLib is a LGPL open source programming library, which abstracts several Half-Life and Half-Life 2 package formats and provides a simple interface for all of them. HLLib works natively in both 
 Windows and 
 Linux.
HLLib is written in native C++ but exposes both a C and C++ interface which can be used in any C or C++ application (additional languages may also use the library with Win32 imports).
Created by Ryan "Nemesis" Gregg.
File formats
HLExtract
HLLib contains a example application called HLExtract. HLExtract is a GPL command-line utility written in C that can browse, extract, validate and defragment all supported packages. It provides a lean and mean shell-like interface for browsing as well as a command-line interface for automating tasks. HLExtract works natively in both Windows and Linux.
Screenshot
Common Options
- -p <path>
 - Package file to open.
 - -d <path>
 - Directory to extract content to (defaults to the package's directory).
 - -e <path>
 - Path to a file for folder in the package to extract.  Chain these for multiple items.  
-e rootfor everything. - -t <path>
 - Path to a file for folder in the package to validate.  Chain these for multiple items.  
-t rootfor everything. - -l[d][f]
 - List the contents of the package.  
-ldfor directories.-lffor files.-ldffor everything. - -f
 - Defragment the package.
 - -c
 - Drop into shell-like console mode.
 - -s
 - Silent mode. Display minimal messages.
 - -m
 - Use file mapping.
 - -q
 - Use quick file mapping. (Must also specify -m.)
 - -v
 - Allow volatile access. Enable this to share file access with other processes such as Steam.
 - -o
 - Don't overwrite files when extracting.
 - -r
 - Force complete lexicographical reordering of files during defragment even if there is no fragmentation.
 - -n <path>
 - The directory to find a NCF file's data in (for validation for example).
 
HLExtract.exe -p %1 -c -v.
Examples
HLExtract.exe -p "half-life.gcf" -d "backup" -e "root\valve\models" -e "root\valve\config.cfg" HLExtract.exe -p "half-life.gcf" -c -m -v HLExtract.exe -p "half-life.gcf" -lf "half-life.txt" HLExtract.exe -p "half-life.gcf" -m -f
Console Commands
- dir
 - List the current directory's contents.
 - cd <name>
 - Change directory to <name>.  Type 
cd ..to go up one level. - info <name>
 - Display information about <name>.
 - extract <name>
 - Extract <name> to destination directory (specified by -d).
 - validate <name>
 - Validate <name> and its subdirectories.
 - find <string>
 - Search for <string> if the current directory and its subdirectories.
 - type <name>
 - Type the contents of <name> to the console.
 - open <name>
 - Open the package <name> within the current package.
 - root
 - Change to the root directory.
 - status
 - Display information about the package.
 - cls
 - Clear the screen.
 - help
 - Display program help.
 - exit
 - Exit the current package.
 
