If anyone needs to make a stack multiplier (maximum
possible stack is multiplied by your default multiplier 2)
did it for myself
about the behavior if the script is enabled then everything works as it should and if initially the stack was 50 then it will become 100 and will not allow you to increase it anymore
if after this you disable the script
then the stack will not be reset and everything will become infinite
logic without script
max stack = 50
current stack = 50
the value is placed in the register eax = (max stack) - (current stack)
and then in code
very far after the patch there is such a check
mov eax,[rsp+7C]
test eax,eax
je 7FF67ACBE14B
So this check skips all values except 0
and if the current stack is greater than the max stack
then the check value is negative and everything works (infinite stack)
if current stack if less than or equal to max stack
then logic will not allow you to exceed the max stack
In general, unlimited stack will sooner or later hit the ceiling
and reset to your maximum
(no idea about bugs
make backup saves)
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>570</ID>
<Description>"stack_multiplier"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>{ Game : enshrouded.exe
Version:
Date : 2024-02-01
Author : Atamg
This script does blah blah blah
}
[ENABLE]
aobscanmodule(stack_multiplier,enshrouded.exe,0F B7 47 14 2B 46 04) // should be unique
alloc(newmem,$1000,stack_multiplier)
label(code)
label(multiplier_stack)
registersymbol(multiplier_stack)
label(return)
newmem:
code:
movzx eax,word ptr [rdi+14]
imul eax, [multiplier_stack]
sub eax,[rsi+04]
jmp return
multiplier_stack:
dd #2
stack_multiplier:
jmp newmem
nop 2
return:
registersymbol(stack_multiplier)
[DISABLE]
stack_multiplier:
db 0F B7 47 14 2B 46 04
unregistersymbol(stack_multiplier)
unregistersymbol(multiplier_stack)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: enshrouded.exe.text+8CB1CC
enshrouded.exe.text+8CB1AB: 39 06 - cmp [rsi],eax
enshrouded.exe.text+8CB1AD: 74 1D - je enshrouded.exe.text+8CB1CC
enshrouded.exe.text+8CB1AF: C7 43 04 00 00 00 00 - mov [rbx+04],00000000
enshrouded.exe.text+8CB1B6: 48 8B C3 - mov rax,rbx
enshrouded.exe.text+8CB1B9: C6 03 12 - mov byte ptr [rbx],12
enshrouded.exe.text+8CB1BC: 48 8B 5C 24 30 - mov rbx,[rsp+30]
enshrouded.exe.text+8CB1C1: 48 8B 74 24 40 - mov rsi,[rsp+40]
enshrouded.exe.text+8CB1C6: 48 83 C4 20 - add rsp,20
enshrouded.exe.text+8CB1CA: 5F - pop rdi
enshrouded.exe.text+8CB1CB: C3 - ret
// ---------- INJECTING HERE ----------
enshrouded.exe.text+8CB1CC: 0F B7 47 14 - movzx eax,word ptr [rdi+14]
// ---------- DONE INJECTING ----------
enshrouded.exe.text+8CB1D0: 2B 46 04 - sub eax,[rsi+04]
enshrouded.exe.text+8CB1D3: C6 03 00 - mov byte ptr [rbx],00
enshrouded.exe.text+8CB1D6: EB 2F - jmp enshrouded.exe.text+8CB207
enshrouded.exe.text+8CB1D8: 0F B6 87 E6 04 00 00 - movzx eax,byte ptr [rdi+000004E6]
enshrouded.exe.text+8CB1DF: C0 E8 02 - shr al,02
enshrouded.exe.text+8CB1E2: C6 03 00 - mov byte ptr [rbx],00
enshrouded.exe.text+8CB1E5: A8 01 - test al,01
enshrouded.exe.text+8CB1E7: 74 1A - je enshrouded.exe.text+8CB203
enshrouded.exe.text+8CB1E9: C7 43 04 01 00 00 00 - mov [rbx+04],00000001
enshrouded.exe.text+8CB1F0: 48 8B C3 - mov rax,rbx
}
</AssemblerScript>
<CheatEntries>
<CheatEntry>
<ID>571</ID>
<Description>"multiple"</Description>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>4 Bytes</VariableType>
<Address>multiplier_stack</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
</CheatTable>