Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 54cbdfe

Browse files
authored
Merge pull request #20 from idietmoran/dev-cli
Updated for patch 4.2
2 parents 3046296 + c7097ba commit 54cbdfe

File tree

13 files changed

+77
-55
lines changed

13 files changed

+77
-55
lines changed

UPDATING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# UPDATING
2+
------------
3+
This is a checklist of things to do while UPDATING the program for a new patch
4+
5+
#### DIRECTX 11 (x64)
6+
--------------
7+
8+
- [x] Number of Party Members `arch\\x64.cpp : 14`
9+
- [x] You `arch\\x64.cpp : 41`
10+
- [x] Normal Party Allies (find one and add 0x220 to each) `arch\\x64.cpp : 43-50`
11+
- [x] Cross-World Party Boolean `arch\\x64.cpp : 79`
12+
- [x] First Cross-World Party Ally `arch\\x64.cpp : 57`
13+
14+
#### DIRECTX 9 (x86)
15+
----------------------------
16+
- [x] Number of Party Members `arch\\x64.cpp : 13`
17+
- [x] You `arch\\x64.cpp : 41`
18+
- [x] Normal Party Allies (find one and add 0x220 to each) `arch\\x64.cpp : 42-49`
19+
- [x] Cross-World Party Boolean `arch\\x64.cpp : 78`
20+
- [ ] First Cross-World Party Ally `arch\\x64.cpp : 55`

src/arch/x64.cpp

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ x64::x64(Process* proc)
1111
// get window name
1212
exe_ = new Module("ffxiv_dx11.exe");
1313
// memory offests for dx11 number of party members
14-
numberOfPartyMembers_ = new Offset({ 0x0180A038, 0x38, 0x18, 0x20, 0x20, 0x10 });
14+
numberOfPartyMembers_ = new Offset({ 0x018AE778, 0x38, 0x18, 0x20, 0x20, 0x10 });
1515

1616
// if dx11 (64-bit) set static x64 true
1717
if (exe_->getModule(proc))
@@ -35,23 +35,28 @@ x64::~x64()
3535
// create allies
3636
void x64::createAllies(Process* proc)
3737
{
38+
// A7128
39+
// 18F30F8
3840
// dx11 64-bit offsets
39-
allies_.push_back(new YOU(0x182AB51));
40-
allies_.push_back(new Ally(0x184BFD0));
41-
allies_.push_back(new Ally(0x184C1F0));
42-
allies_.push_back(new Ally(0X184C410));
43-
allies_.push_back(new Ally(0x184C630));
44-
allies_.push_back(new Ally(0x184C850));
45-
allies_.push_back(new Ally(0x184CA70));
46-
allies_.push_back(new Ally(0x184CC90));
47-
allies_.push_back(new Ally(0X184CEB0));
48-
41+
allies_.push_back(new YOU(0x18D1C79));
42+
// each address is 0x220 away
43+
allies_.push_back(new Ally(0x18F3540));
44+
allies_.push_back(new Ally(0x18F3760));
45+
allies_.push_back(new Ally(0X18F3980));
46+
allies_.push_back(new Ally(0x18F3BA0));
47+
allies_.push_back(new Ally(0x18F3DC0));
48+
allies_.push_back(new Ally(0x18F3FE0));
49+
allies_.push_back(new Ally(0x18F4200));
50+
allies_.push_back(new Ally(0X18F3320));
51+
// 18F3320
4952
// create crossworld allies
50-
alliesCW_.push_back(allies_[0]); // YOU
51-
DWORD64 address = exe_->getAddress();
52-
address += 0x017E86A0;
53+
alliesCW_.push_back(allies_[0]); // YOU
5354

54-
ReadProcessMemory(proc->getHandle(), (void*)address, &address, sizeof(DWORD64), 0);
55+
DWORD64 address = exe_->getAddress(); // exe base address
56+
// 0x0188C540 #NEW ADDRESS
57+
address += 0x0188C540; // address offset
58+
59+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(address), &address, sizeof(DWORD64), 0);
5560
address += 0x2E8;
5661
alliesCW_.push_back(new AllyCW(address));
5762

@@ -65,11 +70,11 @@ void x64::createAllies(Process* proc)
6570
// get the number of party members
6671
void x64::updateNumberOfPartyMembers(Process* proc, int &partyMembers)
6772
{
68-
ReadProcessMemory(proc->getHandle(), (void*)(numberOfPartyMembers_->getMemoryAddress64(proc, exe_)), &partyMembers, sizeof(int), 0);
73+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(numberOfPartyMembers_->getMemoryAddress64(proc, exe_)), &partyMembers, sizeof(int), 0);
6974
}
7075

7176
// check if currently crossworld party
7277
void x64::checkCrossWorldParty(Process* proc)
7378
{
74-
ReadProcessMemory(proc->getHandle(), (void*)(exe_->getAddress() + 0x184AF8C), &inCrossWorldParty_, 1, 0);
79+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(exe_->getAddress() + 0x18F22C4), &inCrossWorldParty_, 1, 0);
7580
}

src/arch/x86.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
x86::x86(Process* proc)
1111
{
1212
// handle error when getting invalid module
13-
numberOfPartyMembers_ = new Offset({ 0x114151C, 0x1C, 0x10, 0x10, 0x1C, 0x10 });
13+
numberOfPartyMembers_ = new Offset({ 0x011B6D74, 0x1C, 0x10, 0x10, 0x1C, 0x10 });
1414
exe_ = new Module("ffxiv.exe");
1515
if (!exe_->getModule32bit(proc))
1616
{
@@ -38,23 +38,23 @@ x86::~x86()
3838
void x86::createAllies(Process* proc)
3939
{
4040
// dx9 32-bit offsets
41-
allies_.push_back(new YOU(0x115F441));
42-
allies_.push_back(new Ally(0x117BA40));
43-
allies_.push_back(new Ally(0x117BC60));
44-
allies_.push_back(new Ally(0x117BE80));
45-
allies_.push_back(new Ally(0x117C0A0));
46-
allies_.push_back(new Ally(0x117C2C0));
47-
allies_.push_back(new Ally(0x117C4E0));
48-
allies_.push_back(new Ally(0x117C700));
49-
allies_.push_back(new Ally(0x117C920));
41+
allies_.push_back(new YOU(0x11D7411));
42+
allies_.push_back(new Ally(0x11F3C00)); // 11F3C00
43+
allies_.push_back(new Ally(0x11F3E20)); // 11F3E20
44+
allies_.push_back(new Ally(0x11F4040));
45+
allies_.push_back(new Ally(0x11F4260));
46+
allies_.push_back(new Ally(0x11F4480)); //
47+
allies_.push_back(new Ally(0x11F46A0));
48+
allies_.push_back(new Ally(0x11F48C0));
49+
allies_.push_back(new Ally(0x11F4AE0));
5050

5151
// create crossworld allies
5252
alliesCW_.push_back(allies_[0]); // YOU
5353

5454
DWORD address = exe_->getAddress();
55-
address += 0x10297A4;
55+
address += 0x0109E5A4;
5656

57-
ReadProcessMemory(proc->getHandle(), (void*)address, &address, sizeof(DWORD64), 0);
57+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(address), &address, sizeof(DWORD), 0);
5858
address += 0x2E0;
5959
alliesCW_.push_back(new AllyCW(address));
6060

@@ -68,12 +68,12 @@ void x86::createAllies(Process* proc)
6868
// get the number of party members
6969
void x86::updateNumberOfPartyMembers(Process *proc, int &partyMembers)
7070
{
71-
ReadProcessMemory(proc->getHandle(), (void*)(numberOfPartyMembers_->getMemoryAddress(proc, exe_)), &partyMembers, sizeof(int), 0);
71+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(numberOfPartyMembers_->getMemoryAddress(proc, exe_)), &partyMembers, sizeof(int), 0);
7272
}
7373

7474
// check if currently crossworld party
7575
void x86::checkCrossWorldParty(Process* proc)
7676
{
7777
// do nothing for the time being
78-
ReadProcessMemory(proc->getHandle(), (void*)(exe_->getAddress() + 0x117ABF4), &inCrossWorldParty_, 1, 0);
78+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(exe_->getAddress() + 0x11F2DA4), &inCrossWorldParty_, 1, 0);
7979
}

src/menu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void Menu::displayAllies()
4444

4545
if(fflogs_->arch_->getFilteredAlliesCW().size() < fflogs_->partyMembers_)
4646
{
47-
partyMembers = fflogs_->arch_->getFilteredAlliesCW().size();
47+
partyMembers = static_cast<int>(fflogs_->arch_->getFilteredAlliesCW().size());
4848
}
4949

5050
for (int i = 0; i < partyMembers; i++)
@@ -68,7 +68,7 @@ void Menu::displayAllies()
6868

6969
if (fflogs_->arch_->getFilteredAllies().size() < fflogs_->partyMembers_)
7070
{
71-
partyMembers = fflogs_->arch_->getFilteredAllies().size();
71+
partyMembers = static_cast<int>(fflogs_->arch_->getFilteredAllies().size());
7272
}
7373

7474
for (int i = 0; i < partyMembers; i++)

src/player/ally.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ void Ally::display()
1919

2020
void Ally::updateName(Process* proc, Module* exe)
2121
{
22-
ReadProcessMemory(proc->getHandle(), (void*)(exe->getAddress() + address_), &name_, 80, 0);
22+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(exe->getAddress() + address_), &name_, 80, 0);
2323
}

src/player/allyCW.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ void AllyCW::display()
1818

1919
void AllyCW::updateName(Process* proc, Module* exe)
2020
{
21-
ReadProcessMemory(proc->getHandle(), (void*)(address_), &name_, 80, 0);
21+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(address_), &name_, 80, 0);
2222
}

src/player/player.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ bool Player::getCharId()
2020

2121
if (!body.empty())
2222
{
23-
std::wstring tempBody;
23+
2424

2525
if (body.find(L"/character/id/") == std::string::npos)
2626
{
2727
return false;
2828
}
2929

30-
tempBody = body.substr(body.find(L"/character/id/"), body.size());
30+
std::wstring tempBody = body.substr(body.find(L"/character/id/"), body.size());
3131
std::wstring tempBody2 = tempBody;
3232
body = tempBody.substr(0, tempBody.find_first_of(L"\""));
3333
tempBody2 = tempBody2.substr(tempBody2.find(L"</a>"), tempBody2.size());
@@ -56,7 +56,7 @@ void Player::openBrowser()
5656
{
5757
std::wstring url = L"https://www.fflogs.com/character/id/" + characterId_;
5858
//url += characterId_;
59-
ShellExecuteW(NULL, L"open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
59+
ShellExecuteW(nullptr, L"open", url.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
6060
}
6161
else
6262
{
@@ -74,9 +74,5 @@ void Player::openBrowser()
7474

7575
bool Player::compare(Player* player)
7676
{
77-
if(name_ == player->name_)
78-
{
79-
return true;
80-
}
81-
return false;
77+
return name_ == player->name_;
8278
}

src/player/you.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ void YOU::display()
1919

2020
void YOU::updateName(Process* proc, Module* exe)
2121
{
22-
ReadProcessMemory(proc->getHandle(), (void*)(exe->getAddress() + address_), &name_, 80, 0);
22+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(exe->getAddress() + address_), &name_, 80, 0);
2323
}

src/process/module.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bool Module::getModule(Process *proc)
2929
{
3030
if (!strcmp(nModule.szModule, moduleName_))
3131
{
32-
address_ = (DWORD64)nModule.modBaseAddr;
32+
address_ = reinterpret_cast<DWORD64>(nModule.modBaseAddr);
3333
return true;
3434
}
3535
} while (Module32Next(hSnapshot, &nModule));
@@ -48,7 +48,7 @@ bool Module::getModule32bit(Process *proc)
4848
{
4949
if (!strcmp(nModule.szModule, moduleName_))
5050
{
51-
address_ = (DWORD64)nModule.modBaseAddr;
51+
address_ = reinterpret_cast<DWORD64>(nModule.modBaseAddr);
5252
return true;
5353
}
5454
} while (Module32Next(hSnapshot, &nModule));

src/process/offset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ DWORD64 Offset::getMemoryAddress(Process* proc, Module* module)
2222
for(int i = 0; i < offsets_.size() - 1; i++)
2323
{
2424
address += offsets_[i];
25-
ReadProcessMemory(proc->getHandle(), (void*)(address), &address, sizeof(DWORD), 0);
25+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(address), &address, sizeof(DWORD), 0);
2626
}
2727
address += offsets_[offsets_.size() - 1];
2828
return address;
@@ -35,7 +35,7 @@ DWORD64 Offset::getMemoryAddress64(Process* proc, Module* module)
3535
for (int i = 0; i < offsets_.size() - 1; i++)
3636
{
3737
address += offsets_[i];
38-
ReadProcessMemory(proc->getHandle(), (void*)(address), &address, sizeof(DWORD64), 0);
38+
ReadProcessMemory(proc->getHandle(), reinterpret_cast<LPCVOID>(address), &address, sizeof(DWORD64), 0);
3939
}
4040
address += offsets_[offsets_.size() - 1];
4141

src/process/process.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <iostream>
44

55
// constructor
6-
Process::Process(std::string processName)
6+
Process::Process(const std::string &processName)
77
{
88
getProcessId(processName);
99
}
@@ -15,14 +15,15 @@ Process::~Process()
1515
}
1616

1717
// Gets the process id of the processname
18-
void Process::getProcessId(std::string processName)
18+
void Process::getProcessId(const std::string &processName)
1919
{
20-
hWnd_ = FindWindow(0, processName.c_str());
20+
hWnd_ = FindWindow(nullptr, processName.c_str());
2121
GetWindowThreadProcessId(hWnd_, &pid_);
2222
pHandle_ = OpenProcess(PROCESS_VM_READ, FALSE, pid_);
2323

24-
if(pHandle_ == NULL)
24+
if(pHandle_ == nullptr)
2525
{
26+
std::cout << GetLastError() << std::endl;
2627
std::cout << "FFXIV is not currently running...\n";
2728
std::cout << "Please restart the program while FFXIV is running.\n";
2829
Sleep(1300);

src/process/process.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ class Process
99
HWND hWnd_;
1010
HANDLE pHandle_;
1111
public:
12-
Process(std::string processName);
12+
Process(const std::string &processName);
1313
~Process();
14-
void getProcessId(std::string processName);
14+
void getProcessId(const std::string &processName);
1515
HANDLE getHandle();
1616
DWORD getPid();
1717
};

src/updater/updater.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void Updater::displayUpdate()
5454
if(!compareVersion())
5555
{
5656
std::cout << "Update has been found...\n";
57-
std::cout << "Press enter to update...";
57+
std::cout << "Press any key to update...";
5858

5959
while(true)
6060
{

0 commit comments

Comments
 (0)