gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
76793 Posts in 13502 Topics by 1651 Members - Latest Member: Arnold99 November 21, 2024, 12:45:34 pm
*
gfx*gfx
gfx
WinMX World :: Forum  |  Technical  |  Protocol Discussion  |  Packet Enquiry
gfx
gfxgfx
 

Author Topic: Packet Enquiry  (Read 3411 times)

0 Members and 1 Guest are viewing this topic.

Offline Josh

  • Forum Member
  • Thinking about tomorrow...
    • http://www.winmxunlimited.net
Packet Enquiry
« on: September 03, 2005, 10:56:08 pm »
How are you supposed to make a packet? What Format?
- Josh

KiLO

  • Guest
Packet Enquiry
« Reply #1 on: September 04, 2005, 03:21:01 am »
If you take a look at some of the open source programs, you can find examples of use. Yeah, sure the info isn't given right to you, but who said coding was painless?

Also, if you checkout the Internet Achive you can see a brief documentation on KM's old MCS site.

http://web.archive.org/web/20041027202709/www.mxtools.net/?section=techie&page=cht

Thank God for the Internet Archive  :roll:

KM

  • Guest
Packet Enquiry
« Reply #2 on: September 04, 2005, 04:17:58 am »
a packet would refer to a UDP packet, or perhaps the raw TCP packets, if you mean sending messages through the TCP stream, that's not packets :-P

but it just uses the raw data, 2 bytes for a type, 2 bytes for a length, and then the body of the message - the exact formats for the messages are on that page, but you already know that, you did take it and put it on your website...

Offline Josh

  • Forum Member
  • Thinking about tomorrow...
    • http://www.winmxunlimited.net
Packet Enquiry
« Reply #3 on: September 20, 2005, 02:24:35 am »
well like? what would the join packet be. You make it real hard for the people that want to learn.
- Josh

KM

  • Guest
Packet Enquiry
« Reply #4 on: September 20, 2005, 11:00:34 am »
...you should know, it is in your website

Offline Josh

  • Forum Member
  • Thinking about tomorrow...
    • http://www.winmxunlimited.net
Packet Enquiry
« Reply #5 on: September 20, 2005, 02:12:13 pm »
yea but people with no brain can not understand it
- Josh

Sharky

  • Guest
Re: Packet Enquiry
« Reply #6 on: September 19, 2006, 07:18:18 am »
How are you supposed to make a packet? What Format?

[Type - 2 Bytes] [Length of data - 2 Bytes] [Data - Any Size]

The Join Request Type Would Be: 0x0064

[0x0064][Len - 2 Bytes][RoomName - NULL Terminated][Connection - 2 bytes][Primary IP - 4 Bytes][Primary Port - 2 Bytes][Files - 4 Bytes][UserName - NULL Terminated]

Now, lets go over how to create a join packet.

C Code:

Code: [Select]
// Vars
char RoomName[256] = {0x00};
char UserName[64] = {0x00};
WORD wLine = 0;
WORD wPrimeUDPPort = 0;
DWORD dwFiles = 0;
DWORD dwPrimeIP = 0;
char buffer[MAX_BUFFER_SIZE] = {0x00};

sprintf(RoomName,"YourRoom_0100007f0003");
sprintf(UserName,"YourUserName000_00000");
//skip the first four bytes, for now.
WORD Len = 4;
//copy our room name to our packet
lstrcpy(buffer+Len,RoomName);
// our length is then increased,
// we then add the length of our ROom Name
// to our total length variable (Len)
// Since the end of the string has no value (NULL)
// we can just skip it by adding 1 to the total length
Len+=strlen(RoomName)+1;
//Now we copy our linetype
memcpy(buffer+Len, &wLine, 2);
// since the linetype is only 2 bytes
// we add 2 to our total length
Len+=2;
// we then copy our Prime IP
memcpy(buffer+Len, &dwPrimeIP, 4);
// since the prime ip is 4 bytes
// we add 4 to our total length
Len+=4;
// Now we copy our Prime UDP Port
memcpy(buffer+Len, &wPrimeUDPPort, 2);
// 2 bytes, we add 2
Len+=2;
// Add our file count
memcpy(buffer+Len, &dwFiles, 4);
// 4 bytes, we add 4
Len+=4;
// add our user name
lstrcpy(buffer+Len, UserName);
// add the length of our username to the total length var (Len)
// Null terminated, we just add 1, since end of string contains null chars
Len+=strlen(UserName)+1;
// we add our type at the beginning
*(WORD*)buffer = 0x0064;
// we add our packet length
*(WORD*)buffer+2 = Len-4;
// we subtract 4, the type and lenght are each 2 bytes, which makes 4, we don't
// add the length of our type and length.

// Encrypt

YourdwUPKey = EncryptMXTCP((BYTE*)buffer, Len, YourdwUPKey);

// this should help, it doesn't explain everything, but it answers your question
// on how to write a join packet. Please excuse any syntax errors in my code, it was
// written in notepad. LOL

Offline Josh

  • Forum Member
  • Thinking about tomorrow...
    • http://www.winmxunlimited.net
Re: Packet Enquiry
« Reply #7 on: September 19, 2006, 02:54:17 pm »
Would of been useful about a year ago. I dont program for winmx anymore.
- Josh

WinMX World :: Forum  |  Technical  |  Protocol Discussion  |  Packet Enquiry
 

gfxgfx
gfx
©2005-2024 WinMXWorld.com. All Rights Reserved.
SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
Page created in 0.005 seconds with 17 queries.
Helios Multi © Bloc
gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!