<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="46">
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"ENABLE ALL CHEATS"</Description>
      <Options moActivateChildrenAsWell="1"/>
      <GroupHeader>1</GroupHeader>
      <Address/>
      <CheatEntries>
        <CheatEntry>
          <ID>0</ID>
          <Description>"INFINITE STAMINA"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Grimshire.exe
  Version: 
  Date   : 2026-04-17
  Author : egkla

  This script does blah blah blah
}

[ENABLE]

aobscan(INFINITE_STAMINA,89 87 88 03 00 00 48 63) // should be unique
alloc(newmem,$1000,INFINITE_STAMINA)

label(code)
label(return)

newmem:

code:
  mov [rdi+00000388],(int)100
  //mov [rdi+00000388],eax
  jmp return

INFINITE_STAMINA:
  jmp newmem
  nop
return:
registersymbol(INFINITE_STAMINA)

[DISABLE]

INFINITE_STAMINA:
  db 89 87 88 03 00 00

unregistersymbol(INFINITE_STAMINA)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: PlayerController:AdjustStamina+6c

PlayerController:AdjustStamina+43: 85 C0                          - test eax,eax
PlayerController:AdjustStamina+45: 74 1C                          - je PlayerController:AdjustStamina+63
PlayerController:AdjustStamina+47: 33 C9                          - xor ecx,ecx
PlayerController:AdjustStamina+49: BA 14 00 00 00                 - mov edx,00000014
PlayerController:AdjustStamina+4e: 49 BB 19 F3 43 31 31 02 00 00  - mov r11,000002313143F319
PlayerController:AdjustStamina+58: 41 FF D3                       - call r11
PlayerController:AdjustStamina+5b: 85 C0                          - test eax,eax
PlayerController:AdjustStamina+5d: 0F 84 78 00 00 00              - je PlayerController:AdjustStamina+db
PlayerController:AdjustStamina+63: 48 63 87 88 03 00 00           - movsxd  rax,dword ptr [rdi+00000388]
PlayerController:AdjustStamina+6a: 03 C6                          - add eax,esi
// ---------- INJECTING HERE ----------
PlayerController:AdjustStamina+6c: 89 87 88 03 00 00              - mov [rdi+00000388],eax
// ---------- DONE INJECTING  ----------
PlayerController:AdjustStamina+72: 48 63 87 88 03 00 00           - movsxd  rax,dword ptr [rdi+00000388]
PlayerController:AdjustStamina+79: 85 C0                          - test eax,eax
PlayerController:AdjustStamina+7b: 7F 0A                          - jg PlayerController:AdjustStamina+87
PlayerController:AdjustStamina+7d: C7 87 88 03 00 00 00 00 00 00  - mov [rdi+00000388],00000000
PlayerController:AdjustStamina+87: 48 63 87 88 03 00 00           - movsxd  rax,dword ptr [rdi+00000388]
PlayerController:AdjustStamina+8e: 48 63 8F 84 03 00 00           - movsxd  rcx,dword ptr [rdi+00000384]
PlayerController:AdjustStamina+95: 3B C1                          - cmp eax,ecx
PlayerController:AdjustStamina+97: 7E 0D                          - jle PlayerController:AdjustStamina+a6
PlayerController:AdjustStamina+99: 48 63 87 84 03 00 00           - movsxd  rax,dword ptr [rdi+00000384]
PlayerController:AdjustStamina+a0: 89 87 88 03 00 00              - mov [rdi+00000388],eax
}
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <CheatCodes>
    <CodeEntry>
      <Description>Change of mov [rdi+00000388],eax</Description>
      <AddressString>1FA8924421C</AddressString>
      <Before>
        <Byte>03</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
        <Byte>03</Byte>
        <Byte>C6</Byte>
      </Before>
      <Actual>
        <Byte>89</Byte>
        <Byte>87</Byte>
        <Byte>88</Byte>
        <Byte>03</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </Actual>
      <After>
        <Byte>48</Byte>
        <Byte>63</Byte>
        <Byte>87</Byte>
        <Byte>88</Byte>
        <Byte>03</Byte>
      </After>
    </CodeEntry>
  </CheatCodes>
  <UserdefinedSymbols/>
  <Comments>Instructions:

Infinite stamina:
1. Use a little bit of stamina before activating cheat.
2. Activate cheat.
3. Use more stamina. Stamina will then return to 100 and stay there.
</Comments>
  <LuaScript>-- Wait 1 second (1000ms) for the UI to settle, then open comments
local t = createTimer()
t.Interval = 1000
t.OnTimer = function(timer)
  timer.destroy() -- Only run this once
  getMainForm().CommentButton.doClick()
end
</LuaScript>
</CheatTable>
