aboutsummaryrefslogtreecommitdiff
path: root/Patcher.cpp
blob: d0d75d1a3c1648f28a35a48f0a299c3b02b79278 (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
#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);

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