关闭

ipmsg_pwd_finder.c

标签: pathnullaccessfunuser
596人阅读 评论(0) 收藏 举报
分类:

/*
 * missing u, sierra
 * binjo @ 2006/03/08
 *------------------------------------------------------------
 * ipmsg_pwd_finder.c
 *
 * *CopyLeft*
 * 4 fun, and test...
 *
 * cl ipmsg_pwd_finder.c /MD /O1 /link /release /subsystem:console /entry:main
 *
 */
#include 
#include 
//------------------------------------------------------------
#pragma comment( lib, "Advapi32.lib" )
//------------------------------------------------------------
int main( int argc, char **argv ) {
    HKEY    hkey;
    LPCTSTR lpTarget         = "Software//HSTools//IPMsg";
    LPCTSTR lpPwdStr         = "PasswordStr";
    CHAR    achBuf[MAX_PATH] = "";
    CHAR    achREV[MAX_PATH] = "";
    LONG    cbData;
    LONG    lnRet;
    int     i;

    printf( "+--------------------------------+/n" );
    printf( "   IPMSG Password Cracker v0.2/n" );
    printf( "       By Sierra/n" );
    printf( "   Merry Women's Day/n" );
    printf( "+--------------------------------+/n" );

    lnRet   = RegOpenKeyEx(
                  HKEY_CURRENT_USER,
                  lpTarget,
                  0,
                  KEY_ALL_ACCESS,
                  &hkey
              );

    if ( lnRet != ERROR_SUCCESS )
    {
        printf( "[-] RegOpenKeyEx failed : %d/n", lnRet );
        return 0;
    }

    lnRet   = RegQueryValueEx(
                  hkey,
                  lpPwdStr,
                  NULL,
                  NULL,
                  (LPBYTE)achBuf,
                  &cbData
              );

    if ( lnRet != ERROR_SUCCESS )
    {
        printf( "[-] RegQueryValue failed : %d/n", lnRet );
        RegCloseKey( hkey );
        return 0;
    }
    else
    {

        if ( achBuf[0] != '/0' )
        {
            printf( "[+] Original PasswordStr = [%s]/n", achBuf );

            for ( i = 0; i < MAX_PATH && achBuf[i] != '/0'; i++ )
            {
                achREV[i] = achBuf[i] ^ 0x7F;
            }

            printf( "[+] Cracked PasswordStr  = [%s]/n", achREV );
        }
        else
        {
            printf( "[+] You haven't set the password/n" );
        }
    }

    RegCloseKey( hkey );

    printf( "print any key..." );
    getch();

    return 0;
}
//------------------------------------------------------------
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:9287次
    • 积分:196
    • 等级:
    • 排名:千里之外
    • 原创:8篇
    • 转载:1篇
    • 译文:0篇
    • 评论:3条
    文章分类
    最新评论
    Friends
    Security