wxapi.h 2.5 KB
Newer Older
1
#pragma once
2
#include "wxsignal.h"
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include "SendImage.h"
#include "SendText.h"
#include "SendFile.h"
#include "SendArticle.h"
#include "FriendList.h"
#include "SearchContact.h"
#include "SelfInfo.h"
#include "SendCard.h"
#include "CheckFriendStatus.h"
#include "LogMsgInfo.h"
#include "ReceiveMessage.h"
#include "SendAtText.h"
#include "GetChatRoomMembers.h"
#include "GetDbHandles.h"
#include "DbExecuteSql.h"
#include "DbBackup.h"
#include "VerifyFriendApply.h"
#include "AddFriend.h"
#include "sqlite3.h"
#include "wechatver.h"
#include "DeleteUser.h"
#include "SendAppMsg.h"
L
ljc545w 已提交
25 26 27 28 29 30 31
#include "EditRemark.h"
#include "DelChatRoomMember.h"
#include "AddChatRoomMember.h"
#include "SetChatRoomAnnouncement.h"
#include "SetChatRoomSelfNickname.h"
#include "SetChatRoomName.h"
#include "GetChatRoomMemberNickname.h"
L
ljc545w 已提交
32 33
#include "OpenBrowser.h"
#include "GetHistoryPublicMsg.h"
34
#include "ForwardMessage.h"
35
#include "GetQrcodeImage.h"
L
ljc545w 已提交
36
#include "GetA8Key.h"
37 38

using namespace std;
L
ljc545w 已提交
39 40
#pragma comment(lib, "version.lib")
#pragma warning(disable : 4731 26812)
41 42 43 44 45
// 对于导出函数,需要使用此宏修饰
#define DLLEXPORT extern "C" __declspec(dllexport)

BOOL CreateConsole(void);
DWORD GetWeChatWinBase();
L
ljc545w 已提交
46 47
string unicode_to_gb2312(wchar_t *wchar);
string unicode_to_utf8(wchar_t *wstr);
L
ljc545w 已提交
48 49

string utf8_to_gb2312(const char *strUTF8);
L
ljc545w 已提交
50
wstring utf8_to_unicode(const char *buffer);
L
ljc545w 已提交
51 52 53 54

string gb2312_to_utf8(const char *strGB2312);
wstring gb2312_to_unicode(const char *buffer);

L
ljc545w 已提交
55 56
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char *originalRecieveCode);
void UnHookAnyAddress(DWORD dwHookAddr, char *originalRecieveCode);
57 58 59
DLLEXPORT void UnHookAll();
wstring wreplace(wstring source, wchar_t replaced, wstring replaceto);
void PrintProcAddr();
L
ljc545w 已提交
60
wstring GetTimeW(long long timestamp);
61
BOOL ProcessIsWeChat();
L
ljc545w 已提交
62
BOOL FindOrCreateDirectory(const wchar_t *pszPath);
L
ljc545w 已提交
63
void gLogInit();
L
ljc545w 已提交
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78

template <typename T1, typename T2>
vector<T1> split(T1 str, T2 letter)
{
    vector<T1> arr;
    size_t pos;
    while ((pos = str.find_first_of(letter)) != T1::npos)
    {
        T1 str1 = str.substr(0, pos);
        arr.push_back(str1);
        str = str.substr(pos + 1, str.length() - pos - 1);
    }
    arr.push_back(str);
    return arr;
}
L
ljc545w 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94

template <typename T1, typename T2>
T1 replace(T1 source, T2 replaced, T1 replaceto)
{
    vector<T1> v_arr = split(source, replaced);
    if (v_arr.size() < 2)
        return source;
    T1 temp;
    for (unsigned int i = 0; i < v_arr.size() - 1; i++)
    {
        temp += v_arr[i];
        temp += replaceto;
    }
    temp += v_arr[v_arr.size() - 1];
    return temp;
}