Skip to content

Commit

Permalink
Support patch 1.61
Browse files Browse the repository at this point in the history
  • Loading branch information
psiberx committed Nov 8, 2022
1 parent a51d013 commit aa556c3
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 25 deletions.
37 changes: 37 additions & 0 deletions config/Version.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#define VER_PRODUCTVERSION ${VERSION_MAJOR},${VERSION_MINOR},${VERSION_ALTER},0
#define VER_FILEVERSION ${VERSION_MAJOR},${VERSION_MINOR},${VERSION_ALTER},${VERSION_BUILD}

#define VER_PRODUCTNAME_STR "${NAME}\0"
#define VER_PRODUCTVERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_ALTER}\0"
#define VER_FILEVERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_ALTER}.${VERSION_BUILD}\0"

1 VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK 0x17L
FILEFLAGS 0x0L
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "\0"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "\0"
VALUE "LegalCopyright", "\0"
VALUE "LegalTrademarks1", "\0"
VALUE "LegalTrademarks2", "\0"
VALUE "OriginalFilename", "\0"
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
2 changes: 1 addition & 1 deletion lib/Core/Hooking/Detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ class HookHandler<TRaw<TOffset, TRet(*)(TArgs...)>, TWrapper, TFlow, TRun>
inline static void Dispose()
{
s_callback = {};
s_original = nullptr;
//s_original = nullptr;
}

private:
Expand Down
28 changes: 25 additions & 3 deletions src/App/Extensions/InkSpawner/Module.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#include "Module.hpp"
#include "Red/InkSpawner.hpp"
#include "Red/Threads.hpp"

namespace
{
constexpr auto ModuleName = "InkSpawner";
constexpr auto WaitTimeout = std::chrono::milliseconds(200);
constexpr auto WaitTick = std::chrono::milliseconds(2);
}

std::string_view App::InkSpawnerModule::GetName()
Expand Down Expand Up @@ -37,9 +40,28 @@ void App::InkSpawnerModule::OnSpawnExternal(Red::Handle<Red::ink::WidgetLibraryI
if (externalLibrary.path == aExternalLibraryPath)
return;

// Add the requested library to the list.
// Add the requested library to the list
aLocalLibrary->externalLibraries.EmplaceBack(aExternalLibraryPath);

// Load requested library for the spawner.
(aLocalLibrary->externalLibraries.End() - 1)->Load();
// Load requested library for the spawner
auto externalLibrary = aLocalLibrary->externalLibraries.End() - 1;

if (Raw::IsMainThread())
{
externalLibrary->Load();
}
else
{
externalLibrary->LoadAsync();

const auto start = std::chrono::steady_clock::now();

while (!externalLibrary->IsLoaded() && !externalLibrary->IsFailed())
{
std::this_thread::sleep_for(WaitTick);

if (std::chrono::steady_clock::now() - start >= WaitTimeout)
break;
}
}
}
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.1.5").value();
constexpr auto Version = semver::from_string_noexcept("1.1.6").value();
}
37 changes: 37 additions & 0 deletions src/App/Version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#define VER_PRODUCTVERSION 1,1,6,0
#define VER_FILEVERSION 1,1,6,2211082054

#define VER_PRODUCTNAME_STR "ArchiveXL\0"
#define VER_PRODUCTVERSION_STR "1.1.6\0"
#define VER_FILEVERSION_STR "1.1.6.2211082054\0"

1 VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK 0x17L
FILEFLAGS 0x0L
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "\0"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "\0"
VALUE "LegalCopyright", "\0"
VALUE "LegalTrademarks1", "\0"
VALUE "LegalTrademarks2", "\0"
VALUE "OriginalFilename", "\0"
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
35 changes: 18 additions & 17 deletions src/Red/Addresses.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

// Generated by cp77ida.py on 2022-10-27 for Cyberpunk 2077 v.1.6
// Generated by cp77ida.py on 2022-11-08 for Cyberpunk 2077 v.1.61
// DO NOT MODIFY. USE tools\ida\scan.py TO GENERATE THIS FILE.

#include <cstdint>
Expand All @@ -9,31 +9,32 @@ namespace Red::Addresses
{
constexpr uintptr_t ImageBase = 0x140000000;

constexpr uintptr_t Main = 0x140195E00 - ImageBase; // 40 53 48 81 EC ? ? ? ? FF 15 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ?, expected: 1, index: 0
constexpr uintptr_t Main = 0x1401963B0 - ImageBase; // 40 53 48 81 EC ? ? ? ? FF 15 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ?, expected: 1, index: 0
constexpr uintptr_t IsMainThread = 0x142B970C0 - ImageBase; // 83 3D ? ? ? ? 00 74 17 65 48 8B 04 25 30 00 00 00 8B 48 48 39 0D ? ? ? ? 74 03 32 C0 C3, expected: 1, index: 0

constexpr uintptr_t AppearanceChanger_ComputePlayerGarment = 0x141C4BA90 - ImageBase; // 48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 4C 89 64 24 20 55 41 56 41 57 48 8D 6C 24 C0, expected: 1, index: 0
constexpr uintptr_t AppearanceChanger_ComputePlayerGarment = 0x141C4BD00 - ImageBase; // 48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 4C 89 64 24 20 55 41 56 41 57 48 8D 6C 24 C0, expected: 1, index: 0

constexpr uintptr_t AppearanceNameVisualTagsPreset_GetVisualTags = 0x1417ABE80 - ImageBase; // 48 89 74 24 18 48 89 54 24 10 57 48 83 EC 40 49 8B F8 48 8D 54 24 20 4C 8D 44 24 58 48 83 C1 40 49 8B F1, expected: 1, index: 0
constexpr uintptr_t AppearanceNameVisualTagsPreset_GetVisualTags = 0x1417AC560 - ImageBase; // 48 89 74 24 18 48 89 54 24 10 57 48 83 EC 40 49 8B F8 48 8D 54 24 20 4C 8D 44 24 58 48 83 C1 40 49 8B F1, expected: 1, index: 0

constexpr uintptr_t AppearanceResource_FindAppearanceDefinition = 0x140FFFF90 - ImageBase; // 48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 20 48 8B F1 45 8B F9 48 81 C1 F0 00 00 00 49 8B D8 4C 8B F2, expected: 1, index: 0
constexpr uintptr_t AppearanceResource_FindAppearanceDefinition = 0x141000690 - ImageBase; // 48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 20 48 8B F1 45 8B F9 48 81 C1 F0 00 00 00 49 8B D8 4C 8B F2, expected: 1, index: 0

constexpr uintptr_t Entity_GetComponents = 0x14104A7C0 - ImageBase; // 48 83 C1 70 E9, expected: 7, index: 1
constexpr uintptr_t Entity_ReassembleAppearance = 0x141046260 - ImageBase; // 40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 88 48 81 EC 78 01 00 00 4C 8B EA 49 8B D9, expected: 1, index: 0
constexpr uintptr_t Entity_GetComponents = 0x14104AEC0 - ImageBase; // 48 83 C1 70 E9, expected: 7, index: 1
constexpr uintptr_t Entity_ReassembleAppearance = 0x141046960 - ImageBase; // 40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 88 48 81 EC 78 01 00 00 4C 8B EA 49 8B D9, expected: 1, index: 0

constexpr uintptr_t EntityTemplate_FindAppearance = 0x141066900 - ImageBase; // 40 53 48 83 EC 20 48 8B D9 48 85 D2 74 ? 48 3B 15 ? ? ? ? 75 ? 48 8B 51 60 48 3B 15 ? ? ? ? 48 89 7C 24 30 75, expected: 1, index: 0
constexpr uintptr_t EntityTemplate_FindAppearance = 0x141067000 - ImageBase; // 40 53 48 83 EC 20 48 8B D9 48 85 D2 74 ? 48 3B 15 ? ? ? ? 75 ? 48 8B 51 60 48 3B 15 ? ? ? ? 48 89 7C 24 30 75, expected: 1, index: 0

constexpr uintptr_t FactoryIndex_LoadFactoryAsync = 0x141058290 - ImageBase; // 48 89 5C 24 18 55 56 57 41 56 41 57 48 8D 6C 24 C9 48 81 EC A0 00 00 00 45 33 FF 48 89 55 DF 4D 8B F0 44 89 7D FB 48 8B D9 4C 89 7D E7, expected: 1, index: 0
constexpr uintptr_t FactoryIndex_LoadFactoryAsync = 0x141058990 - ImageBase; // 48 89 5C 24 18 55 56 57 41 56 41 57 48 8D 6C 24 C9 48 81 EC A0 00 00 00 45 33 FF 48 89 55 DF 4D 8B F0 44 89 7D FB 48 8B D9 4C 89 7D E7, expected: 1, index: 0

constexpr uintptr_t GameApplication_InitResourceDepot = 0x142CC0570 - ImageBase; // 48 89 74 24 18 55 48 8D 6C 24 A9 48 81 EC C0 00 00 00, expected: 1, index: 0
constexpr uintptr_t GameApplication_InitResourceDepot = 0x142CC5910 - ImageBase; // 48 89 74 24 18 55 48 8D 6C 24 A9 48 81 EC C0 00 00 00, expected: 1, index: 0

constexpr uintptr_t GarmentAssembler_AddItem = 0x141C2CEE0 - ImageBase; // 48 89 5C 24 08 57 48 83 EC 60 49 8B F8 4C 8B C2 48 8D 54 24 40 E8 ? ? ? ? 48 8B 07, expected: 2, index: 0
constexpr uintptr_t GarmentAssembler_OverrideItem = 0x141C2CFB0 - ImageBase; // 48 89 5C 24 08 57 48 83 EC 60 49 8B F8 4C 8B C2 48 8D 54 24 40 E8 ? ? ? ? 48 8B 07, expected: 2, index: 1
constexpr uintptr_t GarmentAssembler_RemoveItem = 0x141C2EEE0 - ImageBase; // 48 89 5C 24 08 57 48 83 EC 40 49 8B F8 4C 8B C2 48 8D 54 24 20 E8 ? ? ? ? 44 8B 47, expected: 1, index: 0
constexpr uintptr_t GarmentAssembler_OnGameDetach = 0x141C2F6E0 - ImageBase; // 40 53 48 83 EC 20 8B 51 14 48 8B D9 48 8B 49 08 E8 ? ? ? ? C7 43 14 00 00 00 00, expected: 2, index: 1
constexpr uintptr_t GarmentAssembler_AddItem = 0x141C2D0C0 - ImageBase; // 48 89 5C 24 08 57 48 83 EC 60 49 8B F8 4C 8B C2 48 8D 54 24 40 E8 ? ? ? ? 48 8B 07, expected: 2, index: 0
constexpr uintptr_t GarmentAssembler_OverrideItem = 0x141C2D190 - ImageBase; // 48 89 5C 24 08 57 48 83 EC 60 49 8B F8 4C 8B C2 48 8D 54 24 40 E8 ? ? ? ? 48 8B 07, expected: 2, index: 1
constexpr uintptr_t GarmentAssembler_RemoveItem = 0x141C2F0C0 - ImageBase; // 48 89 5C 24 08 57 48 83 EC 40 49 8B F8 4C 8B C2 48 8D 54 24 20 E8 ? ? ? ? 44 8B 47, expected: 1, index: 0
constexpr uintptr_t GarmentAssembler_OnGameDetach = 0x141C2F8C0 - ImageBase; // 40 53 48 83 EC 20 8B 51 14 48 8B D9 48 8B 49 08 E8 ? ? ? ? C7 43 14 00 00 00 00, expected: 2, index: 1

constexpr uintptr_t InkSpawner_SpawnFromExternal = 0x1409D1170 - ImageBase; // 48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 55 41 56 41 57 48 8D 6C 24 C1 48 81 EC F0 00 00 00, expected: 1, index: 0
constexpr uintptr_t InkSpawner_SpawnFromExternal = 0x1409D14D0 - ImageBase; // 48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 55 41 56 41 57 48 8D 6C 24 C1 48 81 EC F0 00 00 00, expected: 1, index: 0

constexpr uintptr_t Localization_LoadOnScreens = 0x1406ECA50 - ImageBase; // 40 55 53 57 48 8B EC 48 81 EC 80 00 00 00 0F 57 C0 48 8B D9 F3 0F 7F 45 A0 48 85 D2 75 17 33 FF 48 8B C1 48 89 39 48 89 79 08 48 81 C4 80 00 00, expected: 2, index: 0
constexpr uintptr_t Localization_LoadOnScreens = 0x1406ECE40 - ImageBase; // 40 55 53 57 48 8B EC 48 81 EC 80 00 00 00 0F 57 C0 48 8B D9 F3 0F 7F 45 A0 48 85 D2 75 17 33 FF 48 8B C1 48 89 39 48 89 79 08 48 81 C4 80 00 00, expected: 2, index: 0

constexpr uintptr_t TagList_MergeWith = 0x1402AD8C0 - ImageBase; // 48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 48 8B 1A 48 8B F1 8B 42 0C 48 8D 3C C3 48 3B DF 74, expected: 1, index: 0
constexpr uintptr_t TagList_MergeWith = 0x1402ADE70 - ImageBase; // 48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 48 8B 1A 48 8B F1 8B 42 0C 48 8D 3C C3 48 3B DF 74, expected: 1, index: 0
}
11 changes: 11 additions & 0 deletions src/Red/Threads.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once

#include "Core/Raw.hpp"
#include "Red/Addresses.hpp"

namespace Raw
{
constexpr auto IsMainThread = Core::RawFunc<
/* addr = */ Red::Addresses::IsMainThread,
/* type = */ bool (*)()>();
}
2 changes: 2 additions & 0 deletions tools/ida/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def patterns():
Group(functions=[
Item(name="Main",
pattern="40 53 48 81 EC ? ? ? ? FF 15 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ?"),
Item(name="IsMainThread",
pattern="83 3D ? ? ? ? 00 74 17 65 48 8B 04 25 30 00 00 00 8B 48 48 39 0D ? ? ? ? 74 03 32 C0 C3"),
]),
Group(name="AppearanceChanger", functions=[
Item(name="ComputePlayerGarment",
Expand Down
5 changes: 3 additions & 2 deletions 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.1.5")
set_version("1.1.6", {build = "%y%m%d%H%M"})

set_arch("x64")
set_languages("cxx20", "cxx2a")
Expand Down Expand Up @@ -36,7 +36,7 @@ target("ArchiveXL")
set_kind("shared")
set_filename("ArchiveXL.dll")
set_pcxxheader("src/pch.hpp")
add_files("src/**.cpp", "lib/**.cpp")
add_files("src/**.cpp", "src/**.rc", "lib/**.cpp")
add_headerfiles("src/**.hpp", "lib/**.hpp")
add_includedirs("src/", "lib/")
add_deps("RED4ext.SDK", "semver", "wil")
Expand All @@ -45,6 +45,7 @@ target("ArchiveXL")
add_defines("WINVER=0x0601", "WIN32_LEAN_AND_MEAN", "NOMINMAX")
set_configdir("src")
add_configfiles("config/Project.hpp.in", {prefixdir = "App"})
add_configfiles("config/Version.rc.in", {prefixdir = "App"})
set_configvar("AUTHOR", "psiberx")
set_configvar("NAME", "ArchiveXL")

Expand Down

0 comments on commit aa556c3

Please sign in to comment.