Remove useless code for Win32 diversions.
This commit is contained in:
parent
8ad42b6b1c
commit
bfcb7051fb
@ -50,14 +50,8 @@ typedef struct
|
||||
}
|
||||
zzuf_table_t;
|
||||
|
||||
# define DIVERT(x) { "kernel32.dll", #x, \
|
||||
(void **)&x##_orig, (void *)x##_new }
|
||||
# define DIVERT_END { NULL, NULL, NULL, NULL }
|
||||
|
||||
extern zzuf_table_t table_stream[],
|
||||
table_win32[];
|
||||
extern zzuf_table_t table_win32[];
|
||||
|
||||
#else
|
||||
# error no function diversion system for this platform
|
||||
#endif
|
||||
|
||||
|
||||
@ -1145,15 +1145,3 @@ int NEW(__uflow)(FILE *fp)
|
||||
int ret; ZZ_REFILL(__uflow, 1); return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Win32 function table */
|
||||
#if defined _WIN32
|
||||
zzuf_table_t table_stream[] =
|
||||
{
|
||||
DIVERT(fopen),
|
||||
DIVERT(fread),
|
||||
DIVERT(fclose),
|
||||
DIVERT_END
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@ -113,6 +113,10 @@ BOOL __stdcall NEW(CloseHandle)(HANDLE hObject)
|
||||
|
||||
/* Win32 function table */
|
||||
#if defined _WIN32
|
||||
# define DIVERT(x) { "kernel32.dll", #x, \
|
||||
(void **)&x##_orig, (void *)x##_new }
|
||||
# define DIVERT_END { NULL, NULL, NULL, NULL }
|
||||
|
||||
zzuf_table_t table_win32[] =
|
||||
{
|
||||
#if defined HAVE_CLOSEHANDLE
|
||||
|
||||
@ -93,7 +93,6 @@ static void insert_funcs(void *module)
|
||||
{
|
||||
static zzuf_table_t *list[] =
|
||||
{
|
||||
table_stream,
|
||||
table_win32,
|
||||
};
|
||||
|
||||
@ -139,7 +138,7 @@ static void insert_funcs(void *module)
|
||||
continue;
|
||||
|
||||
/* FIXME: The StarCraft 2 hack uses two methods for function
|
||||
* diversion. See HookSsdt() and HookHotPatch(). */
|
||||
* diversion. See HookSsdt() and HookHotPatch(). */
|
||||
VirtualProtect(func, sizeof(func), PAGE_EXECUTE_READWRITE, &dummy);
|
||||
WriteProcessMemory(GetCurrentProcess(), func, &diversion->new,
|
||||
sizeof(diversion->new), NULL);
|
||||
@ -150,4 +149,3 @@ static void insert_funcs(void *module)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user