Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 02:33

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

Advertisement



[Help] Packet Editor - Comparing Socket Data.

Discussion on [Help] Packet Editor - Comparing Socket Data. within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2010
Posts: 4
Received Thanks: 0
Smile [Help] Packet Editor - Comparing Socket Data.

Hello, I want to save and compare the data of a 2 packets,

and finding out if they contain the same data...

Thanks to u-coRe & Metin2Spieler97 i have something like this, and its working great!

Thanks for the help!!!

This part saves the 1rst packet to be compared.
PHP Code:
bool paso0(const charbuf,int len){

            
buf2 = (char*) malloc (len);
            
tam_buf2=len;
            for (
int i 0len; ++i)    /
                
buf2[i] = buf[i];            
            return 
true;

This part check if the packets are the same
PHP Code:
bool check(const charbuf,int len,charbufb,int lenb){
        
bool check=false;
        
int i=0;
        if(
len!=lenb){

        }else{
            while (
len) {
                if (
memcmp(bufb,buf,len)==0){
                    
check true;
                }else{
                    
check false;
                    
i=len;
                }
                
i++;
            }}
        return 
check;
    } 
Now i need to build an interface!!! ANY SUGGESTIONS?
pokeninja2 is offline  
Old 07/27/2011, 12:39   #2


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
how come u use strcmp? a packet doesnt has to be a string. use memcmp instead
buFFy! is offline  
Thanks
2 Users
Old 07/27/2011, 18:35   #3
 
elite*gold: 0
Join Date: Jul 2010
Posts: 4
Received Thanks: 0
Quote:
Originally Posted by u-coRe View Post
how come u use strcmp? a packet doesnt has to be a string. use memcmp instead
Same error... I'm Using Wireshark to analize what's in the packet Data and for example:
Packet data with Wireshark= d7
Content of buf = 126FA51E0B (Using printf ("DATA: %X\n",buf); )
Why is that?
pokeninja2 is offline  
Old 07/27/2011, 19:11   #4


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
tbh, i have no clue. never used wireshark.

try to check the length parameter and compare with wireshark. this could help debugging
buFFy! is offline  
Thanks
1 User
Old 07/27/2011, 22:38   #5
 
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,345
Quote:
Originally Posted by pokeninja2 View Post
Same error... I'm Using Wireshark to analize what's in the packet Data and for example:
Packet data with Wireshark= d7
Content of buf = 126FA51E0B (Using printf ("DATA: %X\n",buf); )
Why is that?
You're printing the pointer instead of what it points to. If you want to print out the buffer content instead you need to iterate over it.

Code:
int i;
printf("DATA: ");
for (i = 0; i < len; ++i)
    printf("%02X ", buf[i]);
printf("\n\n");
ms​ is offline  
Thanks
1 User
Old 07/28/2011, 00:02   #6
 
elite*gold: 0
Join Date: Jul 2010
Posts: 4
Received Thanks: 0
Quote:
Originally Posted by Metin2Spieler97 View Post
You're printing the pointer instead of what it points to. If you want to print out the buffer content instead you need to iterate over it.

Code:
int i;
printf("DATA: ");
for (i = 0; i < len; ++i)
    printf("%02X ", buf[i]);
printf("\n\n");
Thank you !!! I knew that the problem was in me reading de pointer instead of the data, but i didn't knew how to fix it

Now I have to compare each data and find out if they are equal.
pokeninja2 is offline  
Old 07/28/2011, 10:44   #7


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
actually, memcmp is still the right way.
buFFy! is offline  
Thanks
1 User
Old 07/28/2011, 12:12   #8
 
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,345
Quote:
Originally Posted by pokeninja2 View Post
Thank you !!! I knew that the problem was in me reading de pointer instead of the data, but i didn't knew how to fix it

Now I have to compare each data and find out if they are equal.
Quote:
Originally Posted by pokeninja2 View Post
if (memcmp (azules,buf,1024) == 0){
The 3. argument of memcmp has to be the length of your array, which is len in your case.
ms​ is offline  
Thanks
1 User
Old 07/29/2011, 03:34   #9
 
elite*gold: 0
Join Date: Jul 2010
Posts: 4
Received Thanks: 0
Thanks for the help!!!
This part saves the 1rst packet to be compared.
PHP Code:
bool paso0(const charbuf,int len){

            
buf2 = (char*) malloc (len);
            
tam_buf2=len;
            for (
int i 0len; ++i)    /
                
buf2[i] = buf[i];            
            return 
true;

This part check if the packets are the same
PHP Code:
bool check(const charbuf,int len,charbufb,int lenb){
        
bool check=false;
        
int i=0;
        if(
len!=lenb){

        }else{
            while (
len) {
                if (
memcmp(bufb,buf,len)==0){
                    
check true;
                }else{
                    
check false;
                    
i=len;
                }
                
i++;
            }}
        return 
check;
    } 
Now i need to build an interface!!! ANY SUGGESTIONS?
pokeninja2 is offline  
Old 07/29/2011, 10:56   #10


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
mfc? you should try using google
buFFy! is offline  
Thanks
1 User
Reply

Tags
compare, edit, packet, socket


Similar Threads Similar Threads
Archlord Data Editor
10/31/2013 - Archlord - 51 Replies
Many people ask me how to decrypt the .DAT Files ... so i make my Editor public. Saving the .dat files is not finished but extracting images and other files work. I hope it will help some of you. Screenshot: http://img706.imageshack.us/img706/7783/sshot1rtd .png History: - 26.06.2011 V1.0 initial release Download: Uploaded.to
Packet sending c# to an opend socket?
09/15/2010 - .NET Languages - 0 Replies
Hey guys, I got programs to send packets to a game using its socket. I tried to send packets like this: int port = 29200; Socket tcpsocket; tcpsocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP); IPEndPoint remoteServerEndPoint = new IPEndPoint(IPAddress.Parse("128.241.92.43&quo t;), port ); tcpsocket.Connect(remoteServerEndPoint);
Shaiya EP4 Data.saf editor
01/20/2010 - Shaiya - 0 Replies
need help with this program.. u can open everything but u can't save.. anyone know how to save? thx Download Here: http://sep5.p8.hu/5.00.rar
[Question] Packet data , packet editing ??
10/13/2009 - 9Dragons - 2 Replies
I would like to know : What is packet data? How do i get the address for hacking a item in game? How to use it ??
[help] Max HP/VE packet data
09/03/2009 - 9Dragons - 11 Replies
I've been trying for 2 days trying to find the maximum HP/VE in the socket data to no avail. Getting the current HP/VE is no problem. Just trying to find the your current max hp/ve is being tricky. Anyone else figured this out? I'm beginning to think it is calculated within the client.



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


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