Advertisement
xtekky_

Untitled

Jul 22nd, 2022
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "crypto/md5"
  5. "encoding/hex"
  6. "fmt"
  7. "strconv"
  8. "time"
  9. )
  10.  
  11. var (
  12. HEX_KEY = []int64{0xDF, 0x77, 0xB9, 0x40, 0xb9, 0x9b, 0x84, 0x83, 0xd1, 0xb9, 0xcb, 0xd1, 0xf7, 0xc2, 0xb9, 0x85, 0xc3, 0xd0, 0xfb, 0xc3}
  13. )
  14.  
  15. func generateMD5(str string) string {
  16. var hash [16]byte = md5.Sum([]byte(str))
  17. return hex.EncodeToString(hash[:])
  18. }
  19.  
  20. func hexString(n int64) string {
  21. var HEX = strconv.FormatInt(n, 16)
  22. if len(HEX) < 2 {
  23. HEX = "0" + HEX
  24. }
  25. return HEX
  26. }
  27.  
  28. func RBIT(num int64) int64 {
  29. var binData string
  30. var bin = fmt.Sprintf("%b", num)
  31.  
  32. for len(bin) < 8 {
  33. bin = "0" + bin
  34. }
  35. for i := 0; i < 8; i++ {
  36. binData += string(bin[7-i])
  37. }
  38. var data, _ = strconv.ParseInt(binData, 2, 64)
  39. return data
  40. }
  41.  
  42. func reverseString(n int64) int64 {
  43. var hexStr string = hexString(n)
  44. var hexInt, _ = strconv.ParseInt(hexStr[1:]+hexStr[:1], 16, 64)
  45. return hexInt
  46. }
  47.  
  48. func gethashstring(params string, data, cookies string) (string, int64) {
  49. // fmt.Println(len(data))
  50.  
  51. if len(data) == 0 {
  52. data = "00000000000000000000000000000000"
  53. } else {
  54. data = generateMD5(data)
  55. }
  56.  
  57. if len(cookies) == 0 {
  58. cookies = "00000000000000000000000000000000"
  59. } else {
  60. cookies = generateMD5(data)
  61. }
  62.  
  63. MD5 := generateMD5(params) + data + cookies
  64.  
  65. var HEX []int64
  66. var EOR []int64
  67.  
  68. var xGorgon string
  69. xKhronos := time.Now().Unix()
  70.  
  71. for i := 0; i < 12; i += 4 {
  72. for x := 0; x < 4; x++ {
  73. var H, _ = strconv.ParseInt(
  74. MD5[8*i : 8*(i+1)][x*2:(x+1)*2], 16, 64,
  75. )
  76. HEX = append(HEX, H)
  77. }
  78. }
  79. HEX = append(HEX, 0x0, 0x6, 0xB, 0x1C, (xKhronos&0xFF000000)>>24, (xKhronos&0x00FF0000)>>16, (xKhronos&0x0000FF00)>>8, (xKhronos&0x000000FF)>>0)
  80.  
  81. for i := range HEX_KEY {
  82. EOR = append(EOR, HEX[i]^HEX_KEY[i])
  83. }
  84. for i := 0; i < 0x14; i++ {
  85. EOR[i] = ((RBIT(reverseString(EOR[i])^EOR[(i+1)%0x14]) ^ 0xFFFFFFFF) ^ 0x14) & 0xFF
  86. }
  87. for _, value := range EOR {
  88. xGorgon += hexString(value)
  89. }
  90. return "0404b0d30000" + xGorgon, xKhronos
  91.  
  92. }
  93.  
  94. // func generateSignature(params string) (string, int64) {
  95. // var MD5 string = generateMD5(params) + strings.Repeat("00000000000000000000000000000000", 3)
  96. // var HEX []int64
  97. // var EOR []int64
  98.  
  99. // var xGorgon string
  100. // var xKhronos int64 = time.Now().Unix()
  101.  
  102. // for i := 0; i < 12; i += 4 {
  103. // for x := 0; x < 4; x++ {
  104. // var H, _ = strconv.ParseInt(MD5[8*i : 8*(i+1)][x*2:(x+1)*2], 16, 64)
  105. // HEX = append(HEX, H)
  106. // }
  107. // }
  108. // HEX = append(HEX, 0x0, 0x6, 0xB, 0x1C, (xKhronos&0xFF000000)>>24, (xKhronos&0x00FF0000)>>16, (xKhronos&0x0000FF00)>>8, (xKhronos&0x000000FF)>>0)
  109.  
  110. // for i := range HEX_KEY {
  111. // EOR = append(EOR, HEX[i]^HEX_KEY[i])
  112. // }
  113. // for i := 0; i < 0x14; i++ {
  114. // EOR[i] = ((RBIT(reverseString(EOR[i])^EOR[(i+1)%0x14]) ^ 0xFFFFFFFF) ^ 0x14) & 0xFF
  115. // }
  116. // for _, value := range EOR {
  117. // xGorgon += hexString(value)
  118. // }
  119. // return "0408b0d30000" + xGorgon, xKhronos
  120. // }
  121.  
  122. func main() {
  123. // 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&region=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&current_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")
  124. // fmt.Println(xgorgon, xKhronos)
  125.  
  126. fmt.Println(gethashstring("", "x", "x"))
  127.  
  128. }
  129.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement