Global $kernel32 = DllOpen('kernel32.dll')
Global $pid = ProcessExists('elementclient.exe')
global $realBaseAddress = 10229012
global $sendPacketFunction = 0x005BD7B0
DllClose($kernel32)
Func dropGold($amount, $pid)
;Drops $amount of gold to floor
local $packet, $packetSize
Func sendPacket($packet, $packetSize, $pid)
;Declare local variables
Local $pRemoteThread, $vBuffer, $loop, $result, $OPcode, $processHandle, $packetAddress
;Open process for given processId
$processHandle = memopen($pid)
;Allocate memory for the OpCode and retrieve address for this
$functionAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', 0x46, 'int', 0x1000, 'int', 0x40)
;Allocate memory for the packet to be sent and retrieve the address for this
$packetAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', $packetSize, 'int', 0x1000, 'int', 0x40)
;Put the OpCode into a struct for later memory writing
$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
;Write the OpCode to previously allocated memory
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $functionAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Put the packet into a struct for later memory writing
$vBuffer = DllStructCreate('byte[' & StringLen($packet) / 2 & ']')
For $loop = 1 To DllStructGetSize($vBuffer)
DllStructSetData($vBuffer, 1, Dec(StringMid($packet, ($loop - 1) * 2 + 1, 2)), $loop)
Next
;Write the packet to previously allocated memory
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $packetAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Create a remote thread in order to run the OpCode
$hRemoteThread = DllCall($kernel32, 'int', 'CreateRemoteThread', 'int', $processHandle, 'int', 0, 'int', 0, 'int', $functionAddress[0], 'ptr', 0, 'int', 0, 'int', 0)
;Wait for the remote thread to finish
Do
$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
Until $result[0] <> 258
;Close the handle to the previously created remote thread
DllCall($kernel32, 'int', 'CloseHandle', 'int', $hRemoteThread[0])
Global $kernel32 = DllOpen('kernel32.dll')
Global $pid = ProcessExists('elementclient.exe')
global $realBaseAddress = 10229012
global $sendPacketFunction = 0x005BD7B0
DllClose($kernel32)
Func dropGold($1, $pid)
;Drops $amount of gold to floor
local $packet, $packetSize
Func sendPacket($packet, $packetSize, $pid)
;Declare local variables
Local $pRemoteThread, $vBuffer, $loop, $result, $OPcode, $processHandle, $packetAddress
;Open process for given processId
$processHandle = memopen($pid)
;Allocate memory for the OpCode and retrieve address for this
$functionAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', 0x46, 'int', 0x1000, 'int', 0x40)
;Allocate memory for the packet to be sent and retrieve the address for this
$packetAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', $packetSize, 'int', 0x1000, 'int', 0x40)
;Put the OpCode into a struct for later memory writing
$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
;Write the OpCode to previously allocated memory
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $functionAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Put the packet into a struct for later memory writing
$vBuffer = DllStructCreate('byte[' & StringLen($packet) / 2 & ']')
For $loop = 1 To DllStructGetSize($vBuffer)
DllStructSetData($vBuffer, 1, Dec(StringMid($packet, ($loop - 1) * 2 + 1, 2)), $loop)
Next
;Write the packet to previously allocated memory
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $packetAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Create a remote thread in order to run the OpCode
$hRemoteThread = DllCall($kernel32, 'int', 'CreateRemoteThread', 'int', $processHandle, 'int', 0, 'int', 0, 'int', $functionAddress[0], 'ptr', 0, 'int', 0, 'int', 0)
;Wait for the remote thread to finish
Do
$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
Until $result[0] <> 258
;Close the handle to the previously created remote thread
DllCall($kernel32, 'int', 'CloseHandle', 'int', $hRemoteThread[0])
Global $kernel32 = DllOpen('kernel32.dll')
Global $pid = ProcessExists('elementclient.exe')
global $realBaseAddress = 0x009C1514
global $sendPacketFunction = 0x005BD7B0
DllClose($kernel32)
Func dropGold($amount, $pid)
dropGold(1, $pid)
;Drops $amount of gold to floor
local $packet, $packetSize
Func sendPacket($packet, $packetSize, $pid)
;Declare local variables
Local $pRemoteThread, $vBuffer, $loop, $result, $OPcode, $processHandle, $packetAddress
;Open process for given processId
$processHandle = memopen($pid)
;Allocate memory for the OpCode and retrieve address for this
$functionAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', 0x46, 'int', 0x1000, 'int', 0x40)
;Allocate memory for the packet to be sent and retrieve the address for this
$packetAddress = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', $packetSize, 'int', 0x1000, 'int', 0x40)
;Put the OpCode into a struct for later memory writing
$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
;Write the OpCode to previously allocated memory
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $functionAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Put the packet into a struct for later memory writing
$vBuffer = DllStructCreate('byte[' & StringLen($packet) / 2 & ']')
For $loop = 1 To DllStructGetSize($vBuffer)
DllStructSetData($vBuffer, 1, Dec(StringMid($packet, ($loop - 1) * 2 + 1, 2)), $loop)
Next
;Write the packet to previously allocated memory
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $packetAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Create a remote thread in order to run the OpCode
$hRemoteThread = DllCall($kernel32, 'int', 'CreateRemoteThread', 'int', $processHandle, 'int', 0, 'int', 0, 'int', $functionAddress[0], 'ptr', 0, 'int', 0, 'int', 0)
;Wait for the remote thread to finish
Do
$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
Until $result[0] <> 258
;Close the handle to the previously created remote thread
DllCall($kernel32, 'int', 'CloseHandle', 'int', $hRemoteThread[0])
Well, it would help if you understood the basics in programming I suppose. I'd suggest following a tutorial or two on AutoIt (or any other programming 'language'). In an AutoIt script, you declare functions by writing
Code:
Func <FunctionName>([parameter name1, ...., parameter nameN]
[code for performing the function based on the parameters you were passed]
End Func
Where you may have 0 to N parameters.
In order to perform said function, you 'call' the function elsewhere in the code. It is generally not advisable to call the same function inside the function itself unless you are expressly interested in recursion (which, trust me, you are not).
In AutoIt the code that will be performed upon starting the script will be in the top part, usually after declaring the global variables. Since the 'dropGold' function requires the $pid to be given, I'd suggest writing the function call to dropGold "dropGold(1, $pid)" after the bit of code where the $pid is retrieved.
So after
Code:
Global $pid = ProcessExists('elementclient.exe')
You'd put your function call for the packet you wish to send, just like in my first post of this thread.
And just to reiterate in case you didn't understand. You can NOT use packets to randomly spawn gold or exp or items or robot unicorns that shoot rainbows.
I am currently using C# to send package to the server,after a while, about 3 or 4 times, the game client become stuck and not responding. Any suggestion for that error?
Thanks ^ ^
I am currently using C# to send package to the server,after a while, about 3 or 4 times, the game client become stuck and not responding. Any suggestion for that error?
Thanks ^ ^
I'm sorry I've never encountered any difficulties even after sending thousands of packets. You might want to ensure that the packets I've listed are the same for your version of PW. As someone has mentioned before somewhere in this thread, for the russian version of PW the packets for using skills might be different for example.
Iam confused!!! can you make TRUE SCript for PW indo plese??
If my explanation confused you, you might want to follow some very basic tutorials on using AutoIt, how to use functions specifically...
I'm not here to write scripts for other people. I'm happy to help them achieve their goals if they have questions I can answer or I have information to share. Simply copy-pasting code and randomly expecting it to do what you want isn't the way to go. Try and understand what the code does instead.
I'm sorry I've never encountered any difficulties even after sending thousands of packets. You might want to ensure that the packets I've listed are the same for your version of PW. As someone has mentioned before somewhere in this thread, for the russian version of PW the packets for using skills might be different for example.
Quote:
Originally Posted by Interest07
If my explanation confused you, you might want to follow some very basic tutorials on using AutoIt, how to use functions specifically...
I'm not here to write scripts for other people. I'm happy to help them achieve their goals if they have questions I can answer or I have information to share. Simply copy-pasting code and randomly expecting it to do what you want isn't the way to go. Try and understand what the code does instead.
Interest07, i am both impressed and in awe of your patience and stamina when you are dealing with these .... erm.. cases.
I would have sent them to a "warm" place a long time ago.
So here is to you Interest07, keep up the good work, please send some patience my way and I'm dying of curiosity on how you will handle their follow up questions, such as: "why do I need to press compile?" or "does my computer need to be turned on for bot to work?".
Interest07, i am both impressed and in awe of your patience and stamina when you are dealing with these .... erm.. cases.
I would have sent them to a "warm" place a long time ago.
So here is to you Interest07, keep up the good work, please send some patience my way and I'm dying of curiosity on how you will handle their follow up questions, such as: "why do I need to press compile?" or "does my computer need to be turned on for bot to work?".
Hahaha I love the way you put that...
When I first happened across these forums and knew absolutely nothing about cheat engine, asm, etcetera I was helped a lot by posts from people such as yourself to enter this newly found realm (to me at least) inside of PW. That inspired me to try and share any knowledge I came across to help others in a similar manner. I've also come to understand where the occasional outburst of aggravation came from though
I'm trying to keep my cool, even though I think some people are biting off a bit more than they can chew at times...
I'm sorry I've never encountered any difficulties even after sending thousands of packets. You might want to ensure that the packets I've listed are the same for your version of PW. As someone has mentioned before somewhere in this thread, for the russian version of PW the packets for using skills might be different for example.
I can do self cast but I can not do it with target and after do 4-5 self cast spells, the game client become not responding. Maybe my code do something stupid with the game client. Anyway, thank for your respond ^ ^
P/s: Is there any problem if I open and close the process many time, for example, update game info, perform send package, scan for mob, items, npc?
Help with sending packets in autoit 08/16/2010 - AutoIt - 1 Replies ive been lookin around different sites for ways to send packets to the game server. the only examples i see is to create a server and a client which i dont need, i think. well to the point now, can someone lead me in a direction or tell me how to send packets to a game? also if i send packets then that means i dont need the game to be active, correct? Because in autoit when u use keys u need to have the game active, and control send does not work. ty
Sending Packets !!! 09/07/2008 - Kal Online - 14 Replies now i know how to sniff / analyse packets ... but what then ? :)
how can i send packets ?? to pimp or mix weapon for example
i just need the way to send , and then i can depend on myself :D
Sending Packets (need advice) 03/20/2008 - Conquer Online 2 - 7 Replies OK well im finaly trying to stop leaching off of everybodys work its been great n all download n play :D But im tired of being a begger n the past couple months ive been learning as much as i can about macros memery add blah blah you know ...
After playing around with ce and ahk the past couple months i stumbled across wpe pro, theres not alot of tuturals and its hard to find good help.
Well heres what ive been doing so far, open my CO then i attach it to my sniffer.
I change my...
Scamming by sending packets??? 04/15/2006 - Conquer Online 2 - 1 Replies Well my friend and i came up with the idea to send packets to the server to show a certain item in the trade window. We want to use this as a type of scam. I didnt see this in any other threads and was wondering if anyone knew if this is possible and if they could point use in the right direction. My friend was pretty good with packets in CO 1.0 but we arent really sure to go about doing it. If anyone one could please lend a helping hand?
P.S.- Before I get flamed for this because i know i...
Sending packets 10/12/2005 - Conquer Online 2 - 10 Replies I've a question. Is it possible to send 1 packet multiple times at the exact same time?