diff options
author | Kyle K <kylek389@gmail.com> | 2015-04-15 04:38:04 -0500 |
---|---|---|
committer | Kyle K <kylek389@gmail.com> | 2015-04-15 04:38:04 -0500 |
commit | 70cb6d01b478fbb1cfa2741553f35e6d8da4042d (patch) | |
tree | e51c5f11bb2aa58b8e7a1f8a090ecc96eebc58a7 /TXRExtractor.cpp | |
parent | 9dc9b87417acf5c26df8f1cb3034fe1e350080e6 (diff) | |
download | TXRExtractor-70cb6d01b478fbb1cfa2741553f35e6d8da4042d.tar.gz TXRExtractor-70cb6d01b478fbb1cfa2741553f35e6d8da4042d.tar.bz2 TXRExtractor-70cb6d01b478fbb1cfa2741553f35e6d8da4042d.zip |
initial commit
1st commit after 3 hard weeks of staring at hex editor. At this time
WMN.DAT archive from Wangan Midnight is extractable.
Diffstat (limited to 'TXRExtractor.cpp')
-rw-r--r-- | TXRExtractor.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/TXRExtractor.cpp b/TXRExtractor.cpp new file mode 100644 index 0000000..f52d7b4 --- /dev/null +++ b/TXRExtractor.cpp @@ -0,0 +1,51 @@ +/*
+ * Tokyo Xtreme Racer Extractor
+ *
+ * currently supported archives:
+ * - Wangan Midnight 2007 PS3..............: WMN.DAT (done), AUDIO_PS3.DAT (work in progress...)
+ * - Import Tuner Challenge 2006 XBOX360...: work in progress...
+ *
+ *
+ * author: fatalhalt https://github.com/fatalhalt
+ *
+ */
+
+#include "stdafx.h"
+#include "TXRExtractor.h"
+#include "wmn.h"
+#include <io.h>
+#include <fcntl.h>
+
+int main(int argc, char* argv[])
+{
+ /* avoid end-of-line conversions */
+ _setmode(_fileno(stdin), O_BINARY);
+ _setmode(_fileno(stdout), O_BINARY);
+
+ if (argc != 4) {
+ fprintf(stderr, "usage: %s <archive> <table of content> <output>\n", argv[0]);
+ exit(1);
+ }
+
+ FILE *fd_archive, *fd_toc;
+ fd_archive = fopen(argv[1], "rb");
+ fd_toc = fopen(argv[2], "rb");
+ if (!fd_archive || !fd_toc) {
+ fprintf(stderr, "failed to open required files: %s\n", strerror(errno));
+ exit(2);
+ }
+
+ // cd to output dir
+ if (_chdir(argv[3])) {
+ fprintf(stderr, "couldn't cd into %s: %s\n", argv[3], strerror(errno));
+ exit(12);
+ }
+
+ wmn_extract(fd_archive, fd_toc);
+
+ fclose(fd_archive);
+ fclose(fd_toc);
+
+ return 0;
+}
+
|