pch.h 2.6 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 "wechatver.h"
L
ljc545w 已提交
34 35
#include "DeleteUser.h"
#include "SendAppMsg.h"
L
ljc545w 已提交
36
#include <vector>
L
ljc545w 已提交
37
#include <strstream>
L
ljc545w 已提交
38 39 40
#endif //PCH_H

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

L
ljc545w 已提交
46 47 48 49 50 51 52 53 54
/*
* 微信中的基础数据结构
* buffer:UNICODE字符串
* length:`buffer`字符数
* maxLength:`buffer`最大字符数
* fill1:占位成员1,默认为0
* fill2:占位成员2,默认为0
* WxBaseStruct:默认构造函数
*/
L
ljc545w 已提交
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
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 已提交
72 73 74
/*
* 不使用构造函数的微信基础数据结构,使用频率较低
*/
L
ljc545w 已提交
75 76
struct WxString
{
77 78 79
    wchar_t* buffer = NULL;
    DWORD length = 0;
    DWORD maxLength = 0;
L
ljc545w 已提交
80 81 82 83 84 85 86
    DWORD fill1 = 0;
    DWORD fill2 = 0;
};

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