Add debug build
This commit is contained in:
+1
-2
@@ -126,8 +126,7 @@
|
||||
<ModuleDefinitionFile>sdk.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y $(OutDir)sdk.dll $(OutDir)out\launcher
|
||||
xcopy /y $(OutDir)sdk.dll $(SolutionDir)python\wcferry</Command>
|
||||
<Command>xcopy /y $(OutDir)sdk.dll $(SolutionDir)Out</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy files</Message>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sdk.h"
|
||||
|
||||
void help() { printf("Usage: sdk.exe start|stop [debug]"); }
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret = -1;
|
||||
bool debug = false;
|
||||
if ((argc < 2) || (argc > 3)) {
|
||||
help();
|
||||
} else if (argc == 3) {
|
||||
debug = (strcmp(argv[2], "debug") == 0);
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "start") == 0) {
|
||||
ret = WxInitSDK(debug);
|
||||
} else if (strcmp(argv[1], "stop") == 0) {
|
||||
ret = WxDestroySDK();
|
||||
} else {
|
||||
help();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
+8
-4
@@ -1,4 +1,4 @@
|
||||
#include "Shlwapi.h"
|
||||
#include "Shlwapi.h"
|
||||
#include "framework.h"
|
||||
#include <process.h>
|
||||
#include <tlhelp32.h>
|
||||
@@ -13,17 +13,21 @@ static HANDLE wcProcess = NULL;
|
||||
static HMODULE spyBase = NULL;
|
||||
static WCHAR spyDllPath[MAX_PATH] = { 0 };
|
||||
|
||||
int WxInitSDK()
|
||||
int WxInitSDK(bool debug)
|
||||
{
|
||||
int status = 0;
|
||||
InitLogger();
|
||||
LOG_INFO("WxInitSDK.");
|
||||
GetModuleFileName(GetModuleHandle(WECHATSDKDLL), spyDllPath, MAX_PATH);
|
||||
PathRemoveFileSpec(spyDllPath);
|
||||
PathAppend(spyDllPath, WECHATINJECTDLL);
|
||||
if (debug) {
|
||||
PathAppend(spyDllPath, WECHATINJECTDLL_DEBUG);
|
||||
} else {
|
||||
PathAppend(spyDllPath, WECHATINJECTDLL);
|
||||
}
|
||||
|
||||
if (!PathFileExists(spyDllPath)) {
|
||||
LOG_ERROR("DLL does not exists.");
|
||||
LOG_ERROR("DLL does not exists: {}.", Wstring2String(spyDllPath));
|
||||
return ERROR_FILE_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user