[vbnet] LF2 Data Files... Halp? - Av23 - 10-19-2010
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.
RE: LF2 Data Files... Halp? - Alectric - 10-19-2010
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/data-changing/data-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
RE: LF2 Data Files... Halp? - Av23 - 10-19-2010
(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/data-changing/data-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.
RE: LF2 Data Files... Halp? - Alectric - 10-19-2010
oh, my apologies for misunderstanding :P
i have no idea then
Moved to programming forum btw
RE: LF2 Data Files... Halp? - Silverthorn - 10-19-2010
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.
RE: LF2 Data Files... Halp? - blow_fly98 - 10-19-2010
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...
RE: LF2 Data Files... Halp? - Av23 - 10-20-2010
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
|
RE: [vbnet] LF2 Data Files... Halp? - blow_fly98 - 10-20-2010
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
|
|