|

分享源码
界面截图: |
- |
是否带模块: |
纯源码 |
备注说明: |
- |
我看咸鱼一大堆那种忽悠人,诈骗的,割韭菜的
现在免费分享给大家学习研究交流使用,避免被割韭菜
使用环境:golang
编译条件:windows/linux
使用条件:傻瓜式
源码来源:某大佬私人赠送+个人修订修复
算法代码
package Algorithm
import (
"math/rand"
"time"
"github.com/golang/protobuf/proto"
"hash/crc32"
"wechatdll/Cilent/mm"
)
// 常量定义
const (
opTypeLogin = 5
encryptFlag = 1
zeroUin = 0
iphoneVersion = "00000008"
ipadVersion = "00000007"
androidVersion = "00000001"
randomMax = 10000
)
// buildZTData 构建通用的ZTData结构
func buildZTData(version string, encryptedData []byte) *mm.ZTData {
timestamp := uint32(time.Now().Unix())
return &mm.ZTData{
Version: proto.String(version + "\x00"),
Encrypted: proto.Uint32(encryptFlag),
Data: encryptedData,
TimeStamp: proto.Uint32(timestamp),
Optype: proto.Uint32(opTypeLogin),
Uin: proto.Uint32(zeroUin),
}
}
// encryptAndCompress 通用的压缩加密流程
func encryptAndCompress(data []byte, encryptFunc func([]byte) []byte) []byte {
compressed := DoZlibCompress(data)
return encryptFunc(compressed)
}
// generateTimeSequence 生成时间序列
func generateTimeSequence(baseTime uint64, length int) []uint64 {
sequence := make([]uint64, length)
current := baseTime
for i := 0; i < length; i++ {
current += uint64(rand.Intn(randomMax))
sequence = current
}
return sequence
}
// IphoneWcstf iphone生成wcstf, 使用08加密
func IphoneWcstf(Username string) []byte {
now := time.Now()
curtime := uint64(now.UnixNano() / 1e6)
contentlen := len(Username)
ct := generateTimeSequence(curtime, contentlen)
ccd := &mm.Wcstf{
StartTime: &curtime,
CheckTime: &curtime,
Count: proto.Uint32(uint32(contentlen)),
EndTime: ct,
}
pb, _ := proto.Marshal(ccd)
encrypted := encryptAndCompress(pb, SaeEncrypt06)
ztData := buildZTData(iphoneVersion, encrypted)
MS, _ := proto.Marshal(ztData)
return MS
}
// IphoneWcste iphone生成wcste, 使用08加密
func IphoneWcste(A, B uint64) []byte {
now := time.Now()
curtime := uint32(now.Unix())
curNanoTime := uint64(now.UnixNano())
ccd := &mm.Wcste{
Checkid: proto.String("<LoginByID>"),
StartTime: &curtime,
CheckTime: &curtime,
Count1: proto.Uint32(0),
Count2: proto.Uint32(1),
Count3: proto.Uint32(0),
Const1: proto.Uint64(A),
Const2: &curNanoTime,
Const3: &curNanoTime,
Const4: &curNanoTime,
Const5: &curNanoTime,
Const6: proto.Uint64(B),
}
pb, _ := proto.Marshal(ccd)
encrypted := encryptAndCompress(pb, SaeEncrypt06)
ztData := buildZTData(iphoneVersion, encrypted)
MS, _ := proto.Marshal(ztData)
return MS
}
// IpadWcstf ipad生成wcstf, 使用07加密
func IpadWcstf(Username string) []byte {
now := time.Now()
curtime := uint64(now.UnixNano() / 1e6)
contentlen := len(Username)
ct := generateTimeSequence(curtime, contentlen)
ccd := &mm.Wcstf{
StartTime: &curtime,
CheckTime: &curtime,
Count: proto.Uint32(uint32(contentlen)),
EndTime: ct,
}
pb, _ := proto.Marshal(ccd)
encrypted := encryptAndCompress(pb, func(data []byte) []byte {
zt := new(ZT)
zt.Init()
return zt.Encrypt(data)
})
ztData := buildZTData(ipadVersion, encrypted)
MS, _ := proto.Marshal(ztData)
return MS
}
// IpadWcste ipad生成wcste, 使用07加密
func IpadWcste(A, B uint64) []byte {
now := time.Now()
curtime := uint32(now.Unix())
curNanoTime := uint64(now.UnixNano())
ccd := &mm.Wcste{
Checkid: proto.String("<LoginByID>"),
StartTime: &curtime,
CheckTime: &curtime,
Count1: proto.Uint32(0),
Count2: proto.Uint32(1),
Count3: proto.Uint32(0),
Const1: proto.Uint64(A),
Const2: &curNanoTime,
Const3: &curNanoTime,
Const4: &curNanoTime,
Const5: &curNanoTime,
Const6: proto.Uint64(B),
}
pb, _ := proto.Marshal(ccd)
encrypted := encryptAndCompress(pb, func(data []byte) []byte {
zt := new(ZT)
zt.Init()
return zt.Encrypt(data)
})
ztData := buildZTData(ipadVersion, encrypted)
MS, _ := proto.Marshal(ztData)
return MS
}
// AndroidWcstf android生成wcstf, 使用01加密
func AndroidWcstf(Username string) []byte {
now := time.Now()
curtime := uint64(now.UnixNano() / 1e6)
contentlen := len(Username)
ct := generateTimeSequence(curtime, contentlen)
ccd := &mm.Wcstf{
StartTime: &curtime,
CheckTime: &curtime,
Count: proto.Uint32(uint32(contentlen)),
EndTime: ct,
}
pb, _ := proto.Marshal(ccd)
encrypted := encryptAndCompress(pb, SaeEncrypt01)
ztData := buildZTData(androidVersion, encrypted)
MS, _ := proto.Marshal(ztData)
return MS
}
// AndroidWcste android生成wcste, 使用01加密
func AndroidWcste(A, B uint64) []byte {
now := time.Now()
curtime := uint32(now.Unix())
curNanoTime := uint64(now.UnixNano())
ccd := &mm.Wcste{
Checkid: proto.String("<LoginByID>"),
StartTime: &curtime,
CheckTime: &curtime,
Count1: proto.Uint32(0),
Count2: proto.Uint32(1),
Count3: proto.Uint32(0),
Const1: proto.Uint64(A),
Const2: &curNanoTime,
Const3: &curNanoTime,
Const4: &curNanoTime,
Const5: &curNanoTime,
Const6: proto.Uint64(B),
}
pb, _ := proto.Marshal(ccd)
encrypted := encryptAndCompress(pb, SaeEncrypt01)
ztData := buildZTData(androidVersion, encrypted)
MS, _ := proto.Marshal(ztData)
return MS
}
// AndroidCcData 生成Android设备数据
func AndroidCcData(DeviceId string, info AndroidDeviceInfo, DeviceToken mm.TrustResponse) *mm.ZTData {
curtime := uint32(time.Now().Unix())
ccd3body := &mm.AndroidSpamDataBody{
Loc: proto.Uint32(0),
Root: proto.Uint32(0),
Debug: proto.Uint32(0),
PackageSign: proto.String(info.AndriodPackageSign(DeviceId)),
RadioVersion: proto.String(info.AndroidRadioVersion(DeviceId)),
BuildVersion: proto.String(info.AndroidVersion()),
DeviceId: proto.String(info.AndriodImei(DeviceId)),
AndroidId: proto.String(info.AndroidBuildID(DeviceId)),
SerialId: proto.String(info.AndriodPhoneSerial(DeviceId)),
Model: proto.String(info.AndroidPhoneModel(DeviceId)),
CpuCount: proto.Uint32(8),
CpuBrand: proto.String(info.AndroidHardware(DeviceId)),
CpuExt: proto.String(info.AndroidFeatures()),
WlanAddress: proto.String(info.AndriodWLanAddress(DeviceId)),
Ssid: proto.String(info.AndriodSsid(DeviceId)),
Bssid: proto.String(info.AndriodBssid(DeviceId)),
SimOperator: proto.String(""),
WifiName: proto.String(info.AndroidWifiName(DeviceId)),
BuildFP: proto.String(info.AndroidBuildFP(DeviceId)),
BuildBoard: proto.String("bullhead"),
BuildBootLoader: proto.String(info.AndroidBuildBoard(DeviceId)),
BuildBrand: proto.String("google"),
BuildDevice: proto.String("bullhead"),
GsmSimOperatorNumber: proto.String(""),
SoterId: proto.String(""),
KernelReleaseNumber: proto.String(info.AndroidKernelReleaseNumber(DeviceId)),
UsbState: proto.Uint32(0),
Sign: proto.String(info.AndriodPackageSign(DeviceId)),
PackageFlag: proto.Uint32(14),
AccessFlag: proto.Uint32(uint32(info.AndriodAccessFlag(DeviceId))),
Unkonwn: proto.Uint32(3),
TbVersionCrc: proto.Uint32(uint32(info.AndriodTbVersionCrc(DeviceId))),
SfMD5: proto.String(info.AndriodSfMD5(DeviceId)),
SfArmMD5: proto.String(info.AndriodSfArmMD5(DeviceId)),
SfArm64MD5: proto.String(info.AndriodSfArm64MD5(DeviceId)),
SbMD5: proto.String(info.AndriodSbMD5(DeviceId)),
SoterId2: proto.String(""),
WidevineDeviceID: proto.String(info.AndriodWidevineDeviceID(DeviceId)),
FSID: proto.String(info.AndriodFSID(DeviceId)),
Oaid: proto.String(""),
TimeCheck: proto.Uint32(0),
NanoTime: proto.Uint32(uint32(info.AndriodNanoTime(DeviceId))),
Refreshtime: proto.Uint32(DeviceToken.GetTrustResponseData().GetTimeStamp()),
SoftConfig: proto.String(DeviceToken.GetTrustResponseData().GetSoftData().GetSoftConfig()),
SoftData: DeviceToken.GetTrustResponseData().GetSoftData().GetSoftData(),
}
pb, _ := proto.Marshal(ccd3body)
crc := crc32.ChecksumIEEE(pb)
ccd3 := &mm.AndroidCcdDataBody{
Crc: &crc,
TimeStamp: &curtime,
Body: ccd3body,
}
pb, _ = proto.Marshal(ccd3)
encrypted := encryptAndCompress(pb, SaeEncrypt01)
return buildZTData(androidVersion, encrypted)
}
写的不好的大家多担待,仅供学习研究交流使用,有修改的内容可以交流沟通
https://f.wss.ink/f/gr90oln6ivf 复制链接到浏览器打开
不收精币,免费开源,防止被割韭菜
|
评分
-
查看全部评分
|