Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 00:07

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

Advertisement



Help me please!

Discussion on Help me please! within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
Help me please!

hi community..
i have another problem,

i used a hex editor and i modified nostale ip in 5.7.162.152 (hamachi ip).
now, i have a problem with the login server.

how i receive nostale login packet that client send to server?
and buffer?

i used C++ language with WinSock2

This is correct?

HTML Code:
#pragma comment(lib,"ws2_32.lib")
#include <WinSock2.h>
#include <iostream>
#include <stdio.h>
#include <tchar.h>

int _tmain(int argc, _TCHAR* argv[])
{
	WSAData wsa;
	WORD Version = MAKEWORD(2,1);
	WSAStartup(Version, &wsa);

	SOCKET Listen = socket(AF_INET, SOCK_STREAM, 0);
	SOCKET Connect = socket(AF_INET, SOCK_STREAM, 0);

	SOCKADDR_IN Server;

	char ip[12] = "5.7.162.152";
	int port;

	port = 4003;
	Server.sin_addr.s_addr = inet_addr(ip);
	Server.sin_family = AF_INET;
	Server.sin_port = htons(port);

	bind(Listen, (SOCKADDR*)&Server, sizeof(Server));

	listen(Listen, 1);
	int size = sizeof(Server);
	
	std::cout << "--------------------------------------------------------------------------------"
		  << " Server connected." << std::endl
                  << " Host: " << ip << " : " << port << std::endl
		  << "--------------------------------------------------------------------------------" << std::endl;
           for(;;){
		if(Connect = accept(Listen, (SOCKADDR*)&Server, &size)){
			std::cout << "Connection accepted from: " << inet_ntoa(Server.sin_addr) << std::endl;
			char recvbuf[225];
			recv(Connect,recvbuf,225,0);
			std::cout << recvbuf << std::endl;
		}
	
	}

	WSACleanup();
	std::cin.get();
	return 0;
}
i don't get good nostale login packet..

i receive:

Connection accepted from: 5.7.162.152
£╗ƒ☻♣♥♣‗♣*
♦♥
♦‗Â│┤│‗☺☻♠♣♦


HELP ME PLEASE!!
Kingrap is offline  
Old 07/05/2012, 14:15   #2
 
elite*gold: 0
Join Date: Jun 2012
Posts: 187
Received Thanks: 58
So what? You expected a game to transfer data in human readable form? That would be massive overhead.
tnd0 is offline  
Old 07/05/2012, 14:31   #3
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
-- EDIT --

ok i solved!
Kingrap is offline  
Reply




All times are GMT +2. The time now is 00:07.


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