Golang羊了个羊直接根据UID通关
本帖最后由 若无zz 于 2022-9-19 17:14 编辑2022年9月19日17:13:11 亲测可用
package main
import (
"encoding/json"
"fmt"
"github.com/go-resty/resty/v2"
rand2 "math/rand"
)
type UserInfo struct {
ErrCode int `json:"err_code"`
UserInfoData *UserInfoData `json:"data"`
}
type UserInfoData struct {
WxOpenId string `json:"wx_open_id"`
Token string `json:"token"`
Uid int `json:"uid"`
}
func main() {
fmt.Println("刷通关次数程序")
start:
var scanUid string
fmt.Print("输入UID: ")
scan, err4 := fmt.Scanln(&scanUid)
if err4 != nil && scan != 1 {
fmt.Println("输入错误")
goto start
}
client := resty.New()
request := client.R().SetHeader("t", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQ0MDU0MjMsIm5iZiI6MTY2MzMwMzIyMywiaWF0IjoxNjYzMzAxNDIzLCJqdGkiOiJDTTpjYXRfbWF0Y2g6bHQxMjM0NTYiLCJvcGVuX2lkIjoiIiwidWlkIjoxMDg0MzMxMjgsImRlYnVnIjoiIiwibGFuZyI6IiJ9.oT1OY9XokZmHt1Hzifc8ILF1U-xQxY-itXNaeLj02R8")
getUserInfoInfo := "https://cat-match.easygame2021.com/sheep/v1/game/user_info?uid=" + scanUid
userInfo, err0 := request.Get(getUserInfoInfo)
if err0 != nil {
fmt.Println(err0.Error())
goto start
}
fmt.Println(userInfo)
obj1 := UserInfo{}
err := json.Unmarshal(userInfo.Body(), &obj1)
if err != nil {
fmt.Println(err)
goto start
}
if obj1.ErrCode != 0 {
goto start
}
fmt.Println(obj1.UserInfoData.WxOpenId)
tokenRes, _ := request.Post("https://cat-match.easygame2021.com/sheep/v1/user/login_oppo?uid=" + obj1.UserInfoData.WxOpenId + "&nick_name=" + string(rune(rand2.Intn(50000000))) + "&avatar=https://www.baidu.com/favicon.ico&sex=1")
obj2 := UserInfo{}
err2 := json.Unmarshal(tokenRes.Body(), &obj2)
if err2 != nil {
fmt.Println(err2)
goto start
}
if obj2.ErrCode != 0 {
goto start
}
token := obj2.UserInfoData.Token
fmt.Println(token)
fmt.Println(obj2.UserInfoData.Uid)
gameOver := "https://cat-match.easygame2021.com/sheep/v1/game/game_over?rank_score=10086&rank_state=1&rank_time=3599&rank_role=1&skin=1"
newClient := resty.New().R().SetHeader("t", token).SetHeader("User-Agent", "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) ").EnableTrace()
overRes, err3 := newClient.Get(gameOver)
if err3 != nil {
fmt.Println(err3)
goto start
}
fmt.Println(overRes.Status())
fmt.Println("通关了,内蒙古工业大学627到此一游")
goto start
}
{"err_code":0,"err_msg":"","data":{"id":"63228d941cce6f97a18445af","created_at":"2022-09-15T02:27:32.538Z","updated_at":"2022-09-15T02:27:32.538Z","role":2,"uid":67649905,"gender":0,"nick_name":"","avatar":"","wx_open_id":"oOYg25B77tbWJGqDZOPdTkzHWrUc","wx_union_id":"oNvyk5lLCBVMKBngfjaScNV2S4dI","last_login_time":null,"last_logout_time":null,"charge_first_time":0,"charge_last_time":0,"charge_total":0,"charge_times":0}}
oOYg25B77tbWJGqDZOPdTkzHWrUc
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQ3MDE3NDIsIm5iZiI6MTY2MzU5OTU0MiwiaWF0IjoxNjYzNTk3NzQyLCJqdGkiOiJDTTpjYXRfbWF0Y2g6bHQxMjM0NTYiLCJvcGVuX2lkIjoiIiwidWlkIjo2NzY0OTkwNSwiZGVidWciOiIiLCJsYW5nIjoiIn0.kfGj-06JDHT0cMQnf3aqWyPQNP8th1yb-QHn9pVS5fA
67649905
200 OK mr_leechar 发表于 2022-9-19 16:47
不行提示{"err_code":10007,"err_msg":"用户不存在","data":null}
那就是ID输入错误了,确认下 再试试 这个可以吗?今天全和谐了 提示用户不存在 52CEO 发表于 2022-9-19 16:41
这个可以吗?今天全和谐了
真假的?我刚跟人装完 binibn 发表于 2022-9-19 16:43
真假的?我刚跟人装完
作者该接口了 用户不存在 用户不存在 不行提示{"err_code":10007,"err_msg":"用户不存在","data":null} {"err_code":10007,"err_msg":"用户不存在","data":null} 用户不存在