We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy of data in https://github.com/darklab8/fl-server-vanilla/tree/master/docs/fladmin_inspiration
using System; using System.IO; namespace LibreLancer.Data.Save { public static class FlCodec { const uint FLS1 = 0x31534C46; //FLS1 string public static byte[] DecodeBytes(byte[] input) { if (input.Length < 4) return input; if (BitConverter.ToUInt32(input, 0) == FLS1) return Crypt(input, 4, input.Length - 4); return input; } public static byte[] ReadFile(string file) => DecodeBytes(File.ReadAllBytes(file)); public static void WriteFile(byte[] bytes, string file) { using(var writer = new BinaryWriter(File.Create(file))) { writer.Write(FLS1); writer.Write(Crypt(bytes, 0, bytes.Length)); } } static readonly byte[] gene = new byte[] { (byte)'G', (byte)'e', (byte)'n', (byte)'e' }; static byte[] Crypt(byte[] buf, int offset, int len) { byte[] output = new byte[len]; for (int i = 0; i < len; i++) output[i] = (byte)(buf[offset + i] ^ (byte)((gene[i & 3] + i) | 0x80)); return output; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Copy of data in https://github.com/darklab8/fl-server-vanilla/tree/master/docs/fladmin_inspiration
Relevant information for inspiration
The text was updated successfully, but these errors were encountered: