Skip to content

Commit

Permalink
updated IDs for BakaFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
shad0wshayd3 committed May 4, 2024
1 parent bacb321 commit 3caa0a8
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 79 deletions.
4 changes: 4 additions & 0 deletions CommonLibF4/include/F4SE/Impl/WinAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ namespace F4SE::WinAPI
};
static_assert(sizeof(CRITICAL_SECTION) == 0x28);

[[nodiscard]] bool(GetComputerName)(
char* a_buffer,
std::uint32_t* a_size) noexcept;

[[nodiscard]] void*(GetCurrentModule)() noexcept;

[[nodiscard]] void*(GetCurrentProcess)() noexcept;
Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BGSDefaultObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ namespace RE

[[nodiscard]] static BSTArray<BGSDefaultObject*>* GetSingleton()
{
REL::Relocation<BSTArray<BGSDefaultObject*>**> singleton{ REL::ID(561749) };
REL::Relocation<BSTArray<BGSDefaultObject*>**> singleton{ REL::ID(2690473) };
return *singleton;
}

Expand All @@ -508,7 +508,7 @@ namespace RE
BGSDefaultObject* ctor(const char* a_name, ENUM_FORM_ID a_formType, const char* a_description)
{
using func_t = decltype(&BGSDefaultObject::ctor);
REL::Relocation<func_t> func{ REL::ID(1144014) };
REL::Relocation<func_t> func{ REL::ID(2197003) };
return func(this, a_name, a_formType, a_description);
}
};
Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/BGSStoryEventManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ namespace RE
public:
[[nodiscard]] static BGSStoryEventManager* GetSingleton()
{
REL::Relocation<BGSStoryEventManager**> singleton{ REL::ID(1160067) };
REL::Relocation<BGSStoryEventManager**> singleton{ REL::ID(2693504) };
return *singleton;
}

std::uint32_t AddEvent(std::uint32_t a_index, const void* a_event)
{
using func_t = std::uint32_t (BGSStoryEventManager::*)(std::uint32_t, const void*);
REL::Relocation<func_t> func{ REL::ID(312533) };
REL::Relocation<func_t> func{ REL::ID(2214088) };
return func(this, a_index, a_event);
}

Expand Down Expand Up @@ -55,7 +55,7 @@ namespace RE

[[nodiscard]] static std::uint32_t EVENT_INDEX()
{
REL::Relocation<std::uint32_t*> eventIdx{ REL::ID(1382765) };
REL::Relocation<std::uint32_t*> eventIdx{ REL::ID(2663409) };
return *eventIdx;
}

Expand Down
8 changes: 4 additions & 4 deletions CommonLibF4/include/RE/Bethesda/BSLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,28 @@ namespace RE
void lock_read()
{
using func_t = decltype(&BSReadWriteLock::lock_read);
REL::Relocation<func_t> func{ REL::ID(1573164) };
REL::Relocation<func_t> func{ REL::ID(2267897) };
return func(this);
}

void lock_write()
{
using func_t = decltype(&BSReadWriteLock::lock_write);
REL::Relocation<func_t> func{ REL::ID(336186) };
REL::Relocation<func_t> func{ REL::ID(2267898) };
return func(this);
}

[[nodiscard]] bool try_lock_read()
{
using func_t = decltype(&BSReadWriteLock::try_lock_read);
REL::Relocation<func_t> func{ REL::ID(1372435) };
REL::Relocation<func_t> func{ REL::ID(2267901) };
return func(this);
}

[[nodiscard]] bool try_lock_write()
{
using func_t = decltype(&BSReadWriteLock::try_lock_write);
REL::Relocation<func_t> func{ REL::ID(1279453) };
REL::Relocation<func_t> func{ REL::ID(2267902) };
return func(this);
}

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BSScript/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ namespace RE
[[nodiscard]] std::size_t GetHandle() const
{
using func_t = decltype(&Object::GetHandle);
REL::Relocation<func_t> func{ REL::ID(1452752) };
REL::Relocation<func_t> func{ REL::ID(2314431) };
return func(this);
}

void IncRef() const
{
using func_t = decltype(&Object::IncRef);
REL::Relocation<func_t> func{ REL::ID(461710) };
REL::Relocation<func_t> func{ REL::ID(2314436) };
return func(this);
}

Expand Down
8 changes: 4 additions & 4 deletions CommonLibF4/include/RE/Bethesda/BSStringPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace RE
static void release(Entry*& a_entry)
{
using func_t = decltype(&Entry::release);
REL::Relocation<func_t> func{ REL::ID(1204430) };
REL::Relocation<func_t> func{ REL::ID(2268720) };
return func(a_entry);
}

Expand Down Expand Up @@ -121,7 +121,7 @@ namespace RE
static BucketTable& GetSingleton()
{
using func_t = decltype(&BucketTable::GetSingleton);
REL::Relocation<func_t> func{ REL::ID(1390486) };
REL::Relocation<func_t> func{ REL::ID(2268736) };
return func();
}

Expand All @@ -139,15 +139,15 @@ namespace RE
inline void GetEntry<char>(BSStringPool::Entry*& a_result, const char* a_string, bool a_caseSensitive)
{
using func_t = decltype(&GetEntry<char>);
REL::Relocation<func_t> func{ REL::ID(507142) };
REL::Relocation<func_t> func{ REL::ID(2268729) };
return func(a_result, a_string, a_caseSensitive);
}

template <>
inline void GetEntry<wchar_t>(BSStringPool::Entry*& a_result, const wchar_t* a_string, bool a_caseSensitive)
{
using func_t = decltype(&GetEntry<wchar_t>);
REL::Relocation<func_t> func{ REL::ID(345043) };
REL::Relocation<func_t> func{ REL::ID(2268730) };
return func(a_result, a_string, a_caseSensitive);
}
}
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/BSTEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace RE

[[nodiscard]] static BSTGlobalEvent* GetSingleton()
{
REL::Relocation<BSTGlobalEvent**> singleton{ REL::ID(1424022) };
REL::Relocation<BSTGlobalEvent**> singleton{ REL::ID(2688814) };
return *singleton;
}

Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/Console.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ namespace RE
public:
[[nodiscard]] static ConsoleLog* GetSingleton()
{
REL::Relocation<ConsoleLog**> singleton{ REL::ID(689441) };
REL::Relocation<ConsoleLog**> singleton{ REL::ID(2690148) };
return *singleton;
}

void AddString(char const* a_string)
{
using func_t = decltype(&ConsoleLog::AddString);
REL::Relocation<func_t> func{ REL::ID(764) };
REL::Relocation<func_t> func{ REL::ID(2248593) };
return func(this, a_string);
}

void Print(const char* a_fmt, std::va_list a_args)
{
using func_t = decltype(&ConsoleLog::Print);
REL::Relocation<func_t> func{ REL::ID(799546) };
REL::Relocation<func_t> func{ REL::ID(2248591) };
func(this, a_fmt, a_args);
}

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace RE
public:
[[nodiscard]] static EventSource_t* GetEventSource()
{
REL::Relocation<EventSource_t**> singleton{ REL::ID(696410) };
REL::Relocation<EventSource_t**> singleton{ REL::ID(2696196) };
if (!*singleton) {
*singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller);
}
Expand Down Expand Up @@ -400,7 +400,7 @@ namespace RE
public:
[[nodiscard]] static EventSource_t* GetEventSource()
{
REL::Relocation<EventSource_t**> singleton{ REL::ID(1140080) };
REL::Relocation<EventSource_t**> singleton{ REL::ID(2696280) };
if (!*singleton) {
*singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller);
}
Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/FormComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ namespace RE
[[nodiscard]] static auto GetSparseFullNameMap()
-> BSTHashMap<const TESForm*, BGSLocalizedString>&
{
REL::Relocation<BSTHashMap<const TESForm*, BGSLocalizedString>*> sparseFullNameMap{ REL::ID(226372), -0x8 };
REL::Relocation<BSTHashMap<const TESForm*, BGSLocalizedString>*> sparseFullNameMap{ REL::ID(2661402), -0x8 };
return *sparseFullNameMap;
}

Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/ItemCrafted.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ namespace RE
inline void NotifyOfItemCrafted(const TESFurniture* a_workbench, const BGSConstructibleObject* a_recipe)
{
using func_t = decltype(&NotifyOfItemCrafted);
REL::Relocation<func_t> func{ REL::ID(788895) };
REL::Relocation<func_t> func{ REL::ID(2232809) };
return func(a_workbench, a_recipe);
}

inline void RegisterSink(BSTEventSink<Event>* a_sink)
{
using func_t = decltype(&RegisterSink);
REL::Relocation<func_t> func{ REL::ID(1320496) };
REL::Relocation<func_t> func{ REL::ID(2232807) };
return func(a_sink);
}

inline void UnregisterSink(BSTEventSink<Event>* a_sink)
{
using func_t = decltype(&UnregisterSink);
REL::Relocation<func_t> func{ REL::ID(1054567) };
REL::Relocation<func_t> func{ REL::ID(2232808) };
return func(a_sink);
}
}
Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ namespace RE

[[nodiscard]] static Main* GetSingleton()
{
REL::Relocation<Main**> singleton{ REL::ID(756304) };
REL::Relocation<Main**> singleton{ REL::ID(2698043) };
return *singleton;
}

[[nodiscard]] static NiCamera* WorldRootCamera()
{
using func_t = decltype(&Main::WorldRootCamera);
REL::Relocation<func_t> func{ REL::ID(384264) };
REL::Relocation<func_t> func{ REL::ID(2228956) };
return func();
}

Expand Down
20 changes: 10 additions & 10 deletions CommonLibF4/include/RE/Bethesda/MemoryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ namespace RE
void* Allocate(std::size_t a_size, std::size_t a_alignment)
{
using func_t = decltype(&ScrapHeap::Allocate);
REL::Relocation<func_t> func{ REL::ID(1085394) };
REL::Relocation<func_t> func{ REL::ID(2267983) };
return func(this, a_size, a_alignment);
}

void Deallocate(void* a_mem)
{
using func_t = decltype(&ScrapHeap::Deallocate);
REL::Relocation<func_t> func{ REL::ID(923307) };
REL::Relocation<func_t> func{ REL::ID(2267984) };
return func(this, a_mem);
}

Expand Down Expand Up @@ -171,14 +171,14 @@ namespace RE
AutoScrapBuffer* Ctor()
{
using func_t = decltype(&AutoScrapBuffer::Ctor);
REL::Relocation<func_t> func{ REL::ID(1571567) };
REL::Relocation<func_t> func{ REL::ID(2267865) };
return func(this);
}

void Dtor()
{
using func_t = decltype(&AutoScrapBuffer::Dtor);
REL::Relocation<func_t> func{ REL::ID(68625) };
REL::Relocation<func_t> func{ REL::ID(2267867) };
return func(this);
}
};
Expand All @@ -197,42 +197,42 @@ namespace RE
[[nodiscard]] static MemoryManager& GetSingleton()
{
using func_t = decltype(&MemoryManager::GetSingleton);
const REL::Relocation<func_t> func{ REL::ID(343176) };
const REL::Relocation<func_t> func{ REL::ID(2193197) };
return func();
}

[[nodiscard]] void* Allocate(std::size_t a_size, std::uint32_t a_alignment, bool a_alignmentRequired)
{
using func_t = decltype(&MemoryManager::Allocate);
const REL::Relocation<func_t> func{ REL::ID(652767) };
const REL::Relocation<func_t> func{ REL::ID(2267872) };
return func(this, a_size, a_alignment, a_alignmentRequired);
}

void Deallocate(void* a_mem, bool a_alignmentRequired)
{
using func_t = decltype(&MemoryManager::Deallocate);
const REL::Relocation<func_t> func{ REL::ID(1582181) };
const REL::Relocation<func_t> func{ REL::ID(2267874) };
return func(this, a_mem, a_alignmentRequired);
}

[[nodiscard]] ScrapHeap* GetThreadScrapHeap()
{
using func_t = decltype(&MemoryManager::GetThreadScrapHeap);
const REL::Relocation<func_t> func{ REL::ID(1495205) };
const REL::Relocation<func_t> func{ REL::ID(2267850) };
return func(this);
}

[[nodiscard]] void* Reallocate(void* a_oldMem, std::size_t a_newSize, std::uint32_t a_alignment, bool a_alignmentRequired)
{
using func_t = decltype(&MemoryManager::Reallocate);
const REL::Relocation<func_t> func{ REL::ID(1502917) };
const REL::Relocation<func_t> func{ REL::ID(2267873) };
return func(this, a_oldMem, a_newSize, a_alignment, a_alignmentRequired);
}

void RegisterMemoryManager()
{
using func_t = decltype(&MemoryManager::RegisterMemoryManager);
const REL::Relocation<func_t> func{ REL::ID(453212) };
const REL::Relocation<func_t> func{ REL::ID(2228356) };
return func(this);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/PlayerCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ namespace RE

[[nodiscard]] static PlayerCharacter* GetSingleton()
{
REL::Relocation<NiPointer<PlayerCharacter>*> singleton{ REL::ID(303410) };
REL::Relocation<NiPointer<PlayerCharacter>*> singleton{ REL::ID(2690919) };
return singleton->get();
}

Expand Down
Loading

0 comments on commit 3caa0a8

Please sign in to comment.