473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Parsing DNS section from Etheral capture

4
hi all,
i am currently working on files in c.i am using ethereal to capture the packet and have got a binary file.now i need to extract only certain datas from tht binary file.file contains http,dns,pop3 datas.i need to take only the dns data.thanks in advance.plz help me out.
Dec 10 '07 #1
6 2150
gpraghuram
1,275 Expert 1GB
hi all,
i am currently working on files in c.i am using ethereal to capture the packet and have got a binary file.now i need to extract only certain datas from tht binary file.file contains http,dns,pop3 datas.i need to take only the dns data.thanks in advance.plz help me out.

If you know the structure then try to use fread.
How the data is organized?
Can you give me more inputs and also tell us what have you tried on this

Raghuram
Dec 10 '07 #2
syndal
4
If you know the structure then try to use fread.
How the data is organized?
Can you give me more inputs and also tell us what have you tried on this

Raghuram
i know the structure of ethereal.now i am pasting my code.now i nhave a file eq.txt which has the output in binary.need to convert it to readble form.plz help with ur ideas
#include<stdio.h>
#include<conio.h>

main()
{
FILE *fp,*ft;
char ch;
int i;
clrscr();
fp=fopen("test2.cap","rb");
ft=fopen("e1.txt","wb");
fseek(fp,0,SEEK_SET);
printf("The start position of fp:%ld",ftell(fp));
for(i=0;i<=32;i++)
{
ch=fgetc(fp);
fputc(ch,ft);
}
printf("\nThe end position of fp :%ld",ftell(fp));
fclose(fp);
fclose(ft);
}
Dec 10 '07 #3
sicarie
4,677 Expert Mod 4TB
So do you know what the binary returned there represents?
Dec 10 '07 #4
syndal
4
So do you know what the binary returned there represents?
ya i am trying with tht.i am converting the integer values in the binary to readable.but not able to do it for text.can u help
Dec 11 '07 #5
sicarie
4,677 Expert Mod 4TB
You need to figure out what each section represents, and how they are translated by Wireshark(Ethereal). Once you figure out what they are supposed to represent, you can figure out how they are translated and mimick that. (ie, are they ASCII values?)
Dec 11 '07 #6
syndal
4
thanx for the reply.i have done with tht part and now in the next part.
thanx again
Jan 3 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Pir8 | last post by:
I have a complex xml file, which contains stories within a magazine. The structure of the xml file is as follows: <?xml version="1.0" encoding="ISO-8859-1" ?> <magazine> <story>...
1
by: David Williams | last post by:
Has the Schema of the Web.Config changed in Web App Projects? After converting my 2005 Web Site project to a 2005 WAP, and switching to IIS Web Server, I am getting a number of errors at run time...
17
by: Mark | last post by:
I must create a routine that finds tokens in small, arbitrary VB code snippets. For example, it might have to find all occurrences of {Formula} I was thinking that using regular expressions...
3
by: Zach | last post by:
Say I have a string which is of the format {A, B, C, D} for some variable number of objects. I want a regular expression that will put each of A, B, C, and D into its own separate capture...
9
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics"...
3
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in...
9
by: Paulers | last post by:
Hello, I have a log file that contains many multi-line messages. What is the best approach to take for extracting data out of each message and populating object properties to be stored in an...
0
by: Masa Ito | last post by:
I am trying to capture the contents of a function with Regex. I am using Expresso to test (nice - thanks for the great tool UltraPico!). I can handle my own with single line regex's (I think).. ...
0
by: hzgt9b | last post by:
Using VB.NET under .NET 1.1 in VS2003, BACKGROUND I have a windows application that dereferences the MsHTM.dll. The app is successfully able to parse existing HTM documents allowing me to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.