PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Editing packets.

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Packet World
Display posts from previous:   

Author Message
mr bubbles



Joined: 18 Jan 2007
Posts: 91

PostPosted: Sun Mar 25, 2007 2:14 am    Post subject: Editing packets. Reply with quote

Is it possible to hook a packet like 0x6C (target cursor) and edit the packet info the client sends?

I want it to always show the result of GetMapInfo() in the last part of the packet, instead of the landtile or static #.

What ive got now is a hook catching the packet and creating a new packet of the same type to what i want. But how do i make POL use the edited packet? I've tried

packet := newpacket;
return 0;

or is it sent via a different packet to the client with the info?

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Sun Mar 25, 2007 12:00 pm    Post subject: Reply with quote

If you want to hook a packet sent by the client and modify it before it gets to the server, that's entirely possible. Make sure it is configured as a recieve hook, and try editing packet instead of setting it to equal another packet.

Author Message
mr bubbles



Joined: 18 Jan 2007
Posts: 91

PostPosted: Sun Mar 25, 2007 4:25 pm    Post subject: Reply with quote

how do i edit "packet"? does .setintx(x, x) overwrite whats there or just make the packet bigger? and how is it different than me creating a new packet and assigning "packet" to that one?

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Mon Mar 26, 2007 10:24 am    Post subject: Reply with quote

If you use .SetInt16(), etc... you'll be rewriting 16-bytes of memory starting at that offset, which would overwrite the old data. I can't think of a reason that packet := newpacket wouldn't work, but using SetInt16(), etc... would just be the first thing I would check, because I know that way works.

Could you post your code? Maybe it's something else.

Author Message
Barbeirosa



Joined: 01 Feb 2007
Posts: 43

PostPosted: Mon Mar 26, 2007 1:25 pm    Post subject: Reply with quote

Does your packethook script declare the packet parameter as byref? If it does not, then nothing at all you do to the packet will stick.

Author Message
mr bubbles



Joined: 18 Jan 2007
Posts: 91

PostPosted: Mon Mar 26, 2007 9:40 pm    Post subject: Reply with quote

ohh, editing packet worked. maybe the packet i created was the wrong size or something Razz

Thanks for the help

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Mon Mar 26, 2007 10:23 pm    Post subject: Reply with quote

Good. Smile

Post new topic   Reply to topic    PenUltima Online Forum Index -> Packet World All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty