Jump to content

Ps3 shellshock2 game Localization


Go to solution Solved by h3x3r,

Recommended Posts

  • kosemen_76 changed the title to Ps3 shellshock2 game Localization
  • 8 months later...
  • Engineers
Posted (edited)

Any file ending like this "_AM.ASRBE" is loc file.

COMMON.ASRBE uses zlib and overal all files are in big endian since it's ps3.

Made a quick struct... for reference.

//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
BigEndian();OutputPaneClear();

char AsuraSign[8];

struct
{
    char TXTHSign[4];
    uint32 TableSize; // Must be probably updated.
    uint32 Unknown_1,
           Unknown_2,
           StringCount,
           Unknown_3,
           StringSectionSize; // This must be updated after repack. It's size of all strings without StrCRC and StrLen variable.
    struct
    {
        uint32 StrCRC;
        uint32 StrLen;
        wchar_t LocString[StrLen]; // If changed StrLen must be updated too.
    }String[StringCount]<optimize=false>;
    
    uint32 IdStringSize;

    struct
    {
        string IdString;
    }IdString[StringTable.StringCount]<optimize=false>;
}StringTable;

 

Edited by h3x3r
Posted
3 hours ago, h3x3r said:

"_AM.ASRBE" şeklinde biten her dosya loc dosyasıdır.

COMMON.ASRBE zlib kullanır ve PS3'e ait olduğu için bütün dosyalar big endian'dır.

Referans olması açısından hızlı bir yapı oluşturdum.




    

 

Thanks for the template. From this template, I can see that the archive file is just a text file. However, I have no idea how to modify the lines in this template to create a text file generator script. Would it be possible for you to edit this template in .1sc format?

  • Engineers
Posted

You can use qbms to export/import. Only thing which is left is fixing StringSectionSize variable.

Posted
4 hours ago, h3x3r said:

You can use qbms to export/import. Only thing which is left is fixing StringSectionSize variable.

Unfortunately, it did not work with Quickbms.

  • Engineers
  • Solution
Posted (edited)

There you go...

###################################
get BaseFileName basename
endian big
getdstring Dummy 0x0C
get TableSize uint32
getdstring Dummy 0x08
get StrigCount uint32
getdstring Dummy 0x04
get StringSectionSize uint32
string FileName p= "%s.txt" BaseFileName

for i = 0 < StrigCount
	get StrCRC uint32
	get StrLen uint32
	savepos StrOffset
	math StrLen * 2
	getdstring LocString StrLen
	slog FileName StrOffset StrLen unicode
next i

And this one should fix it after reimport3.

//------------------------------------------------
//--- 010 Editor v14.0 Script File
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
//   History: 
//------------------------------------------------
BigEndian();

local uint32 i,j,k;

FSkip(8);
local uint32 TableStartOffset=FTell();
FSkip(4);
local uint32 TableSize=ReadUInt(FTell());
FSkip(12);
local uint32 StringCount=ReadUInt(FTell());
FSkip(8);
local uint32 StringSectionSize=ReadUInt(FTell());
FSkip(4);

local struct
{
    uint32 StrCRC=ReadUInt(FTell());
    FSkip(4);
    local uint32 StrLenPos=FTell();
    uint32 StrLen=ReadUInt(FTell());
    FSkip(4);
    local uint32 StrPos=FTell();
    wstring LocString=ReadWString(StrPos,StrLen);
    FSkip(StrLen * 2);
    local uint32 StrEndPos=FTell();
    InsertBytes(StrEndPos, 2, 0);
    FSkip(2);
    WriteUInt(StrLenPos, StrLen + 1);
}String[StringCount]<optimize=false>;

local uint32 StringSectionEndOffset=FTell();
local uint32 IdStringSize=ReadUInt(FTell());
FSkip(IdStringSize + 4);
local uint32 TableEndOffset=FTell();

local uint32 StrSectionSize=((StringSectionEndOffset - TableStartOffset) - (StringCount * 8) - 28);
local uint32 TabSize=(TableEndOffset - TableStartOffset);
WriteUInt(12, TabSize);
WriteUInt(32, StrSectionSize);
FileSave();

 

Edited by h3x3r
Posted (edited)
4 hours ago, h3x3r said:

İşte böyle...


Ve bu, reimport3'ten sonra düzelmeli.






 

get BaseFileName basename
endian big
getdstring Dummy 0x0C
get TableSize uint32
getdstring Dummy 0x08
get StrigCount uint32
getdstring Dummy 0x04
get StringSectionSize uint32

string FileName p= "%s.txt" BaseFileName

# Export: Save all strings to external txt file
for i = 0 < StrigCount
    get StrCRC uint32
    get StrLen uint32
    savepos StrOffset
    math StrLen *= 2
    getdstring LocString StrLen
    slog FileName StrOffset StrLen unicode
next i

# Reimport: Read back modified strings from txt
reimport FileName
goto 0x1C

for i = 0 < StrigCount
    get StrCRC uint32
    get StrLen uint32
    savepos StrOffset
    math StrLen *= 2
    getdstring OldStr StrLen
    reimport FileName
    getdstring NewStr StrLen FileName
    putdstring NewStr StrLen
next i
 

Edited by kosemen_76
  • Engineers
Posted

Create bat file and put this in it and save and run. It automatically updates StrLen based on string length in txt file. Use same script as for export.

quickbms.exe -G -w -r -r -r

 

Posted (edited)
21 minutes ago, h3x3r said:

Create bat file and put this in it and save and run. It automatically updates StrLen based on string length in txt file. Use same script as for export.

 

 

 

Ekran Görüntüsü (245).png

Edited by kosemen_76
Posted (edited)

Of course, I tried, but this is the result. There is no problem when exporting and importing in the original format, but when changing the format, this problem occurs.

 

Can't read 15898 bytes from offset 0000be62.
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%! 118690 48738 . offset 0000be62

Last script line before the error or that produced the error:
31 getdstring OldStr StrLen
coverage file 0 100%! 118690 48738 . offset 0000be62

 

 

After adding the import code to the script, it still gives this error when exporting.

Edited by kosemen_76
  • Engineers
Posted (edited)

so what is this then?

image.thumb.png.d8123709e8300246414d05dc7c9aebaa.png

You didn't update TableSize + StringSectionSize after reimport.

Edited by h3x3r
  • Engineers
Posted

Use BMS which i posted for export/re-import.

Do re-import only on clean unmodified files aka original. Never do re-import twice on single file. You fuck it up.

After re-import use 010 hex editor script on that file.

DONE!

Posted
21 hours ago, h3x3r said:

Use BMS which i posted for export/re-import.

Do re-import only on clean unmodified files aka original. Never do re-import twice on single file. You fuck it up.

After re-import use 010 hex editor script on that file.

DONE!

 

Ekran Görüntüsü (246).png

Thank you very much

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...