diff --git a/WeChatFerry/spy/exec_sql.cpp b/WeChatFerry/spy/exec_sql.cpp index 5ba9457..3c8e369 100644 --- a/WeChatFerry/spy/exec_sql.cpp +++ b/WeChatFerry/spy/exec_sql.cpp @@ -4,6 +4,7 @@ #include "exec_sql.h" #include "fill_response.h" #include "log.hpp" +#include "pb_util.h" #include "sqlite3.h" #include "util.h" diff --git a/WeChatFerry/spy/exec_sql.h b/WeChatFerry/spy/exec_sql.h index 538f06e..411c338 100644 --- a/WeChatFerry/spy/exec_sql.h +++ b/WeChatFerry/spy/exec_sql.h @@ -19,7 +19,7 @@ DbTables_t get_db_tables(const std::string &db); DbRows_t exec_db_query(const std::string &db, const std::string &sql); // 获取本地消息 ID 和数据库索引 -std::optional> get_local_id_and_dbidx(uint64_t id); +int get_local_id_and_dbidx(uint64_t id, uint64_t *local_id, uint32_t *db_idx); // 获取音频数据 std::vector get_audio_data(uint64_t msg_id); diff --git a/WeChatFerry/spy/funcs.cpp b/WeChatFerry/spy/funcs.cpp index 56b1b8c..0ec2959 100644 --- a/WeChatFerry/spy/funcs.cpp +++ b/WeChatFerry/spy/funcs.cpp @@ -202,7 +202,7 @@ int DownloadAttach(QWORD id, string thumb, string extra) return 0; } - if (GetLocalIdandDbidx(id, &localId, &dbIdx) != 0) { + if (exec_sql::get_local_id_and_dbidx(id, &localId, &dbIdx) != 0) { LOG_ERROR("Failed to get localId, Please check id: {}", to_string(id)); return status; } @@ -285,7 +285,7 @@ string GetAudio(QWORD id, string dir) return mp3path; } - vector silk = GetAudioData(id); + vector silk = exec_sql::get_audio_data(id); if (silk.size() == 0) { LOG_ERROR("Empty audio data."); return ""; @@ -305,7 +305,7 @@ string GetPCMAudio(uint64_t id, string dir, int32_t sr) return pcmpath; } vector pcm; - vector silk = GetAudioData(id); + vector silk = exec_sql::get_audio_data(id); if (silk.size() == 0) { LOG_ERROR("Empty audio data."); return "";