Compare commits
No commits in common. "master" and "master" have entirely different histories.
@ -10,7 +10,6 @@
|
|||||||
#include "hooklib/reg.h"
|
#include "hooklib/reg.h"
|
||||||
#include "hook/procaddr.h"
|
#include "hook/procaddr.h"
|
||||||
#include "hooklib/serial.h"
|
#include "hooklib/serial.h"
|
||||||
#include "platform/clock.h"
|
|
||||||
|
|
||||||
#include "util/dprintf.h"
|
#include "util/dprintf.h"
|
||||||
|
|
||||||
@ -97,7 +96,6 @@ static HMODULE WINAPI my_LoadLibraryW(const wchar_t *name)
|
|||||||
path_hook_insert_hooks(result);
|
path_hook_insert_hooks(result);
|
||||||
reg_hook_insert_hooks(result);
|
reg_hook_insert_hooks(result);
|
||||||
proc_addr_insert_hooks(result);
|
proc_addr_insert_hooks(result);
|
||||||
clock_hook_insert_hooks(result);
|
|
||||||
serial_hook_apply_hooks(result);
|
serial_hook_apply_hooks(result);
|
||||||
iohook_apply_hooks(result);
|
iohook_apply_hooks(result);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "hooklib/reg.h"
|
#include "hooklib/reg.h"
|
||||||
#include "hook/procaddr.h"
|
#include "hook/procaddr.h"
|
||||||
#include "hooklib/serial.h"
|
#include "hooklib/serial.h"
|
||||||
#include "platform/clock.h"
|
|
||||||
|
|
||||||
#include "util/dprintf.h"
|
#include "util/dprintf.h"
|
||||||
|
|
||||||
@ -108,7 +107,6 @@ static HMODULE WINAPI my_LoadLibraryW(const wchar_t *name)
|
|||||||
path_hook_insert_hooks(result);
|
path_hook_insert_hooks(result);
|
||||||
reg_hook_insert_hooks(result);
|
reg_hook_insert_hooks(result);
|
||||||
proc_addr_insert_hooks(result);
|
proc_addr_insert_hooks(result);
|
||||||
clock_hook_insert_hooks(result);
|
|
||||||
serial_hook_apply_hooks(result);
|
serial_hook_apply_hooks(result);
|
||||||
iohook_apply_hooks(result);
|
iohook_apply_hooks(result);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include "hooklib/dll.h"
|
#include "hooklib/dll.h"
|
||||||
#include "hooklib/path.h"
|
#include "hooklib/path.h"
|
||||||
#include "platform/clock.h"
|
|
||||||
|
|
||||||
#include "util/dprintf.h"
|
#include "util/dprintf.h"
|
||||||
|
|
||||||
@ -89,7 +88,6 @@ static HMODULE WINAPI my_LoadLibraryW(const wchar_t *name)
|
|||||||
|
|
||||||
dll_hook_insert_hooks(result);
|
dll_hook_insert_hooks(result);
|
||||||
path_hook_insert_hooks(result);
|
path_hook_insert_hooks(result);
|
||||||
clock_hook_insert_hooks(result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "hook/table.h"
|
#include "hook/table.h"
|
||||||
#include "hook/procaddr.h"
|
|
||||||
|
|
||||||
#include "platform/clock.h"
|
#include "platform/clock.h"
|
||||||
|
|
||||||
@ -20,9 +19,7 @@ static BOOL WINAPI my_SetTimeZoneInformation(TIME_ZONE_INFORMATION *tzinfo);
|
|||||||
|
|
||||||
static BOOL (WINAPI * next_GetSystemTimeAsFileTime)(FILETIME *out);
|
static BOOL (WINAPI * next_GetSystemTimeAsFileTime)(FILETIME *out);
|
||||||
static int64_t clock_current_day;
|
static int64_t clock_current_day;
|
||||||
static bool clock_timezone;
|
|
||||||
static bool clock_time_warp;
|
static bool clock_time_warp;
|
||||||
static bool clock_writeable;
|
|
||||||
|
|
||||||
static const struct hook_symbol clock_base_hook_syms[] = {
|
static const struct hook_symbol clock_base_hook_syms[] = {
|
||||||
{
|
{
|
||||||
@ -161,7 +158,7 @@ static BOOL WINAPI my_GetSystemTime(SYSTEMTIME *out)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(LOG_CLOCK)
|
#if 0
|
||||||
static int last_second;
|
static int last_second;
|
||||||
|
|
||||||
if (out->wSecond != last_second) {
|
if (out->wSecond != last_second) {
|
||||||
@ -228,41 +225,35 @@ HRESULT clock_hook_init(const struct clock_config *cfg)
|
|||||||
{
|
{
|
||||||
assert(cfg != NULL);
|
assert(cfg != NULL);
|
||||||
|
|
||||||
clock_timezone = cfg->timezone;
|
|
||||||
clock_time_warp = cfg->timewarp;
|
clock_time_warp = cfg->timewarp;
|
||||||
clock_writeable = cfg->writeable;
|
|
||||||
|
|
||||||
clock_hook_insert_hooks(NULL);
|
if (cfg->timezone || cfg->timewarp || !cfg->writeable) {
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void clock_hook_insert_hooks(HMODULE target) {
|
|
||||||
if (clock_timezone || clock_time_warp || !clock_writeable) {
|
|
||||||
/* All the clock hooks require the core GSTAFT hook to be installed */
|
/* All the clock hooks require the core GSTAFT hook to be installed */
|
||||||
/* Note the ! up there btw. */
|
/* Note the ! up there btw. */
|
||||||
|
|
||||||
hook_table_apply(
|
hook_table_apply(
|
||||||
target,
|
NULL,
|
||||||
"kernel32.dll",
|
"kernel32.dll",
|
||||||
clock_base_hook_syms,
|
clock_base_hook_syms,
|
||||||
_countof(clock_base_hook_syms));
|
_countof(clock_base_hook_syms));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clock_timezone) {
|
if (cfg->timezone) {
|
||||||
hook_table_apply(
|
hook_table_apply(
|
||||||
target,
|
NULL,
|
||||||
"kernel32.dll",
|
"kernel32.dll",
|
||||||
clock_read_hook_syms,
|
clock_read_hook_syms,
|
||||||
_countof(clock_read_hook_syms));
|
_countof(clock_read_hook_syms));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clock_writeable) {
|
if (!cfg->writeable) {
|
||||||
/* Install hook if this config parameter is FALSE! */
|
/* Install hook if this config parameter is FALSE! */
|
||||||
hook_table_apply(
|
hook_table_apply(
|
||||||
target,
|
NULL,
|
||||||
"kernel32.dll",
|
"kernel32.dll",
|
||||||
clock_write_hook_syms,
|
clock_write_hook_syms,
|
||||||
_countof(clock_write_hook_syms));
|
_countof(clock_write_hook_syms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -11,4 +11,3 @@ struct clock_config {
|
|||||||
};
|
};
|
||||||
|
|
||||||
HRESULT clock_hook_init(const struct clock_config *cfg);
|
HRESULT clock_hook_init(const struct clock_config *cfg);
|
||||||
void clock_hook_insert_hooks(HMODULE target);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user