Esempio n. 1
0
        public bool save(string saveFilePath)
        {
            mem m = new mem();

            for (ushort i = 0; i < saveGame.Length; i++)
            {
                saveGame[i].data = getData(m, saveGame[i]);
            }
            saveFilePath += "\\" + m.getString(0x1CAA4).ToLower();
            writeFile(saveFilePath, saveGame);
            return(true);
        }
Esempio n. 2
0
 private byte[] getData(mem m, Item item)
 {
     //If fixedValue
     if (0 == item.memoryOffsetStart)
     {
         return(getConstant(item));
     }
     //If Filename - if end offset is 0 and we have a start object this is the filename
     if (item.memoryOffsetEnd < item.memoryOffsetStart)
     {
         return(getFilename(m, item));
     }
     if (0 != item.memoryOffsetStart && 0 != item.memoryOffsetEnd)
     {
         return(getByteArray(m, item));
     }
     return(null);
 }
Esempio n. 3
0
        private byte[] getByteArray(mem m, Item item)
        {
            byte arraySize = (byte)((item.fileOffsetEnd - item.fileOffsetStart) + 1); //(11 - 1 = 10, we need to be inclusive)

            return(m.getByteArray(item.memoryOffsetStart, arraySize));
        }
Esempio n. 4
0
 private byte[] getFilename(mem m, Item item)
 {
     return(m.getByteArrayNull(item.memoryOffsetStart));
 }