首页
社区
课程
招聘
[作品提交]Hash计算器
发表于: 2008-7-10 05:37 6865

[作品提交]Hash计算器

2008-7-10 05:37
6865
可能有些晚了。。。第一届软件设计大赛。。。

这是一个可以计算多种hash的软件:CRC16/32,CRCIIT16,MD2/MD4/MD5/SHA0/SHA1

可以计算某个文件,或者某个目录下的所有文件,文件大小可以超过4GB

也可以计算某个进程的某段虚拟空间,只要是可读的

直接运行该程序,可以看到相关的帮助说明。

F:\>hash.exe

Hash Calculator  Build 1, 2, 261, 21
Copyright (C) 2006-2008 by Bookworm

Usage:  <this EXE> [options] <the file or folder>

All parameters are NOT case-sensitive.

Options:

short  long             Note
=====  ====             ====
/h -h  --help           Display this help
/r -r  --recursive      Search sub-directories as well. Default = NO
/f -f  --file           Calculate the file's (or files under the folder) hash
/p -p  --pid            Calculate the process' hash (user space)
/b -b  --begin          Start address of the process, used with pid, default 0x01000000
/e -e  --end              End address of the process, used with pid, default 0x7FFF0000
/c -c  --CRC16
/0 -0  --CRCIIT16
/1 -1  --CRC32
/2 -2  --MD2
/3 -3  --MD4
/4 -4  --MD5
/5 -5  --SHA0
/6 -6  --SHA1

Examples:

  <this EXE> -f C:\ntdetect.com -c01   Calculate CRC16/CRCIIT16/CRC32 hash of the file
  <this EXE> -012345f6 C:\ntdetect.com Calculate all the hashes of the file
  <this EXE> -012345  C:\windows       Calculate hashes on all files under the folder
  <this EXE> -012345r C:\windows       Save as above, and recursive to all its sub-folders
  <this EXE> -p 1234 -b 0x01000000 -e x02000000 -4     Get MD5 hash of the memory chunk
                                                        in process with PID=1234
  <this EXE> -p 1234 -4be 0x02000000 x01000000         Same as above

[课程]Linux pwn 探索篇!

上传的附件:
收藏
免费 7
支持
分享
最新回复 (7)
雪    币: 139
活跃值: (111)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
2
运行该程序,你需要local admin的权限,否则会报错。
2008-7-10 05:46
0
雪    币: 190
活跃值: (20)
能力值: ( LV10,RANK:170 )
在线值:
发帖
回帖
粉丝
3
密码学的好东东.......
2008-7-10 17:52
0
雪    币: 266
活跃值: (50)
能力值: ( LV9,RANK:290 )
在线值:
发帖
回帖
粉丝
4
作品早就停止提交了啊,您还是等下次比赛吧。感谢分享了
2008-7-10 18:39
0
雪    币: 364
活跃值: (152)
能力值: ( LV12,RANK:450 )
在线值:
发帖
回帖
粉丝
5
怎末没源代码??
2008-7-10 19:23
0
雪    币: 139
活跃值: (111)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
6
抱歉,这是开发的工具软件中的一个,没打算开源,故无法提供源代码。大赛并未
规定提供完整的源代码,不算违规。遗憾的是忘了提交日期。

这里有其中的一个function,供demo之用。很多人写程序都是不注意细节和格式的,
交流起来就达不到共同提高的目的。

// *--------------------------------------------------------------------------------------------------------------
// copy string to clipboard
extern HRESULT WINAPI Base_CopyMsgToClipboardW(
                            __deref_in      LPCWSTR pwszMsg )
{
    HRESULT hr = S_OK;
    HGLOBAL hClipBuffer = INVALID_HANDLE_VALUE;
    WCHAR*  wszChar = NULL;
    size_t  dwSize = 0;

    if( NULL == pwszMsg )
        return E_INVALIDARG;

    if( 0 == OpenClipboard( GetForegroundWindow() ) ||
        0 == EmptyClipboard( ) ||
        FAILED( hr = StringCbLengthW( pwszMsg, (DWORD)-1, &dwSize ) ) )
    {
        hr = HRESULT_FROM_LAST_ERROR();
        goto Done;
    }

    if( NULL == (hClipBuffer = GlobalAlloc( GMEM_DDESHARE | GMEM_MOVEABLE, dwSize + 10 ) ) ||
        NULL == ( wszChar = (WCHAR*) GlobalLock( hClipBuffer ) ) )
    {
        hr = HRESULT_FROM_LAST_ERROR();
        goto Done;
    }

#pragma warning( disable : 6386 )                                               // VS2005: disable warning as we know it's safe: a bug in VS2005?
    StringCchCopyW( wszChar, (dwSize + 10)/2, pwszMsg );
#pragma warning( default : 6386 )
    GlobalUnlock( hClipBuffer );

    if(  NULL == SetClipboardData( CF_UNICODETEXT, hClipBuffer ) ||
        0 == CloseClipboard() )
        hr = HRESULT_FROM_LAST_ERROR();
Done:
    if( INVALID_HANDLE_VALUE != hClipBuffer &&
        NULL != GlobalFree( hClipBuffer ) )
        hr = HRESULT_FROM_LAST_ERROR();

    return hr;
}

// *--------------------------------------------------------------------------------------------------------------
extern __inline HRESULT HRESULT_FROM_LAST_ERROR( VOID )
{
    DWORD dwError = GetLastError();
    return HRESULT_FROM_WIN32( dwError );
}
2008-7-11 05:55
0
雪    币: 266
活跃值: (50)
能力值: ( LV9,RANK:290 )
在线值:
发帖
回帖
粉丝
7
呵呵,没有完成源码就不能参加比赛了。请自己参看比赛规则。
2008-7-11 08:31
0
雪    币: 1852
活跃值: (504)
能力值: (RANK:1010 )
在线值:
发帖
回帖
粉丝
8
bookworm兄似乎很久没出现了
2008-7-12 00:37
0
游客
登录 | 注册 方可回帖
返回
//