mirror of
https://github.com/yincongcyincong/wechat_chatter.git
synced 2026-07-15 10:26:52 +08:00
finished
This commit is contained in:
+5
-5
@@ -32,7 +32,7 @@ var (
|
||||
fridaScript *frida.Script
|
||||
session *frida.Session
|
||||
taskId = int64(0x20000000)
|
||||
myWechatId = ""
|
||||
myWechatId = "wxid_ldftuhe36izg19"
|
||||
|
||||
msgChan = make(chan *SendMsg, 10)
|
||||
finishChan = make(chan struct{})
|
||||
@@ -192,9 +192,6 @@ func loadJs() {
|
||||
if t.(string) == "send" {
|
||||
go SendHttpReq(msg)
|
||||
} else if t.(string) == "finish" {
|
||||
if selfId, ok := pMap["self_id"]; ok {
|
||||
myWechatId = selfId.(string)
|
||||
}
|
||||
finishChan <- struct{}{}
|
||||
}
|
||||
}
|
||||
@@ -280,6 +277,7 @@ func SendWorker() {
|
||||
}
|
||||
|
||||
func SendWechatMsg(m *SendMsg) {
|
||||
time.Sleep(1 * time.Second)
|
||||
currTaskId := atomic.AddInt64(&taskId, 1)
|
||||
log.Printf("📩 收到任务: %d\n", currTaskId)
|
||||
|
||||
@@ -424,6 +422,8 @@ func SaveBase64Image(base64Data string) (string, string, error) {
|
||||
if err != nil {
|
||||
return "", "", fmt.Errorf("base64 decode failed: %v", err)
|
||||
}
|
||||
salt := []byte(fmt.Sprintf("\n#md5_salt_%d_%d#", time.Now().UnixNano(), rand.Intn(10000)))
|
||||
data = append(data, salt...)
|
||||
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
randomNumber := r.Intn(1000) // 生成 0-999 的随机数
|
||||
@@ -469,7 +469,7 @@ func DetectImageFormat(data []byte) string {
|
||||
|
||||
switch {
|
||||
case bytes.HasPrefix(data, []byte{0xFF, 0xD8, 0xFF}):
|
||||
return "jpeg"
|
||||
return "jpg"
|
||||
case bytes.HasPrefix(data, []byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}):
|
||||
return "png"
|
||||
case bytes.HasPrefix(data, []byte("GIF87a")) || bytes.HasPrefix(data, []byte("GIF89a")):
|
||||
|
||||
+1
-1
@@ -710,7 +710,7 @@ function attachProto() {
|
||||
.concat([0x5F, 0x31, 0x36, 0x30, 0x5F, 0x78, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x5F, 0x33]);
|
||||
|
||||
// 0xb0, 0x02 是长度,需要看一下什么的长度
|
||||
const msgIdHeader = [0xb0, 0x02, 0x12, 0x2E, 0x0A, 0x2C]
|
||||
const msgIdHeader = [0xb0, 0x02, 0x12, receiverMsgId.length + 2, 0x0A, receiverMsgId.length]
|
||||
|
||||
const senderHeader = [0x1A, senderGlobal.length + 2, 0x0A, senderGlobal.length];
|
||||
// wxid_xxxx 或者 chatroom
|
||||
|
||||
Reference in New Issue
Block a user