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 read a process memory and show it on label...
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Pixelyze
How do I cheat?
Reputation: 0

Joined: 25 Dec 2014
Posts: 8

PostPosted: Thu Dec 25, 2014 1:41 pm    Post subject: How to read a process memory and show it on label... Reply with quote

Hi,

How I can read a process memory (Unicode-Text type) and show it on label with realtime read? I'm new with Lua script and CE.

- Process name "exam.exe"
- Address = "exam.exe"+9CDC08
- Type = String[30] (Unicode)

On my form, I need to put only 1 label and show value of process in realtime.

Thank in advance,
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Dec 26, 2014 7:01 am    Post subject: Reply with quote

here is an example that will show the value of an memory record in the form using a label


example.ct
 Description:

Download
 Filename:  example.ct
 Filesize:  1.02 KB
 Downloaded:  710 Time(s)


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

Joined: 25 Dec 2014
Posts: 8

PostPosted: Fri Dec 26, 2014 8:03 am    Post subject: Reply with quote

It's works .. but I got some problem ...

[img]upic.me/i/ls/62untitled.png[/img]

It cannot display unicode (Chinese/Japanese language) Confused
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Dec 26, 2014 8:17 am    Post subject: Reply with quote

You may wish to wrap the value in ansiToUtf8
_________________
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
Pixelyze
How do I cheat?
Reputation: 0

Joined: 25 Dec 2014
Posts: 8

PostPosted: Fri Dec 26, 2014 8:28 am    Post subject: Reply with quote

I'm grateful for your helping, But I'm new with coding.
I don't know how to wrap the value to ansiToUtf8 Crying or Very sad

So please tell me how to config it, and I think I need a textfield instead of label (Can be copied to clipboard). Please help me

Thank you Shocked
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Dec 26, 2014 9:09 am    Post subject: Reply with quote

try replacing
Code:

UDF1.CELabel1.Caption='Value = '..getAddressList().getMemoryRecordByDescription("value").Value

with
Code:

UDF1.CELabel1.Caption='Value = '..ansiToUtf8(getAddressList().getMemoryRecordByDescription("value").Value)

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

Joined: 15 Mar 2012
Posts: 80

PostPosted: Fri Dec 26, 2014 9:43 am    Post subject: Reply with quote

Hi Dark Byte.

I think i found a bug in getAutoAttachList().Add('Process.exe').

If I use your script the process open's only one time (close and reopen dosn't work...). I test it with calc.exe.

value = calc.exe+75D2C 4 Byte

Code:
t=createTimer(nil)
t.OnTimer=function()
  UDF1.CELabel1.Caption='Value = '..getAddressList().getMemoryRecordByDescription("value").Value
end

function _bye()
object_destroy(t)
print("bye")
--UDF1.Hide()
return caHide
end

t.Interval=500
t.Enabled=true

UDF1.onClose = _bye

UDF1.Show()

getAutoAttachList().Add('calc.exe')


I test it at this scipt:

Code:
t=createTimer(nil)
t.OnTimer=function()
  local iAV = getAddressList().getAddressList().getMemoryRecordByDescription("value").ValueValue
  if iAV ~= "??" then
     UDF1.CELabel1.Caption='Value = '..iAV
  else
     UDF1.CELabel1.Caption='Value = '.."Process not found!"
     local iPI = getProcessIDFromProcessName('calc.exe')
     if iPI then
        openProcess(iPI)
     end
  end
end

function _bye()
object_destroy(t)
print("bye")
--UDF1.Hide()
return caHide
end

t.Interval=500
t.Enabled=true

UDF1.onClose = _bye

UDF1.Show()

Edit: Replace getAddressList().getMemoryRecordByDescription("value").Value


Last edited by sir-gunny on Fri Dec 26, 2014 10:48 am; edited 1 time in total
Back to top
View user's profile Send private message
Pixelyze
How do I cheat?
Reputation: 0

Joined: 25 Dec 2014
Posts: 8

PostPosted: Fri Dec 26, 2014 10:27 am    Post subject: Reply with quote

It's work~!! Thank you very much Very Happy
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Dec 26, 2014 10:44 am    Post subject: Reply with quote

sir-gunny wrote:
I think i found a bug in getAutoAttachList().Add('Process.exe').
open's only one time (close and reopen dosn't work...).

It is not a bug. AutoAttach object keeps a list of processes you want to open automatically.
If it finds such process, AutoAttach object disables itself (timer part), then it opens that process.

This is how AutoAttach works.




If you need different behavior, you have to manually open process, check if it still exist, and try to open new. Example below:



reopen.CT
 Description:

Download
 Filename:  reopen.CT
 Filesize:  889 Bytes
 Downloaded:  668 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Fri Dec 26, 2014 10:55 am    Post subject: Reply with quote

AH, OK THX Smile
Back to top
View user's profile Send private message
Pixelyze
How do I cheat?
Reputation: 0

Joined: 25 Dec 2014
Posts: 8

PostPosted: Fri Dec 26, 2014 10:56 am    Post subject: Reply with quote

Umm ... How can I make a trainer to run stand-alone with 2 files of this?

- EXAM.CT
- EXAM.FRM
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Dec 26, 2014 11:00 am    Post subject: Reply with quote

@Pixelyze, do you really need form in different file?
_________________
Back to top
View user's profile Send private message MSN Messenger
Pixelyze
How do I cheat?
Reputation: 0

Joined: 25 Dec 2014
Posts: 8

PostPosted: Fri Dec 26, 2014 11:03 am    Post subject: Reply with quote

Nope, I'm config an original form and save, It saved to new file (.frm) and I don't know how to use it right now ... Confused
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Dec 26, 2014 11:06 am    Post subject: Reply with quote

Ohh, you've used "save" option from "Form Designer" window.

You don't have to use that. All form changes are saved automatically after closing Form Designer.

In main Cheat Engine window, in "Table" sub-menu, there should be your form.

_________________
Back to top
View user's profile Send private message MSN Messenger
Pixelyze
How do I cheat?
Reputation: 0

Joined: 25 Dec 2014
Posts: 8

PostPosted: Fri Dec 26, 2014 11:22 am    Post subject: Reply with quote

@mgr.inz.Player

Yeah, Thank you very much~ It's work, and how can I make a stand-alone with .ct file?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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