Skip to content

Commit

Permalink
Merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Nov 24, 2023
2 parents 5d747ff + 0d4238c commit 5ad2c5b
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 253 deletions.
40 changes: 40 additions & 0 deletions AsaApi/Core/Private/Offsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,46 @@ namespace API

DWORD64 Offsets::GetAddress(const void* base, const std::string& name)
{
#ifdef API_DEBUG
if (!offsets_dump_.contains(name))
{
Log::GetLog()->critical("Failed to get the offset of {}.", name);
Log::GetLog()->flush();
Sleep(10000);
throw;
}
#endif

return reinterpret_cast<DWORD64>(base) + static_cast<DWORD64>(offsets_dump_[name]);
}

LPVOID Offsets::GetAddress(const std::string& name)
{
#ifdef API_DEBUG
if (!offsets_dump_.contains(name))
{
Log::GetLog()->critical("Failed to get the offset of {}.", name);
Log::GetLog()->flush();
Sleep(10000);
throw;
}
#endif

return reinterpret_cast<LPVOID>(module_base_ + static_cast<DWORD64>(offsets_dump_[name]));
}

LPVOID Offsets::GetDataAddress(const std::string& name)
{
#ifdef API_DEBUG
if (!offsets_dump_.contains(name))
{
Log::GetLog()->critical("Failed to get the offset of {}.", name);
Log::GetLog()->flush();
Sleep(10000);
throw;
}
#endif

return reinterpret_cast<LPVOID>(data_base_ + static_cast<DWORD64>(offsets_dump_[name]));
}

Expand All @@ -74,6 +104,16 @@ namespace API

BitField Offsets::GetBitFieldInternal(const void* base, const std::string& name)
{
#ifdef API_DEBUG
if (!bitfields_dump_.contains(name))
{
Log::GetLog()->critical("Failed to get the bitfield address of {}.", name);
Log::GetLog()->flush();
Sleep(10000);
throw;
}
#endif

const auto bf = bitfields_dump_[name];
auto cf = BitField();
cf.bit_position = bf.bit_position;
Expand Down
2 changes: 1 addition & 1 deletion AsaApi/Core/Public/API/ARK/GameMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,7 @@ struct AShooterGameMode : APrimalGameMode
void LoadBanListFromString(FString* FileString, bool GlobalList) { NativeCall<void, FString*, bool>(this, "AShooterGameMode.LoadBanListFromString(FString&,bool)", FileString, GlobalList); }
//FString* GetSaveDirectoryName(FString* result, ESaveType::Type SaveType, bool RemoveSavedArksDir) { return NativeCall<FString*, FString*, ESaveType::Type, bool>(this, "AShooterGameMode.GetSaveDirectoryName(FString&,ESaveType::Type,bool)", result, SaveType, RemoveSavedArksDir); }
static FString* GeneratePGMapFolderName() { return NativeCall<FString*>(nullptr, "AShooterGameMode.GeneratePGMapFolderName()"); }
FString* GetMapName(FString* result) { return NativeCall<FString*, FString*>(this, "AShooterGameMode.GetMapName(FString&)", result); }
FString* GetMapName(FString* result) { return NativeCall<FString*, FString*>(this, "AShooterGameMode.GetMapName()", result); }
void UpdateSaveBackupFiles() { NativeCall<void>(this, "AShooterGameMode.UpdateSaveBackupFiles()"); }
void LoadTribeIds_Process(unsigned int theTribeID) { NativeCall<void, unsigned int>(this, "AShooterGameMode.LoadTribeIds_Process(unsignedint)", theTribeID); }
void LoadTribeIds() { NativeCall<void>(this, "AShooterGameMode.LoadTribeIds()"); }
Expand Down
Loading

0 comments on commit 5ad2c5b

Please sign in to comment.