当前位置: 首页>>代码示例>>C++>>正文


C++ CallHook类代码示例

本文整理汇总了C++中CallHook的典型用法代码示例。如果您正苦于以下问题:C++ CallHook类的具体用法?C++ CallHook怎么用?C++ CallHook使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CallHook类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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();
}
开发者ID:Call-of-Duty-Scripts,项目名称:fourdeltaone,代码行数:27,代码来源:PatchMW2WeaponCamos.cpp

示例2: PatchMW2_SuicideMessages

void PatchMW2_SuicideMessages()
{
	srand((unsigned int)time(NULL));

	printObituaryHook.initialize(printObituaryHookLoc, PrintObituaryHookStub);
	printObituaryHook.installHook();
}
开发者ID:JohannesHei,项目名称:iw4m-lan,代码行数:7,代码来源:PatchMW2SuicideMessages.cpp

示例3:

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);
}
开发者ID:HOOman33,项目名称:openiwnet-iw4,代码行数:8,代码来源:PatchMW2ClientConsole.cpp

示例4: PatchMW2_UserAvatars

void PatchMW2_UserAvatars()
{
	call(0x594295, SetPlayerCardInfoHook, PATCH_CALL);

	initGFXImages.initialize(initGFXImagesLoc, InitGFXImagesHook);
	initGFXImages.installHook();

	call(0x59449F, OnServerCommandStub, PATCH_JUMP);

	call(0x5910BC, DrawScoreboardRankStub, PATCH_CALL);
}
开发者ID:Call-of-Duty-Scripts,项目名称:fourdeltaone,代码行数:11,代码来源:UserAvatars.cpp

示例5: PatchMW2_RemoteConsoleServer

void PatchMW2_RemoteConsoleServer()
{
	// maximum size in NET_OutOfBandPrint
	*(DWORD*)0x4AEF08 = 0x1FFFC;
	*(DWORD*)0x4AEFA3 = 0x1FFFC;

	// client-side OOB handler
	*(int*)0x5AA715 = ((DWORD)SVC_RemoteCommandStub) - 0x5AA713 - 6;

	gsrCmpHook.initialize((PBYTE)gsrCmpHookLoc);
	gsrCmpHook.installHook(GsrCmpHookStub, false);
}
开发者ID:HOOman33,项目名称:openiwnet-iw4,代码行数:12,代码来源:PatchMW2RemoteConsoleSV.cpp

示例6: PatchMW2_OOB

void PatchMW2_OOB()
{
	// maximum size in NET_OutOfBandPrint
	*(DWORD*)0x4AEF08 = 0x1FFFC;
	*(DWORD*)0x4AEFA3 = 0x1FFFC;

	// client-side OOB handler
	*(int*)0x5AA715 = ((DWORD)CL_DeployOOBStub) - 0x5AA713 - 6;

	gsrCmpHook.initialize(gsrCmpHookLoc, GsrCmpHookStub);
	gsrCmpHook.installHook();
}
开发者ID:Call-of-Duty-Scripts,项目名称:fourdeltaone,代码行数:12,代码来源:PatchMW2OOB.cpp

示例7: 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;
}
开发者ID:JohannesHei,项目名称:iw4m-lan,代码行数:14,代码来源:PatchMW2Stats.cpp

示例8: PatchMW2_OOB

void PatchMW2_OOB()
{
	if(version == 159)
	{
		// client-side OOB handler
		*(int*)0x65E454 = ((DWORD)CL_DeployOOBStub) - 0x65E452 - 6;
	}
	else
	{
		// client-side OOB handler
		*(int*)0x65BCE4 = ((DWORD)CL_DeployOOBStub) - 0x65BCE2 - 6;

		gsrCmpHookLoc = 0x65BCD8;
	}

	gsrCmpHook.initialize(gsrCmpHookLoc, GsrCmpHookStub);
	gsrCmpHook.installHook();
}
开发者ID:snitchedits,项目名称:cod-mod,代码行数:18,代码来源:PatchMW2_OOB.cpp

示例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();
}
开发者ID:HOOman33,项目名称:openiwnet-iw4,代码行数:21,代码来源:PatchMW2Console.cpp

示例10: PatchMW2_Branding

void PatchMW2_Branding()
{
	cg_hideVersion = Dvar_RegisterBool("cg_hideVersion", false, DVAR_FLAG_SAVED, "Hide the version release branding text.");

	drawDevStuffHook.initialize(drawDevStuffHookLoc, DrawDevStuffHookStub);
	drawDevStuffHook.installHook();

	// createwindowexa on winconsole
	static DWORD wcCWEx = (DWORD)CreateWindowExAWrap_WC;
	static DWORD wcGEx = (DWORD)CreateWindowExAWrap_G;
	*(DWORD**)0x4289CA = &wcCWEx;
	*(DWORD**)0x5076AC = &wcGEx;

	// displayed build tag in UI code
	*(DWORD*)0x43F73B = (DWORD)"";

	// console '%s: %s> ' string
	*(DWORD*)0x5A44B4 = (DWORD)(VERSIONSTRING "> ");

	// console version string
	*(DWORD*)0x4B12BB = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// version string
	*(DWORD*)0x60BD56 = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// set fs_basegame to 'iw4lan' (will apply before fs_game, unlike the above line)
	*(DWORD*)0x6431D1 = (DWORD)"iw4lan";

	// increase font sizes for chat on higher resolutions
	static float float13 = 13.0f;
	static float float10 = 10.0f;
	*(float**)0x5814AE = &float13;
	*(float**)0x5814C8 = &float10;

#ifndef MATCHMAKING
	// use M2 playlists
	strcpy((char*)0x6EE7AC, "mp_playlists_m2");
	*(DWORD*)0x4D47FB = (DWORD)"mp_playlists_m2.ff";
#endif
}
开发者ID:enghama,项目名称:iw4lan,代码行数:40,代码来源:PatchMW2Branding.cpp

示例11: PatchMW2_Load

void PatchMW2_Load()
{
	zoneLoadHook1.initialize(zoneLoadHook1Loc, ZoneLoadHook1Stub);
	zoneLoadHook1.installHook();

	zoneLoadHook2.initialize(zoneLoadHook2Loc, ZoneLoadHook2Stub);
	zoneLoadHook2.installHook();

	// zone folders -> remove absolute stuff
	zoneTestHook.initialize(zoneTestHookLoc, ZoneTestHookFunc);
	zoneTestHook.installHook();

	zoneSprintfHook.initialize(zoneSprintfHookLoc, ZoneSprintfHookFunc);
	zoneSprintfHook.installHook();
}
开发者ID:DidUknowiPwn,项目名称:zonebuilder,代码行数:15,代码来源:PatchMW2Load.cpp

示例12: 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();
}
开发者ID:enghama,项目名称:iw4lan,代码行数:71,代码来源:PatchMW2Load.cpp

示例13: PatchMW2_MusicalTalent

void PatchMW2_MusicalTalent()
{
	findSoundAliasHook.initialize(findSoundAliasHookLoc, FindSoundAliasHookFunc);
	findSoundAliasHook.installHook();
}
开发者ID:Call-of-Duty-Scripts,项目名称:fourdeltaone,代码行数:5,代码来源:PatchMW2MusicalTalent.cpp

示例14: PatchMW2_Load

void PatchMW2_Load()
{
	// rawfile moddability
	rawFileHook1.initialize((PBYTE)rawFileHook1Loc);
	rawFileHook1.installHook(LoadModdableRawfileStub, false);

	rawFileHook2.initialize((PBYTE)rawFileHook2Loc);
	rawFileHook2.installHook(LoadModdableRawfileStub, false);

	rawFileHook3.initialize((PBYTE)rawFileHook3Loc);
	rawFileHook3.installHook(LoadModdableRawfileStub, false);

	rawFileHook4.initialize((PBYTE)rawFileHook4Loc);
	rawFileHook4.installHook(LoadModdableRawfileStub2, false);

	// fastfile loading hooks
	uiLoadHook1.initialize((PBYTE)uiLoadHook1Loc);
	uiLoadHook1.installHook(UILoadHook1Stub, false);

	ffLoadHook1.initialize((PBYTE)ffLoadHook1Loc);
	ffLoadHook1.installHook(FFLoadHook1Stub, false);

	ffLoadHook2.initialize((PBYTE)ffLoadHook2Loc);
	ffLoadHook2.installHook(FFLoadHook2Stub, false);

	zoneLoadHook1.initialize((PBYTE)zoneLoadHook1Loc);
	zoneLoadHook1.installHook(ZoneLoadHook1Stub, false);

	zoneLoadHook2.initialize((PBYTE)zoneLoadHook2Loc);
	zoneLoadHook2.installHook(ZoneLoadHook2Stub, false);

	//ReallocateAssetPool(ASSET_TYPE_WEAPON, 1400);
	return; // TODO: change this for build 159, possibly use dynamic offsets from array start
	// reallocation of image assets
	*(DWORD*)0x799618 = 0xE00 * 2; // originally 0xE00
	*(DWORD*)0x7998D8 = (DWORD)malloc((0xE00 * 2) * 0x20);

	// reallocation of loaded_sound assets
	*(DWORD*)0x799624 = 0x546 * 2; // assetID 13
	*(DWORD*)0x7998E4 = (DWORD)malloc((0x546 * 2) * 0x2C);

	// reallocation of fx assets
	*(DWORD*)0x799668 = 600 * 2; // assetID 30
	*(DWORD*)0x799928 = (DWORD)malloc((600 * 2) * 32);

	// reallocation of localize assets
	*(DWORD*)0x79965C = 7000 * 2; // assetID 27
	*(DWORD*)0x79991C = (DWORD)malloc((7000 * 2) * 8);

	// reallocation of xanim assets
	*(DWORD*)0x7995F8 = 4096 * 2; // assetID 2
	*(DWORD*)0x7998B8 = (DWORD)malloc((4096 * 2) * 88);

	// reallocation of xmodel assets
	*(DWORD*)0x799600 = 1536 * 2; // assetID 4
	*(DWORD*)0x7998C0 = (DWORD)malloc((1536 * 2) * 304);

	// reallocation of physpreset assets
	*(DWORD*)0x7995F0 = 64 * 2; // assetID 0
	*(DWORD*)0x7998B0 = (DWORD)malloc((64 * 2) * 44);

	// set GameWorldSp pool to be a random 1024 byte buffer (GameWorldMp is just a name it seems, as such useless)
	DWORD gwSP = (DWORD)malloc(1024);

	*(DWORD*)0x7998F4 = gwSP;

	// set this bit of data loaded from the GameWorld to point to new offset in GameWorldSp (seems it got added in IW4, as such 'aww')
	//*(DWORD*)0x4137C7 = gwSP + 52;

	// try not to re/unload ui FFs
	*(BYTE*)0x60DAF0 = 0xC3;

	// allow loading of IWffu (unsigned) files
	*(BYTE*)0x414AB9 = 0xEB; // main function
	*(WORD*)0x50B3C7 = 0x9090; // DB_AuthLoad_InflateInit

	// temporary stuff to not load from maps/mp/, needs to be changed to check for mp_*
	//strcpy((char*)0x70D6CC, "maps/%s.d3dbsp");

	// ignore 'node_' entities as well
	ignoreEntityHook.initialize((PBYTE)ignoreEntityHookLoc);
	ignoreEntityHook.installHook((void(*)())IgnoreEntityHookFunc, false);

	// reallocate XAsset entries
	ReallocEntries();

	*(DWORD*)0x5BE4E0 = 789312;
}
开发者ID:Call-of-Duty-Scripts,项目名称:alterIWnet,代码行数:88,代码来源:PatchMW2Load.cpp

示例15: PatchMW2_InGameMenu

void PatchMW2_InGameMenu()
{
	ingameMenuHook.initialize(ingameMenuHookLoc, IngameMenuHookStub);
	ingameMenuHook.installHook();
}
开发者ID:Call-of-Duty-Scripts,项目名称:fourdeltaone,代码行数:5,代码来源:PatchMW2IGMenu.cpp


注:本文中的CallHook类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。