// Initialize is called by Inner Space when the extension should initialize.
bool ISXEQItemDisplay::Initialize(ISInterface *p_ISInterface)
{
    pISInterface=p_ISInterface;

    // retrieve basic ISData types
    pStringType=pISInterface->FindLSType("string");
    pIntType=pISInterface->FindLSType("int");
    pBoolType=pISInterface->FindLSType("bool");
    pFloatType=pISInterface->FindLSType("float");
    pTimeType=pISInterface->FindLSType("time");
    pByteType=pISInterface->FindLSType("byte");


    pISInterface->OpenSettings(XMLFileName);

    ConnectServices();

    RegisterCommands();
    RegisterAliases();
    RegisterDataTypes();
    RegisterTopLevelObjects();
    RegisterServices();
    EzDetour(CItemDisplayWnd__SetSpell,&ItemDisplayHook::SetSpell_Detour,&ItemDisplayHook::SetSpell_Trampoline);
    EzDetour(CItemDisplayWnd__UpdateStrings, &ItemDisplayHook::UpdateStrings_Detour, &ItemDisplayHook::UpdateStrings_Trampoline);
    //EzDetour(CXWnd__DrawTooltipAtPoint,&XWndHook::DrawTooltipAtPoint_Detour,&XWndHook::DrawTooltipAtPoint_Trampoline);
    //EzDetour(CInvSlotWnd__DrawTooltip, &InvSlotWndHook::DrawTooltip_Detour, &InvSlotWndHook::DrawTooltip_Trampoline);

    WriteChatf("ISXEQItemDisplay Loaded");
    return true;
}
// Initialize is called by Inner Space when the extension should initialize.
bool ISXEQLabels::Initialize(ISInterface *p_ISInterface)
{    pISInterface=p_ISInterface;

// retrieve basic ISData types
pStringType=pISInterface->FindLSType("string");
pIntType=pISInterface->FindLSType("int");
pBoolType=pISInterface->FindLSType("bool");
pFloatType=pISInterface->FindLSType("float");
pTimeType=pISInterface->FindLSType("time");
pByteType=pISInterface->FindLSType("byte");


pISInterface->OpenSettings(XMLFileName);
LoadSettings();

ConnectServices();

RegisterCommands();
RegisterAliases();
RegisterDataTypes();
RegisterTopLevelObjects();
RegisterServices();

EzDetour(CLabel__Draw,&CLabelHook::Draw_Detour,&CLabelHook::Draw_Trampoline);
EzDetour(CSidlManager__CreateLabel,&CSidlManagerHook::CreateLabel_Detour,&CSidlManagerHook::CreateLabel_Trampoline);
// currently in testing:
//    EasyClassDetour(CGauge__Draw,CGaugeHook,Draw_Detour,VOID,(VOID),Draw_Trampoline);
//    EasyDetour(__GetGaugeValueFromEQ,GetGaugeValueFromEQ_Hook,int,(int,class CXStr *,bool *),GetGaugeValueFromEQ_Trampoline);
WriteChatf("ISXEQLabels Loaded");
return true;
}
Example #3
0
void InitializeMQ2Pulse()
{
	DebugSpew("Initializing Pulse");
	InitializeCriticalSection(&gPulseCS);
	EzDetour(ProcessGameEvents, Detour_ProcessGameEvents, Trampoline_ProcessGameEvents);
	EzDetour(CEverQuest__EnterZone, &CEverQuestHook::EnterZone_Detour, &CEverQuestHook::EnterZone_Trampoline);
	EzDetour(CEverQuest__SetGameState, &CEverQuestHook::SetGameState_Detour, &CEverQuestHook::SetGameState_Trampoline);

}
Example #4
0
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
	bzsrchhandle = CreateMutex(NULL, FALSE, NULL);
    DebugSpewAlways("Initializing MQ2Bzsrch");

    LoadMQ2Plugin("MQ2ItemDisplay");
    HMODULE h = LoadLibrary("MQ2ItemDisplay.dll");
    if (!h) {
        pg_Item = NULL;
    }
    else {
        pg_Item = (ITEMINFO *)GetProcAddress(h, "g_Item");
    }
    FreeLibrary(h);

    // Add commands, macro parameters, hooks, etc.
    AddCommand("/bzsrch",BzSrchMe);
    AddCommand("/breset",BzSrchMe);
    AddCommand("/mq2bzsrch",MQ2BzSrch);
    //AddCommand("/pricecheck",bzpc);
    AddMQ2Data("Bazaar",dataBazaar);              // cc - added, but not using TLO yet

    EzDetour(CBazaarSearchWnd__HandleBazaarMsg,&BzSrchHook::BzDetour,&BzSrchHook::BzTrampoline);
    pBazaarType = new MQ2BazaarType;
    pBazaarItemType = new MQ2BazaarItemType;
}
Example #5
0
// Initialize is called by Inner Space when the extension should initialize.
bool ISXEQMap::Initialize(ISInterface *p_ISInterface)
{
	pISInterface = p_ISInterface;

	// retrieve basic ISData types
	pStringType = pISInterface->FindLSType("string");
	pIntType = pISInterface->FindLSType("int");
	pBoolType = pISInterface->FindLSType("bool");
	pFloatType = pISInterface->FindLSType("float");
	pTimeType = pISInterface->FindLSType("time");
	pByteType = pISInterface->FindLSType("byte");


	pISInterface->OpenSettings("ISXEQMap.XML");

	bmMapRefresh = AddMQ2Benchmark("Map Refresh");
	unsigned int i;
	CHAR szBuffer[MAX_STRING] = { 0 };
	for (i = 0; MapFilterOptions[i].szName; i++) {
		sprintf(szBuffer, "%s Color", MapFilterOptions[i].szName);
		int Temp;
		if (pISInterface->GetSettingi("ISXEQMap.XML", "Map Filters", MapFilterOptions[i].szName, Temp))
			MapFilterOptions[i].Enabled = Temp;
		else
			MapFilterOptions[i].Enabled = MapFilterOptions[i].Default;

		if (pISInterface->GetSettingi("ISXEQMap.XML", "Map Filters", szBuffer, Temp))
			MapFilterOptions[i].Color = Temp | 0xFF000000;
		else
			MapFilterOptions[i].Color = MapFilterOptions[i].DefaultColor | 0xFF000000;
	}
	MapInit();
	pISInterface->GetSetting("ISXEQMap.XML", "Naming Schemes", "Normal", MapNameString, sizeof(MapNameString));
	pISInterface->GetSetting("ISXEQMap.XML", "Naming Schemes", "Target", MapTargetNameString, sizeof(MapTargetNameString));

	for (i = 1; i<16; i++)
	{
		sprintf(szBuffer, "KeyCombo%d", i);
		pISInterface->GetSetting("ISXEQMap.XML", "Right Click", szBuffer, MapSpecialClickString[i], sizeof(MapSpecialClickString[i]));
	}

	// Do not use Custom, since the string isn't stored
	MapFilterOptions[MAPFILTER_Custom].Enabled = 0;


	ConnectServices();

	RegisterCommands();
	RegisterAliases();
	RegisterDataTypes();
	RegisterTopLevelObjects();
	RegisterServices();

	EzDetour(CMapViewWnd__CMapViewWnd, &CMyMapViewWnd::Constructor_Detour, &CMyMapViewWnd::Constructor_Trampoline);
	CMyMapViewWnd::StealVFTable();

	printf("ISXEQMap Loaded");
	return true;
}
Example #6
0
void MQ2MouseHooks(BOOL bFlag)
{
	if(bFlag) {
		EzDetour(CDisplay__GetClickedActor,&FakeCDisplay::GetClickedActor_Detour,&FakeCDisplay::GetClickedActor_Tramp);
	} else {
		RemoveDetour(CDisplay__GetClickedActor);
	}
}
Example #7
0
VOID CISXEQ::HookMemChecker(BOOL Patch)
{
    if (Patch) {

		if (!EzDetour(__MemChecker0,memcheck0,memcheck0_tramp))
		{
			printf("memcheck0 detour failed");
		}
		if (!EzDetour(__MemChecker2,memcheck2,memcheck2_tramp))
		{
			printf("memcheck2 detour failed");
		}
		if (!EzDetour(__MemChecker3,memcheck3,memcheck3_tramp))
		{
			printf("memcheck3 detour failed");
		}
		if (!EzDetour(__MemChecker4,memcheck4,memcheck4_tramp))
		{
			printf("memcheck4 detour failed");
		}
                if (!EzDetour(CEverQuest__Emote,&CEmoteHook::Detour,&CEmoteHook::Trampoline))
		{
			printf("emote detour failed");
		}
		if (!EzDetour(CObfuscator__doit,&CObfuscator::doit_detour,&CObfuscator::doit_tramp))
		{
			printf("CObfuscator::doit detour failed");
		}
		HookInlineChecks(Patch);
    } else {
		HookInlineChecks(Patch);
		EzUnDetour(__MemChecker0);
		EzUnDetour(__MemChecker2);
		EzUnDetour(__MemChecker3);
		EzUnDetour(__MemChecker4);
		EzUnDetour(CObfuscator__doit);
		EzUnDetour(CEverQuest__Emote);
    }
}
Example #8
0
void InitializeMQ2Commands()
{
    int i;
    DebugSpew("Initializing Commands");
    InitializeCriticalSection(&gCommandCS);

    EzDetour(CEverQuest__InterpretCmd,&CCommandHook::Detour,&CCommandHook::Trampoline);

    // Import EQ commands
    PCMDLIST pCmdListOrig = (PCMDLIST)EQADDR_CMDLIST;
    for (i=0;pCmdListOrig[i].fAddress != 0;i++) {
        if (!strcmp(pCmdListOrig[i].szName,"/who")) {
            cmdWho  = (fEQCommand)pCmdListOrig[i].fAddress;
            AddCommand("/",pCmdListOrig[i].fAddress,TRUE,1,1); // make sure / does EQ who by default
        } else if (!strcmp(pCmdListOrig[i].szName,"/whotarget")) {
            cmdWhoTarget  = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/location")) {
            cmdLocation  = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/help")) {
            cmdHelp = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/target")) {
            cmdTarget = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/charinfo")) {
            cmdCharInfo = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/filter")) {
            cmdFilter = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/doability")) {
            cmdDoAbility = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/cast")) {
            cmdCast = (fEQCommand)pCmdListOrig[i].fAddress;
        } else if (!strcmp(pCmdListOrig[i].szName,"/useitem")) {
            cmdUseItem = (fEQCommand)pCmdListOrig[i].fAddress;
        }
        AddCommand(pCmdListOrig[i].szName,pCmdListOrig[i].fAddress,TRUE,1,1);
    }    



    // Add MQ commands...
    struct _NEWCOMMANDLIST { PCHAR szCommand; fEQCommand pFunc; BOOL Parse; BOOL InGame;} NewCommands[] = {
        {"/who",        SuperWho,1,1},
        {"/whotarget",  SuperWhoTarget,1,1},
        {"/location",   Location,1,1},
        {"/help",       Help,1,0},
        {"/target",     Target,1,1},
        {"/alias",      Alias,0,0},
        {"/aa",         AltAbility,0,1},
        {"/substitute", Substitute,0,0},
        {"/filter",     Filter,1,0},
        {"/whofilter",  SWhoFilter,1,1},
        {"/spewfile",   DebugSpewFile,1,0},
        {"/char",       CharInfo,1,1},
        {"/face",       Face,1,1},
        {"/identify",   Identify,1,1},
        {"/where",      Where,1,1},
        {"/skills",     Skills,1,1},
        {"/unload",     Unload,1,0},
        {"/macro",      Macro,1,0},
        {"/buyitem",    BuyItem,1,1},
        {"/sellitem",   SellItem,1,1},
        {"/memspell",   MemSpell,1,1},
        {"/loadspells", LoadSpells,1,1},
        {"/loginname",  DisplayLoginName,1,0},
        {"/endmacro",   EndMacro,1,0},
        {"/listmacros", ListMacros,1,0},
        {"/echo",       Echo,1,0},
        {"/msgbox",     MQMsgBox,1,0},
        {"/lootall",    LootAll,1,0},
        {"/alert",      Alert,1,1},
        {"/click",      Click,1,0},
        {"/mqpause",    MacroPause,1,0},
        {"/items",      Items,1,1},
        {"/itemtarget", ItemTarget,1,1},
        {"/doability",  DoAbility,1,1},
        {"/doors",      Doors,1,1},
        {"/doortarget", DoorTarget,1,1},
        {"/beep",       MacroBeep,1,0},
        {"/cast",       Cast,1,1},
        {"/mqlog",      MacroLog,1,0},
        {"/seterror",   SetError,1,0},
        {"/declare",    NewDeclareVar,1,0},
        {"/deletevar",  NewDeleteVarCmd,1,0},
        {"/varcalc",    NewVarcalc,1,0},
        {"/varset",     NewVarset,1,0},
        {"/vardata",    NewVardata,1,0},
        {"/delay",      Delay,0,0}, // do not parse
        {"/cleanup",    Cleanup,1,0},
        {"/doevents",   DoEvents,1,0},
        {"/goto",       Goto,1,0},
        {"/for",        For,1,0},
        {"/next",       Next,1,0},
        {"/call",       Call,1,0},
        {"/return",     Return,1,0},
        {"/updateitems",UpdateItemInfo,1,1},
        {"/ini",        IniOutput,1,0},
        {"/dumpstack",  DumpStack,1,0},
        {"/setautorun", SetAutoRun,0,1},
        {"/banklist",   BankList,1,1},
        {"/look",       Look,1,1},
        {"/keepkeys",   KeepKeys,1,0},
        {"/windowstate",WindowState,1,0},
        {"/plugin",     PluginCommand,1,0},
        {"/destroy",    EQDestroyHeldItemOrMoney,1,1},
        {"/exec",       Exec,1,0}, 
        {"/keypress",   DoMappable,1,0},
        {"/popup",      PopupText,1,1},
        {"/multiline",  MultilineCommand,0,0},
        {"/bind",       MQ2KeyBindCommand,1,0},
        {"/ranged",     do_ranged,1,1},
        {"/loadcfg",    LoadCfgCommand,1,0},
        {"/dumpbinds",  DumpBindsCommand,1,0},
        {"/squelch",    SquelchCommand,1,0},
        {"/dosocial",   DoSocial,1,1},
        {"/docommand",  DoCommandCmd,1,0},
        {"/ctrlkey",    DoCtrlCmd,0,0},
        {"/altkey",     DoAltCmd,0,0},
        {"/shiftkey",   DoShiftCmd,0,0},
        {"/timed",      DoTimedCmd,0,0},
        {"/if",         NewIf,1,0},
        {"/while",      WhileCmd,1,0},
        {"/combine",    CombineCmd,1,1},
        {"/clearerrors",ClearErrorsCmd,1,0},
        {"/drop",       DropCmd,1,0},
        {"/hud",        HudCmd,1,0},
        {"/caption",    CaptionCmd,0,0},
        {"/captioncolor",CaptionColorCmd,1,0},
        {"/noparse",    NoParseCmd,0,0},
        {"/nomodkey",   NoModKeyCmd,0,0},
        {"/useitem",    UseItemCmd,1,1},
		{"/spellslotinfo",SpellSlotInfo,1,1},
		{"/getwintitle",GetWinTitle,1,0},
		{"/setwintitle",SetWinTitle,1,0},
		{"/removebuff",RemoveBuff,1,1},
		{"/makemevisible",MakeMeVisible,0,1},
        {NULL,          NULL,0,1},
    };

    // Remove replaced commands first
    for (i = 0 ; NewCommands[i].szCommand && NewCommands[i].pFunc ; i++)
    {
        RemoveCommand(NewCommands[i].szCommand);
        AddCommand(NewCommands[i].szCommand,NewCommands[i].pFunc,0,NewCommands[i].Parse,NewCommands[i].InGame);
    }

    /* ALIASES FOR OUT OF ORDER SHORTHAND COMMANDS */
    AddAlias("/d","/duel");
    AddAlias("/t","/tell");
    AddAlias("/w","/who");
    AddAlias("/a","/anonymous");
    AddAlias("/ta","/tap");
    AddAlias("/c","/consider");
    AddAlias("/cha","/channel");
    AddAlias("/f","/feedback");
    AddAlias("/fa","/fastdrop");
    AddAlias("/m","/msg");
    AddAlias("/load","/loadspells");
    AddAlias("/b","/bazaar");
    AddAlias("/ba","/bazaar");
    AddAlias("/g","/gsay");
    AddAlias("/gu","/guildsay");
    AddAlias("/key","/keys");
    AddAlias("/r","/reply");

    AddAlias("/newif","/if");
    /* NOW IMPORT THE USER'S ALIAS LIST, THEIR MODIFICATIONS OVERRIDE EXISTING. */

    CHAR AliasList[MAX_STRING*10] = {0};
    CHAR szBuffer[MAX_STRING] = {0};
    CHAR MainINI[MAX_STRING] = {0};
    sprintf(MainINI,"%s\\macroquest.ini",gszINIPath);
    GetPrivateProfileString("Aliases",NULL,"",AliasList,MAX_STRING*10,MainINI);
    PCHAR pAliasList = AliasList;
    while (pAliasList[0]!=0) {
        GetPrivateProfileString("Aliases",pAliasList,"",szBuffer,MAX_STRING,MainINI);
        if (szBuffer[0]!=0) {
            AddAlias(pAliasList,szBuffer);
        }
        pAliasList+=strlen(pAliasList)+1;
    }

    // Here is where you can add in permanent Substitutions
    AddSubstitute("omg","Oh My God");

    //Importing the User's Substitution List from .ini file
    CHAR SubsList[MAX_STRING*10] = {0};
    CHAR szBuffer2[MAX_STRING] = {0};
    sprintf(MainINI,"%s\\macroquest.ini",gszINIPath);
    GetPrivateProfileString("Substitutions",NULL,"",SubsList,MAX_STRING*10,MainINI);
    PCHAR pSubsList = SubsList;
    while (pSubsList[0]!=0) {
        GetPrivateProfileString("Substitutions",pSubsList,"",szBuffer2,MAX_STRING,MainINI);
        if (szBuffer[0]!=0) {
            AddSubstitute(pSubsList,szBuffer2);
        }
        pSubsList+=strlen(pSubsList)+1;
    }
}