From bc52a43651cbf635cc895e9463c53d0a2e44ff1e Mon Sep 17 00:00:00 2001 From: alexeevdv Date: Fri, 13 Feb 2015 22:31:52 +0300 Subject: [PATCH] Dump feature implemented --- .gitignore | 12 +++++++ FalloutScript.cpp | 30 +++++++++++------ FalloutScriptDecompile.cpp | 32 ++++++++++++------ Hacks/CArchive.cpp | 3 ++ Hacks/CFile.cpp | 16 ++++----- Hacks/CFile.h | 16 +++------ Hacks/CMap.h | 5 +-- Hacks/CString.cpp | 7 +++- Hacks/CString.h | 1 + Hacks/Types.h | 22 ++++++------ Namespace.cpp | 41 ++++++++++++++--------- Opcode.h | 23 ++++++------- OpcodeAttributes.cpp | 13 +++++--- ProcTable.cpp | 19 +++++++---- StartupCode.cpp | 68 +++++++++++++++++--------------------- StartupCode.h | 7 ++-- Utility.cpp | 4 +-- main.cpp | 15 ++++++--- 18 files changed, 193 insertions(+), 141 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..816fa66 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +CMakeFiles +CMakeCache.txt +CMakeLists.txt.user +Makefile +*.dump +*.int +*.ssl +*.cmake +*.cbp +*.exe +int2ssl + diff --git a/FalloutScript.cpp b/FalloutScript.cpp index 9c9a67d..0155fff 100644 --- a/FalloutScript.cpp +++ b/FalloutScript.cpp @@ -70,40 +70,48 @@ void CFalloutScript::Serialize(CArchive& ar) // Jump to 'start' procedure printf(" Check \"Jump to \'start\' procedure\" / \"Jump to end of statup code\"\n"); - if (!HeaderTail.IsEmpty()) { + if (!HeaderTail.IsEmpty()) + { INT_PTR nIndexOfStart = GetIndexOfProc("start"); ULONG ulStartProcAddress = (nIndexOfStart != -1) ? m_ProcTable[nIndexOfStart].m_ulBodyOffset : 18; opcode = HeaderTail.at(HeaderTail.GetUpperBound()); - if (opcode.GetOperator() == COpcode::O_JMP) { + if (opcode.GetOperator() == COpcode::O_JMP) + { HeaderTail.RemoveAt(HeaderTail.GetUpperBound()); - if (HeaderTail.IsEmpty()) { + if (HeaderTail.IsEmpty()) + { printf("\n"); printf("Warning: Omitted address of jump\n"); printf("\n"); } - else { + else + { opcode = HeaderTail.at(HeaderTail.GetUpperBound()); - if (opcode.GetOperator() == COpcode::O_INTOP) { + if (opcode.GetOperator() == COpcode::O_INTOP) + { HeaderTail.RemoveAt(HeaderTail.GetUpperBound()); - if (opcode.GetArgument() != ulStartProcAddress) { + if (opcode.GetArgument() != ulStartProcAddress) + { printf("\n"); printf("Warning: Invalid jump address\n"); printf("\n"); } } - else { + else + { printf("\n"); printf("Warning: Invalid opcode for jump addres\n"); printf("\n"); } } } - else { + else + { printf("\n"); printf("Warning: Omitted \"Jump to \'start\' procedure\" / \"Jump to end of statup code\"\n"); printf("\n"); @@ -188,14 +196,16 @@ void CFalloutScript::Serialize(CArchive& ar) CNode node; - for(INT_PTR i = 0; i < m_ProcTable.GetSize(); i++) { + for(INT_PTR i = 0; i < m_ProcTable.GetSize(); i++) + { printf(" Procedure: %d\r", i); ULONG ulOffset = m_ProcTable[i].m_ulBodyOffset; ULONG ulSize = m_ProcTable.GetSizeOfProc(i); ar.Flush(); ar.GetFile()->Seek(ulOffset, CFile::begin); - while(ulOffset < m_ProcTable[i].m_ulBodyOffset + ulSize) { + while(ulOffset < m_ProcTable[i].m_ulBodyOffset + ulSize) + { node.m_Opcode.Serialize(ar); node.m_ulOffset = ulOffset; m_ProcBodies.at(i).Add(node); diff --git a/FalloutScriptDecompile.cpp b/FalloutScriptDecompile.cpp index 2082739..5e87c90 100644 --- a/FalloutScriptDecompile.cpp +++ b/FalloutScriptDecompile.cpp @@ -46,7 +46,8 @@ void CFalloutScript::ProcessCode() printf(" Building execution tree\n"); - for(INT_PTR i = 0; i < m_ProcTable.GetSize(); i++) { + for(INT_PTR i = 0; i < m_ProcTable.GetSize(); i++) + { printf(" Procedure: %d\r", i); BuildTree(m_ProcBodies.at(i)); } @@ -368,22 +369,25 @@ ULONG CFalloutScript::BuildTreeBranch(CNodeArray& NodeArray, ULONG nStartIndex, COpcode::COpcodeAttributes opcodeAttributes; INT_PTR j; - for (j = nStartIndex; (j < NodeArray.GetSize() && NodeArray.at(j).m_ulOffset < ulEndOffset); j++) { + for (j = nStartIndex; (j < NodeArray.GetSize() && NodeArray.at(j).m_ulOffset < ulEndOffset); j++) + { wOperator = NodeArray.at(j).m_Opcode.GetOperator(); ulArgument = NodeArray.at(j).m_Opcode.GetArgument(); opcodeAttributes = NodeArray.at(j).m_Opcode.GetAttributes(); nNumOfArgs = INT_PTR(opcodeAttributes.m_ulNumArgs); - switch(wOperator) { + switch(wOperator) + { case COpcode::O_FETCH_EXTERNAL: case COpcode::O_STORE_EXTERNAL: - { + { INT_PTR nExtVarNameNodeIndex = NextNodeIndex(NodeArray, j, -1); WORD wOpeartor = NodeArray.at(nExtVarNameNodeIndex).m_Opcode.GetOperator(); ULONG ulArgument = NodeArray.at(nExtVarNameNodeIndex).m_Opcode.GetArgument(); - if ((wOpeartor != COpcode::O_STRINGOP) && (wOpeartor != COpcode::O_INTOP)) { + if ((wOpeartor != COpcode::O_STRINGOP) && (wOpeartor != COpcode::O_INTOP)) + { printf("Error: Invalid reference to external variable\n"); AfxThrowUserException(); } @@ -453,17 +457,22 @@ ULONG CFalloutScript::BuildTreeBranch(CNodeArray& NodeArray, ULONG nStartIndex, } // Move arguments - for(INT_PTR k = 0; k < nNumOfArgs; k++) { - if (k < nOmittedArgStartIndex) { + for(INT_PTR k = 0; k < nNumOfArgs; k++) + { + if (k < nOmittedArgStartIndex) + { NodeArray.at(j).m_Arguments.InsertAt(0, NodeArray.at(j - 1)); NodeArray.RemoveAt(j - 1); j--; } - else { - if (g_bInsOmittedArgsBackward) { + else + { + if (g_bInsOmittedArgsBackward) + { NodeArray.at(j).m_Arguments.Add(CNode(CNode::TYPE_OMITTED_ARGUMENT)); } - else { + else + { NodeArray.at(j).m_Arguments.InsertAt(0, CNode(CNode::TYPE_OMITTED_ARGUMENT)); } } @@ -496,7 +505,8 @@ ULONG CFalloutScript::BuildTreeBranch(CNodeArray& NodeArray, ULONG nStartIndex, void CFalloutScript::BuildTree(CNodeArray& NodeArray) { - if (NodeArray.GetSize() > 0) { + if (NodeArray.GetSize() > 0) + { BuildTreeBranch(NodeArray, 0, NodeArray.at(NodeArray.GetSize() - 1).m_ulOffset + COpcode::OPERATOR_SIZE); } } diff --git a/Hacks/CArchive.cpp b/Hacks/CArchive.cpp index 50dc152..eb56072 100644 --- a/Hacks/CArchive.cpp +++ b/Hacks/CArchive.cpp @@ -1,5 +1,7 @@ #include "CArchive.h" +#include + CArchive::CArchive(CFile* file, unsigned int mode) { _file = file; @@ -16,6 +18,7 @@ CFile* CArchive::GetFile() void CArchive::WriteString(const char * value) { + std::cout << _file->_ostream.is_open() << std::endl; _file->_ostream << value; } diff --git a/Hacks/CFile.cpp b/Hacks/CFile.cpp index 3ce2b1c..d22bd4d 100644 --- a/Hacks/CFile.cpp +++ b/Hacks/CFile.cpp @@ -8,16 +8,18 @@ CFile::CFile() bool CFile::Open(CString name, unsigned int mode) { + _mode = (mode & modeRead ? modeRead : modeWrite); + switch (_mode) { - case modeRead: + case modeWrite: + _ostream.open(name.c_str(), std::fstream::out | std::fstream::trunc); + return _ostream.is_open(); + break; + default: _istream.open(name.c_str(), std::ios_base::in | std::ios_base::binary); return _istream.is_open(); break; - - case modeWrite: - _ostream.open(name.c_str(), std::ios_base::out | std::ios_base::ate); - return _ostream.is_open(); } } @@ -72,7 +74,3 @@ ULONG CFile::GetLength() return size; } -CStdioFile::CStdioFile() : CFile() -{ - -} diff --git a/Hacks/CFile.h b/Hacks/CFile.h index 21be967..58e707b 100644 --- a/Hacks/CFile.h +++ b/Hacks/CFile.h @@ -17,10 +17,10 @@ class CFile std::ofstream _ostream; static const unsigned int modeRead = 1; static const unsigned int modeWrite = 2; - static const unsigned int shareDenyWrite = 3; - static const unsigned int modeCreate = 4; - static const unsigned int typeText = 5; - static const unsigned int begin = 6; + static const unsigned int shareDenyWrite = 4; + static const unsigned int modeCreate = 8; + static const unsigned int typeText = 16; + static const unsigned int begin = 32; CFile(); @@ -32,12 +32,4 @@ class CFile }; -class CStdioFile : public CFile -{ -protected: - unsigned int _mode = 2; -public: - CStdioFile(); -}; - #endif // CFILE_H diff --git a/Hacks/CMap.h b/Hacks/CMap.h index 55b35ed..17357e4 100644 --- a/Hacks/CMap.h +++ b/Hacks/CMap.h @@ -36,9 +36,10 @@ class CMap bool Lookup(ULONG offset, C& value) const { - if (_map.find(offset) != _map.end()) + auto it = _map.find(offset); + if (it != _map.end()) { - value = _map.at(offset); + value = it->second; return true; } return false; diff --git a/Hacks/CString.cpp b/Hacks/CString.cpp index f6add18..5a22843 100644 --- a/Hacks/CString.cpp +++ b/Hacks/CString.cpp @@ -6,6 +6,11 @@ CString::CString() { } +CString::CString(char value) +{ + _string.push_back(value); +} + CString::CString(std::string string) { _string = string; @@ -78,7 +83,7 @@ void CString::Format(const char *format, ...) va_list args; va_start( args, format ); - size = sprintf(buff, format, args); + size = vsprintf(buff, format, args); std::string stroka(buff, size); _string = stroka; } diff --git a/Hacks/CString.h b/Hacks/CString.h index 83de9f7..15068ee 100644 --- a/Hacks/CString.h +++ b/Hacks/CString.h @@ -12,6 +12,7 @@ protected: std::string _string; public: CString(); + CString(char value); CString(std::string string); CString(const CString& cstring); diff --git a/Hacks/Types.h b/Hacks/Types.h index b3a7778..58f649e 100644 --- a/Hacks/Types.h +++ b/Hacks/Types.h @@ -4,17 +4,19 @@ #include #include -typedef char BYTE; -typedef const char * LPCTSTR; -typedef char * LPTSTR; -typedef unsigned int ULONG; -typedef uint16_t WORD; -typedef uint32_t DWORD; +typedef int BOOL; +typedef unsigned char BYTE; +typedef const char* LPCSTR; +typedef LPCSTR LPCTSTR; +typedef char* LPSTR; +typedef LPSTR LPTSTR; +typedef unsigned short WORD; +typedef unsigned long DWORD; typedef unsigned int UINT; -typedef bool BOOL; typedef char TCHAR; -#define TRUE true -#define FALSE false -typedef size_t INT_PTR; +#define TRUE 1 +#define FALSE 0 +typedef int INT_PTR; +typedef unsigned int ULONG; #endif // TYPES_H diff --git a/Namespace.cpp b/Namespace.cpp index de31b05..31b0dd0 100644 --- a/Namespace.cpp +++ b/Namespace.cpp @@ -36,18 +36,22 @@ void CNamespace::Serialize(CArchive& ar) ULONG ulLength; - if (ReadMSBULong(ar, ulLength) != 4) { + if (ReadMSBULong(ar, ulLength) != 4) + { printf("Error: Unable read length of namespace\n"); AfxThrowUserException(); } - if (ulLength != 0xFFFFFFFF) { + if (ulLength != 0xFFFFFFFF) + { ULONG ulTotalRead = 0; WORD wLengthOfString; - CString strNewString; - LPTSTR lpszNewString; + LPTSTR lpszNewString; + + while(ulTotalRead < ulLength) + { + CString strNewString; - while(ulTotalRead < ulLength) { if (ReadMSBWord(ar, wLengthOfString) != 2) { printf("Error: Unable read length of string\n"); AfxThrowUserException(); @@ -72,17 +76,19 @@ void CNamespace::Serialize(CArchive& ar) AfxThrowUserException(); } - strNewString.ReleaseBuffer(); + std::string tmpString(lpszNewString); + strNewString = tmpString.c_str();//.ReleaseBuffer(); + -/* // Convert Nongraphic Characters to Escape sequence CString strNonGraph("\\\a\b\f\n\r\t\""); CString strEscape("\\abfnrt\""); - for(int i = 0; i < strNonGraph.GetLength(); i++) { - strNewString.Replace(CString(strNonGraph[i]), CString('\\') + strEscape[i]); + for(int i = 0; i < strNonGraph.GetLength(); i++) + { + strNewString.Replace(CString(strNonGraph[i]), CString("\\" + strEscape[i])); } -*/ + m_Map.SetAt(ulTotalRead + 6, strNewString); m_Order.Add(ulTotalRead + 6); @@ -91,7 +97,8 @@ void CNamespace::Serialize(CArchive& ar) ULONG ulTerminator; - if (ReadMSBULong(ar, ulTerminator) != 4) { + if (ReadMSBULong(ar, ulTerminator) != 4) + { printf("Error: Unable read terminator of namespace\n"); AfxThrowUserException(); } @@ -130,11 +137,14 @@ void CNamespace::Dump(CArchive& ar) { CString strOutLine; - if (m_Order.IsEmpty()) { + if (m_Order.IsEmpty()) + { ar.WriteString("Empty\n"); } - else { - for(INT_PTR i = 0; i < m_Order.GetSize(); i++) { + else + { + for(unsigned int i = 0; i < m_Order.GetSize(); i++) + { strOutLine.Format("0x%08X: \"%s\"\n", m_Order.at(i), GetStringByIndex(i).c_str()); ar.WriteString(strOutLine); } @@ -149,7 +159,8 @@ CString CNamespace::operator [] (ULONG ulOffset) const { CString strResult; - if (!m_Map.Lookup(ulOffset, strResult)) { + if (!m_Map.Lookup(ulOffset, strResult)) + { printf("Error: No string at offset 0x%08x\n", ulOffset); AfxThrowUserException(); } diff --git a/Opcode.h b/Opcode.h index b96dcb0..af0e5e8 100644 --- a/Opcode.h +++ b/Opcode.h @@ -1,5 +1,3 @@ -#pragma once - #ifndef OPCODE_H #define OPCODE_H @@ -8,7 +6,8 @@ #include "Hacks/CMap.h" // COpcode -class COpcode : public CObject { +class COpcode +{ public: enum Size { OPERATOR_SIZE = 2, @@ -765,7 +764,8 @@ public: }; // COpcodeAttributes - class COpcodeAttributes { + class COpcodeAttributes + { public: enum Type { TYPE_STATEMENT, @@ -778,22 +778,21 @@ public: }; public: - COpcodeAttributes(LPCTSTR lpszMnemonic = "", LPCTSTR lpszName = "", ULONG ulNumArgs = 0, - Type type = TYPE_STATEMENT, Category category = CATEGORY_PREFIX, ULONG *procArgs = NULL, ULONG numProcArgs = 0); + COpcodeAttributes(std::string mnemonic = "", + std::string name = "", + ULONG ulNumArgs = 0, + Type type = TYPE_STATEMENT, + Category category = CATEGORY_PREFIX, + ULONG* procArgs = NULL, + ULONG numProcArgs = 0); COpcodeAttributes(const COpcodeAttributes& attributes); - - public: COpcodeAttributes& operator = (const COpcodeAttributes& attributes); - - public: void InitAttributes(); public: CString m_strMnemonic; - CString m_strName; ULONG m_ulNumArgs; - Type m_Type; Category m_Category; ULONG *m_procArgs; diff --git a/OpcodeAttributes.cpp b/OpcodeAttributes.cpp index ea40858..e7c016a 100644 --- a/OpcodeAttributes.cpp +++ b/OpcodeAttributes.cpp @@ -10,10 +10,15 @@ // COpcode::COpcodeAttributes -COpcode::COpcodeAttributes::COpcodeAttributes(LPCTSTR lpszMnemonic, LPCTSTR lpszName, ULONG ulNumArgs, - Type type, Category category, ULONG *procArgs, ULONG numProcArgs) : - m_strMnemonic(lpszMnemonic), - m_strName(lpszName), +COpcode::COpcodeAttributes::COpcodeAttributes(std::string mnemonic, + std::string name, + ULONG ulNumArgs, + Type type, + Category category, + ULONG *procArgs, + ULONG numProcArgs) : + m_strMnemonic(mnemonic), + m_strName(name), m_ulNumArgs(ulNumArgs), m_Type(type), m_Category(category), diff --git a/ProcTable.cpp b/ProcTable.cpp index 3d36af3..357cce7 100644 --- a/ProcTable.cpp +++ b/ProcTable.cpp @@ -89,18 +89,22 @@ void CProcDescriptor::Dump(CArchive& ar) CString strOutLine; CString strType; - if (m_ulType != 0x00000000) { + if (m_ulType != 0x00000000) + { strType = "( "; - if (m_ulType & P_TIMED) { + if (m_ulType & P_TIMED) + { strType += "timed "; } - if (m_ulType & P_CONDITIONAL) { + if (m_ulType & P_CONDITIONAL) + { strType += "conditional "; } - if (m_ulType & P_IMPORT) { + if (m_ulType & P_IMPORT) + { strType += "import "; } @@ -191,7 +195,8 @@ void CProcTable::Serialize(CArchive& ar) ulRead = ReadMSBULong(ar, ulSizeOfTable); - if (ulRead != sizeof(ulSizeOfTable)) { + if (ulRead != sizeof(ulSizeOfTable)) + { printf("Error: Unable read size of procedures table\n"); AfxThrowUserException(); } @@ -285,8 +290,10 @@ void CProcTable::Dump(CArchive& ar) { CString strOutLine; - for(INT_PTR i = 0; i < m_Table.GetSize(); i++) { + for(unsigned int i = 0; i < m_Table.GetSize(); i++) + { strOutLine.Format("======== Procedure %d ========\n", i); + ar.WriteString(strOutLine); m_Table.at(i).Dump(ar); ar.WriteString("\n"); diff --git a/StartupCode.cpp b/StartupCode.cpp index 21309b0..805bb3d 100644 --- a/StartupCode.cpp +++ b/StartupCode.cpp @@ -1,11 +1,6 @@ -// StartupCode.cpp : implementation file -// - #include "stdafx.h" #include "StartupCode.h" -// CStartupCode - CStartupCode::CStartupCode() { } @@ -16,39 +11,36 @@ CStartupCode::~CStartupCode() void CStartupCode::Serialize(CArchive& ar) { - //if (ar.IsStoring()) { - if (false) + WORD wExpectOpcodes[17] = { + COpcode::O_CRITICAL_START, + COpcode::O_INTOP, + COpcode::O_D_TO_A, + COpcode::O_INTOP, + COpcode::O_JMP, + COpcode::O_EXIT_PROG, + COpcode::O_POP, + COpcode::O_POP_FLAGS_RETURN, + COpcode::O_POP, + COpcode::O_POP_FLAGS_EXIT, + COpcode::O_POP, + COpcode::O_POP_FLAGS_RETURN_EXTERN, + COpcode::O_POP, + COpcode::O_POP_FLAGS_EXIT_EXTERN, + COpcode::O_POP_FLAGS_RETURN_VAL_EXTERN, + COpcode::O_POP_FLAGS_RETURN_VAL_EXIT, + COpcode::O_POP_FLAGS_RETURN_VAL_EXIT_EXTERN + }; + + for(INT_PTR i = 0; i < 17; i++) { - // ASSERT(FALSE); - } - else { - WORD wExpectOpcodes[17] = { - COpcode::O_CRITICAL_START, - COpcode::O_INTOP, - COpcode::O_D_TO_A, - COpcode::O_INTOP, - COpcode::O_JMP, - COpcode::O_EXIT_PROG, - COpcode::O_POP, - COpcode::O_POP_FLAGS_RETURN, - COpcode::O_POP, - COpcode::O_POP_FLAGS_EXIT, - COpcode::O_POP, - COpcode::O_POP_FLAGS_RETURN_EXTERN, - COpcode::O_POP, - COpcode::O_POP_FLAGS_EXIT_EXTERN, - COpcode::O_POP_FLAGS_RETURN_VAL_EXTERN, - COpcode::O_POP_FLAGS_RETURN_VAL_EXIT, - COpcode::O_POP_FLAGS_RETURN_VAL_EXIT_EXTERN - }; + if (i == 1) + { + m_Code[i].Expect(ar, wExpectOpcodes[i], TRUE, 18); + } + else + { + m_Code[i].Expect(ar, wExpectOpcodes[i]); + } + } - for(INT_PTR i = 0; i < 17; i++) { - if (i == 1) { - m_Code[i].Expect(ar, wExpectOpcodes[i], TRUE, 18); - } - else { - m_Code[i].Expect(ar, wExpectOpcodes[i]); - } - } - } } diff --git a/StartupCode.h b/StartupCode.h index 02d2e3f..11b8b02 100644 --- a/StartupCode.h +++ b/StartupCode.h @@ -7,17 +7,16 @@ #include "Opcode.h" // CStartupCode -class CStartupCode : public CObject { +class CStartupCode +{ public: + enum Defaults { c_nDefaultSize = 42 }; -public: CStartupCode(); virtual ~CStartupCode(); - -public: virtual void Serialize(CArchive& ar); private: diff --git a/Utility.cpp b/Utility.cpp index 2d5a84e..2b82fa9 100644 --- a/Utility.cpp +++ b/Utility.cpp @@ -4,13 +4,13 @@ UINT ReadMSBWord(CArchive& ar, WORD& wValue) { - BYTE* pBuffer = reinterpret_cast(&wValue); + char* pBuffer = reinterpret_cast(&wValue); return (ar.Read(pBuffer + 1, 1) + ar.Read(pBuffer, 1)); } UINT ReadMSBULong(CArchive& ar, ULONG& ulValue) { - BYTE* pBuffer = reinterpret_cast(&ulValue); + char* pBuffer = reinterpret_cast(&ulValue); return (ar.Read(pBuffer + 3, 1) + ar.Read(pBuffer + 2, 1) + ar.Read(pBuffer + 1, 1) + ar.Read(pBuffer, 1)); } diff --git a/main.cpp b/main.cpp index 0adac22..3676f89 100644 --- a/main.cpp +++ b/main.cpp @@ -58,13 +58,16 @@ int main(int argc, char* argv[]) //} CFile fileInput; - CStdioFile fileOutput; + CFile fileOutput; //if (fileInput.Open(g_strInputFileName, CFile::modeRead | CFile::shareDenyWrite)) { - if (fileInput.Open(CString("BECA.int"), CFile::modeRead | CFile::shareDenyWrite)) { + if (fileInput.Open(CString("BECA.int"), CFile::modeRead | CFile::shareDenyWrite)) + { //if (fileOutput.Open(g_strOutputFileName, CFile::modeCreate | CFile::modeWrite | CFile::typeText | CFile::shareDenyWrite)) { - if (fileOutput.Open(CString("BECA.int.ssl"), CFile::modeCreate | CFile::modeWrite | CFile::typeText | CFile::shareDenyWrite)) { - try { + if (fileOutput.Open(CString("BECA.int.ssl"), CFile::modeCreate | CFile::modeWrite | CFile::typeText | CFile::shareDenyWrite)) + { + try + { CArchive arInput(&fileInput, CArchive::load); CFalloutScript Script; @@ -76,7 +79,9 @@ int main(int argc, char* argv[]) CArchive arOutput(&fileOutput, CArchive::store); - if (g_bDump) { + if (g_bDump) + //if (true) + { printf("Dumping...\n", g_strInputFileName.c_str()); Script.Dump(arOutput);