diff --git a/rpc/pb_types.h b/rpc/pb_types.h new file mode 100644 index 0000000..97ebe58 --- /dev/null +++ b/rpc/pb_types.h @@ -0,0 +1,6 @@ +#pragma once + +#include +#include + +typedef std::map MsgTypes_t; \ No newline at end of file diff --git a/rpc/pb_util.cpp b/rpc/pb_util.cpp index c57ad23..0ec3607 100644 --- a/rpc/pb_util.cpp +++ b/rpc/pb_util.cpp @@ -1,14 +1,11 @@ -#include - +#include "pb_util.h" #include "log.h" -#include "pb_util.h" +#include "pb_types.h" #include "wcf.pb.h" #define BUF_SIZE (1024 * 1024) static char buf[BUF_SIZE] = { 0 }; -typedef std::map MsgTypes_t; - void log_buffer(uint8_t *buffer, size_t len) { size_t j = sprintf_s(buf, BUF_SIZE, "Encoded message[%ld]: ", len); diff --git a/spy/receive_msg.cpp b/spy/receive_msg.cpp index 6163c88..1a06cfc 100644 --- a/spy/receive_msg.cpp +++ b/spy/receive_msg.cpp @@ -4,24 +4,24 @@ MsgTypes_t GetMsgTypes() { - const std::map m = { { 0x01, "文字" }, - { 0x03, "图片" }, - { 0x22, "语音" }, - { 0x25, "好友确认" }, - { 0x28, "POSSIBLEFRIEND_MSG" }, - { 0x2A, "名片" }, - { 0x2B, "视频" }, - { 0x2F, "石头剪刀布 | 表情图片" }, - { 0x30, "位置" }, - { 0x31, "共享实时位置、文件、转账、链接" }, - { 0x32, "VOIPMSG" }, - { 0x33, "微信初始化" }, - { 0x34, "VOIPNOTIFY" }, - { 0x35, "VOIPINVITE" }, - { 0x3E, "小视频" }, - { 0x270F, "SYSNOTICE" }, - { 0x2710, "红包、系统消息" }, - { 0x2712, "撤回消息" } }; + const MsgTypes_t m = { { 0x01, "文字" }, + { 0x03, "图片" }, + { 0x22, "语音" }, + { 0x25, "好友确认" }, + { 0x28, "POSSIBLEFRIEND_MSG" }, + { 0x2A, "名片" }, + { 0x2B, "视频" }, + { 0x2F, "石头剪刀布 | 表情图片" }, + { 0x30, "位置" }, + { 0x31, "共享实时位置、文件、转账、链接" }, + { 0x32, "VOIPMSG" }, + { 0x33, "微信初始化" }, + { 0x34, "VOIPNOTIFY" }, + { 0x35, "VOIPINVITE" }, + { 0x3E, "小视频" }, + { 0x270F, "SYSNOTICE" }, + { 0x2710, "红包、系统消息" }, + { 0x2712, "撤回消息" } }; return m; } diff --git a/spy/receive_msg.h b/spy/receive_msg.h index 24294d9..84bd2b5 100644 --- a/spy/receive_msg.h +++ b/spy/receive_msg.h @@ -1,7 +1,6 @@ #pragma once -#include -#include +#include "pb_types.h" typedef std::map MsgTypes_t;