View previous topic :: View next topic |
Author |
Message |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sat May 24, 2008 12:06 pm Post subject: [Question] Freeze Process |
|
|
Is there a way to freeze a process?
I think you all know what I mean by freezing.
I've searched, but had no results. |
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat May 24, 2008 1:04 pm Post subject: |
|
|
Freeze all the threads? |
|
Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sat May 24, 2008 1:56 pm Post subject: |
|
|
Uhm, I don't really know much of threads.
What I'm asking is, if there's a way to freeze a process, and if possible, unfreeze it again.
Like appalsap's "Buy Time". (http://forum.cheatengine.org/viewtopic.php?t=164934 check under tools) |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25794 Location: The netherlands
|
Posted: Sat May 24, 2008 2:02 pm Post subject: |
|
|
if you're on windows XP or later you can use SuspendProcess _________________
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 |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sat May 24, 2008 2:08 pm Post subject: |
|
|
Dark Byte wrote: | if you're on windows XP or later you can use SuspendProcess |
You've got any snippets?
Thanks for the "hint" btw.
EDIT:
Found this, can you use that aswell?
Code: | DWORD WINAPI WaitForSingleObject(
__in HANDLE hHandle,
__in DWORD dwMilliseconds
); |
I'm trying to do this in delphi.
Last edited by NothingToShow on Sat May 24, 2008 2:19 pm; edited 2 times in total |
|
Back to top |
|
 |
DoomsDay Grandmaster Cheater
Reputation: 0
Joined: 06 Jan 2007 Posts: 768 Location: %HomePath%
|
Posted: Sat May 24, 2008 2:16 pm Post subject: |
|
|
Get the target process' ID, use it to create a thread snapshot using CreateToolHelp32Snapshot, then use OpenThread, and then, SuspenThread\ResumeThread. |
|
Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sat May 24, 2008 2:19 pm Post subject: |
|
|
DoomsDay wrote: | Get the target process' ID, use it to create a thread snapshot using CreateToolHelp32Snapshot, then use OpenThread, and then, SuspenThread\ResumeThread. |
I'll "mess around". Sounds a bit confusing since I've never messed with all that. |
|
Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Sat May 24, 2008 3:08 pm Post subject: |
|
|
Windows is thread-based. A process is simply a group of threads. It is like a container. The threads do all the execution of code. In order to "freeze" a process, you must suspend all of the process's threads. Use CreateToolhelp32Snapshot, OpenThread, and SuspendThread.
Btw, SuspendProcess simply does the mentioned above. |
|
Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sat May 24, 2008 3:13 pm Post subject: |
|
|
rapion124 wrote: | Windows is thread-based. A process is simply a group of threads. It is like a container. The threads do all the execution of code. In order to "freeze" a process, you must suspend all of the process's threads. Use CreateToolhelp32Snapshot, OpenThread, and SuspendThread.
Btw, SuspendProcess simply does the mentioned above. |
I can't find anything about SuspendProcess. |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat May 24, 2008 3:43 pm Post subject: |
|
|
You have to suspend all of the thread's within a process.
Using CreateToolhelp32Snapshot, Thread32First and Thread32Next _________________
|
|
Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sat May 24, 2008 4:12 pm Post subject: |
|
|
x0r wrote: | Code: | VOID SuspendProcess(HANDLE hProcess)
{
HANDLE hSnapshot, hThread;
hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, GetProcessId(hProcess));
if (hSnapshot != NULL)
{
THREADENTRY32 ThreadEntry;
ThreadEntry.dwSize = sizeof(THREADENTRY32);
if (Thread32First(hSnapshot, &ThreadEntry))
{
do
{
hThread = OpenThread(THREAD_SUSPEND_RESUME, NULL, ThreadEntry.th32ThreadID);
if (hThread != NULL)
{
SuspendThread(hThread);
CloseHandle(hThread);
}
} while (Thread32Next(hSnapshot, &ThreadEntry));
}
CloseHandle(hSnapshot);
}
} |
|
Thanks, I'll try to convert it to Delphi. |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25794 Location: The netherlands
|
Posted: Sat May 24, 2008 4:52 pm Post subject: |
|
|
I meant ntSuspendProcess (a function in ntdll.dll)
takes a processhandle _________________
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 |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sun May 25, 2008 7:25 am Post subject: |
|
|
Thanks for all the help, I'll have to mess around with it.
I have anothe question, not regarding this, but I didn't want to create a new topic for it.
In Flash you've got ._X and ._Y, what have you got in Delphi?
I think it's .top and .left, but is there a way to make it x and y. |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25794 Location: The netherlands
|
Posted: Sun May 25, 2008 8:12 am Post subject: |
|
|
a new topic would be better.
anyhow, create this unit:
Code: |
unit newform;
interface
uses classes,forms;
type TForm=class(forms.TForm) //override TForm class
private
function getTop: integer;
procedure setTop(y: integer);
function getLeft: integer;
procedure setLeft(x: integer);
public
property _x: integer read getLeft write setLeft;
property _y: integer read getTop write setTop;
end;
implementation
function TForm.getTop: integer;
begin
result:=top;
end;
procedure TForm.setTop(y: integer);
begin
top:=y;
end;
function TForm.getLeft: integer;
begin
result:=left;
end;
procedure TForm.setLeft(x: integer);
begin
left:=x;
end;
end.
|
and add this unit to your form's uses list.
Now you can use _x:=value and _y:=value to set top and left
(if your formclass is a different name, eg inherited form, you'll havwe to make some minor changes) _________________
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
Last edited by Dark Byte on Sun May 25, 2008 6:00 pm; edited 1 time in total |
|
Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sun May 25, 2008 9:02 am Post subject: |
|
|
Thanks!  |
|
Back to top |
|
 |
|