Rename files

This commit is contained in:
Changhua 2023-06-20 08:10:24 +08:00
parent e0f8edb647
commit a77e2513ce
7 changed files with 69 additions and 89 deletions

View File

@ -226,12 +226,11 @@ $(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto</Command>
<ClInclude Include="..\rpc\pb_types.h" />
<ClInclude Include="..\rpc\pb_util.h" />
<ClInclude Include="..\rpc\proto\wcf.pb.h" />
<ClInclude Include="accept_new_friend.h" />
<ClInclude Include="chatroom_mgmt.h" />
<ClInclude Include="decrypt_image.h" />
<ClInclude Include="exec_sql.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="get_contacts.h" />
<ClInclude Include="contact_mgmt.h" />
<ClInclude Include="load_calls.h" />
<ClInclude Include="log.h" />
<ClInclude Include="receive_msg.h" />
@ -251,12 +250,11 @@ $(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto</Command>
<ClCompile Include="..\rpc\nanopb\pb_encode.c" />
<ClCompile Include="..\rpc\pb_util.cpp" />
<ClCompile Include="..\rpc\proto\wcf.pb.c" />
<ClCompile Include="accept_new_friend.cpp" />
<ClCompile Include="chatroom_mgmt.cpp" />
<ClCompile Include="decrypt_image.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="exec_sql.cpp" />
<ClCompile Include="get_contacts.cpp" />
<ClCompile Include="contact_mgmt.cpp" />
<ClCompile Include="load_calls.cpp" />
<ClCompile Include="log.cpp" />
<ClCompile Include="receive_msg.cpp" />

View File

@ -27,13 +27,10 @@
<ClInclude Include="log.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="accept_new_friend.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="exec_sql.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="get_contacts.h">
<ClInclude Include="contact_mgmt.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="load_calls.h">
@ -104,13 +101,10 @@
<ClCompile Include="log.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="accept_new_friend.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="exec_sql.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="get_contacts.cpp">
<ClCompile Include="contact_mgmt.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="load_calls.cpp">

View File

@ -1,67 +0,0 @@
#include "framework.h"
#include "accept_new_friend.h"
#include "load_calls.h"
#include "log.h"
#include "util.h"
extern WxCalls_t g_WxCalls;
extern DWORD g_WeChatWinDllAddr;
int AcceptNewFriend(std::string v3, std::string v4, int scene)
{
int success = 0;
DWORD acceptNewFriendCall1 = g_WeChatWinDllAddr + g_WxCalls.anf.call1;
DWORD acceptNewFriendCall2 = g_WeChatWinDllAddr + g_WxCalls.anf.call2;
DWORD acceptNewFriendCall3 = g_WeChatWinDllAddr + g_WxCalls.anf.call3;
DWORD acceptNewFriendCall4 = g_WeChatWinDllAddr + g_WxCalls.anf.call4;
char buffer[0x40] = { 0 };
char nullbuffer[0x3CC] = { 0 };
LOG_DEBUG("\nv3: {}\nv4: {}\nscene: {}", v3, v4, scene);
WxString_t wxV3 = { 0 };
WxString_t wxV4 = { 0 };
std::wstring wsV3 = String2Wstring(v3);
std::wstring wsV4 = String2Wstring(v4);
wxV3.text = (wchar_t *)wsV3.c_str();
wxV3.size = wsV3.size();
wxV3.capacity = wsV3.capacity();
wxV4.text = (wchar_t *)wsV4.c_str();
wxV4.size = wsV4.size();
wxV4.capacity = wsV4.capacity();
__asm {
pushad;
pushfd;
lea ecx, buffer;
call acceptNewFriendCall1;
mov esi, 0x0;
mov edi, scene;
push esi;
push edi;
sub esp, 0x14;
mov ecx, esp;
lea eax, wxV4;
push eax;
call acceptNewFriendCall2;
sub esp, 0x8;
push 0x0;
lea eax, nullbuffer;
push eax;
lea eax, wxV3;
push eax;
lea ecx, buffer;
call acceptNewFriendCall3;
mov success, eax;
lea ecx, buffer;
call acceptNewFriendCall4;
popfd;
popad;
}
return success; // 成功返回 1
}

View File

@ -1,7 +1,8 @@
#pragma execution_character_set("utf-8")
#include "get_contacts.h"
#include "contact_mgmt.h"
#include "load_calls.h"
#include "log.h"
#include "util.h"
extern WxCalls_t g_WxCalls;
@ -88,3 +89,61 @@ vector<RpcContact_t> GetContacts()
return contacts;
}
int AcceptNewFriend(std::string v3, std::string v4, int scene)
{
int success = 0;
DWORD acceptNewFriendCall1 = g_WeChatWinDllAddr + g_WxCalls.anf.call1;
DWORD acceptNewFriendCall2 = g_WeChatWinDllAddr + g_WxCalls.anf.call2;
DWORD acceptNewFriendCall3 = g_WeChatWinDllAddr + g_WxCalls.anf.call3;
DWORD acceptNewFriendCall4 = g_WeChatWinDllAddr + g_WxCalls.anf.call4;
char buffer[0x40] = { 0 };
char nullbuffer[0x3CC] = { 0 };
LOG_DEBUG("\nv3: {}\nv4: {}\nscene: {}", v3, v4, scene);
WxString_t wxV3 = { 0 };
WxString_t wxV4 = { 0 };
std::wstring wsV3 = String2Wstring(v3);
std::wstring wsV4 = String2Wstring(v4);
wxV3.text = (wchar_t *)wsV3.c_str();
wxV3.size = wsV3.size();
wxV3.capacity = wsV3.capacity();
wxV4.text = (wchar_t *)wsV4.c_str();
wxV4.size = wsV4.size();
wxV4.capacity = wsV4.capacity();
__asm {
pushad;
pushfd;
lea ecx, buffer;
call acceptNewFriendCall1;
mov esi, 0x0;
mov edi, scene;
push esi;
push edi;
sub esp, 0x14;
mov ecx, esp;
lea eax, wxV4;
push eax;
call acceptNewFriendCall2;
sub esp, 0x8;
push 0x0;
lea eax, nullbuffer;
push eax;
lea eax, wxV3;
push eax;
lea ecx, buffer;
call acceptNewFriendCall3;
mov success, eax;
lea ecx, buffer;
call acceptNewFriendCall4;
popfd;
popad;
}
return success; // 成功返回 1
}

View File

@ -1,5 +1,9 @@
#pragma once
#include "string"
#include <vector>
#include "pb_types.h"
vector<RpcContact_t> GetContacts();
int AcceptNewFriend(std::string v3, std::string v4, int scene);

View File

@ -1,7 +0,0 @@
#pragma once
#include <vector>
#include "pb_types.h"
vector<RpcContact_t> GetContacts();

View File

@ -16,11 +16,10 @@
#include "wcf.pb.h"
#include "accept_new_friend.h"
#include "chatroom_mgmt.h"
#include "decrypt_image.h"
#include "exec_sql.h"
#include "get_contacts.h"
#include "contact_mgmt.h"
#include "log.h"
#include "pb_types.h"
#include "pb_util.h"