mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-18 23:11:19 +03:00
import KernelEx-4.5.1
This commit is contained in:
@ -120,26 +120,31 @@ size_t lstrlenWnull(LPCWSTR s);
|
||||
|
||||
//In macros: convert A<->W on stack
|
||||
#define STACK_WtoA(strW,strA) \
|
||||
strA = (LPSTR)strW; \
|
||||
if (HIWORD(strW)) \
|
||||
{ \
|
||||
int c = lstrlenWnull((LPCWSTR)strW); \
|
||||
if (c) \
|
||||
strA = (LPSTR)strW; \
|
||||
if (HIWORD(strW)) \
|
||||
{ \
|
||||
strA = (LPSTR)alloca(c*2); \
|
||||
WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)strW, -1, (LPSTR)strA, c, NULL, NULL); \
|
||||
int c = lstrlenWnull((LPCWSTR)strW); \
|
||||
if (c) \
|
||||
{ \
|
||||
c *= 2; \
|
||||
strA = (LPSTR)alloca(c); \
|
||||
WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)strW, -1, (LPSTR)strA, c, NULL, NULL); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define STACK_AtoW(strA,strW) \
|
||||
strW = (LPWSTR)strA; \
|
||||
if (HIWORD(strA)) \
|
||||
{ \
|
||||
int c = lstrlenAnull((LPCSTR)strA); \
|
||||
if (c) \
|
||||
strW = (LPWSTR)strA; \
|
||||
if (HIWORD(strA)) \
|
||||
{ \
|
||||
strW = (LPWSTR)alloca(c*sizeof(WCHAR)); \
|
||||
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)strA, -1, (LPWSTR)strW, c); \
|
||||
int c = lstrlenAnull((LPCSTR)strA); \
|
||||
if (c) \
|
||||
{ \
|
||||
strW = (LPWSTR)alloca(c*sizeof(WCHAR)); \
|
||||
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)strA, -1, (LPWSTR)strW, c); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
@ -106,11 +106,16 @@ typedef const apilib_api_table* (* fgat_t)();
|
||||
_KEXCOREIMP unsigned long kexGetKEXVersion();
|
||||
|
||||
|
||||
/** kexIsDebugCore - determine release/debug KernelEx Core version
|
||||
/** KernelEx Core capability flags. */
|
||||
#define KCC_DEBUG 1 /* Core compiled with debug features enabled */
|
||||
#define KCC_APIHOOK 2 /* Core compiled with API hook feature enabled */
|
||||
|
||||
|
||||
/** kexGetCoreCaps - determine KernelEx Core capabilities
|
||||
*
|
||||
* @return Zero if release Core, one if debug Core.
|
||||
* @return Combination of capability flags.
|
||||
*/
|
||||
_KEXCOREIMP int kexIsDebugCore();
|
||||
_KEXCOREIMP DWORD kexGetCoreCaps();
|
||||
|
||||
|
||||
/** DBGPRINTF - convenience macro for including debug messages only in debugs.
|
||||
@ -165,7 +170,7 @@ _KEXCOREIMP BOOL kexAreExtensionsEnabled();
|
||||
/** KernelEx resolver flags. */
|
||||
#define KRF_KEX_DISABLE 1 /* disable KernelEx API extensions for this module */
|
||||
#define KRF_OVERRIDE_PROC_MOD 2 /* use same configuration and flags for all modules in a process */
|
||||
#define KRF_LOG_APIS 4 /* enable API tracing */
|
||||
#define KRF_HOOK_APIS 8 /* enable API tracing */
|
||||
#define KRF_NO_INHERIT 16 /* don't inherit configuration and flags to child processes */
|
||||
#define KRF_VALID_FLAG 128 /* denotes that flags field is valid */
|
||||
|
||||
|
@ -296,6 +296,32 @@ typedef struct _FILEMAPPING { // Size = 0x28 (from Kernel32)
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
||||
static inline
|
||||
PDB98* get_pdb(void)
|
||||
{
|
||||
PDB98* pdb;
|
||||
__asm__(".byte 0x64\n\tmovl (0x30),%0" : "=r" (pdb));
|
||||
return pdb;
|
||||
}
|
||||
|
||||
static inline
|
||||
TIB98* get_tib(void)
|
||||
{
|
||||
TIB98* tib;
|
||||
__asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (tib));
|
||||
return tib;
|
||||
}
|
||||
|
||||
static inline
|
||||
TDB98* get_tdb(void)
|
||||
{
|
||||
return (TDB98*) ((unsigned long) get_tib()) - 8;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#pragma warning (disable:4035) // turn off no return code warning
|
||||
|
||||
static inline
|
||||
@ -319,4 +345,6 @@ TDB98* get_tdb(void)
|
||||
|
||||
#pragma warning (default:4035) // turn on no return code warning
|
||||
|
||||
#endif /* defined(__GNUC__) */
|
||||
|
||||
#endif /* __KSTRUCTS_H */
|
||||
|
@ -28,6 +28,13 @@
|
||||
class sstring
|
||||
{
|
||||
public:
|
||||
sstring()
|
||||
{
|
||||
len = 0;
|
||||
storage = new char[1];
|
||||
storage[0] = '\0';
|
||||
}
|
||||
|
||||
sstring(const char* src)
|
||||
{
|
||||
len = strlen(src);
|
||||
@ -79,6 +86,11 @@ public:
|
||||
{
|
||||
return len;
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return len == 0;
|
||||
}
|
||||
|
||||
private:
|
||||
int len;
|
||||
|
@ -22,9 +22,9 @@
|
||||
#ifndef __VERSION_H
|
||||
#define __VERSION_H
|
||||
|
||||
#define VERSION_STR "4.5 Final"
|
||||
#define VERSION_CODE 0x04050065
|
||||
#define RCVERSION 4, 5, 10, 1
|
||||
#define _RCVERSION_ "4, 5, 10, 1"
|
||||
#define VERSION_STR "4.5.1"
|
||||
#define VERSION_CODE 0x0405006E
|
||||
#define RCVERSION 4, 5, 11, 0
|
||||
#define _RCVERSION_ "4, 5, 11, 0"
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user