diff --git a/UPDATING.md b/UPDATING.md new file mode 100644 index 0000000..4e861fd --- /dev/null +++ b/UPDATING.md @@ -0,0 +1,20 @@ +# UPDATING +------------ +This is a checklist of things to do while UPDATING the program for a new patch + +#### DIRECTX 11 (x64) +-------------- + +- [x] Number of Party Members `arch\\x64.cpp : 14` +- [x] You `arch\\x64.cpp : 41` +- [x] Normal Party Allies (find one and add 0x220 to each) `arch\\x64.cpp : 43-50` +- [x] Cross-World Party Boolean `arch\\x64.cpp : 79` +- [x] First Cross-World Party Ally `arch\\x64.cpp : 57` + +#### DIRECTX 9 (x86) +---------------------------- +- [x] Number of Party Members `arch\\x64.cpp : 13` +- [x] You `arch\\x64.cpp : 41` +- [x] Normal Party Allies (find one and add 0x220 to each) `arch\\x64.cpp : 42-49` +- [x] Cross-World Party Boolean `arch\\x64.cpp : 78` +- [ ] First Cross-World Party Ally `arch\\x64.cpp : 55` diff --git a/src/arch/x64.cpp b/src/arch/x64.cpp index e94f559..1e2573b 100644 --- a/src/arch/x64.cpp +++ b/src/arch/x64.cpp @@ -11,7 +11,7 @@ x64::x64(Process* proc) // get window name exe_ = new Module("ffxiv_dx11.exe"); // memory offests for dx11 number of party members - numberOfPartyMembers_ = new Offset({ 0x0180A038, 0x38, 0x18, 0x20, 0x20, 0x10 }); + numberOfPartyMembers_ = new Offset({ 0x018AE778, 0x38, 0x18, 0x20, 0x20, 0x10 }); // if dx11 (64-bit) set static x64 true if (exe_->getModule(proc)) @@ -35,23 +35,28 @@ x64::~x64() // create allies void x64::createAllies(Process* proc) { + // A7128 + // 18F30F8 // dx11 64-bit offsets - allies_.push_back(new YOU(0x182AB51)); - allies_.push_back(new Ally(0x184BFD0)); - allies_.push_back(new Ally(0x184C1F0)); - allies_.push_back(new Ally(0X184C410)); - allies_.push_back(new Ally(0x184C630)); - allies_.push_back(new Ally(0x184C850)); - allies_.push_back(new Ally(0x184CA70)); - allies_.push_back(new Ally(0x184CC90)); - allies_.push_back(new Ally(0X184CEB0)); - + allies_.push_back(new YOU(0x18D1C79)); + // each address is 0x220 away + allies_.push_back(new Ally(0x18F3540)); + allies_.push_back(new Ally(0x18F3760)); + allies_.push_back(new Ally(0X18F3980)); + allies_.push_back(new Ally(0x18F3BA0)); + allies_.push_back(new Ally(0x18F3DC0)); + allies_.push_back(new Ally(0x18F3FE0)); + allies_.push_back(new Ally(0x18F4200)); + allies_.push_back(new Ally(0X18F3320)); + // 18F3320 // create crossworld allies - alliesCW_.push_back(allies_[0]); // YOU - DWORD64 address = exe_->getAddress(); - address += 0x017E86A0; + alliesCW_.push_back(allies_[0]); // YOU - ReadProcessMemory(proc->getHandle(), (void*)address, &address, sizeof(DWORD64), 0); + DWORD64 address = exe_->getAddress(); // exe base address + // 0x0188C540 #NEW ADDRESS + address += 0x0188C540; // address offset + + ReadProcessMemory(proc->getHandle(), reinterpret_cast(address), &address, sizeof(DWORD64), 0); address += 0x2E8; alliesCW_.push_back(new AllyCW(address)); @@ -65,11 +70,11 @@ void x64::createAllies(Process* proc) // get the number of party members void x64::updateNumberOfPartyMembers(Process* proc, int &partyMembers) { - ReadProcessMemory(proc->getHandle(), (void*)(numberOfPartyMembers_->getMemoryAddress64(proc, exe_)), &partyMembers, sizeof(int), 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(numberOfPartyMembers_->getMemoryAddress64(proc, exe_)), &partyMembers, sizeof(int), 0); } // check if currently crossworld party void x64::checkCrossWorldParty(Process* proc) { - ReadProcessMemory(proc->getHandle(), (void*)(exe_->getAddress() + 0x184AF8C), &inCrossWorldParty_, 1, 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(exe_->getAddress() + 0x18F22C4), &inCrossWorldParty_, 1, 0); } \ No newline at end of file diff --git a/src/arch/x86.cpp b/src/arch/x86.cpp index 5824df8..3b1c3fc 100644 --- a/src/arch/x86.cpp +++ b/src/arch/x86.cpp @@ -10,7 +10,7 @@ x86::x86(Process* proc) { // handle error when getting invalid module - numberOfPartyMembers_ = new Offset({ 0x114151C, 0x1C, 0x10, 0x10, 0x1C, 0x10 }); + numberOfPartyMembers_ = new Offset({ 0x011B6D74, 0x1C, 0x10, 0x10, 0x1C, 0x10 }); exe_ = new Module("ffxiv.exe"); if (!exe_->getModule32bit(proc)) { @@ -38,23 +38,23 @@ x86::~x86() void x86::createAllies(Process* proc) { // dx9 32-bit offsets - allies_.push_back(new YOU(0x115F441)); - allies_.push_back(new Ally(0x117BA40)); - allies_.push_back(new Ally(0x117BC60)); - allies_.push_back(new Ally(0x117BE80)); - allies_.push_back(new Ally(0x117C0A0)); - allies_.push_back(new Ally(0x117C2C0)); - allies_.push_back(new Ally(0x117C4E0)); - allies_.push_back(new Ally(0x117C700)); - allies_.push_back(new Ally(0x117C920)); + allies_.push_back(new YOU(0x11D7411)); + allies_.push_back(new Ally(0x11F3C00)); // 11F3C00 + allies_.push_back(new Ally(0x11F3E20)); // 11F3E20 + allies_.push_back(new Ally(0x11F4040)); + allies_.push_back(new Ally(0x11F4260)); + allies_.push_back(new Ally(0x11F4480)); // + allies_.push_back(new Ally(0x11F46A0)); + allies_.push_back(new Ally(0x11F48C0)); + allies_.push_back(new Ally(0x11F4AE0)); // create crossworld allies alliesCW_.push_back(allies_[0]); // YOU DWORD address = exe_->getAddress(); - address += 0x10297A4; + address += 0x0109E5A4; - ReadProcessMemory(proc->getHandle(), (void*)address, &address, sizeof(DWORD64), 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(address), &address, sizeof(DWORD), 0); address += 0x2E0; alliesCW_.push_back(new AllyCW(address)); @@ -68,12 +68,12 @@ void x86::createAllies(Process* proc) // get the number of party members void x86::updateNumberOfPartyMembers(Process *proc, int &partyMembers) { - ReadProcessMemory(proc->getHandle(), (void*)(numberOfPartyMembers_->getMemoryAddress(proc, exe_)), &partyMembers, sizeof(int), 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(numberOfPartyMembers_->getMemoryAddress(proc, exe_)), &partyMembers, sizeof(int), 0); } // check if currently crossworld party void x86::checkCrossWorldParty(Process* proc) { // do nothing for the time being - ReadProcessMemory(proc->getHandle(), (void*)(exe_->getAddress() + 0x117ABF4), &inCrossWorldParty_, 1, 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(exe_->getAddress() + 0x11F2DA4), &inCrossWorldParty_, 1, 0); } \ No newline at end of file diff --git a/src/menu.cpp b/src/menu.cpp index 15071be..e76c7c2 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -44,7 +44,7 @@ void Menu::displayAllies() if(fflogs_->arch_->getFilteredAlliesCW().size() < fflogs_->partyMembers_) { - partyMembers = fflogs_->arch_->getFilteredAlliesCW().size(); + partyMembers = static_cast(fflogs_->arch_->getFilteredAlliesCW().size()); } for (int i = 0; i < partyMembers; i++) @@ -68,7 +68,7 @@ void Menu::displayAllies() if (fflogs_->arch_->getFilteredAllies().size() < fflogs_->partyMembers_) { - partyMembers = fflogs_->arch_->getFilteredAllies().size(); + partyMembers = static_cast(fflogs_->arch_->getFilteredAllies().size()); } for (int i = 0; i < partyMembers; i++) diff --git a/src/player/ally.cpp b/src/player/ally.cpp index b3d1dc3..0ef5779 100644 --- a/src/player/ally.cpp +++ b/src/player/ally.cpp @@ -19,5 +19,5 @@ void Ally::display() void Ally::updateName(Process* proc, Module* exe) { - ReadProcessMemory(proc->getHandle(), (void*)(exe->getAddress() + address_), &name_, 80, 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(exe->getAddress() + address_), &name_, 80, 0); } diff --git a/src/player/allyCW.cpp b/src/player/allyCW.cpp index 46bd23b..6ab9446 100644 --- a/src/player/allyCW.cpp +++ b/src/player/allyCW.cpp @@ -18,5 +18,5 @@ void AllyCW::display() void AllyCW::updateName(Process* proc, Module* exe) { - ReadProcessMemory(proc->getHandle(), (void*)(address_), &name_, 80, 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(address_), &name_, 80, 0); } \ No newline at end of file diff --git a/src/player/player.cpp b/src/player/player.cpp index 7aaac71..b7cadfb 100644 --- a/src/player/player.cpp +++ b/src/player/player.cpp @@ -20,14 +20,14 @@ bool Player::getCharId() if (!body.empty()) { - std::wstring tempBody; + if (body.find(L"/character/id/") == std::string::npos) { return false; } - tempBody = body.substr(body.find(L"/character/id/"), body.size()); + std::wstring tempBody = body.substr(body.find(L"/character/id/"), body.size()); std::wstring tempBody2 = tempBody; body = tempBody.substr(0, tempBody.find_first_of(L"\"")); tempBody2 = tempBody2.substr(tempBody2.find(L""), tempBody2.size()); @@ -56,7 +56,7 @@ void Player::openBrowser() { std::wstring url = L"https://www.fflogs.com/character/id/" + characterId_; //url += characterId_; - ShellExecuteW(NULL, L"open", url.c_str(), NULL, NULL, SW_SHOWNORMAL); + ShellExecuteW(nullptr, L"open", url.c_str(), nullptr, nullptr, SW_SHOWNORMAL); } else { @@ -74,9 +74,5 @@ void Player::openBrowser() bool Player::compare(Player* player) { - if(name_ == player->name_) - { - return true; - } - return false; + return name_ == player->name_; } \ No newline at end of file diff --git a/src/player/you.cpp b/src/player/you.cpp index 1d53ffd..a0a5e1b 100644 --- a/src/player/you.cpp +++ b/src/player/you.cpp @@ -19,5 +19,5 @@ void YOU::display() void YOU::updateName(Process* proc, Module* exe) { - ReadProcessMemory(proc->getHandle(), (void*)(exe->getAddress() + address_), &name_, 80, 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(exe->getAddress() + address_), &name_, 80, 0); } diff --git a/src/process/module.cpp b/src/process/module.cpp index f0ad600..af84548 100644 --- a/src/process/module.cpp +++ b/src/process/module.cpp @@ -29,7 +29,7 @@ bool Module::getModule(Process *proc) { if (!strcmp(nModule.szModule, moduleName_)) { - address_ = (DWORD64)nModule.modBaseAddr; + address_ = reinterpret_cast(nModule.modBaseAddr); return true; } } while (Module32Next(hSnapshot, &nModule)); @@ -48,7 +48,7 @@ bool Module::getModule32bit(Process *proc) { if (!strcmp(nModule.szModule, moduleName_)) { - address_ = (DWORD64)nModule.modBaseAddr; + address_ = reinterpret_cast(nModule.modBaseAddr); return true; } } while (Module32Next(hSnapshot, &nModule)); diff --git a/src/process/offset.cpp b/src/process/offset.cpp index 9b91f72..43756e8 100644 --- a/src/process/offset.cpp +++ b/src/process/offset.cpp @@ -22,7 +22,7 @@ DWORD64 Offset::getMemoryAddress(Process* proc, Module* module) for(int i = 0; i < offsets_.size() - 1; i++) { address += offsets_[i]; - ReadProcessMemory(proc->getHandle(), (void*)(address), &address, sizeof(DWORD), 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(address), &address, sizeof(DWORD), 0); } address += offsets_[offsets_.size() - 1]; return address; @@ -35,7 +35,7 @@ DWORD64 Offset::getMemoryAddress64(Process* proc, Module* module) for (int i = 0; i < offsets_.size() - 1; i++) { address += offsets_[i]; - ReadProcessMemory(proc->getHandle(), (void*)(address), &address, sizeof(DWORD64), 0); + ReadProcessMemory(proc->getHandle(), reinterpret_cast(address), &address, sizeof(DWORD64), 0); } address += offsets_[offsets_.size() - 1]; diff --git a/src/process/process.cpp b/src/process/process.cpp index fe82a47..da74b03 100644 --- a/src/process/process.cpp +++ b/src/process/process.cpp @@ -3,7 +3,7 @@ #include // constructor -Process::Process(std::string processName) +Process::Process(const std::string &processName) { getProcessId(processName); } @@ -15,14 +15,15 @@ Process::~Process() } // Gets the process id of the processname -void Process::getProcessId(std::string processName) +void Process::getProcessId(const std::string &processName) { - hWnd_ = FindWindow(0, processName.c_str()); + hWnd_ = FindWindow(nullptr, processName.c_str()); GetWindowThreadProcessId(hWnd_, &pid_); pHandle_ = OpenProcess(PROCESS_VM_READ, FALSE, pid_); - if(pHandle_ == NULL) + if(pHandle_ == nullptr) { + std::cout << GetLastError() << std::endl; std::cout << "FFXIV is not currently running...\n"; std::cout << "Please restart the program while FFXIV is running.\n"; Sleep(1300); diff --git a/src/process/process.h b/src/process/process.h index 0192e0a..7cf91b6 100644 --- a/src/process/process.h +++ b/src/process/process.h @@ -9,9 +9,9 @@ class Process HWND hWnd_; HANDLE pHandle_; public: - Process(std::string processName); + Process(const std::string &processName); ~Process(); - void getProcessId(std::string processName); + void getProcessId(const std::string &processName); HANDLE getHandle(); DWORD getPid(); }; \ No newline at end of file diff --git a/src/updater/updater.cpp b/src/updater/updater.cpp index 5d48531..066317d 100644 --- a/src/updater/updater.cpp +++ b/src/updater/updater.cpp @@ -54,7 +54,7 @@ void Updater::displayUpdate() if(!compareVersion()) { std::cout << "Update has been found...\n"; - std::cout << "Press enter to update..."; + std::cout << "Press any key to update..."; while(true) {