From 50f0dd331f8168fb5b2cd60c70178fad627b7fb6 Mon Sep 17 00:00:00 2001 From: pixel Date: Sat, 27 Nov 2004 21:44:15 +0000 Subject: Large dos2unix commit... --- PE/extract-various.cpp | 330 ++++++++++++++++++++++++------------------------- 1 file changed, 165 insertions(+), 165 deletions(-) (limited to 'PE/extract-various.cpp') diff --git a/PE/extract-various.cpp b/PE/extract-various.cpp index 6f02fba..cd0d8e1 100644 --- a/PE/extract-various.cpp +++ b/PE/extract-various.cpp @@ -1,165 +1,165 @@ -#include -#include -#include -#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) << "\n"; - break; - case 0xff: - (*s) << "\n\n"; - c++; - break; - default: - (*s) << String().set("", 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) << "\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\n"; - c++; - changed = 1; - break; - default: - (*s) << String().set("", 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 +#include +#include +#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) << "\n"; + break; + case 0xff: + (*s) << "\n\n"; + c++; + break; + default: + (*s) << String().set("", 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) << "\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\n"; + c++; + changed = 1; + break; + default: + (*s) << String().set("", 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 -- cgit v1.2.3