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 


Exporting Search Result Data

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Gravy
How do I cheat?
Reputation: 0

Joined: 28 Sep 2012
Posts: 2

PostPosted: Fri Sep 28, 2012 3:30 am    Post subject: Exporting Search Result Data Reply with quote

So I've captured a whole lot of strings from a game and I need to export them. I've found no way of exporting the string value other than double clicking and copying for each of the 200+ results (this scan).

Is there something I'm missing? Any advice? Anything?

I'll be exporting more than 60,000 in the long run so clicking one at a time isn't really practical.

The form it comes out as doesn't really matter, if there's something else I can export that will carry that data in any way. Other than a full process memory dump which takes 2gb+.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Sep 28, 2012 3:38 am    Post subject: Reply with quote

Just execute this script in lua and you will be able to paste it into notepad

Code:

ms=getCurrentMemscan()
fl=memscan_getAttachedFoundlist(ms)

count=foundlist_getCount(fl)

result=""
for i=0,count-1 do
  result=result..foundlist_getAddress(fl, i).." - "..foundlist_getValue(fl,i).."\n\r\n\r"
end

writeToClipboard(result)


(alternatively you could just write the result file directly to a file using the io. routines)

_________________
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
Gravy
How do I cheat?
Reputation: 0

Joined: 28 Sep 2012
Posts: 2

PostPosted: Fri Sep 28, 2012 5:47 am    Post subject: Reply with quote

Thanks that was almost what I wanted, though I worded my question slightly wrong. I actually wanted the results from the address list as I had to resize the string length to get the full length text. Only the beginning was non-variant.

Thanks for the push in the right direction, I finally know what LUA is now and have a rough idea how to play with it.

Here's my modification to that script for anyone who may need it.

Code:
addresslist=getAddressList()
count = addresslist_getCount(addresslist)

result=""
for i=0,count-1 do
 record = addresslist_getMemoryRecord(addresslist, i)
 result=result..memoryrecord_getValue(record).."\n\r\n\r"
end

writeToClipboard(result)




P.S. You're work on Cheat Engine is really appreciated.



Added:

Unfortunately LUA seems to support a max string length of 255 characters. This is less than the length of the string that's showing in Cheat Engine.

Do you have any other solution to this?

"(alternatively you could just write the result file directly to a file using the io. routines)"
I'd also appreciate a hint on what/how one would do this.

Kindly appreciated.


Last edited by Gravy on Fri Sep 28, 2012 8:46 am; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Sep 28, 2012 8:10 am    Post subject: Reply with quote

No, this is a limit of the addresslist
You could try using readString on the address of the cheatentry

_________________
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
Gravy
How do I cheat?
Reputation: 0

Joined: 28 Sep 2012
Posts: 2

PostPosted: Fri Sep 28, 2012 8:38 am    Post subject: Reply with quote

Dark Byte wrote:
No, this is a limit of the addresslist
You could try using readString on the address of the cheatentry


In the address list I have the max length at 5000 character and it shows all the data, and I can view/copy it no problem.

It's only when getting the data via LUA is it ever truncated to 255 characters.

======

readString - It seems does not work with UTF-8 strings and terminates after the first letter.

Code:
addresslist=getAddressList()
count = addresslist_getCount(addresslist)

result=""
for i=0,count-1 do
 record = addresslist_getMemoryRecord(addresslist, i)
 result=result..readString(memoryrecord_getAddress(record),2000)
end

writeToClipboard(result)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Sep 28, 2012 11:26 am    Post subject: Reply with quote

try
Code:

result=result..readString(memoryrecord_getAddress(record),2000, true)

The last parameter defines if it's UTF8 or UTF16

_________________
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
theboy181
Advanced Cheater
Reputation: 0

Joined: 26 Jan 2018
Posts: 90

PostPosted: Tue Jul 16, 2019 7:45 pm    Post subject: Reply with quote

This LUA scrip does copy to clipboard but leave two spaces between each line. Is there any way to fix that?


ms=getCurrentMemscan()
fl=memscan_getAttachedFoundlist(ms)

count=foundlist_getCount(fl)

result=""
for i=0,count-1 do
result=result..foundlist_getAddress(fl, i).." - "..foundlist_getValue(fl,i).."\n\r\n\r"
end

writeToClipboard(result)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Tue Jul 16, 2019 11:58 pm    Post subject: Reply with quote

replace \n\r\n\r with \n
_________________
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