Skip to content

Commit

Permalink
Support address library
Browse files Browse the repository at this point in the history
  • Loading branch information
psiberx committed Feb 29, 2024
1 parent 55e1e00 commit 4b9f56c
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 31 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ With the mod you can:

### Compatibility

- Cyberpunk 2077 2.11
- Cyberpunk 2077 2.12+

### Installation

1. Install requirements:
- [RED4ext](https://docs.red4ext.com/getting-started/installing-red4ext) 1.22.0+
- [RED4ext](https://docs.red4ext.com/getting-started/installing-red4ext) 1.23.0+
2. Extract the release archive `ArchiveXL-x.x.x.zip` into the Cyberpunk 2077 directory.

## Documentation
Expand Down
4 changes: 1 addition & 3 deletions lib/Core/Memory/AddressResolver.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#pragma once

#include "Core/Memory/Common.hpp"

namespace Core
{
class AddressResolver
{
public:
virtual uintptr_t ResolveAddress(AddressSegment aSegment, uint32_t aAddressHash) = 0;
virtual uintptr_t ResolveAddress(uint32_t aAddressID) = 0;

static void SetDefault(AddressResolver& aResolver);
static AddressResolver& GetDefault();
Expand Down
11 changes: 0 additions & 11 deletions lib/Core/Memory/Common.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions lib/Core/Raw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class RawFunc<A, R (*)(Args...)> : public RawBase
}
else
{
address = AddressResolver::GetDefault().ResolveAddress(AddressSegment::Text, target);
address = AddressResolver::GetDefault().ResolveAddress(target);
}
}

Expand Down Expand Up @@ -187,7 +187,7 @@ class RawPtr : public RawBase
}
else
{
static uintptr_t addr = AddressResolver::GetDefault().ResolveAddress(AddressSegment::Data, target);
static uintptr_t addr = AddressResolver::GetDefault().ResolveAddress(target);
return addr;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Support/RED4ext/RED4extProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ bool Support::RED4extProvider::HookDetach(uintptr_t aAddress)
return m_sdk->hooking->Detach(m_plugin, reinterpret_cast<void*>(aAddress));
}

uintptr_t Support::RED4extProvider::ResolveAddress(Core::AddressSegment aSegment, uint32_t aAddressHash)
uintptr_t Support::RED4extProvider::ResolveAddress(uint32_t aAddressID)
{
return RED4ext::UniversalRelocBase::Resolve(static_cast<RED4ext::UniversalRelocSegment>(aSegment), aAddressHash);
return RED4ext::UniversalRelocBase::Resolve(aAddressID);
}
2 changes: 1 addition & 1 deletion lib/Support/RED4ext/RED4extProvider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RED4extProvider
bool HookAttach(uintptr_t aAddress, void* aCallback, void** aOriginal) override;
bool HookDetach(uintptr_t aAddress) override;

uintptr_t ResolveAddress(Core::AddressSegment aSegment, uint32_t aAddressHash) override;
uintptr_t ResolveAddress(uint32_t aAddressID) override;

auto EnableLogging() noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion src/App/Project.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ constexpr auto Author = "psiberx";
constexpr auto NameW = L"ArchiveXL";
constexpr auto AuthorW = L"psiberx";

constexpr auto Version = semver::from_string_noexcept("1.11.4").value();
constexpr auto Version = semver::from_string_noexcept("1.12.0").value();
}
8 changes: 4 additions & 4 deletions src/App/Version.rc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define VER_PRODUCTVERSION 1,11,4,0
#define VER_FILEVERSION 1,11,4,2402291928
#define VER_PRODUCTVERSION 1,12,0,0
#define VER_FILEVERSION 1,12,0,2402292351

#define VER_PRODUCTNAME_STR "ArchiveXL\0"
#define VER_PRODUCTVERSION_STR "1.11.4\0"
#define VER_FILEVERSION_STR "1.11.4.2402291928\0"
#define VER_PRODUCTVERSION_STR "1.12.0\0"
#define VER_FILEVERSION_STR "1.12.0.2402292351\0"

1 VERSIONINFO
FILEVERSION VER_FILEVERSION
Expand Down
4 changes: 2 additions & 2 deletions src/Red/Addresses/Library.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ constexpr uint32_t AppearanceChanger_GetSuffixValue = 1003499294;
constexpr uint32_t AppearanceChanger_RegisterPart = 3169139695;
constexpr uint32_t AppearanceChanger_SelectAppearanceName = 2770550105;

constexpr uint32_t AppearanceChangeSystem_ChangeAppearance = 633157431;
constexpr uint32_t AppearanceChangeSystem_ChangeAppearance = 386815609;

constexpr uint32_t AppearanceNameVisualTagsPreset_GetVisualTags = 1186798404;

constexpr uint32_t AppearanceResource_FindAppearanceDefinition = 985997606;
constexpr uint32_t AppearanceResource_FindAppearanceDefinition = 549398675;

constexpr uint32_t AttachmentSlots_InitializeSlots = 3224838039;
constexpr uint32_t AttachmentSlots_IsSlotEmpty = 4231927464;
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RED4EXT_C_EXPORT void RED4EXT_CALL Query(RED4ext::PluginInfo* aInfo)
App::Project::Version.minor,
App::Project::Version.patch);

aInfo->runtime = RED4EXT_RUNTIME_LATEST;
aInfo->runtime = RED4EXT_RUNTIME_INDEPENDENT;
aInfo->sdk = RED4EXT_SDK_LATEST;
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/RED4ext.SDK
2 changes: 1 addition & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set_xmakever("2.5.9")

set_project("ArchiveXL")
set_version("1.11.4", {build = "%y%m%d%H%M"})
set_version("1.12.0", {build = "%y%m%d%H%M"})

set_arch("x64")
set_languages("cxx2a")
Expand Down

0 comments on commit 4b9f56c

Please sign in to comment.