|
You last visited: Today at 02:33
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.
07/27/2011, 11:44
|
#1
|
elite*gold: 0
Join Date: Jul 2010
Posts: 4
Received Thanks: 0
|
[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 char* buf,int len){
buf2 = (char*) malloc (len); tam_buf2=len; for (int i = 0; i < len; ++i) / buf2[i] = buf[i]; return true; }
This part check if the packets are the same
PHP Code:
bool check(const char* buf,int len,char* bufb,int lenb){ bool check=false; int i=0; if(len!=lenb){
}else{ while (i < 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?
|
|
|
07/27/2011, 12:39
|
#2
|
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
|
|
|
07/27/2011, 18:35
|
#3
|
elite*gold: 0
Join Date: Jul 2010
Posts: 4
Received Thanks: 0
|
Quote:
Originally Posted by u-coRe
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?
|
|
|
07/27/2011, 19:11
|
#4
|
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
|
|
|
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
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");
|
|
|
07/28/2011, 00:02
|
#6
|
elite*gold: 0
Join Date: Jul 2010
Posts: 4
Received Thanks: 0
|
Quote:
Originally Posted by Metin2Spieler97
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.
|
|
|
07/28/2011, 10:44
|
#7
|
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
|
actually, memcmp is still the right way.
|
|
|
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
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
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.
|
|
|
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 char* buf,int len){
buf2 = (char*) malloc (len);
tam_buf2=len;
for (int i = 0; i < len; ++i) /
buf2[i] = buf[i];
return true;
}
This part check if the packets are the same
PHP Code:
bool check(const char* buf,int len,char* bufb,int lenb){
bool check=false;
int i=0;
if(len!=lenb){
}else{
while (i < 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?
|
|
|
07/29/2011, 10:56
|
#10
|
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
|
mfc? you should try using google
|
|
|
 |
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.
|
|