-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
446 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "stdafx.h" | ||
#include "common.h" | ||
#include "util.h" | ||
|
||
bool IsSupportedWxVersion( | ||
const SuppWxCfg* cfg, | ||
INT cfg_count, | ||
DWORD* offset/* = NULL*/, | ||
BYTE* orig_code/* = NULL*/, | ||
DWORD* orig_code_count/* = NULL*/, | ||
BYTE* fake_code/* = NULL*/, | ||
DWORD* fake_code_count/* = NULL*/) | ||
{ | ||
TCHAR tszDllPath[MAX_PATH] = { 0 }; | ||
|
||
GetModuleFileName(NULL, tszDllPath, MAX_PATH); | ||
PathRemoveFileSpec(tszDllPath); | ||
PathAppend(tszDllPath, WECHATWINDLL); | ||
|
||
TCHAR version[100] = { 0 }; | ||
if (!GetFileVersion(tszDllPath, version)) | ||
{ | ||
return false; | ||
} | ||
|
||
for (int i = 0; i < cfg_count; i++) { | ||
if (!_tcsicmp(cfg[i].version, version)) { | ||
if (offset) { | ||
*offset = cfg[i].revoke_offset; | ||
} | ||
if (orig_code) { | ||
memcpy(orig_code, cfg[i].code.orig_code, cfg[i].code.orig_code_count); | ||
} | ||
if (fake_code) { | ||
memcpy(fake_code, cfg[i].code.fake_code, cfg[i].code.fake_code_count); | ||
} | ||
if (orig_code_count) { | ||
*orig_code_count = cfg[i].code.orig_code_count; | ||
} | ||
if (fake_code_count) { | ||
*fake_code_count = cfg[i].code.fake_code_count; | ||
} | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <windows.h> | ||
|
||
#define WECHATWINDLL TEXT("WeChatWin.dll") | ||
#define WECHATRESOURCE TEXT("WeChatResource.dll") | ||
#define ORGWECHATRESOURCE TEXT("WeChatResource.dll.1") | ||
|
||
typedef struct _FAKE_WX_CODE | ||
{ | ||
DWORD orig_code_count; | ||
BYTE orig_code[100]; | ||
DWORD fake_code_count; | ||
BYTE fake_code[100]; | ||
}FakeWxCode, *PFakeWxCode; | ||
|
||
typedef struct _SUP_WX_CFG | ||
{ | ||
const TCHAR* version; | ||
DWORD revoke_offset; | ||
FakeWxCode code; | ||
}SuppWxCfg, *PSuppWxCfg; | ||
|
||
bool IsSupportedWxVersion( | ||
const SuppWxCfg* cfg, | ||
INT cfg_count, | ||
DWORD* offset = NULL, | ||
BYTE* orig_code = NULL, | ||
DWORD* orig_code_count = NULL, | ||
BYTE* fake_code = NULL, | ||
DWORD* fake_code_count = NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "stdafx.h" | ||
#include "config.h" | ||
|
||
#define CONFIGFILE TEXT("superwx.ini") | ||
|
||
WxFuncConfig::WxFuncConfig() | ||
{ | ||
Init(); | ||
} | ||
|
||
WxFuncConfig::~WxFuncConfig() | ||
{ | ||
|
||
} | ||
|
||
void WxFuncConfig::Init() | ||
{ | ||
TCHAR tszCfgPath[MAX_PATH] = { 0 }; | ||
|
||
GetModuleFileName(GetModuleHandle(WECHATRESOURCE), tszCfgPath, MAX_PATH); | ||
PathRemoveFileSpec(tszCfgPath); | ||
PathAppend(tszCfgPath, CONFIGFILE); | ||
|
||
_tcscpy_s(m_configPath, tszCfgPath); | ||
} | ||
|
||
bool WxFuncConfig::IsRevokeMsg() | ||
{ | ||
return GetPrivateProfileInt(TEXT("config"), TEXT("revokemsg"), 0, m_configPath) != 0; | ||
} | ||
|
||
bool WxFuncConfig::IsSaveVoiceMsg(TCHAR * path) | ||
{ | ||
TCHAR voiceMsgPath[MAX_PATH] = { 0 }; | ||
|
||
GetPrivateProfileString(TEXT("config"), TEXT("voicemsg"), TEXT(""), voiceMsgPath, MAX_PATH, m_configPath); | ||
if (_tcslen(voiceMsgPath) > 0) { | ||
if (path) { | ||
_tcscpy_s(path, MAX_PATH, voiceMsgPath); | ||
} | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <windows.h> | ||
|
||
class WxFuncConfig | ||
{ | ||
public: | ||
WxFuncConfig(); | ||
~WxFuncConfig(); | ||
|
||
bool IsRevokeMsg(); | ||
bool IsSaveVoiceMsg(TCHAR* path); | ||
private: | ||
void Init(); | ||
|
||
private: | ||
TCHAR m_configPath[MAX_PATH]; | ||
}; |
Binary file not shown.
Oops, something went wrong.