Perfect World Bot PWI-Prophet Bot Recoded

09/10/2010 22:14 PW-Prophets#406
Just uncomment that sleep trust me it will be less laggy when you are setting up the bots.
09/10/2010 22:16 asaky#407
Quote:
Originally Posted by PW-Prophets View Post
Just uncomment that sleep trust me it will be less laggy when you are setting up the bots.
How do you edit and compile the source code?
09/10/2010 22:24 asaky#408
Quote:
Originally Posted by asaky View Post
How do you edit and compile the source code?
Ignore this comment I figured it out, cpu is down to 77-88% ?? will there be and side effects though?

Also out of curiosity did you 2 write out every single one of those 2516 lines? O.o *dies* I will never become a programmer if thats true lmao
09/10/2010 22:54 PW-Prophets#409
Well yes we did write out all that code.
The good thing is we had such nice ppl on these forums helping us along.
Has made the codeing alot easier on us.
09/11/2010 00:10 Interest07#410
Quote:
Originally Posted by asaky View Post
Ignore this comment I figured it out, cpu is down to 77-88% ?? will there be and side effects though?

Also out of curiosity did you 2 write out every single one of those 2516 lines? O.o *dies* I will never become a programmer if thats true lmao
2516 lines of programming isn't as bad as when writing dissertations or stuff :P

a single '}' can already be a line :D

DOn't let that discourage you from getting into programming, its tons of fun :)

@prophets

Not sure if my PM actually worked so:



Code:
Func sendPacket($packet, $packetSize)
	Local $pRemoteThread, $vBuffer, $loop, $result, $OPcode
	
	$functionAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $mid, 'ptr', 0, 'int', 0x46, 'int', 0x1000, 'int', 0x40)
	$packetAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $mid, 'ptr', 0, 'int', $packetSize, 'int', 0x1000, 'int', 0x40)
	
	
	
	$OPcode &= '60'                                 ;PUSHAD
	$OPcode &= 'B8'&_hex($SendPacketAddress)	;MOV	 EAX, sendPacketAddress
	$OPcode &= '8B0D'&_hex($realBaseAddress)	;MOV     ECX, DWORD PTR [revBaseAddress]
	$OPcode &= '8B4920'				;MOV     ECX, DWORD PTR [ECX+20]
	$OPcode &= 'BF'&_hex($packetAddress)		;MOV     EDI, packetAddress	//src pointer
	$OPcode &= '6A'&_hex($packetSize)		;PUSH    packetSize		//size
	$OPcode &= '57'					;PUSH    EDI
	$OPcode &= 'FFD0'				;CALL    EAX
	$OPcode &= '61'					;POPAD
	$OPcode &= 'C3'					;RET		
	
	; --- enter the asm code to to a dllstruct, which can be used with WriteProcessMemory ---
	$vBuffer = DllStructCreate('byte[' & StringLen($OPcode) / 2 & ']')
	For $loop = 1 To DllStructGetSize($vBuffer)
		DllStructSetData($vBuffer, 1, Dec(StringMid($OPcode, ($loop - 1) * 2 + 1, 2)), $loop)
	Next
	; --- now letz write the code from our dllstruct ---
	DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $mid, 'int', $functionAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
		
	; --- enter the packet code to to a dllstruct, which can be used with WriteProcessMemory ---
	$vBuffer = DllStructCreate('byte[' & StringLen($packet) / 2 & ']')
	For $loop = 1 To DllStructGetSize($vBuffer)
		DllStructSetData($vBuffer, 1, Dec(StringMid($OPcode, ($loop - 1) * 2 + 1, 2)), $loop)
	Next
	; --- now letz write the code from our dllstruct ---
	DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $mid, 'int', $packetAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
		
	; --- now we run the asm code we've just written ---
	$hRemoteThread = DllCall($kernel32, 'int', 'CreateRemoteThread', 'int', $mid, 'int', 0, 'int', 0, 'int', $functionAddress[0], 'ptr', 0, 'int', 0, 'int', 0)
	; --- wait till the thread did his job ---
	Do
		$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
	Until $result[0] <> 258
	; --- close everything we've opened ---
	DllCall($kernel32, 'int', 'CloseHandle', 'int', $hRemoteThread[0])
	DllCall($kernel32, 'ptr', 'VirtualFreeEx', 'hwnd', $mid, 'int', $functionAddress[0], 'int', 0, 'int', 0x8000)
	DllCall($kernel32, 'ptr', 'VirtualFreeEx', 'hwnd', $mid, 'int', $packetAddress[0], 'int', 0, 'int', 0x8000)
	Return True
EndFunc
Is what my sendpacket function would prolly look like (using his function as example.) Writing opcodes is just basically converting it to machine code first, then storing it in memory and having a remote thread access it. It works the same in all programming languages :)

You shouldn't need GUI functions for anything if you can send the packets ;)
09/11/2010 01:23 asaky#411
Quote:
Originally Posted by Interest07 View Post
2516 lines of programming isn't as bad as when writing dissertations or stuff :P

a single '}' can already be a line :D

DOn't let that discourage you from getting into programming, its tons of fun :)
Lol nah i'm no programmer I will leave that to the professions atm just call me a professional leecher :cool: yeah!... wait thats not a good thing :S
09/11/2010 01:30 Smurfin#412
is there any way to increase looting range ? I think I read it somewhere
09/11/2010 01:58 asaky#413
Quote:
Originally Posted by Smurfin View Post
is there any way to increase looting range ? I think I read it somewhere
never heard of one :confused: That is more of a hack then a bot. Though if your botting on land just use the "Walk to" feature.
09/11/2010 02:32 Smurfin#414
ok then, it's a hack if you say so, even a bot might contain stuff that you call as a hack. It can be quite useful to be stuffed into a bot and can help save the time walking, because even a close-ranged class sometimes still need a bit of walking to pick drops, well..maybe not much but botting continuously, anything faster will help.

I read it [Only registered and activated users can see links. Click Here To Register...] , mentioned as remote looting.

again, sorry if it's not useful for you and all you wanna discuss here is what-You-think is matter for a bot, was just asking....
09/11/2010 04:07 asaky#415
Quote:
Originally Posted by Smurfin View Post
ok then, it's a hack if you say so, even a bot might contain stuff that you call as a hack. It can be quite useful to be stuffed into a bot and can help save the time walking, because even a close-ranged class sometimes still need a bit of walking to pick drops, well..maybe not much but botting continuously, anything faster will help.
Isn't sending packets dangerous? and can make you get caught easily? The current bot doesn't send anything so its basicly invisible the only way to detect a bot is to send a pm and even then its not 100% accurate proof.

And yes you are correct about that I will admit, though my bms and barbs rarley miss drops unless the inventory is full. Even my spear bm doesn't have any trouble at the range of the spear.
09/11/2010 06:15 PW-Prophets#416
Quote:
Originally Posted by asaky View Post
Isn't sending packets dangerous? and can make you get caught easily? The current bot doesn't send anything so its basicly invisible the only way to detect a bot is to send a pm and even then its not 100% accurate proof.

And yes you are correct about that I will admit, though my bms and barbs rarley miss drops unless the inventory is full. Even my spear bm doesn't have any trouble at the range of the spear.
Hmmmm. This whole send packet thing may be something to think about. Why do you consider it dangerous Asaky? Now that you have brought it up I have thought of several reasons that it could potentially be easier to catch, but I need some afirmation :D Thx Prophet1
09/11/2010 08:31 Interest07#417
Using the send packet function isn't any more dangerous than using any other funciton from the game via injection. The server won't see any difference, as your client will call that exact same function eventually anyway. It just saves you the trouble of finding all the different functions out there. The only things you usually don't want to do by packets is stuff involving movement, as it requires a move packet every ~500 ms. Best let the game calculate those by using the actionstruct.

In my WQ bot you can see an example of using movement packets though for flying upwards. It also uses sending packets for accepting quests, selecting npcs, talking to them, starting flying. One benefit is that the structure of the packets are the same for every server.

It would be easier to catch supposedly if you send the wrong packets of course :p But the same can be send for calling other functions at the wrong time (as they will result in a sent packet also) if you call them at too low a level.

I can easily find you the information for sending packets for almost any action that you need if you get the sendPacket function working. Easiest packet to test would be "0800", size = 2. This deselects yoru current target.
09/11/2010 12:23 asaky#418
Quote:
Originally Posted by PW-Prophets View Post
Hmmmm. This whole send packet thing may be something to think about. Why do you consider it dangerous Asaky? Now that you have brought it up I have thought of several reasons that it could potentially be easier to catch, but I need some afirmation :D Thx Prophet1
I don't know the technical reason why its easier to catch but being on this forum I have seen alot of discussions about it.

Lol what is sending packets do? Use small words i'm not very bright.
09/11/2010 14:41 asaky#419
Check out this if you haven't found it already prophet1/2
[Only registered and activated users can see links. Click Here To Register...]

It seems to work and could make your life easier lol you and nooob should work together
09/11/2010 15:00 Interest07#420
Quote:
Originally Posted by asaky View Post
I don't know the technical reason why its easier to catch but being on this forum I have seen alot of discussions about it.

Lol what is sending packets do? Use small words i'm not very bright.
This way you aren't actually sending packets yourself, you're just making the game think it's been told to perform a certain action, just like with the other injection functions. This function is just two or three function calls further down the line from say an 'Equip this gear' function. There is technically absolutely no difference, you could call it 'PerformAction' function instead if it makes you feel better :D :D

The way for a computer to communicate with another computer is by sending 'packets' of information. These will usually consist of a header which identifies the type of information being sent followed by the information itself. A packet for selecting a mob with id 80103fd7 would be for example:

02 00 D7 3F 10 80

In the game if you click on the mob with that id, it would check if you had already selected it, if not, it would call the select(objectId) function. In order to let the server know you have selected this mob, this select(objectId) function will prepare a 'packet' to send to the server notifying it of your actions. The header for this packet would be '0200', to let the server know the packet contains information about the player selecting something. Then it would put the objectId of what you selected in the body of the packet, in this case '80103fd7'. Everything put in packets will always be in reverse byte order, so the packet will look like this: '0200D73F1080'

Next the select(objectId) function will call a function that handles packets, which I called 'sendPacket(packetSize, packet)'. This function doesn't actually send the packet though, it merely stores the packet in memory somewhere and then calls further functions that encrypt it and send it on to the server. The reason to use the sendPacket function, is that eventually most functions end up calling it anyway, so it requires much less searching for function addresses and keeping them updated, all you have to know is where this one funciton is located and what the packets originating from different functions look like.

This method just uses a different function in the game to do your bidding, so it is just as detectable as when using other functions. You can also send packets directly from your computer, without injecting functions in your client. This would mean you'd have to encrypt them yourself though, the advantage is that you can bypass using the game entirely though, saving a lot of resources. You'd then have to set up a connection with the server and use the packets the server sends you to keep track of monster positions, your stats, etc etc, what you normally would look up in memory.

This method would require you to send ALL the packets the server expects from the client, not just ones informing the server of an action, and I can imagine messing that up would increase detectability.