Replace offset.bin's header version variable with TimeDateStamp. (#2832)

* Replace offset.bin's header version variable with TimeDateStamp.

* Broke out Read Attribute Patch into two signatures.
This commit is contained in:
gir489 2024-03-16 17:06:29 -04:00 committed by GitHub
parent e8027127d1
commit 0f8cec4604
5 changed files with 18 additions and 2 deletions

View File

@ -44,6 +44,11 @@ namespace memory
return m_size;
}
DWORD module::timestamp() const
{
return m_timestamp;
}
bool module::wait_for_module(std::optional<std::chrono::high_resolution_clock::duration> time)
{
const auto giveup_time = time.has_value() ? std::make_optional(std::chrono::high_resolution_clock::now() + time.value()) : std::nullopt;
@ -72,6 +77,7 @@ namespace memory
const auto ntHeader = m_base.add(dosHeader->e_lfanew).as<IMAGE_NT_HEADERS*>();
m_size = ntHeader->OptionalHeader.SizeOfImage;
m_timestamp = ntHeader->FileHeader.TimeDateStamp;
return m_loaded;
}

View File

@ -18,6 +18,7 @@ namespace memory
bool loaded() const;
size_t size() const;
DWORD timestamp() const;
/**
* @brief Waits till the given module is loaded.

View File

@ -23,5 +23,6 @@ namespace memory
protected:
handle m_base;
std::size_t m_size;
DWORD m_timestamp;
};
}

View File

@ -1813,7 +1813,15 @@ namespace big
[](memory::handle ptr)
{
g_pointers->m_sc.m_read_attribute_patch = ptr.as<PVOID>();
g_pointers->m_sc.m_read_attribute_patch_2 = ptr.add(0x72).as<PVOID>();
}
},
// Read Attribute Patch 2
{
"RAP2",
"32 C0 EB ? C7 83",
[](memory::handle ptr)
{
g_pointers->m_sc.m_read_attribute_patch_2 = ptr.as<PVOID>();
}
}
>();

View File

@ -80,7 +80,7 @@ namespace big
cache_file.set_data(std::move(cache_data_ptr), data_size);
cache_file.set_header_version(mem_region.size());
cache_file.set_header_version(mem_region.timestamp());
cache_file.write();
}