View previous topic :: View next topic |
Author |
Message |
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Sun May 31, 2020 1:18 pm Post subject: executeCodeLocalEx pointer to variable |
|
|
ok i tried using executeCodeLocalEx
but im stuck on pointer to variable in lua
ill just use GetWindowThreadProcessId as example
in c++
Code: |
HWND hwnd = FindWindowA(0, "Task Manager");
DWORD pid;
GetWindowThreadProcessId(hwnd, &pid);
cout << pid; |
c++ code works perfectly
but how in lua i tried this code and not work
Code: | local hwnd = executeCodeLocalEx("FindWindowA",0,"Task Manager")
local pid = 0
executeCodeLocalEx("GetWindowThreadProcessId",hwnd,pid)
print(pid) |
how can i pointer to variable in lua?
i know i can use getWindowProcessID function but i want it on executeCodeLocalEx
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1253
|
Posted: Sun May 31, 2020 4:19 pm Post subject: |
|
|
FreeER wrote: | Presumably calling setMousePos(x,y) inside the OnTimer function would work.
Though if you're really worried about people messing with it then you'll probably need to worry about them pressing the power button to reset it once they realize they can't use the mouse, not sure how to handle that (especially holding down the power) but...also for older children they'll probably eventually figure out which key toggles it so you might want to use inputQuery to ask for a password and stringToMD5String to generate a hash from the input to compare to one saved in the script (that way they can't simply find the script and read the password, all they get is the hash).
Over time you may also need to worry about someone opening a command prompt or something that might let them cancel the script by killing CE, if you can open something on top of where the mouse is clicking then it'd keep the focus because the mouse is constantly clicking on it. Using the win api SetForegroundWindow may help with that, example usage
Code: | local hwnd = findWindow(nil, '... - VLC media player') -- I was watching a movie lol
if hwnd ~= 0 and getForegroundWindow() ~= hwnd then -- found window and not foreground
local success = executeCodeLocal('SetForegroundWindow',hwnd) ~= 0
end
|
Ultimately it depends on just how far you want to go, it's possible that other programs already exist that might help, though I haven't done any google searches to find out |
local hwnd = findWindow(nil, 'Games_Code1') -- I was watching a movie lol
if hwnd ~= 0 and getForegroundWindow() ~= hwnd then -- found window and not foreground
local success = executeCodeLocal('SetForegroundWindow',hwnd) ~= 0
end
Description: |
|
Filesize: |
26.26 KB |
Viewed: |
1915 Time(s) |
|
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Mon Jun 01, 2020 12:16 am Post subject: |
|
|
Use a memorystream and give the memory pointer to executecodelocalex
_________________
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 |
|
|
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Mon Jun 01, 2020 3:21 am Post subject: |
|
|
Dark Byte wrote: | Use a memorystream and give the memory pointer to executecodelocalex |
i wonder how its work using memorystream, can you give me an example?
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Mon Jun 01, 2020 3:29 am Post subject: |
|
|
look at https://forum.cheatengine.org/viewtopic.php?t=614401
getDriverList() uses executecodelocalex with pointers
_________________
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 |
|
|
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Mon Jun 01, 2020 7:45 am Post subject: |
|
|
Thank you it worked perfectly
here is the finished code for somebody who needs
Code: | local hwnd = executeCodeLocalEx("FindWindowA",0,"Task Manager")
local pid = createMemoryStream()
pid.writeDword(0)
executeCodeLocalEx("GetWindowThreadProcessId",hwnd,pid.Memory)
print(readIntegerLocal(pid.Memory)) |
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Jun 01, 2020 6:23 pm Post subject: |
|
|
Lynxz Gaming wrote: |
here is the finished code for somebody who needs
|
Note:
This will return PID only when the window handle is active on the screen and the window caption/title have the correct syntax.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
|