aboutsummaryrefslogtreecommitdiff
path: root/client/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/util')
-rw-r--r--client/src/util/io.cpp2
-rw-r--r--client/src/util/io.h6
-rw-r--r--client/src/util/native.h9
3 files changed, 17 insertions, 0 deletions
diff --git a/client/src/util/io.cpp b/client/src/util/io.cpp
index 47d9dbe..bfd58db 100644
--- a/client/src/util/io.cpp
+++ b/client/src/util/io.cpp
@@ -1,6 +1,8 @@
#include "../include.h"
#include "io.h"
+std::mutex io::file_mutex;
+
bool io::read_file(const std::string_view path, std::vector<char>& out) {
std::ifstream file(path.data(), std::ios::binary);
if (!file.good()) {
diff --git a/client/src/util/io.h b/client/src/util/io.h
index adb63f7..2b99434 100644
--- a/client/src/util/io.h
+++ b/client/src/util/io.h
@@ -3,7 +3,13 @@
#include <fmt/format.h>
#include <fmt/color.h>
+#include "../client/enc.h"
+
+
+
namespace io {
+ extern std::mutex file_mutex;
+
template<typename... Args>
void log(const std::string_view str, Args... params) {
static auto handle = GetStdHandle(STD_OUTPUT_HANDLE);
diff --git a/client/src/util/native.h b/client/src/util/native.h
index b5b0768..aa41b65 100644
--- a/client/src/util/native.h
+++ b/client/src/util/native.h
@@ -157,6 +157,11 @@ namespace native {
uint8_t Flags;
};
+ enum SECTION_INHERIT {
+ ViewShare = 1,
+ ViewUnmap = 2
+ };
+
using NtQuerySystemInformation = NTSTATUS(__stdcall*)(SYSTEM_INFORMATION_CLASS, PVOID, SIZE_T, PULONG);
using NtOpenProcess = NTSTATUS(__stdcall*)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, CLIENT_ID*);
using NtOpenThread = NTSTATUS(__stdcall*)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, CLIENT_ID*);
@@ -169,4 +174,8 @@ namespace native {
using NtWaitForSingleObject = NTSTATUS(__stdcall*)(HANDLE, BOOLEAN, PLARGE_INTEGER);
using NtCreateThreadEx = NTSTATUS(__stdcall*)(PHANDLE, ACCESS_MASK, PVOID, HANDLE, LPTHREAD_START_ROUTINE, PVOID, ULONG, ULONG_PTR, SIZE_T, SIZE_T, PVOID);
+ using NtCreateSection = NTSTATUS(__stdcall*)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PLARGE_INTEGER, ULONG, ULONG, HANDLE);
+ using NtMapViewOfSection = NTSTATUS(__stdcall*)(HANDLE, HANDLE, PVOID *, ULONG_PTR, SIZE_T, PLARGE_INTEGER, PSIZE_T, SECTION_INHERIT, ULONG, ULONG);
+ using NtUnmapViewOfSection = NTSTATUS(__stdcall*)(HANDLE, PVOID);
+
}; // namespace native \ No newline at end of file