mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
[Update] Logger and injector
This commit is contained in:
1 parent
80713ace68
commit
76055183d2
5 files changed
+57
-1
No files matched your search
+2
-1
@@ -12,4 +12,5 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
|
||||
|
||||
# modules
|
||||
add_subdirectory(${SRC_DIR}/libagent)
|
||||
add_subdirectory(${SRC_DIR}/libagent)
|
||||
add_subdirectory(${SRC_DIR}/libinjector)
|
||||
@@ -0,0 +1,17 @@
|
||||
// Logger.hpp
|
||||
#pragma once
|
||||
#include <plog/Log.h>
|
||||
#include <plog/Init.h>
|
||||
#include <plog/Formatters/TxtFormatter.h>
|
||||
#include <plog/Appenders/ConsoleAppender.h>
|
||||
#include <plog/Appenders/DebugOutputAppender.h>
|
||||
|
||||
inline void InitLogger()
|
||||
{
|
||||
static plog::ConsoleAppender<plog::TxtFormatter> consoleAppender;
|
||||
static plog::DebugOutputAppender<plog::TxtFormatter> debugAppender;
|
||||
|
||||
plog::init(plog::debug, &consoleAppender).addAppender(&debugAppender);
|
||||
|
||||
PLOG_INFO << "Logger initialized: Console + Debug Output";
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#include <windows.h>
|
||||
#include <JuiceAgent/Logger.hpp>
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved ) {
|
||||
switch( fdwReason )
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
InitLogger();
|
||||
PLOGI << "DllMain: DLL_PROCESS_ATTACH";
|
||||
PLOGD.printf("lpReserved: %p", lpReserved);
|
||||
break;
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
PLOGI << "DllMain: DLL_PROCESS_DETACH";
|
||||
PLOGD.printf("lpReserved: %p", lpReserved);
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
file(
|
||||
GLOB_RECURSE
|
||||
libinjector_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.c
|
||||
)
|
||||
|
||||
add_library(injector SHARED ${libinjector_sources})
|
||||
|
||||
target_include_directories(injector PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/includes
|
||||
${CMAKE_SOURCE_DIR}/includes/jvm
|
||||
${CMAKE_SOURCE_DIR}/includes/jvm/win32
|
||||
)
|
||||
Whitespace-only changes.
Reference in new issue
Block a user