diff options
author | pixel <pixel> | 2004-11-27 21:44:15 +0000 |
---|---|---|
committer | pixel <pixel> | 2004-11-27 21:44:15 +0000 |
commit | 50f0dd331f8168fb5b2cd60c70178fad627b7fb6 (patch) | |
tree | 65fcec7bd507791f0db8a3af1b60ad9ac631f4a7 /PE/extract.cpp | |
parent | f1df76865d1751469deff19e62255d50a814f183 (diff) |
Large dos2unix commit...
Diffstat (limited to 'PE/extract.cpp')
-rw-r--r-- | PE/extract.cpp | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/PE/extract.cpp b/PE/extract.cpp index 4fa8b2f..4418fb9 100644 --- a/PE/extract.cpp +++ b/PE/extract.cpp @@ -1,83 +1,83 @@ -#include <Main.h> -#include <Input.h> -#include <Output.h> - -#define INDEX 0x838da - -#define N1 100 -#define N2 600 - -CODE_BEGINS -int index1[N1]; -int index2[N2]; - -virtual int startup() throw (GeneralException) { - Input * s; - Output * f; - short int t, b; - int n1 = 0, n2 = 0, i, j, size; - String fn; - char buff[2048]; - - verbosity = M_INFO; - - s = new Input("slus_006.62"); - - s->seek(INDEX); - - while (1) { - t = s->readU16(); - if (!t) - break; - index1[n1++] = t; - printm(M_INFO, "I1 - %3i - %4i\n", n1, t); - } - - b = index1[n1 - 1]; - - s->seek(6, SEEK_CUR); - - while (1) { - s->read(&t, 2); - if (!t) - break; - index2[n2++] = t + b; - printm(M_INFO, "I2 - %3i - %4i\n", n2, t); - } - - delete s; - - s = new Input("pe.img"); - - for (i = 0; i < (n1 - 1); i++) { - fn.set("dump/%04i.out", i); - if (!(index1[i + 1] - index1[i])) - continue; - f = new Output(fn); - printm(M_INFO, "Dumping %3i sectors at %4i (%8i) into " + fn + "\n", index1[i + 1] - index1[i], index1[i], index1[i] * 2048); - s->seek(index1[i] * 2048); - for (j = index1[i]; j < index1[i + 1]; j++) { - s->read(buff, 2048); - f->write(buff, 2048); - } - delete f; - } - - for (i = 0; i < (n2 - 1); i++) { - fn.set("musics/song-%04i.out", i); - if (!(index2[i + 1] - index2[i])) - continue; - f = new Output(fn); - printm(M_INFO, "Music - Dumping %3i sectors at %4i into " + fn + "\n", index2[i + 1] - index2[i], index2[i]); - s->seek(index2[i] * 2048); - for (j = index2[i]; j < index2[i + 1]; j++) { - s->read(buff, 2048); - f->write(buff, 2048); - } - delete f; - } - delete s; - - return 0; -} -CODE_ENDS +#include <Main.h>
+#include <Input.h>
+#include <Output.h>
+
+#define INDEX 0x838da
+
+#define N1 100
+#define N2 600
+
+CODE_BEGINS
+int index1[N1];
+int index2[N2];
+
+virtual int startup() throw (GeneralException) {
+ Input * s;
+ Output * f;
+ short int t, b;
+ int n1 = 0, n2 = 0, i, j, size;
+ String fn;
+ char buff[2048];
+
+ verbosity = M_INFO;
+
+ s = new Input("slus_006.62");
+
+ s->seek(INDEX);
+
+ while (1) {
+ t = s->readU16();
+ if (!t)
+ break;
+ index1[n1++] = t;
+ printm(M_INFO, "I1 - %3i - %4i\n", n1, t);
+ }
+
+ b = index1[n1 - 1];
+
+ s->seek(6, SEEK_CUR);
+
+ while (1) {
+ s->read(&t, 2);
+ if (!t)
+ break;
+ index2[n2++] = t + b;
+ printm(M_INFO, "I2 - %3i - %4i\n", n2, t);
+ }
+
+ delete s;
+
+ s = new Input("pe.img");
+
+ for (i = 0; i < (n1 - 1); i++) {
+ fn.set("dump/%04i.out", i);
+ if (!(index1[i + 1] - index1[i]))
+ continue;
+ f = new Output(fn);
+ printm(M_INFO, "Dumping %3i sectors at %4i (%8i) into " + fn + "\n", index1[i + 1] - index1[i], index1[i], index1[i] * 2048);
+ s->seek(index1[i] * 2048);
+ for (j = index1[i]; j < index1[i + 1]; j++) {
+ s->read(buff, 2048);
+ f->write(buff, 2048);
+ }
+ delete f;
+ }
+
+ for (i = 0; i < (n2 - 1); i++) {
+ fn.set("musics/song-%04i.out", i);
+ if (!(index2[i + 1] - index2[i]))
+ continue;
+ f = new Output(fn);
+ printm(M_INFO, "Music - Dumping %3i sectors at %4i into " + fn + "\n", index2[i + 1] - index2[i], index2[i]);
+ s->seek(index2[i] * 2048);
+ for (j = index2[i]; j < index2[i + 1]; j++) {
+ s->read(buff, 2048);
+ f->write(buff, 2048);
+ }
+ delete f;
+ }
+ delete s;
+
+ return 0;
+}
+CODE_ENDS
|