I need help revising this code, i've tryed to get it to work but nothings worked for me. Any help?
Code:#include <iostream> #include <fstream> using namespace std; int main() { char pnt; char *name; char *data; int x = 0, index, endex = 0; long size, offset; ifstream hed("datap.hed", ios::in | ios::binary); ifstream wad("datap.wad", ios::in | ios::binary); while(! hed.eof()) { hed.seekg(endex); while(pnt!=0x5C) hed.read(&pnt, 1); index = hed.tellg(); while(pnt!=0x00) { hed.read(&pnt, 1); name[x] = pnt; x++; } endex = hed.tellg(); if(strlen(name) > 4) { hed.seekg(index-9); hed.read(reinterpret_cast<char*>(&offset), 4); wad.seekg(offset); hed.read(reinterpret_cast<char*>(&size), 4); data = new char[size]; wad.read(data,size); ofstream extract(name, ios::out | ios::binary); extract.write(data, size); extract.close(); data = 0; cout << "\n" << name; } else endex++; x = 0; } wad.close(); hed.close(); return 0; }



LinkBack URL
About LinkBacks


