 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Buggy Advanced Cheater
Reputation: 0
Joined: 04 Jan 2008 Posts: 72 Location: Republic of Korea (South Korea)
|
Posted: Mon Jan 28, 2008 7:16 am Post subject: [VB6 Tips] Killing Processes |
|
|
Can I post this on General programming section?? Anyway i'll post it... if it isn't right then quote me please...;
We usually use these five ways when we kill process. On this topic, I'll give you ways to kill processes.(There are many ways but i'll introduce five ways.)
1. OpenProcess -> TerminateProcess
Mostly, we use this method.
This is an example for it.
| Code: | Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32.dll" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Const PROCESS_TERMINATE = 1&
Private Const ProcessID = 621 'You have to put process id here
Dim hProcess As Long
hProcess = OpenProcess(PROCESS_TERMINATE, 0, ProcessID)
'Open Process
TerminateProcess hProcess, 0& ' Terminate Process
'Return Handle
CloseHandle hProcess
|
We use mostly but it isn't safe. Because, it doesn't return resources completely.
2. CreateRemoteThread -> ExitProcess
I want you to use this method. It is better than the first one, i think.
| Code: |
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CreateRemoteThread Lib "kernel32.dll" (ByVal hProcess As Long, ByRef lpThreadAttributes As Any, ByVal dwStackSize As Long, ByRef lpStartAddress As Long, ByRef lpParameter As Any, ByVal dwCreationFlags As Long, ByRef lpThreadId As Long) As Long
Private Declare Function GetModuleHandle Lib "kernel32.dll" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32.dll" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Const PROCESS_CREATE_THREAD = 2&
Private Const ProcessID = 621 ' You have to put process id here
Dim hProcess As Long, KernelModule As Long, hThread As Long, ThreadID As Long
hProcess = OpenProcess(PROCESS_CREATE_THREAD, 0, ProcessID)
'Open
KernelModule = GetModuleHandle("KERNEL32.DLL") 'Get KERNEL32.DLL Base Address
hThread = CreateRemoteThread (hProcess, ByVal 0, 0, ByVal GetProcAddress(KernelModule, "ExitProcess"), ByVal 0&, 0, ThreadID) ' Create thread with ExitProcess's address
' Returns handle
CloseHandle hThread
CloseHandle hProcess
|
3. DebugActiveProcess
DebugActiveProcess debugs process and if we use this, and the process will be debugged and if we kill debugger (vb6 compiled program), a process that you want to kill will be killed.This method is really simple.
| Code: |
Private Declare Function DebugActiveProcess Lib "kernel32.dll" (ByVal dwProcessId As Long) As Long
Private Const ProcessID = 621 'You have to put process id here
DebugActiveProcess ProcessID
End
|
4. Kill process with Terminal Services
well it's an unofficial way to kill process but it works general computers.
| Code: |
Private Declare Function WinStationTerminateProcess Lib "winsta.dll" (ByVal hServer As Long, ByVal ProcessId As Long, ByVal ExitCode As Long) As Long
Private Const ProcessID = 621 'You have to put process id here
Private Const WTS_CURRENT_SERVER_HANDLE = 0&
WinStationTerminateProcess WTS_CURRENT_SERVER_HANDLE, ProcessId, 0
|
5. Kill process with TSKILL.EXE
well it doesn't need any APIs and it's reallyy simple.!
| Code: |
Shell "tskill MapleStory", vbHide
|
And there are many ways except for these ways.
You can send message to process WM_CLOSE,
you can call PsTerminateProcess() in kernel level,
you can kill all threads with TerminateThread, and anything!
Thank you...?
_________________
[img]
<a><img></a>[/img]
iroo sooo hooooot |
|
| Back to top |
|
 |
sangeli Master Cheater
Reputation: 0
Joined: 07 Dec 2006 Posts: 406
|
Posted: Mon Jan 28, 2008 6:27 pm Post subject: |
|
|
so, i could use this to kill processes like Ollydbg and other debuggers to prevent my password form from being hacked? if so, NICE.
a major step in anti cracking code
_________________
| Dark Byte wrote: | | ce can certainly damage hardware let's say you have a robotarm attached to your computer, and the software limits usually block it from ripping out it's own cpu. If you remove that limit and then issue the command to rip out the cpu, sure, say goodbye to your hardware |
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Mon Jan 28, 2008 6:29 pm Post subject: |
|
|
| sangeli wrote: | so, i could use this to kill processes like Ollydbg and other debuggers to prevent my password form from being hacked? if so, NICE.
a major step in anti cracking code |
No.
_________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Jan 28, 2008 6:48 pm Post subject: |
|
|
someone can nop out the code or change the window or process name
_________________
|
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Mon Jan 28, 2008 7:10 pm Post subject: |
|
|
| Or put a hook on NtOpenProcess and NtTerminateProcess.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Jan 28, 2008 10:19 pm Post subject: |
|
|
You can just hook any of the API you listed and force false returns and disable the from executing their normal code. For example TerminateProcess, compare the given handle to your processes handle, if they match, just return without executing the real TerminateProcess.
_________________
- Retired. |
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Tue Jan 29, 2008 2:42 am Post subject: |
|
|
| sangeli wrote: | so, i could use this to kill processes like Ollydbg and other debuggers to prevent my password form from being hacked? if so, NICE.
a major step in anti cracking code |
lol'd, a MAJOR step ? i tried it and it sucks ;D
|
|
| Back to top |
|
 |
sangeli Master Cheater
Reputation: 0
Joined: 07 Dec 2006 Posts: 406
|
Posted: Tue Jan 29, 2008 10:52 pm Post subject: |
|
|
| Rot1 wrote: | | sangeli wrote: | so, i could use this to kill processes like Ollydbg and other debuggers to prevent my password form from being hacked? if so, NICE.
a major step in anti cracking code |
lol'd, a MAJOR step ? i tried it and it sucks ;D |
i guess im wrong. calm down guys.
_________________
| Dark Byte wrote: | | ce can certainly damage hardware let's say you have a robotarm attached to your computer, and the software limits usually block it from ripping out it's own cpu. If you remove that limit and then issue the command to rip out the cpu, sure, say goodbye to your hardware |
|
|
| Back to top |
|
 |
tornarrow Master Cheater
Reputation: 0
Joined: 29 Jan 2008 Posts: 289
|
Posted: Tue Jan 29, 2008 10:55 pm Post subject: Re: [VB6 Tips] Killing Processes |
|
|
| Buggy wrote: | | Can I post this on General programming section?? |
yesh
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
|
|
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
|
|