Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[vbnet] LF2 Data Files... Halp?
#1
? 
Hello everyones,

Just wondering but does anyone know the format of the LF2 data files? I'm a noob at programming (sort of) and I don't know how to decode the lf2 data files. Is it in hex (I doubt it)? Or something else?? If someone knows please reply. :)

And in case you are wondering, my goal here is to create a visual lf2 data changer. And the goal of that is to challenge my programming skills. :)

Thanks.
Reply
Thanks given by:
#2
Well, since you're new, and i cant be bothered raging, ill just be help out.

On the mainsite, there is a whole download section.

http://www.lf-empire.de/en/lf2-empire/da...ta-changer

download the data changer (not encrypters/decrypters)
Then just open up the data file with the program. Have a nice day.

Does this solve the problem/thread?

Yee be warned...flamers
Reply
Thanks given by: Alblaka
#3
(10-19-2010, 01:45 AM)Alectric Wrote:  Well, since you're new, and i cant be bothered raging, ill just be help out.

On the mainsite, there is a whole download section.

http://www.lf-empire.de/en/lf2-empire/da...ta-changer

download the data changer (not encrypters/decrypters)
Then just open up the data file with the program. Have a nice day.

Does this solve the problem/thread?

Yee be warned...flamers

Ya I know about the pre-made data changers. (I've been using this site for over 5 years)
But I want to know how they managed to decode the lf2-data files... Aka what is the format of the data files? I tried ascii, hex, and many many other random stuff that google told me to do. But everytime I get funny looking characters in my textboxes. :( I'm hoping its not one of the binary ones cuz that 'll take a really long time to decode............

btw If anyone has code, I'm using VB.NET. Yes I know it sucks but thats all they teach in high school... my school at least. :'(
Reply
Thanks given by:
#4
oh, my apologies for misunderstanding :P

i have no idea then

Moved to programming forum btw
Reply
Thanks given by:
#5
http://www.lf-empire.de/forum/showthread.php?tid=1877

If you know how java works, it should be fairly easy to port it to .net.
Silverthorn
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » devArt
Reply
Thanks given by:
#6
And if you are really lazy,
    VBNET-Code:
Public EncKey As String = "odBearBecauseHeIsVeryGoodSiuHungIsAGo"
    Public Function EncryptString(ByVal Contents As String) As Byte()
        Try
            Dim EncKeyLength As Integer = EncKey.Length
            Dim Encoding As New System.Text.ASCIIEncoding
            Dim ContentsBytes As System.Collections.Generic.List(Of Byte) = Encoding.GetBytes(Contents).ToList
            Dim ResultBytes As New System.Collections.Generic.List(Of Byte)
            Dim CountBuffer As Integer = 0
            Try
                For Each buffer As Byte In ContentsBytes
                    If buffer <> &HD Then
                        buffer += Asc(EncKey(CountBuffer))
                        ResultBytes.Add(buffer)
                        CountBuffer += 1
                    End If
                    If CountBuffer > EncKeyLength - 1 Then
                        CountBuffer = 0
                    End If
                Next
            Catch ex As Exception
 
            End Try
            Return ResultBytes.ToArray
        Catch ex As Exception
            Return New Byte() {}
        End Try
    End Function
 
    Public Function DecryptBytes(ByVal Contents() As Byte, Optional ByVal EncryptionKeyIndex As Integer = 0) As String
        Try
            Dim EncKeyLength As Integer = EncKey.Length
            Dim ResultString(Contents.Length - 1) As Char
            Dim ResultIndexBuffer As Integer = 0
            Dim CharBuffer As Integer
            Try
                For Each buffer As Byte In Contents
                    CharBuffer = buffer
                    CharBuffer -= Asc(EncKey.Chars(EncryptionKeyIndex))
                    ResultString(ResultIndexBuffer) = ChrW(CharBuffer)
                    ResultIndexBuffer += 1
                    EncryptionKeyIndex += 1
                    If EncryptionKeyIndex > EncKeyLength - 1 Then
                        EncryptionKeyIndex = 0
                    End If
                Next
            Catch ex As Exception
 
            End Try
            Return New String(ResultString)
        Catch ex As Exception
            Return String.Empty
        End Try
    End Function

You will have to try understand it by yourself.

Of course, that might not be the BEST method when it comes to speed, however VB.NET is not the best language either...
Hiding users' signatures and avatars was the best decision ever.
4ye 6anDy (Click to View)
We're watching you... (Click to View)
| Avatar made by Alectric |
Reply
Thanks given by: ethanara , Electric2Shock , A-Man
#7
Unfortunately I don't understand... :'( :'( :'( :s

I use filestream to open the file, but when I make the byte go through the decrypt function it returns negative values.

    VBNET-Code:
Public EncKey As String = "odBearBecauseHeIsVeryGoodSiuHungIsAGo"
 
    Private Sub mnuOpenTest_Click(ByVal sender As System.Object, _ 
ByVal e As System.EventArgs) _ 
Handles mnuOpenTest.Click
 
        opoOpenTest.FileName = Nothing
        opoOpenTest.ShowDialog()
 
        Dim strFileName As String = opoOpenTest.FileName
        Dim fs As New FileStream _ 
(strFileName, FileMode.Open, FileAccess.Read)
 
        Dim Filesss As New StreamReader(fs)
 
        Dim encoding As New System.Text.ASCIIEncoding
 
        Do While Filesss.Peek() > -1
 
            Dim Superbyte() As Byte = encoding.GetBytes(Filesss.ReadLine())
 
            Me.txtText.Text &= DecryptBytes(Superbyte)
        Loop
 
    End Sub
 
    Public Function DecryptBytes(ByVal Contents() As Byte, Optional ByVal EncryptionKeyIndex As Integer = 0) As String
        Try
            Dim EncKeyLength As Integer = EncKey.Length
            Dim ResultString(Contents.Length - 1) As Char
            Dim ResultIndexBuffer As Integer = 0
            Dim CharBuffer As Integer
            Try
                For Each buffer As Byte In Contents
                    CharBuffer = buffer
                    CharBuffer -= Asc(EncKey.Chars(EncryptionKeyIndex))
                    ResultString(ResultIndexBuffer) = ChrW(CharBuffer)
                    ResultIndexBuffer += 1
                    EncryptionKeyIndex += 1
                    If EncryptionKeyIndex > EncKeyLength - 1 Then
                        EncryptionKeyIndex = 0
                    End If
                Next
            Catch ex As Exception
 
            End Try
            Return New String(ResultString)
        Catch ex As Exception
            Return String.Empty
        End Try
    End Function

Reply
Thanks given by:
#8
You don't decrypt line by line for DAT files. It's decrypted as a whole.
Also, I have to add that you decrypt everything BUT THE FIRST 123 BYTES.
So, basically something like,
    VBNET-Code:
Public Function Open(ByVal filename As String) As String
        Dim stuff() as Byte = System.IO.File.ReadAllBytes(filename)
        Dim copied() as Byte
        '....Do stuff here to copy everything from stuff to copied EXCEPT THE FIRST 123 BYTES
        Return DecryptBytes(copied)
    End Sub
 
    Public Function DecryptBytes(ByVal Contents() As Byte, Optional ByVal EncryptionKeyIndex As Integer = 0) As String
        Try
            Dim EncKeyLength As Integer = EncKey.Length
            Dim ResultString(Contents.Length - 1) As Char
            Dim ResultIndexBuffer As Integer = 0
            Dim CharBuffer As Integer
            Try
                For Each buffer As Byte In Contents
                    CharBuffer = buffer
                    CharBuffer -= Asc(EncKey.Chars(EncryptionKeyIndex))
                    ResultString(ResultIndexBuffer) = ChrW(CharBuffer)
                    ResultIndexBuffer += 1
                    EncryptionKeyIndex += 1
                    If EncryptionKeyIndex > EncKeyLength - 1 Then
                        EncryptionKeyIndex = 0
                    End If
                Next
            Catch ex As Exception
 
            End Try
            Return New String(ResultString)
        Catch ex As Exception
            Return String.Empty
        End Try
    End Function
Hiding users' signatures and avatars was the best decision ever.
4ye 6anDy (Click to View)
We're watching you... (Click to View)
| Avatar made by Alectric |
Reply
Thanks given by: Av23




Users browsing this thread: 1 Guest(s)