您的位置:首页 > 游戏 > 手游 > Charles激活

Charles激活

2024/11/17 13:58:07 来源:https://blog.csdn.net/zk_tww/article/details/141760254  浏览:    关键词:Charles激活

简介

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 mainimport ("bytes""encoding/binary""fmt""math/rand""time"
)const (rounds    = 12roundKeys = 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) + 4padded := ((-length) & (8 - 1)) + lengthbs := make([]byte, 4)binary.BigEndian.PutUint32(bs, uint32(len(name)))buff := bytes.Buffer{}buff.Write(bs)buff.Write(name)var ckName int64 = 0x7a21c951691cd470var ckKey int64 = -5408575981733630035ck := newCkCipher(ckName)outBuff := bytes.Buffer{}for i := 0; i < padded; i += 8 {bf := buff.Bytes()[i : i+8]buf := bytes.NewBuffer(bf)var nowVar int64if 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 int32for _, b := range outBuff.Bytes() {n = rotateLeft(n^int32(int8(b)), 0x3)}prefix:= n ^ 0x54882f8asuffix:=rand.Int31()in := int64(prefix) << 32s := int64(suffix)switch suffix >> 16 {case 0x0401:case 0x0402:case 0x0403:in |= sbreakdefault:in |= 0x01000000 | (s & 0xffffff)break}out := newCkCipher(ckKey).decrypt(in)var n2 int64for 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]int32ld[0] = int32(ckKey)ld[1] = int32(uint64(ckKey) >> 32)ck.rk[0] = -1209970333for i := 1; i < roundKeys; i++ {ck.rk[i] = ck.rk[i-1] + -1640531527}var a, b int32var i, j intfor 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) % roundKeysj = (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) ^ aa = 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/

申明

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

请支持正版!!!


结束

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com