XeNTaX Forum Index
Forum Home Tools Blog GFFC MultiEx
It is currently Fri Sep 03, 2010 6:20 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 48 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Settlers VI bba archives
PostPosted: Sun Sep 30, 2007 9:38 am 
Offline
VVIP member
VVIP member

Joined: Wed Oct 18, 2006 9:48 pm
Posts: 648
Location: Germany
Documentation on the bba format used in Settlers V can be found in the xentax wiki:
http://wiki.xentax.com/index.php/Settle ... e_Of_Kings

Here are some example files from the new tilte:
http://uploaded.to/?id=kzeb9s

Any help appreciated :)

EDIT: atm I can't figure out the encryption algorithm cause I don't have a No-CD, thus the copy protection is preventing me from disassembling the exe.

_________________
Image

Remember: If you don't want to program a tool yourself, hack another one :wink:
__________
http://www.gameformats.de.vu


Top
 Profile  
 
 
 Post subject:
PostPosted: Mon Oct 08, 2007 11:44 pm 
Offline
advanced

Joined: Mon Oct 08, 2007 10:19 pm
Posts: 78
Location: Leiden, The Netherlands
Dear Rheini,


First of all, thanks for the format you posted on the WiKi :) I would love to be able to extract the audio from the songs the viking character sings :)

I've went ahead and started on a vb.net program to read the initial headers, any extra info is appreciated a lot (i have my own CRC32 routine, that isn't the problem, just new to the decryption).

I am already running into problems on the Header (Directory*) data, since i am reading the encrypted data. Any pointers would be appreciated :)

Don't know if it's usefull, but here's what i've done so far (not much:))

Updated to show new built output
Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim DirectoryEncryptionIdentifiers As New Dictionary(Of UInt32, List(Of String))

        For Each FI As IO.FileInfo In New IO.DirectoryInfo("F:\THE SETTLERS - Rise of an Empire Install\base\bba\").GetFiles("*.bba")
            Dim B As BAF = ReadBAF(FI.FullName)
            If DirectoryEncryptionIdentifiers.ContainsKey(B.Header.DirectoryEncryptionIdentifier) Then
                DirectoryEncryptionIdentifiers(B.Header.DirectoryEncryptionIdentifier).Add(B.FileName)
            Else
                Dim Files As New List(Of String)
                Files.Add(B.FileName)
                DirectoryEncryptionIdentifiers.Add(B.Header.DirectoryEncryptionIdentifier, Files)
            End If
        Next
        For Each Key As UInt32 In DirectoryEncryptionIdentifiers.Keys
            Debug.WriteLine(String.Format("{1}Key: 0x{0} is used By:", Key.ToString("X"), vbCrLf))
            For Each File As String In DirectoryEncryptionIdentifiers(Key)
                Debug.Write(String.Format("{0}{1}{2}", vbTab, File, vbCrLf))
            Next
        Next
        '        ReadBAF("F:\THE SETTLERS - Rise of an Empire Install\base\bba\shrgcfg0.bba")
    End Sub

    Private Function ReadBAF(ByVal FileName As String) As BAF
        Dim Result As New BAF
        Result.FileName = IO.Path.GetFileName(FileName)
        If IO.File.Exists(FileName) Then
            Using BR As New IO.BinaryReader(New IO.FileStream(FileName, IO.FileMode.Open, IO.FileAccess.Read))
                Result.ArchiveHeader = BR.ReadChars(3)
                Result.Version = BR.ReadByte
                Result.Unknown = BR.ReadUInt32
                Result.HeaderSize = BR.ReadUInt32
                Result.HeaderEncryptionIdentifier = BR.ReadUInt32
                If Result.HeaderEncryptionIdentifier = &H29D58DC5 Then
                    '  Debug.WriteLine("Known Encryption Header :)")
                Else
                    Debug.WriteLine("UnKnown Encryption Header :( => " & Result.HeaderEncryptionIdentifier.ToString("X"))
                End If
                Result.Header = New BAFHeader
                Result.Header.DirectoryOffsetLow = BR.ReadUInt32
                Result.Header.DirectoryOffsetHigh = BR.ReadUInt32
                Result.Header.DirectoryLength = BR.ReadUInt32
                Result.Header.DirectoryCRC32CheckSum = BR.ReadUInt32
                Result.Header.DirectoryEncryptionIdentifier = BR.ReadUInt32
                Dim Padding As Integer = Result.HeaderSize - 20
                If Padding > 0 Then Result.Header.Padding = BR.ReadBytes(Padding)
            End Using
            Debug.WriteLine(BAF2String(Result))
        Else
            Debug.WriteLine(String.Format("'{0}' does not exist...", FileName))
        End If
        Return Result
    End Function
    Private Function BAF2String(ByVal B As BAF) As String
        Dim Result As String = String.Empty
        Result &= "File                           : " & B.FileName & vbCrLf
        Result &= "Archive Header                 : " & B.ArchiveHeader & vbCrLf
        Result &= "Version                        : " & B.Version & vbCrLf
        Result &= "Unknown                        : " & B.Unknown & vbCrLf
        Result &= "Header Size                    : " & B.HeaderSize & vbCrLf
        Result &= "Header Encryption Identifier   : " & "0x" & B.HeaderEncryptionIdentifier.ToString("X") & vbCrLf
        Result &= "Directory Offset Low           : " & B.Header.DirectoryOffsetLow & vbCrLf
        Result &= "Directory Offset High          : " & B.Header.DirectoryOffsetHigh & vbCrLf
        Result &= "Directory Length               : " & B.Header.DirectoryLength & vbCrLf
        Result &= "Directory CRC32 CheckSum       : " & "0x" & B.Header.DirectoryCRC32CheckSum.ToString("X") & vbCrLf
        Result &= "Directory Encryption Identifier: " & "0x" & B.Header.DirectoryEncryptionIdentifier.ToString("X") & vbCrLf
        Return Result
    End Function
End Class
Public Structure BAF
    Dim FileName As String
    Dim ArchiveHeader As String ' BAF
    Dim Version As Byte ' 4
    Dim Unknown As UInt32 ' 5
    Dim HeaderSize As UInt32  ' 64
    Dim HeaderEncryptionIdentifier As UInt32 ' 0x29D58DC5
    Dim Header As BAFHeader
End Structure
Public Structure BAFHeader ' Encrypted!
    Dim DirectoryOffsetLow As UInt32
    Dim DirectoryOffsetHigh As UInt32 ' null
    Dim DirectoryLength As UInt32
    Dim DirectoryCRC32CheckSum As UInt32
    Dim DirectoryEncryptionIdentifier As UInt32
    Dim Padding() As Byte
End Structure


Sincerely,


Nick Kusters.


Last edited by NKCSS on Tue Oct 09, 2007 12:05 am, edited 2 times in total.

Top
 Profile  
 
 
 Post subject:
PostPosted: Mon Oct 08, 2007 11:54 pm 
Offline
VVIP member
VVIP member

Joined: Wed Oct 18, 2006 9:48 pm
Posts: 648
Location: Germany
Well, I think they changed some parts of the file format (had a look at the memory dump)
Reading the encrypted values doesn't get you further. As already said I can't crack the encryption cause of the copy protection. I'd need a nocd.

_________________
Image

Remember: If you don't want to program a tool yourself, hack another one :wink:
__________
http://www.gameformats.de.vu


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 12:02 am 
Offline
advanced

Joined: Mon Oct 08, 2007 10:19 pm
Posts: 78
Location: Leiden, The Netherlands
Maybe it's a coincidence, but take a look at the following (list in the end in particular):


Code:
File                           : lngencfg0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 1196988368
Directory Offset High          : 3871155334
Directory Length               : 2058234415
Directory CRC32 CheckSum       : 0xDD03B3C5
Directory Encryption Identifier: 0x45C0E120

File                           : lngencfg1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngengfx0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 3606262391
Directory Offset High          : 879410701
Directory Length               : 1065294082
Directory CRC32 CheckSum       : 0xA8C04462
Directory Encryption Identifier: 0xAB9B9126

File                           : lngengfx1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngensnd0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 2959249868
Directory Offset High          : 3740051079
Directory Length               : 1520614706
Directory CRC32 CheckSum       : 0xE0AC2FC3
Directory Encryption Identifier: 0x260937EA

File                           : lngensnd1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngenvid0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 4192530955
Directory Offset High          : 3751230659
Directory Length               : 4002790725
Directory CRC32 CheckSum       : 0x8EF74859
Directory Encryption Identifier: 0x53727CFB

File                           : lngenvid1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngnlcfg0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 3570510255
Directory Offset High          : 3965622274
Directory Length               : 2881330263
Directory CRC32 CheckSum       : 0xDC3923E9
Directory Encryption Identifier: 0xF514FFBC

File                           : lngnlcfg1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngnlgfx0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 1376497629
Directory Offset High          : 1317855434
Directory Length               : 1009338530
Directory CRC32 CheckSum       : 0xDB298A73
Directory Encryption Identifier: 0x411B5FF8

File                           : lngnlgfx1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngnlsnd0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngnlsnd1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngnlvid0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : lngnlvid1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : shrgcfg0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 2975153854
Directory Offset High          : 3553821097
Directory Length               : 1591050018
Directory CRC32 CheckSum       : 0x5568F363
Directory Encryption Identifier: 0x4D38FD74

File                           : shrgcfg1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 1960815207
Directory Offset High          : 3462568127
Directory Length               : 1108658202
Directory CRC32 CheckSum       : 0xC3FAE21E
Directory Encryption Identifier: 0x3D580DEE

File                           : shrgmap0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 2647765936
Directory Offset High          : 1909630748
Directory Length               : 2636763174
Directory CRC32 CheckSum       : 0xCBBD6527
Directory Encryption Identifier: 0x236D5A34

File                           : shrgmap1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 800859420
Directory Offset High          : 1607494606
Directory Length               : 828932505
Directory CRC32 CheckSum       : 0xC0DBC58E
Directory Encryption Identifier: 0x991B2868

File                           : shrlgfx0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 3546334276
Directory Offset High          : 2611121269
Directory Length               : 534973197
Directory CRC32 CheckSum       : 0xC597E6F5
Directory Encryption Identifier: 0x3AA333D2

File                           : shrlgfx1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : shrlmnu0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 1040582878
Directory Offset High          : 2454405875
Directory Length               : 2821459722
Directory CRC32 CheckSum       : 0x82B83BB5
Directory Encryption Identifier: 0x5BA1F7F2

File                           : shrlmnu1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : shrlsnd0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 3131505170
Directory Offset High          : 2427431120
Directory Length               : 2667128408
Directory CRC32 CheckSum       : 0xFBAFA158
Directory Encryption Identifier: 0xCB280D2F

File                           : shrlsnd1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : shrlvid0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 4278376358
Directory Offset High          : 3711618061
Directory Length               : 2464262524
Directory CRC32 CheckSum       : 0x8AEB58C8
Directory Encryption Identifier: 0x6B481406

File                           : shrlvid1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F

File                           : shrtmed0.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 1036181376
Directory Offset High          : 3818352367
Directory Length               : 3866723845
Directory CRC32 CheckSum       : 0xC90CB949
Directory Encryption Identifier: 0x761DBC8C

File                           : shrtmed1.bba
Archive Header                 : BAF
Version                        : 4
Unknown                        : 5
Header Size                    : 64
Header Encryption Identifier   : 0x29D58DC5
Directory Offset Low           : 39847937
Directory Offset High          : 931131212
Directory Length               : 1924721570
Directory CRC32 CheckSum       : 0xC5D84FDF
Directory Encryption Identifier: 0x7CDBA52F


Key: 0x45C0E120 is used By:
   lngencfg0.bba

Key: 0x7CDBA52F is used By:
   lngencfg1.bba
   lngengfx1.bba
   lngensnd1.bba
   lngenvid1.bba
   lngnlcfg1.bba
   lngnlgfx1.bba
   lngnlsnd0.bba
   lngnlsnd1.bba
   lngnlvid0.bba
   lngnlvid1.bba
   shrlgfx1.bba
   shrlmnu1.bba
   shrlsnd1.bba
   shrlvid1.bba
   shrtmed1.bba

Key: 0xAB9B9126 is used By:
   lngengfx0.bba

Key: 0x260937EA is used By:
   lngensnd0.bba

Key: 0x53727CFB is used By:
   lngenvid0.bba

Key: 0xF514FFBC is used By:
   lngnlcfg0.bba

Key: 0x411B5FF8 is used By:
   lngnlgfx0.bba

Key: 0x4D38FD74 is used By:
   shrgcfg0.bba

Key: 0x3D580DEE is used By:
   shrgcfg1.bba

Key: 0x236D5A34 is used By:
   shrgmap0.bba

Key: 0x991B2868 is used By:
   shrgmap1.bba

Key: 0x3AA333D2 is used By:
   shrlgfx0.bba

Key: 0x5BA1F7F2 is used By:
   shrlmnu0.bba

Key: 0xCB280D2F is used By:
   shrlsnd0.bba

Key: 0x6B481406 is used By:
   shrlvid0.bba

Key: 0x761DBC8C is used By:
   shrtmed0.bba


Are you sure this header is encrypted? Seems odd that so many files would have the same EncryptionKey (after encryption).


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 12:05 am 
Offline
VVIP member
VVIP member

Joined: Wed Oct 18, 2006 9:48 pm
Posts: 648
Location: Germany
Well it's just a guess that the files are encrypted, at least the directory.
But where do you know that this the encryption key?

_________________
Image

Remember: If you don't want to program a tool yourself, hack another one :wink:
__________
http://www.gameformats.de.vu


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 12:09 am 
Offline
advanced

Joined: Mon Oct 08, 2007 10:19 pm
Posts: 78
Location: Leiden, The Netherlands
Oh, sorry, i just now see that your are talking about settlers 5, not 6, sorry :(

I built it from spec at http://wiki.xentax.com/index.php/Settle ... _An_Empire


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 12:29 am 
Offline
VVIP member
VVIP member

Joined: Wed Oct 18, 2006 9:48 pm
Posts: 648
Location: Germany
I see. Thanks for the info, I didn't know nevermind already found something out.

_________________
Image

Remember: If you don't want to program a tool yourself, hack another one :wink:
__________
http://www.gameformats.de.vu


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 2:46 pm 
Offline
VVIP member
VVIP member

Joined: Wed Oct 18, 2006 9:48 pm
Posts: 648
Location: Germany
But I doubt he will give us the algorithm.

_________________
Image

Remember: If you don't want to program a tool yourself, hack another one :wink:
__________
http://www.gameformats.de.vu


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 6:22 pm 
Offline
advanced

Joined: Mon Oct 08, 2007 10:19 pm
Posts: 78
Location: Leiden, The Netherlands
To bad :( Without the bold parts, we'll be lost :(

Quote:
The encryption algorithm is a modified TEA version (it has the same characteristic bitshifts)
There exists multiple versions of the same algorithm but with different 128-bit keys and different deltas
The Encryption Identifier will tell you which algorithm to use

...

Example: We have a file with File Type Identifier 1. We look at slot 1 of the encryption table and will find the value: 0x9BB3F065. This tells us that we have a file that is compressed and that the first 16 Bytes of the filedata are encrypted with a simple XOR-algorithm.


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 7:43 pm 
Offline
ultra-n00b

Joined: Tue Oct 09, 2007 3:38 pm
Posts: 3
You can find out the decryption algorithm by disassembling the exe of Settlers 5 - it's the same, just look for the constant 0x9E3779B9. But without the right keys it's useless. Don't ask for them - I don't know :D

PS: PNG or MP3 files are not compressed or encrypted. Maybe you can extract the music without the knowledge of the algorithms :)


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 7:59 pm 
Offline
advanced

Joined: Mon Oct 08, 2007 10:19 pm
Posts: 78
Location: Leiden, The Netherlands
nevermind wrote:
You can find out the decryption algorithm by disassembling the exe of Settlers 5 - it's the same, just look for the constant 0x9E3779B9. But without the right keys it's useless. Don't ask for them - I don't know :D

PS: PNG or MP3 files are not compressed or encrypted. Maybe you can extract the music without the knowledge of the algorithms :)


Wouldn't I need to know how to decrypt the data in the header to find the position of the directory structure, which in turn is required to find the data files? The offsets don't make sense at this time (thanks for the info tho).

I probably won't get any further on my own, I have no experience with dissasembling exe's (as a .NET developer, I only deal with managed languages. This also means I havn't had the need for a debugger other then the one MS ships with Visual Studio...).

In short: I need help :)


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 8:13 pm 
Offline
VVIP member
VVIP member

Joined: Wed Oct 18, 2006 9:48 pm
Posts: 648
Location: Germany
At the moment we can't do anything unless we get an exe with removed copy protection (e.g. most No-CDs)
We need the right keys to decrypt the directory.

_________________
Image

Remember: If you don't want to program a tool yourself, hack another one :wink:
__________
http://www.gameformats.de.vu


Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 09, 2007 8:36 pm 
Offline
advanced

Joined: Mon Oct 08, 2007 10:19 pm
Posts: 78
Location: Leiden, The Netherlands
Well, I started to look at files with a HEX editor, most of the small files are 100% alike, but other then that, I didn't notice much.

All *1.bba files are 1kb, with only two exceptions:

shrgcfg1.bba (7KB)
shrgmap1.bba (well over 5 MB)

I did find something interesting when viewing the files with a hex editor.

The file lngnlgfx0.bba has a unencrypted PNG file header (89 50 4e 47 0d 0a 1a 0a), starting at address 0x50, 0x3E4C0 and 0x5F308.
This means the first 80 bytes must be the header, according to the specs, this adds up, so far, so good.

Update
Decided to check all files, another unencrypted png header was found:
shrgmap1.bba Found PNG header (89 50 4E 47 0D 0A 1A 0A) @ 0x551868
/Update

The fact that in the specs it says
Quote:
byte {44} - null

is wrong, there is data there.

Something else i tried to check was find multiple instances of 0x29D58DC5 to hopefully locate the directory entry. No such luck, so that entry must eather be encrypted or just not present. Without that info, we don't know how big the files are, etc :-/

So far, it's all confusing, but I am glad i at least could find out some more bits and pieces :)


Top
 Profile  
 
 
 Post subject:
PostPosted: Thu Oct 11, 2007 2:32 am 
Offline
advanced

Joined: Mon Oct 08, 2007 10:19 pm
Posts: 78
Location: Leiden, The Netherlands
Well, at least there is some good news :P

I have managed to write a small tool that is able to extract mp3's from the archives.

In short: I've implemented the MP3 format, created a file scanner to look for the format and use the MP3 headers to calculate the required positions.

There are still a lot of bugs, etc, and I edit code on the fly at the moment, so nothing worthy of releasing yet, but as soon as I have put something togeather that is usable by other people, I'll make sure to post it here.

So far I was able to extract about 80-90% of all mp3's inside, so I am quite happy :) I was also able to find the songs I was looking for.

To make sure other people won't miss out on these great songs, I'll work on a stand alone tool that extracts the three songs I have found only (I can do that safely).

Cheers,


Nick Kusters.


Top
 Profile  
 
 
 Post subject:
PostPosted: Thu Oct 11, 2007 10:14 am 
Offline
VVIP member
VVIP member

Joined: Wed Oct 18, 2006 9:48 pm
Posts: 648
Location: Germany
Good Work!
NKCSS wrote:
To make sure other people won't miss out on these great songs, I'll work on a stand alone tool that extracts the three songs I have found only (I can do that safely).

Why create a tool for 3 songs :?: Why don't you just release those 3 songs in an archive, isn't that easier?

_________________
Image

Remember: If you don't want to program a tool yourself, hack another one :wink:
__________
http://www.gameformats.de.vu


Top
 Profile  
 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


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:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group