ZenHAX

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

All times are UTC




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Nut Scripts
PostPosted: Sat Oct 24, 2015 11:38 am 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 713
May be someone knows what the Script Engine is used to work with *.nut / *.nutx files (Magic Header ID is RIQS and in the end magic id is LIAT)?

Edited: Seems it's Squirrel programming language but not sure.


Attachments:
AssetLib.rar [1.68 KiB]
Downloaded 66 times
Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sat Oct 24, 2015 12:14 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6163
Yes, they are compiled Squirrel scripts.


Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sat Oct 24, 2015 12:22 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 713
Ok. Then there is another question: Is there a for compiled scripts Disassembler / Decompiler? :)


Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sat Oct 24, 2015 12:46 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6163
Honestly I didn't even know Squirrel but it looks like it's known in the gaming community and there are some decompilers available.
Just a quick google search reveals something interesting, like this project:
https://github.com/rockfireredmoon/icee ... /UTILITIES
I didn't test it.


Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sat Oct 24, 2015 2:49 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 713
NutCrack don't works. I guess because not supports Unicode strings. Thanks anyway.


Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sun Oct 25, 2015 12:58 pm 

Joined: Tue Sep 08, 2015 11:27 am
Posts: 62
I've used NutCracker in the past and it's worked well.


Attachments:
NutCracker.zip [120.31 KiB]
Downloaded 187 times
Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sun Oct 25, 2015 1:20 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 713
Thanks for source's. I've tried decompile provided by me scripts but got:

Code:
Error: NUT file compiled for different size of char that expected.


Problem here:

Code:
   if (reader.ReadInt32() != sizeof(char))
      throw Error("NUT file compiled for different size of char that expected.");


In script i changed DWORD value 2 at offset 0x6 > to 1 =

Code:
Error: Expected string object not found in source binary file.


That error because strings length written with ANSI size but the string itself is written in UNICODE. I changed part code in BinaryReader.h - void ReadSQString( std::string& str ) for read UNICODE strings but while decompile i got some parts disassembled code like this:

Code:
  // [003]  bad allocation    3      0    0    0
::require($[stack offset 3]);
  // [007]  bad allocation    3      0    0    0
  // [011]  bad allocation    4      0    0    0
this.GMI_SETUP_DEPEND($[stack offset 3], $[stack offset 4]);
  // [015]  bad allocation    3      0    0    0
  // [017]  bad allocation    4      0    0    0
this.glog($[stack offset 3], $[stack offset 4]);
  // [022]  bad allocation    3      0    0    0
::require($[stack offset 3]);
  // [027]  bad allocation    3      0    0    0
::requiredir($[stack offset 3]);


I guess scripts from game compiled with newest or / older 2.2.4 version of Squirrel compiler, also seems developers have made some changes :(


Last edited by Ekey on Sun Oct 25, 2015 1:22 pm, edited 1 time in total.

Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sun Oct 25, 2015 1:22 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6163
@einstein95
Any homepage/github/author? Just curious because I see no references on google except in some talks


Top
   
 Post subject: Re: Nut Scripts
PostPosted: Sun Oct 25, 2015 1:23 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 713
aluigi wrote:
@einstein95
Any homepage/github/author? Just curious because I see no references on google except in some talks

I see some talks only on Steam forums.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 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