Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 16:02

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

Advertisement



[UPDATED] Packet structure - Using pointers

Discussion on [UPDATED] Packet structure - Using pointers within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2010
Posts: 64
Received Thanks: 10
[UPDATED] Packet structure - Using pointers

Hey ,
i made a new packet structure but this time using pointers as Fang said that pointers is better



Regards ,
Salah Mostafa
sala7mostafa is offline  
Old 12/09/2013, 19:17   #2
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Instead of keeping to repeat this:
Code:
            fixed (byte* Packet = Buffer)
Then you could make a property for the pointer:
Code:
		public byte* Pointer
		{
			get
			{
				fixed (byte* p = Buffer)
					return p;
			}
		}
Super Aids is offline  
Thanks
1 User
Old 12/14/2013, 22:40   #3
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
or you guys could just check the COPSv6 source.... ^^
12tails is offline  
Old 12/14/2013, 23:17   #4


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by Super Aids View Post
Instead of keeping to repeat this:
Code:
            fixed (byte* Packet = Buffer)
Then you could make a property for the pointer:
Code:
		public byte* Pointer
		{
			get
			{
				fixed (byte* p = Buffer)
					return p;
			}
		}
The pointer is unsafe () The memory manager might move the managed memory after... The fixed keyword say to the memory manager to fix the memory during a period of time, after that, the pointer is no longer valid. So, everything you do on the pointer must be done inside the fixed's brackets.


Edit. For the thread itself, the code is not really faster as you're fixing the memory for each read and write... All operations should be done in one block to optimize the thing.
Or, just use unmanaged memory and/or just use a structure which will map all the buffer directly to values. (ref. COPS v6)
CptSky is offline  
Thanks
4 Users
Old 12/15/2013, 06:53   #5
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Quote:
Originally Posted by CptSky View Post
The pointer is unsafe () The memory manager might move the managed memory after... The fixed keyword say to the memory manager to fix the memory during a period of time, after that, the pointer is no longer valid. So, everything you do on the pointer must be done inside the fixed's brackets.
Thanks, didn't actually know that
Super Aids is offline  
Reply


Similar Threads Similar Threads
Packet Structure
02/24/2013 - SRO Coding Corner - 5 Replies
Hi all :) , i need help to get the good structure for any packet from SRO_Client.exe with ollydbg , i don't know how to use it , and thxs
Packet Structure from SRO_Client.exe
06/12/2011 - SRO Coding Corner - 2 Replies
Hello Community, im developing a new emulator and use a packet sniffer for finding my packets. Now i want to try to read the packet structure from client with ollydbg. That would simplify my work. I hope someone can explain me how it works
[Request] Packet Structure for CharData Packet
05/16/2011 - Silkroad Online - 4 Replies
can someone tell me which structure the CharData packet has? i would really appreciate this, since im still noob in such things. its just too high for me/ too much information for my head. :handsdown: S->C(3013)...
packet structure
03/09/2008 - Conquer Online 2 - 16 Replies
For what I'd like to do, I think packets are the place to start. After that, probably java then C and VB. This is a question for the people here who are self-taught... what resources would you recommend for... 1. understanding packet structure 2. learning some programming language without enrolling at the local university I'm mainly interested in packet structure and how to capture/decipher/edit/send them, and eventually I'd like to "automate" these functions by writing some programs. ...



All times are GMT +1. The time now is 16:03.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.