Text File The Forest game [Help]

How to translate the files of a game
Dhanyel1911
Posts: 3
Joined: Wed Feb 18, 2015 1:01 am

Text File The Forest game [Help]

Post by Dhanyel1911 »

Could anyone help me to extract the text of this game, it's done in Unity 4. Most games made in Unity, the texts are located within the "resources.assets", but this is in "Main Data". Someone please help me, because I really want to translate this game, but I can not edit them and make the repack. I opened the file with notepad and found some of the game menu texts, but most are encrypted or compressed, I think. Sorry any hassle, but is that this game is a priority in my translations community. I tried using the quickbms, but as the file has no extension, the error of the tool.

Below you can find the file link:

https://mega.co.nz/#!70cnRLQK!4Ve1qss03lnu7IlGm1oBsgcRFpinvs7rY5ETLtJEgso
ponaromixxx
Posts: 176
Joined: Tue Sep 30, 2014 5:59 pm

Re: Text File The Forest game [Help]

Post by ponaromixxx »

Here, I have not tried because the game is not!


Code: Select all

# extract Unity engine *.assets files

get EXT extension
if EXT == "resS" # no TOC -> scan
   cleanexit
endif
endian big
get FSIZE asize

goto 0xc
get BIAS long
if BIAS != 0 # var1
   endian little
   goto 0x28
   get FILES long
else # var2
   goto 0
   get INFOSIZE long
   get INFO long # actually file size
   math INFO -= INFOSIZE
   math INFO += 0x15
   goto INFO
   endian little
   get FILES long
endif

for i = 1 <= FILES
   set SKIP 0
   set EXT ""
   set FNAME ""
   set WNAME ""
   get FID long
   get OFFSET long
   math OFFSET += BIAS # zero in var2
   get SIZE long
   get TYPE long
   get DUMMY long # same as TYPE (?)
   savepos MYOFF
   callfunction distTYPE 1
   if SKIP == 0
      if EXT = ""
         set EXT "."
         string EXT += TYPE
      endif
      get FOLDERNAME basename
      string FOLDERNAME += "/"
      if FNAME == ""
         get FNAME basename
         string FNAME += "_"
         string FNAME += FID
      endif
      string FNAME += EXT
      set WNAME FOLDERNAME
      string WNAME += FNAME
      if FID == FILES # probably not needed, just a precaution
         get SIZE asize
         math SIZE -= OFFSET
      endif
      log WNAME OFFSET SIZE
   endif
   goto MYOFF
next i

startfunction distTYPE
   if TYPE == 1
      elif TYPE == 2
      elif TYPE == 3
      elif TYPE == 4
      elif TYPE == 5
      elif TYPE == 6
      elif TYPE == 7
      elif TYPE == 8
      elif TYPE == 9
      elif TYPE == 10
      elif TYPE == 11
      elif TYPE == 12
      elif TYPE == 13
      elif TYPE == 14
      elif TYPE == 15
      elif TYPE == 16
      elif TYPE == 17
      elif TYPE == 18
      elif TYPE == 19
      elif TYPE == 20
      elif TYPE == 21
         callfunction getname 1
         set EXT ".mat"
      elif TYPE == 23
      elif TYPE == 26
      elif TYPE == 28
         callfunction getname 1
         set EXT ".tex"
      elif TYPE == 33
      elif TYPE == 43
         callfunction getname 1
      elif TYPE == 48
         callfunction getname 1
         set EXT ".shader"
         goto OFFSET
         get SIZE long
         math OFFSET += 4
      elif TYPE == 49 # ingame movies/xml/backgrounds
         callfunction getname 1
         callfunction getType 1
      elif TYPE == 54
      elif TYPE == 64
      elif TYPE == 65
      elif TYPE == 74
         callfunction getname 1
         set EXT ".ani"
      elif TYPE == 82
      elif TYPE == 83 # can be empty (some pointer maybe)
         callfunction getname 1
         set TEST SIZE
         math TEST -= 0x18
         if TEST == 0
            set SKIP 1
         else
            math OFFSET += 0x10
            goto OFFSET
            get SIZE long
            savepos OFFSET
            getDstring TYPE2 3
            if TYPE2 == "RIF"
               set EXT ".wav"
            elif TYPE2 == "Ogg"
               set EXT ".ogg"
            elif TYPE2 == "ID3"
               set EXT ".mp3"
            else
               goto OFFSET
               get TYPE2 byte
               if TYPE2 == 0xff
                  set EXT ".mp3"
               endif
            endif
         endif
      elif TYPE == 89
         callfunction getname 1
      elif TYPE == 96
      elif TYPE == 108
      elif TYPE == 111
      elif TYPE == 115
         callfunction getname 1
      elif TYPE == 123
      elif TYPE == 128
         callfunction getname 1
         set EXT ".ttf"
      elif TYPE == 131
      elif TYPE == 135
      elif TYPE == 150
      elif TYPE == 152
         callfunction getname 1
         math OFFSET += 0x10
         math SIZE -= 0x10
         set EXT ".ogm"
      elif TYPE == 159
         callfunction getname 1
      elif TYPE == 198
      elif TYPE == 199
      elif TYPE == 3584 # last file
      else
   endif
endfunction
   
startfunction getname
   goto OFFSET
   get NAMEL long
   set TEST NAMEL
   math TEST %= 4
   if TEST != 0 # round to next 4byte
      math NAMEL /= 4
      math NAMEL += 1
      math NAMEL *= 4
   endif
   getDstring FNAME NAMEL
   savepos NBIAS
   math NBIAS -= OFFSET
   math OFFSET += NBIAS
   math SIZE -= NBIAS
endfunction

startfunction getType
   goto OFFSET
   get DUMMY long
   get TYPE long
   if TYPE == 0x6d783f3c
      math OFFSET += 4
      set SIZE DUMMY
      set EXT ".xml"
   elif TYPE == 0x474e5089
      math OFFSET += 4
      set SIZE DUMMY
      set EXT ".png"
   endif
endfunction
makc_ar
Posts: 1193
Joined: Sun Aug 17, 2014 7:27 pm

Re: Text File The Forest game [Help]

Post by makc_ar »

binary text
ImageImageImage
Dhanyel1911
Posts: 3
Joined: Wed Feb 18, 2015 1:01 am

Re: Text File The Forest game [Help]

Post by Dhanyel1911 »

##ponaromixxx

From what I saw, this script is to extract the .assets the game. I managed to extract the resource.assets, however, files with extension .text are still encrypted; unable to extract the MainData, which if I remember correctly is where the game's texts are. As I said, this game is a priority in my translations community. :)