-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
6,710 additions
and
2,298 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Common version parameters. | ||
// | ||
// Microsoft Research Detours Package, Version 4.0.1 | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
|
||
#define _USING_V110_SDK71_ 1 | ||
#include "winver.h" | ||
#if 0 | ||
#include <windows.h> | ||
#include <detours.h> | ||
#else | ||
#ifndef DETOURS_STRINGIFY | ||
#define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x) | ||
#define DETOURS_STRINGIFY_(x) #x | ||
#endif | ||
|
||
#define VER_FILEFLAGSMASK 0x3fL | ||
#define VER_FILEFLAGS 0x0L | ||
#define VER_FILEOS 0x00040004L | ||
#define VER_FILETYPE 0x00000002L | ||
#define VER_FILESUBTYPE 0x00000000L | ||
#endif | ||
#define VER_DETOURS_BITS DETOUR_STRINGIFY(DETOURS_BITS) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
#include "FrameAPI.h" | ||
#include "Variables.h" | ||
#include "fcalls.h" | ||
|
||
std::unordered_map<EFrameEvent, std::unordered_map<UINT, UINT>> frameEventHashTable; | ||
|
||
UINT GetOriginFrame(EOriginFrame originframe, UINT index) { | ||
CGameUI* gameui = GetGameUI(); | ||
|
||
switch (originframe) { | ||
case ORIGIN_FRAME_GAME_UI: | ||
return (UINT)gameui; | ||
case ORIGIN_FRAME_WORLD_FRAME: | ||
return (UINT)gameui->WorldFrameWar3; | ||
case ORIGIN_FRAME_HERO_BAR: | ||
return (UINT)gameui->HeroBar; | ||
case ORIGIN_FRAME_HERO_BUTTON: | ||
return (UINT)GetPanelButton((UINT)gameui->HeroBar, index, 0); | ||
case ORIGIN_FRAME_HERO_HP_BAR: | ||
return *(UINT*)((UINT)GetPanelButton((UINT)gameui->HeroBar, index, 0) + 0x1cc); | ||
case ORIGIN_FRAME_HERO_MANA_BAR: | ||
return *(UINT*)((UINT)GetPanelButton((UINT)gameui->HeroBar, index, 0) + 0x1d0); | ||
case ORIGIN_FRAME_HERO_BUTTON_INDICATOR: | ||
// Undefined | ||
break; | ||
case ORIGIN_FRAME_ITEM_BUTTON: | ||
return *(UINT*)(*(UINT*)(*(UINT*)(gameui->InfoBar + 0x148) + 0x130) + 8 * index + 4); | ||
case ORIGIN_FRAME_COMMAND_BUTTON: | ||
return (UINT)GetPanelButton((UINT)gameui->CommandBar, index / 4, index % 4); | ||
case ORIGIN_FRAME_SYSTEM_BUTTON: | ||
// Undefined | ||
break; | ||
case ORIGIN_FRAME_PORTRAIT: | ||
return (UINT)gameui->Portrait; | ||
case ORIGIN_FRAME_MINIMAP: | ||
return (UINT)gameui->Minimap; | ||
case ORIGIN_FRAME_MINIMAP_BUTTON: | ||
return (UINT)gameui->MinimapButtons[index]; | ||
case ORIGIN_FRAME_TOOLTIP: | ||
return GetTooltipFrame(); | ||
case ORIGIN_FRAME_UBERTOOLTIP: | ||
// Undefined | ||
break; | ||
case ORIGIN_FRAME_CHAT_MSG: | ||
return (UINT)gameui->ChatMessage; | ||
case ORIGIN_FRAME_UNIT_MSG: | ||
return (UINT)gameui->UnitMessage; | ||
case ORIGIN_FRAME_TOP_MSG: | ||
return (UINT)gameui->TopMessage; | ||
default: | ||
break; | ||
} | ||
|
||
return NULL; | ||
} | ||
|
||
UINT GetPanelButton(UINT frame, BYTE row, BYTE column) { | ||
return *(UINT*)(*(DWORD*)(16 * row + *((DWORD*)frame + 85) + 8) + 4 * column) - sizeof(CFrame); | ||
} | ||
|
||
UINT GetTooltipFrame(UINT unknown0) { | ||
return fastcall<UINT>(MakePtr(gameBase, _getTooltipFrame), unknown0); | ||
} | ||
|
||
BOOL LoadTOCFile(LPCSTR filename) { | ||
DWORD stringHastTable = MakePtr(gameBase, _stringHastTable); | ||
DWORD FDFHashTable = MakePtr(gameBase, _FDFHashTable); | ||
|
||
if (*(int*)(stringHastTable + 0x14) < 0xFFFF) { | ||
thiscall<void>(MakePtr(gameBase, _stringHashNodeGrowListArray), stringHastTable, 0xFFFF); | ||
} | ||
|
||
if (*(int*)(FDFHashTable + 0x14) < 0xFFFF) { | ||
thiscall<void>(MakePtr(gameBase, _baseFrameHashNodeGrowListArray), FDFHashTable, 0xFFFF); | ||
} | ||
|
||
return fastcall<BOOL>(MakePtr(gameBase, _readFDFFile), filename, stringHastTable, FDFHashTable, MakePtr(gameBase, _CFrameDefStatus)); | ||
} | ||
|
||
UINT GetFrameByName(LPCSTR framename, UINT id) { | ||
return fastcall<UINT>(MakePtr(gameBase, _getCFrameByName), framename, id); | ||
} | ||
|
||
UINT CreateFrame(LPCSTR baseframe, UINT parentframe, EFramePoint point, EFramePoint relativepoint, UINT id) { | ||
return fastcall<UINT>(MakePtr(gameBase, _createCFrame), baseframe, parentframe, point, relativepoint, id); | ||
} | ||
|
||
void SetFrameText(UINT frame, LPCSTR text) { | ||
thiscall<void>(MakePtr(gameBase, _setCFrameText), *(UINT*)(FRAMELAYOUT(frame) + 0x130), text); | ||
} | ||
|
||
void SetFrameTextColor(UINT frame, BYTE red, BYTE green, BYTE blue, BYTE alpha) { | ||
DWORD color = ((alpha << 24) + (red << 16) + (green << 8) + blue); | ||
thiscall<void>(MakePtr(gameBase, _setCFrameTextColor), FRAMELAYOUT(frame), &color); | ||
} | ||
|
||
float GetFrameTextHeight(UINT frame) { | ||
return thiscall<float>(MakePtr(gameBase, _getCFrameTextHeight), FRAMELAYOUT(frame)); | ||
} | ||
|
||
void SetFrameWidth(UINT frame, float width) { | ||
thiscall<void>(MakePtr(gameBase, _setCLayoutFrameWidth), FRAMELAYOUT(frame), width); | ||
} | ||
|
||
void SetFrameHeight(UINT frame, float height) { | ||
thiscall<void>(MakePtr(gameBase, _setCLayoutFrameHeight), FRAMELAYOUT(frame), height); | ||
} | ||
|
||
void SetFrameSize(UINT frame, float width, float height) { | ||
SetFrameWidth(frame, width); | ||
SetFrameHeight(frame, height); | ||
} | ||
|
||
void SetFrameScale(UINT frame, float scale) { | ||
thiscall<void>(MakePtr(gameBase, _setCLayoutFrameScale), FRAMELAYOUT(frame), scale); | ||
} | ||
|
||
void SetFrameAbsolutePoint(UINT frame, EFramePoint point, float offsetX, float offsetY) { | ||
thiscall<void>(MakePtr(gameBase, _setCLayoutFrameAbsolutePoint), FRAMELAYOUT(frame), point, offsetX, offsetY, 1); | ||
} | ||
|
||
void SetFramePoint(UINT frame, EFramePoint point, UINT parentframe, EFramePoint relativepoint, float offsetX, float offsetY) { | ||
thiscall<void>(MakePtr(gameBase, _setCLayoutFramePoint), FRAMELAYOUT(frame), point, FRAMELAYOUT(parentframe), relativepoint, offsetX, offsetY, 1); | ||
} | ||
|
||
float GetFrameWidth(UINT frame) { | ||
return *(float*)(FRAMELAYOUT(frame) + 0x58); | ||
} | ||
|
||
float GetFrameHeight(UINT frame) { | ||
return *(float*)(FRAMELAYOUT(frame) + 0x5c); | ||
} | ||
|
||
UINT GetFramePoint(UINT frame, EFramePoint point) { | ||
return *(UINT*)(FRAMELAYOUT(frame) + 4 * (UINT)point + 8); | ||
} | ||
|
||
UINT GetFramePointParent(UINT frame, EFramePoint point) { | ||
return *(UINT*)(GetFramePoint(frame, point) + 4); | ||
} | ||
|
||
UINT GetFramePointRelativePoint(UINT frame, EFramePoint point) { | ||
return *(UINT*)(GetFramePoint(frame, point) + 8); | ||
} | ||
|
||
float GetFramePointX(UINT frame, EFramePoint point) { | ||
return *(float*)(GetFramePoint(frame, point) + 12); | ||
} | ||
|
||
float GetFramePointY(UINT frame, EFramePoint point) { | ||
return *(float*)(GetFramePoint(frame, point) + 16); | ||
} | ||
|
||
//--------------------------------------------------------------------------------------- | ||
|
||
void TriggerRegisterFrameEvent(UINT trigger, UINT frame, EFrameEvent event) { | ||
frameEventHashTable[event][frame] = trigger; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#pragma once | ||
|
||
#include "Warcraft.h" | ||
#include "Mem.h" | ||
|
||
enum EFramePoint : UINT | ||
{ | ||
TopLeft = 0, | ||
Top = 1, | ||
TopRight = 2, | ||
Left = 3, | ||
Center = 4, | ||
Right = 5, | ||
BottomLeft = 6, | ||
Bottom = 7, | ||
BottomRight = 8 | ||
}; | ||
|
||
enum EOriginFrame : UINT { | ||
ORIGIN_FRAME_GAME_UI, | ||
ORIGIN_FRAME_WORLD_FRAME, | ||
ORIGIN_FRAME_HERO_BAR, | ||
ORIGIN_FRAME_HERO_BUTTON, | ||
ORIGIN_FRAME_HERO_HP_BAR, | ||
ORIGIN_FRAME_HERO_MANA_BAR, | ||
ORIGIN_FRAME_HERO_BUTTON_INDICATOR, | ||
ORIGIN_FRAME_ITEM_BUTTON, | ||
ORIGIN_FRAME_COMMAND_BUTTON, | ||
ORIGIN_FRAME_SYSTEM_BUTTON, | ||
ORIGIN_FRAME_PORTRAIT, | ||
ORIGIN_FRAME_MINIMAP, | ||
ORIGIN_FRAME_MINIMAP_BUTTON, | ||
ORIGIN_FRAME_TOOLTIP, | ||
ORIGIN_FRAME_UBERTOOLTIP, | ||
ORIGIN_FRAME_CHAT_MSG, | ||
ORIGIN_FRAME_UNIT_MSG, | ||
ORIGIN_FRAME_TOP_MSG | ||
}; | ||
|
||
enum EFrameEvent : UINT { | ||
FRAMEEVENT_CONTROL_CLICK = 1, | ||
FRAMEEVENT_MOUSE_ENTER, | ||
FRAMEEVENT_MOUSE_LEAVE, | ||
FRAMEEVENT_MOUSE_UP, | ||
FRAMEEVENT_MOUSE_DOWN, | ||
FRAMEEVENT_MOUSE_WHEEL, | ||
FRAMEEVENT_CHECKBOX_CHECKED, | ||
FRAMEEVENT_CHECKBOX_UNCHECKED, | ||
FRAMEEVENT_EDITBOX_TEXT_CHANGED, | ||
FRAMEEVENT_POPUPMENU_ITEM_CHANGED, | ||
FRAMEEVENT_MOUSE_DOUBLECLICK, | ||
FRAMEEVENT_SPRITE_ANIM_UPDATE, | ||
FRAMEEVENT_SLIDER_VALUE_CHANGED, | ||
FRAMEEVENT_DIALOG_CANCEL, | ||
FRAMEEVENT_DIALOG_ACCEPT, | ||
FRAMEEVENT_EDITBOX_ENTER | ||
}; | ||
|
||
//DWORD eventType[16] = {MakePtr(gameBase, _frameevent_control_click), MakePtr(gameBase, _frameevent_control_mouseenter) }; | ||
|
||
UINT GetOriginFrame(EOriginFrame originframe, UINT index); | ||
|
||
UINT GetPanelButton(UINT frame, BYTE row, BYTE column); | ||
|
||
UINT GetTooltipFrame(UINT unknown0 = NULL); | ||
|
||
BOOL LoadTOCFile(LPCSTR filename); | ||
|
||
UINT GetFrameByName(LPCSTR framename, UINT id); | ||
|
||
UINT CreateFrame(LPCSTR baseframe, UINT parentframe, EFramePoint point, EFramePoint relativepoint, UINT id); | ||
|
||
void SetFrameText(UINT frame, LPCSTR text); | ||
|
||
void SetFrameTextColor(UINT frame, BYTE red, BYTE green, BYTE blue, BYTE alpha); | ||
|
||
float GetFrameTextHeight(UINT frame); | ||
|
||
void SetFrameWidth(UINT frame, float width); | ||
|
||
void SetFrameHeight(UINT frame, float height); | ||
|
||
void SetFrameSize(UINT frame, float width, float height); | ||
|
||
void SetFrameScale(UINT frame, float scale); | ||
|
||
void SetFrameAbsolutePoint(UINT frame, EFramePoint point, float offsetX, float offsetY); | ||
|
||
void SetFramePoint(UINT frame, EFramePoint point, UINT parentframe, EFramePoint relativepoint, float offsetX, float offsetY); | ||
|
||
float GetFrameWidth(UINT frame); | ||
|
||
float GetFrameHeight(UINT frame); | ||
|
||
UINT GetFramePointParent(UINT frame, EFramePoint point); | ||
|
||
UINT GetFramePointRelativePoint(UINT frame, EFramePoint point); | ||
|
||
float GetFramePointX(UINT frame, EFramePoint point); | ||
|
||
float GetFramePointY(UINT frame, EFramePoint point); | ||
|
||
//--------------------------------------------------------------------------------------- | ||
|
||
void TriggerRegisterFrameEvent(UINT trigger, UINT frame, EFrameEvent event); |
Oops, something went wrong.