aboutsummaryrefslogtreecommitdiff
path: root/Patcher.cpp
blob: d8328f606bc023f6b94a103c737c21f12bbceb40 (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
#include <iostream>
#include <filesystem>
#include <fstream>
#include <array>
#include <iterator>

int main(int argc, char** argv)
{
    std::string wow;
    if (argc < 2)
    {
        std::cout << "World of Warcraft exe not found!\n";
        return 1;
    }

    wow = argv[1];

    std::fstream wow_exe(wow, std::ios::in | std::ios::out | std::ios::binary);
    if (!wow_exe)
    {
        std::cout << "World of Warcraft exe not found!\n";
        return 1;
    }

    // windowed mode to full screen
    wow_exe.seekp(0xE94);
    wow_exe << static_cast<char>(0xEB);

    // melee swing on right-click
    wow_exe.clear();
    wow_exe.seekg(0);
    wow_exe.seekp(0x2E1C67);
    for (size_t i = 0; i < 11; ++i)
        wow_exe << static_cast<char>(0x90);

    // NPC attack animation when turning
    wow_exe.clear();
    wow_exe.seekg(0);
    wow_exe.seekp(0x33D7C9);
    wow_exe << static_cast<char>(0xEB);

    // "ghost" attack when NPC evades from combat
    wow_exe.clear();
    wow_exe.seekg(0);
    wow_exe.seekp(0x355BF);
    wow_exe << static_cast<char>(0xEB);

    // missing pre cast animation when canceling channeled spells
    wow_exe.clear();
    wow_exe.seekg(0);
    wow_exe.seekp(0x33E0D6);
    for (size_t i = 0; i < 22; ++i)
        wow_exe << static_cast<char>(0x90);

    std::cout << "World of Warcraft exe has been patched!\n";
    return 0;
}