Register for your free account! | Forgot your password?

You last visited: Today at 06:12

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

Advertisement



Sending Packets

Discussion on Sending Packets within the PW Hacks, Bots, Cheats, Exploits forum part of the Perfect World category.

Reply
 
Old 02/07/2013, 12:36   #346
 
Interest07's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
Quote:
Originally Posted by belobrk View Post
So, can anyone please translate the main subject here? I ain't no programmer or anything related but I'd still like to know how would I make a good use of this 35 pages o info. It'd be much appreciated
This information is for programmers I'm afraid

The way your game communicates with the server is by sending 'packets' of information (for example moving to some place, using a skill, talking to an NPC). The server also sends packets back to your game telling you what is happening around you (other players moving, using skills, mobs that are around etcetera). In order to make an effective bot, you want your game to perform actions without you having to click or press any buttons. What this thread describes is how to send packets pretending to be the game once you've located that function within the game's code.

Because bandwidth is limited, packets are condensed into as few bytes of information as possible:
One number indicating the type of packet (e.g. doing a buying an item = 21), then additional numbers for any other information necessary for performing that action (item id, quantity, etc). In order to use the send packet function, you first have to figure out what number of packet describes which action, and what parameters (additional numbers) are needed for that action.

This thread basically discusses a big amount of different actions and their corresponding packet ids and parameters.

edit: also, since the packets sent from the server and back are encrypted, this function isn't actually the function that's responsible for sending the packets, but more for encrypting them first and then sending.
Interest07 is offline  
Old 02/08/2013, 02:13   #347
 
elite*gold: 0
Join Date: Mar 2011
Posts: 2
Received Thanks: 0
I need a bit of help is anyone is up for it.

I'm trying to read the inventory to an array but I'm doing something wrong.

I'm guessing I'm not reading from the right place and finding offsets is not really my strong side.

Fyi I did not write the BuildInventoryArray function (most of it anyways), found it on a prophet modified bot and I'm trying to make it work with my client (scanning inventory, opening packs and dropping "crap" items for a private server).

Using what Interest07 posted it was easy to send packets to open packs and dropping items but I'd have to know their current position in inventory and that is where I'm lost.

Anyways, here is the code:

PHP Code:
#RequireAdmin
#include <File.au3>
#include <NomadMemory.au3>

Global $APP_BASE_ADDRESS 0x00B4EF34

Global $PROCESS_ID ProcessExists('elementclient.exe')
Global 
$PROCESS_INFORMATION _MemoryOpen($PROCESS_ID)
Global 
$CHAR_DATA_BASE _MemoryRead(_MemoryRead($APP_BASE_ADDRESS$PROCESS_INFORMATION) + 0x34 $PROCESS_INFORMATION)

Global 
$OFFSET_INVENTORYID 8
Global $OFFSET_INVENTORYSTACKAMOUNT 16
Global $OFFSET_INVENTORYMAXSTACKAMOUNT 20
Global $OFFSET_INVENTORYDESCRIPTION 64

BuildInventoryArray
()

Func BuildInventoryArray()
    
Local $array[1][7], $pointer$inventory_base$counter$inventorysize
    $inventorysize 
_MemoryRead(_MemoryRead($CHAR_DATA_BASE 0xD20$PROCESS_INFORMATION) + 0x14$PROCESS_INFORMATION) ;0xCA4
    $pointer 
_MemoryRead(_MemoryRead($CHAR_DATA_BASE 0xD20$PROCESS_INFORMATION) + 0xC$PROCESS_INFORMATION) ;0xCA4
    
For $i=0 To $inventorysize 1
        $inventory_base 
_MemoryRead($pointer $i 0x4$PROCESS_INFORMATION)
        
ReDim $array[$i 1][7]
        
$array[$i][0] = _MemoryRead($inventory_base$PROCESS_INFORMATION) ;ID
        $array
[$i][1] = _MemoryRead($inventory_base $OFFSET_INVENTORYID$PROCESS_INFORMATION) ;ID
        $array
[$i][2] = _MemoryRead($inventory_base $OFFSET_INVENTORYSTACKAMOUNT$PROCESS_INFORMATION) ;Stack Amount
        $array
[$i][3] = _MemoryRead($inventory_base $OFFSET_INVENTORYMAXSTACKAMOUNT$PROCESS_INFORMATION) ;MAX Stack Amount
        
;$array[$i][4] = _MemoryRead($inventory_base $OFFSET_INVENTORYSELLPRICE$PROCESS_INFORMATION) ;Sell Price
        
;$array[$i][5] = _MemoryRead($inventory_base $OFFSET_INVENTORYBUYPRICE$PROCESS_INFORMATION) ;Buy Price
        $array
[$i][6] = _MemoryRead(_MemoryRead($inventory_base $OFFSET_INVENTORYDESCRIPTION$PROCESS_INFORMATION), $PROCESS_INFORMATION'wchar[30]') ;Name
    Next
    Local $sFile 
= @ScriptDir "\Test.txt"
    
_FileWriteFromArray($sFile$array)
EndFunc 
I'd appreciate any help..
hkr1 is offline  
Old 02/08/2013, 05:37   #348
 
elite*gold: 0
Join Date: Nov 2012
Posts: 96
Received Thanks: 81
Quote:
Originally Posted by hkr1 View Post
but I'd have to know their current position in inventory and that is where I'm lost.
sit back, take some time, look again at the code you posted and try to understand the function first before you use it...

im sure the most who read your question and look on the code make this ->
Murmuring is offline  
Old 02/08/2013, 11:01   #349
 
elite*gold: 0
Join Date: Mar 2011
Posts: 2
Received Thanks: 0
Quote:
Originally Posted by Murmuring View Post
sit back, take some time, look again at the code you posted and try to understand the function first before you use it...

im sure the most who read your question and look on the code make this ->
Got it to work
hkr1 is offline  
Old 02/14/2013, 18:27   #350
 
elite*gold: 0
Join Date: Dec 2011
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by Interest07 View Post
This information is for programmers I'm afraid

The way your game communicates with the server is by sending 'packets' of information (for example moving to some place, using a skill, talking to an NPC). The server also sends packets back to your game telling you what is happening around you (other players moving, using skills, mobs that are around etcetera). In order to make an effective bot, you want your game to perform actions without you having to click or press any buttons. What this thread describes is how to send packets pretending to be the game once you've located that function within the game's code.

Because bandwidth is limited, packets are condensed into as few bytes of information as possible:
One number indicating the type of packet (e.g. doing a buying an item = 21), then additional numbers for any other information necessary for performing that action (item id, quantity, etc). In order to use the send packet function, you first have to figure out what number of packet describes which action, and what parameters (additional numbers) are needed for that action.

This thread basically discusses a big amount of different actions and their corresponding packet ids and parameters.

edit: also, since the packets sent from the server and back are encrypted, this function isn't actually the function that's responsible for sending the packets, but more for encrypting them first and then sending.
You could have stopped at your first line but you kept going and I'm thankful for that. Thanks a bunch. Cleared a lot of things up.
belobrk is offline  
Old 02/20/2013, 22:48   #351
 
ntldr32's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 75
Received Thanks: 34

How to select one of that option,
i tryd to use function handInQuest after interact with the npc, but somehow i alwasy fail with that function, anyone can help?
i also want to know, why my image above not showed XD,...
ntldr32 is offline  
Old 03/11/2013, 07:30   #352
 
elite*gold: 0
Join Date: Jan 2010
Posts: 21
Received Thanks: 10
Quote:
Originally Posted by ntldr32 View Post

How to select one of that option,
i tryd to use function handInQuest after interact with the npc, but somehow i alwasy fail with that function, anyone can help?
i also want to know, why my image above not showed XD,...
To accept and hand in this quest :



Code:
acceptQuest(24877, $pid)
Sleep(1000)
handInQuest(24877, 0, $pid)
That will trade your Nirvana Talisman to Mysterious Chip x10 (0 mean first option)

or handInQuest(24877, 1, $pid) will trade your Nirvana Talisman to Mirage Celestone x5


About your image problem, u should check your client, maybe file models.pck

Quote:
Originally Posted by nashua100 View Post
so..it means ...i cant send packet over 0x80 with (sendpacket function) as the usual i use ?
if cannot...how i write it......can You tell me ...Swoosh....Txs before
If i were you,i would send 3 buy packet to buy 3 item, don't have to send one big packet to buy 3 item
jollyjoker0305 is offline  
Old 05/29/2013, 23:46   #353
 
elite*gold: 0
Join Date: Apr 2013
Posts: 5
Received Thanks: 0
Hello Do you have a script like that ?
PopingIt is offline  
Old 07/08/2013, 18:20   #354
 
elite*gold: 0
Join Date: Jul 2013
Posts: 4
Received Thanks: 0
trinna get started

this is my first time doing a bot EVER! so can someone just give me a push on it. i downloaded the program and downloaded autoit but thats it. i would greatly appreciate it
missnaya is offline  
Old 07/08/2013, 23:52   #355
 
elite*gold: 10
Join Date: Sep 2010
Posts: 400
Received Thanks: 234
Quote:
Originally Posted by missnaya View Post
this is my first time doing a bot EVER! so can someone just give me a push on it. i downloaded the program and downloaded autoit but thats it. i would greatly appreciate it
This thread is not actually a bot although it's about something that many bots use these days.
If you're just starting with bots, you're better off using one straight out of the box - I see you've already found Murmuring's prophet bot thread. That thread is kind of aimed at those who already know how to use it, so for basic info on setting it up, you'd probably want to take a look at one of the older threads.
Having not actually used the bot, I'm gonna guess that for tutorials etc.
If anyone has a better link, please jump in

Or if you're after a commercial (subscription) bot that's much kinder on your system resources, give a go.
dumbfck is offline  
Old 07/09/2013, 03:10   #356
 
elite*gold: 0
Join Date: Jul 2013
Posts: 4
Received Thanks: 0
ok thx i will start from the bottom, im obsessed with pw now so i got time to learn
missnaya is offline  
Old 07/25/2013, 21:54   #357
 
ntldr32's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 75
Received Thanks: 34
hi, i download the packetsender and memfunction class and compiled both of that class into .Net Dll Library, and then i use it with VB.net.
All function look good, all working until i try to call skill with "useSkill" function, i got mesg "Invalid Skill" in game,
im sure that the skill id is correct, but everytime i try to use that function, the result is always same :/. I do something like this on my code
______________
PHP Code:
    Public Shared Sub killTarget(ByVal targetID As IntegerByVal skillArray As List(Of Integer))
        
sendPacket.select(targetID)
        For 
As Integer 0 To skillArray.Count 1
            
If skillArray(i) = 0 Then
                sendPacket
.regularAttack(0)
            
End If
            If 
skill.isCooldown(skillArray(i)) = False And skillArray(i) <> 0 Then
                sendPacket
.useSkill(skillArray(i), targetID)
            
End If
        
Next
    End Sub 
______________
i also try to call it manual by directly passd the id of skill and target, but still get "Invalid Skill" msg in game., can you tell me what to be fix? do i need to edit the packet sender, and recompile it?
ntldr32 is offline  
Old 07/26/2013, 00:49   #358
 
elite*gold: 10
Join Date: Sep 2010
Posts: 400
Received Thanks: 234
If you're getting the invalid skill message, that would suggest the injection function is working fine but your values aren't. Are you mixing decimal and hex?
Try putting a
Code:
Console.Write(skillArray(i).ToString("X"))
to see what actual value you have at that point - Or set a breakpoint.
Also, check your target ID is valid and also in the correct format.

Alternatively, try using hardcoded values. Have you tried using non-target skills, e.g., spark?
dumbfck is offline  
Old 07/26/2013, 01:34   #359
 
ntldr32's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 75
Received Thanks: 34
Quote:
Originally Posted by dumbfck View Post
If you're getting the invalid skill message, that would suggest the injection function is working fine but your values aren't. Are you mixing decimal and hex?
Try putting a
Code:
Console.Write(skillArray(i).ToString("X"))
to see what actual value you have at that point - Or set a breakpoint.
Also, check your target ID is valid and also in the correct format.

Alternatively, try using hardcoded values. Have you tried using non-target skills, e.g., spark?
i used all value as decimal, since the packetSender.cs req integer value as parameter.
i had try to call skill directly, eg
Code:
    Sub tes()
        Dim rBaseAddrs As Integer = 12633740
        Dim psAddres As Integer = 7177216
        Dim pHandle As IntPtr
        Try
            For Each proc As Process In Process.GetProcessesByName("elementclient")
                pHandle = pwi_lib.MemFunctions.OpenProcess(proc.Id)
            Next
        Catch ex As Exception
            Exit Sub
        End Try
        Dim sendPacket As New pwi_lib.PacketSender(pHandle)
        sendPacket.REAL_BASE_ADDRESS = rBaseAddrs
        sendPacket.SEND_PACKET_ADDRESS = psAddres
        sendPacket.select(-2092956593) 'select Demonic Souling, work'        
        sendPacket.useSkill(1352, -2092956593) 'try to kill it with Battousai, not work'
        sendPacket.useSkill(1714, 0) 'cast seeker Celestial Eruption, its work'
    End Sub
im sure tha 1352 is the ID for seeker skill Battousai, and -2092956593 is the ID for one of some Demonic Souling, in demonic world. when i call sendPacket.select(-2092956593), the carachter lock that mobs, so i dont think its wrong,. but not sure also, bcos when i use prophet bot to see the id of same monster, the result is differnt 2202010703 is the id of that mob i got from prophet bot, i also try to use that target id from prophet bot, but VS show error when i passed that number(maybe out of integer range).
ntldr32 is offline  
Old 07/26/2013, 02:01   #360
 
elite*gold: 10
Join Date: Sep 2010
Posts: 400
Received Thanks: 234
Those two numbers are effectively the same. -2092956593 = FFFFFFFF8340044F which if it was a 64 bit number would make a difference as it's the signed equivalent, but as a 32 bit DWORD is the same as 2202010703 = 8340044F.
You're better off working in hex by the way as it's much less confusing in the long run. I still can't understand how people can work in decimal with machine code for the vast majority of stuff lol.

I don't use VB for this sort of thing because it's not really ideal, so I can't test it as I don't have any projects I can throw it into. Unless you want to PM me your project or something and I can maybe have a look tomorrow (it's late here now!)
It's the sort of thing I'd probably want breakpoint in VS and Olly to track down the fault.
Also, I haven't done packet stuff for a really long time, so perhaps the packet structure has changed since the code you're using was posted.
I have detailed how you can analyse what stuff is being sent in packets

There are other utilities and stuff that people have posted for analysing packets
but I've not really used them so I don't know how they work or if they still work. If you're interested in that, take a look at the packet section on the

Hopefully something here will be of use to you lol.
dumbfck is offline  
Reply


Similar Threads Similar Threads
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?



All times are GMT +1. The time now is 06:13.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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