Giter Site home page Giter Site logo

hllib's Introduction

================================
================================
 HLLib BY: RYAN "NEMESIS" GREGG
================================
================================

===========================
Library/Author Information:
===========================

---- General Library Information ----
Date                     : November 1st, 2010
Author                   : Ryan Gregg
                           Michael Mohr (Linux Port)
Title                    : HLLib
Build                    : 2.4.0
Email address            : [email protected] (Ryan Gregg)
                           [email protected] (Michael Mohr)
Home page /  Website     : http://nemesis.thewavelength.net/

---- Library Construction Information ----
Written In               : C, C++

======
Other:
======

The library contains four folders:

  Bin
  - Contains library and example program binaries.

  HLExtract
  - Contains example program source code.

  HLLib
  - Contains library source code.

  Lib
  - Contains library C/C++ Header and Inline Files.

  Sln
  - Contains Visual Studio solutions.

The project files are for Visual Studio .NET 2003 and 2005; no .NET extensions are used.

================
HLExtract Usage:
================

Correct HLExtract usage:
 -p <filepath>       (Package to load.)
 -d <path>           (Destination extraction directory.)
 -e <itempath>       (Item in package to extract.)
 -t <itempath>       (Item in package to validate.)
 -l[d][f] [filepath] (List the contents of the package.)
 -f                  (Defragment package.)
 -c                  (Console mode.)
 -s                  (Silent mode.)
 -m                  (Use file mapping.)
 -q                  (Use quick file mapping.)
 -v                  (Allow volatile access.)
 -o                  (Don't overwrite files.)
 -r                  (Force defragmenting on all files.)
 -n <path>           (NCF file's root path.)

Example HLExtract usage:
HLExtract.exe -p "C:\half-life.gcf" -d "C:\backup" -e "root\valve\models" -e "root\valve\config.cfg"
HLExtract.exe -p "C:\half-life.gcf" -c -m -q -v
HLExtract.exe -p "C:\half-life.gcf" -lf "C:\half-life.txt" -m -s
HLExtract.exe -p "C:\half-life.gcf" -m -f

Console Commands (Interactive console mode):

  dir [filter]		Directory listing.
  cd <folder>		Change directory to <folder>.
  info <item>		Information on <item>.
  extract <item>	Extract <item> to <path> specified by -d.
  validate <item>	Validate <item> data.
  find <filter>		Search the current folder for <item> recursively.
  type <file>		Type <file> to the console.
  open <file>		Open nested package <file>.
  root			Change directory to root\.
  status		Package information.
  cls			Clear screen.
  help			Display help.
  exit			Exit HLExtract.

==================
Library Changelog:
==================

  v2.3.0
  - Added support for GCF files larger than 4 GB.

  v2.3.0
  - Added support for x64.
  - Added Visual Studio 2010 solution.
  - Added Visual Studio 2008 solution.
  - Removed Visual Studio 2003 solution.

  v2.2.0
  - Added support for packages larger than 4 GB.

  v2.1.2
  - Added support for new VBSP file format.

  v2.1.1
  - Added support for new VPK file format.
  - Added VPK file validation.
  - Fixed crash when closing VPK files.

  v2.1.0
  - Added VPK file support.

  v2.0.11
  - Added VBSP .lmp support.
  - Fixed support for files over 2 GB.

  v2.0.10
  - Added Last Version Played attribute to NCF file.
  - Fixed change to directory entry folder terminator.

  v2.0.9
  - Added Last Version Played attribute to GCF file.
  
  v2.0.8
  - Improved GCF version check.
  - Fixed fragmentation header checksum after defragment.

  v2.0.7
  - Added different search string comparisons.
  - Added Visual Studio 2005 solution.
  - Improved package type tests.

  v2.0.6
  - Added generic write support to mapping interface.
  - Added no recurse option to FindFirst()/FindNext().
  - Improved package item attribute consistency.
  - Fixed GCC visibility support.
  - Fixed unnecessary GCF bounds check.
  - Fixed BSP unused lump check.

  v2.0.5
  - Added Linux support.
  - Fixed near infinite find next recursion.

  v2.0.4
  - Fixed bug in GCF file defragmentation progress.

  v2.0.3
  - Added NCF file support.

  v2.0.2
  - Added GCF file defragmentation.
  - Added fragmentation property to GCF files.
  - Added Dark Messiah VBSP support.
  - Fixed hlPackageCreateStream() bug.
  - Fixed CMapping::GetTotalMemoryUsed() calculation.
  - Fixed PAK file path parsing.
  - Improved error messages.
  - Improved file mapping performance.

  v2.0.1
  - Added memory tracking.
  - Improved view management.
  - Fixed memory mapping bug.
  - Fixed user data bug in proc reader.
  - Fixed WAD file GetImageData() bug.
  - Fixed default mapping stream view size.
  - Fixed a minor memory leak.

  v2.0.0
  - Rewrote entire library.
  - Open packages from anywhere (files, memory, abstract streams).
  - Get package and item attributes.
  - Stream package data.
  - Validate package data.
  - Added a C wrapper.
  - Improved and optimized package loading code.
  - Improved package detection.

  v1.1.8
  - Added CXZPFile support.

  v1.1.7
  - Added Source engine BSP support.

  v1.1.6
  - Added mipmap level option to CWADFile.

  v1.1.5
  - Improved CWADFile file support.

  v1.1.4
  - Improved detection of corrupt packages.

  v1.1.3
  - Extended CGCFFile.
  - Extended CFileMapping and CPrimitiveFileMapping to allow for volatile access.
  - Fixed CPackageUtility::Extract() bug caused by illegal characters.
  - Files of size 0 B are now treated as valid files.

  v1.1.2
  - Extended CPackage.
  - Extended CMappedPackage.
  - Improved error messages for system calls.

  v1.1.1
  - Fixed last error not being set in CMappedPackage::Open().

  v1.1.0
  - Rewrote mapping code to be more flexible.
  - Packages located on disk or in memory can now be loaded.
  - Optimized file mapping.
  - Fixed CPackage::Root bug.
  - Fixed CGCFFile::GetFileSizeOnDisk() bug.

  v1.0.4
  - Fixed CPackage memory leak.
  - Fixed CMappedPackage initialization bug.
  - Fixed CMappedPackage deinitialization bug.
  - Changed CDirectoryItem::Parent to a CDirectoryFolder.
  - Extended CWADFile.
  - Added CBSPFile which acts like CWADFile on a BSP's textures.

  v1.0.3
  - Extended CWADFile.
  - Changed GetFileSizeEx() to GetFileSize() (Not all versions of Windows supported the former).

  v1.0.2
  - Extended CPackage.
  - Extended CGCFFile.
  - Converted from bool to BOOL.
  - HLLib now used by GCFScape.

  v1.0.1
  - Added callback functionality to CPackageUtility::Extract().
  - Extended CGCFFile.
  - Minor bug fixes.

  v1.0.0
  - Original build.

==============================
Program Copyright-Permissions:
==============================

See the lgpl.txt (HLLib) and gpl.txt (HLExtract) files contained in the distribution.

hllib's People

Contributors

mark-grimes avatar rupan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hllib's Issues

v17-v18 BSP (HL2 Beta) crashes HLLib

Opening v17 BSP will crash GCFScape (which uses HLLib). This is a huge deal because it means the embedded contents of a map cant be seen.

-Getting package type from memory works (returns HL_PACKAGE_VBSP)
-Creating package works (returns true)
-Opening causes a crash

Received signal SIGSEGV
Stack trace:
0x00000257ac970300 (HLLib.x64) HLLib::CPackage::Close
0x00000257ac9701e5 (HLLib.x64) HLLib::CPackage::Open
0x00000257ac957503 (Mono JIT Code) (wrapper managed-to-native) HLLib/x64:hlPackageOpenMemory (intptr,uint,uint)
0x00000257ac95745b (Mono JIT Code) HLLib:hlPackageOpenMemory (intptr,uint,uint)
0x00000257ac95729b (Mono JIT Code) S2U.SourcePackageMemory:Open ()
0x00000257ac956e58 (Mono JIT Code) S2U.BaseSourcePackageFile:EndMount ()
0x00000257ac9560db (Mono JIT Code) S2U.SourcePackageMemory:Mount (byte[])
0x00000257ac9531bb (Mono JIT Code) S2U.SourceBSPLoader:Load (string,S2U.BSPLoadSettings)
0x00000257ac952b93 (Mono JIT Code) S2U.Test:Load ()`

The above stacktrace is from my Unity application, but this does not make a difference here because GCFScape also uses HLLib and gets a crash from these map files.

A quick Google search tells me that SIGSEGV means it tried to access memory it shouldn't?

The header file of v17 BSP can be found here: https://github.com/Clepoy3/LeakNet/blob/master/public/bspfile.h

[C# Wrapper] Formatted HLLib.hlGetString returns ExecutionEngineException

Calling hlGetString with HLOption.HL_ERROR_SHORT_FORMATED or HLOption.HL_ERROR_LONG_FORMATED

Will return:
ExecutionEngineException: String conversion error: Partial byte sequence encountered in the input.

image
image

I manually checked what the error was myself. And it was something about not being able to find the file. Nothing big

Add a new file to a package?

Hi, I am trying to figure out how to add a new file to a package. hlPackageOpenFile() returns 0 if the file does not already exist:

int WriteStream(Package* pak, wchar_t* path, void* data, uint64_t sz)
{
	hlBindPackage(pak->hlpak);
	auto s = String(path);
	if (not hlPackageOpenFile(s.c_str(), HL_MODE_WRITE)) return 0;
	auto root = hlPackageGetRoot();
	auto item = hlFolderGetItemByPath(root, s.c_str(), HL_FIND_ALL);
	HLStream* stream;
	hlPackageCreateStream(item, &stream);
	hlStreamWrite(stream, data, sz);
	hlStreamClose(stream);
	pak->modified = true;
	return 1;
}

Is it possible to use HLLib to add a new file to the package?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.