Petros Cheater
Reputation: 0
Joined: 27 Feb 2007 Posts: 42
|
Posted: Sun Apr 06, 2008 3:29 pm Post subject: [C#] Convert Cheattable Files! |
|
|
Here is a simple function to convert cheattable files (.ct files) in .net 2.0
If you want syntax highlighting:
http://pastebin.com/f4a685424
| Code: |
private void convert(string file2convert,string newfilepath,string newprefix)
{
//Get the orginal file loaded in a byte array
byte[] filebytes = File.ReadAllBytes(file2convert);
//Load up the new prefix in a byte array (must be 11 bytes long)
byte[] newbytes = System.Text.Encoding.ASCII.GetBytes(newprefix);
int i = 0;
//overwrite the first 11 bytes with the new bytes
while(i != 11)
{
filebytes.SetValue(newbytes[i], i);
i++;
}
//Save the converted file
File.WriteAllBytes(newfilepath, filebytes);
} |
Here is an example of usage:
| Code: |
string zenosenginect = @"C:\zenos.ct";
string cheatenginect = @"C:\cheatengine.ct";
string prefix = "CHEATENGINE";
convert(zenoenginect,cheatenginect,prefix);
|
This will make a new file called cheatengine.ct that has all the cheats that are saved the C:\zenos.ct but you can open it in cheatengine 5.3+. The prefix to different engines can be found by opening the .ct files in notepad (but dont try editing them in notepad because it won't work..if you must do it manually use a hex editor).
*NOTE*
I'm not sure if you still can't open other engines cheattables now that cheatengine 5.4 is out so don't flame me if you can.
|
|