913 lines
39 KiB
Go
913 lines
39 KiB
Go
|
|
package extinfo
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"bytes"
|
|||
|
|
"fmt"
|
|||
|
|
"hash/crc32"
|
|||
|
|
"math/rand"
|
|||
|
|
"strings"
|
|||
|
|
"time"
|
|||
|
|
"xiawan/wx/clientsdk/android"
|
|||
|
|
"xiawan/wx/clientsdk/android/mmproto"
|
|||
|
|
"xiawan/wx/clientsdk/baseinfo"
|
|||
|
|
"xiawan/wx/clientsdk/baseutils"
|
|||
|
|
"xiawan/wx/clientsdk/ccdata"
|
|||
|
|
"xiawan/wx/protobuf/wechat"
|
|||
|
|
|
|||
|
|
"github.com/gogf/guuid"
|
|||
|
|
"github.com/gogo/protobuf/proto"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
func init() {
|
|||
|
|
rand.Seed(time.Now().UnixNano())
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 获取CCD
|
|||
|
|
func GetCCDPbLibLogin(iosVersion, deviceType, uuid1, uuid2, deviceName string, deviceToken *wechat.TrustResp, deviceId, userName, guid2 string) ([]byte, error) {
|
|||
|
|
// ccData1, err := GetNewSpamData(iosVersion, deviceType, uuid1, uuid2, deviceName, deviceToken, deviceId, userName, guid2)
|
|||
|
|
ccData1, err := GetNew07SpamData(iosVersion, deviceType, uuid1, uuid2, deviceName, deviceToken, deviceId, userName, guid2)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
wcstf, _ := proto.Marshal(android.IphoneWcstf(userName))
|
|||
|
|
wcste, _ := proto.Marshal(android.IphoneWcste(0, 0))
|
|||
|
|
|
|||
|
|
wcExtInfo := &wechat.WCExtInfoNew{
|
|||
|
|
Wcstf: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(wcstf))),
|
|||
|
|
Buffer: wcstf,
|
|||
|
|
},
|
|||
|
|
Wcste: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(wcste))),
|
|||
|
|
Buffer: wcste,
|
|||
|
|
},
|
|||
|
|
CcData: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(ccData1))),
|
|||
|
|
Buffer: ccData1,
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(wcExtInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 获取CCD
|
|||
|
|
func GetCCDPbLib(iosVersion, deviceType, uuid1, uuid2, deviceName string, deviceToken *wechat.TrustResp, deviceId, userName, guid2 string) ([]byte, error) {
|
|||
|
|
ccData1, _ := GetNewIPadSpamData(iosVersion, deviceType, uuid1, uuid2, deviceName, deviceToken, deviceId, userName, guid2)
|
|||
|
|
|
|||
|
|
wcstf, _ := proto.Marshal(android.IphoneWcstf(userName))
|
|||
|
|
wcste, _ := proto.Marshal(android.IphoneWcste(0, 0))
|
|||
|
|
// wcstf, err := GetWcstfIpad(userName)
|
|||
|
|
// if err != nil {
|
|||
|
|
// return nil, err
|
|||
|
|
// }
|
|||
|
|
// wcste, err := GetWcsteIpad()
|
|||
|
|
// if err != nil {
|
|||
|
|
// return nil, err
|
|||
|
|
// }
|
|||
|
|
DeviceTokenCCD := GetDeviceToken(deviceToken.GetTrustResponseData().GetDeviceToken())
|
|||
|
|
DeviceTokenCCDPB, _ := proto.Marshal(DeviceTokenCCD)
|
|||
|
|
wcExtInfo := &wechat.WCExtInfoNew{
|
|||
|
|
Wcstf: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(wcstf))),
|
|||
|
|
Buffer: wcstf,
|
|||
|
|
},
|
|||
|
|
Wcste: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(wcste))),
|
|||
|
|
Buffer: wcste,
|
|||
|
|
},
|
|||
|
|
CcData: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(ccData1))),
|
|||
|
|
Buffer: ccData1,
|
|||
|
|
},
|
|||
|
|
DeviceToken: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(DeviceTokenCCDPB))),
|
|||
|
|
Buffer: DeviceTokenCCDPB,
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(wcExtInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 获取CCD
|
|||
|
|
func GetCCDPbLibIPhone(iosVersion, deviceType, uuid1, uuid2, deviceName string, deviceToken *wechat.TrustResp, deviceId, userName, guid2 string) ([]byte, error) {
|
|||
|
|
ccData1, err := GetNew07SpamData(iosVersion, deviceType, uuid1, uuid2, deviceName, deviceToken, deviceId, userName, guid2)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
wcstf, _ := proto.Marshal(android.IphoneWcstf(userName))
|
|||
|
|
wcste, _ := proto.Marshal(android.IphoneWcste(0, 0))
|
|||
|
|
|
|||
|
|
DeviceTokenCCD := GetDeviceToken(deviceToken.GetTrustResponseData().GetDeviceToken())
|
|||
|
|
DeviceTokenCCDPB, _ := proto.Marshal(DeviceTokenCCD)
|
|||
|
|
|
|||
|
|
wcExtInfo := &wechat.WCExtInfoNew{
|
|||
|
|
Wcstf: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(wcstf))),
|
|||
|
|
Buffer: wcstf,
|
|||
|
|
},
|
|||
|
|
Wcste: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(wcste))),
|
|||
|
|
Buffer: wcste,
|
|||
|
|
},
|
|||
|
|
CcData: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(ccData1))),
|
|||
|
|
Buffer: ccData1,
|
|||
|
|
},
|
|||
|
|
DeviceToken: &wechat.BufferT{
|
|||
|
|
ILen: proto.Uint32(uint32(len(DeviceTokenCCDPB))),
|
|||
|
|
Buffer: DeviceTokenCCDPB,
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(wcExtInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func GetWcstfIpad(userName string) ([]byte, error) {
|
|||
|
|
curtime := time.Now().UnixNano() / 1000000
|
|||
|
|
contentLen := len(userName)
|
|||
|
|
ct := make([]uint64, 0)
|
|||
|
|
ut := curtime
|
|||
|
|
for i := 0; i < contentLen; i++ {
|
|||
|
|
ut += rand.Int63n(10000)
|
|||
|
|
ct = append(ct, uint64(ut))
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
wcstf := &wechat.WCSTF{
|
|||
|
|
StartTime: proto.Uint64(uint64(curtime)),
|
|||
|
|
CheckTime: proto.Uint64(uint64(curtime)),
|
|||
|
|
Count: proto.Uint32(uint32(contentLen)),
|
|||
|
|
EndTime: ct,
|
|||
|
|
}
|
|||
|
|
ccData, err := proto.Marshal(wcstf)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
afterCompressionCCData := baseutils.CompressByteArray(ccData)
|
|||
|
|
afterEnData, err := ccdata.EncodeZipData(afterCompressionCCData, 0x3060)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
deviceRunningInfo := &wechat.DeviceRunningInfoNew{
|
|||
|
|
Version: []byte("00000003"),
|
|||
|
|
Type: proto.Uint32(1),
|
|||
|
|
EncryptData: afterEnData,
|
|||
|
|
Timestamp: proto.Uint32(uint32(curtime)),
|
|||
|
|
Unknown5: proto.Uint32(5),
|
|||
|
|
Unknown6: proto.Uint32(0),
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(deviceRunningInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func GetWcsteIpad() ([]byte, error) {
|
|||
|
|
curtime := time.Now().Unix()
|
|||
|
|
curNanoTime := time.Now().UnixNano() / 1000000
|
|||
|
|
wcste := &wechat.WCSTE{
|
|||
|
|
CheckId: proto.String("<LoginByID>"),
|
|||
|
|
StartTime: proto.Uint32(uint32(curtime)),
|
|||
|
|
CheckTime: proto.Uint32(uint32(curtime)),
|
|||
|
|
Count1: proto.Uint32(0),
|
|||
|
|
Count2: proto.Uint32(1),
|
|||
|
|
Count3: proto.Uint32(0),
|
|||
|
|
Const1: proto.Uint64(384214787666497617),
|
|||
|
|
Const2: proto.Uint64(uint64(curNanoTime)),
|
|||
|
|
Const3: proto.Uint64(uint64(curNanoTime)),
|
|||
|
|
Const4: proto.Uint64(uint64(curNanoTime)),
|
|||
|
|
Const5: proto.Uint64(uint64(curNanoTime)),
|
|||
|
|
Const6: proto.Uint64(384002236977512448),
|
|||
|
|
}
|
|||
|
|
ccData, err := proto.Marshal(wcste)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
afterCompressionCCData := baseutils.CompressByteArray(ccData)
|
|||
|
|
afterEnData, err := ccdata.EncodeZipData(afterCompressionCCData, 0x3060)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
deviceRunningInfo := &wechat.DeviceRunningInfoNew{
|
|||
|
|
Version: []byte("00000003"),
|
|||
|
|
Type: proto.Uint32(1),
|
|||
|
|
EncryptData: afterEnData,
|
|||
|
|
Timestamp: proto.Uint32(uint32(curtime)),
|
|||
|
|
Unknown5: proto.Uint32(5),
|
|||
|
|
Unknown6: proto.Uint32(0),
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(deviceRunningInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 705以上版本的计算extinfo
|
|||
|
|
func GetNewSpamData(iosVersion string, deviceType, uuid1, uuid2, deviceName string, deviceToken *wechat.TrustResp, deviceId, userName, guid2 string) ([]byte, error) {
|
|||
|
|
dateTimeSramp := time.Now().Unix()
|
|||
|
|
timeStamp := time.Now().Unix()
|
|||
|
|
xorKey := MakeXorKey(timeStamp)
|
|||
|
|
//xorKey := byte((dateTimeSramp * 0xffffffed) + 7)
|
|||
|
|
guid1 := guuid.New().String()
|
|||
|
|
if guid2 == "" {
|
|||
|
|
guid2 = guuid.New().String()
|
|||
|
|
}
|
|||
|
|
//guid2 := guuid.New().String()
|
|||
|
|
//24算法
|
|||
|
|
spamDataBody := wechat.SpamDataBody{
|
|||
|
|
UnKnown1: proto.Int32(1),
|
|||
|
|
TimeStamp: proto.Uint32(uint32(dateTimeSramp)),
|
|||
|
|
KeyHash: proto.Int32(int32(MakeKeyHash(xorKey))),
|
|||
|
|
Yes1: proto.String(XorEncrypt("yes", xorKey)),
|
|||
|
|
Yes2: proto.String(XorEncrypt("yes", xorKey)),
|
|||
|
|
IosVersion: proto.String(XorEncrypt(iosVersion, xorKey)),
|
|||
|
|
DeviceType: proto.String(XorEncrypt(deviceType, xorKey)),
|
|||
|
|
UnKnown2: proto.Int32(4), //cpu核数
|
|||
|
|
IdentifierForVendor: proto.String(XorEncrypt(uuid1, xorKey)),
|
|||
|
|
AdvertisingIdentifier: proto.String(XorEncrypt(uuid2, xorKey)),
|
|||
|
|
Carrier: proto.String(XorEncrypt("中国联通", xorKey)),
|
|||
|
|
BatteryInfo: proto.Int32(1),
|
|||
|
|
NetworkName: proto.String(XorEncrypt("en0", xorKey)),
|
|||
|
|
NetType: proto.Int32(1),
|
|||
|
|
AppBundleId: proto.String(XorEncrypt("com.tencent.xin", xorKey)),
|
|||
|
|
DeviceName: proto.String(XorEncrypt(deviceName, xorKey)),
|
|||
|
|
UserName: proto.String(XorEncrypt(userName, xorKey)),
|
|||
|
|
Unknown3: proto.Int64(DeviceNumber(deviceId[:29] + "FFF")), //基带版本 77968568550229002
|
|||
|
|
Unknown4: proto.Int64(DeviceNumber(deviceId[:29] + "OOO")), //基带通讯版本 77968568550228991
|
|||
|
|
Unknown5: proto.Int32(0), //IsJailbreak
|
|||
|
|
Unknown6: proto.Int32(4),
|
|||
|
|
Lang: proto.String(XorEncrypt("zh", xorKey)),
|
|||
|
|
Country: proto.String(XorEncrypt("CN", xorKey)),
|
|||
|
|
Unknown7: proto.Int32(4),
|
|||
|
|
DocumentDir: proto.String(XorEncrypt(fmt.Sprintf("/var/mobile/Containers/Data/Application/%s/Documents", guid1), xorKey)),
|
|||
|
|
Unknown8: proto.Int32(0),
|
|||
|
|
Unknown9: proto.Int32(0),
|
|||
|
|
HeadMD5: proto.String(XorEncrypt(GetCidMd5(deviceId, GetCid(0x0262626262626)), xorKey)), //XorEncrypt("d13610700984cf481b7d3f5fa2011c30", xorKey)
|
|||
|
|
AppUUID: proto.String(XorEncrypt(uuid1, xorKey)),
|
|||
|
|
SyslogUUID: proto.String(XorEncrypt(uuid2, xorKey)),
|
|||
|
|
Unknown10: proto.String(XorEncrypt(BuildRandomWifiSsid(), xorKey)),
|
|||
|
|
Unknown11: proto.String(XorEncrypt(baseutils.BuildRandomMac(), xorKey)),
|
|||
|
|
AppName: proto.String(XorEncrypt("微信", xorKey)),
|
|||
|
|
SshPath: proto.String(XorEncrypt("/usr/bin/ssh", xorKey)),
|
|||
|
|
TempTest: proto.String(XorEncrypt("/tmp/test.txt", xorKey)), //XorEncrypt("/tmp/test.txt", xorKey)
|
|||
|
|
DevMD5: proto.String(""),
|
|||
|
|
DevUser: proto.String(""),
|
|||
|
|
DevPrefix: proto.String(""),
|
|||
|
|
AppFileInfo: GetFileInfo(deviceId, xorKey, guid2),
|
|||
|
|
Unknown12: proto.String(""),
|
|||
|
|
IsModify: proto.Int32(0),
|
|||
|
|
ModifyMD5: proto.String(baseutils.Md5Value("modify")),
|
|||
|
|
//RqtHash: proto.Int64(baseutils.EncInt(int64(baseutils.CalcMsgCrc([]byte(XorEncrypt(baseutils.Md5Value("modify"), xorKey)))))), //288529533794259264
|
|||
|
|
RqtHash: proto.Int64(baseutils.EncInt(int64(SignRqtBufByAutoChosenKey(baseutils.Md5Value("modify" + deviceId))))),
|
|||
|
|
Unknown53: proto.Uint64(1586355322), //微信安装时间
|
|||
|
|
Unknown54: proto.Uint64(uint64(dateTimeSramp)), //微信启动时间 1586355519000
|
|||
|
|
Unknown55: proto.Uint64(0), //固定值0
|
|||
|
|
Unknown56: proto.Int64(baseutils.EncInt(int64(SignRqtBufByAutoChosenKey(baseutils.Md5Value("modify" + deviceId))))),
|
|||
|
|
//Unknown46: proto.Int64(baseutils.EncInt(int64(baseutils.CalcMsgCrc([]byte(XorEncrypt(baseutils.Md5Value("modify"), xorKey)))))), //288529533794259264
|
|||
|
|
Unknown57: proto.Uint64(0), //固定值0
|
|||
|
|
Unknown58: proto.String(XorEncrypt(deviceId, xorKey)),
|
|||
|
|
//Unknown49: proto.String(strconv.FormatInt(baseutils.EncInt(int64(crc32.ChecksumIEEE([]byte(XorEncrypt(deviceId, xorKey))))), 10)),
|
|||
|
|
Unknown59: proto.String(fmt.Sprintf("%v", baseutils.EncInt(int64(crc32.ChecksumIEEE([]byte(XorEncrypt(deviceId, xorKey))))))),
|
|||
|
|
Unknown61: proto.String(XorEncrypt("2FFC7F6DFEEFFF2B3FFCA029", xorKey)),
|
|||
|
|
Unknown62: proto.Uint64(1175744137544159509),
|
|||
|
|
Unknown63: proto.String(XorEncrypt(baseutils.Md5Value(deviceId+"imsi"), xorKey)), //device + "imsi" md5
|
|||
|
|
}
|
|||
|
|
appFileInfo := new(bytes.Buffer)
|
|||
|
|
appFile := make([]string, 0)
|
|||
|
|
filePath := []string{
|
|||
|
|
"/var/containers/Bundle/Application/" + GenGUId(deviceId, GetCid(0x098521236654)) + "/WeChat.app/WeChat",
|
|||
|
|
"/var/containers/Bundle/Application/" + GenGUId(deviceId, GetCid(0x098521236654)) + "/WeChat.app/Frameworks/mars.framework/mars",
|
|||
|
|
"/var/containers/Bundle/Application/" + GenGUId(deviceId, GetCid(0x098521236654)) + "/WeChat.app/Frameworks/andromeda.framework/andromeda",
|
|||
|
|
"/var/containers/Bundle/Application/" + GenGUId(deviceId, GetCid(0x098521236654)) + "/WeChat.app/Frameworks/OpenSSL.framework/OpenSSL",
|
|||
|
|
"/var/containers/Bundle/Application/" + GenGUId(deviceId, GetCid(0x098521236654)) + "/WeChat.app/Frameworks/ProtobufLite.framework/ProtobufLite",
|
|||
|
|
"/var/containers/Bundle/Application/" + GenGUId(deviceId, GetCid(0x098521236654)) + "/WeChat.app/Frameworks/marsbridgenetwork.framework/marsbridgenetwork",
|
|||
|
|
"/var/containers/Bundle/Application/" + GenGUId(deviceId, GetCid(0x098521236654)) + "/WeChat.app/Frameworks/matrixreport.framework/matrixreport",
|
|||
|
|
}
|
|||
|
|
fileUUid := []string{
|
|||
|
|
"3A1D0388-6BDB-350C-8706-80E3D15AA7C7",
|
|||
|
|
"A7DA401B-3FF6-3920-A30A-1B0FA8258202",
|
|||
|
|
"10F1245A-68FD-310D-98B3-0CFD51760BDE",
|
|||
|
|
"8FAE149B-602B-3B9D-A620-88EA75CE153F",
|
|||
|
|
"05BD590C-4DF6-3EDB-8316-0C9783928DD0",
|
|||
|
|
"CFED9A03-C881-3D50-B014-732D0A09879F",
|
|||
|
|
"1E7F06D2-DD36-31A8-AF3B-00D62054E1F9",
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
for i := 0; i < 7; i++ {
|
|||
|
|
appFile = append(appFile, filePath[i])
|
|||
|
|
appFile = append(appFile, fileUUid[i])
|
|||
|
|
}
|
|||
|
|
appFileInfo.WriteString(strings.Join(appFile, ""))
|
|||
|
|
encInt := baseutils.EncInt(int64(crc32.ChecksumIEEE(appFileInfo.Bytes())))
|
|||
|
|
spamDataBody.Unknown60 = proto.String(fmt.Sprintf("%v", encInt))
|
|||
|
|
spamDataBody.Unknown64 = proto.String(XorEncrypt(deviceToken.GetTrustResponseData().GetDeviceToken(), xorKey))
|
|||
|
|
data, err := proto.Marshal(&spamDataBody)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
newClientCheckData := &wechat.NewClientCheckData{
|
|||
|
|
C32CData: proto.Int64(int64(crc32.ChecksumIEEE(data))),
|
|||
|
|
TimeStamp: proto.Int64(time.Now().Unix()),
|
|||
|
|
DataBody: data,
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ccData, err := proto.Marshal(newClientCheckData)
|
|||
|
|
if err != nil {
|
|||
|
|
return nil, err
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// afterCompressionCCData := baseutils.CompressByteArray(ccData)
|
|||
|
|
// afterEnData, err := ccdata.EncodeZipData(afterCompressionCCData, 0x3060)
|
|||
|
|
// if err != nil {
|
|||
|
|
// return nil, err
|
|||
|
|
// }
|
|||
|
|
//压缩数据
|
|||
|
|
compressdata := baseutils.AE(ccData)
|
|||
|
|
|
|||
|
|
// Zero: 03加密改07加密
|
|||
|
|
// zt := new(ZT)
|
|||
|
|
// zt.Init()
|
|||
|
|
// encData := zt.Encrypt(compressdata)
|
|||
|
|
afterEnData := android.SaeEncrypt07(compressdata)
|
|||
|
|
deviceRunningInfo := &wechat.DeviceRunningInfoNew{
|
|||
|
|
Version: []byte("00000007"),
|
|||
|
|
Type: proto.Uint32(1),
|
|||
|
|
EncryptData: afterEnData,
|
|||
|
|
Timestamp: proto.Uint32(uint32(dateTimeSramp)),
|
|||
|
|
Unknown5: proto.Uint32(5),
|
|||
|
|
Unknown6: proto.Uint32(0),
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(deviceRunningInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 获取FilePathCrc
|
|||
|
|
func GetFileInfo(deviceId string, xorKey byte, guid2 string) []*wechat.FileInfo {
|
|||
|
|
return []*wechat.FileInfo{
|
|||
|
|
{
|
|||
|
|
Filepath: proto.String(XorEncrypt("/var/containers/Bundle/Application/"+GenGUId(deviceId, GetCid(0x098521236654))+"/WeChat.app/WeChat", xorKey)),
|
|||
|
|
Fileuuid: proto.String(XorEncrypt("3A1D0388-6BDB-350C-8706-80E3D15AA7C7", xorKey)),
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
Filepath: proto.String(XorEncrypt("/var/containers/Bundle/Application/"+GenGUId(deviceId, GetCid(0x098521236654))+"/WeChat.app/Frameworks/mars.framework/mars", xorKey)),
|
|||
|
|
Fileuuid: proto.String(XorEncrypt("A7DA401B-3FF6-3920-A30A-1B0FA8258202", xorKey)),
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
Filepath: proto.String(XorEncrypt("/var/containers/Bundle/Application/"+GenGUId(deviceId, GetCid(0x098521236654))+"/WeChat.app/Frameworks/andromeda.framework/andromeda", xorKey)),
|
|||
|
|
Fileuuid: proto.String(XorEncrypt("10F1245A-68FD-310D-98B3-0CFD51760BDE", xorKey)),
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
Filepath: proto.String(XorEncrypt("/var/containers/Bundle/Application/"+GenGUId(deviceId, GetCid(0x098521236654))+"/WeChat.app/Frameworks/OpenSSL.framework/OpenSSL", xorKey)),
|
|||
|
|
Fileuuid: proto.String(XorEncrypt("8FAE149B-602B-3B9D-A620-88EA75CE153F", xorKey)),
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
Filepath: proto.String(XorEncrypt("/var/containers/Bundle/Application/"+GenGUId(deviceId, GetCid(0x098521236654))+"/WeChat.app/Frameworks/ProtobufLite.framework/ProtobufLite", xorKey)),
|
|||
|
|
Fileuuid: proto.String(XorEncrypt("05BD590C-4DF6-3EDB-8316-0C9783928DD0", xorKey)),
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
Filepath: proto.String(XorEncrypt("/var/containers/Bundle/Application/"+GenGUId(deviceId, GetCid(0x098521236654))+"/WeChat.app/Frameworks/marsbridgenetwork.framework/marsbridgenetwork", xorKey)),
|
|||
|
|
Fileuuid: proto.String(XorEncrypt("CFED9A03-C881-3D50-B014-732D0A09879F", xorKey)),
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
Filepath: proto.String(XorEncrypt("/var/containers/Bundle/Application/"+GenGUId(deviceId, GetCid(0x098521236654))+"/WeChat.app/Frameworks/matrixreport.framework/matrixreport", xorKey)),
|
|||
|
|
Fileuuid: proto.String(XorEncrypt("1E7F06D2-DD36-31A8-AF3B-00D62054E1F9", xorKey)),
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func DeviceNumber(DeviceId string) int64 {
|
|||
|
|
/*ssss := strings.ToLower(baseutils.Md5Value(DeviceId))
|
|||
|
|
ccc, _ := strconv.ParseInt(ssss, 16, 8)
|
|||
|
|
ddd := ccc + 60000000000000000
|
|||
|
|
if ddd > 80000000000000000 {
|
|||
|
|
ddd = ddd - (80000000000000000 - ddd)
|
|||
|
|
}
|
|||
|
|
return int64(ddd)*/
|
|||
|
|
ssss := []byte(baseutils.Md5Value(DeviceId))
|
|||
|
|
ccc := Hex2int(&ssss) >> 8
|
|||
|
|
ddd := ccc + 60000000000000000
|
|||
|
|
if ddd > 80000000000000000 {
|
|||
|
|
ddd = ddd - (80000000000000000 - ddd)
|
|||
|
|
}
|
|||
|
|
return int64(ddd)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func IOSDeviceNumber(DeviceId string) int64 {
|
|||
|
|
ssss := []byte(baseutils.MD5ToLower(DeviceId))
|
|||
|
|
ccc := Hex2int(&ssss) >> 8
|
|||
|
|
ddd := ccc + 60000000000000000
|
|||
|
|
if ddd > 80000000000000000 {
|
|||
|
|
ddd = ddd - (80000000000000000 - ddd)
|
|||
|
|
}
|
|||
|
|
return int64(ddd)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func Hex2int(hexB *[]byte) uint64 {
|
|||
|
|
var retInt uint64
|
|||
|
|
hexLen := len(*hexB)
|
|||
|
|
for k, v := range *hexB {
|
|||
|
|
retInt += b2m_map[v] * exponent(16, uint64(2*(hexLen-k-1)))
|
|||
|
|
}
|
|||
|
|
return retInt
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func exponent(a, n uint64) uint64 {
|
|||
|
|
result := uint64(1)
|
|||
|
|
for i := n; i > 0; i >>= 1 {
|
|||
|
|
if i&1 != 0 {
|
|||
|
|
result *= a
|
|||
|
|
}
|
|||
|
|
a *= a
|
|||
|
|
}
|
|||
|
|
return result
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func GenGUId(DeviceId, Cid string) string {
|
|||
|
|
Md5Data := baseutils.Md5Value(DeviceId + Cid)
|
|||
|
|
return fmt.Sprintf("%x-%x-%x-%x-%x", Md5Data[0:8], Md5Data[2:6], Md5Data[3:7], Md5Data[1:5], Md5Data[20:32])
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// IphoneWcstf
|
|||
|
|
func GetWcstf(userName string) ([]byte, error) {
|
|||
|
|
deviceRunningInfo := android.IphoneWcstf(userName)
|
|||
|
|
return proto.Marshal(deviceRunningInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func MakeXorKey(key int64) uint8 {
|
|||
|
|
var un int64 = int64(0xffffffed)
|
|||
|
|
xorKey := (uint8)(key*un + 7)
|
|||
|
|
return xorKey
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// /IphoneWcste
|
|||
|
|
func GetWcste() ([]byte, error) {
|
|||
|
|
deviceRunningInfo := android.IphoneWcste(0, 0)
|
|||
|
|
// deviceRunningInfo := android.IphoneWcste(384214787666497617, 384002236977512448)
|
|||
|
|
return proto.Marshal(deviceRunningInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 获取DeviceToken
|
|||
|
|
func GetDeviceToken(deviceToken string) *mmproto.DeviceToken {
|
|||
|
|
curtime := uint32(time.Now().Unix())
|
|||
|
|
return &mmproto.DeviceToken{
|
|||
|
|
Version: proto.String(""),
|
|||
|
|
Encrypted: proto.Uint32(1),
|
|||
|
|
Data: &mmproto.SKBuiltinStringt{
|
|||
|
|
String_: proto.String(deviceToken),
|
|||
|
|
},
|
|||
|
|
TimeStamp: &curtime,
|
|||
|
|
Optype: proto.Uint32(2),
|
|||
|
|
Uin: proto.Uint32(0),
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 获取dt的数据
|
|||
|
|
func GetZTData(DeviceId, DeviceType, OsVersion, DeviceName string, Version uint64) ([]byte, error) {
|
|||
|
|
uuid1, uuid2 := baseutils.IOSUuid(DeviceId)
|
|||
|
|
td := &wechat.TrustReq{
|
|||
|
|
Td: &wechat.TrustData{
|
|||
|
|
Tdi: []*wechat.TrustDeviceInfo{
|
|||
|
|
{Key: proto.String("deviceid"), Val: proto.String(DeviceId)},
|
|||
|
|
{Key: proto.String("sdi"), Val: proto.String(baseutils.IOSGetCidMd5(DeviceId, baseutils.IOSGetCid(0x0262626262626)))},
|
|||
|
|
{Key: proto.String("idfv"), Val: proto.String(uuid1)},
|
|||
|
|
{Key: proto.String("idfa"), Val: proto.String(uuid2)},
|
|||
|
|
{Key: proto.String("device_model"), Val: proto.String(DeviceType)},
|
|||
|
|
{Key: proto.String("os_version"), Val: proto.String(OsVersion)},
|
|||
|
|
{Key: proto.String("core_count"), Val: proto.String("6")},
|
|||
|
|
{Key: proto.String("carrier_name"), Val: proto.String("")},
|
|||
|
|
{Key: proto.String("is_jailbreak"), Val: proto.String("0")},
|
|||
|
|
{Key: proto.String("device_name"), Val: proto.String(DeviceName)},
|
|||
|
|
{Key: proto.String("client_version"), Val: proto.String(fmt.Sprintf("%v", Version))},
|
|||
|
|
{Key: proto.String("plist_version"), Val: proto.String(fmt.Sprintf("%v", Version))},
|
|||
|
|
{Key: proto.String("language"), Val: proto.String("zh")},
|
|||
|
|
{Key: proto.String("locale_country"), Val: proto.String("CN")},
|
|||
|
|
{Key: proto.String("screen_width"), Val: proto.String("834")},
|
|||
|
|
{Key: proto.String("screen_height"), Val: proto.String("1112")},
|
|||
|
|
{Key: proto.String("install_time"), Val: proto.String("1586355322")},
|
|||
|
|
{Key: proto.String("kern_boottime"), Val: proto.String("1586355519000")},
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
// 压缩
|
|||
|
|
pbReq, _ := proto.Marshal(td)
|
|||
|
|
zipData := baseutils.CompressByteArray(pbReq)
|
|||
|
|
// retData, err := ccdata.EncodeZipData(zipData, 0x3060)
|
|||
|
|
retData := android.SaeEncrypt07(zipData)
|
|||
|
|
//fmt.Println(hex.EncodeToString(pbReq))
|
|||
|
|
ztd := &wechat.ZTData{
|
|||
|
|
Data: retData,
|
|||
|
|
Version: []byte("00000007"),
|
|||
|
|
Encrypted: proto.Uint64(1),
|
|||
|
|
OpType: proto.Uint64(5),
|
|||
|
|
TimeStamp: proto.Int64(time.Now().Unix()),
|
|||
|
|
Uin: proto.Uint64(0),
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(ztd)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// / <summary>
|
|||
|
|
// / 获取UUid
|
|||
|
|
// / </summary>
|
|||
|
|
// / <param name="data"></param>
|
|||
|
|
// / <returns></returns>
|
|||
|
|
func GetUUID(data string) string {
|
|||
|
|
data = data[:8] + "-" + data[8:]
|
|||
|
|
data = data[:13] + "-" + data[13:]
|
|||
|
|
data = data[:18] + "-" + data[18:]
|
|||
|
|
data = data[:23] + "-" + data[23:]
|
|||
|
|
return data
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var wifiPrefix = []string{"TP_", "360_", "ChinaNet-", "MERCURY_", "DL-", "VF_", "HUAW-"}
|
|||
|
|
|
|||
|
|
func BuildRandomWifiSsid() string {
|
|||
|
|
s := rand.NewSource(time.Now().UnixNano())
|
|||
|
|
r := rand.New(s)
|
|||
|
|
i := r.Intn(len(wifiPrefix))
|
|||
|
|
randChar := make([]byte, 6)
|
|||
|
|
for x := 0; x < 6; x++ {
|
|||
|
|
randChar[x] = byte(r.Intn(26) + 65)
|
|||
|
|
}
|
|||
|
|
return wifiPrefix[i] + string(randChar)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// RqtKey 计算RQT用到到Key
|
|||
|
|
var RqtKey = []byte{0x6a, 0x66, 0x4d, 0x5d, 0x53, 0x7c, 0x25, 0x3f, 0x73, 0x6e, 0x48, 0x27, 0x3a, 0x29, 0x5e, 0x4f}
|
|||
|
|
|
|||
|
|
// SignRqtBufByAutoChosenKey 计算RQT值
|
|||
|
|
func SignRqtBufByAutoChosenKey(md5Value string) uint32 {
|
|||
|
|
// tmpRqtKeyOne
|
|||
|
|
rqtLen := len(RqtKey)
|
|||
|
|
totalLength := 48 + rqtLen
|
|||
|
|
blockOne := make([]byte, totalLength)
|
|||
|
|
for index := 0; index < totalLength; index++ {
|
|||
|
|
blockOne[index] = 0
|
|||
|
|
if index < rqtLen {
|
|||
|
|
blockOne[index] = RqtKey[index]
|
|||
|
|
}
|
|||
|
|
blockOne[index] = blockOne[index] ^ 0x36
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// tmpRqtKeyTwo
|
|||
|
|
blockTwo := make([]byte, totalLength)
|
|||
|
|
for index := 0; index < totalLength; index++ {
|
|||
|
|
blockTwo[index] = 0
|
|||
|
|
if index < rqtLen {
|
|||
|
|
blockTwo[index] = RqtKey[index]
|
|||
|
|
}
|
|||
|
|
blockTwo[index] = blockTwo[index] ^ 0x5c
|
|||
|
|
}
|
|||
|
|
// 计算Hash值
|
|||
|
|
tmpData := append(blockOne, []byte(md5Value)[0:]...)
|
|||
|
|
shaValue := baseutils.Sha1(tmpData)
|
|||
|
|
tmpData = append(blockTwo, shaValue[0:]...)
|
|||
|
|
shaValue = baseutils.Sha1(tmpData)
|
|||
|
|
|
|||
|
|
// 计算key1,key2, key3
|
|||
|
|
key1 := 0
|
|||
|
|
key2 := 0
|
|||
|
|
key3 := 0
|
|||
|
|
tmpLen := len(shaValue) - 2
|
|||
|
|
for index := 0; index < tmpLen; index++ {
|
|||
|
|
tmpValue1 := shaValue[index] & 0xff
|
|||
|
|
tmpValue2 := shaValue[index+1] & 0xff
|
|||
|
|
tmpValue3 := shaValue[index+2] & 0xff
|
|||
|
|
|
|||
|
|
key1 = key1*0x83 + int(tmpValue1)
|
|||
|
|
key2 = key2*0x83 + int(tmpValue2)
|
|||
|
|
key3 = key3*0x83 + int(tmpValue3)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 计算RQT值
|
|||
|
|
key1 = key1 & 0x7f
|
|||
|
|
key2 = (key2 << 8) & 0x7f00
|
|||
|
|
key3 = (key3 << 16) & 0x7f0000
|
|||
|
|
retValue := key1 | key3 | key2
|
|||
|
|
retValue = retValue | 0x21000000
|
|||
|
|
return uint32(retValue)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 新 rqtx 07算法 版本24算法的计算extinfo
|
|||
|
|
func GetNew07SpamData(iosVersion string, deviceType, uuid1, uuid2, deviceName string, deviceToken *wechat.TrustResp, deviceId, userName, guid2 string) ([]byte, error) {
|
|||
|
|
timeStamp := time.Now().Unix()
|
|||
|
|
afterEnData := GetiPhoneNewSpamData(iosVersion, uuid1, uuid2, deviceId, deviceName, deviceToken)
|
|||
|
|
deviceRunningInfo := &wechat.DeviceRunningInfoNew{
|
|||
|
|
EncryptData: afterEnData,
|
|||
|
|
Version: []byte("00000007"),
|
|||
|
|
Type: proto.Uint32(1),
|
|||
|
|
Timestamp: proto.Uint32(uint32(timeStamp)),
|
|||
|
|
Unknown5: proto.Uint32(5),
|
|||
|
|
Unknown6: proto.Uint32(0),
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(deviceRunningInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// iphone生成ccd, 使用07加密
|
|||
|
|
func GetiPhoneNewSpamData(iosVersion, uuid1, uuid2, Deviceid, DeviceName string, DeviceToken *wechat.TrustResp) []byte {
|
|||
|
|
timeStamp := int(time.Now().Unix())
|
|||
|
|
xorKey := uint8((timeStamp * 0xffffffed) + 7)
|
|||
|
|
|
|||
|
|
if len(Deviceid) < 32 {
|
|||
|
|
Dlen := 32 - len(Deviceid)
|
|||
|
|
Fill := "ff95DODUJ4EysYiogKZSmajWCUKUg9RX"
|
|||
|
|
Deviceid = Deviceid + Fill[:Dlen]
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
spamDataBody := &wechat.SpamDataIosBody{
|
|||
|
|
UnKnown1: proto.Int32(1),
|
|||
|
|
TimeStamp: proto.Uint32(uint32(timeStamp)),
|
|||
|
|
KeyHash: proto.Int32(int32(MakeKeyHash(xorKey))),
|
|||
|
|
Yes1: proto.String(XorEncodeStr("yes", xorKey)),
|
|||
|
|
Yes2: proto.String(XorEncodeStr("yes", xorKey)),
|
|||
|
|
IosVersion: proto.String(XorEncodeStr(baseinfo.IPadOsVersion, xorKey)),
|
|||
|
|
DeviceType: proto.String(XorEncodeStr("iPad", xorKey)),
|
|||
|
|
UnKnown2: proto.Int32(2),
|
|||
|
|
IdentifierForVendor: proto.String(XorEncodeStr(uuid1, xorKey)),
|
|||
|
|
AdvertisingIdentifier: proto.String(XorEncodeStr(uuid2, xorKey)),
|
|||
|
|
Carrier: proto.String(XorEncodeStr("中国移动", xorKey)),
|
|||
|
|
BatteryInfo: proto.Int32(1),
|
|||
|
|
NetworkName: proto.String(XorEncodeStr("en0", xorKey)),
|
|||
|
|
NetType: proto.Int32(1),
|
|||
|
|
AppBundleId: proto.String(XorEncodeStr("com.tencent.xin", xorKey)),
|
|||
|
|
DeviceName: proto.String(XorEncodeStr(DeviceName, xorKey)),
|
|||
|
|
UserName: proto.String(XorEncodeStr(baseinfo.IPhoneModel, xorKey)),
|
|||
|
|
Unknown3: proto.Int64(IOSDeviceNumber(Deviceid[:29] + "FFF")),
|
|||
|
|
Unknown4: proto.Int64(IOSDeviceNumber(Deviceid[:29] + "OOO")),
|
|||
|
|
Unknown5: proto.Int32(1),
|
|||
|
|
Unknown6: proto.Int32(4),
|
|||
|
|
Lang: proto.String(XorEncodeStr("zh", xorKey)),
|
|||
|
|
Country: proto.String(XorEncodeStr("CN", xorKey)),
|
|||
|
|
Unknown7: proto.Int32(4),
|
|||
|
|
DocumentDir: proto.String(XorEncodeStr("/var/mobile/Containers/Data/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x10101201))+"/Documents", xorKey)),
|
|||
|
|
Unknown8: proto.Int32(0),
|
|||
|
|
Unknown9: proto.Int32(0),
|
|||
|
|
HeadMD5: proto.String(XorEncodeStr(IOSGetCidMd5(Deviceid, IOSGetCid(0x0262626262626)), xorKey)),
|
|||
|
|
AppUUID: proto.String(XorEncodeStr(uuid1, xorKey)),
|
|||
|
|
SyslogUUID: proto.String(XorEncodeStr(uuid2, xorKey)),
|
|||
|
|
Unknown10: proto.String(""),
|
|||
|
|
Unknown11: proto.String(""),
|
|||
|
|
AppName: proto.String(XorEncodeStr("微信", xorKey)),
|
|||
|
|
SshPath: proto.String(""),
|
|||
|
|
TempTest: proto.String(""),
|
|||
|
|
DevMD5: proto.String(""),
|
|||
|
|
DevUser: proto.String(""),
|
|||
|
|
Unknown12: proto.String(""),
|
|||
|
|
IsModify: proto.Int32(0),
|
|||
|
|
ModifyMD5: proto.String(""),
|
|||
|
|
RqtHash: proto.Int64(288529533794259264),
|
|||
|
|
Unknown43: proto.Uint64(1586355322),
|
|||
|
|
Unknown44: proto.Uint64(1586355519000),
|
|||
|
|
Unknown45: proto.Uint64(0),
|
|||
|
|
Unknown46: proto.Uint64(288529533794259264),
|
|||
|
|
Unknown47: proto.Uint64(0),
|
|||
|
|
Unknown48: proto.String(Deviceid),
|
|||
|
|
Unknown49: proto.String(""),
|
|||
|
|
Unknown50: proto.String(""),
|
|||
|
|
Unknown51: proto.String(XorEncodeStr(DeviceToken.GetTrustResponseData().GetSoftData().GetSoftConfig(), xorKey)),
|
|||
|
|
Unknown52: proto.Uint64(0),
|
|||
|
|
Unknown53: proto.String(""),
|
|||
|
|
Unknown54: proto.String(XorEncodeStr(DeviceToken.GetTrustResponseData().GetDeviceToken(), xorKey)),
|
|||
|
|
}
|
|||
|
|
wxFile := &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x098521236654))+"/WeChat.app/WeChat", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr(IOSGetCidUUid(Deviceid, IOSGetCid(0x30000001)), xorKey)),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, wxFile)
|
|||
|
|
|
|||
|
|
opensslFile := &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x098521236654))+"/WeChat.app/Frameworks/OpenSSL.framework/OpenSSL", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr(IOSGetCidUUid(Deviceid, IOSGetCid(0x30000002)), xorKey)),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, opensslFile)
|
|||
|
|
|
|||
|
|
protoFile := &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x098521236654))+"/WeChat.app/Frameworks/ProtobufLite.framework/ProtobufLite", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr(IOSGetCidUUid(Deviceid, IOSGetCid(0x30000003)), xorKey)),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, protoFile)
|
|||
|
|
|
|||
|
|
marsbridgenetworkFile := &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x098521236654))+"/WeChat.app/Frameworks/marsbridgenetwork.framework/marsbridgenetwork", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr(IOSGetCidUUid(Deviceid, IOSGetCid(0x30000004)), xorKey)),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, marsbridgenetworkFile)
|
|||
|
|
|
|||
|
|
matrixreportFile := &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x098521236654))+"/WeChat.app/Frameworks/matrixreport.framework/matrixreport", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr(IOSGetCidUUid(Deviceid, IOSGetCid(0x30000005)), xorKey)),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, matrixreportFile)
|
|||
|
|
|
|||
|
|
andromedaFile := &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x098521236654))+"/WeChat.app/Frameworks/andromeda.framework/andromeda", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr(IOSGetCidUUid(Deviceid, IOSGetCid(0x30000006)), xorKey)),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, andromedaFile)
|
|||
|
|
|
|||
|
|
marsFile := &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/"+IOSGetCidUUid(Deviceid, IOSGetCid(0x098521236654))+"/WeChat.app/Frameworks/mars.framework/mars", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr(IOSGetCidUUid(Deviceid, IOSGetCid(0x30000007)), xorKey)),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, marsFile)
|
|||
|
|
srcdata, _ := proto.Marshal(spamDataBody)
|
|||
|
|
|
|||
|
|
newClientCheckData := &wechat.NewClientCheckData{
|
|||
|
|
C32CData: proto.Int64(int64(crc32.ChecksumIEEE([]byte(srcdata)))),
|
|||
|
|
TimeStamp: proto.Int64(int64(timeStamp)),
|
|||
|
|
DataBody: srcdata,
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ccddata, _ := proto.Marshal(newClientCheckData)
|
|||
|
|
|
|||
|
|
//压缩数据
|
|||
|
|
compressdata := baseutils.AE(ccddata)
|
|||
|
|
|
|||
|
|
// Zero: 03加密改07加密
|
|||
|
|
// zt := new(ZT)
|
|||
|
|
// zt.Init()
|
|||
|
|
// encData := zt.Encrypt(compressdata)
|
|||
|
|
encData := android.SaeEncrypt07(compressdata)
|
|||
|
|
|
|||
|
|
return encData
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func GetNewIPadSpamData(iosVersion string, deviceType, uuid1, uuid2, deviceName string, deviceToken *wechat.TrustResp, deviceId, userName, guid2 string) ([]byte, error) {
|
|||
|
|
timeStamp := time.Now().Unix()
|
|||
|
|
afterEnData := GetiPadNewSpamData(iosVersion, uuid1, uuid2, deviceId, deviceName, deviceToken)
|
|||
|
|
deviceRunningInfo := &wechat.DeviceRunningInfoNew{
|
|||
|
|
EncryptData: afterEnData,
|
|||
|
|
Version: []byte("00000007"),
|
|||
|
|
Type: proto.Uint32(1),
|
|||
|
|
Timestamp: proto.Uint32(uint32(timeStamp)),
|
|||
|
|
Unknown5: proto.Uint32(5),
|
|||
|
|
Unknown6: proto.Uint32(0),
|
|||
|
|
}
|
|||
|
|
return proto.Marshal(deviceRunningInfo)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ipad生成ccd, 使用03加密
|
|||
|
|
func GetiPadNewSpamData(iosVersion, uuid1, uuid2, Deviceid, DeviceName string, DeviceToken *wechat.TrustResp) []byte {
|
|||
|
|
T := uint32(time.Now().Unix())
|
|||
|
|
timeStamp := int(T)
|
|||
|
|
xorKey := uint8((timeStamp * 0xffffffed) + 7)
|
|||
|
|
|
|||
|
|
if len(Deviceid) < 32 {
|
|||
|
|
Dlen := 32 - len(Deviceid)
|
|||
|
|
Fill := "ff95DODUJ4EysYiogKZSmajWCUKUg9RX"
|
|||
|
|
Deviceid = Deviceid + Fill[:Dlen]
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
spamDataBody := &wechat.SpamDataIosBody{
|
|||
|
|
UnKnown1: proto.Int32(1),
|
|||
|
|
TimeStamp: proto.Uint32(uint32(timeStamp)),
|
|||
|
|
KeyHash: proto.Int32(int32(MakeKeyHash(xorKey))),
|
|||
|
|
Yes1: proto.String(XorEncodeStr("yes", xorKey)),
|
|||
|
|
Yes2: proto.String(XorEncodeStr("yes", xorKey)),
|
|||
|
|
IosVersion: proto.String(XorEncodeStr(baseinfo.IPadOsVersion, xorKey)),
|
|||
|
|
DeviceType: proto.String(XorEncodeStr("iPad", xorKey)),
|
|||
|
|
UnKnown2: proto.Int32(6),
|
|||
|
|
IdentifierForVendor: proto.String(XorEncodeStr(uuid1, xorKey)),
|
|||
|
|
AdvertisingIdentifier: proto.String(XorEncodeStr(uuid2, xorKey)),
|
|||
|
|
Carrier: proto.String(XorEncodeStr("中国移动", xorKey)),
|
|||
|
|
BatteryInfo: proto.Int32(1),
|
|||
|
|
NetworkName: proto.String(XorEncodeStr("en0", xorKey)),
|
|||
|
|
NetType: proto.Int32(0),
|
|||
|
|
AppBundleId: proto.String(XorEncodeStr("com.tencent.xin", xorKey)),
|
|||
|
|
DeviceName: proto.String(XorEncodeStr(DeviceName, xorKey)),
|
|||
|
|
UserName: proto.String(XorEncodeStr(baseinfo.IPadModel, xorKey)),
|
|||
|
|
Unknown3: proto.Int64(77968568554095637),
|
|||
|
|
Unknown4: proto.Int64(77968568554095617),
|
|||
|
|
Unknown5: proto.Int32(5),
|
|||
|
|
Unknown6: proto.Int32(4),
|
|||
|
|
Lang: proto.String(XorEncodeStr("zh", xorKey)),
|
|||
|
|
Country: proto.String(XorEncodeStr("CN", xorKey)),
|
|||
|
|
Unknown7: proto.Int32(4),
|
|||
|
|
DocumentDir: proto.String(XorEncodeStr("/var/mobile/Containers/Data/Application/94E41585-A27E-4933-AF06-5ABF7C774A6F/Documents", xorKey)),
|
|||
|
|
Unknown8: proto.Int32(0),
|
|||
|
|
Unknown9: proto.Int32(1),
|
|||
|
|
HeadMD5: proto.String(XorEncodeStr("901bf05e51e2cb5585760f7e0116d0ba", xorKey)),
|
|||
|
|
AppUUID: proto.String(XorEncodeStr(uuid1, xorKey)),
|
|||
|
|
SyslogUUID: proto.String(""),
|
|||
|
|
Unknown10: proto.String(""),
|
|||
|
|
Unknown11: proto.String(""),
|
|||
|
|
AppName: proto.String(XorEncodeStr("微信", xorKey)),
|
|||
|
|
SshPath: proto.String(""),
|
|||
|
|
TempTest: proto.String(""),
|
|||
|
|
DevMD5: proto.String(""),
|
|||
|
|
DevUser: proto.String(""),
|
|||
|
|
Unknown12: proto.String(""),
|
|||
|
|
IsModify: proto.Int32(0),
|
|||
|
|
ModifyMD5: proto.String(""),
|
|||
|
|
RqtHash: proto.Int64(288530629010980929),
|
|||
|
|
Unknown43: proto.Uint64(1586355322),
|
|||
|
|
Unknown44: proto.Uint64(1586355519000),
|
|||
|
|
Unknown45: proto.Uint64(0),
|
|||
|
|
Unknown46: proto.Uint64(288530629010980929),
|
|||
|
|
Unknown47: proto.Uint64(1),
|
|||
|
|
Unknown48: proto.String(XorEncodeStr(Deviceid, xorKey)),
|
|||
|
|
Unknown49: proto.String(""),
|
|||
|
|
Unknown50: proto.String(""),
|
|||
|
|
Unknown51: proto.String(XorEncodeStr(DeviceToken.GetTrustResponseData().GetSoftData().GetSoftConfig(), xorKey)),
|
|||
|
|
Unknown52: proto.Uint64(0),
|
|||
|
|
Unknown53: proto.String(""),
|
|||
|
|
Unknown54: proto.String(XorEncodeStr(DeviceToken.GetTrustResponseData().GetDeviceToken(), xorKey)),
|
|||
|
|
AppFileInfo: make([]*wechat.FileInfo, 0),
|
|||
|
|
}
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/WeChat", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("7195B97E-9078-3119-9110-8BDA959283F0", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/Library/MobileSubstrate/MobileSubstrate.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("3134CFB2-F722-310E-A2C7-42AE4DC131AB", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/mars.framework/mars", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("A87DAD8E-E356-3E1E-9925-D63EA1614A95", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/andromeda.framework/andromeda", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("EB5B920E-3AE6-3534-9DA4-C32DF72E33BD", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/OpenSSL.framework/OpenSSL", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("8FAE149B-602B-3B9D-A620-88EA75CE153F", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/ProtobufLite.framework/ProtobufLite", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("6F0D3077-4301-3D8F-8579-E34902547580", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/marsbridgenetwork.framework/marsbridgenetwork", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("CFED9A03-C881-3D50-B014-732D0A09879F", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/matrixreport.framework/matrixreport", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("1E7F06D2-DD36-31A8-AF3B-00D62054E1F9", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/libswiftCore.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("AD0CAD3B-1B51-3327-8644-8BE1FF1F0AE9", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/libswiftDispatch.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("9FCBA8ED-D8FD-3C16-9740-5E2A31F3E959", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/libswiftFoundation.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("9702769F-1F06-3001-AB75-5AD38E1F7D66", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/libswiftObjectiveC.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("1180AC10-0A92-39DB-8497-2B6D4217B8EB", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/libswiftDarwin.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("999C2967-8A06-3CD5-82D7-D156E9440A0C", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/libswiftCoreGraphics.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("DC548EF9-00F9-3A15-B5DB-05E39D9B5C5B", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/private/var/containers/Bundle/Application/2F493AE2-C0EB-4B4E-A86C-CE9BA3C0FA14/WeChat.app/Frameworks/libswiftCoreFoundation.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("25114AE1-4AE9-3DBC-B3DE-7F9F9A5B45D2", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
spamDataBody.AppFileInfo = append(spamDataBody.AppFileInfo, &wechat.FileInfo{
|
|||
|
|
Fileuuid: proto.String(XorEncodeStr("/Library/Frameworks/CydiaSubstrate.framework/Libraries/SubstrateLoader.dylib", xorKey)),
|
|||
|
|
Filepath: proto.String(XorEncodeStr("54645DC0-3212-31D8-8A02-2FD67A793278", xorKey)),
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
srcdata, _ := proto.Marshal(spamDataBody)
|
|||
|
|
|
|||
|
|
newClientCheckData := &wechat.NewClientCheckData{
|
|||
|
|
C32CData: proto.Int64(int64(crc32.ChecksumIEEE([]byte(srcdata)))),
|
|||
|
|
TimeStamp: proto.Int64(time.Now().Unix()),
|
|||
|
|
DataBody: srcdata,
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ccddata, _ := proto.Marshal(newClientCheckData)
|
|||
|
|
|
|||
|
|
//压缩数据
|
|||
|
|
compressdata := baseutils.AE(ccddata)
|
|||
|
|
|
|||
|
|
// Zero: 03加密改07加密
|
|||
|
|
// zt := new(ZT)
|
|||
|
|
// zt.Init()
|
|||
|
|
// encData := zt.Encrypt(compressdata)
|
|||
|
|
afterEnData := android.SaeEncrypt07(compressdata)
|
|||
|
|
|
|||
|
|
// afterCompressionCCData := baseutils.CompressByteArray(ccddata)
|
|||
|
|
// afterEnData, _ := ccdata.EncodeZipData(afterCompressionCCData, 0x3060)
|
|||
|
|
return afterEnData
|
|||
|
|
}
|