⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snifferprodoc.cpp

📁 这是一个嗅探器
💻 CPP
字号:
// SnifferProDoc.cpp : implementation of the CSnifferProDoc class
//

#include "stdafx.h"
#include "SnifferPro.h"
#include "MainFrm.h"
#include "SnifferProDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSnifferProDoc

IMPLEMENT_DYNCREATE(CSnifferProDoc, CDocument)

BEGIN_MESSAGE_MAP(CSnifferProDoc, CDocument)
	//{{AFX_MSG_MAP(CSnifferProDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSnifferProDoc construction/destruction

CSnifferProDoc::CSnifferProDoc()
{
	// TODO: add one-time construction code here

}

CSnifferProDoc::~CSnifferProDoc()
{
}

BOOL CSnifferProDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CSnifferProDoc serialization

void CSnifferProDoc::Serialize(CArchive& ar)
{
	/*if (ar.IsStoring())
	{
		// TODO: add storing code here
		unsigned char *buf=((CMainFrame *)AfxGetApp()->GetMainWnd())->conView->buf;
		unsigned char *pos=buf;
		unsigned int buflen=((CMainFrame *)AfxGetApp()->GetMainWnd())->conView->buflen;
		if(buf=!NULL){
			for(unsigned int i=0;i<buflen;i++){
				ar<<(*pos);
				pos++;
			}
		}
	}
	else
	{
		// TODO: add loading code here
	}*/
	if(ar.IsStoring())
	{
		unsigned char *buf,*pos;
		int index;
		int start;
		int len;
		int count=((CMainFrame *)AfxGetApp()->GetMainWnd())->founders.GetSize();
		for(int i=0;i<count;i++){//将每个定位器所指向内容一次输出
			index=((CMainFrame *)AfxGetApp()->GetMainWnd())->founders.GetAt(i).index;
			start=((CMainFrame *)AfxGetApp()->GetMainWnd())->founders.GetAt(i).start;
			len=((CMainFrame *)AfxGetApp()->GetMainWnd())->founders.GetAt(i).len;
			buf=(unsigned char *)((CMainFrame *)AfxGetApp()->GetMainWnd())->mulPackView->pkt_datas.GetAt(index);
			buf+=start;
			pos=buf;
			for(int j=0;j<len;j++){
				ar<<(*pos);
				pos++;
			}
		}
	}
}

/////////////////////////////////////////////////////////////////////////////
// CSnifferProDoc diagnostics

#ifdef _DEBUG
void CSnifferProDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CSnifferProDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSnifferProDoc commands

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -