Make port configurable
This commit is contained in:
1 parent
dd02c4b6ff
commit
b643f92681
8 files changed
+33
-35
No files matched your search
+2
-13
@@ -34,12 +34,8 @@ static int GetDllPath(bool debug, wchar_t *dllPath)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int WxInitSDK(bool debug, const char *url)
|
||||
int WxInitSDK(bool debug, int port)
|
||||
{
|
||||
if (url == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int status = 0;
|
||||
DWORD wcPid = 0;
|
||||
|
||||
@@ -60,15 +56,8 @@ int WxInitSDK(bool debug, const char *url)
|
||||
LOG_ERROR("Failed to Inject DLL into WeChat.");
|
||||
return -1;
|
||||
}
|
||||
size_t urlLen = strlen(url) + 1;
|
||||
LPVOID urlAddr = VirtualAllocEx(wcProcess, NULL, urlLen, MEM_COMMIT, PAGE_READWRITE);
|
||||
if (urlAddr == NULL) {
|
||||
LOG_ERROR("Failed to Alloc Memory.");
|
||||
return NULL;
|
||||
}
|
||||
WriteProcessMemory(wcProcess, urlAddr, url, urlLen, NULL);
|
||||
|
||||
if (!CallDllFunc(wcProcess, spyDllPath, spyBase, "InitSpy", urlAddr, NULL)) {
|
||||
if (!CallDllFunc(wcProcess, spyDllPath, spyBase, "InitSpy", (LPVOID)port, NULL)) {
|
||||
LOG_ERROR("Failed to InitSpy.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user