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 


How to Change DAT Files be text in CE Trainer ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
MateeJr GT
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2017
Posts: 66

PostPosted: Sat Jul 14, 2018 4:02 am    Post subject: How to Change DAT Files be text in CE Trainer ? Reply with quote

How change SAVE.DAT Be Text? I Will drag Dat to some Panel , Then it changesit be text on ceedit
_________________
Hi Lynxz Gaming
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sat Jul 14, 2018 9:59 am    Post subject: Reply with quote

um, by reversing the format?

"dat" is a fairly generic file extension like "sav" and "bak". It could be pure text/json/xml or it could be some binary format that has to be read and converted to text based on the way the game writes to it.

I haven't done any drag and drop stuff myself but I assume there's an event for it that would provide the file path and you'd just open that file and do whatever with it using the same lua code you would for any file (google surely has dozens of examples for file io in lua). quick google suggests setting "AllowDropFiles" and the event "OnDropFiles", opening CE I don't see that event on the edit box but it is on the form itself so you may not be able to make it that specific...

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
MateeJr GT
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2017
Posts: 66

PostPosted: Sat Jul 14, 2018 9:43 pm    Post subject: Reply with quote

make example
_________________
Hi Lynxz Gaming
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sat Jul 14, 2018 9:55 pm    Post subject: Reply with quote

of what?

reversing the format or dropping a file on a form? For the first, google. For the second... what don't you understand? If you don't know how to create an event on the form click the ... button in the event panel, if you don't know how to read a file, google (it's pretty simple for text files but there's multiple different ways, particularly for binary files), if you don't know how to set the text of an edit box, FormName.EditName.Text = ...

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
MateeJr GT
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2017
Posts: 66

PostPosted: Sat Jul 14, 2018 9:57 pm    Post subject: Reply with quote

make picture
_________________
Hi Lynxz Gaming
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Sat Jul 14, 2018 10:20 pm    Post subject: Re: How to Change DAT Files be text in CE Trainer ? Reply with quote

MateeJr Gaming wrote:
How change SAVE.DAT Be Text? I Will drag Dat to some Panel , Then it changesit be text on ceedit

why you are making things so complex?
if its a simple text (plaintext) then open it using notepad.exe (or simply change file extension to .txt)

in case its not a plaintext, then this would require some reverse engineering. (REing the program that can read/write to this file)

another idea is, if you are interested in modifying couple bytes only then make two versions of the file.
assuming save.dat contains some data related to player:
- backup current file
- play a bit, save
- compare both files

done.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
MateeJr GT
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2017
Posts: 66

PostPosted: Sun Jul 15, 2018 7:21 am    Post subject: Reply with quote

i know it can open with notepad
I want show on trainer

_________________
Hi Lynxz Gaming
Back to top
View user's profile Send private message
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Mon Jul 16, 2018 5:34 am    Post subject: Reply with quote

MateeJr Gaming wrote:
i know it can open with notepad
I want show on trainer

then use io.open

Code:

readfile = io.open(the save.dat path, "r")
UDF1.CEMemo1.Text = readfile:read("*a")
readfile:close()

_________________
my english is bad
discord : rynx#9828
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
MateeJr GT
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2017
Posts: 66

PostPosted: Mon Jul 16, 2018 7:10 am    Post subject: Reply with quote

Lynxz Gaming wrote:
MateeJr Gaming wrote:
i know it can open with notepad
I want show on trainer

then use io.open

Code:

readfile = io.open(the save.dat path, "r")
UDF1.CEMemo1.Text = readfile:read("*a")
readfile:close()

NAH! , YOU IS THE BEST! HELPER WITH A SCRIPT!
NOT ASKING BACK!!
THANKS LYNXZ
I Even Try, But there error on Text : save and readfile
More Explain Lynxz?

_________________
Hi Lynxz Gaming
Back to top
View user's profile Send private message
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Tue Jul 17, 2018 6:20 am    Post subject: Reply with quote

Code:

readfile = io.open(os.getenv("localappdata").."\\Growtopia/save.dat", "r")
print(readfile:read("*a"))
readfile:close()

just press execute.

ik its shows nothing i think cuz unicode, but it work to read like .ct, .txt, etc

_________________
my english is bad
discord : rynx#9828
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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