C1,c2,c3,c4

Results 1 to 24 of 24
  1. #1
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    C1,c2,c3,c4

    Help to understand what is going on encryption and thus data decryption.
    And how to check packets between the server and the client, in general understand the relationship


  2. #2
    (づ。◕‿‿◕。) Natzugen is offline
    MemberRank
    Jun 2014 Join Date
    ElbelandLocation
    1,858Posts

    Re: C1,c2,c3,c4

    learn about winsock and use wpepro or wireshark to capture the packets

  3. #3
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: C1,c2,c3,c4

    First of all, you should open any MU Online Protocol on server side, then you need a protocol on client side ( you can use xteam, reedlan addons ) to see what an witch packet does.

    Packet Headers example ( connect server protocol ):

    Code:
    #pragma once
    
    #define SET_NUMBERHB(x) ((BYTE)((DWORD)(x)>>(DWORD)8))
    #define SET_NUMBERLB(x) ((BYTE)((DWORD)(x)&0xFF))
    #define SET_NUMBERHW(x) ((WORD)((DWORD)(x)>>(DWORD)16))
    #define SET_NUMBERLW(x) ((WORD)((DWORD)(x)&0xFFFF))
    #define SET_NUMBERHDW(x) ((DWORD)((QWORD)(x)>>(QWORD)32))
    #define SET_NUMBERLDW(x) ((DWORD)((QWORD)(x)&0xFFFFFFFF))
    
    #define MAKE_NUMBERW(x,y) ((WORD)(((BYTE)((y)&0xFF))|((BYTE)((x)&0xFF)<<8)))
    #define MAKE_NUMBERDW(x,y) ((DWORD)(((WORD)((y)&0xFFFF))|((WORD)((x)&0xFFFF)<<16)))
    #define MAKE_NUMBERQW(x,y) ((QWORD)(((DWORD)((y)&0xFFFFFFFF))|((DWORD)((x)&0xFFFFFFFF)<<32)))
    
    //**********************************************//
    //************ Packet Base *********************//
    //**********************************************//
    
    struct PBMSG_HEAD
    {
    	void set(BYTE head,BYTE size) // OK
    	{
    		this->type = 0xC1;
    		this->size = size;
    		this->head = head;
    	}
    
    	void setE(BYTE head,BYTE size) // OK
    	{
    		this->type = 0xC3;
    		this->size = size;
    		this->head = head;
    	}
    
    	BYTE type;
    	BYTE size;
    	BYTE head;
    };
    
    struct PSBMSG_HEAD
    {
    	void set(BYTE head,BYTE subh,BYTE size) // OK
    	{
    		this->type = 0xC1;
    		this->size = size;
    		this->head = head;
    		this->subh = subh;
    	}
    
    	void setE(BYTE head,BYTE subh,BYTE size) // OK
    	{
    		this->type = 0xC3;
    		this->size = size;
    		this->head = head;
    		this->subh = subh;
    	}
    
    	BYTE type;
    	BYTE size;
    	BYTE head;
    	BYTE subh;
    };
    
    struct PWMSG_HEAD
    {
    	void set(BYTE head,WORD size) // OK
    	{
    		this->type = 0xC2;
    		this->size[0] = SET_NUMBERHB(size);
    		this->size[1] = SET_NUMBERLB(size);
    		this->head = head;
    	}
    
    	void setE(BYTE head,WORD size) // OK
    	{
    		this->type = 0xC4;
    		this->size[0] = SET_NUMBERHB(size);
    		this->size[1] = SET_NUMBERLB(size);
    		this->head = head;
    	}
    
    	BYTE type;
    	BYTE size[2];
    	BYTE head;
    };
    
    struct PSWMSG_HEAD
    {
    	void set(BYTE head,BYTE subh,WORD size) // OK
    	{
    		this->type = 0xC2;
    		this->size[0] = SET_NUMBERHB(size);
    		this->size[1] = SET_NUMBERLB(size);
    		this->head = head;
    		this->subh = subh;
    	}
    
    	void setE(BYTE head,BYTE subh,WORD size) // OK
    	{
    		this->type = 0xC4;
    		this->size[0] = SET_NUMBERHB(size);
    		this->size[1] = SET_NUMBERLB(size);
    		this->head = head;
    		this->subh = subh;
    	}
    
    	BYTE type;
    	BYTE size[2];
    	BYTE head;
    	BYTE subh;
    };
    
    //**********************************************//
    //********** Client -> ConnectServer ***********//
    //**********************************************//
    
    struct PMSG_SERVER_INFO_RECV
    {
    	PSBMSG_HEAD header; // C1:F4:03
    	BYTE ServerCode;
    };
    
    struct PMSG_SERVER_LIST_RECV
    {
    	PSBMSG_HEAD header; // C1:F4:06
    };
    
    //**********************************************//
    //********** ConnectServer -> Client ***********//
    //**********************************************//
    
    struct PMSG_SERVER_INIT_SEND
    {
    	PBMSG_HEAD header; // C1:00
    	BYTE result;
    };
    
    struct PMSG_SERVER_INFO_SEND
    {
    	PSBMSG_HEAD header; // C1:F4:03
    	char ServerAddress[16];
    	WORD ServerPort;
    };
    
    struct PMSG_SERVER_LIST_SEND
    {
    	PSWMSG_HEAD header; // C1:F4:06
    	BYTE count[2];
    };
    
    struct PMSG_SERVER_LIST
    {
    	WORD ServerCode;
    	BYTE UserTotal;
    	BYTE type;
    };
    
    //**********************************************//
    //**********************************************//
    //**********************************************//
    
    void ConnectServerProtocolCore(int index,BYTE head,BYTE* lpMsg,int size);
    void CCServerInfoRecv(PMSG_SERVER_INFO_RECV* lpMsg,int index);
    void CCServerListRecv(PMSG_SERVER_LIST_RECV* lpMsg,int index);
    void CCServerInitSend(int index,int result);
    And then the actuall Protocol ( connect server ):

    Code:
    void ConnectServerProtocolCore(int index,BYTE head,BYTE* lpMsg,int size) // OK
    {
    	PROTECT_START
    
    	gClientManager[index].m_PacketTime = GetTickCount();
    
    	switch(head)
    	{
    		case 0xF4:
    			switch(lpMsg[3])
    			{
    				case 0x03:
    					CCServerInfoRecv((PMSG_SERVER_INFO_RECV*)lpMsg,index);
    					break;
    				case 0x06:
    					CCServerListRecv((PMSG_SERVER_LIST_RECV*)lpMsg,index);
    					break;
    			}
    			break;
    	}
    
    	PROTECT_FINAL
    }
    
    void CCServerInfoRecv(PMSG_SERVER_INFO_RECV* lpMsg,int index) // OK
    {
    	if(gServerList.CheckJoinServerState() == 0)
    	{
    		return;
    	}
    
    	SERVER_LIST_INFO* lpServerListInfo = gServerList.GetServerListInfo(lpMsg->ServerCode);
    
    	if(lpServerListInfo == 0)
    	{
    		return;
    	}
    
    	if(lpServerListInfo->ServerShow == 0 || lpServerListInfo->ServerState == 0)
    	{
    		return;
    	}
    
    	PMSG_SERVER_INFO_SEND pMsg;
    
    	pMsg.header.set(0xF4,0x03,sizeof(pMsg));
    
    	memcpy(pMsg.ServerAddress,lpServerListInfo->ServerAddress,sizeof(pMsg.ServerAddress));
    
    	pMsg.ServerPort = lpServerListInfo->ServerPort;
    
    	gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
    }
    
    void CCServerListRecv(PMSG_SERVER_LIST_RECV* lpMsg,int index) // OK
    {
    	BYTE send[2048];
    
    	PMSG_SERVER_LIST_SEND pMsg;
    
    	pMsg.header.set(0xF4,0x06,0);
    
    	int size = sizeof(pMsg);
    
    	int count = gServerList.GenerateServerList(send,&size);
    
    	pMsg.count[0] = SET_NUMBERHB(count);
    
    	pMsg.count[1] = SET_NUMBERLB(count);
    
    	pMsg.header.size[0] = SET_NUMBERHB(size);
    
    	pMsg.header.size[1] = SET_NUMBERLB(size);
    
    	memcpy(send,&pMsg,sizeof(pMsg));
    
    	gSocketManager.DataSend(index,send,size);
    }
    
    void CCServerInitSend(int index,int result) // OK
    {
    	PMSG_SERVER_INIT_SEND pMsg;
    
    	pMsg.header.set(0x00,sizeof(pMsg));
    
    	pMsg.result = result;
    
    	gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.header.size);
    }
    Manipulating packets it`s not actually easy because you need to know the size of the packet and other stuff...
    Please remmeber that the packets will be all the same in the gameserver usually, but there will be more "cases" and "C1" you will see a lot when your are moving around in game (movement)

    For the decryption, there is not much to say, because webzen uses the "XOR" encrypt wich looks like this:

    Code:
    static unsigned char bBuxCode[3]={0xF1, 0xDC, 0xEF};	// Xox Key
    
    void BuxConvert(char* buf, int size)
    {
    	int n;
    
    	for (n=0;n<size;n++)
    	{
    		buf[n]^=bBuxCode[n%3] ;
    	}
    }
    It's old and it's shit and any hacker can break a XOR encryption. Best of luck!

  4. #4
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    and the protocol used for the 0.97 version of the mu much different from the above version?

  5. #5
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: C1,c2,c3,c4

    Nope, it's even simpler... Thoe more higher the season gets the more things are added / changed.

  6. #6
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    I would be full of people who helped source to connect the 0.97 version, or even give the correct protocol, and that time is not enough

  7. #7
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    Its my logs file


    22:16:42 connect : [2106][192.168.1.100]
    Error-L1 : Socket Serial 0 o_serial:255 serial:204
    error-L3 : 2106 Game Not Play(Protocol:0,len:48)
    WSARecv() failed with error 10038
    22:16:44 (2106)logout : [192.168.1.100]

    that an error?

  8. #8
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: C1,c2,c3,c4

    Quote Originally Posted by ponteleymon View Post
    Its my logs file


    22:16:42 connect : [2106][192.168.1.100]
    Error-L1 : Socket Serial 0 o_serial:255 serial:204
    error-L3 : 2106 Game Not Play(Protocol:0,len:48)
    WSARecv() failed with error 10038
    22:16:44 (2106)logout : [192.168.1.100]

    that an error?
    Can I ask what you want to do actually now..? Its because you send request but its not valid so its dropped 10038.

    Not better if you create a simple monitor for the clientside and for the serverside, and see the packets realtime?

    In the release section you can find a dll and if you hook it into the clientside it will open a console window and show the sent and recv packets on it and save in to a log file, I cannot give link now bcz i am not on my pc, but if i dont forget I will give link for it.

  9. #9
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    Quote Originally Posted by RevolGaming View Post
    Can I ask what you want to do actually now..? Its because you send request but its not valid so its dropped 10038.

    Not better if you create a simple monitor for the clientside and for the serverside, and see the packets realtime?

    In the release section you can find a dll and if you hook it into the clientside it will open a console window and show the sent and recv packets on it and save in to a log file, I cannot give link now bcz i am not on my pc, but if i dont forget I will give link for it.
    forward links

  10. #10
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    up forward links

  11. #11
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: C1,c2,c3,c4

    Nobody will help you because you do not explain clearly what you want to achieve. You just posted 3 lines of logs, and people should figure it out?

  12. #12
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    Quote Originally Posted by Mecanik View Post
    Nobody will help you because you do not explain clearly what you want to achieve. You just posted 3 lines of logs, and people should figure it out?
    first of all I need to deal with packages for version 0.97 MU, I connect the server 065 version of the source, and I did not get, and because I want to understand what the problem is.

    if you can help me with this, I will give my ICQ or Skype for communication

  13. #13
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: C1,c2,c3,c4

    I dont find the DLL in the dev section.

    Anyways I still dont understand why you want to see the packets, its totally useless for you, I mean if you dont know how to catch them how you want to work with them, after you got the packets..?

    And whats the problem in the source? Why you think there is problem? Why you dont show us whats the real problem... for a simple problem you dont need to learn the mu packet stuct.

  14. #14
    (づ。◕‿‿◕。) Natzugen is offline
    MemberRank
    Jun 2014 Join Date
    ElbelandLocation
    1,858Posts

    Re: C1,c2,c3,c4

    basically the guy says he is using the 0.65 source and is trying to login with 0.97 client but you have to complete a lot of missing stuff and its not just the gs that you have to work with.

  15. #15
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    Quote Originally Posted by natzugen View Post
    basically the guy says he is using the 0.65 source and is trying to login with 0.97 client but you have to complete a lot of missing stuff and its not just the gs that you have to work with.
    someone can help me with this? Now you understand me correctly

  16. #16
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: C1,c2,c3,c4

    I think its too much work for you, why you dont downgrade another working one for yourself?

  17. #17
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    Quote Originally Posted by RevolGaming View Post
    I think its too much work for you, why you dont downgrade another working one for yourself?
    give me a link to a normal source file and all I find is a lot of errors at compile time, well, there is still need to work with the same package)))

  18. #18
    (づ。◕‿‿◕。) Natzugen is offline
    MemberRank
    Jun 2014 Join Date
    ElbelandLocation
    1,858Posts

    Re: C1,c2,c3,c4

    if you cant even fix the simple compile errors how do you want to work with packets and update a really old and deprecated source?

  19. #19
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    Quote Originally Posted by natzugen View Post
    if you cant even fix the simple compile errors how do you want to work with packets and update a really old and deprecated source?
    I'm in such a way, but the error is in some files are missing, and still is to understand this wish

  20. #20
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    please give me the source code which can be reduced to 0.97 version, I beg you, and yet someone just used me to describe the packages arranged and I Deconstructing
    There are smart people immediately show yourself

  21. #21

    Re: C1,c2,c3,c4

    u want 97d gameserver source maybe?

  22. #22
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    Quote Originally Posted by KarLi View Post
    u want 97d gameserver source maybe?
    Yes, I want to have

  23. #23
    Account Upgraded | Title Enabled! ponteleymon is offline
    MemberRank
    Jan 2013 Join Date
    276Posts

    Re: C1,c2,c3,c4

    can someone help me at least with packages for version 0.97, or useless to write here?

  24. #24

    Re: C1,c2,c3,c4

    Quote Originally Posted by ponteleymon View Post
    can someone help me at least with packages for version 0.97, or useless to write here?
    i replied on your thread here:
    http://forum.ragezone.com/f193/downg...7/#post8704657



Advertisement