注册机代码~

做看雪的crackme才看出差距,包含的东西比别的多。

这个ck没别的,用代码校验和来做反调试,于是下硬件断点,直接还原上代码

// Reverse11.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "windows.h"

int _tmain(int argc, _TCHAR* argv[])
{
    char username[30] = { 0 };
    char password[30] = { 0 };
    scanf_s("%s", username, 30);
    scanf_s("%s", password, 30);

    BYTE v1 = 0;
    BYTE v2 = 0;
    char str[] = "ZWATRQLCGHPSXYENVBJDFKMU";
    if (password[1] != 'E' || strlen(password) != 0xa)
    {
        printf_s("wrong");
        system("pause");
        return 0;
    }
    for (int i = 0; i < strlen(password); i++)
    {
        if (password[i]<'A' || password[i]>'Z')
        {
            printf_s("wrong");
            system("pause");
            return 0;
        }
            
    }
    int temp1 = 0;
    for (int i = 0; i < strlen(username); i++)
    {
        temp1 += username[i];
    }
    v1 = temp1 % 0x18;
    int temp2 = 0;
    for (int i = 0; i < 9; i++)
    {
        temp2 += password[i];
    }
    v2 = temp2 / 0x9;

    if (v1 > 0x18)
    v1 -= 0x18;
    if (password[0] != str[v1])
    {
        printf_s("wrong");
        system("pause");
        return 0;
    }

    BYTE v3 = v1 + (v1 + 0x18);
    if (v3 > 0x18)
    v3 -= 0x18;
    if (password[2] != str[v3])
    {
        printf_s("wrong");
        system("pause");
        return 0;
    }
    for (int i = 2; i < 8; i++)
    {
        v1 -= 0x41;
        v3 += v1;
        if (v3 > 0x18)
            v3 -= 0x18;
        if (password[i] != str[v3])
        {
            printf_s("wrong");
            system("pause");
            return 0;
        }
    }
    if (v2 == password[9])
    {
        printf_s("right");
        system("pause");
        return 0;
    }


    return 0;
}

 

转载于:https://www.cnblogs.com/distanceblog/p/5370449.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值