首页 > 其他分享 >Charles激活

Charles激活

时间:2024-09-01 08:56:17浏览次数:11  
标签:ck int32 name int Charles long 激活 rk

简介

Charles激活码计算

激活

Help -> Register Charles

添加 Registered Name 和计算出的 License key 点击 Register

Java


import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Random;
import java.util.Scanner;

/**
 * @program: ZK
 * @description: Charles激活
 * @author: zk
 * @create: 2024-08-31 10:41
 **/
public class CharlesRegister {

    private static final int ROUNDS = 12;
    private static final int ROUND_KEYS = 2 * (ROUNDS + 1);
    private static final Random RAND = new Random();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String name = sc.nextLine().toLowerCase();
        RAND.setSeed(System.nanoTime());
        System.out.println("name: " + name + "    key: " + crack(name));
    }

    private static String crack(String text) {
        byte[] name = text.getBytes();
        int length = name.length + 4;
        int padded = ((-length) & (8 - 1)) + length;
        ByteBuffer buffer = ByteBuffer.allocate(padded);
        buffer.order(ByteOrder.BIG_ENDIAN);
        buffer.putInt(name.length);
        buffer.put(name);

        long ckName = 0x7a21c951691cd470L;
        long ckKey = -5408575981733630035L;
        CkCipher ck = new CkCipher(ckName);
        ByteBuffer outBuffer = ByteBuffer.allocate(padded);
        outBuffer.order(ByteOrder.BIG_ENDIAN);

        for (int i = 0; i < padded; i += 8) {
            long nowVar = buffer.getLong(i);
            long dd = ck.encrypt(nowVar);
            outBuffer.putLong(dd);
        }

        int n = 0;
        for (byte b : outBuffer.array()) {
            n = rotateLeft(n ^ (int) b, 3);
        }
        int prefix = n ^ 0x54882f8a;
        int suffix = RAND.nextInt();
        long in = ((long) prefix << 32) | (suffix & 0xffffffffL);
        if ((suffix >> 16) == 0x0401 || (suffix >> 16) == 0x0402 || (suffix >> 16) == 0x0403) {
            // Keep `in` as is
        } else {
            in = (in & 0xffffffff00000000L) | 0x01000000L | (suffix & 0xffffff);
        }

        long out = new CkCipher(ckKey).decrypt(in);
        long n2 = 0;
        for (int i = 56; i >= 0; i -= 8) {
            n2 ^= (in >> i) & 0xff;
        }

        int vv = (int) (n2 & 0xff);
        if (vv < 0) {
            vv = -vv;
        }
        return String.format("%02x%016x", vv, out);
    }

    private static class CkCipher {
        private int[] rk = new int[ROUND_KEYS];

        public CkCipher(long ckKey) {
            int[] ld = new int[]{(int) ckKey, (int) (ckKey >>> 32)};
            rk[0] = -1209970333;
            for (int i = 1; i < ROUND_KEYS; i++) {
                rk[i] = rk[i - 1] - 1640531527;
            }
            int a = 0, b = 0, i = 0, j = 0;
            for (int k = 0; k < 3 * ROUND_KEYS; k++) {
                rk[i] = rotateLeft(rk[i] + (a + b), 3);
                a = rk[i];
                ld[j] = rotateLeft(ld[j] + (a + b), a + b);
                b = ld[j];
                i = (i + 1) % ROUND_KEYS;
                j = (j + 1) % 2;
            }
        }

        public long encrypt(long in) {
            int a = (int) in + rk[0];
            int b = (int) (in >>> 32) + rk[1];
            for (int r = 1; r <= ROUNDS; r++) {
                a = rotateLeft(a ^ b, b) + rk[2 * r];
                b = rotateLeft(b ^ a, a) + rk[2 * r + 1];
            }
            return packLong(a, b);
        }

        public long decrypt(long in) {
            int a = (int) in;
            int b = (int) (in >>> 32);
            for (int i = ROUNDS; i > 0; i--) {
                b = rotateRight(b - rk[2 * i + 1], a) ^ a;
                a = rotateRight(a - rk[2 * i], b) ^ b;
            }
            b -= rk[1];
            a -= rk[0];
            return packLong(a, b);
        }
    }

    private static int rotateLeft(int x, int y) {
        return (x << (y & 31)) | (x >>> (32 - (y & 31)));
    }

    private static int rotateRight(int x, int y) {
        return (x >>> (y & 31)) | (x << (32 - (y & 31)));
    }

    private static long packLong(int a, int b) {
        return ((long) a & 0xffffffffL) | ((long) b << 32);
    }
}

Go


package main

import (
	"bytes"
	"encoding/binary"
	"fmt"
	"math/rand"
	"time"
)

const (
	rounds    = 12
	roundKeys = 2 * (rounds + 1)
)

func main() {
	rand.Seed(time.Now().UnixNano())

	name := "Charles"

	fmt.Println("name:", name, "    key:", crack(name))
}

func crack(text string) string {

	name := []byte(text)
	length := len(name) + 4
	padded := ((-length) & (8 - 1)) + length
	bs := make([]byte, 4)
	binary.BigEndian.PutUint32(bs, uint32(len(name)))
	buff := bytes.Buffer{}
	buff.Write(bs)
	buff.Write(name)

	var ckName int64 = 0x7a21c951691cd470
	var ckKey int64 = -5408575981733630035
	ck := newCkCipher(ckName)
	outBuff := bytes.Buffer{}

	for i := 0; i < padded; i += 8 {
		bf := buff.Bytes()[i : i+8]
		buf := bytes.NewBuffer(bf)
		var nowVar int64
		if err := binary.Read(buf, binary.BigEndian, &nowVar); err != nil {
			panic(err)
		}

		dd := ck.encrypt(nowVar)

		outBuff.WriteByte(byte(dd >> 56))
		outBuff.WriteByte(byte(dd >> 48))
		outBuff.WriteByte(byte(dd >> 40))
		outBuff.WriteByte(byte(dd >> 32))
		outBuff.WriteByte(byte(dd >> 24))
		outBuff.WriteByte(byte(dd >> 16))
		outBuff.WriteByte(byte(dd >> 8))
		outBuff.WriteByte(byte(dd))

	}
	var n int32
	for _, b := range outBuff.Bytes() {
		n = rotateLeft(n^int32(int8(b)), 0x3)
	}
	prefix:= n ^ 0x54882f8a
	suffix:=rand.Int31()
	in := int64(prefix) << 32
	s := int64(suffix)
	switch suffix >> 16 {
	case 0x0401:
	case 0x0402:
	case 0x0403:
		in |= s
		break
	default:
		in |= 0x01000000 | (s & 0xffffff)
		break
	}

	out := newCkCipher(ckKey).decrypt(in)

	var n2 int64
	for i := 56; i >= 0; i -= 8 {
		n2 ^= int64((uint64(in) >> i) & 0xff)
	}

	vv := int32(n2 & 0xff)
	if vv < 0 {
		vv = -vv
	}
	return fmt.Sprintf("%02x%016x", vv, uint64(out))
}


type ckCipher struct {
	rk [roundKeys]int32
}

func newCkCipher(ckKey int64) ckCipher {
	ck := ckCipher{}

	var ld [2]int32
	ld[0] = int32(ckKey)
	ld[1] = int32(uint64(ckKey) >> 32)

	ck.rk[0] = -1209970333
	for i := 1; i < roundKeys; i++ {
		ck.rk[i] = ck.rk[i-1] + -1640531527
	}
	var a, b int32
	var i, j int

	for k := 0; k < 3*roundKeys; k++ {
		ck.rk[i] = rotateLeft(ck.rk[i]+(a+b), 3)
		a = ck.rk[i]
		ld[j] = rotateLeft(ld[j]+(a+b), a+b)
		b = ld[j]
		i = (i + 1) % roundKeys
		j = (j + 1) % 2
	}
	return ck
}

func (ck ckCipher) encrypt(in int64) int64 {
	a := int32(in) + ck.rk[0]
	b := int32(uint64(in)>>32) + ck.rk[1]
	for r := 1; r <= rounds; r++ {
		a = rotateLeft(a^b, b) + ck.rk[2*r]
		b = rotateLeft(b^a, a) + ck.rk[2*r+1]
	}
	return pkLong(a, b)
}

func (ck ckCipher) decrypt(in int64) int64 {
	a := int32(in)
	b := int32(uint64(in) >> 32)
	for i := rounds; i > 0; i-- {
		b = rotateRight(b-ck.rk[2*i+1], a) ^ a
		a = rotateRight(a-ck.rk[2*i], b) ^ b
	}
	b -= ck.rk[1]
	a -= ck.rk[0]
	return pkLong(a, b)
}

func rotateLeft(x int32, y int32) int32 {
	return int32(x<<(y&(32-1))) | int32(uint32(x)>>(32-(y&(32-1))))
}

func rotateRight(x int32, y int32) int32 {
	return int32(uint32(x)>>(y&(32-1))) | int32(x<<(32-(y&(32-1))))
}

func pkLong(a int32, b int32) int64 {
	return (int64(a) & 0xffffffff) | (int64(b) << 32)
}

在线

https://www.zzzmode.com/mytools/charles/

申明

上述均为技术学习探索,请勿牟利!!!

请支持正版!!!


结束

标签:ck,int32,name,int,Charles,long,激活,rk
From: https://blog.csdn.net/zk_tww/article/details/141760254

相关文章

  • 小白学安全:轻松下载安装和激活VMware虚拟机
    一、下载VMwarehttps://pan.quark.cn/s/6e439e2c15c1二、安装VMware1、接受协议2、更改安装路径,建议非C盘3、不参与用户体验4、创建快捷方式5、开始安装三、激活VMware7、输入许可证#以下许可证选择其一即可【仅做学习交流,请支持正版】4A4RR-813DK-M81A......
  • day37-测试之抓包工具Charles、Fiddler
    目录一、抓包工具Charles    1.1.Charles是什么    1.2.Charles工作原理    1.3.Charles主要功能    1.4.Charles优点    1.5.Charles安装    1.6.Charles组件介绍        1.7.Charles设置    1.8.C......
  • 关于流量卡的激活和首充
    继7月份电信发文宣布所有线上卡产品从135G下降至80G后(4月份已经从185G降至135G),这个月,联通和移动也出台了同样政策和发文,这意味着三大运营商都正式进入80G时代,大流量时代已落下帷幕。 这些天,店铺内所有超过135G产品也在陆续下架,这几天很多小伙伴都希望能赶上这135G的最后末......
  • 什么是激活函数?零基础扫盲~
    我刚开始学习深度学习的时候,看到了这么一段话:作者把非线性激活函数(ReLU)用在了模型里,发现训练速度显著提高,原因在于传统用的是饱和非线性激活函数,例如tanh,训练时如果进入到饱和区域,那么会因为梯度变化过小而难以训练;而ReLU是一种非饱和非线性激活函数,接受阈是0~∞∞,不存在tan......
  • 抓包工具安装-Charles
    简介Charles作为一个HTTP代理/HTTP监视器/反向代理工具,允许开发者查看他们的计算机与互联网之间的所有HTTP和HTTPS通信。工作原理是基于HTTP代理的概念,它充当了一个中间人,拦截并记录客户端(如浏览器或移动应用)与服务器之间的所有HTTP和HTTPS通信。环境windows+......
  • Typora 1.4.8 最新Typora破解激活教程!
    一、typora介绍Typora是一款Markdown编辑器和阅读器,风格极简/多种主题/支持macOS,Windows及Linux二、下载地址破解工具已经放到网盘了,需要的自取。网盘地址:Typora1.4.8最新Typora破解激活教程! 三、破解教程双击typora1.48-setup-x64.exe进行安装找到破解补丁中......
  • Adobe Photoshop PS v25.6 激活版下载安装教程 (图像设计工具)
    前言AdobePhotoshop是一款专业强大的图片处理工具,从照片编辑和合成到数字绘画、动画和图形设计,一流的图像处理和图形设计应用程序是几乎每个创意项目的核心所在。利用Photoshop在桌面上的强大功能,您可以在灵感来袭时随时随地进行创作。一、下载地址2024v25.6下载:Adobe-Phot......
  • Autodesk 3DS Max v2025 激活版下载及安装教程 (3D 建模工具)
    前言Autodesk3dsMax是一款功能强大的3D建模和动画解决方案,游戏开发人员、视觉效果艺术家和平面设计师使用它来创建庞大的世界、令人惊叹的场景和引人入胜的虚拟现实(VR)体验。Autodesk3DSMAX是业界使用最广泛的3D建模和动画软件程序之一,它将为用户提供一系列新功能和工......
  • 【PyCharm安装+激活】Python+PyCharm安装,你看看这篇就够了,保证一看就会(附带激活码)
    安装Python1、下载Python1.访问Python官方网站:Python.orghttps://www.python.org/2.点击页面上方的“Downloads”链接。3.在下载页面,选择适合你操作系统的版本(如Windows、macOS、Linux)。以Windows为例,选择“Windows”系统后,再选择适合你系统的位数(64位或32位),并下载相应的......
  • IDEA2023激活码
    激活码FV8EM46DQYC5AW9-eyJsaWNlbnNlSWQiOiJGVjhFTTQ2RFFZQzVBVzkiLCJsaWNlbnNlZU5hbWUiOiJtZW5vcmFoIHBhcmFwZXQiLCJsaWNlbnNlZVR5cGUiOiJQRVJTT05BTCIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiIiLCJjaGVja0NvbmN1cnJlbnRVc2UiOm......