Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 17:12

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

Advertisement



[C++] Recv packets from webbrowser...

Discussion on [C++] Recv packets from webbrowser... within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2011
Posts: 12
Received Thanks: 5
[C++] Recv packets from webbrowser...

Hello guys!
I have a question to you. I want make bot as:
Code:
http://www.elitepvpers.com/forum/browsergames/1763240-release-seafight-antistealth-wartool-bot.html
and I don't know how recv packets which seafight server send to webbrowser?
I must use winsock or winpcap?
I try make serwer:
PHP Code:
#include <cstdio>
#include <winsock2.h>
#include <iostream>
using namespace std;
int main()
{
//********************START**********************************
    
WSADATA wsaData;

    
int result WSAStartupMAKEWORD2), & wsaData );
    if( 
result != NO_ERROR )
        
printf"Initialization error.\n" );

    
SOCKET mainSocket socketAF_INETSOCK_STREAMIPPROTO_TCP );
    if( 
mainSocket == INVALID_SOCKET )
    {
    
printf"Error creating socket: %ld\n"WSAGetLastError() );
    
WSACleanup();
    return 
1;
    }

    
sockaddr_in service;
    
memset( & service0sizeofservice ) );
    
service.sin_family AF_INET;
    
service.sin_addr.s_addr inet_addr"127.0.0.1" );
    
service.sin_port htons1111 );
//********************START**********************************
    
if( bindmainSocket,( SOCKADDR * ) & servicesizeofservice )) == SOCKET_ERROR)
    {
        
printf"bind() failed.\n" );
        
closesocketmainSocket );
        
WSACleanup();
        return 
1;
    }
    if( 
listenmainSocket) == SOCKET_ERROR )
        
printf"Error listening on socket.\n" );

    
SOCKET acceptSocket SOCKET_ERROR;
    
printf"Waiting for a client to connect...\n" );

    while( 
acceptSocket== SOCKET_ERROR )
        {
        
acceptSocket acceptmainSocketNULLNULL );
        }

    
printf"Client connected.\n" );
    
mainSocket acceptSocket;
//****************END***************************

int bytesSent;
int bytesRecv SOCKET_ERROR;
char sendbuf32 ] = "answer...";
char recvbuf1024 ] = "";

bytesRecv recvmainSocketrecvbuf1024);
printf"Bytes received: %ld\n"bytesRecv );
printf"Received text: %s\n"recvbuf );

bytesSent sendmainSocketsendbufstrlensendbuf ), );
printf"Bytes sent: %ld\n"bytesSent );

cin.get();
    return 
0;

and in webbrowser set ip: 127.0.0.1 and socket: 1111; but webbrowser can't connect to game..
I need way to make it!
Please help me
stronka111 is offline  
Old 03/20/2012, 11:54   #2
 
elite*gold: 42
Join Date: Jun 2008
Posts: 5,425
Received Thanks: 1,888
This looks like c&p code ;o
MoepMeep is offline  
Old 03/20/2012, 20:12   #3
 
elite*gold: 9
Join Date: Dec 2009
Posts: 1,071
Received Thanks: 819
Your "server" is not a proxy... It does not know how to answer the browsers requests. Neither does your browser know how to handle your server's packets.

First you need to know how communication between a browser and a proxy server works in order to emulate one.
.Infinite is offline  
Old 03/20/2012, 21:09   #4
 
elite*gold: 0
Join Date: Nov 2011
Posts: 12
Received Thanks: 5
So i must make proxy local and listen
stronka111 is offline  
Old 03/20/2012, 21:42   #5
 
elite*gold: 9
Join Date: Dec 2009
Posts: 1,071
Received Thanks: 819
Quote:
but webbrowser can't connect to game..
Your "server" has to redirect the packets:

Browser ---GET---> Local Proxy(your server) ---GET---> Gameserver
.Infinite is offline  
Reply

Tags
c++ recv packets


Similar Threads Similar Threads
[Recv] Send Self
10/31/2011 - Nostale - 4 Replies
Ich wollte fragen ob hier noch irgendwer erfahrungen in ASM hat. Suche nämlich die Sendself Funktion aber weiß ned wie ich weiter suchen soll habs schon rückwerts über die Sockte Funktionen versucht aber kein wirklicher Erfolg. Brauche die Send Self Funktion um nach Sendpackets zu suchen. Falls mir wer Helfen kann aber ned offen osten will geht auch per PN.
Send Recv
08/18/2009 - Kal Online - 0 Replies
Hey;) I start checking this code http://www.elitepvpers.com/forum/kal-hacks-bots-che ats-exploits/189618-release-kalhackzz-v0-3-v0-4-so urces.html but i cant still send a packet of move just to see my player moving.Maybe this code is obsolete i dont know if there are better send and rev codes just tell me When dll process attach happens i call my function _beginthread(f,0,NULL); void f(void* start_parameter){ Console(); //Get the console printf("DLL loaded");
[help] recv
08/02/2009 - Kal Online - 3 Replies
Soo, man man behinderter tag. naja wayne. bin grad dabei mich etwas mehr mit den recv packets außeinander zu setzen. unter anderem mit den zahlen dahinter. Borsti sagte das ist die größe (size) naja also ich hab mir das mal als hex ausgeben lassen (das packet für empfangene nachrichten im chat ) ich hab mir das folgendermaßen "notiziert" 0c 00 3c //size 44 65 6e 4a 61 73//name
[How to Get Recv Information]
05/30/2009 - Kal Online - 14 Replies
have write Tutorial there how to Analyse the Recv Packet... SoniKk69 – Blog hf who dont know it already..
[Question] Hooking send() & recv() works, but recv hiding data for co???
05/06/2009 - CO2 Programming - 2 Replies
Hey guys, I've been making a DLL to allow another program to intercept the packets of conquer using windows pipes. (Then its the job of the main program to decrypt the packets, the DLL only gives a communication channel for the main program) (winsock functions btw) - hooking send() works fine for my internet browser - hooking recv() works fine for my internet browser - hooking send() works fine for conquer online



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


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.