Sniper Elite 5 Text Files

How to translate the files of a game
Franco
Posts: 28
Joined: Sat May 14, 2022 11:03 pm

Sniper Elite 5 Text Files

Post by Franco »

Hello, how do we open Sniper Elite 5 text files? old games tools don't work.
This is a sample file, can you help?

https://www.mediafire.com/file/0fd3kzqu ... sniper.rar
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Sniper Elite 5 Text Files

Post by h3x3r »

I have a solution. But it requires 010 HEX Editor.
Here's BMS script for export a import with using reimport3_localizations.bat.
Note: You must do re-import on original file. If you do reimport on already modified file then it will fail.

Code: Select all

####################################
idstring "Asura   "
get MAGIC long
get FILESIZE long
getdstring FLAG 0x8
get STRCOUNT long
getdstring UNK 0xC

for i = 0 < STRCOUNT
   get CRC long
   get STRLEN long
   math STRLEN *= 2
   savepos STROFF
   getdstring TEXT STRLEN
   slog "" STROFF STRLEN unicode
next i

And here 010 Script for fixing file after re-import.

Code: Select all

//------------------------------------------------
//--- 010 Editor v11.0.1 Script File
//
//      File:
//   Authors:
//   Version:
//   Purpose:
//  Category:
//   History:
//------------------------------------------------
local uint FileCount,Hash,StrLen,StrOffset,StrLenOffset,Value,Size,Filesize,RefTextEnd,TempCount,RefTextSize,i;

FSeek(24);
FileCount=ReadUInt(FTell());
FSeek(40);
for(i=0;i<FileCount;i++)
local struct {
        Hash=ReadUInt(FTell());
        FSkip(4);
        StrLenOffset=FTell();
        StrLen=ReadUInt(FTell());
        Value=StrLen+1;
        Size=1;
        WriteUInt(StrLenOffset,Value);
        FSkip(4);
        StrOffset=FTell();
        FSkip(StrLen*2);
        InsertBytes(StrOffset+StrLen*2,2,0);
        FSkip(2);
}TextTable;
RefTextEnd=FTell();
TempCount=FileCount*8;
RefTextSize=RefTextEnd-TempCount-40;
FSeek(0);
Filesize=FileSize()-12;
WriteUInt(12,Filesize);
WriteUInt(32,RefTextSize);
FileSave();

Open re-imported file in 010 HEX Editor and run Script on it.
Also edit *.txt files preferably in NP++ for maintain code page.

Video tutorial
https://youtu.be/6eEsWb-5M64
And proof
https://youtu.be/mgkruTpjO1E

EDiT: Updated 010 script. Now it writes one value correctly. "WriteUInt(32,RefTextSize);"
Last edited by h3x3r on Fri Jun 10, 2022 11:43 pm, edited 2 times in total.
bornaghi
Posts: 17
Joined: Wed Jun 09, 2021 6:27 pm

Re: Sniper Elite 5 Text Files

Post by bornaghi »

The tool belongs to cousty#5208 is from XeNTaX Discord. Huge thanks to him.
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Sniper Elite 5 Text Files

Post by h3x3r »

Huge thanks for not working tool. This happens when import. Also there is some leftovers from uexp which is unreal engine thing.
Image
It's Turkish and it means Not found!
bornaghi
Posts: 17
Joined: Wed Jun 09, 2021 6:27 pm

Re: Sniper Elite 5 Text Files

Post by bornaghi »

h3x3r wrote:Huge thanks for not working tool. This happens when import. Also there is some leftovers from uexp which is unreal engine thing.
Image
It's Turkish and it means Not found!


He said if h3x3r looks the source codes, h3x3r will understand the situation.
Franco
Posts: 28
Joined: Sat May 14, 2022 11:03 pm

Re: Sniper Elite 5 Text Files

Post by Franco »

Thank you both very much for your help. I also thank you h3x3r for always helping people.