Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 05:45

  • Please register to post and access all features, it's quick, easy and FREE!

Looking for example code (all info in thread)

Discussion on Looking for example code (all info in thread) within the AutoIt forum part of the Coders Den category.

Old   #1
elite*gold: 0
Join Date: Jul 2007
Posts: 191
Received Thanks: 37
Looking for example code (all info in thread)

Hello there everyone.

I hope there is someone who could help me a bit.
(Im not looking for full code , just for simple example how this could be done)
im working on a bot for Royal Quest.
I know a way to run multiple clients in one pc without VMWare etc
to do that i need to kill 2 "Event's" inside running process
I know how to do that manually using process exploler. But i would like to automate that , using build in script in to my bot. (
These two actually (Handle 0x120 and handle 0x108 )

I tried to find any Tutorial or script example , but without success
Spend like 4 hours , trying to figure it out by my self
using _WINAPI_CloseHandle function but i failed

so any help from community is appreciated

owadziak is offline  
Old 01/31/2019, 00:42   #2
elite*gold: 100
Join Date: Apr 2008
Posts: 548
Received Thanks: 697
Sorry, I have no clue what that screenshot should tell me and what kind of events you are talking about. WinAPI sometimes references to Events as Threads so maybe you are talking about threads. But BaseNamedObjects can also refer to Mutexes or Semaphores or "Events" ... so ... ?

I guess these are the real WinAPI Events.

Events are managed in the kernel by reference counting. There is no certain way to "delete" an event. The kernel will release the event once the last reference to it has been closed. CloseHandle states that it will also "delete" events, but I'm unsure how the kernel will actually handle this.

Long story short: CloseHandle seems to be your only hope. There is only one trick to it: You need to call it inside the target process. An external process can not access the internal handles of another process. Therefore you need to inject a DLL or "simply" call CreateRemoteThread.

The question is now do you find the handles? Are they deterministic aka. can you guess them?

florian0 is offline  
Old 01/31/2019, 01:35   #3
elite*gold: 0
Join Date: Jul 2007
Posts: 191
Received Thanks: 37
seems like this one never change, doesnt matter how many client i open even if i open that game in different pc.

Maybe this screen will help u figure out anything
owadziak is offline  
Old 02/02/2019, 23:15   #4
elite*gold: 0
Join Date: Apr 2011
Posts: 253
Received Thanks: 86
#include <WinAPI.au3>
#include <WinAPIProc.au3>
#include <ProcessConstants.au3>
#include <Array.au3>


$PID = ProcessExists("Your process name here.exe")
$Data = _WinAPI_EnumProcessHandles($PID)
;Note that in windows, handle type Event is 12
;_ArrayDisplay(Data) to find handle types for every OS

If IsArray($Data) Then
	$hSource = _WinAPI_OpenProcess($PROCESS_DUP_HANDLE, 0, $PID)
	If $hSource Then
		For $i = 1 To $Data[0][0]
			If $Data[$i][1] == $WINDOWS_HANDLE_TYPE_EVENT Then
				;Handle value
                                $value = Int ($Data[$i][0])
				If $value == 0x120 or $value == 0x108 Then
			$hObject = _WinAPI_DuplicateHandle($hSource, $Data[$i][0], 0, 0, 0, $DUPLICATE_OPTION_CLOSE_SOURCE)
			If Not @error Then
Reference link:

elmarcia is offline  
1 User
Old 02/05/2019, 05:22   #5
elite*gold: 0
Join Date: Jul 2007
Posts: 191
Received Thanks: 37
Thanks alot, this one works perfectly

owadziak is offline  

« RtlExitUserProcess hook to terminate another process | - »

Similar Threads
Example Source Code für C++
10/30/2013 - Wolfteam - 9 Replies
Hallo , kann villeicht jemand einen kleinen Source Code reinpackenund zeigen wo er keine Offsets braucht ? Es wäre sehr hilfreich. Es ist egal ob der schon alt ist hhauptsache er hat funktoniert. Mfg Rolfx1 :)
AutoIt code cave no DLLs xD ToxicFog leveler example
05/06/2009 - CO2 Programming - 18 Replies
Hey guys, This one is inspired by IAmHawkings w/ his code inject in VB. Inside the .zip i provide source code as well as executable to show you all how code injection can be done in AutoIT. Note: Not all assembly instructions are implemented, i got lazy lol. Steps to using it:
[Request]C++ Bot Source Code/Example Code
07/19/2008 - SRO Ask the Experts - 2 Replies
Please someone direct me to anywhere that might have any sort of information and resources on the construction of a bot, preferably in C++. Looking for any Reverse engineering information(finding the Base addr for say player) and locating the offsets ptrs for Cur health etc. I would also love to see a simple example source in C++ of putting those addresses and offsets into action. I'm sure I have the basic idea down on how to do this but I'm not 100% sure how to get it setup correctly. ...

All times are GMT +1. The time now is 05:45.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2019 elitepvpers All Rights Reserved.