diff --git a/project/windll_winpe/Makefile b/project/windll_winpe/Makefile index 43c0664..717e50b 100644 --- a/project/windll_winpe/Makefile +++ b/project/windll_winpe/Makefile @@ -28,7 +28,7 @@ endif ifneq (,$(findstring d, $(BUILD_TYPE))) CFLAGS+=-g -D_DEBUG else -CFLAGS+=-O3 +CFLAGS+=-O3 # winpe_memGetProcAddress might fail if use inline and -O3 by llvm-clang endif ifneq (,$(findstring tcc, $(CC))) LDFLAGS= # tcc can not remove at at stdcall in i686 diff --git a/project/windll_winpe/src/libwinpe_test.c b/project/windll_winpe/src/libwinpe_test.c index 55241d9..efef747 100644 --- a/project/windll_winpe/src/libwinpe_test.c +++ b/project/windll_winpe/src/libwinpe_test.c @@ -15,8 +15,7 @@ void test_findkernel32() void test_findloadlibrarya() { - - void *func = (void*)LoadLibraryA; + void *func = (void*)GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA"); // compatible with tcc void *func2 = winpe_findloadlibrarya(); printf("[test_findloadlibrarya] LoadLibraryA=%p\n", func2); assert(func==func2); @@ -24,7 +23,7 @@ void test_findloadlibrarya() void test_findgetprocaddress() { - void *func = (void*)GetProcAddress; + void *func = (void*)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetProcAddress"); // compatible with tcc void *func2 = winpe_findgetprocaddress(); printf("[test_findgetprocaddress] GetProcAddress=%p\n", func2); assert(func==func2); diff --git a/src/commdef.h b/src/commdef.h index 33826db..605092c 100644 --- a/src/commdef.h +++ b/src/commdef.h @@ -67,12 +67,12 @@ #define LOG_LEVEL_INFO 3 #define LOG_LEVEL_DEBUG 4 #define LOG_LEVEL_VERBOSE 5 -#define LogTagPrintf(format, tag, ...) \ +#define LogTagPrintf(format, tag, ...) {\ printf("[%s,%d,%s,%s] ", __FILE__, __LINE__, __func__, tag);\ - printf(format, ##__VA_ARGS__); -#define LogTagWprintf(format, tag, ...) \ + printf(format, ##__VA_ARGS__);} +#define LogTagWprintf(format, tag, ...) {\ printf("[%s,%d,%s,%s] ", __FILE__, __LINE__, __func__, tag);\ - wprintf(format, ##__VA_ARGS__); + wprintf(format, ##__VA_ARGS__);} #define DummyPrintf(format, ...) #define LOG(format, ...) LogTagPrintf(format, "I", ##__VA_ARGS__) #define LOGL(format, ...) LogTagWprintf(format, "I", ##__VA_ARGS__) diff --git a/src/winhook.h b/src/winhook.h index 6a3f388..aeb7004 100644 --- a/src/winhook.h +++ b/src/winhook.h @@ -198,17 +198,6 @@ BOOL winhook_iathook(LPCSTR targetDllName, PROC pfnOrg, PROC pfgNew) { return winhook_iathookmodule(targetDllName, NULL, pfnOrg, pfgNew); } - -/** - * inline hooks wrapper, - * @param pfnTargets -> @param pfnNews, save origin pointers in @param pfnOlds - * @return: success hook numbers -*/ -WINHOOK_API -int winhook_inlinehooks(PVOID pfnTargets[], PVOID pfnNews[], PVOID pfnOlds[], int n); - -WINHOOK_API -int winhook_inlineunhooks(PVOID pfnTargets[], PVOID pfnNews[], PVOID pfnOlds[], int n); #ifdef WINHOOK_IMPLEMENTATION #include