refactor: Entire code base, thread and log usage

Boils down to:
- Include headers
- Reduce boiler plate with helpers
- Swap out explicit usages with core API layer
  and ensure the right API is configured beforehand
This commit is contained in:
icex2
2024-02-25 09:30:53 +01:00
parent ea835b32ee
commit e4a221e15b
338 changed files with 1307 additions and 640 deletions
+2 -1
View File
@@ -6,13 +6,14 @@
#include <ntdef.h>
#include <ntstatus.h>
#include "core/log.h"
#include "hook/table.h"
#include "hooklib/acp.h"
#include "util/codepage.h"
#include "util/defs.h"
#include "util/log.h"
static NTSTATUS NTAPI my_RtlMultiByteToUnicodeN(
wchar_t *dest,
+2 -1
View File
@@ -6,13 +6,14 @@
#include <stdbool.h>
#include <string.h>
#include "core/log.h"
#include "hook/table.h"
#include "hooklib/adapter.h"
#include "util/codepage.h"
#include "util/defs.h"
#include "util/log.h"
static DWORD WINAPI
my_GetAdaptersInfo(PIP_ADAPTER_INFO adapter_info, PULONG out_buf_len);
+2 -1
View File
@@ -1,5 +1,7 @@
#include <windows.h>
#include "core/log.h"
#include "hook/table.h"
#include "hooklib/app.h"
@@ -7,7 +9,6 @@
#include "imports/avs.h"
#include "imports/eapki.h"
#include "util/log.h"
#include "util/str.h"
static dll_entry_init_t hook_dll_entry_init;
+2 -2
View File
@@ -1,8 +1,8 @@
#include "cconfig/cconfig-util.h"
#include "hooklib/config-adapter.h"
#include "core/log.h"
#include "util/log.h"
#include "hooklib/config-adapter.h"
#define HOOKLIB_CONFIG_ADAPTER_OVERRIDE_IP_KEY "adapter.override_ip"
+2 -1
View File
@@ -3,12 +3,13 @@
#include <stdbool.h>
#include <windows.h>
#include "core/log.h"
#include "hook/hr.h"
#include "hook/iohook.h"
#include "hook/table.h"
#include "util/array.h"
#include "util/log.h"
#include "util/str.h"
struct file_entry {
+2 -1
View File
@@ -14,12 +14,13 @@
#include <stdbool.h>
#include <string.h>
#include "core/log.h"
#include "hook/hr.h"
#include "hook/iohook.h"
#include "hook/table.h"
#include "util/array.h"
#include "util/log.h"
/* RS232 API hooks */
+2 -1
View File
@@ -4,12 +4,13 @@
#include <string.h>
#include <wchar.h>
#include "core/log.h"
#include "hook/table.h"
#include "hooklib/setupapi.h"
#include "util/defs.h"
#include "util/log.h"
#include "util/str.h"
/* my hooks */