<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>11</ID>
      <Description>"Compact mode"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
--https://forum.cheatengine.org/viewtopic.php?t=570055
LuaCall(function cycleFullCompact(sender,force) local state = not(compactmenuitem.Caption == 'Compact View Mode'); if force~=nil then state = not force end; compactmenuitem.Caption = state and 'Compact View Mode' or 'Full View Mode'; getMainForm().Splitter1.Visible = state; getMainForm().Panel4.Visible    = state; getMainForm().Panel5.Visible    = state; end; function addCompactMenu() if compactmenualreadyexists then return end; local parent = getMainForm().Menu.Items; compactmenuitem = createMenuItem(parent); parent.add(compactmenuitem); compactmenuitem.Caption = 'Compact View Mode'; compactmenuitem.OnClick = cycleFullCompact; compactmenualreadyexists = 'yes'; end; addCompactMenu(); cycleFullCompact(nil,true))

[DISABLE]
LuaCall(cycleFullCompact(nil,false))

</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>12</ID>
      <Description>"Enable (enable twice)"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then
    return
end
if process == nil then
    ShowMessage("Process is not selected.")
elseif readInteger(process) == 0 then
    ShowMessage("Process cannot be opened.")
else
    if monopipe ~= nil and monopipe.ProcessID ~= getOpenedProcessID() then
        monopipe.destroy()
        monopipe = nil
    end
    if monopipe == nil then
        LaunchMonoDataCollector()
    end
end


{$asm}
//define(ResourceManagerClearItemCountsProc, "ResourceManager.ClearItemCounts")
//registersymbol(ResourceManagerClearItemCountsProc)


[DISABLE]
{$lua}
if syntaxcheck then return end;if not syntaxcheck and monopipe then monopipe=nil,monopipe.Destroy()end

{$asm}
unregistersymbol(*)

</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>2</ID>
          <Description>"Set min. stamina"</Description>
          <Options moHideChildren="1"/>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Elin.exe
  Version: 
  Date   : 2024-12-21
  Author :
}

[ENABLE]

aobscanregion(INJECT_SET_STA,Stats:Mod+a0,Stats:Mod+1b0,48 8B CF 48 8B 07) // should be unique
alloc(newmem,$1000,INJECT_SET_STA)

label(code)
label(return)
label(i_min_sta)

newmem:
  push r12
  mov r12d, [rax]
  mov r12, [rdi]

  cmp dword ptr [rdi+18], 3 // stamina
  jne endp
  mov r12d, [i_min_sta]
  cmp [rax], r12d
  jae endp
  mov [rax], r12d

endp:
  pop r12

code:
  mov rcx,rdi
  mov rax,[rdi]
  jmp return
align 10 cc
  i_min_sta:
  dd 8

INJECT_SET_STA:
  jmp newmem
  nop
return:
registersymbol(INJECT_SET_STA)
registersymbol(i_min_sta)

[DISABLE]

INJECT_SET_STA:
  db 48 8B CF 48 8B 07

unregistersymbol(*)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: Stats:Mod+a9

Stats:Mod+83: FF 90 80 00 00 00  - call qword ptr [rax+00000080]
Stats:Mod+89: 4C 8B F8           - mov r15,rax
Stats:Mod+8c: 48 8B CF           - mov rcx,rdi
Stats:Mod+8f: 48 8B 07           - mov rax,[rdi]
Stats:Mod+92: FF 90 20 01 00 00  - call qword ptr [rax+00000120]
Stats:Mod+98: 48 8B D0           - mov rdx,rax
Stats:Mod+9b: 03 D6              - add edx,esi
Stats:Mod+9d: 48 8B CF           - mov rcx,rdi
Stats:Mod+a0: 48 8B 07           - mov rax,[rdi]
Stats:Mod+a3: FF 90 18 01 00 00  - call qword ptr [rax+00000118]
// ---------- INJECTING HERE ----------
Stats:Mod+a9: 48 8B CF           - mov rcx,rdi
// ---------- DONE INJECTING  ----------
Stats:Mod+ac: 48 8B 07           - mov rax,[rdi]
Stats:Mod+af: FF 90 20 01 00 00  - call qword ptr [rax+00000120]
Stats:Mod+b5: 48 89 45 D8        - mov [rbp-28],rax
Stats:Mod+b9: 48 8B CF           - mov rcx,rdi
Stats:Mod+bc: 48 8B 07           - mov rax,[rdi]
Stats:Mod+bf: FF 90 F8 00 00 00  - call qword ptr [rax+000000F8]
Stats:Mod+c5: 48 8B C8           - mov rcx,rax
Stats:Mod+c8: 48 8B 45 D8        - mov rax,[rbp-28]
Stats:Mod+cc: 3B C1              - cmp eax,ecx
Stats:Mod+ce: 0F 8D 20 00 00 00  - jnl Stats:Mod+f4
}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>3</ID>
              <Description>"min. stamina"</Description>
              <ShowAsSigned>0</ShowAsSigned>
              <Color>C08000</Color>
              <VariableType>4 Bytes</VariableType>
              <Address>i_min_sta</Address>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>8</ID>
          <Description>"Get HP"</Description>
          <Options moHideChildren="1" moDeactivateChildrenAsWell="1"/>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Elin.exe
  Version: 
  Date   : 2024-12-21
  Author :
}

[ENABLE]

aobscanregion(INJECT_GET_HP,WidgetHP:Refresh+8f, WidgetHP:Refresh+19f, 48 63 40 58 48 89 85 90 FE FF FF) // should be unique
alloc(newmem,$1000,INJECT_GET_HP)

label(code)
label(return)
label(i_base_hp_addr)
newmem:
  mov [i_base_hp_addr], rax

code:
  movsxd  rax,dword ptr [rax+58]
  mov [rbp-00000170],rax
  jmp return
align 10 cc
  i_base_hp_addr:
  dq 0
INJECT_GET_HP:
  jmp newmem
  nop 6
return:
registersymbol(INJECT_GET_HP)
registersymbol(i_base_hp_addr)
[DISABLE]

INJECT_GET_HP:
  db 48 63 40 58 48 89 85 90 FE FF FF

unregistersymbol(*)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: WidgetHP:Refresh+9f

WidgetHP:Refresh+6f: 85 C0                          - test eax,eax
WidgetHP:Refresh+71: 0F 85 A6 02 00 00              - jne WidgetHP:Refresh+31d
WidgetHP:Refresh+77: 48 8D AD 00 00 00 00           - lea rbp,[rbp+00000000]
WidgetHP:Refresh+7e: 49 BB 90 FC 45 90 4F 02 00 00  - mov r11,EMono:get_pc
WidgetHP:Refresh+88: 41 FF D3                       - call r11
WidgetHP:Refresh+8b: 48 8B C8                       - mov rcx,rax
WidgetHP:Refresh+8e: 83 39 00                       - cmp dword ptr [rcx],00
WidgetHP:Refresh+91: 48 8B 40 28                    - mov rax,[rax+28]
WidgetHP:Refresh+95: 83 78 18 0E                    - cmp dword ptr [rax+18],0E
WidgetHP:Refresh+99: 0F 86 51 0E 00 00              - jbe WidgetHP:Refresh+ef0
// ---------- INJECTING HERE ----------
WidgetHP:Refresh+9f: 48 63 40 58                    - movsxd  rax,dword ptr [rax+58]
// ---------- DONE INJECTING  ----------
WidgetHP:Refresh+a3: 48 89 85 90 FE FF FF           - mov [rbp-00000170],rax
WidgetHP:Refresh+aa: 48 8D 6D 00                    - lea rbp,[rbp+00]
WidgetHP:Refresh+ae: 49 BB 90 FC 45 90 4F 02 00 00  - mov r11,EMono:get_pc
WidgetHP:Refresh+b8: 41 FF D3                       - call r11
WidgetHP:Refresh+bb: 48 8B C8                       - mov rcx,rax
WidgetHP:Refresh+be: 48 8B 00                       - mov rax,[rax]
WidgetHP:Refresh+c1: FF 90 18 02 00 00              - call qword ptr [rax+00000218]
WidgetHP:Refresh+c7: 48 8B C8                       - mov rcx,rax
WidgetHP:Refresh+ca: 48 8B 85 90 FE FF FF           - mov rax,[rbp-00000170]
WidgetHP:Refresh+d1: 3B C1                          - cmp eax,ecx
}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>5</ID>
              <Description>"HP double heal"</Description>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>{ Game   : Elin.exe
  Version: 
  Date   : 2024-12-21
  Author :
}

[ENABLE]

aobscanregion(INJECT_HEAL_HP_MULTI,Card:HealHP+34, Card:HealHP+144, 03 4D 98 49 8B 47 28) // should be unique
alloc(newmem,$1000,INJECT_HEAL_HP_MULTI)

label(code)
label(return)

newmem:
  cmp rax, [i_base_hp_addr]
  jne code
  add ecx,[rbp-68]

code:
  add ecx,[rbp-68]
  mov rax,[r15+28]
  jmp return

INJECT_HEAL_HP_MULTI:
  jmp newmem
  nop 2
return:
registersymbol(INJECT_HEAL_HP_MULTI)

[DISABLE]

INJECT_HEAL_HP_MULTI:
  db 03 4D 98 49 8B 47 28

unregistersymbol(INJECT_HEAL_HP_MULTI)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: Card:HealHP+44

Card:HealHP+13: 4C 8B F9              - mov r15,rcx
Card:HealHP+16: 48 89 55 98           - mov [rbp-68],rdx
Card:HealHP+1a: 49 8B F0              - mov rsi,r8
Card:HealHP+1d: C7 45 A0 00 00 00 00  - mov [rbp-60],00000000
Card:HealHP+24: C7 45 A4 00 00 00 00  - mov [rbp-5C],00000000
Card:HealHP+2b: C7 45 A8 00 00 00 00  - mov [rbp-58],00000000
Card:HealHP+32: 49 8B 47 28           - mov rax,[r15+28]
Card:HealHP+36: 83 78 18 0E           - cmp dword ptr [rax+18],0E
Card:HealHP+3a: 0F 86 19 02 00 00     - jbe Card:HealHP+259
Card:HealHP+40: 48 63 48 58           - movsxd  rcx,dword ptr [rax+58]
// ---------- INJECTING HERE ----------
Card:HealHP+44: 03 4D 98              - add ecx,[rbp-68]
// ---------- DONE INJECTING  ----------
Card:HealHP+47: 49 8B 47 28           - mov rax,[r15+28]
Card:HealHP+4b: 83 78 18 0E           - cmp dword ptr [rax+18],0E
Card:HealHP+4f: 0F 86 FD 01 00 00     - jbe Card:HealHP+252
Card:HealHP+55: 89 48 58              - mov [rax+58],ecx
Card:HealHP+58: 49 8B 47 28           - mov rax,[r15+28]
Card:HealHP+5c: 83 78 18 0E           - cmp dword ptr [rax+18],0E
Card:HealHP+60: 0F 86 E5 01 00 00     - jbe Card:HealHP+24b
Card:HealHP+66: 48 63 40 58           - movsxd  rax,dword ptr [rax+58]
Card:HealHP+6a: 48 89 45 90           - mov [rbp-70],rax
Card:HealHP+6e: 49 8B CF              - mov rcx,r15
}
</AssemblerScript>
            </CheatEntry>
            <CheatEntry>
              <ID>7</ID>
              <Description>"HP"</Description>
              <ShowAsSigned>0</ShowAsSigned>
              <VariableType>4 Bytes</VariableType>
              <Address>i_base_hp_addr</Address>
              <Offsets>
                <Offset>58</Offset>
              </Offsets>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>10</ID>
          <Description>"Dag item: set min. stock to 10, if &gt; 1"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : Elin.exe
  Version: 
  Date   : 2024-12-21
  Author :
}

[ENABLE]

aobscanregion(INJECT_ITEM_DRAG,InvOwner:OnDrag+9b2,InvOwner:OnDrag+ac2,48 63 40 38 48 89 85 48 FF FF FF) // should be unique
alloc(newmem,$1000,INJECT_ITEM_DRAG)

label(code)
label(return)

newmem:
  cmp dword ptr [rax+38], 1
  je code
  cmp dword ptr [rax+38], A
  jae code
  mov dword ptr [rax+38], A

code:
  movsxd  rax,dword ptr [rax+38]
  mov [rbp-000000B8],rax
  jmp return

INJECT_ITEM_DRAG:
  jmp newmem
  nop 6
return:
registersymbol(INJECT_ITEM_DRAG)

[DISABLE]

INJECT_ITEM_DRAG:
  db 48 63 40 38 48 89 85 48 FF FF FF

unregistersymbol(INJECT_ITEM_DRAG)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: InvOwner:OnDrag+9c2

InvOwner:OnDrag+99f: 85 C0                          - test eax,eax
InvOwner:OnDrag+9a1: 75 07                          - jne InvOwner:OnDrag+9aa
InvOwner:OnDrag+9a3: 33 C0                          - xor eax,eax
InvOwner:OnDrag+9a5: E9 0B 02 00 00                 - jmp InvOwner:OnDrag+bb5
InvOwner:OnDrag+9aa: 49 8B 46 20                    - mov rax,[r14+20]
InvOwner:OnDrag+9ae: 48 8B C8                       - mov rcx,rax
InvOwner:OnDrag+9b1: 83 39 00                       - cmp dword ptr [rcx],00
InvOwner:OnDrag+9b4: 48 8B 40 28                    - mov rax,[rax+28]
InvOwner:OnDrag+9b8: 83 78 18 06                    - cmp dword ptr [rax+18],06
InvOwner:OnDrag+9bc: 0F 86 38 02 00 00              - jbe InvOwner:OnDrag+bfa
// ---------- INJECTING HERE ----------
InvOwner:OnDrag+9c2: 48 63 40 38                    - movsxd  rax,dword ptr [rax+38]
// ---------- DONE INJECTING  ----------
InvOwner:OnDrag+9c6: 48 89 85 48 FF FF FF           - mov [rbp-000000B8],rax
InvOwner:OnDrag+9cd: 48 B9 28 11 AE 92 50 02 00 00  - mov rcx,0000025092AE1128
InvOwner:OnDrag+9d7: 48 8D AD 00 00 00 00           - lea rbp,[rbp+00000000]
InvOwner:OnDrag+9de: 49 BB 10 30 E2 1D 4F 02 00 00  - mov r11,System.Object:__icall_wrapper_ves_icall_object_new_specific
InvOwner:OnDrag+9e8: 41 FF D3                       - call r11
InvOwner:OnDrag+9eb: 4C 8B 8D 48 FF FF FF           - mov r9,[rbp-000000B8]
InvOwner:OnDrag+9f2: 48 89 85 50 FF FF FF           - mov [rbp-000000B0],rax
InvOwner:OnDrag+9f9: 48 8B C8                       - mov rcx,rax
InvOwner:OnDrag+9fc: 49 8B D6                       - mov rdx,r14
InvOwner:OnDrag+9ff: 4D 8B C7                       - mov r8,r15
}
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>13</ID>
      <Description>"Elin (EA)  /  https://opencheattables.com"</Description>
      <Color>00B500</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
  </CheatEntries>
  <CheatCodes>
    <CodeEntry>
      <Description>GoalAutoCombat:.ctor+1c7  :movsxd  r14,dword ptr [rax+58]</Description>
      <AddressString>24F94B66847</AddressString>
      <Before>
        <Byte>86</Byte>
        <Byte>14</Byte>
        <Byte>02</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </Before>
      <Actual>
        <Byte>4C</Byte>
        <Byte>63</Byte>
        <Byte>70</Byte>
        <Byte>58</Byte>
      </Actual>
      <After>
        <Byte>E9</Byte>
        <Byte>74</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </After>
    </CodeEntry>
  </CheatCodes>
  <UserdefinedSymbols/>
</CheatTable>
