本文整理汇总了C++中StompHook::installHook方法的典型用法代码示例。如果您正苦于以下问题:C++ StompHook::installHook方法的具体用法?C++ StompHook::installHook怎么用?C++ StompHook::installHook使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StompHook
的用法示例。
在下文中一共展示了StompHook::installHook方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PatchCoD4_Console
void PatchCoD4_Console()
{
memset((void*)0x4FCB73, 0x90, 9); // disable null check
hCreateWindow.initialize(SYS_CREATEWINDOW_HOOK, Sys_CreateConsole);
hCreateWindow.installHook();
hDestroyWindow.initialize(SYS_DESTROYWINDOW_HOOK, Sys_DestroyConsole);
hDestroyWindow.installHook();
hSysPrint.initialize(SYS_PRINT_HOOK, Sys_Print);
hSysPrint.installHook();
}
示例2: PatchMW2_Stats
void PatchMW2_Stats()
{
writeStatsHook.initialize(writeStatsHookLoc, WriteStatsHookStub);
writeStatsHook.installHook();
loadOldStatsHook.initialize(loadOldStatsHookLoc, LoadOldStatsHookFunc);
loadOldStatsHook.installHook();
readStatsHook.initialize(readStatsHookLoc, ReadStatsHookStub);
readStatsHook.installHook();
// make statWriteNeeded ignored (kill stat saving?)
//*(BYTE*)0x424BD0 = 0xEB;
}
示例3: PatchT4_NoBorder
void PatchT4_NoBorder()
{
r_noborder = Dvar_RegisterBool(0, "r_noborder", DVAR_FLAG_ARCHIVE, "Remove the border when running in windowed mode (set vid_xpos and vid_ypos to 0).");
windowedWindowStyleHook.initialize(windowedWindowStyleHookLoc, WindowedWindowStyleHookStub, 5, false);
windowedWindowStyleHook.installHook();
}
示例4: PatchMW2_NoBorder
void PatchMW2_NoBorder()
{
r_noborder = Dvar_RegisterBool("r_noborder", true, DVAR_FLAG_SAVED, "Do not use a border in windowed mode");
windowedWindowStyleHook.initialize(windowedWindowStyleHookLoc, WindowedWindowStyleHookStub, 5, false);
windowedWindowStyleHook.installHook();
}
示例5: PatchMW2_WeaponCamos
void PatchMW2_WeaponCamos()
{
#if PRE_RELEASE_DEMO
// before enabling: g_modelindex: overflow
return;
#endif
xModelTable.set_empty_key("");
xMaterialTable.set_empty_key("");
/*
xModelLoadHook.initialize(xModelLoadHookLoc, XModelLoadHookFunc);
xModelLoadHook.installHook();
xModelLoadHook2.initialize(xModelLoadHook2Loc, XModelLoadHookFunc);
xModelLoadHook2.installHook();
xModelLoadHook3.initialize(xModelLoadHook3Loc, XModelLoadHookFunc);
xModelLoadHook3.installHook();
*/
forEachXAssetHook.initialize(forEachXAssetHookLoc, ForEachXAssetHookStub);
forEachXAssetHook.installHook();
postWeaponLoadHook.initialize(postWeaponLoadHookLoc, PostWeaponLoadHookStub);
postWeaponLoadHook.installHook();
}
示例6: PatchMW2_StringTable
// entry point
void PatchMW2_StringTable()
{
stringTables.set_empty_key("");
stringTableHook.initialize(stringTableHookLoc, StringTable_GetAsset);
stringTableHook.installHook();
}
示例7:
static void PatchMW2_ClientConsole_Toggle()
{
clKeyEventToggleConsoleHook1.initialize((PBYTE)clKeyEventToggleConsoleHook1Loc);
clKeyEventToggleConsoleHook1.installHook(Con_ToggleConsole, false);
clKeyEventToggleConsoleHook2.initialize(5, (PBYTE)clKeyEventToggleConsoleHook2Loc);
clKeyEventToggleConsoleHook2.installHook(Con_ToggleConsole, true, false);
}
示例8: PatchMW2_Materialism
void PatchMW2_Materialism()
{
materialTable.set_empty_key("");
materialLoadHook.initialize(materialLoadHookLoc, MaterialLoadHookFunc);
materialLoadHook.installHook();
Cmd_AddCommand("materialTableDebug", Material_TableDebug_f, &tDebugCmd, 0);
}
示例9: PatchMW2_Console
// patch entry point
void PatchMW2_Console()
{
createConsoleHook.initialize(5, (PBYTE)HOOK_Sys_CreateConsole);
createConsoleHook.installHook(Sys_CreateConsole, true, false);
destroyConsoleHook.initialize(5, (PBYTE)HOOK_Sys_DestroyConsole);
destroyConsoleHook.installHook(Sys_DestroyConsole, true, false);
// TODO: get rid of weird casts
sysPrintHook.initialize(5, (PBYTE)HOOK_Sys_Print);
sysPrintHook.installHook((void (__cdecl *)(void))Sys_Print, true, false);
sysErrorHook.initialize(5, (PBYTE)HOOK_Sys_Error);
sysErrorHook.installHook((void (__cdecl *)(void))Sys_Error, true, false);
consoleInputHook.initialize((PBYTE)HOOK_Sys_ConsoleInput);
consoleInputHook.installHook((void (__cdecl *)(void))Sys_ConsoleInput, false);
//PatchMW2_DebugAllocations();
}
示例10: PatchMW2_LocalizedStrings
void PatchMW2_LocalizedStrings()
{
_localizedStrings.set_empty_key("");
loadLocalizeHook.initialize(loadLocalizeHookLoc, SEH_GetLocalizedString);
loadLocalizeHook.installHook();
call(0x4CE5EE, SetString, PATCH_CALL); //instead of calling CStringEdPackage::SetString in CStringEdPackage::ParseLine we call our SetString
call(0x41D860, SELoadLanguageHookStub, PATCH_JUMP); //instead of the game loading str files according to loc_language we load them according to loc_modlanguage
Dvar_RegisterEnum("loc_modLanguage", ModLanguageEnum, 0, DVAR_FLAG_SAVED, "Preferred language for custom localized strings.");
}
示例11: PatchMW2_Load
void PatchMW2_Load()
{
// rawfile moddability
rawFileHook1.initialize(rawFileHook1Loc, LoadModdableRawfileStub);
rawFileHook1.installHook();
rawFileHook2.initialize(rawFileHook2Loc, LoadModdableRawfileStub);
rawFileHook2.installHook();
rawFileHook3.initialize(rawFileHook3Loc, LoadModdableRawfileStub);
rawFileHook3.installHook();
rawFileHook4.initialize(rawFileHook4Loc, LoadModdableRawfileStub2);
rawFileHook4.installHook();
rawFileHook5.initialize(rawFileHook5Loc, LoadModdableRawfileStub);
rawFileHook5.installHook();
rawFileHook6.initialize(rawFileHook6Loc, LoadModdableRawfileStub);
rawFileHook6.installHook();
rawFileHook7.initialize(rawFileHook7Loc, LoadModdableRawfileStub);
rawFileHook7.installHook();
rawFileHook8.initialize(rawFileHook8Loc, LoadModdableRawfileStub);
rawFileHook8.installHook();
//rawFileHook9.initialize(rawFileHook9Loc, LoadModdableRawfileStub);
//rawFileHook9.installHook();
//rawFileHook10.initialize(rawFileHook10Loc, LoadModdableRawfileStub);
//rawFileHook10.installHook();
// fastfile loading hooks
uiLoadHook1.initialize(uiLoadHook1Loc, UILoadHook1Stub);
uiLoadHook1.installHook();
ffLoadHook1.initialize(ffLoadHook1Loc, FFLoadHook1Stub);
ffLoadHook1.installHook();
ffLoadHook2.initialize(ffLoadHook2Loc, FFLoadHook2Stub);
ffLoadHook2.installHook();
zoneLoadHook1.initialize(zoneLoadHook1Loc, ZoneLoadHook1Stub);
zoneLoadHook1.installHook();
zoneLoadHook2.initialize(zoneLoadHook2Loc, ZoneLoadHook2Stub);
zoneLoadHook2.installHook();
getZoneRootHook.initialize(getZoneRootHookLoc, GetZoneRootHookFunc);
getZoneRootHook.installHook();
// disable 'ignoring asset' notices
memset((void*)0x5BB902, 0x90, 5);
// ignore 'no iwd files found in main'
memset((void*)0x642A4B, 0x90, 5);
if (strstr(GetCommandLine(), "fs_cdpath") != NULL)
{
// fs_basepath for 'players' -> fs_cdpath
*(DWORD*)0x482408 = 0x63D0BB0;
}
// zone folders -> remove absolute stuff
zoneTestHook.initialize(zoneTestHookLoc, ZoneTestHookFunc);
zoneTestHook.installHook();
zoneSprintfHook.initialize(zoneSprintfHookLoc, ZoneSprintfHookFunc);
zoneSprintfHook.installHook();
}
示例12: PatchIW3_VA
void PatchIW3_VA()
{
vaHook.initialize(vaHookLoc, va);
vaHook.installHook();
}
示例13: PatchSP
void PatchSP()
{
// cg_fov unprotect
*(DWORD*)0x4A3921 = DVAR_ARCHIVE;
// small fix for infinite waiting for other players
*(BYTE*)0x5026BC = 0x0;
// function changes
Com_Error = (Com_Error_t)0x651D90;
Com_Printf = (Com_Printf_t)0x43BF30;
// disable bandwidth testing / better match finding
*(WORD*)0x693842 = 0x9090;
// enable console (normally this check is !monkeytoy || blah; now it's only 'blah'
*(BYTE*)0x58761C = 0xEB;
// console toggling
toggleConsoleHook1.initialize("", (PBYTE)toggleConsoleHook1Loc);
toggleConsoleHook1.installHook((void(*)())Con_ToggleConsole, false);
toggleConsoleHook2.initialize("", (PBYTE)toggleConsoleHook2Loc);
toggleConsoleHook2.installHook((void(*)())Con_ToggleConsole, false);
// player_sustainAmmo re-adding
sustainAmmoHook.initialize("", 7, (PBYTE)sustainAmmoHookLoc);
sustainAmmoHook.installHook(SustainAmmoHookFunc, true, false);
// cg_drawVersion
*(BYTE*)0x4A3D46 = 1; // default
*(BYTE*)0x4A3D44 = 0x50; // flags
// y 450, x 10
*(DWORD*)0x4A3D7A = (DWORD)&drawVersionX;
*(DWORD*)0x4A3DAF = (DWORD)&drawVersionY;
*(DWORD*)0x9A33FC = (DWORD)customTimeBeginPeriod;
// set port to 28960
*(DWORD*)0x52E1D5 = 28960;
// disable UPnP
//*(WORD*)0x973C6B = 0x9090;
// remove the windows hook setting function
//*(BYTE*)0x8683D0 = 0xC3;
// con stuff
*(WORD*)0x79E6E5 = 0x9090; // dvar set 1
*(BYTE*)0x5119B0 = 0xC3; // dvar reset flag
*(WORD*)0x4A87EB = 0x9090; // dvar exec
*(WORD*)0x829CBE = 0x9090; // cmd exec
*(WORD*)0x5F5D4E = 0x9090; // dvar enum
*(WORD*)0x610A94 = 0x9090; // cmd enum
windowedWindowStyleHook.initialize("aaaaa", 5, (PBYTE)windowedWindowStyleHookLoc);
windowedWindowStyleHook.installHook(WindowedWindowStyleHookStub, false, false);
// gethostbyname
*(DWORD*)0x9A3470 = (DWORD)custom_gethostbyname;
// small fix for infinite waiting for other players
*(BYTE*)0x5026BC = 0x03;
}