📄 crc_ficdlg.h
字号:
// CRC_FICDlg.h : header file
//
#if !defined(AFX_CRC_FICDLG_H__C70F9F38_2A40_11D4_BBF9_485400FF8BAF__INCLUDED_)
#define AFX_CRC_FICDLG_H__C70F9F38_2A40_11D4_BBF9_485400FF8BAF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CCRC_FICDlg dialog
class CCRC_FICDlg : public CDialog
{
// Construction
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
CCRC_FICDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CCRC_FICDlg)
enum { IDD = IDD_CRC_FIC_DIALOG };
CString m_csCRC32;
CString m_csFileName;
CString m_md5;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCRC_FICDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CToolTipCtrl m_tooltip;
HICON m_hIcon;
//Codes add begining here
ULONG crc32_table[256]; // Lookup table arrays
void Init_CRC32_Table(); // Builds Lookup table array
ULONG Reflect(ULONG ref, char ch); // Reflects CRC bits in the lookup table
void Open_File(); // Opens the file and reads it
int Get_CRC(CString& csData, DWORD dwSize); // Creates a CRC from a string buffer
static CString GetMD5(BYTE* pBuf, UINT nLength);
void Transform(BYTE Block[64]);
void Update(BYTE* Input, ULONG nInputLen);
CString Final();
inline DWORD RotateLeft(DWORD x, int n);
inline void FF( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
inline void GG( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
inline void HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
inline void II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
//utility functions
void DWordToByte(BYTE* Output, DWORD* Input, UINT nLength);
void ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength);
private:
BYTE m_lpszBuffer[64]; //input buffer
ULONG m_nCount[2]; //number of bits, modulo 2^64 (lsb first)
ULONG m_lMD5[4];
// Generated message map functions
//{{AFX_MSG(CCRC_FICDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnBrowse();
afx_msg void OnDropFiles(HDROP hDropInfo);
virtual void OnCancel();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CRC_FICDLG_H__C70F9F38_2A40_11D4_BBF9_485400FF8BAF__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -