资源简介
int main(int argc, char *argv[])
{
int i = 0;
bool bOnce = true;
char szPath[RH_MAX_PATH];
char szAbsPath[RH_MAX_PATH];
char szOrgPath[RH_MAX_PATH];
char szTemp[RH_MAX_BUFFER];
int iErrorCode = 0;
CHashManager hashmgr;
getcwd(szOrgPath, RH_MAX_PATH);
//No arguments?
if(argc == 1)
{
printInfo();
return(RH_NO_ARGS);
}
memset(szPath, 0, RH_MAX_PATH);
bOnce = true;
hashmgr.SelectAllAlgorithms(true);
for(i = 1; i = RH_MAX_BUFFER) continue; // Non-parsable option argument, ignore
fmtArgument(argv[i], szTemp); // Format the argument, i.e. remove all special chars
if(strcmp(szTemp, "help" ) == 0) printInfo();
if(strcmp(szTemp, "h" ) == 0) printInfo();
if(strcmp(szTemp, "?" ) == 0) printInfo();
if(strcmp(szTemp, "version" ) == 0) printInfo();
if(strcmp(szTemp, "v" ) == 0) printInfo();
if(strcmp(szTemp, "fullpath") == 0) hashmgr.SetOption(OPT_FULLPATH, true);
if(strcmp(szTemp, "f" ) == 0) hashmgr.SetOption(OPT_FULLPATH, true);
if(strcmp(szTemp, "nopath" ) == 0) hashmgr.SetOption(OPT_FULLPATH, false);
if(strcmp(szTemp, "rcrsv" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, true);
if(strcmp(szTemp, "norcrsv" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, false);
if(strcmp(szTemp, "recur" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, true);
if(strcmp(szTemp, "norecur" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, false);
if(strcmp(szTemp, "r" ) == 0) hashmgr.SetOption(OPT_RECURSIVE, true);
if(strcmp(szTemp, "all" ) == 0) hashmgr.SelectAllAlgorithms(true);
if(strcmp(szTemp, "a" ) == 0) hashmgr.SelectAllAlgorithms(true);
if(strcmp(szTemp, "none" ) == 0) hashmgr.SelectAllAlgorithms(false);
if(strcmp(s

代码片段和文件信息
/*
---------------------------------------------------------------------------
Copyright (c) 2003 Dominik Reichl Germany.
All rights reserved.
Distributed under the terms of the GNU General Public License v2.
This software is provided ‘as is‘ with no explicit or implied warranties
in respect of its properties including but not limited to correctness
and/or fitness for purpose.
---------------------------------------------------------------------------
*/
#include “clutil.h“
#include “rehash.h“
bool isArgument(char *pszString)
{
if(pszString == NULL) return false;
if(pszString[0] == ‘-‘) return true;
return false;
}
void fmtArgument(char *pszArg char *pszDest)
{
unsigned int i = 0;
int pos = 0;
if(pszArg == NULL) return;
if(pszDest == NULL) return;
pszDest[0] = 0;
// Filter special characters
for(i = 0; i < strlen(pszArg); i++)
{
if(pszArg[i] == ‘-‘) continue;
if(pszArg[i] == ‘#‘) continue;
if(pszArg[i] == ‘ ‘) continue;
if(pszArg[i] == ‘<‘) continue;
if(pszArg[i] == ‘>‘) continue;
if(pszArg[i] == ‘(‘) continue;
if(pszArg[i] == ‘)‘) continue;
if(pszArg[i] == ‘[‘) continue;
if(pszArg[i] == ‘]‘) continue;
if(pszArg[i] == ‘/‘) continue;
if(pszArg[i] == ‘\\‘) continue;
if(pszArg[i] == ‘\“‘) continue;
pszDest[pos] = pszArg[i];
pos++;
}
pszDest[pos] = 0;
strlwr(pszDest);
}
void fmtPath(char *pszPath)
{
unsigned int i = 0;
char chFind = 0;
char chReplace = 0;
if(pszPath == NULL) return;
if(strlen(pszPath) == 0) return;
#if(RH_TARGET_SYSTEM == RH_TARGET_SYSTEM_WINDOWS)
chFind = ‘/‘;
chReplace = ‘\\‘;
#elif(RH_TARGET_SYSTEM == RH_TARGET_SYSTEM_LINUX)
chFind = ‘\\‘;
chReplace = ‘/‘;
#endif
for(i = 0; i < strlen(pszPath); i++)
{
if(pszPath[i] == chFind) pszPath[i] = chReplace;
}
}
void catdirsep(char *pszPath)
{
unsigned int i = 0;
if(pszPath == NULL) return;
i = strlen(pszPath);
if(pszPath[i-1] == SZ_DIR_CHAR) return; // Nothing to do
strcat(pszPath SZ_DIR_STR);
}
void pathonly(char *pszPath)
{
unsigned int i = 0;
bool bReplaced = false;
if(pszPath == NULL) return;
i = strlen(pszPath) - 1;
if(i == (unsigned int)-1) return;
while(1)
{
if(pszPath[i] == SZ_DIR_CHAR)
{
pszPath[i] = 0;
bReplaced = true;
break;
}
i--;
if(i == (unsigned int)-1) break;
}
if(bReplaced == false) pszPath[0] = 0;
#if(RH_TARGET_SYSTEM == RH_TARGET_SYSTEM_WINDOWS)
if(strlen(pszPath) == 2) catdirsep(pszPath);
#endif
}
void fileonly(char *pszPath)
{
char szTemp[RH_MAX_PATH];
unsigned int i = 0;
unsigned int j = 0;
if(pszPath == NULL) return;
i = strlen(pszPath) - 1;
if(i == (unsigned int)-1) return;
if(i <= 1) return;
while(1) // Reverse scan for path delimiter
{
if(pszPath[i] == SZ_DIR_CHAR) break;
i--;
if(i == 0) break;
}
if(i == 0) return;
j =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3634 2003-04-09 19:33 algo\crc16.cpp
文件 970 2003-04-09 19:33 algo\crc16.h
文件 4531 2003-04-09 19:33 algo\crc32.cpp
文件 763 2003-04-09 19:33 algo\crc32.h
文件 6811 2003-04-09 19:33 algo\fcs.cpp
文件 949 2003-04-09 19:33 algo\fcs.h
文件 1478 2003-04-09 19:33 algo\ghash.cpp
文件 846 2003-04-09 19:33 algo\ghash.h
文件 12235 2003-04-04 18:59 algo\gosthash.cpp
文件 931 2003-04-04 18:59 algo\gosthash.h
文件 31432 2003-04-04 19:54 algo\haval.cpp
文件 4455 2003-04-04 19:36 algo\haval.h
文件 2807 2003-04-01 19:22 algo\md2.cpp
文件 475 2003-04-01 19:22 algo\md2.h
文件 8367 2003-04-01 19:22 algo\md4.cpp
文件 1767 2003-03-28 16:28 algo\md4.h
文件 12112 2003-03-30 12:09 algo\md5.cpp
文件 3889 2003-03-28 16:28 algo\md5.h
文件 9278 2003-03-27 18:38 algo\sha1.cpp
文件 2330 2003-03-27 18:38 algo\sha1.h
文件 25610 2003-03-27 18:38 algo\sha2.cpp
文件 4495 2003-03-27 18:38 algo\sha2.h
文件 776 2003-04-09 19:33 algo\sizehash.cpp
文件 772 2003-04-09 19:33 algo\sizehash.h
文件 45894 2003-04-01 19:22 algo\tiger.cpp
文件 716 2003-03-28 18:34 algo\tiger.h
文件 3734 2003-04-09 19:33 clutil.cpp
文件 921 2003-04-09 19:33 clutil.h
文件 15411 1999-11-23 21:29 docs\gnugpl2.txt
文件 10249 2003-04-12 11:39 docs\rehash.html
文件 111716 2003-04-12 11:24 docs\rehash.jpg
............此处省略27个文件信息
相关资源
- Hash1.04(md5校验工具) 绿色免费版
- 右键属性文件校验插件可同时生成十
- delphi 版CRC校验程序
- windows下生成MD5值的工具(WinMD5)
- 全自动多功能编码转换工具(URLASCI
- MD5碰撞验证算法
- 易语言MD5加密源码
- CRC校验小工具
- PB9.0调用MD5加密
- MD5暴力破解程序 用SSE2 CPU加速指令集
- SecureCRT 8.5.3 Build 1867(X64)原版 + ZW
- 暴力破解MD5解密工具
- CRC_GEN_CONFIGUABLE.rar
- MD5加密解密算法demo
- 转:excel中用的md5宏,可批量转字串为
- APK获取MD5工具
- win7 802.1X MD5验证补丁
- 易语言md5定向爆破源码
- OpcRcw.Ae.dll OpcRcw.Batch.dll OpcRcw.Comn.dll
- MD5EditTools,MD5修改工具
- MD5源代码和教程
- MD5GPU.rar
- 批量修改视频MD5值绿色版
- 基于DES的数字签名系统
- springboot+shiro+md5
- RS232串口CRC程序
- MD5值修改器破解版
- SD卡CRC7计算器
- SSM实现登录注册
- CRC-CCITT校验工具
评论
共有 条评论