07-05-2013, 06:46 PM
(This post was last modified: 05-18-2014, 09:00 PM by NightmareX1337.)
CSHARP-Code:
public static class DataProc { public static byte[] DatToPlain(string filepath) { byte[] buffer = File.ReadAllBytes(filepath); byte[] decryptedtext = new byte[buffer.Length]; string password = Form1.Settings.dekey; // Decryption key if(string.IsNullOrEmpty(password)) return buffer; for(int i = 123, j = 0; i < buffer.Length; i++, j++) decryptedtext[j] = (byte)(buffer[i] - (byte)password[j % password.Length]); return decryptedtext; } public static void PlainToDat(string text, string filepath) { string password = Form1.Settings.enkey; // Encryption key string First123 = Program.Title; byte[] dat = new byte[123 + text.Length]; for (int i = 0; i < First123.Length && i < 123; i++) dat[i] = (byte)First123[i]; for (int i = First123.Length; i < 123; i++) dat[i] = 0; if(!string.IsNullOrEmpty(password)) for (int i = 0; i < text.Length; i++) dat[i + 123] = (byte)((byte)text[i] + (byte)password[i % password.Length]); else for (int i = 0; i < text.Length; i++) dat[i + 123] = (byte)text[i]; File.WriteAllBytes(filepath, dat); } } |
Hi,
Here is the DCing algorithm that i'm using it on my DCer (LF2.IDE)
The algorithm works fine and when i open saved files with -my DCer again or with- another DCer there is nothing weird but somehow LF2 crashes whenever i try to choose the saved character - there is no error while loading dat files
I saved my dat file -without changing it- with another DCer then everything was fine.
Please help :( so i can make my DCer much better :)
Thanks in Advance!..
Ultimately, my constant dissatisfaction with the way things are becomes the driving force behind everything I do.
LF2 IDE - Advanced visual data changer featuring instant data loader
LF2 Sprite Sheet Generator - Template based sprite sheet generator based on Gad's method
There is no perfect language, but C++ is the worst.
LF2 IDE - Advanced visual data changer featuring instant data loader
LF2 Sprite Sheet Generator - Template based sprite sheet generator based on Gad's method
There is no perfect language, but C++ is the worst.