Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "crypto/md5"
- "encoding/hex"
- "fmt"
- "strconv"
- "time"
- )
- var (
- HEX_KEY = []int64{0xDF, 0x77, 0xB9, 0x40, 0xb9, 0x9b, 0x84, 0x83, 0xd1, 0xb9, 0xcb, 0xd1, 0xf7, 0xc2, 0xb9, 0x85, 0xc3, 0xd0, 0xfb, 0xc3}
- )
- func generateMD5(str string) string {
- var hash [16]byte = md5.Sum([]byte(str))
- return hex.EncodeToString(hash[:])
- }
- func hexString(n int64) string {
- var HEX = strconv.FormatInt(n, 16)
- if len(HEX) < 2 {
- HEX = "0" + HEX
- }
- return HEX
- }
- func RBIT(num int64) int64 {
- var binData string
- var bin = fmt.Sprintf("%b", num)
- for len(bin) < 8 {
- bin = "0" + bin
- }
- for i := 0; i < 8; i++ {
- binData += string(bin[7-i])
- }
- var data, _ = strconv.ParseInt(binData, 2, 64)
- return data
- }
- func reverseString(n int64) int64 {
- var hexStr string = hexString(n)
- var hexInt, _ = strconv.ParseInt(hexStr[1:]+hexStr[:1], 16, 64)
- return hexInt
- }
- func gethashstring(params string, data, cookies string) (string, int64) {
- // fmt.Println(len(data))
- if len(data) == 0 {
- data = "00000000000000000000000000000000"
- } else {
- data = generateMD5(data)
- }
- if len(cookies) == 0 {
- cookies = "00000000000000000000000000000000"
- } else {
- cookies = generateMD5(data)
- }
- MD5 := generateMD5(params) + data + cookies
- var HEX []int64
- var EOR []int64
- var xGorgon string
- xKhronos := time.Now().Unix()
- for i := 0; i < 12; i += 4 {
- for x := 0; x < 4; x++ {
- var H, _ = strconv.ParseInt(
- MD5[8*i : 8*(i+1)][x*2:(x+1)*2], 16, 64,
- )
- HEX = append(HEX, H)
- }
- }
- HEX = append(HEX, 0x0, 0x6, 0xB, 0x1C, (xKhronos&0xFF000000)>>24, (xKhronos&0x00FF0000)>>16, (xKhronos&0x0000FF00)>>8, (xKhronos&0x000000FF)>>0)
- for i := range HEX_KEY {
- EOR = append(EOR, HEX[i]^HEX_KEY[i])
- }
- for i := 0; i < 0x14; i++ {
- EOR[i] = ((RBIT(reverseString(EOR[i])^EOR[(i+1)%0x14]) ^ 0xFFFFFFFF) ^ 0x14) & 0xFF
- }
- for _, value := range EOR {
- xGorgon += hexString(value)
- }
- return "0404b0d30000" + xGorgon, xKhronos
- }
- // func generateSignature(params string) (string, int64) {
- // var MD5 string = generateMD5(params) + strings.Repeat("00000000000000000000000000000000", 3)
- // var HEX []int64
- // var EOR []int64
- // var xGorgon string
- // var xKhronos int64 = time.Now().Unix()
- // for i := 0; i < 12; i += 4 {
- // for x := 0; x < 4; x++ {
- // var H, _ = strconv.ParseInt(MD5[8*i : 8*(i+1)][x*2:(x+1)*2], 16, 64)
- // HEX = append(HEX, H)
- // }
- // }
- // HEX = append(HEX, 0x0, 0x6, 0xB, 0x1C, (xKhronos&0xFF000000)>>24, (xKhronos&0x00FF0000)>>16, (xKhronos&0x0000FF00)>>8, (xKhronos&0x000000FF)>>0)
- // for i := range HEX_KEY {
- // EOR = append(EOR, HEX[i]^HEX_KEY[i])
- // }
- // for i := 0; i < 0x14; i++ {
- // EOR[i] = ((RBIT(reverseString(EOR[i])^EOR[(i+1)%0x14]) ^ 0xFFFFFFFF) ^ 0x14) & 0xFF
- // }
- // for _, value := range EOR {
- // xGorgon += hexString(value)
- // }
- // return "0408b0d30000" + xGorgon, xKhronos
- // }
- func main() {
- // var xgorgon, xKhronos = generateSignature("id=xxx&address_book_access=2&from=0&user_avatar_shrink=188_188&user_cover_shrink=750_422&os_api=25&device_type=SM-G973N&ssmix=a&manifest_version_code=2021901030&dpi=320&carrier_region=IE&uoo=0®ion=US&carrier_region_v2=310&app_name=musical_ly&version_name=19.1.3&timezone_offset=7200&ts=1658273727&ab_version=19.1.3&residence=IE&cpu_support64=false¤t_region=US&ac2=wifi&ac=wifi&app_type=normal&host_abi=armeabi-v7a&channel=googleplay&update_version_code=2021901030&_rticket=1658267489496&device_platform=android&iid=7121866431746524933&build_number=19.1.3&locale=en&op_region=IE&version_code=190103&timezone_name=Africa%2FHarare&cdid=09caa359-46d5-493c-80c9-ee59809471f0&openudid=0e96eaebc0c2e44f&sys_region=US&device_id=6888243656290108930&app_language=en&resolution=900%2A1600&device_brand=samsung&language=en&os_version=7.1.2&aid=1233&mcc_mnc=310023")
- // fmt.Println(xgorgon, xKhronos)
- fmt.Println(gethashstring("", "x", "x"))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement