From 64fa0db684db306766280593b0a9717132e636d4 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Wed, 7 Aug 2024 22:55:34 +0200 Subject: [IMP] - Updated the PEF header for NDK. - Adding ICL parser for SCM (ToDo) - Updated extensions of PEF. - Updated start address for exes in PEF. Signed-off-by: Amlal EL Mahrouss --- SCIKit/SCIBase.hxx | 2 +- SCIKit/SCM.drawio | 16 ++---------- SCIKit/build.json | 2 +- SCIKit/makefile | 2 +- SCIKit/rtl.internal.inl | 67 ------------------------------------------------ SCIKit/scm.iclparser.inl | 18 +++++++++++++ SCIKit/scm.internal.inl | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 90 insertions(+), 84 deletions(-) delete mode 100644 SCIKit/rtl.internal.inl create mode 100644 SCIKit/scm.iclparser.inl create mode 100644 SCIKit/scm.internal.inl (limited to 'SCIKit') diff --git a/SCIKit/SCIBase.hxx b/SCIKit/SCIBase.hxx index b084a17b..e8208c49 100644 --- a/SCIKit/SCIBase.hxx +++ b/SCIKit/SCIBase.hxx @@ -52,7 +52,7 @@ inline constexpr auto cLPCCloseMsgSyscall = 0x27; inline constexpr auto cLPCSanitizeMsgSyscall = 0x28; #ifdef __NEWOS_SYMS__ -#include +#include #else class UnknownInterface; // Refrenced from an IDB entry. class UnknownUCLSID; // From the IDB, the constructor of the object, e.g: WordUCLSID. diff --git a/SCIKit/SCM.drawio b/SCIKit/SCM.drawio index 56974466..978ebb6d 100644 --- a/SCIKit/SCM.drawio +++ b/SCIKit/SCM.drawio @@ -1,15 +1,9 @@ - + - - - - - - @@ -19,20 +13,14 @@ - - - - - - - + diff --git a/SCIKit/build.json b/SCIKit/build.json index 91e64384..770d1622 100644 --- a/SCIKit/build.json +++ b/SCIKit/build.json @@ -3,7 +3,7 @@ "compiler_std": "c++20", "headers_path": ["../"], "sources_path": ["*.cxx"], - "output_name": "libSCI.lib", + "output_name": "libSCI.dll", "compiler_flags": ["-fPIC", "-shared", "-std=c++20"], "cpp_macros": ["__NEWOS_SYMS__"] } diff --git a/SCIKit/makefile b/SCIKit/makefile index 9a2b836e..7757440e 100644 --- a/SCIKit/makefile +++ b/SCIKit/makefile @@ -5,7 +5,7 @@ CC=g++ FLAGS=-I../ -shared -fPIC -D__NEWOS_SYMS__ -OUTPUT=libSCI.lib +OUTPUT=libSCI.dll .PHONY: build-sci build-sci: diff --git a/SCIKit/rtl.internal.inl b/SCIKit/rtl.internal.inl deleted file mode 100644 index b4e8e7dd..00000000 --- a/SCIKit/rtl.internal.inl +++ /dev/null @@ -1,67 +0,0 @@ -/* ------------------------------------------- - -Copyright ZKA Technologies. - -File: rt.internal.inl -Purpose: Base code of SCM. - -------------------------------------------- */ - -/// @internal - -#ifndef __ZECC__ -#define object class -#define protocol class -#define clsid(X) __attribute__((uuid(X))) - -#warning ! you may be using the clang version of the newos kit, please be cautious that some thing mayn't be present. ! -#endif // !__ZECC__ - -// Interfaces are divided between classes. -// So that they aren't too big. - -protocol UnknownInterface; // Refrenced from an IDB entry. -class UnknownUCLSID; // From the IDB, the constructor of the object, e.g: TextUCLSID. -object UUID; - -protocol clsid("d7c144b6-0792-44b8-b06b-02b227b547df") UnknownInterface -{ -public: - explicit UnknownInterface() = default; - virtual ~UnknownInterface() = default; - - UnknownInterface& operator=(const UnknownInterface&) = default; - UnknownInterface(const UnknownInterface&) = default; - - virtual SInt32 Release() = 0; - virtual void DecrementRef() = 0; - virtual UnknownInterface* IncrementRef() = 0; - virtual VoidPtr QueryInterface(UUID* p_uuid) = 0; -}; - -/// @brief Allocate new SCM object. -/// @tparam TCLS -/// @tparam UCLSID -/// @param uclsidOfCls -/// @return -template -inline TCLS* ScmQueryInterface(UCLSID* uclsidOfCls, Args&&... args) -{ - return uclsidOfCls->QueryInterfaceWithArgs(args...); -} - -/// @brief Release SCM object. -/// @tparam TCLS -/// @param cls -/// @return -template -inline SInt32 ScmReleaseClass(TCLS* cls) -{ - if (!cls) - return -1; - - cls->DecrementRef(); - cls->Release(); - - return 0; -} diff --git a/SCIKit/scm.iclparser.inl b/SCIKit/scm.iclparser.inl new file mode 100644 index 00000000..acedc9d8 --- /dev/null +++ b/SCIKit/scm.iclparser.inl @@ -0,0 +1,18 @@ +/* ------------------------------------------- + +Copyright ZKA Technologies. + +File: rt.internal.inl +Purpose: Base code of SCM. + +------------------------------------------- */ + +/// @internal + +#ifndef __ZECC__ +#define object class +#define protocol class +#define clsid(X) __attribute__((uuid(X))) + +#warning ! you may be using the clang version of the newos kit, please be cautious that some thing mayn't be present. ! +#endif // !__ZECC__ \ No newline at end of file diff --git a/SCIKit/scm.internal.inl b/SCIKit/scm.internal.inl new file mode 100644 index 00000000..b4e8e7dd --- /dev/null +++ b/SCIKit/scm.internal.inl @@ -0,0 +1,67 @@ +/* ------------------------------------------- + +Copyright ZKA Technologies. + +File: rt.internal.inl +Purpose: Base code of SCM. + +------------------------------------------- */ + +/// @internal + +#ifndef __ZECC__ +#define object class +#define protocol class +#define clsid(X) __attribute__((uuid(X))) + +#warning ! you may be using the clang version of the newos kit, please be cautious that some thing mayn't be present. ! +#endif // !__ZECC__ + +// Interfaces are divided between classes. +// So that they aren't too big. + +protocol UnknownInterface; // Refrenced from an IDB entry. +class UnknownUCLSID; // From the IDB, the constructor of the object, e.g: TextUCLSID. +object UUID; + +protocol clsid("d7c144b6-0792-44b8-b06b-02b227b547df") UnknownInterface +{ +public: + explicit UnknownInterface() = default; + virtual ~UnknownInterface() = default; + + UnknownInterface& operator=(const UnknownInterface&) = default; + UnknownInterface(const UnknownInterface&) = default; + + virtual SInt32 Release() = 0; + virtual void DecrementRef() = 0; + virtual UnknownInterface* IncrementRef() = 0; + virtual VoidPtr QueryInterface(UUID* p_uuid) = 0; +}; + +/// @brief Allocate new SCM object. +/// @tparam TCLS +/// @tparam UCLSID +/// @param uclsidOfCls +/// @return +template +inline TCLS* ScmQueryInterface(UCLSID* uclsidOfCls, Args&&... args) +{ + return uclsidOfCls->QueryInterfaceWithArgs(args...); +} + +/// @brief Release SCM object. +/// @tparam TCLS +/// @param cls +/// @return +template +inline SInt32 ScmReleaseClass(TCLS* cls) +{ + if (!cls) + return -1; + + cls->DecrementRef(); + cls->Release(); + + return 0; +} -- cgit v1.2.3