<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="42">
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"Base Pointers (Move to Update)"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : Mahokenshi.exe
  Version: 
  Date   : 2023-01-25
  Author : Taha

  This script does blah blah blah
}

[ENABLE]

aobscan(Ener,89 48 0C 48 8D AD 00 00 00 00) // should be unique
alloc(newmem,$1000,Ener)
alloc(_Ener,$8)

label(code)
label(return)

registersymbol(_Ener)

newmem:
  mov [rax+0C],ecx
  mov [_Ener],rax
  lea rbp,[rbp+00000000]
  jmp return

code:
  mov [rax+0C],ecx
  lea rbp,[rbp+00000000]
  jmp return

Ener:
  jmp newmem
  nop 5
return:
registersymbol(Ener)

[DISABLE]

Ener:
  db 89 48 0C 48 8D AD 00 00 00 00

unregistersymbol(Ener)
unregistersymbol(_Ener)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 11EF35681DC

11EF35681B6: 48 83 C0 50                    - add rax,50
11EF35681BA: 48 8B 8F B8 00 00 00           - mov rcx,[rdi+000000B8]
11EF35681C1: 48 85 C9                       - test rcx,rcx
11EF35681C4: 0F 84 A9 00 00 00              - je 11EF3568273
11EF35681CA: 48 63 49 5C                    - movsxd  rcx,dword ptr [rcx+5C]
11EF35681CE: 2B CE                          - sub ecx,esi
11EF35681D0: 45 33 C0                       - xor r8d,r8d
11EF35681D3: 33 D2                          - xor edx,edx
11EF35681D5: 44 3B C1                       - cmp r8d,ecx
11EF35681D8: 48 0F 4F CA                    - cmovg rcx,rdx
// ---------- INJECTING HERE ----------
11EF35681DC: 89 48 0C                       - mov [rax+0C],ecx
// ---------- DONE INJECTING  ----------
11EF35681DF: 48 8D AD 00 00 00 00           - lea rbp,[rbp+00000000]
11EF35681E6: 49 BB C0 24 56 F3 1E 01 00 00  - mov r11,0000011EF35624C0
11EF35681F0: 41 FF D3                       - call r11
11EF35681F3: 85 C0                          - test eax,eax
11EF35681F5: 0F 84 50 00 00 00              - je 11EF356824B
11EF35681FB: 48 8B 87 88 00 00 00           - mov rax,[rdi+00000088]
11EF3568202: 48 8B F0                       - mov rsi,rax
11EF3568205: 48 85 C0                       - test rax,rax
11EF3568208: 74 2A                          - je 11EF3568234
11EF356820A: 48 8B 87 B8 00 00 00           - mov rax,[rdi+000000B8]
}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>2</ID>
          <Description>"Energy"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>0C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>16</ID>
          <Description>"Base Energy"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>0</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>4</ID>
          <Description>"Health"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>14</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>3</ID>
          <Description>"Max Health"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>10</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>5</ID>
          <Description>"Gold"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>18</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>13</ID>
          <Description>"Base Strength"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>-3C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>7</ID>
          <Description>"Strength"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>-34</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>14</ID>
          <Description>"Base Defense"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>-2C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>8</ID>
          <Description>"Defense"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>-24</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>15</ID>
          <Description>"Base Draw"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Ener</Address>
          <Offsets>
            <Offset>-20</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>11</ID>
      <Description>"Crystal Pointer (Spend to Update)"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : Mahokenshi.exe
  Version: 
  Date   : 2023-01-25
  Author : dell

  This script does blah blah blah
}

[ENABLE]

aobscan(Crys,89 B7 D8 00 00 00 48 8B 87) // should be unique
alloc(newmem,$1000,Crys)
alloc(_Crys,$8)

label(code)
label(return)

registersymbol(_Crys)

newmem:
  mov [rdi+000000D8],esi
  mov [_Crys],rdi
  jmp return

code:
  mov [rdi+000000D8],esi
  jmp return

Crys:
  jmp newmem
  nop
return:
registersymbol(Crys)

[DISABLE]

Crys:
  db 89 B7 D8 00 00 00

unregistersymbol(Crys)
unregistersymbol(_Crys)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 11EF35FFA0A

11EF35FF9EC: 00 00                 - add [rax],al
11EF35FF9EE: 00 00                 - add [rax],al
11EF35FF9F0: 55                    - push rbp
11EF35FF9F1: 48 8B EC              - mov rbp,rsp
11EF35FF9F4: 48 83 EC 40           - sub rsp,40
11EF35FF9F8: 48 89 75 E8           - mov [rbp-18],rsi
11EF35FF9FC: 48 89 7D F0           - mov [rbp-10],rdi
11EF35FFA00: 4C 89 7D F8           - mov [rbp-08],r15
11EF35FFA04: 48 8B F9              - mov rdi,rcx
11EF35FFA07: 48 8B F2              - mov rsi,rdx
// ---------- INJECTING HERE ----------
11EF35FFA0A: 89 B7 D8 00 00 00     - mov [rdi+000000D8],esi
// ---------- DONE INJECTING  ----------
11EF35FFA10: 48 8B 87 C0 00 00 00  - mov rax,[rdi+000000C0]
11EF35FFA17: 48 8B C8              - mov rcx,rax
11EF35FFA1A: 4C 8B F9              - mov r15,rcx
11EF35FFA1D: 48 85 C0              - test rax,rax
11EF35FFA20: 75 02                 - jne 11EF35FFA24
11EF35FFA22: EB 17                 - jmp 11EF35FFA3B
11EF35FFA24: F3 0F 2A C6           - cvtsi2ss xmm0,esi
11EF35FFA28: F3 0F 5A C0           - cvtss2sd xmm0,xmm0
11EF35FFA2C: 49 8B CF              - mov rcx,r15
11EF35FFA2F: F2 0F 10 C8           - movsd xmm1,xmm0
}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>12</ID>
          <Description>"Crystals"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>_Crys</Address>
          <Offsets>
            <Offset>D8</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>22</ID>
      <Description>"Equipment 1 Turn Cooldown"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : Mahokenshi.exe
  Version: 
  Date   : 2023-01-25
  Author : dell

  This script does blah blah blah
}

[ENABLE]

aobscan(Cooll,D3 89 46 60 48 8B 46 38) // should be unique
alloc(newmem,$1000,Cooll)

label(code)
label(return)

newmem:
  mov [rsi+60],eax
  mov [rsi+60],#0
  mov rax,[rsi+38]
  jmp return

code:
  mov [rsi+60],eax
  mov rax,[rsi+38]
  jmp return

Cooll+01:
  jmp newmem
  nop 2
return:
registersymbol(Cooll)

[DISABLE]

Cooll+01:
  db 89 46 60 48 8B 46 38

unregistersymbol(Cooll)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 14835A4DB5B

14835A4DB37: FF C0                          - inc eax
14835A4DB39: 89 46 5C                       - mov [rsi+5C],eax
14835A4DB3C: 48 63 4E 60                    - movsxd  rcx,dword ptr [rsi+60]
14835A4DB40: FF C9                          - dec ecx
14835A4DB42: 48 8B C1                       - mov rax,rcx
14835A4DB45: 89 46 60                       - mov [rsi+60],eax
14835A4DB48: 4C 63 46 58                    - movsxd  r8,dword ptr [rsi+58]
14835A4DB4C: 33 D2                          - xor edx,edx
14835A4DB4E: 49 BB 80 D5 51 68 47 01 00 00  - mov r11,000001476851D580
14835A4DB58: 41 FF D3                       - call r11
// ---------- INJECTING HERE ----------
14835A4DB5B: 89 46 60                       - mov [rsi+60],eax
// ---------- DONE INJECTING  ----------
14835A4DB5E: 48 8B 46 38                    - mov rax,[rsi+38]
14835A4DB62: 48 8B C8                       - mov rcx,rax
14835A4DB65: 48 8B F9                       - mov rdi,rcx
14835A4DB68: 48 85 C0                       - test rax,rax
14835A4DB6B: 75 02                          - jne 14835A4DB6F
14835A4DB6D: EB 0A                          - jmp 14835A4DB79
14835A4DB6F: 48 63 56 60                    - movsxd  rdx,dword ptr [rsi+60]
14835A4DB73: 48 8B CF                       - mov rcx,rdi
14835A4DB76: FF 57 18                       - call qword ptr [rdi+18]
14835A4DB79: 48 63 46 60                    - movsxd  rax,dword ptr [rsi+60]
}
</AssemblerScript>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
</CheatTable>
