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 


Source Lua

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
Filipe_Br
Expert Cheater
Reputation: 2

Joined: 07 Jan 2016
Posts: 232
Location: My house

PostPosted: Thu Oct 20, 2016 9:09 am    Post subject: Source Lua Reply with quote

Is there any specific file that I can see for example what happens when you type OpenProcess ("game.exe").
I'm a little lost, I hope someone can help me, many files, I do not know what I seek.
Back to top
View user's profile Send private message
ParkourPenguin
Grandmaster Cheater Supreme
Reputation: 54

Joined: 06 Jul 2014
Posts: 1815
Location: Arcadian Suburbia

PostPosted: Thu Oct 20, 2016 10:09 am    Post subject: Reply with quote

main.lua:
Quote:
openProcess(processname): causes cheat engine to find and open the given process

Implementation is here.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Thu Oct 20, 2016 10:37 am    Post subject: Reply with quote

Here:
https://github.com/cheat-engine/cheat-engine/blob/ca87e4dc8980edff75cbb04cdd7fc35d5f87e83b/Cheat%20Engine/LuaHandler.pas#L2334



To get PID, we see another function: "ce_getProcessIDFromProcessName"
https://github.com/cheat-engine/cheat-engine/blob/ca87e4dc8980edff75cbb04cdd7fc35d5f87e83b/Cheat%20Engine/pluginexports.pas#L1315




when we have PID, it will call function "ce_openProcess", which is here
https://github.com/cheat-engine/cheat-engine/blob/ca87e4dc8980edff75cbb04cdd7fc35d5f87e83b/Cheat%20Engine/pluginexports.pas#L1431




but, it call another one: "ce_openProcess2":
https://github.com/cheat-engine/cheat-engine/blob/ca87e4dc8980edff75cbb04cdd7fc35d5f87e83b/Cheat%20Engine/pluginexports.pas#L1399


and it calls another function "Open_Process", here:
https://github.com/cheat-engine/cheat-engine/blob/ca87e4dc8980edff75cbb04cdd7fc35d5f87e83b/Cheat%20Engine/CEFuncProc.pas#L1807


There we see this:
NewKernelHandler.OpenProcess(PROCESS_ALL_ACCESS,false,ProcessID);


Digging more:
NewKernelHandler.OpenProcess:=GetProcAddress(WindowsKernel,'OpenProcess');


WindowsKernel and OpenProcess

Digging more:
WindowsKernel:=LoadLibrary('Kernel32.dll')



So, OpenProcess from Kernel32.dll.

_________________
Back to top
View user's profile Send private message MSN Messenger
Filipe_Br
Expert Cheater
Reputation: 2

Joined: 07 Jan 2016
Posts: 232
Location: My house

PostPosted: Thu Oct 20, 2016 10:44 am    Post subject: Reply with quote

Everything is programmed in Delphi?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Thu Oct 20, 2016 10:52 am    Post subject: Reply with quote

Yes. "OpenProcess" function you see in CE's Lua, it is registered function written in other language (be it C, Pascal)
_________________
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 Source 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