Click here to Skip to main content
Click here to Skip to main content

A Great Protocol Analyser

, 16 Aug 2007
Rate this:
Please Sign up or sign in to vote.
A programmable, easy-to-use protocol decoder for parsing and displaying binary package
Screenshot - 1small.gif

Background

There are a lot of protocol analysers (such as Ethereal, sniffer tools) in the software market, but it is still difficult to find a decoder which can support custom-defined package. Here, we provide a framework of such a software, hoping it will help you a lot.

Introduction

Protocol analyser is a protocol analyse tool for parsing and displaying received binary data package. With an easy-to-use interface and programmable kernel, it can support a variety of protocols such as IP based protocols (TCP, UDP, etc.), Telecommunication protocols (MTP3, ISUP, TUP, etc.), or you can define new custom decoders of non-standard or rare protocols.

Unlike other protocol analyzer tools, we create advanced features to meet future needs, not only for standard protocols, but also for user-defined protocols.
Instead of waiting long time for a new protocol decoder to be released, you can easily write a script to support new protocols in an incredibly short time by yourself.

It can be used as a message debug tool for protocol analyzers and program developers, especially for those who want to have a tool to support their own protocol or their own frame format, because no other software can be found to meet such specific requirement.

By understanding this project, you could create your own protocol decoders. Or, you could download the newest version of this software here.

Besides, this article gives a demonstration of how to compile a text script, and how to get the grammar elements. It might be useful in software development.

The Framework

Here, we give you a brief description of how to use the main class.

    /////////////////////////////////////////////
    // 1. Load protocol script ( sample script is give in source folder )
    MsgTranslater Translater;
    bRT=Translater.LoadScript(m_strFilePath.GetBuffer(0));
    if (!bRT)
    {
        AfxMessageBox(Translater.m_strLastError.GetBuffer());
        return;
    }
    ...
    ///////////////////////////////////////////////////////
    // 2. Decode 'buf'
    bRT=Translater.Translate(true,buf,n);
    if (!bRT)
    {
        strLastError=Translater.m_strLastError;
    }
    ...
    ///////////////////////////////////////////////////////
    // 3. Save the result in the VariableItem
    TVariableItem& VariableItem=Translater.GetResult();
    ...
    ///////////////////////////////////////////////////////
    // 4. Dump the result by hierarchy
    VirtualList DataList;
    VariableItem.DumpToList(DataList,Attr);
    ...
    COneLogFile LogFile("Dump\\Tran.txt",true);
    ...
    ///////////////////////////////////////////////////////
    // 5. Display the decoding result 
    FILE *fp;
    long len;
    fp=fopen("Dump\\Tran.txt","rb");
    fseek(fp,0L,2);
    len=ftell(fp);
    fseek(fp,0L,0);
    char *buffer=new char[len+2];
    buffer[len]='\0';
    fread(buffer,len,1,fp);
    GetDlgItem(IDC_MYEDIT)->SetWindowText(buffer);
    delete buffer;
    fclose(fp);
        
    ...

History

This is version 0.9, first workable version, and we are still improving it now, because it can become a very useful tool.
You can visit http://Aries-studio.vicp.net/soft/default.html to download the newest version, the help documents and get more information (website is not always open, but don't worry, try it later).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

shen_bd

China China
No Biography provided

Comments and Discussions

 
QuestionNeed a help PinmemberMember 27588508-Feb-11 12:02 
QuestionISUP protocol Pinmemberbrajesh sharma24-Aug-10 4:37 
GeneralExcellent work PinmemberSrdjanMK11-Nov-09 21:10 
Questionhow i can sniffer a package from desk ip? Pinmemberchenli05136-Nov-09 19:19 
GeneralGreat work... Pinmemberabisval21-Aug-07 19:53 
Great work..I had been trying this for months..Great effort .Thank you
 
Abhilash

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 16 Aug 2007
Article Copyright 2007 by shen_bd
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid