pch.h 2.5 KB
Newer Older
L
ljc545w 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// pch.h: 这是预编译标头文件。
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
#pragma once
#ifndef PCH_H
#define PCH_H

// 添加要在此处预编译的标头
#include "framework.h"
#include<windows.h>
#include<iostream>
#include "SendImage.h"
#include "SendText.h"
#include "SendFile.h"
#include "SendArticle.h"
#include "FriendList.h"
L
ljc545w 已提交
19
#include "SearchContact.h"
L
ljc545w 已提交
20 21
#include "SelfInfo.h"
#include "SendCard.h"
L
ljc545w 已提交
22
#include "CheckFriendStatus.h"
23
#include "LogMsgInfo.h"
24
#include "ReceiveMessage.h"
L
ljc545w 已提交
25
#include "SendAtText.h"
L
ljc545w 已提交
26
#include "GetChatRoomMembers.h"
L
ljc545w 已提交
27 28 29
#include "GetDbHandles.h"
#include "DbExecuteSql.h"
#include "DbBackup.h"
L
ljc545w 已提交
30
#include "VerifyFriendApply.h"
L
ljc545w 已提交
31
#include "AddFriend.h"
L
ljc545w 已提交
32
#include "sqlite3.h"
L
ljc545w 已提交
33
#include <vector>
L
ljc545w 已提交
34
#include <strstream>
L
ljc545w 已提交
35 36 37
#endif //PCH_H

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

L
ljc545w 已提交
42 43 44 45 46 47 48 49 50
/*
* 微信中的基础数据结构
* buffer:UNICODE字符串
* length:`buffer`字符数
* maxLength:`buffer`最大字符数
* fill1:占位成员1,默认为0
* fill2:占位成员2,默认为0
* WxBaseStruct:默认构造函数
*/
L
ljc545w 已提交
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
struct WxBaseStruct
{
    wchar_t* buffer;
    DWORD length;
    DWORD maxLength;
    DWORD fill1;
    DWORD fill2;

    WxBaseStruct(wchar_t* pStr) {
        buffer = pStr;
        length = wcslen(pStr);
        maxLength = wcslen(pStr) * 2;
        fill1 = 0x0;
        fill2 = 0x0;
    }
};

L
ljc545w 已提交
68 69 70
/*
* 不使用构造函数的微信基础数据结构,使用频率较低
*/
L
ljc545w 已提交
71 72
struct WxString
{
73 74 75
    wchar_t* buffer = NULL;
    DWORD length = 0;
    DWORD maxLength = 0;
L
ljc545w 已提交
76 77 78 79 80 81 82
    DWORD fill1 = 0;
    DWORD fill2 = 0;
};

BOOL CreateConsole(void);
DWORD GetWeChatWinBase();
void Wchar_tToString(std::string& szDst, wchar_t* wchar);
L
ljc545w 已提交
83
string UTF8ToGBK(const std::string& strUTF8);
L
ljc545w 已提交
84 85 86
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode);
void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode);
DLLEXPORT void UnHookAll();
L
ljc545w 已提交
87
wstring wreplace(wstring source, wchar_t replaced, wstring replaceto);
L
ljc545w 已提交
88
void PrintProcAddr();
L
ljc545w 已提交
89
wchar_t* GetTimeW();
L
ljc545w 已提交
90 91 92
BOOL ProcessIsWeChat();
DWORD GetWeChatVerInt();
string GetWeChatVerStr();