From f992748443e05612ae2ba9064912626ff5cce4ce Mon Sep 17 00:00:00 2001 From: David Vogel Date: Sun, 16 Apr 2023 19:13:53 +0200 Subject: [PATCH] Add compatibility with Mar 11 2023 build closes #21 closes #20 --- files/modification.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/files/modification.lua b/files/modification.lua index 20a46ab..2f5b89b 100644 --- a/files/modification.lua +++ b/files/modification.lua @@ -117,6 +117,16 @@ function Modification.SetMemoryOptions(memory) mPlayerNeverDies = function(value) ffi.cast("char*", 0x010EDEC2)[0] = value end, mFreezeAI = function(value) ffi.cast("char*", 0x010EDEC3)[0] = value end, }, + [0x00F8A7B4] = { _BuildString = "Build Mar 11 2023 14:05:19", -- Steam dev build. + mPostFxDisabled = function(value) ffi.cast("char*", 0x010F80EC)[0] = value end, + mGuiDisabled = function(value) ffi.cast("char*", 0x010F80ED)[0] = value end, + mGuiHalfSize = function(value) ffi.cast("char*", 0x010F80EE)[0] = value end, + mFogOfWarOpenEverywhere = function(value) ffi.cast("char*", 0x010F80EF)[0] = value end, + mTrailerMode = function(value) ffi.cast("char*", 0x010F80F0)[0] = value end, + mDayTimeRotationPause = function(value) ffi.cast("char*", 0x010F80F1)[0] = value end, + mPlayerNeverDies = function(value) ffi.cast("char*", 0x010F80F2)[0] = value end, + mFreezeAI = function(value) ffi.cast("char*", 0x010F80F3)[0] = value end, + }, }, }, [false] = { @@ -128,6 +138,13 @@ function Modification.SetMemoryOptions(memory) ptr[0] = value -- This basically just changes the value that Noita forces to the "mods_have_been_active_during_this_run" member of the WorldStateComponent when any mod is enabled. end, }, + [0x00E22E18] = { _BuildString = "Build Mar 11 2023 14:09:24", -- Steam build. + enableModDetection = function(value) + local ptr = ffi.cast("char*", 0x006429ED) -- Can be found by searching for the pattern C6 80 20 01 00 00 >01< 8B CF E8 FB 1D. The pointer has to point to the highlighted byte. + Memory.VirtualProtect(ptr, 1, Memory.PAGE_EXECUTE_READWRITE) + ptr[0] = value -- This basically just changes the value that Noita forces to the "mods_have_been_active_during_this_run" member of the WorldStateComponent when any mod is enabled. + end, + }, }, }, }