-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move some files, common dp command, some pool to dump, localize/luafi…
…le dump mwiii
- Loading branch information
Showing
23 changed files
with
1,677 additions
and
1,174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include <includes.hpp> | ||
#include "scobalula_csi.hpp" | ||
|
||
namespace compatibility::scobalula::csi { | ||
|
||
const char* CordycepGameName(CordycepGame game) { | ||
switch (game) { | ||
case CG_GHOSTS: return "Ghosts"; | ||
case CG_AW: return "Advanced Warfare"; | ||
case CG_IW: return "Infinite Warfare"; | ||
case CG_MWR: return "Modern Warfare Remastered"; | ||
case CG_MW2R: return "Modern Warfare 2 Remastered"; | ||
case CG_MW4: return "Modern Warfare 2019"; | ||
case CG_MW5: return "Modern Warfare II"; | ||
case CG_MW6: return "Modern Warfare III"; | ||
case CG_VANGUARD: return "Vanguard"; | ||
default: return "<unknown>"; | ||
} | ||
} | ||
|
||
bool CordycepProc::ReadCsi(const std::filesystem::path& path) { | ||
std::string dbBuff{}; | ||
|
||
if (!utils::ReadFile(path, dbBuff)) { | ||
LOG_ERROR("Can't read Cordycep database: {}", path.string()); | ||
return false; | ||
} | ||
|
||
LOG_DEBUG("Loading Cordycep CSI..."); | ||
CordycepCsiHeader* header{ (CordycepCsiHeader*)dbBuff.data() }; | ||
|
||
const char* buffer{ dbBuff.data() }; | ||
size_t idx{ offsetof(CordycepCsiHeader, gameDir) }; | ||
|
||
gameDir.resize(header->stringSize); | ||
memcpy(gameDir.data(), buffer + idx, header->stringSize); | ||
idx += header->stringSize; | ||
|
||
|
||
LOG_DEBUG("Game Id .. {} (0x{:x})", CordycepGameName(header->gameId), (uint64_t)header->gameId); | ||
LOG_DEBUG("Pools .... 0x{:x}", header->poolsAddress); | ||
LOG_DEBUG("Strings .. 0x{:x}", header->stringsAddress); | ||
LOG_DEBUG("Game dir . '{}'", gameDir); | ||
|
||
gameId = header->gameId; | ||
poolsAddress = header->poolsAddress; | ||
stringsAddress = header->stringsAddress; | ||
|
||
return true; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
namespace compatibility::scobalula::csi { | ||
enum CordycepGame : uint64_t { | ||
CG_GHOSTS = 0xA0A5354534F4847, | ||
CG_AW = 0x5241574E41564441, | ||
CG_IW = 0x4652415749464E49, | ||
CG_MWR = 0x30305453414D4552, | ||
CG_MW2R = 0x32305453414D4552, | ||
CG_MW4 = 0x3931524157444F4D, | ||
CG_MW5 = 0x3232524157444F4D, | ||
CG_MW6 = 0x4B4F4D41594D4159, | ||
CG_VANGUARD = 0x44524155474E4156, | ||
}; | ||
|
||
const char* CordycepGameName(CordycepGame game); | ||
|
||
struct CordycepProc { | ||
CordycepGame gameId; | ||
uintptr_t poolsAddress; | ||
uintptr_t stringsAddress; | ||
std::string gameDir; | ||
|
||
bool ReadCsi(const std::filesystem::path& path); | ||
}; | ||
|
||
struct CordycepCsiHeader { | ||
CordycepGame gameId; | ||
uintptr_t poolsAddress; | ||
uintptr_t stringsAddress; | ||
uint32_t stringSize; | ||
byte gameDir[4]; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/acts/compatibility/serious.hpp → src/acts/compatibility/serious_db2.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <includes.hpp> | ||
|
||
namespace { | ||
int commonpooltool(Process& _, int argc, const char* argv[]) { | ||
const char* tools[]{ | ||
"dpbo4", | ||
"dpcw", | ||
"dpt7", | ||
"dpcord", | ||
}; | ||
|
||
for (const char* name : tools) { | ||
const tool::toolfunctiondata& tool = tool::findtool(name); | ||
|
||
if (!tool || !tool.m_game) { | ||
LOG_WARNING("Invalid tool config: {}", name); | ||
continue; | ||
} | ||
|
||
Process proc{ tool.m_game }; | ||
|
||
if (!proc) continue; | ||
|
||
LOG_INFO("Find process {} {}", utils::WStrToStr(tool.m_game), proc); | ||
|
||
if (!proc.Open()) { | ||
LOG_ERROR("Can't open game process: 0x{:x}", GetLastError()); | ||
return -1; | ||
} | ||
|
||
return tool.m_func(proc, argc, argv); | ||
} | ||
|
||
LOG_ERROR("Can't find any supported game"); | ||
LOG_ERROR("Available games:"); | ||
for (const char* name : tools) { | ||
const tool::toolfunctiondata& tool = tool::findtool(name); | ||
|
||
if (!tool || !tool.m_game) { | ||
continue; | ||
} | ||
LOG_ERROR("- {} : {} ({})", utils::WStrToStr(tool.m_game), tool.m_description, tool.m_category); | ||
} | ||
|
||
return tool::BASIC_ERROR; | ||
} | ||
|
||
} | ||
|
||
|
||
ADD_TOOL("dp", "common", " [pool]+", "dump pool", nullptr, commonpooltool); |
Oops, something went wrong.