From 01658f0f5ba1fb3e84d61629f15b8c5221bf66dc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 20 Aug 2024 10:04:39 +0200 Subject: + Fixes and refactors regarding Kernel DLL and other DLLs. + Next commit will fix TryLogIn method. Signed-off-by: Amlal El Mahrouss --- dev/CRT/ReadMe.md | 4 ++-- dev/DDK/KernelVersion.c | 10 +++++++--- dev/DDK/build.json | 33 +++++++++++++++++++++++---------- dev/DLL/HTTP/.keepme | 0 dev/DLL/HTTP/build.json | 10 ---------- dev/DLL/OSHS/build.json | 30 ++++++++++++++++++++---------- dev/DLL/OSSS/.keepme | 0 dev/DLL/OSSS/build.json | 20 ++++++++++++++++++++ dev/EFS/EncryptFS.hxx | 6 ------ dev/EFS/ReadMe.md | 5 +++++ dev/EFS/Sources/EncryptBlock.cxx | 14 ++++++++++++++ dev/EFS/Sources/Key.cxx | 12 ++++++++++++ dev/EFS/build.json | 30 ++++++++++++++++++++---------- dev/ZKA/Sources/FS/FAT32.cxx | 12 ++++++++++++ 14 files changed, 135 insertions(+), 51 deletions(-) delete mode 100644 dev/DLL/HTTP/.keepme delete mode 100644 dev/DLL/HTTP/build.json create mode 100644 dev/DLL/OSSS/.keepme create mode 100644 dev/DLL/OSSS/build.json create mode 100644 dev/EFS/ReadMe.md create mode 100644 dev/EFS/Sources/EncryptBlock.cxx create mode 100644 dev/EFS/Sources/Key.cxx create mode 100644 dev/ZKA/Sources/FS/FAT32.cxx (limited to 'dev') diff --git a/dev/CRT/ReadMe.md b/dev/CRT/ReadMe.md index 25dc2cb2..a959d6b8 100644 --- a/dev/CRT/ReadMe.md +++ b/dev/CRT/ReadMe.md @@ -1,5 +1,5 @@ # ZKA C++ RunTime -This is the public interface of ZKA' NDK RunTime, please check ndk.dll instead. +This is the public interface of ZKA' C++ RunTime. -###### (c) ZKA Technologies, all rights reserved. \ No newline at end of file +###### (c) ZKA Technologies, all rights reserved. diff --git a/dev/DDK/KernelVersion.c b/dev/DDK/KernelVersion.c index 84abc4f7..4b69aa34 100644 --- a/dev/DDK/KernelVersion.c +++ b/dev/DDK/KernelVersion.c @@ -10,12 +10,16 @@ #ifndef cDDKVersionHighest #define cDDKVersionHighest 1 -#endif // cDDKVersionHighest +#endif // !cDDKVersionHighest #ifndef cDDKVersionLowest #define cDDKVersionLowest 1 -#endif // cDDKVersionLowest +#endif // !cDDKVersionLowest + +#ifndef cDDKVersion +#define cDDKVersion 1 +#endif // !cDDKVersion int32_t c_api_version_highest = cDDKVersionHighest; int32_t c_api_version_least = cDDKVersionLowest; -int32_t c_api_version = cDDKVersionHighest | cDDKVersionLowest; \ No newline at end of file +int32_t c_api_version = cDDKVersion; diff --git a/dev/DDK/build.json b/dev/DDK/build.json index 328165ba..a9a3b895 100644 --- a/dev/DDK/build.json +++ b/dev/DDK/build.json @@ -1,10 +1,23 @@ -{ - "compiler_path": "x86_64-w64-mingw32-gcc", - "compiler_std": "c++20", - "headers_path": ["../", "./"], - "sources_path": ["*.c", "*.cxx", "*.S"], - "output_name": "ddk.dll", - "compiler_flags": ["-ffreestanding", "-shared", "-std=c17", "-std=c++20", "-fno-rtti", "-fno-exceptions", " -Wl,--subsystem=17"], - "cpp_macros": ["__NEWOSKRNL__", "__DDK_AMD64__", "cDDKVersionHighest=1", "cDDKVersionLowest=1"] - } - \ No newline at end of file +{ + "compiler_path": "x86_64-w64-mingw32-gcc", + "compiler_std": "c++20", + "headers_path": ["../", "./"], + "sources_path": ["*.c", "*.cxx", "*.S"], + "output_name": "ddk.dll", + "compiler_flags": [ + "-ffreestanding", + "-shared", + "-std=c17", + "-std=c++20", + "-fno-rtti", + "-fno-exceptions", + " -Wl,--subsystem=17" + ], + "cpp_macros": [ + "__NEWOSKRNL__", + "__DDK_AMD64__", + "cDDKVersionHighest=0x0100", + "cDDKVersionLowest=0x0100", + "cDDKVersion=0x0100" + ] +} diff --git a/dev/DLL/HTTP/.keepme b/dev/DLL/HTTP/.keepme deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/DLL/HTTP/build.json b/dev/DLL/HTTP/build.json deleted file mode 100644 index 10470542..00000000 --- a/dev/DLL/HTTP/build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "./"], - "sources_path": ["*.cxx"], - "output_name": "httpsrv.dll", - "compiler_flags": ["-ffreestanding", "-shared", "-fno-rtti", "-fno-exceptions", " -Wl,--subsystem=17"], - "cpp_macros": ["__HTTP_AMD64__", "cHTTPVersion=0x0100", "cHTTPVersionHighest=0x0100", "cHTTPVersionLowest=0x0100"] - } - \ No newline at end of file diff --git a/dev/DLL/OSHS/build.json b/dev/DLL/OSHS/build.json index b8d41ae3..a407db54 100644 --- a/dev/DLL/OSHS/build.json +++ b/dev/DLL/OSHS/build.json @@ -1,10 +1,20 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "./"], - "sources_path": ["*.cxx"], - "output_name": "oshs.dll", - "compiler_flags": ["-ffreestanding", "-shared", "-fno-rtti", "-fno-exceptions", " -Wl,--subsystem=17"], - "cpp_macros": ["__OSHS_AMD64__", "cOSHSVersion=0x0100", "cOSHSVersionHighest=0x0100", "cOSHSVersionLowest=0x0100"] - } - \ No newline at end of file +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "./"], + "sources_path": ["*.cxx"], + "output_name": "oshs.dll", + "compiler_flags": [ + "-ffreestanding", + "-shared", + "-fno-rtti", + "-fno-exceptions", + " -Wl,--subsystem=17" + ], + "cpp_macros": [ + "__OSHS_AMD64__", + "cOSHSVersion=0x0100", + "cOSHSVersionHighest=0x0100", + "cOSHSVersionLowest=0x0100" + ] +} diff --git a/dev/DLL/OSSS/.keepme b/dev/DLL/OSSS/.keepme new file mode 100644 index 00000000..e69de29b diff --git a/dev/DLL/OSSS/build.json b/dev/DLL/OSSS/build.json new file mode 100644 index 00000000..2d804db5 --- /dev/null +++ b/dev/DLL/OSSS/build.json @@ -0,0 +1,20 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "./"], + "sources_path": ["*.cxx"], + "output_name": "osss.dll", + "compiler_flags": [ + "-ffreestanding", + "-shared", + "-fno-rtti", + "-fno-exceptions", + " -Wl,--subsystem=17" + ], + "cpp_macros": [ + "__OSSS_AMD64__", + "cOSSSVersion=0x0100", + "cOSSSVersionHighest=0x0100", + "cOSSSVersionLowest=0x0100" + ] +} diff --git a/dev/EFS/EncryptFS.hxx b/dev/EFS/EncryptFS.hxx index 2ed382e3..4348027b 100644 --- a/dev/EFS/EncryptFS.hxx +++ b/dev/EFS/EncryptFS.hxx @@ -14,9 +14,3 @@ #pragma once #include - -/// @brief EncryptFS NewFS extension for data protection. - -#define EFSKIT_VERSION 0x0100 - -struct EFS_ENCRYPT_BLOCK; diff --git a/dev/EFS/ReadMe.md b/dev/EFS/ReadMe.md new file mode 100644 index 00000000..ba9de32f --- /dev/null +++ b/dev/EFS/ReadMe.md @@ -0,0 +1,5 @@ +# ZKA Encrypted File System + +This is the ZKA's Encrypted file system DLL. + +###### (c) ZKA Technologies, all rights reserved. diff --git a/dev/EFS/Sources/EncryptBlock.cxx b/dev/EFS/Sources/EncryptBlock.cxx new file mode 100644 index 00000000..09b8c0d9 --- /dev/null +++ b/dev/EFS/Sources/EncryptBlock.cxx @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#include +#include + +enum +{ + eEFSFlagEncrypted = 0x3f, + eEFSFlagEncryptedEPM = 0xf3, +}; diff --git a/dev/EFS/Sources/Key.cxx b/dev/EFS/Sources/Key.cxx new file mode 100644 index 00000000..457ce1b8 --- /dev/null +++ b/dev/EFS/Sources/Key.cxx @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#include +#include +#include + +typedef int32_t efs_encrypt_token_t; +typedef void* efs_encrypted_blob_t; diff --git a/dev/EFS/build.json b/dev/EFS/build.json index 560f6716..3c611a95 100644 --- a/dev/EFS/build.json +++ b/dev/EFS/build.json @@ -1,10 +1,20 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "./"], - "sources_path": ["*.cxx"], - "output_name": "encryptfs.dll", - "compiler_flags": ["-ffreestanding", "-shared", "-fno-rtti", "-fno-exceptions", " -Wl,--subsystem=17"], - "cpp_macros": ["__EFS_AMD64__", "cEFSVersion=0x0100", "cEFSVersionHighest=0x0100", "cEFSVersionLowest=0x0100"] - } - \ No newline at end of file +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "./"], + "sources_path": ["Sources/*.cxx"], + "output_name": "encryptfs.dll", + "compiler_flags": [ + "-ffreestanding", + "-shared", + "-fno-rtti", + "-fno-exceptions", + " -Wl,--subsystem=17" + ], + "cpp_macros": [ + "__EFS_AMD64__", + "cEFSVersion=0x0100", + "cEFSVersionHighest=0x0100", + "cEFSVersionLowest=0x0100" + ] +} diff --git a/dev/ZKA/Sources/FS/FAT32.cxx b/dev/ZKA/Sources/FS/FAT32.cxx new file mode 100644 index 00000000..1f5e194b --- /dev/null +++ b/dev/ZKA/Sources/FS/FAT32.cxx @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#ifdef __FSKIT_INCLUDES_FAT32__ + +#include +#include + +#endif // ifdef __FSKIT_INCLUDES_FAT32__ -- cgit v1.2.3