Difference between revisions of "DAT (Ever17)"

From Game Research Wiki
Jump to navigation Jump to search
Line 28: Line 28:


Notes for 'wallpaper.dat'
Notes for 'wallpaper.dat'
Extracting images straight from the container file will produce broken images. There is nothing wrong with the extraction process but rather the files themselves. Starting from offset 4352 and ending at 4608 in every single JPG, this 256 byte has been modified in some way.
The files inside this archive appear to have been processed before put inside the archive. Every *.JPG file has a 256 byte chunk of data from offset 4352 to 4608 (base 10) that differs from the same file that is saved from the in-game wallpaper menu (special features). This effectively breaks/corrupts the picture. To fix this , you have to subtract each byte in the obstructed area by a specific number, which is not static for each byte and is different for each picture. This array of difference numbers is calculate by first adding the filename's characters together (think base 16/hexadecimal), and truncate the number to just 8-bits/1 Byte. This is the first difference number of the 256 needed to be generated. The rest are generated using a series of calculations using the previously generated number.
 
There is a subroutine in the EXE that will take 1 byte from the JPG that is stored in memory, subtracted it by a number, then put it back. It does this 256 times, or the whole 256 byte chunk of data that is obstructed and only for locations between 4352 and 4608. The number that is subtracted from the raw value is not the same for each byte.
 
Subtraction numbers are generated by adding up the 14 characters in the file name and using only 8-bits of the result (such as if the total amount ended up needing 2 bytes to display, it just uses one). This is the first difference number out of 256. The next difference number, and the rest of the difference numbers for that matter, are generated by using the previous number in a series of calculations.


'a' starts off as the value of the previous number.
'a' starts off as the value of the previous number.
Line 45: Line 41:
| 3|| a = a+(d*4)+1243
| 3|| a = a+(d*4)+1243
|}
|}
Yay for dissemblers and debuggers? :P


Current task-> Rewrite archive tool for packing and unpacking. Fix flaws in wallpaper fix tool. Also think about renamming wallpaper fix tool if other files extracted show same thing, such as scripts.
Current task-> Rewrite archive tool for packing and unpacking. Fix flaws in wallpaper fix tool. Also think about renamming wallpaper fix tool if other files extracted show same thing, such as scripts.

Revision as of 06:13, 15 July 2014


Seen/used in the follow game(s):

  • Ever17

Structure

Header
Size Content Description
4Bytes Magic/ID
4Bytes File Count
8Bytes 0x00 Filler
Index
Size Content Description
4Bytes Offset Starts from zero.
4Bytes File Size Stored value is actual size doubled
24Bytes File name

Notes for 'wallpaper.dat' The files inside this archive appear to have been processed before put inside the archive. Every *.JPG file has a 256 byte chunk of data from offset 4352 to 4608 (base 10) that differs from the same file that is saved from the in-game wallpaper menu (special features). This effectively breaks/corrupts the picture. To fix this , you have to subtract each byte in the obstructed area by a specific number, which is not static for each byte and is different for each picture. This array of difference numbers is calculate by first adding the filename's characters together (think base 16/hexadecimal), and truncate the number to just 8-bits/1 Byte. This is the first difference number of the 256 needed to be generated. The rest are generated using a series of calculations using the previously generated number.

'a' starts off as the value of the previous number.

Order Expression
1 d = a + (a*2)
2 d = d + (d*8)
3 a = a+(d*4)+1243

Yay for dissemblers and debuggers? :P

Current task-> Rewrite archive tool for packing and unpacking. Fix flaws in wallpaper fix tool. Also think about renamming wallpaper fix tool if other files extracted show same thing, such as scripts.