aboutsummaryrefslogtreecommitdiff
path: root/InitialiseOffsets.cpp
blob: d62689748a14c748cf40a7aa09993e9818fd0b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "InitialiseOffsets.h"


#include "Pattern.h"
#include "Offsets.h"

#include <Windows.h>

void InitialiseOffsets::OnInitialise()
{
	using namespace Offsets;
	

	printf("~~ Initialising Offsets ~~\n");

	uint64_t base = (uint64_t)GetModuleHandle(NULL);

	pathfindingSystem = Pattern::FindSignature("AoE2DE_s.exe", "48 8D 0D ? ? ? ? 41 B8 ? ? ? ? E8 ? ? ? ? 33 C0");
	pathfindingSystem += *(uint32_t*)(pathfindingSystem + 3) + 7;
	pathfindingSystem -= base;
	printf("pathfindingSystem: %x\n", pathfindingSystem);

	mainScreen = Pattern::FindSignature("AoE2DE_s.exe", "48 8B 0D ? ? ? ? E8 ? ? ? ? C6 85");
	mainScreen += *(uint32_t*)(mainScreen + 3) + 7;
	mainScreen -= base;
	printf("mainScreen: %x\n", mainScreen);

	tribePanelInven = Pattern::FindSignature("AoE2DE_s.exe", "48 8B 0D ? ? ? ? 48 85 C9 0F 84 ? ? ? ? 40");
	tribePanelInven += *(uint32_t*)(tribePanelInven + 3) + 7;
	tribePanelInven -= base;
	printf("tribePanelInven: %x\n", tribePanelInven);

	tribePanelInven_localPlayer = Pattern::FindSignature("AoE2DE_s.exe", "48 8B 83 ? ? ? ? 48 8B 48 70 F3 0F 10");
	tribePanelInven_localPlayer = *(uint32_t*)(tribePanelInven_localPlayer + 3);
	tribePanelInven_localPlayer -= base;
	printf("tribePanelInven_localPlayer: %x\n", tribePanelInven_localPlayer);

	playerArrayStart = Pattern::FindSignature("AoE2DE_s.exe", "48 8B 88 ? ? ? ? 8B 83 ? ? ? ? 48 8B 0C");
	playerArrayStart = *(int32_t*)(playerArrayStart + 3);
	printf("playerArrayStart: %x\n", playerArrayStart);
	
	pAVGame = Pattern::FindSignature("AoE2DE_s.exe", "49 83 BF ? ? ? ? ? 0F 86 ? ? ? ? 48 8B") + 0xE;
	pAVGame += *(uint32_t*)(pAVGame + 3) + 7;
	pAVGame -= base;
	printf("pAVGame: %x\n", pAVGame);


	minimapHookOffset = Pattern::FindSignature("AoE2DE_s.exe", "88 85 ? ? ? ? 41 8B 46 0C");
	minimapHookOffset -= base;
	printf("minimapHookOffset: %x\n", minimapHookOffset);

	//Functions
	printNotification = Pattern::FindSignature("AoE2DE_s.exe", "48 83 EC 48 48 8B 05 ? ? ? ? 4C 8D");
	printNotification -= base;
	printf("printNotification: %x\n", printNotification);
	
	printBottomText = Pattern::FindSignature("AoE2DE_s.exe", "48 8B C4 48 83 EC 78 F3 0F 10 05 ? ? ? ? 41");
	printBottomText -= base;
	printf("printBottomText: %x\n", printBottomText);
		
	sendChat = Pattern::FindSignature("AoE2DE_s.exe", "E8 ? ? ? ? 90 48 8B 05 ? ? ? ? F2") - 0x94;
	sendChat -= base;
	printf("sendChat: %x\n", sendChat);


	createUnitHook = Pattern::FindSignature("AoE2DE_s.exe", "48 89 74 24 ? B8 ? ? ? ? 4C 89 74") - 0x23;
	createUnitHook -= base;
	printf("createUnitHook: %x\n", createUnitHook);



	printf("~~~~~~~~~~~~~~~\n");
}