Batch Renaming Script by Matching IDs

Codecs, formats, encoding/decoding of game audio, video and music
brendan19
Posts: 144
Joined: Fri Aug 08, 2014 11:25 am

Batch Renaming Script by Matching IDs

Post by brendan19 »

Hey

I'm extracting audio from Ori and the Blind Forest which uses the Unity engine.

So I have a whole heap of .fsb files with 0x20 byte ID filenames e.g.

b8df80f1a4339914cb8970bfb664dd63.fsb

In a separate file, it has that exact same ID located at 0x1C "b8df80f1a4339914cb8970bfb664dd63" but this file has the proper filename "02standUp"

I was hoping someone could write a script that renames the FSB files to their proper filenames by matching up the FSB ID filenames with the files that have the same ID at 0x1C.

Sample has been provided to help :)

Sample
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: Batch Renaming Script by Matching IDs

Post by spider91 »

Code: Select all

goto 0x1c
get NAME basename
string NAME += ".fsb"
GetDString IDNAME 0x20
string IDNAME += ".fsb"
open FDSE IDNAME 1
get SIZE asize 1
log NAME 0 SIZE 1
brendan19
Posts: 144
Joined: Fri Aug 08, 2014 11:25 am

Re: Batch Renaming Script by Matching IDs

Post by brendan19 »

Thank you spider91. The script works flawlessly :D
brendan19
Posts: 144
Joined: Fri Aug 08, 2014 11:25 am

Re: Batch Renaming Script by Matching IDs

Post by brendan19 »

Code: Select all

goto 0x1c
get NAME basename
string NAME += ".fsb"
GetDString IDNAME 0x20
string IDNAME += ".resource"
open FDSE IDNAME 1
get SIZE asize 1
log NAME 0 SIZE 1


Changed one line, but this reduces a step earlier on by having to rename the .resource files to .FSB first