From 36b6d84ee4b520bdf43891ea86df03cf660cb464 Mon Sep 17 00:00:00 2001 From: Matthew Wozniak Date: Fri, 25 Oct 2024 23:24:45 -0400 Subject: create project --- os.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 os.h (limited to 'os.h') diff --git a/os.h b/os.h new file mode 100644 index 0000000..2635268 --- /dev/null +++ b/os.h @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: ISC +// SPDX-FileCopyrightText: 2024 Matthew Wozniak + +#ifndef OS_H +#define OS_H + +#include +#include "intdef.h" + +#define os_dlopen LoadLibraryA +#define os_dlsym GetProcAddress + +inline bool os_mprot(void *mem, int len, int mode) { + ulong old; + return !!VirtualProtect(mem, len, mode, &old); +} + +#endif + +// vi: sw=4 ts=4 noet tw=80 cc=80 -- cgit v1.2.3-54-g00ecf