Skip to content

Commit

Permalink
Added ArchiveFile type
Browse files Browse the repository at this point in the history
  • Loading branch information
shawwwn committed May 15, 2014
1 parent b1d59c1 commit 66a8ae7
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 1 deletion.
20 changes: 20 additions & 0 deletions H2OExtractor.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Source/Archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>

#include "Types.h"
#include "DebugUtils.h"
#include "ArchiveComment.h"
#include "ArchiveHeader.h"
#include "ArchiveFile.h"
#include "ArchiveFileNameDesc.h"
#include "ArchiveFileNameChunk.h"
#include "ArchiveFileName.h"

class Archive
{
Expand All @@ -26,6 +31,8 @@ class Archive
ArchiveComment m_Comment;
ArchiveHeader m_Header;



protected:
std::ifstream m_hH2O;
private:
Expand Down
3 changes: 2 additions & 1 deletion Source/ArchiveComment.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/* ArchiveComment.h */
#pragma once

#include "Types.h"

#define H2O_COMMENT_TERMINATOR 0x1A

#pragma pack(push, 1)
struct ArchiveComment
{
char szHeader[9];
char szHeader[8];
float VersionInfo;
char* szComments;
};
Expand Down
2 changes: 2 additions & 0 deletions Source/ArchiveFile.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* ArchiveFile.cpp */
#include "ArchiveFile.h"
19 changes: 19 additions & 0 deletions Source/ArchiveFile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* ArchiveFile.h */
#pragma once

#include "Types.h"

#pragma pack(push, 1)
struct ArchiveFile
{
uint32_t CompressionTag;
int32_t FolderNameIndex;
int32_t FileNameIndex;
uint32_t FileId;
uint32_t RawSize;
uint32_t CompressedSize;
uint32_t Offest;
char CRC32[4];
uint32_t UnknownConstant;
};
#pragma pack(pop)
2 changes: 2 additions & 0 deletions Source/ArchiveFileName.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* ArchiveFileName.cpp */
#include "ArchiveFileName.h"
12 changes: 12 additions & 0 deletions Source/ArchiveFileName.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* ArchiveFileName.h */
#pragma once

#include "Types.h"

#pragma pack(push, 1)
struct ArchiveFileName
{
char* FileName;
uint16_t NullTerminator;
};
#pragma pack(pop)
2 changes: 2 additions & 0 deletions Source/ArchiveFileNameChunk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* ArchiveFileNameChunk.cpp */
#include "ArchiveFileNameChunk.h"
12 changes: 12 additions & 0 deletions Source/ArchiveFileNameChunk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* ArchiveFileNameChunk.h */
#pragma once

#include "Types.h"

#pragma pack(push, 1)
struct ArchiveFileNameChunk
{
uint32_t FileNameCount;
uint32_t FileNameSize;
};
#pragma pack(pop)
2 changes: 2 additions & 0 deletions Source/ArchiveFileNameDesc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* ArchiveFileNameDesc.cpp */
#include "ArchiveFileNameDesc.h"
14 changes: 14 additions & 0 deletions Source/ArchiveFileNameDesc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* ArchiveFileNameDesc.h */
#pragma once

#include "Types.h"

#pragma pack(push, 1)
struct ArchiveFileNameDesc
{
uint32_t CompressedSize;
uint32_t RawSize;
char CRC32[4];
char* CompressedChunk;
};
#pragma pack(pop)
1 change: 1 addition & 0 deletions Source/ArchiveHeader.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* ArchiveHeader.h */
#pragma once

#include "Types.h"

#pragma pack(push, 1)
Expand Down

0 comments on commit 66a8ae7

Please sign in to comment.