1
0
mirror of https://github.com/UzixLS/KernelEx.git synced 2025-07-19 07:21:20 +03:00

import KernelEx-4.5.1

This commit is contained in:
UzixLS
2018-11-03 16:23:39 +03:00
parent 7571e3c60d
commit 2948e23961
77 changed files with 2603 additions and 883 deletions

View File

@ -60,12 +60,12 @@ bool KexLinkage::Prepare()
"kexResetModuleSettings");
m_kexGetKEXVersion = (kexGetKEXVersion_t) GetProcAddress(hKernelEx,
"kexGetKEXVersion");
m_kexIsDebugCore = (kexIsDebugCore_t) GetProcAddress(hKernelEx,
"kexIsDebugCore");
m_kexGetCoreCaps = (kexGetCoreCaps_t) GetProcAddress(hKernelEx,
"kexGetCoreCaps");
if (!m_kexGetModuleSettings || !m_kexSetModuleSettings
|| !m_kexResetModuleSettings
|| !m_kexGetKEXVersion || !m_kexIsDebugCore)
|| !m_kexGetKEXVersion || !m_kexGetCoreCaps)
return false;
//read config file location from registry

View File

@ -38,7 +38,7 @@ class KexLinkage
const char* conf_name, DWORD mod_flags);
typedef void (*kexResetModuleSettings_t)(const char* module);
typedef unsigned long (*kexGetKEXVersion_t)(void);
typedef int (*kexIsDebugCore_t)(void);
typedef DWORD (*kexGetCoreCaps_t)(void);
public:
@ -60,7 +60,7 @@ public:
kexSetModuleSettings_t m_kexSetModuleSettings;
kexResetModuleSettings_t m_kexResetModuleSettings;
kexGetKEXVersion_t m_kexGetKEXVersion;
kexIsDebugCore_t m_kexIsDebugCore;
kexGetCoreCaps_t m_kexGetCoreCaps;
protected:
KexLinkage();

View File

@ -8,7 +8,7 @@
#define TIP_SYSTEM 4
#define TIP_NOINHERIT 5
#define TIP_OVERRIDE 6
#define TIP_LOG 7
#define TIP_HOOK 7
#define IDS_ENABLED 8
#define IDS_DISABLED 9
#define IDD_PROPPAGE 102
@ -20,7 +20,7 @@
#define IDC_KEXVER 1005
#define IDC_GCOMPAT 1006
#define IDC_TCOMPAT 1007
#define IDC_LOG 1008
#define IDC_HOOK 1008
#define IDC_NOINHERIT 1009
#define IDC_GADVAN 1010
#define IDC_CHECK1 1011

View File

@ -36,12 +36,12 @@ struct CTips
char* _TIP_SYSTEM;
char* _TIP_NOINHERIT;
char* _TIP_OVERRIDE;
char* _TIP_LOG;
char* _TIP_HOOK;
CTips()
{
_TIP_DEFAULT = _TIP_DISABLE = _TIP_COMPAT = _TIP_SYSTEM
= _TIP_NOINHERIT = _TIP_OVERRIDE = _TIP_LOG = NULL;
= _TIP_NOINHERIT = _TIP_OVERRIDE = _TIP_HOOK = NULL;
loaded = false;
}
@ -55,7 +55,7 @@ struct CTips
free(_TIP_SYSTEM);
free(_TIP_NOINHERIT);
free(_TIP_OVERRIDE);
free(_TIP_LOG);
free(_TIP_HOOK);
}
}
@ -70,7 +70,7 @@ struct CTips
_TIP_SYSTEM = load_string(TIP_SYSTEM);
_TIP_NOINHERIT = load_string(TIP_NOINHERIT);
_TIP_OVERRIDE = load_string(TIP_OVERRIDE);
_TIP_LOG = load_string(TIP_LOG);
_TIP_HOOK = load_string(TIP_HOOK);
}
private:
@ -372,7 +372,7 @@ BOOL CALLBACK KexShlExt::DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
case IDC_DEFAULT:
if (!IsDlgButtonChecked(hwnd, IDC_DEFAULT)) break;
EnableWindow(GetDlgItem(hwnd, IDC_SYSTEM), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_LOG), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_HOOK), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_NOINHERIT), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_OVERRIDE), FALSE);
PropSheet_Changed(GetParent(hwnd), hwnd);
@ -380,7 +380,7 @@ BOOL CALLBACK KexShlExt::DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
case IDC_DISABLE:
if (!IsDlgButtonChecked(hwnd, IDC_DISABLE)) break;
EnableWindow(GetDlgItem(hwnd, IDC_SYSTEM), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_LOG), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_HOOK), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_NOINHERIT), TRUE);
EnableWindow(GetDlgItem(hwnd, IDC_OVERRIDE), TRUE);
PropSheet_Changed(GetParent(hwnd), hwnd);
@ -388,14 +388,15 @@ BOOL CALLBACK KexShlExt::DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
case IDC_COMPAT:
if (!IsDlgButtonChecked(hwnd, IDC_COMPAT)) break;
EnableWindow(GetDlgItem(hwnd, IDC_SYSTEM), TRUE);
EnableWindow(GetDlgItem(hwnd, IDC_LOG), TRUE);
EnableWindow(GetDlgItem(hwnd, IDC_HOOK), TRUE);
EnableWindow(GetDlgItem(hwnd, IDC_NOINHERIT), TRUE);
EnableWindow(GetDlgItem(hwnd, IDC_OVERRIDE), TRUE);
PropSheet_Changed(GetParent(hwnd), hwnd);
break;
case IDC_SYSTEM:
case IDC_LOG:
case IDC_HOOK:
case IDC_NOINHERIT:
case IDC_OVERRIDE:
PropSheet_Changed(GetParent(hwnd), hwnd);
break;
}
@ -438,7 +439,7 @@ void KexShlExt::OnInitDialog(HWND hwnd, ModuleSetting* ms)
{
CheckDlgButton(hwnd, IDC_DEFAULT, BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDC_SYSTEM), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_LOG), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_HOOK), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_NOINHERIT), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_OVERRIDE), FALSE);
}
@ -446,10 +447,10 @@ void KexShlExt::OnInitDialog(HWND hwnd, ModuleSetting* ms)
{
CheckDlgButton(hwnd, IDC_DISABLE, BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDC_SYSTEM), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_LOG), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_HOOK), FALSE);
}
if (ms->flags & KRF_LOG_APIS)
CheckDlgButton(hwnd, IDC_LOG, BST_CHECKED);
if (ms->flags & KRF_HOOK_APIS)
CheckDlgButton(hwnd, IDC_HOOK, BST_CHECKED);
if (ms->flags & KRF_NO_INHERIT)
CheckDlgButton(hwnd, IDC_NOINHERIT, BST_CHECKED);
if (ms->flags & KRF_OVERRIDE_PROC_MOD)
@ -470,25 +471,27 @@ void KexShlExt::OnInitDialog(HWND hwnd, ModuleSetting* ms)
(WPARAM) 0, (LPARAM) bufo);
}
int debug = KexLinkage::instance.m_kexIsDebugCore();
DWORD caps = KexLinkage::instance.m_kexGetCoreCaps();
{
//set KernelEx version
unsigned long ver = KexLinkage::instance.m_kexGetKEXVersion();
char ver_s[32];
snprintf(ver_s, sizeof(ver_s), "KernelEx Core v%d.%d.%d %s",
ver>>24, (ver>>16) & 0xff, ver & 0xffff, debug ? "DEBUG" : "");
snprintf(ver_s, sizeof(ver_s), "KernelEx Core v%d.%d.%d %s", ver>>24,
(ver>>16) & 0xff, ver & 0xffff, caps & KCC_DEBUG ? "DEBUG" : "");
SendMessage(GetDlgItem(hwnd, IDC_KEXVER), WM_SETTEXT, 0, (LPARAM) ver_s);
}
ShowWindow(GetDlgItem(hwnd, IDC_OVERRIDE), debug ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDC_LOG), debug ? SW_SHOW : SW_HIDE);
if (!debug)
ShowWindow(GetDlgItem(hwnd, IDC_HOOK), caps & KCC_APIHOOK ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDC_OVERRIDE), caps & KCC_DEBUG ? SW_SHOW : SW_HIDE);
if (!(caps & KCC_DEBUG))
{
RECT r;
HWND h = GetDlgItem(hwnd, IDC_GADVAN);
GetWindowRect(h, &r);
r.bottom -= 40; //height between IDC_LOG and element above
r.bottom -= 20; //space between IDC_HOOK and element above
if (!(caps & KCC_APIHOOK))
r.bottom -= 20;
SetWindowPos(h, NULL, 0, 0, r.right - r.left, r.bottom - r.top, SWP_NOMOVE);
}
@ -500,8 +503,8 @@ void KexShlExt::OnInitDialog(HWND hwnd, ModuleSetting* ms)
CreateTooltip(hwndTip, hwnd, IDC_COMPAT, tips._TIP_COMPAT);
CreateTooltip(hwndTip, hwnd, IDC_SYSTEM, tips._TIP_SYSTEM);
CreateTooltip(hwndTip, hwnd, IDC_NOINHERIT, tips._TIP_NOINHERIT);
CreateTooltip(hwndTip, hwnd, IDC_HOOK, tips._TIP_HOOK);
CreateTooltip(hwndTip, hwnd, IDC_OVERRIDE, tips._TIP_OVERRIDE);
CreateTooltip(hwndTip, hwnd, IDC_LOG, tips._TIP_LOG);
}
@ -517,8 +520,8 @@ void KexShlExt::OnApply(HWND hwnd)
if (IsDlgButtonChecked(hwnd, IDC_COMPAT))
conf = KexLinkage::instance.confs[SendMessage(
GetDlgItem(hwnd, IDC_SYSTEM), CB_GETCURSEL, 0, 0)].name;
if (IsDlgButtonChecked(hwnd, IDC_LOG))
flags |= KRF_LOG_APIS;
if (IsDlgButtonChecked(hwnd, IDC_HOOK))
flags |= KRF_HOOK_APIS;
if (IsDlgButtonChecked(hwnd, IDC_NOINHERIT))
flags |= KRF_NO_INHERIT;
if (IsDlgButtonChecked(hwnd, IDC_OVERRIDE))

View File

@ -54,8 +54,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,6
PRODUCTVERSION 1,0,0,6
FILEVERSION 1,0,0,7
PRODUCTVERSION 1,0,0,7
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -72,15 +72,15 @@ BEGIN
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Xeno86\0"
VALUE "FileDescription", "sheet\0"
VALUE "FileVersion", "1, 0, 0, 6\0"
VALUE "FileDescription", "KernelEx Properties Tab\0"
VALUE "FileVersion", "1, 0, 0, 7\0"
VALUE "InternalName", "sheet\0"
VALUE "LegalCopyright", "Copyright <20> 2009-2010, Xeno86\0"
VALUE "LegalCopyright", "Copyright <20> 2009-2011, Xeno86\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "sheet.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "KernelEx\0"
VALUE "ProductVersion", "1, 0, 0, 6\0"
VALUE "ProductVersion", "1, 0, 0, 7\0"
VALUE "SpecialBuild", "\0"
END
END
@ -134,10 +134,10 @@ BEGIN
CONTROL "Don't use these settings in child processes",
IDC_NOINHERIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,
127,208,10
CONTROL "Use API hook",IDC_HOOK,"Button",BS_AUTOCHECKBOX | NOT
WS_VISIBLE | WS_TABSTOP,15,141,208,10
CONTROL "Override settings of invidual modules",IDC_OVERRIDE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,141,208,10
CONTROL "Enable api logging",IDC_LOG,"Button",BS_AUTOCHECKBOX |
NOT WS_VISIBLE | WS_TABSTOP,15,155,208,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,155,208,10
END
@ -173,7 +173,7 @@ BEGIN
TIP_SYSTEM "Select desired compatibility mode from the list."
TIP_NOINHERIT "Disables inheritance of these settings. Normally programs started by this application use settings from this tab as their default settings. Use this option to disable such behaviour."
TIP_OVERRIDE "Disables usage of per module settings. Use this option to use same settings for all modules in the application."
TIP_LOG "Use this option to enable api spying debugging feature."
TIP_HOOK "Use this option to enable api hooking debugging feature."
IDS_ENABLED "KernelEx is enabled"
IDS_DISABLED "KernelEx is disabled"
END