Hello everyone! I apologize in advance for any errors in the text. I am a novice translator and would like to translate the game Nancy Drew: The Final Scene, but I have encountered a problem with the Ciftree file. I can't unpack it no matter what I try. Seriously, I've tried many different methods, including quickbms scripts, and nothing works!
Maybe someone knows how to do this and can help me... I would be very grateful!
Those formats are unique to the Nancy (+TVD) games. Standalone tools don't yet exist to unpack & repack those. (Maybe some old source for old tools are archived somewhere, but according to my search effort, not reachable on the internet today.) To write an instance of those tools is on my hobby todo list! ...and someone else is more than welcome to beat me to it!!
At the moment, in my opinion the ScummVM source code is the best way to learn about the file formats!
Hi:
I'm trying to translate Nancy Drew games too. I found a tool to unpack CIFTREE/CAL/HIS files but I haven't been able to discover format and where text is located, where fonts are and how images are codified.
I used a tool called "RavioliGameTools_v2.10". It works.
I hope it could be usefull and you could share any information if there is any success.
Thanks
After analyzing the NANCY engine source code in SCUMMVM and the hexadecimal contents of the CIFTREE.DAT files, I discovered the following:
- The games NANCY1, NANCY2, NANCY3 through 5, and NANCY6 and later have different CIFTREE.DAT file structures (shown below).
- The contents of the files in this container are stored in PLAIN (value 03) or COMPRESSED (02) format.
- The data is compressed using LZSS and obfuscated.
- In general, they consist of:
+ A 0x32 byte HEADER header containing version information and the number of ENTRY files.
+ A HASH area (which I haven't yet analyzed in detail).
+ An area with the ENTRIES that provide information about how the file contents are stored in the DATA area. + DATA area where the file content is located
+ Files stored as COMPRESSED are generally game images
+ Among the PLAIN files, I've located scene files (S*.) which contain scene information and subtitles in a structure similar to "<i><c1>Nancy ..... text text text.<c0><n><o>"
+ Another interesting PLAIN file is BOOT, which, among other things, seems to prepare the characters from the #FONT graphics files.
I've currently prepared a more or less functional .py tool that extracts the contents of CIFTREE.DAT. [The compressed images aren't yet extracted correctly because I still need to interpret part of the structure of each ENTRY].
I'm working on another tool for the PLAIN files containing the scenes that will classify and allow me to edit the content of each one.
Next, you'll need to reverse the process of reconstructing the CIFTREE.DAT file with the modified content.
STRUCTURE CIFTREE.DAT NANCY 1:
HEADER:
HEADER_START= 0x000000 # HEADER start (0x000000-0x00001D)
HEADER_SIZE = 0x1E # Total header size (30Bytes)
HEADER_SIGNATURE_POS = 0x0 # SIGNATURE position
HEADER_SIGNATURE_SIZE = 0x13 # SIGNATURE size (0x13 = 19Bytes)
HEADER_VERSION = 0x18 # Version (4Bytes)
HEADER_NUM_ENTRY_POS = 0x1C # Position number of ENTRYs (2Bytes)
ENTRY:
ENTRY_START = 0x00081E # Start of ENTRY AREA
ENTRY_SIZE = 0x26 # Size of each ENTRY (0x26 = 38 Bytes)
name = data(0x00) # File name [8 Bytes]
value1 = data(0x08) # Fixed value 0x00 [1 Byte]
index = u16(0x09) # ENTRY index [2 Bytes]
width = u16(0x0B) # Width of the compressed image [2 Bytes]
height = u16(0x0F) # Height of the compressed image [2 Bytes]
bpp = data(0x11) # Color depth of the image [1 Byte]
value2 = data(0x12) # Fixed value 0x02 [1 Byte]
offset = u32(0x13) # Offset where the file content starts in the DATA area [4 Bytes]
decomp_sz = u32(0x17) # Size of the decompressed file [4 Bytes]
packed_sz = u32(0x1F) # Size of the packaged file within the DATA area [4 Bytes]
ftype = data[0x23] # 0x02 = Compressed, 0x03 = Plain (uncompressed) [1 Byte]
DATA:
DATA_START = 0x########
CIFTREE.DAT NANCY 2 STRUCTURE:
HEADER:
HEADER_START = 0x000000 # Start HEADER (0x000000-0x00001F)
HEADER_SIZE = 0x20 # Total header size (32Bytes)
HEADER_SIGNATURE_POS = 0x0 # SIGNATURE position
HEADER_SIGNATURE_SIZE = 0x13 # SIGNATURE size (0x13 = 19Bytes)
HEADER_VERSION = 0x18 # Version (4Bytes)
HEADER_NUM_ENTRY_POS = 0x1C # Position number of ENTRYs (2Bytes)
ENTRY:
ENTRY_START = 0x000820 # Start ENTRY AREA
ENTRY_SIZE = 0x5E # Size of each ENTRY (0x5E = 94 Bytes)
name = data(0x00) # File name [32 Bytes]
index = u16(0x21) # ENTRY index [2 Bytes]
width = u16(0x2B) # Width of the compressed image [2 Bytes]
height = u16(0x2F) # Height of the compressed image [2 Bytes]
width1 = u16(0x43) # Width of the compressed image [2 Bytes]
height1 = u16(0x45) # Height of the compressed image [2 Bytes]
bpp = data(0x0x49) # Color depth of the image (fixed or non-localized) [1 Byte]
decomp_sz = u32(0x4F) # Size of the decompressed file (original size 0x43, 0x45, 0x47) [4 Bytes]
offset = u32(0x4B) # Offset of where the file content starts in the DATA area field [4 Bytes]
packed_sz = u32(0x57) # Size of the file Packed within the DATA area [4 Bytes]
ftype = data[0x5B] # 0x02 = Compressed, 0x03 = Plain (uncompressed) [1 Byte]
DATA:
DATA_START = 0x########
CIFTREE.DAT STRUCTURE NANCY 6+:
HEADER:
HEADER_START = 0x000000 # Start HEADER (0x000000-0x00001F)
HEADER_SIZE = 0x20 # Total header size (32Bytes)
HEADER_SIGNATURE_POS = 0x0 # SIGNATURE position
HEADER_SIGNATURE_SIZE = 0x13 # SIGNATURE size (0x13 = 19Bytes)
HEADER_VERSION = 0x18 # Version (4Bytes)
HEADER_NUM_ENTRY_POS = 0x1C # Position number of ENTRYs (2Bytes)
ENTRY:
ENTRY_START = 0x000820 # Start of ENTRY AREA (Should be 0x00087E)
ENTRY_SIZE = 0x5E # Size of each ENTRY (0x5E = 94 Bytes)
name = data(0x00) # File name [32 Bytes]
index = u16(0x21) # ENTRY index [2 Bytes]
offset = u32(0x23) # Offset of where the file content starts in the DATA area field [4 Bytes]
width = u16(0x31) # Width of the compressed image [2 Bytes]
height = u16(0x35) # Height of the compressed image [2 Bytes]
width1 = u16(0x49) # Width of the compressed image [2 Bytes]
height1 = u16(0x4B) # Height of the compressed image [2 Bytes]
decomp_sz = u32(0x51) # Size of the decompressed file (original size 0x43, doubts) 0x45, 0x47) [4 Bytes]
bpp = data(0x4F) # Image color depth (fixed or non-localized) [1 Byte] Value 0x10
packed_sz = u32(0x59) # Size of the packed file within the DATA area [4 Bytes]
ftype = data[0x5D] # 0x02 = Compressed, 0x03 = Plain (uncompressed), 0x04 = Special pack [1 Byte]
Last edited by mmogas on Fri Mar 27, 2026 12:30 pm, edited 4 times in total.
I'm wanting to write a new CIFTREE now; I got stuck at the portion which looks like a hash table. I'm not sure if I can understand how to write my own version of that without understanding how the games use it--for reading i.e. extracting, it seems to be optional and ScummVM skips it at time of writing; maybe it's a performance aide of some kind--so... if I want to be confident that I can write a well-formed CIFTREE that the original games can understand, I guess that means I have no choice but to start reverse-engineering or debugging! Neither of which I've ever done for a video game with so many moving parts :'D
Of course it's really great to be connected with the community around ScummVM when trying this out. I'm grateful for so many experienced and passionate people who like to advise and lend a hand.
I'm going to try to investigate the logic the game uses for the HASH.
For now, if the intention is to create a tool to modify the contents of CIFTREE.DAT for translations, especially in SCUMMVM, I would simply copy the original HASH (it's 0x800 bytes), since from what I've seen of the Nancy engine's source code, it doesn't use them at all.
I would focus on ensuring the ENTRY table is consistent and that the data area contains the updated information after going through an LZSS and obfuscation process.
More information about the game structure to aid in translation:
Common files in the games:
[Coming soon]
In Nancy 6 and later, translation will be considerably easier since much of the text is contained in the AUTOTEXT and CONVO files within CIFTREE.DAT. Another files with text are Scenes (S*) with TEXTBOX field inside.
- Extract files from the CIFTREE.DAT container: using LZSS and obfuscation via XOR/ADD
- Analyze the file structure.
- Investigate which game files contain the text:
+ Nancy 1-5: only in Scenes S####*
+ Nancy 6+: AUTOTEXT, CONVO, and Scenes S####*
- Investigate where and how the game uses characters/fonts: BOOT defines the characters (glyphs) from various graphic files: *FONT*
Next challenges:
- Create a tool to generate new CIFTREE files from modified files (for translations). Currently under development.
- Analyze the BOOT file to add new characters/fonts.
- Analyze the CIFTREE file hash to regenerate it.
- Begin the translation process and/or publish the Python source code for all the tools I have created for this project.
I have already created and verified the two main tools that allow extracting and recompressing the CIFTREE.DAT file, which contains most of the game's text and the key for translation.
I have also created other secondary tools to manipulate and/or structure other important game files such as BOOT, CONVO, AUTOTEXT, and SCENES (S####), as well as a converter for game images to PNG and vice versa.
I have been able to verify that the original game checks a HASH area (that's what I call it) between 0x0020 and 0x081F, which contains encrypted information verifying the game's integrity. Unfortunately, until I discover this mechanism, it won't be possible to play directly from Windows.
The good news is that SCUMMVM doesn't verify this part, so if we inject the new hash value from the modified CIFTREE.DAT file, the game works.
For now, I'm manually modifying the detection hash value in the "detection.cpp" file of SCUMMVM's Nancy engine, which forces me to recompile the program with every change made to CIFTREE.
To save time, I've parameterized the compilation process to create a mini-SCUMMVM using only the Nancy engine.
Now I'll focus on figuring out how to include new fonts in the form of "glyphs" (FONT files) and manage them in the BOOT file.
This demonstrates that the translation is possible, but it will require significant time and resources given the game's size, with a lot of text and images to edit.
As I expected, games from NANCY6 onwards (with AUTOTEXT, CONVO, and SCENES files) will be much easier to translate since the character set already includes the necessary characters for translating into multiple languages. It includes ñ and accents, although glyphs aren't assigned on some screens; these can be added by modifying the coordinates of the available extra entries, which are currently undefined.
Previous games have a limited character set defined in the BOOT file, in the chunk called FONT.
I've documented the structure of this section in case anyone wants to analyze it:
MAIN:
=====
0x0000 (4) -> DATA (TAG)
0x0003 (4) -> SIZE DATA (file - 8 bytes) HH LL format
...
CHUNKS STRUCTURE:
0x0000 (4) - NAME TAG
0x0003 (4) - CHUNK SIZE (chunk - 8 bytes) HH LL format
0x0005 - data
FONT CHUNK:
=====
0x0000 (4) - NAME TAG
0x0003 (4) - CHUNK SIZE
----
data:
offset 0x0000 (0x21) - FONT FILE NAME
offset 0x0021 (0x21) - FONT STYLE NAME
0x4B - 0x4E (4 bytes): Line Height. Defines the total vertical space occupied by a line of text. This is crucial for the engine to know how much to "down" when performing a line break.
0x4F - 0x52 (4 bytes): Ascent. Indicates the distance from the baseline to the top of the tallest characters (such as 'A' or 'k').
0x53 - 0x56 (4 bytes): Descent. Defines how much space is reserved below the baseline for letter "tails" like 'g', 'j', or 'y'.
0x57 - 0x58 (2 bytes): Default Kerning. A small value that adds a fixed gap between characters if no individual gap is specified.
Glyphs u32(X1) u32(Y1) u32(X2) u32(Y2)
In the NANCY3 to 5 games, only 78 characters are available. The only option would be to replace some unused symbols (&, %, º,...). I have tried to increase the number of entries for new glyphs by adjusting offsets and sizes, but SCUMMVM gives me a "chunk overread" error.
I don't think translating these games could do only purely amateur endeavor, given the amount of text and the many nuances in the game's language. It won't just be a matter of translating and adjusting the text to the display window; we'll also need to give the text meaning within the context and story.
Furthermore, since the only way to test/play them right now is through a manual recompile of SCUMMVM and adding the hash of the new CIFTREE.DAT file with all the modifications to the source code, it would have to be a 100% revised and 100% complete version before submitting the translation to SCUMMVM for inclusion as a final version.
In the coming days, I'll be sharing all the complete English texts for Nancy6, Nancy7, Nancy8, Nancy9, Nancy10, and Nancy11 (which are the ones SCUMMVM Beta recognizes to date) in case anyone is interested in starting the translation. I'll also be including some PNG images of menus and help files that would need translating.
I continue to focus on creating tools and then sharing them publicly soon.
UPDATE: (16/04/2026)
Some modifications in Create-CIFTREE.py and now games are fully playable under Windows 9x/XP (for example under VirtualBOX). Win10/11 shows error. Now, to test it, it's no longer necessary to modify the source code and manually recompile SCUMMVM.
NEXT CHALLENGES:
- Tools to perform the entire process of text replacement and automatic repackaging of CIFTREE.dat.
- Figuring out how to manage the fonts of games prior to NANCY5 where the available characters are limited. For now, the only solution is to replace some of the unused symbols in the game.
Last edited by mmogas on Wed Apr 15, 2026 10:12 pm, edited 3 times in total.
OH MY GOD! When I created this thread on the forum, I thought no one would pay attention. But seeing your current progress, it’s amazing! If you don’t mind, could you describe - either in private messages or here—the general translation process? If that’s possible, my team and I would immediately start translating the game The Vampire Diaries. Thank you! You’re awesome!
aleada21 wrote: Mon Apr 13, 2026 3:02 pm
OH MY GOD! When I created this thread on the forum, I thought no one would pay attention. But seeing your current progress, it’s amazing! If you don’t mind, could you describe - either in private messages or here—the general translation process? If that’s possible, my team and I would immediately start translating the game The Vampire Diaries. Thank you! You’re awesome!
Hi aleada21
Nice to meet you.
I've mainly been analyzing the structure of the Nancy Drew games (which I've made a lot of progress on), and I had put "Vampire Diaries" apart for a while.
From what I've been able to quickly see, the game's structure is very similar to the Nancy games, but with all the content equivalent to a decompressed CIFTREE.dat file.
Its translation has the same problem as Nancy 1 to Nancy 5: they have a very limited character set, and I haven't been able to modify the BOOT file to insert more characters. Therefore, the only solution would be to replace unused symbols. I'll take a look at it.
I'll soon be sharing the texts for Nancy 6 to Nancy 12 in case anyone is interested in starting the translation. Also, I want to share all tools (python) that I have created for this challenge.
I have already started the translation process for NANCY6 (to spanish). You can find a preliminary translation there in. If anyone wants to verify it...
Important: To make the generation process as automatic as possible with my tools, I recommend you not modifying the file structure too much, keeping the headers and any control codes (between "<" and ">"). Only replace "text" , preferly use *.txt files.
I'll also upload information on the structures of the different files and the tools to extract and recreate the CIFTREE.DAT file.