View Single Post
Re: HL1 For other platforms?
Old
  (#30)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: HL1 For other platforms? - 19-09-2005

Reverse engineering the half-life model format may be too complicated for me :/

Although, I did just reverse engineer the pak file format from q1/q2.
I know its opensource but I wanted to see how difficult it would be to reverse an entire file format.
It was actually pretty easy and oddly enough, fun.

Code:
const int PAK_IDENTITY = ( int ) ( 'K' << 24 ) + ( 'C' << 16 ) + ( 'A' << 8 ) + ( 'P' );

// Structure containing information about files
// stored in pack files.
typedef struct paklump_s {
   char szFilename[ 56 ];	 // Filename along with path ( ie. "maps/q2dm1.bsp" )
   int iFileoffset;		   // File offset from start of pak
   int iFilesize;			 // Length of file in bytes
} paklump_t;

// Structure defining the identity of the file aswell
// as the lump offsets/sizes.
typedef struct pakheader_s {
   char packIdentify[ 4 ];	// Non null terminated 4 character string which should contain "PACK"
   int iFirstlump;			// Offset to the first lump
int iLumpsize;			 // README!!!! THIS IS THE TOTAL SIZE IN BYTES OF THE LUMP TABLE!
							 // To get number of lumps divide this by sizeof( paklump_t ).
} pakheader_t;
Not sure about endianness though, I guess I'll have to get xcode installed on the mac and try some things.

Last edited by Lazy; 19-09-2005 at 19:25..
  
Reply With Quote