ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Jun 24, 2017 10:23 am

All times are UTC




Post new topic  Reply to topic  [ 17 posts ] 
Author Message
 Post subject: The Sim: Free Play
PostPosted: Sat Apr 04, 2015 1:58 pm 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
Have any tools for this file ? Thanks for helping. :D


Attachments:
sims3_deluxe_ios.rar [332.15 KiB]
Downloaded 51 times
Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Wed Apr 08, 2015 4:03 pm 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
Anyone can help ? :(


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Thu Apr 09, 2015 2:26 am 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
I know how to make a script to extract the strings, I don't think it would support reimporting though. I could probably make a script that has separate parts for extraction and importing though, depending on whether you give it a .sb file or a .txt file.


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Thu Apr 09, 2015 6:14 am 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
Hmm, some issues are arising. One of the strings is 0x9C0 bytes long, which first of all seems to be too large for the QuickBMS string variable. Secondly, that string is also multilined, which would break my reimporting script.

I can probably still do it but it will take a bit more time.


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Thu Apr 09, 2015 7:35 am 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
Here it is, finally:
Code:
# The Sims: FreePlay .sb file extraction and re-insertion
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

get EXT extension

if EXT == "sb"
   callfunction SBEXTRACT
elif EXT == "txt"
   callfunction REIMPORT
endif

startfunction SBEXTRACT
   findloc CHDROFF string "CHDR"
   findloc CDATOFF string "CDAT"
   
   goto CDATOFF
   idstring "CDAT"
   get CDATSZ long
   get DUMMY long
   savepos STRINGSOFF
   
   goto CHDROFF
   idstring "CHDR"
   get CHDRSZ long
   get DUMMY long
   
   log MEMORY_FILE 0 0
   
   append
   for POS = 0 < CHDRSZ
      get OFFSET long
      get SIZE long
      math OFFSET += STRINGSOFF
      
      log MEMORY_FILE OFFSET SIZE
      
      goto 0 MEMORY_FILE SEEK_END
      put 0xFF byte MEMORY_FILE
      put 0x0D byte MEMORY_FILE
      put 0x0A byte MEMORY_FILE
      
      math POS += 8
   next
   append
   
   get MSIZE asize MEMORY_FILE
   log "sbextracted.txt" 0 MSIZE MEMORY_FILE
endfunction

startfunction REIMPORT
   open "." "sims3_deluxe_ios.sb" 1 EXISTS
   findloc CHDROFF string "CHDR" 1
   set SIZE CHDROFF
   math SIZE += 0x0C
   
   log MEMORY_FILE 0 SIZE 1
   goto 0 MEMORY_FILE SEEK_END
   
   log MEMORY_FILE2 0 0
   
   get FILESIZE asize
   set STRNUM 0
   set OFFSET 0
   
   append
   for POS = 0 < FILESIZE
      findloc DELOFF byte 255
      set SIZE DELOFF
      math SIZE -= POS
      
      put OFFSET long MEMORY_FILE
      put SIZE long MEMORY_FILE
      
      log MEMORY_FILE2 POS SIZE
      goto 0 MEMORY_FILE2 SEEK_END
      put 0x00 byte MEMORY_FILE2
      goto 0 MEMORY_FILE2 SEEK_END
      savepos OFFSET MEMORY_FILE2
      
      math DELOFF += 3
      goto DELOFF
      savepos POS
      
      math STRNUM += 1
   next
   append
   
   goto CHDROFF MEMORY_FILE
   idstring "CHDR" MEMORY_FILE
   set CHDRSZ STRNUM
   math CHDRSZ *= 8
   put CHDRSZ long MEMORY_FILE
   
   findloc CDATOFF string "CDAT" 1
   set SIZE 0x0C
   
   append
   log MEMORY_FILE CDATOFF SIZE 1
   goto 0 MEMORY_FILE SEEK_END
   
   get MSIZE asize MEMORY_FILE2
   log MEMORY_FILE 0 MSIZE MEMORY_FILE2
   append
   
   get MSIZE asize MEMORY_FILE
   log "newstrings.sb" 0 MSIZE MEMORY_FILE
endfunction

There are a number of things you need to keep in mind:

First of all, when you extract the file, it will create a .txt file containing all of the strings. Each string ends with the "ÿ" character, and then a newline. Do not remove this character (or the newline) when editing the text because it is essential for re-importing.
Secondly, to re-import the strings, choose the edited .txt file as the input file. It is also necessary that "sims3_deluxe_ios.sb" is in the output folder. It will not overwrite this file, but instead create a new file called "newstrings.sb" that contains your edited strings.

I am unable to test this with the game myself (since I don't own it), but if I extract and then re-import without changing anything, the resulting .sb file is identical to the original. So I assume that you should be able to edit strings and re-import them to mod or translate the game.


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Thu Apr 09, 2015 11:26 am 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
puggsoy wrote:
Here it is, finally:
Code:
# The Sims: FreePlay .sb file extraction and re-insertion
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

get EXT extension

if EXT == "sb"
   callfunction SBEXTRACT
elif EXT == "txt"
   callfunction REIMPORT
endif

startfunction SBEXTRACT
   findloc CHDROFF string "CHDR"
   findloc CDATOFF string "CDAT"
   
   goto CDATOFF
   idstring "CDAT"
   get CDATSZ long
   get DUMMY long
   savepos STRINGSOFF
   
   goto CHDROFF
   idstring "CHDR"
   get CHDRSZ long
   get DUMMY long
   
   log MEMORY_FILE 0 0
   
   append
   for POS = 0 < CHDRSZ
      get OFFSET long
      get SIZE long
      math OFFSET += STRINGSOFF
      
      log MEMORY_FILE OFFSET SIZE
      
      goto 0 MEMORY_FILE SEEK_END
      put 0xFF byte MEMORY_FILE
      put 0x0D byte MEMORY_FILE
      put 0x0A byte MEMORY_FILE
      
      math POS += 8
   next
   append
   
   get MSIZE asize MEMORY_FILE
   log "sbextracted.txt" 0 MSIZE MEMORY_FILE
endfunction

startfunction REIMPORT
   open "." "sims3_deluxe_ios.sb" 1 EXISTS
   findloc CHDROFF string "CHDR" 1
   set SIZE CHDROFF
   math SIZE += 0x0C
   
   log MEMORY_FILE 0 SIZE 1
   goto 0 MEMORY_FILE SEEK_END
   
   log MEMORY_FILE2 0 0
   
   get FILESIZE asize
   set STRNUM 0
   set OFFSET 0
   
   append
   for POS = 0 < FILESIZE
      findloc DELOFF byte 255
      set SIZE DELOFF
      math SIZE -= POS
      
      put OFFSET long MEMORY_FILE
      put SIZE long MEMORY_FILE
      
      log MEMORY_FILE2 POS SIZE
      goto 0 MEMORY_FILE2 SEEK_END
      put 0x00 byte MEMORY_FILE2
      goto 0 MEMORY_FILE2 SEEK_END
      savepos OFFSET MEMORY_FILE2
      
      math DELOFF += 3
      goto DELOFF
      savepos POS
      
      math STRNUM += 1
   next
   append
   
   goto CHDROFF MEMORY_FILE
   idstring "CHDR" MEMORY_FILE
   set CHDRSZ STRNUM
   math CHDRSZ *= 8
   put CHDRSZ long MEMORY_FILE
   
   findloc CDATOFF string "CDAT" 1
   set SIZE 0x0C
   
   append
   log MEMORY_FILE CDATOFF SIZE 1
   goto 0 MEMORY_FILE SEEK_END
   
   get MSIZE asize MEMORY_FILE2
   log MEMORY_FILE 0 MSIZE MEMORY_FILE2
   append
   
   get MSIZE asize MEMORY_FILE
   log "newstrings.sb" 0 MSIZE MEMORY_FILE
endfunction

There are a number of things you need to keep in mind:

First of all, when you extract the file, it will create a .txt file containing all of the strings. Each string ends with the "ÿ" character, and then a newline. Do not remove this character (or the newline) when editing the text because it is essential for re-importing.
Secondly, to re-import the strings, choose the edited .txt file as the input file. It is also necessary that "sims3_deluxe_ios.sb" is in the output folder. It will not overwrite this file, but instead create a new file called "newstrings.sb" that contains your edited strings.

I am unable to test this with the game myself (since I don't own it), but if I extract and then re-import without changing anything, the resulting .sb file is identical to the original. So I assume that you should be able to edit strings and re-import them to mod or translate the game.

Thanks so much :D It's very very ok


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Thu Apr 09, 2015 4:42 pm 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
Puggsoy, something wrong ? When i edited some strings that didn't have "ÿ" at the end of string, the game crashed. Can you help me ?
http://i.imgur.com/kFMFrTO.png

P/S: And can you help me for editing with longer strings than orginal ? Example: Old string: "New Game", i want to replace with "Chơi mới" (more characters). Reimport will error if i do that.


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Fri Apr 10, 2015 3:43 am 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
I can see that you're using Notepad++ in UTF-8 mode. You need to use it in ANSI mode (go to Encoding -> Encode in ANSI). That might help.
Also, I don't think unicode characters will work. For example "Chơi mới" cannot be saved as ANSI.

That said, there is a lot of the file format I am still unfamiliar with and that probably is used by the game, so even if you use ANSI strings it might not work. Try it though, just changing one or two simple words without unicode characters.


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Fri Apr 10, 2015 4:51 am 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
puggsoy wrote:
I can see that you're using Notepad++ in UTF-8 mode. You need to use it in ANSI mode (go to Encoding -> Encode in ANSI). That might help.
Also, I don't think unicode characters will work. For example "Chơi mới" cannot be saved as ANSI.

That said, there is a lot of the file format I am still unfamiliar with and that probably is used by the game, so even if you use ANSI strings it might not work. Try it though, just changing one or two simple words without unicode characters.

It still work with Unicode characters in encoding UTF 8 :) But it will crash if i edit the strings that don't have "ÿ" at the end of string. And crash when i replace the original string by longer new string, too. Do you have any idea ?


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Fri Apr 10, 2015 7:37 am 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
That's very strange indeed. I have no idea why that would be happening, I tested that and the resulting .sb file is what I would expect, so I don't think it's importing them incorrectly. What about if the string is shorter than original?


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Fri Apr 10, 2015 12:46 pm 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
Shorter is ok but crash if longer than original :(


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Fri Apr 10, 2015 1:19 pm 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
That's very strange... I'm not sure what it could be then. Maybe just some sort of restriction in the game engine.

I apologise but I don't think I can help you further :?


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Fri Apr 10, 2015 5:06 pm 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
puggsoy wrote:
That's very strange... I'm not sure what it could be then. Maybe just some sort of restriction in the game engine.

I apologise but I don't think I can help you further :?


Anyway, thanks you so much


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Tue Nov 24, 2015 7:16 am 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
Can you update script for the new version ? Thanks


Attachments:
sims3_deluxe_ios.rar [397.84 KiB]
Downloaded 35 times
Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Tue Nov 24, 2015 7:37 am 
User avatar

Joined: Sat Dec 13, 2014 1:01 am
Posts: 161
It appears to work fine with the existing script. Are you experiencing issues?


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Tue Nov 24, 2015 8:39 am 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
puggsoy wrote:
It appears to work fine with the existing script. Are you experiencing issues?

Sorry, my failed :D It is still working


Top
   
 Post subject: Re: The Sim: Free Play
PostPosted: Fri Mar 17, 2017 6:14 am 

Joined: Mon Oct 06, 2014 6:41 pm
Posts: 295
Hi, this game has new update and the old script does not work. When i modding, the game didn't work


Attachments:
sims3_deluxe_ios_new.zip [695.77 KiB]
Downloaded 14 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 17 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited