summaryrefslogtreecommitdiff
path: root/PE/extract-various.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'PE/extract-various.cpp')
-rw-r--r--PE/extract-various.cpp330
1 files changed, 165 insertions, 165 deletions
diff --git a/PE/extract-various.cpp b/PE/extract-various.cpp
index cd0d8e1..6f02fba 100644
--- a/PE/extract-various.cpp
+++ b/PE/extract-various.cpp
@@ -1,165 +1,165 @@
-#include <Main.h>
-#include <Input.h>
-#include <Output.h>
-#include "table.h"
-
-CODE_BEGINS
-int pos[50];
-
-virtual int startup() throw (GeneralException) {
- Input * f = new Input("dump/0000.out");
- Output * s = new Output("various/various.txt");
- unsigned int c, b, i, j, size, changed;
- unsigned short p, t;
- String fn;
-
- verbosity = M_INFO;
-
- for (c = 0; c < 6;) {
- b = f->readU8();
- if (b <= MAXCHAR) {
- s->writeU8(table[b]);
- } else {
- switch(b) {
- case 0xfe:
- b = f->readU8();
- (*s) << "<PT" << b << ">\n";
- break;
- case 0xff:
- (*s) << "\n<CLOSE>\n";
- c++;
- break;
- default:
- (*s) << String().set("<UNK %02X>", b);
- }
- }
- }
-
- delete f;
- delete s;
-
- f = new Input("dump/0001.out");
-
- c = f->readU32();
-
- for (i = 0; i < c; i++) {
- pos[i] = f->readU32();
- }
- pos[c] = f->GetSize();
-
- for (i = 0; i < c; i++) {
- f->seek(pos[i]);
- size = pos[i + 1] - pos[i];
- fn.set("various/0001/%02i.out", i);
- s = new Output(fn);
- for (j = 0; j < size; j++) {
- b = f->readU8();
- s->writeU8(b);
- }
- delete s;
- }
-
- delete f;
-
-
- f = new Input("various/0001/00.out");
-
- c = f->readU32();
-
- for (i = 0; i < c; i++) {
- pos[i] = f->readU32();
- }
- pos[c] = f->GetSize();
-
- for (i = 0; i < c; i++) {
- f->seek(pos[i]);
- size = pos[i + 1] - pos[i];
- fn.set("various/0001/00/%01i.out", i);
- s = new Output(fn);
- for (j = 0; j < size; j++) {
- b = f->readU8();
- s->writeU8(b);
- }
- delete s;
- }
-
- delete f;
-
- for (i = 0; i < 4; i++) {
- fn.set("various/0001/00/%i.out", i);
- f = new Input(fn);
- fn.set("various/menus%i.txt", i);
- s = new Output(fn);
-
- p = f->readU16();
- f->seek(p * 2, SEEK_CUR);
- (*s) << "<NBPTS " << p << ">\n";
-
- changed = 1;
-
- for (c = 0; c < p;) {
- if (changed) {
- f->seek(c * 2 + 2);
- t = f->readU16();
- f->seek(t);
- }
- if (!(b = f->readU8()) && changed)
- break;
-
- changed = 0;
-
- if (b <= MAXCHAR) {
- s->writeU8(table[b]);
- } else {
- switch(b) {
- case 0xff:
- (*s) << "\n<CLOSE>\n";
- c++;
- changed = 1;
- break;
- default:
- (*s) << String().set("<UNK %02X>", b);
- }
- }
- }
-
- delete f;
- delete s;
- }
-
- f = new Input("dump/0075.out");
-
- for (i = 0; i < 4; i++) {
- Uint32 pos, pos2, size;
-
- f->seek(i * 4);
- pos = f->readU32();
- pos2 = f->readU32();
- f->seek(pos);
-
- if (i == 3) {
- size = f->readU32();
- f->seek(pos);
- } else {
- size = pos2 - pos;
- }
-
- s = new Output(String().set("75/%i.out", i));
-
- copy(f, s, size);
-
- delete s;
-
- if (i == 1) {
- s = new Output("75/text.txt");
- f->seek(pos);
- extracttext(f, s, size);
- delete s;
- }
- }
-
- delete f;
-
- return 0;
-}
-CODE_ENDS
+#include <Main.h>
+#include <Input.h>
+#include <Output.h>
+#include "table.h"
+
+CODE_BEGINS
+int pos[50];
+
+virtual int startup() throw (GeneralException) {
+ Input * f = new Input("dump/0000.out");
+ Output * s = new Output("various/various.txt");
+ unsigned int c, b, i, j, size, changed;
+ unsigned short p, t;
+ String fn;
+
+ verbosity = M_INFO;
+
+ for (c = 0; c < 6;) {
+ b = f->readU8();
+ if (b <= MAXCHAR) {
+ s->writeU8(table[b]);
+ } else {
+ switch(b) {
+ case 0xfe:
+ b = f->readU8();
+ (*s) << "<PT" << b << ">\n";
+ break;
+ case 0xff:
+ (*s) << "\n<CLOSE>\n";
+ c++;
+ break;
+ default:
+ (*s) << String().set("<UNK %02X>", b);
+ }
+ }
+ }
+
+ delete f;
+ delete s;
+
+ f = new Input("dump/0001.out");
+
+ c = f->readU32();
+
+ for (i = 0; i < c; i++) {
+ pos[i] = f->readU32();
+ }
+ pos[c] = f->GetSize();
+
+ for (i = 0; i < c; i++) {
+ f->seek(pos[i]);
+ size = pos[i + 1] - pos[i];
+ fn.set("various/0001/%02i.out", i);
+ s = new Output(fn);
+ for (j = 0; j < size; j++) {
+ b = f->readU8();
+ s->writeU8(b);
+ }
+ delete s;
+ }
+
+ delete f;
+
+
+ f = new Input("various/0001/00.out");
+
+ c = f->readU32();
+
+ for (i = 0; i < c; i++) {
+ pos[i] = f->readU32();
+ }
+ pos[c] = f->GetSize();
+
+ for (i = 0; i < c; i++) {
+ f->seek(pos[i]);
+ size = pos[i + 1] - pos[i];
+ fn.set("various/0001/00/%01i.out", i);
+ s = new Output(fn);
+ for (j = 0; j < size; j++) {
+ b = f->readU8();
+ s->writeU8(b);
+ }
+ delete s;
+ }
+
+ delete f;
+
+ for (i = 0; i < 4; i++) {
+ fn.set("various/0001/00/%i.out", i);
+ f = new Input(fn);
+ fn.set("various/menus%i.txt", i);
+ s = new Output(fn);
+
+ p = f->readU16();
+ f->seek(p * 2, SEEK_CUR);
+ (*s) << "<NBPTS " << p << ">\n";
+
+ changed = 1;
+
+ for (c = 0; c < p;) {
+ if (changed) {
+ f->seek(c * 2 + 2);
+ t = f->readU16();
+ f->seek(t);
+ }
+ if (!(b = f->readU8()) && changed)
+ break;
+
+ changed = 0;
+
+ if (b <= MAXCHAR) {
+ s->writeU8(table[b]);
+ } else {
+ switch(b) {
+ case 0xff:
+ (*s) << "\n<CLOSE>\n";
+ c++;
+ changed = 1;
+ break;
+ default:
+ (*s) << String().set("<UNK %02X>", b);
+ }
+ }
+ }
+
+ delete f;
+ delete s;
+ }
+
+ f = new Input("dump/0075.out");
+
+ for (i = 0; i < 4; i++) {
+ Uint32 pos, pos2, size;
+
+ f->seek(i * 4);
+ pos = f->readU32();
+ pos2 = f->readU32();
+ f->seek(pos);
+
+ if (i == 3) {
+ size = f->readU32();
+ f->seek(pos);
+ } else {
+ size = pos2 - pos;
+ }
+
+ s = new Output(String().set("75/%i.out", i));
+
+ copy(f, s, size);
+
+ delete s;
+
+ if (i == 1) {
+ s = new Output("75/text.txt");
+ f->seek(pos);
+ extracttext(f, s, size);
+ delete s;
+ }
+ }
+
+ delete f;
+
+ return 0;
+}
+CODE_ENDS