feat: 3.9.5.81 基础收发功能
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(ConsoleApplication VERSION 1.0.0)
|
||||
project(injector VERSION 1.0.0)
|
||||
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
@@ -9,12 +9,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D '_UNICODE' /D 'UNICODE'")
|
||||
|
||||
file(GLOB INJECT_CPP_FILES ${PROJECT_SOURCE_DIR}/*.cc ${PROJECT_SOURCE_DIR}/*.cpp)
|
||||
|
||||
add_executable (ConsoleApplication ${INJECT_CPP_FILES})
|
||||
add_executable (injector ${INJECT_CPP_FILES})
|
||||
|
||||
SET_TARGET_PROPERTIES(ConsoleApplication PROPERTIES LINKER_LANGUAGE C
|
||||
SET_TARGET_PROPERTIES(injector PROPERTIES LINKER_LANGUAGE C
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
|
||||
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
|
||||
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
|
||||
OUTPUT_NAME "ConsoleApplication"
|
||||
OUTPUT_NAME "injector"
|
||||
PREFIX "")
|
||||
|
||||
@@ -570,7 +570,7 @@ HMODULE GetDLLHandle(wchar_t* wDllName, DWORD dPid)
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOL EnableDebugPrivilege()
|
||||
BOOL EnableDebugPrivilege()
|
||||
{
|
||||
HANDLE TokenHandle = NULL;
|
||||
TOKEN_PRIVILEGES TokenPrivilege;
|
||||
@@ -649,7 +649,7 @@ LPVOID FillAsmCode(HANDLE handle) {
|
||||
|
||||
int InjectDllAndStartHttp(wchar_t* szPName, wchar_t* szDllPath, DWORD port)
|
||||
{
|
||||
if(!EnableDebugPrivilege()){
|
||||
if (!EnableDebugPrivilege()) {
|
||||
return 0;
|
||||
}
|
||||
int result = 0;
|
||||
@@ -662,7 +662,7 @@ int InjectDllAndStartHttp(wchar_t* szPName, wchar_t* szDllPath, DWORD port)
|
||||
size_t ulDllLength;
|
||||
wchar_t* dllName = (wchar_t*)L"wxhelper.dll";
|
||||
size_t dllNameLen = wcslen(dllName) * 2 + 2;
|
||||
char* funcName = (char* )"http_start";
|
||||
char* funcName = (char*)"http_start";
|
||||
size_t funcNameLen = strlen(funcName) + 1;
|
||||
|
||||
HANDLE hStartHttp = NULL;
|
||||
@@ -773,7 +773,7 @@ error:
|
||||
|
||||
int InjectDllAndStartHttpByPid(unsigned int pid, wchar_t* szDllPath, DWORD port)
|
||||
{
|
||||
if(!EnableDebugPrivilege()){
|
||||
if (!EnableDebugPrivilege()) {
|
||||
return 0;
|
||||
}
|
||||
int result = 0;
|
||||
@@ -785,7 +785,7 @@ int InjectDllAndStartHttpByPid(unsigned int pid, wchar_t* szDllPath, DWORD port
|
||||
size_t ulDllLength;
|
||||
wchar_t* dllName = (wchar_t*)L"wxhelper.dll";
|
||||
size_t dllNameLen = wcslen(dllName) * 2 + 2;
|
||||
char* funcName = (char* )"http_start";
|
||||
char* funcName = (char*)"http_start";
|
||||
size_t funcNameLen = strlen(funcName) + 1;
|
||||
|
||||
HANDLE hStartHttp = NULL;
|
||||
@@ -895,7 +895,7 @@ error:
|
||||
|
||||
int InjectDll(wchar_t* szPName, wchar_t* szDllPath)
|
||||
{
|
||||
if(!EnableDebugPrivilege()){
|
||||
if (!EnableDebugPrivilege()) {
|
||||
return 0;
|
||||
}
|
||||
int result = 0;
|
||||
@@ -949,7 +949,7 @@ int InjectDll(wchar_t* szPName, wchar_t* szDllPath)
|
||||
|
||||
int InjectDllByPid(unsigned int pid, wchar_t* szDllPath)
|
||||
{
|
||||
if(!EnableDebugPrivilege()){
|
||||
if (!EnableDebugPrivilege()) {
|
||||
return 0;
|
||||
}
|
||||
int result = 0;
|
||||
@@ -981,7 +981,7 @@ int InjectDllByPid(unsigned int pid, wchar_t* szDllPath)
|
||||
OutputDebugStringA("[DBG] dll inject success");
|
||||
printf("dll inject success");
|
||||
printf("dll path : %s ", szDllPath);
|
||||
printf("pid : %d ", pid);
|
||||
printf("dll path : %d ", pid);
|
||||
result = 1;
|
||||
}
|
||||
else
|
||||
@@ -1052,7 +1052,7 @@ int main(int argc, char** argv)
|
||||
int port = 0;
|
||||
|
||||
ULONG pid = 0;
|
||||
unsigned int injectPid =0;
|
||||
unsigned int injectPid = 0;
|
||||
|
||||
while ((param = getopt(argc, argv, "i:p:u:d:m:P:I:h")) != -1)
|
||||
{
|
||||
@@ -1105,7 +1105,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
if (injectPid != 0 && cDllPath[0] != 0)
|
||||
{
|
||||
if(cDllPath[0] != '\0')
|
||||
if (cDllPath[0] != '\0')
|
||||
{
|
||||
if (port == 0) {
|
||||
std::wstring wsPath = Utf8ToUnicode(cDllPath);
|
||||
@@ -1120,7 +1120,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (cInjectprogram[0] != 0 && cDllPath[0] != 0)
|
||||
{
|
||||
Reference in New Issue
Block a user