Decoding the account ID in 'name' file
-
This information might be useful for someone else. The ‘name’ file in each players account directory contains an encoded version of the player’s account ID. (The account ID is used in log files generated by a number of programs including flhook, flserver and cheaters death)
The following C# code can be used to decode it:
string accountIdFilePath="C:\\Documents and Settings\\Us\My Documents\\My Games\\Freelancer\\Accts\\MultiPlayer\\23-0b447705\\name"; // Read a 'name' file into memory. FileStream fs = System.IO.File.OpenRead(accountIdFilePath); byte[] buf = new byte[fs.Length]; fs.Read(buf, 0, (int)fs.Length); fs.Close(); // Decode the account ID string accountID = ""; for (int i = 0; i < buf.Length; i += 2) { switch (buf[i]) { case 0x43: accountID += '-'; break; case 0x0f: accountID += 'a'; break; case 0x0c: accountID += 'b'; break; case 0x0d: accountID += 'c'; break; case 0x0a: accountID += 'd'; break; case 0x0b: accountID += 'e'; break; case 0x08: accountID += 'f'; break; case 0x5e: accountID += '0'; break; case 0x5f: accountID += '1'; break; case 0x5c: accountID += '2'; break; case 0x5d: accountID += '3'; break; case 0x5a: accountID += '4'; break; case 0x5b: accountID += '5'; break; case 0x58: accountID += '6'; break; case 0x59: accountID += '7'; break; case 0x56: accountID += '8'; break; case 0x57: accountID += '9'; break; default: accountID += '?'; break; } } [/i]
-
It’s a source code, you compile it and then you run it with windows explorer.
-
That’s C# coding, you need Visual Studio to compile it. Plus, that’s just “utility” code; you need to have a program call the function as all it does is decrypt the name from the file given by accountIdFilePath. You’d need to wrap a function around it and call it from some code to have it do something.
-
-
For my VB.NET Brothers (a deadly silence) oh well:
Dim strAccountIDFilePath as string = "C:\Documents and Settings\Us\My Documents\My Games\Freelancer\\Accts\MultiPlayer\23-0b447705\name" Dim fs as Filestream = System.IO.File.OpenRead(strAccountIDFilePath) Dim buf as Byte() = New Byte(fs.Length) Dim accountID as string = Nothing fs.Read(buf,0,fs.Length) fs.Close() For i As Integer = 0 To buf.Length - 1 Step 2 Select Case buf(i) Case &H43 accountID += "-"c Exit Select Case &Hf accountID += "a"c Exit Select Case &Hc accountID += "b"c Exit Select Case &Hd accountID += "c"c Exit Select Case &Ha accountID += "d"c Exit Select Case &Hb accountID += "e"c Exit Select Case &H8 accountID += "f"c Exit Select Case &H5e accountID += "0"c Exit Select Case &H5f accountID += "1"c Exit Select Case &H5c accountID += "2"c Exit Select Case &H5d accountID += "3"c Exit Select Case &H5a accountID += "4"c Exit Select Case &H5b accountID += "5"c Exit Select Case &H58 accountID += "6"c Exit Select Case &H59 accountID += "7"c Exit Select Case &H56 accountID += "8"c Exit Select Case &H57 accountID += "9"c Exit Select Case Else accountID += "?"c Exit Select End Select Next
This has not been tested properly but it should work…:P