Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#] Convert Cheattable Files!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Petros
Cheater
Reputation: 0

Joined: 27 Feb 2007
Posts: 42

PostPosted: Sun Apr 06, 2008 3:29 pm    Post subject: [C#] Convert Cheattable Files! Reply with quote

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.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25859
Location: The netherlands

PostPosted: Sun Apr 06, 2008 4:43 pm    Post subject: Reply with quote

you can open them in cheat engine 5.4 without need to convert (It just gives a warning that it may be unsafe)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites