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

📄 cmdtools.hpp

📁 命令行方式的硬盘工具 可以在dos和nt下运行。 需要djgpp和vs7.0以上
💻 HPP
字号:
/*

  Command Line Tools for DOS(V32) Prgram v2.1.2 write by 孙宝建
  6-1-2003

  3.0.0		9-27-2004
  3.0.1		9-28-2004
3.1.0		9-29-2004

*/

#ifndef _CMDTOOLS_H
#define _CMDTOOLS_H

const DWORD c_CMD_T_MAX_BUF			        =10;
const DWORD c_CMD_T_INIT_BUF_SIZE	        =1;
const DWORD c_CMD_T_MAX_LINES               =32;
const DWORD c_CMD_T_MAX_COL                 =16;
const DWORD c_CMD_T_MAX_SCH_DES_BUF         =250;
const DWORD c_CMD_T_BUFF_SIZE_ADJ           =0;
const DWORD c_CMD_T_SEARCH_BUF_SIZE         =63;		//63kb<=c_INT13_MAX_DJ_NSECTORS

const DWORD c_CMD_T_CM_QUIT                 =ERR_USER_DEFINE +1;

class CTools 
{
public:
    CSError *m_pError;

//	DWORD m_ulError;
	CTools(CSError *pError);
	virtual ~CTools();
	void Run(CHAR *argv);
	void SearchBufferAll(CHAR *argv);
	void SearchBuffer(CHAR *argv);
	void SearchSectors(CHAR *argv);
	void SearchSectorsOffset(CHAR *argv);
	void SearchSectorsAll(CHAR *argv);
	void SearchPartition(CHAR *argv);
	void LoadSectors(CHAR *argv);
	void LoadFile(CHAR *argv);
	void SaveSectors(CHAR *argv);
	void SaveFile(CHAR *argv);
	void DispDir(CHAR *argv);
	void DispBuffer(CHAR *argv);
	void BufferAlloc(CHAR *argv);
	void GetCmd(CHAR *szCmdLine);
	void TranslateCommand(CHAR *argv);
	void Init(void);
    void EditBuffer(CHAR *argv);
    void Calculater(CHAR *argv);
    void AddSub(CHAR *argv);
    void Status(void);
    void HandleError(void);

    void LoadNtfsBootBlock(CHAR *argv);

    void LoadBpb(CHAR *argv);
    void LoadCluster(CHAR *argv);
    void LoadDir32(CHAR *argv);
    void LoadPartition(CHAR *argv);
    void LoadMbr(CHAR *argv);
    void ClustertoSectors(CHAR *argv);
    void GetCluster(CHAR *argv);
    void Help(void);
    void Quit(void);
    void DosCommand(CHAR *argv);
	BOOL ReadFile(const CHAR *FileName,unsigned int ulLen,BYTE  * Buffer);
	BOOL WriteFile(const CHAR *szFileName,unsigned int FileLength,BYTE  *Buffer);
    void UseBuf(CHAR *argv);
    unsigned int BintoHex(CHAR *argv);
  //  void HextoBin(unsigned int ulHex);
    void MoveData(CHAR *argv);
    void SetActivePhyDisk(CHAR *argv);
#ifdef WIN32
	void Counter(CHAR *argv);
#endif 
#ifdef __DJGPP__
	void Cmos(CHAR *argv);
#endif 

private:

	BYTE				*m_ppBuf[c_CMD_T_MAX_BUF];
	unsigned int		m_BufSize[c_CMD_T_MAX_BUF];
	DWORD64				m_dqBufSector[c_CMD_T_MAX_BUF];
	unsigned int		m_uBufPos;

	CInt13 *m_pInt13;
	unsigned int		m_uDisk;
	BOOL				m_bIsLoadFat;

	//    unsigned int m_Setf;

	unsigned int		m_ulBufOffset;
	CHAR				*m_pszFileName;
	CLogicalDisk32		*m_pLD32;
	CNtfs				*m_pNtfs;
	CSectorSrch			*m_pSrch;
	
protected:
	void BackupDiskPartitions(CHAR *argv);
	void RestoreDiskPartitions(CHAR *argv);
};

class CCmdToolError : public  CSError
{

public:
    CCmdToolError();
    ~CCmdToolError();
    virtual void OutputMsg(const tstring & msg)const ;
};

void DispError(CHAR *p);
#endif //_CMDTOOLS_H

⌨️ 快捷键说明

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