View previous topic :: View next topic |
Author |
Message |
salumor Advanced Cheater Reputation: 0
Joined: 14 Jan 2019 Posts: 87
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Fri Dec 17, 2021 4:15 pm Post subject: |
|
|
Timers don't run on separate threads. They are done using the window message system which raises a 'WM_TIMER' event when a timers interval has passed.
_________________
- Retired. |
|
Back to top |
|
|
salumor Advanced Cheater Reputation: 0
Joined: 14 Jan 2019 Posts: 87
|
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Sat Dec 18, 2021 1:14 pm Post subject: |
|
|
You don't need to create new threads and create timers in them,you can create lot of timers instead of creating new thread and creating timer in it
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
salumor Advanced Cheater Reputation: 0
Joined: 14 Jan 2019 Posts: 87
|
Posted: Sat Dec 18, 2021 1:35 pm Post subject: |
|
|
Frouk wrote: | You don't need to create new threads and create timers in them,you can create lot of timers instead of creating new thread and creating timer in it | ? In what way would a lot of timers help me if one is enough to break the debugger? Why would I even need a lot of timers? Are you sure you did understand the topic or are you trolling me?
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4289
|
Posted: Sat Dec 18, 2021 2:15 pm Post subject: |
|
|
Timers aren't run on separate threads. The Lua code run by OnTimer is run by the main thread IIRC.
debug_addThreadToNoBreakList operates on the target process. When CE handles a debug event (in TDebugThreadHandler.DispatchBreakpoint), it checks to see if the thread that triggered the breakpoint is in the noBreakList, and if so, it exits the breakpoint handling routine early and continues execution.
createTimer can't break the debugger unless you do something really weird in the OnTimer function.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Sat Dec 18, 2021 2:56 pm Post subject: |
|
|
You are also missing the fact that when you create a timer, it is not running in the remote process. The timer is local to CE's process itself. So CE's process is what will be handling that timer and receiving the WM_TIMER message when the interval is expired each time.
If you need to do something similar in the remote process, then you need to create a remote thread instead. (By this I do not mean using CE's Lua function 'createThread', as that is just a local thread inside of CE's own process as well. You'll need to inject a thread, such as with the auto-assembler, into the remote process. CE's Lua also has 'createRemoteThread' but you'll have to have injected code already to be invoked with this as it expects an address. So you can instead just do it all from an auto-assembler script.)
For example, this is an old script of mine that force respawns the player of a certain game:
Code: |
[ENABLE]
alloc(threadGame,1024,"Game.dll")
registersymbol(threadGame)
createthread(threadGame)
threadGame:
mov ecx, [playerPointer]
mov [ecx+00000D60], 4
ret
[DISABLE]
dealloc(threadGame)
unregistersymbol(threadGame)
|
_________________
- Retired. |
|
Back to top |
|
|
salumor Advanced Cheater Reputation: 0
Joined: 14 Jan 2019 Posts: 87
|
Posted: Sat Dec 18, 2021 4:09 pm Post subject: |
|
|
ParkourPenguin wrote: | createTimer can't break the debugger unless you do something really weird in the OnTimer function. | OOOkay so did test beforehand also simplifying the the script (only autoattach). I know the table/debugging works. I know the timer did what I wanted just breaking the debugger and found the thread in 1. post mentioning threads breaking the debugger. Hence my conclusion.
But I did miss some mistake leading to the timer always running "openProcess" "breaking" (of course) the debugger ... And now there is no problem. Damn.
@atom0s yes, that would have been more of a feature request in CE anyway. (I mean still could be if needed. If you check those threads TTimer is not rly reliable in higher Intervals. But except that nonexistent problem I don't know if there would be any need?)
|
|
Back to top |
|
|
|