forked from shawwwn/H2OExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 349ff41
Showing
16 changed files
with
544 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#OS junk files | ||
[Tt]humbs.db | ||
*.DS_Store | ||
|
||
#Visual Studio files | ||
*.[Oo]bj | ||
*.user | ||
*.aps | ||
*.pch | ||
*.vspscc | ||
*.vssscc | ||
*_i.c | ||
*_p.c | ||
*.ncb | ||
*.suo | ||
*.tlb | ||
*.tlh | ||
*.bak | ||
*.[Cc]ache | ||
*.ilk | ||
*.log | ||
*.lib | ||
*.sbr | ||
*.sdf | ||
*.opensdf | ||
*.unsuccessfulbuild | ||
ipch/ | ||
[Oo]bj/ | ||
[Bb]in | ||
[Dd]ebug*/ | ||
[Rr]elease*/ | ||
Ankh.NoLoad | ||
|
||
#MonoDevelop | ||
*.pidb | ||
*.userprefs | ||
|
||
#Tooling | ||
_ReSharper*/ | ||
*.resharper | ||
[Tt]est[Rr]esult* | ||
*.sass-cache | ||
|
||
#Project files | ||
[Bb]uild/ | ||
|
||
#Subversion files | ||
.svn | ||
|
||
# Office Temp Files | ||
~$* | ||
|
||
# vim Temp Files | ||
*~ | ||
|
||
#NuGet | ||
packages/ | ||
*.nupkg | ||
|
||
#ncrunch | ||
*ncrunch* | ||
*crunch*.local.xml | ||
|
||
# visual studio database projects | ||
*.dbmdl | ||
|
||
#Test files | ||
*.testsettings | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
*.opt | ||
*.plg | ||
*.dep | ||
*.pch | ||
*.ncb | ||
*.exp |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Microsoft Developer Studio Workspace File, Format Version 6.00 | ||
# ����: ���ܱ༭��ɾ���ù������ļ��� | ||
|
||
############################################################################### | ||
|
||
Project: "H2OExtractor"=".\H2OExtractor.dsp" - Package Owner=<4> | ||
|
||
Package=<5> | ||
{{{ | ||
}}} | ||
|
||
Package=<4> | ||
{{{ | ||
}}} | ||
|
||
############################################################################### | ||
|
||
Global: | ||
|
||
Package=<5> | ||
{{{ | ||
}}} | ||
|
||
Package=<3> | ||
{{{ | ||
}}} | ||
|
||
############################################################################### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
H2OExtractor | ||
======= | ||
|
||
A .h2o archive extractor, has the ability to read and manipulate archives of WOTR that were previously unreadable. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* Archive.cpp */ | ||
#include "Archive.h" | ||
|
||
Archive::Archive() | ||
{ | ||
init(); | ||
} | ||
|
||
Archive::Archive(char* szFilePath) | ||
{ | ||
init(); | ||
open(szFilePath); | ||
} | ||
|
||
Archive::~Archive() | ||
{ | ||
close(); | ||
} | ||
|
||
uint64_t Archive::readComment(uint64_t streamPos) | ||
{ | ||
m_hH2O.seekg(streamPos, std::ios::beg); | ||
|
||
// Read Header | ||
m_hH2O.read(m_Comment.szHeader, 8); | ||
DB::debugLog("- ArchiveHeader: ", m_Comment.szHeader, NULL); | ||
|
||
// Read VersionInfo | ||
m_hH2O.read((char*)&m_Comment.VersionInfo, 4); | ||
DB::debugLog("- VersionInfo: ", m_Comment.VersionInfo, NULL); | ||
|
||
// Read Comments | ||
uint64_t beg = m_hH2O.tellg(); | ||
char curByte = 0x0; | ||
while (!m_hH2O.eof() && curByte!=H2O_COMMENT_TERMINATOR) | ||
{ | ||
m_hH2O.read(&curByte, 1); | ||
} | ||
uint64_t end = m_hH2O.tellg(); | ||
m_hH2O.seekg(beg); | ||
uint64_t length = end-beg; | ||
m_Comment.szComments = new char[length]; | ||
memset(m_Comment.szComments, 0, length); | ||
m_hH2O.read(m_Comment.szComments, length-1); | ||
DB::debugLog("- Comments: ", m_Comment.szComments, NULL); | ||
return end; | ||
} | ||
|
||
uint64_t Archive::readHeader(uint64_t streamPos) | ||
{ | ||
m_hH2O.seekg(streamPos, std::ios::beg); | ||
m_hH2O.read((char*)&m_Header, sizeof(ArchiveHeader)); | ||
DB::debugLog("size: ", sizeof(m_Header.CompressedSize), NULL); | ||
DB::debugLog("- Version: ", m_Header.Version, NULL); | ||
DB::debugLog("- FileCount: ", m_Header.FileCount, NULL); | ||
DB::debugLog("- CompressedSize: ", m_Header.CompressedSize, NULL); | ||
DB::debugLog("- RawSize: ", m_Header.RawSize, NULL); | ||
return 0; | ||
} | ||
|
||
void Archive::open(char* szFilePath) | ||
{ | ||
m_hH2O.open("Cursors.H2O", std::ifstream::binary); | ||
|
||
uint64_t curPos = 0; | ||
DB::debugLog("Comment Section: ", "", NULL); | ||
curPos = readComment(curPos); | ||
DB::debugLog("Header Section: ", "", NULL); | ||
curPos = readHeader(curPos); | ||
} | ||
|
||
void Archive::close() | ||
{ | ||
m_hH2O.close(); | ||
} | ||
|
||
|
||
// | ||
// Private | ||
// | ||
void Archive::init() | ||
{ | ||
memset(&m_Comment, 0, sizeof(m_Comment)); | ||
memset(&m_Header, 0, sizeof(m_Header)); | ||
} |
Oops, something went wrong.