YoYo Games data.win

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: YoYo Games data.win

Post by aluigi »

Script 0.1.2
zaphiel
Posts: 6
Joined: Mon Nov 16, 2015 11:48 pm

Re: YoYo Games data.win

Post by zaphiel »

I never thought trying the script on the exe would work, but it did beautifully! Thank you so much!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: YoYo Games data.win

Post by aluigi »

It's a feature I have just added for this new version of the script :)
theus
Posts: 2
Joined: Sat Sep 09, 2017 12:11 am

Re: YoYo Games data.win

Post by theus »

Can someone help me? After i extract the files from a .win archive all the files are raw with no extensions.
I've tried opening sprite files (From the SPRT extracted folder) with photo viewers but it says the file is invalid.
The data.win archive i'm trying to extract is from the game called Relic Hunters Zero, it's a free game on Steam if you want to try extracting the files yourself.
I've also tried extracting the files from a game that has the game files built in the .exe file (Yes it is a GameMaker game), but the extracted files are raw aswell.
This one is a paid game but i'll leave the .exe for download if you want to try extracting it:
https://www.dropbox.com/s/58k44bf6fbhfo ... w.exe?dl=0
makc_ar
Posts: 1193
Joined: Sun Aug 17, 2014 7:27 pm

Re: YoYo Games data.win

Post by makc_ar »

aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: YoYo Games data.win

Post by aluigi »

Some TXTR files had the offset 0xffffffff or 0, I don't know if there is a real way to fix it.
In the meantime I have released the script 0.1.2a
makc_ar
Posts: 1193
Joined: Sun Aug 17, 2014 7:27 pm

Re: YoYo Games data.win

Post by makc_ar »

Thanks a lot aluigi!
neptuniapp2
Posts: 2
Joined: Fri Apr 07, 2017 3:44 pm

Re: YoYo Games data.win

Post by neptuniapp2 »

Is there no possibility of unpacking the full files inside the font folder? Only one .dat file appears inside it.
CureLovelyWarrior
Posts: 5
Joined: Mon May 21, 2018 3:41 pm

Re: YoYo Games data.win

Post by CureLovelyWarrior »

Not sure if this is old news or not, but regarding people who are having trouble with opening images in the "SPRT" folder. Truth is they're not images, they are .json files (so are the files in many of the other folders). They contain data for animation, coordinates, etc but not the images themselves, which are instead in the "TXTR" folder (and they're all jumbled, so anyone who makes a script that fixes this - or gives a source code file - would be most appreciated).
Here is an example of what the code in one of the .json files looks like (viewable in firefox for sure): http://biancagames.com/bullet_enemy.json

Although the quickbms script exported the "SPRT" files without an extension, I found another decompiler: https://gitlab.com/PoroCYon/Altar.NET/tags
that exported them as .json files. Just so everyone knows, I think this decompiler also can decompile readable gml code.

I hope this helps someone! ♥
GGG
Posts: 2
Joined: Tue May 29, 2018 1:31 am

Re: YoYo Games data.win

Post by GGG »

Thanks, I hope this hasn't been addressed elsewhere.

I was looking to modify the sprites in Cook Serve Delicious 2. The original could be edited, the sequel doesn't extract fully, it throws the error below:
The data.win file is quite large, but is here: https://mega.nz/#!OrYGTQxS!AwVC1MsKh_FNUSw9lWmTx5zKSpNXnTfHZtBuoFBGZzs
I used quickbms 0.8.4 and yoyogames.bms 0.1.2a from the front page

...
< 8780: gml_Script___BT_init
< 8781: gml_Script_bt_set_borderless
< 8782: gml_Script_bt_set_windowed
< 8783: gml_Script___BT_preserveWindowSize
< 8784: gml_GlobalScript_0
< 8785: gml_GlobalScript_1
< 8786: gml_GlobalScript_2
< 8787: gml_GlobalScript_3
CHUNK TXTR 0x00b3f488 0x2c9fb6d4

Error: the script uses more array indexes (809) than supported (809)

Last script line before the error or that produced the error:
131 getarray NEXT_OFFSET 0 j


If a full log is useful let me know.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: YoYo Games data.win

Post by aluigi »

Script 0.1.3
The cause of the problem was a slightly different format of the TXTR chunk, instead of being 01 00 00 00 OFFSET it was 01 00 00 00 00 00 00 00 OFFSET.
I also fixed problems like this happening in the future because the array indexing wasn't limited.
TXTR still remains an unreliable field so I hope to have not broken any compatibility with other data.win archives :)
GGG
Posts: 2
Joined: Tue May 29, 2018 1:31 am

Re: YoYo Games data.win

Post by GGG »

Tested it, it works.
I was also able to edit and repack.

Thanks!
CureLovelyWarrior
Posts: 5
Joined: Mon May 21, 2018 3:41 pm

Re: YoYo Games data.win

Post by CureLovelyWarrior »

I'm using the newest version of the script and although I am able to use "reimport" on stuff in the "CODE" folder, reimporting stuff in the "OBJT" folder breaks the game. (edit: figured out I don't need to do this as the object event data is actually in the CODE folder)
Just so you know, I wasn't editing gml code. I copied a gml code file that was decompiled from another version of the same game. It's complicated.
It would be really nice if I could edit and reimport code, that'd fix my problem I think (doing what I did caused in game errors).
Hacking images with "reimport2" also is breaking the game for me.
Maybe you guys should collaborate with the creators of altar, because that program can clearly let you read and edit code.... only thing is you can't reimport it. ♥
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: YoYo Games data.win

Post by aluigi »

I checked the reports about why the data.win reimported with quickbms 0.9.x worked while that with 0.10.x doesn't.

In short the strings in data.win are like the following:
- 32bit size of the string + 1
- string
- NUL byte

quickbms needs to take some decisions on its own during reimporting via the SLog command:
- what byte to use as "filler" to cover the gaps between the original string and the new one
- what to do if there are NUL bytes at the end of the original string

In version 0.9.x the filler was the byte 0x00 (NUL), in version 0.10.x it was adopted 0x20 (the space) because it was more appropriate and failsafe to use with strings.
Quickbms simply doesn't display the NUL bytes at the end of the strings because the resulting text file would be very chaotic... imagine having a \0 at the end of each line of the output file.

What happens with data.win is that the string coming from data.win with this format |0x00000006 "hello" 0x00| is saved as "hello", and not as "hello\0".
During reimporting quickbms has a 5 bytes long string ("hello") to fit the 6 bytes long slot, therefore it must put a filler at the end for covering the 1 byte gap.
The filler is the space in version 0.10.x.

Long story short... is there a way to fix this behaviour?
Since there is no automatic way to guess what to do, my solution for quickbms 0.11 (work-in-progress) is adding in-script support for the -b option already available in 0.10 and meant to set the "filler" byte.
I already updated the yoyogames.bms script with it, so it's ready when version 0.11 will be out.

What to do now with quickbms 0.10.x?
Simple, use the -b 0x00 option at command-line during reimporting.
If you use reimport.bat just add -b 0x00 in it after quickbms.exe
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: YoYo Games data.win

Post by Shokoniraya »

sir alugi
filler should be \x00, because many games use this way, space (\x20) is not safe at all, please set \x00 as default

many games using null terminated string, even if they have string length, some games skips rest of string that comming after \x00 (just like null terminated)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: YoYo Games data.win

Post by aluigi »

This case is different because they are NUL delimited strings in a space ruled by a size field, therefore it's a mess done by the game that should not use NUL delimited strings in this context.
The 0x00 filler creates problems with size-limited strings.
With NUL delimited strings obviously quickbms uses the 0x00 delimiter.
Pollux88
Posts: 1
Joined: Mon Dec 14, 2020 10:57 pm

Re: YoYo Games data.win

Post by Pollux88 »

Hi there. I'm trying to edit a game's sprites for a translation. I can extract them just fine, but when I'm trying to reimport edited pngs (the size is smaller than the original files) reimporter gives an error if I delete everything except the .pngs in TXTR folder

Code: Select all

- error in src\file.c line 1965: dumpa_slog()
Error: No such file or directory

Last script line before the error or that produced the error:
  114 slog "STRG.txt" -1 STRING_SIZE


It looks for STRG.txt
But if I leave extracted STRG.txt, the game wouldn't run with reimported data.win

Am I doing something wrong? Is there a way to make the game not look for STRG.txt?



EDIT:
First I invented a backwards way of taking the necessary image data form invalid .win file by offsets and inserting it into the original file, which did work. But then I figured out that I can just leave STRG.txt blank, and so far that seems to work. Still seems wrong that the program should require it.

Anyway, thanks for the script and sorry for flooding.
skhoob
Posts: 1
Joined: Fri Mar 05, 2021 3:48 am

Re: YoYo Games data.win

Post by skhoob »

I was able to use yoyogames script 1.3a to decompile a game I'm interested in reviewing, but I've not been able to find any information on how to take it a step further to review the code. The artifacts in the CODE folder certainly seem to be related to functions that are used inside the game (based on the filenames alone), but it's not clear how they should be used.

Most start with 'gml_Script', 'gml_GlobalScript', or 'gml_Object'. What types of files are these? How are they expected to be used/viewed?

Ideally I'd like to be able to import the resulting files into something like Ghidra to decompile into actual code, but anything helps at the moment. Thanks in advance.
PlanK69
Posts: 73
Joined: Thu Sep 10, 2015 10:17 pm

Re: YoYo Games data.win

Post by PlanK69 »

hey. I found a game that uses .win but the yoyogames bms script doesn't extract any usable files, it just extracts about 20% of the actual file and it doesn't extract any image or sound files. I've uploaded the file so you can take a look. I've also tried to open it with the UndertaleModTool (which usually works with .win files) but that didn't work either. According to the dev (who I asked directly) the game uses "Game maker: studio 2.3". Do we have any .bms scripts for that? I looked on aluigi's site and didn't see any.

https://www.dropbox.com/s/2pqmdgnxb1jn8p5/data.win?dl=0
taklaminon
Posts: 1
Joined: Mon Jan 16, 2023 1:28 am

Re: YoYo Games data.win

Post by taklaminon »

I keep getting this error with a specific game.

Error: incomplete input file 0: D:\Downloads\Spacethumper V1.0.3\Spacethumper V1.0.3\data.win
Can't read 1428490802 bytes from offset 00438a7e.
Anyway don't worry, it's possible that the BMS script has been written
to exit in this way if it's reached the end of the archive so check it
or contact its author or verify that all the files have been extracted.
Please check the following coverage information to know if it's ok.

coverage file 0 100% 4444895 4426366 . offset 00438a7e

Last script line before the error or that produced the error:
114 slog "STRG.txt" -1 STRING_SIZE
coverage file 0 100% 4444895 4426366 . offset 00438a7e

Press ENTER or close the window to quit

Before it is a line that contains the entirety of the outputted strg.txt file. It looks like this


CHUNK STRG 0x00168f88 0x0000b6f8
< 1: prototype
< 2: \0\0@@array@@\0\0\0 \0\0\0arguments\0\0\0 \0\0\0argument0\0\0\0...

I cut off the text just so this comment wouldn't contain 627 kB of text, but I'll show the last few lines of text if it helps

)bo\n\0/V#Zpu/AQ t.CNيu\nR$Z.bS}ߡ6oA\0\0\0\0!(/cie\n|1[P2j}bZlp<03pq\\+vrk\0vkldӆ1|qCkn?=z1y\r13ש[PS"{6sC zeh;\ /_͂&bx3U_ Û+Ni&] [% kL[hN]3u*U\0 \0\0\0\0m/t6mKCi-\\=WH`v3O[$ǖ-^k47|,7ϫU&\0s"ת\0u[v.m64"97ImZnh 6roA\0c$H!\\1uݶ]iSP\\@_fS͸\\\0\0\0\0\0\0I}\0P(_W[Ͳ&\0g6Im~ מ\0}v~3*��]uk^Q@uf3F]mh&z>|~W3+.P<A[PKX ?z?{/?w]6O4JZ)Ӗ @ҕيu\nB5t%\n*Hsc#\0\0\0\0\0Q\r'1H\\ML%e*f/HM%Sn*wRgš MS~2[}pm#\nu+ sl_UU$l'@PO4皸9U0mXr\!\0\rWֿ4HR2 c\0>m\0bZך]ܵ:MQ\0k&ۆ\0\0Sܺ?(\nL\0E.1m讀\0\\mP3U6QUfͲ#dGDцf+#_w-6ufy/n1q^LEv[Fcc^wo,1AhTn?R(>A}Ŷ3\r\0+c|\n@J5kzބ^ŧ:Mem@u\0;;PA<\0U0`wY-!RqQ2|&\0c[ls\ng;v.^/Dz[Ɵ"r&\0깹-y-;e9"-^?(׭s?-7O9,bryGnњM\0vo@u+>S\0,5L)m \\.0'{1i@Κ4]}J9u#\\>ցTwRm}D \0@r ƾ۔s]쳵icl=Txn3C\nQ7C_)~^?2uG:;邹>=jxxغB:<\r/s:\0F!8\n 661Rnb}&Ĉu1z\0R[Z\\?\0t׸dTe%x'hhKWە@PA<\0��o:\0"P`Ĝ_%2>C])dr>s dnmMMu(Vw&Ŋ#4?gϻ(|h&5C`54\\do`7!A%\rm.$&dߙ\0fc\0@pJcm?]...

The resulting files only have the extensions .txt, .dat, .vap, .cl5, .nfc, and no extension.

Here's a link to the game (warning: furry fetish content) https://forum.weightgaming.com/t/spacethumper/14210