<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="42">
  <CheatEntries>
    <CheatEntry>
      <ID>4</ID>
      <Description>"Activate for 200 CP for party during battle"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-07
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReanCPAmtForAlliesDuringBattle,hnk.exe,0F B7 48 0C 41 0F B7 C7 66 41 3B CF 66 0F 43 C1) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov word ptr [rax+0C],#200 // New Code
  movzx ecx,word ptr [rax+0C]
  movzx eax,r15w
  cmp cx,r15w
  cmovae ax,cx
  jmp return

ReanCPAmtForAlliesDuringBattle:
  jmp far newmem
  nop 2
return:
registersymbol(ReanCPAmtForAlliesDuringBattle)

[DISABLE]

ReanCPAmtForAlliesDuringBattle:
  db 0F B7 48 0C 41 0F B7 C7 66 41 3B CF 66 0F 43 C1

unregistersymbol(ReanCPAmtForAlliesDuringBattle)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+C9441

hnk.exe+C9417: 66 44 89 67 02        - mov [rdi+02],r12w
hnk.exe+C941C: 48 8B 4E 50           - mov rcx,[rsi+50]
hnk.exe+C9420: E8 CB 37 02 00        - call hnk.exe+ECBF0
hnk.exe+C9425: 0F B7 48 08           - movzx ecx,word ptr [rax+08]
hnk.exe+C9429: 66 3B 4F 02           - cmp cx,[rdi+02]
hnk.exe+C942D: E9 C6 FE FF FF        - jmp hnk.exe+C92F8
hnk.exe+C9432: 80 7B 1E 1F           - cmp byte ptr [rbx+1E],1F
hnk.exe+C9436: 75 1C                 - jne hnk.exe+C9454
hnk.exe+C9438: 48 8B 4E 50           - mov rcx,[rsi+50]
hnk.exe+C943C: E8 AF 37 02 00        - call hnk.exe+ECBF0
// ---------- INJECTING HERE ----------
hnk.exe+C9441: 0F B7 48 0C           - movzx ecx,word ptr [rax+0C]
// ---------- DONE INJECTING  ----------
hnk.exe+C9445: 41 0F B7 C7           - movzx eax,r15w
hnk.exe+C9449: 66 41 3B CF           - cmp cx,r15w
hnk.exe+C944D: 66 0F 43 C1           - cmovae ax,cx
hnk.exe+C9451: 66 89 07              - mov [rdi],ax
hnk.exe+C9454: 48 8B 85 88 81 00 00  - mov rax,[rbp+00008188]
hnk.exe+C945B: 4C 8B 46 50           - mov r8,[rsi+50]
hnk.exe+C945F: 4C 8B 88 58 03 00 00  - mov r9,[rax+00000358]
hnk.exe+C9466: 4D 3B C1              - cmp r8,r9
hnk.exe+C9469: 0F 84 81 00 00 00     - je hnk.exe+C94F0
hnk.exe+C946F: 4D 85 C9              - test r9,r9
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>13</ID>
      <Description>"Mira Pointer"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>hnk.exe+163E5F8</Address>
    </CheatEntry>
    <CheatEntry>
      <ID>31</ID>
      <Description>"Sepith Pointers"</Description>
      <Options moHideChildren="1"/>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>23</ID>
          <Description>"earth"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E558</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>24</ID>
          <Description>"water"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E55C</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>25</ID>
          <Description>"fire"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E560</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>26</ID>
          <Description>"wind"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E564</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>27</ID>
          <Description>"time"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E568</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>28</ID>
          <Description>"space"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E56C</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>29</ID>
          <Description>"mirage"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E570</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>30</ID>
          <Description>"sepith mass"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>hnk.exe+163E574</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>1</ID>
      <Description>"BP pointer"</Description>
      <VariableType>Byte</VariableType>
      <Address>hnk.exe+16469EA</Address>
    </CheatEntry>
    <CheatEntry>
      <ID>5</ID>
      <Description>"Assault Meter pointer (max = 200)"</Description>
      <ShowAsSigned>0</ShowAsSigned>
      <VariableType>2 Bytes</VariableType>
      <Address>hnk.exe+163E626</Address>
    </CheatEntry>
    <CheatEntry>
      <ID>6</ID>
      <Description>"Max Assault Meter on Use"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(WriteToChargeAmtUponUsage,hnk.exe,66 41 89 89 46 2C 7B 00 4D 8B 89 A8 1D 00 00) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov cx,#200 // New Code
  mov [r9+007B2C46],cx
  mov r9,[r9+00001DA8]
  jmp return

WriteToChargeAmtUponUsage:
  jmp far newmem
  nop
return:
registersymbol(WriteToChargeAmtUponUsage)

[DISABLE]

WriteToChargeAmtUponUsage:
  db 66 41 89 89 46 2C 7B 00 4D 8B 89 A8 1D 00 00

unregistersymbol(WriteToChargeAmtUponUsage)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+400982

hnk.exe+400954: EB 34                    - jmp hnk.exe+40098A
hnk.exe+400956: 45 0F B7 81 46 2C 7B 00  - movzx r8d,word ptr [r9+007B2C46]
hnk.exe+40095E: 41 0F B7 C0              - movzx eax,r8w
hnk.exe+400962: 66 44 2B C2              - sub r8w,dx
hnk.exe+400966: 66 3B C2                 - cmp ax,dx
hnk.exe+400969: 41 0F B7 81 F0 40 00 00  - movzx eax,word ptr [r9+000040F0]
hnk.exe+400971: 66 44 0F 46 C1           - cmovbe r8w,cx
hnk.exe+400976: 6B C8 64                 - imul ecx,eax,64
hnk.exe+400979: 66 44 3B C1              - cmp r8w,cx
hnk.exe+40097D: 66 41 0F 46 C8           - cmovbe cx,r8w
// ---------- INJECTING HERE ----------
hnk.exe+400982: 66 41 89 89 46 2C 7B 00  - mov [r9+007B2C46],cx
// ---------- DONE INJECTING  ----------
hnk.exe+40098A: 4D 8B 89 A8 1D 00 00     - mov r9,[r9+00001DA8]
hnk.exe+400991: 49 83 B9 38 E0 06 00 00  - cmp qword ptr [r9+0006E038],00
hnk.exe+400999: 74 2B                    - je hnk.exe+4009C6
hnk.exe+40099B: 4D 8B 89 48 E0 06 00     - mov r9,[r9+0006E048]
hnk.exe+4009A2: 4D 85 C9                 - test r9,r9
hnk.exe+4009A5: 74 1F                    - je hnk.exe+4009C6
hnk.exe+4009A7: 41 0F B7 89 30 03 00 00  - movzx ecx,word ptr [r9+00000330]
hnk.exe+4009AF: 41 0F B7 C0              - movzx eax,r8w
hnk.exe+4009B3: 2B C1                    - sub eax,ecx
hnk.exe+4009B5: 99                       - cdq 
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>40</ID>
      <Description>"Megalith effect (hp/ep regen on field)"</Description>
      <Options moHideChildren="1"/>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>33</ID>
          <Description>"HP regen (800 per sec)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadHPEverySecondOnField,hnk.exe,41 83 3E 00 0F 84 A3 04 00 00 0F B7 D7 49 8B CA) // should be unique
alloc(newmem,$1000)

label(code)
label(dothis)
label(return)

newmem:

code:
  mov r8d,dword ptr [r14]
  add r8d,#800 // Amt HP restored per sec
  // Compare to max HP, to not go over
  cmp r8d,dword ptr [r14+4]
  jl dothis
  mov r8d,dword ptr [r14+4]
  jmp dothis

dothis:
  mov dword ptr [r14],r8d
  cmp dword ptr [r14],00
  je hnk.exe+32A2C1
  movzx edx,di
  mov rcx,r10
  jmp return

ReadHPEverySecondOnField:
  jmp far newmem
  nop 2
return:
registersymbol(ReadHPEverySecondOnField)

[DISABLE]

ReadHPEverySecondOnField:
  db 41 83 3E 00 0F 84 A3 04 00 00 0F B7 D7 49 8B CA

unregistersymbol(ReadHPEverySecondOnField)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+329E14

hnk.exe+329DE0: 4D 8B 95 30 0C 00 00  - mov r10,[r13+00000C30]
hnk.exe+329DE7: 49 8B 82 48 CF 79 00  - mov rax,[r10+0079CF48]
hnk.exe+329DEE: 41 0F B7 3C 07        - movzx edi,word ptr [r15+rax]
hnk.exe+329DF3: 83 FF 40              - cmp edi,40
hnk.exe+329DF6: 0F 83 C5 04 00 00     - jae hnk.exe+32A2C1
hnk.exe+329DFC: 48 8D 0C BF           - lea rcx,[rdi+rdi*4]
hnk.exe+329E00: 48 C1 E1 04           - shl rcx,04
hnk.exe+329E04: 4D 8D B2 4C 2C 7B 00  - lea r14,[r10+007B2C4C]
hnk.exe+329E0B: 4C 03 F1              - add r14,rcx
hnk.exe+329E0E: 0F 84 AD 04 00 00     - je hnk.exe+32A2C1
// ---------- INJECTING HERE ----------
hnk.exe+329E14: 41 83 3E 00           - cmp dword ptr [r14],00
// ---------- DONE INJECTING  ----------
hnk.exe+329E18: 0F 84 A3 04 00 00     - je hnk.exe+32A2C1
hnk.exe+329E1E: 0F B7 D7              - movzx edx,di
hnk.exe+329E21: 49 8B CA              - mov rcx,r10
hnk.exe+329E24: E8 17 43 02 00        - call hnk.exe+34E140
hnk.exe+329E29: 83 F8 03              - cmp eax,03
hnk.exe+329E2C: 0F 87 8F 04 00 00     - ja hnk.exe+32A2C1
hnk.exe+329E32: 41 B9 FF FF FF FF     - mov r9d,FFFFFFFF
hnk.exe+329E38: 41 B8 00 00 00 01     - mov r8d,01000000
hnk.exe+329E3E: 49 8B CA              - mov rcx,r10
hnk.exe+329E41: E8 7A F4 04 00        - call hnk.exe+3792C0
}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>37</ID>
          <Description>"EP regen (50 per sec)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadEPEvrySecOnField,hnk.exe,43 0F B7 84 37 56 2C 7B 00 49 8D 9E 4C 2C 7B 00) // should be unique
alloc(newmem,$1000)

label(code)
label(dothis)
label(return)

newmem:

code:
  mov ax,word ptr [r15+r14+007B2C54]
  add ax,#50 // Amt of EP added per sec
  cmp ax,word ptr [r15+r14+007B2C54+2]
  jle dothis
  mov ax,word ptr [r15+r14+007B2C54+2]
  jmp dothis

dothis:
  mov word ptr [r15+r14+007B2C54],ax
  movzx eax,word ptr [r15+r14+007B2C56]
  lea rbx,[r14+007B2C4C]
  jmp return

ReadEPEvrySecOnField:
  jmp far newmem
  nop 2
return:
registersymbol(ReadEPEvrySecOnField)

[DISABLE]

ReadEPEvrySecOnField:
  db 43 0F B7 84 37 56 2C 7B 00 49 8D 9E 4C 2C 7B 00

unregistersymbol(ReadEPEvrySecOnField)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+32A670

hnk.exe+32A644: 75 11                       - jne hnk.exe+32A657
hnk.exe+32A646: C5 FA 2C 51 04              - vcvttss2si edx,[rcx+04]
hnk.exe+32A64B: 45 33 C0                    - xor r8d,r8d
hnk.exe+32A64E: C6 45 70 01                 - mov byte ptr [rbp+70],01
hnk.exe+32A652: E8 A9 5E 0D 00              - call hnk.exe+400500
hnk.exe+32A657: 48 8B 15 72 DB B5 00        - mov rdx,[hnk.exe+E881D0]
hnk.exe+32A65E: BF 42 0E 00 00              - mov edi,00000E42
hnk.exe+32A663: 66 FF C6                    - inc si
hnk.exe+32A666: 66 83 FE 02                 - cmp si,02
hnk.exe+32A66A: 0F 82 20 FD FF FF           - jb hnk.exe+32A390
// ---------- INJECTING HERE ----------
hnk.exe+32A670: 43 0F B7 84 37 56 2C 7B 00  - movzx eax,word ptr [r15+r14+007B2C56]
// ---------- DONE INJECTING  ----------
hnk.exe+32A679: 49 8D 9E 4C 2C 7B 00        - lea rbx,[r14+007B2C4C]
hnk.exe+32A680: 66 43 39 84 37 54 2C 7B 00  - cmp [r15+r14+007B2C54],ax
hnk.exe+32A689: 0F 84 BC 02 00 00           - je hnk.exe+32A94B
hnk.exe+32A68F: 45 33 D2                    - xor r10d,r10d
hnk.exe+32A692: 41 8B F2                    - mov esi,r10d
hnk.exe+32A695: 49 03 DF                    - add rbx,r15
hnk.exe+32A698: 0F 1F 84 00 00 00 00 00     - nop dword ptr [rax+rax+00000000]
hnk.exe+32A6A0: B8 FF 00 00 00              - mov eax,000000FF
hnk.exe+32A6A5: 66 3B F0                    - cmp si,ax
hnk.exe+32A6A8: 0F 85 49 01 00 00           - jne hnk.exe+32A7F7
}
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>41</ID>
      <Description>"200 CP upon starting/finishing battle"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadCPAtBattleEnd,hnk.exe,0F B7 56 0C C5 FA 11 74 24 20 E8 2E D1 FF FF) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov word ptr [rsi+0C],#200//New Code
  movzx edx,word ptr [rsi+0C]
  vmovss [rsp+20],xmm6
  call hnk.exe+1BA530
  jmp return

ReadCPAtBattleEnd:
  jmp far newmem
  nop
return:
registersymbol(ReadCPAtBattleEnd)

[DISABLE]

ReadCPAtBattleEnd:
  db 0F B7 56 0C C5 FA 11 74 24 20 E8 2E D1 FF FF

unregistersymbol(ReadCPAtBattleEnd)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+1BD3F3

hnk.exe+1BD3C9: 74 14                 - je hnk.exe+1BD3DF
hnk.exe+1BD3CB: 48 8B 8B A0 03 00 00  - mov rcx,[rbx+000003A0]
hnk.exe+1BD3D2: C5 F0 57 C9           - vxorps xmm1,xmm1,xmm1
hnk.exe+1BD3D6: 48 8B 01              - mov rax,[rcx]
hnk.exe+1BD3D9: FF 90 E0 01 00 00     - call qword ptr [rax+000001E0]
hnk.exe+1BD3DF: 48 8B 8B A8 03 00 00  - mov rcx,[rbx+000003A8]
hnk.exe+1BD3E6: 48 85 C9              - test rcx,rcx
hnk.exe+1BD3E9: 74 2F                 - je hnk.exe+1BD41A
hnk.exe+1BD3EB: 44 0F B7 46 0E        - movzx r8d,word ptr [rsi+0E]
hnk.exe+1BD3F0: 41 B1 01              - mov r9l,01
// ---------- INJECTING HERE ----------
hnk.exe+1BD3F3: 0F B7 56 0C           - movzx edx,word ptr [rsi+0C]
// ---------- DONE INJECTING  ----------
hnk.exe+1BD3F7: C5 FA 11 74 24 20     - vmovss [rsp+20],xmm6
hnk.exe+1BD3FD: E8 2E D1 FF FF        - call hnk.exe+1BA530
hnk.exe+1BD402: 84 C0                 - test al,al
hnk.exe+1BD404: 74 14                 - je hnk.exe+1BD41A
hnk.exe+1BD406: 48 8B 8B A8 03 00 00  - mov rcx,[rbx+000003A8]
hnk.exe+1BD40D: C5 F0 57 C9           - vxorps xmm1,xmm1,xmm1
hnk.exe+1BD411: 48 8B 01              - mov rax,[rcx]
hnk.exe+1BD414: FF 90 E0 01 00 00     - call qword ptr [rax+000001E0]
hnk.exe+1BD41A: 48 8B 8B B8 03 00 00  - mov rcx,[rbx+000003B8]
hnk.exe+1BD421: 48 85 C9              - test rcx,rcx
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>0</ID>
      <Description>"5 BP on checking orders during battle"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-07
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadBPOnOrderCheckInBattle,hnk.exe,0F B6 80 0A B0 7B 00 C3 CC CC CC CC CC CC) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov byte ptr [rax+007BB00A],#5
  movzx eax,byte ptr [rax+007BB00A]
  ret 
  int 3 
  int 3 
  int 3 
  int 3 
  int 3 
  int 3 
  jmp return

ReadBPOnOrderCheckInBattle:
  jmp far newmem
return:
registersymbol(ReadBPOnOrderCheckInBattle)

[DISABLE]

ReadBPOnOrderCheckInBattle:
  db 0F B6 80 0A B0 7B 00 C3 CC CC CC CC CC CC

unregistersymbol(ReadBPOnOrderCheckInBattle)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+6488D1

hnk.exe+6488AA: 48 8B 05 1F F9 83 00  - mov rax,[hnk.exe+E881D0]
hnk.exe+6488B1: 8B 88 7C 40 00 00     - mov ecx,[rax+0000407C]
hnk.exe+6488B7: 83 F9 04              - cmp ecx,04
hnk.exe+6488BA: 75 08                 - jne hnk.exe+6488C4
hnk.exe+6488BC: 0F B6 80 0B B0 7B 00  - movzx eax,byte ptr [rax+007BB00B]
hnk.exe+6488C3: C3                    - ret 
hnk.exe+6488C4: 83 F9 01              - cmp ecx,01
hnk.exe+6488C7: 75 08                 - jne hnk.exe+6488D1
hnk.exe+6488C9: 0F B6 80 09 B0 7B 00  - movzx eax,byte ptr [rax+007BB009]
hnk.exe+6488D0: C3                    - ret 
// ---------- INJECTING HERE ----------
hnk.exe+6488D1: 0F B6 80 0A B0 7B 00  - movzx eax,byte ptr [rax+007BB00A]
// ---------- DONE INJECTING  ----------
hnk.exe+6488D8: C3                    - ret 
hnk.exe+6488D9: CC                    - int 3 
hnk.exe+6488DA: CC                    - int 3 
hnk.exe+6488DB: CC                    - int 3 
hnk.exe+6488DC: CC                    - int 3 
hnk.exe+6488DD: CC                    - int 3 
hnk.exe+6488DE: CC                    - int 3 
hnk.exe+6488DF: CC                    - int 3 
hnk.exe+6488E0: 48 8B C4              - mov rax,rsp
hnk.exe+6488E3: 48 89 58 10           - mov [rax+10],rbx
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>7</ID>
      <Description>"79 of item upon tossing (discarding) it in menu"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadItmAmtOnToss,hnk.exe,41 8B 44 D1 04 2B C6 85 C0 44 0F 4F D0 45 89 54 D1 04) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov [r9+rdx*8+04],#80//New Code
  mov eax,[r9+rdx*8+04]
  sub eax,esi
  test eax,eax
  cmovg r10d,eax
  mov [r9+rdx*8+04],r10d
  jmp return

ReadItmAmtOnToss:
  jmp far newmem
  nop 4
return:
registersymbol(ReadItmAmtOnToss)

[DISABLE]

ReadItmAmtOnToss:
  db 41 8B 44 D1 04 2B C6 85 C0 44 0F 4F D0 45 89 54 D1 04

unregistersymbol(ReadItmAmtOnToss)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+3F763A

hnk.exe+3F7620: 8B C1                    - mov eax,ecx
hnk.exe+3F7622: 48 03 C0                 - add rax,rax
hnk.exe+3F7625: 8B D1                    - mov edx,ecx
hnk.exe+3F7627: 66 45 39 1C C1           - cmp [r9+rax*8],r11w
hnk.exe+3F762C: 74 09                    - je hnk.exe+3F7637
hnk.exe+3F762E: FF C1                    - inc ecx
hnk.exe+3F7630: 41 3B C8                 - cmp ecx,r8d
hnk.exe+3F7633: 72 EB                    - jb hnk.exe+3F7620
hnk.exe+3F7635: EB 15                    - jmp hnk.exe+3F764C
hnk.exe+3F7637: 48 03 D2                 - add rdx,rdx
// ---------- INJECTING HERE ----------
hnk.exe+3F763A: 41 8B 44 D1 04           - mov eax,[r9+rdx*8+04]
// ---------- DONE INJECTING  ----------
hnk.exe+3F763F: 2B C6                    - sub eax,esi
hnk.exe+3F7641: 85 C0                    - test eax,eax
hnk.exe+3F7643: 44 0F 4F D0              - cmovg r10d,eax
hnk.exe+3F7647: 45 89 54 D1 04           - mov [r9+rdx*8+04],r10d
hnk.exe+3F764C: 80 BC 24 50 04 00 00 00  - cmp byte ptr [rsp+00000450],00
hnk.exe+3F7654: 74 34                    - je hnk.exe+3F768A
hnk.exe+3F7656: 48 8B D7                 - mov rdx,rdi
hnk.exe+3F7659: E8 B2 00 00 00           - call hnk.exe+3F7710
hnk.exe+3F765E: EB 2A                    - jmp hnk.exe+3F768A
hnk.exe+3F7660: 41 B8 FF 03 00 00        - mov r8d,000003FF
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>32</ID>
      <Description>"8787 U-Materials upon opening menu"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadUMatAmtOnOpeningMenu,hnk.exe,45 8B 44 D1 04 E9 59 FF FF FF 48 03 D2 41 8B 5C D1 04) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov [r9+rdx*8+04],#8787
  mov r8d,[r9+rdx*8+04]
  jmp hnk.exe+21555D
  add rdx,rdx
  mov ebx,[r9+rdx*8+04]
  jmp return

ReadUMatAmtOnOpeningMenu:
  jmp far newmem
  nop 4
return:
registersymbol(ReadUMatAmtOnOpeningMenu)

[DISABLE]

ReadUMatAmtOnOpeningMenu:
  db 45 8B 44 D1 04 E9 59 FF FF FF 48 03 D2 41 8B 5C D1 04

unregistersymbol(ReadUMatAmtOnOpeningMenu)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+2155FA

hnk.exe+2155E0: 8B C1                    - mov eax,ecx
hnk.exe+2155E2: 48 03 C0                 - add rax,rax
hnk.exe+2155E5: 8B D1                    - mov edx,ecx
hnk.exe+2155E7: 66 45 39 1C C1           - cmp [r9+rax*8],r11w
hnk.exe+2155EC: 74 16                    - je hnk.exe+215604
hnk.exe+2155EE: FF C1                    - inc ecx
hnk.exe+2155F0: 41 3B C8                 - cmp ecx,r8d
hnk.exe+2155F3: 72 EB                    - jb hnk.exe+2155E0
hnk.exe+2155F5: EB 15                    - jmp hnk.exe+21560C
hnk.exe+2155F7: 48 03 D2                 - add rdx,rdx
// ---------- INJECTING HERE ----------
hnk.exe+2155FA: 45 8B 44 D1 04           - mov r8d,[r9+rdx*8+04]
// ---------- DONE INJECTING  ----------
hnk.exe+2155FF: E9 59 FF FF FF           - jmp hnk.exe+21555D
hnk.exe+215604: 48 03 D2                 - add rdx,rdx
hnk.exe+215607: 41 8B 5C D1 04           - mov ebx,[r9+rdx*8+04]
hnk.exe+21560C: 44 8B C3                 - mov r8d,ebx
hnk.exe+21560F: 48 8D 15 EA 8C A2 00     - lea rdx,[hnk.exe+C3E300]
hnk.exe+215616: 49 8B CA                 - mov rcx,r10
hnk.exe+215619: E8 82 D4 46 00           - call hnk.exe+682AA0
hnk.exe+21561E: 48 8B 05 AB 2B C7 00     - mov rax,[hnk.exe+E881D0]
hnk.exe+215625: C5 7B 2C 90 60 59 00 00  - vcvttsd2si r10d,[rax+00005960]
hnk.exe+21562D: B8 89 88 88 88           - mov eax,88888889
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>12</ID>
      <Description>"All equipped Master Quartz to verge of level up upon starting battle"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadMasterQrtzXPWhenStartingBattle,hnk.exe,8B 69 04 4C 89 A4 24 88 04 00 00 41 89 69 1C) // should be unique
alloc(newmem,$1000)

label(code)
label(dothis)
label(return)

newmem:

code:
  mov ebp,[rcx+04]
  // check if you're already on the verge of lvl up
  cmp [rcx+04],#611911
  je dothis
  cmp [rcx+04],#494801
  je dothis
  cmp [rcx+04],#397879
  je dothis
  cmp [rcx+04],#322027
  je dothis
  cmp [rcx+04],#257229
  je dothis
  cmp [rcx+04],#202369
  je dothis
  cmp [rcx+04],#156387
  je dothis
  cmp [rcx+04],#127340
  je dothis
  cmp [rcx+04],#107407
  je dothis
  cmp [rcx+04],#97019
  je dothis
  // check which threshold you're in between
  cmp [rcx+04],#611911
  jge dothis
  mov ebp,#611911
  cmp [rcx+04],#494801
  jge dothis
  mov ebp,#494801
  cmp [rcx+04],#397879
  jge dothis
  mov ebp,#397879
  cmp [rcx+04],#322027
  jge dothis
  mov ebp,#322027
  cmp [rcx+04],#257229
  jge dothis
  mov ebp,#257229
  cmp [rcx+04],#202369
  jge dothis
  mov ebp,#202369
  cmp [rcx+04],#156387
  jge dothis
  mov ebp,#156387
  cmp [rcx+04],#127340
  jge dothis
  mov ebp,#127340
  cmp [rcx+04],#107407
  jge dothis
  mov ebp,#107407
  cmp [rcx+04],#97019
  jge dothis
  mov ebp,#97019

dothis:
  mov [rcx+04],ebp
  mov ebp,[rcx+04]
  mov [rsp+00000488],r12
  mov [r9+1C],ebp
  jmp return

ReadMasterQrtzXPWhenStartingBattle:
  jmp far newmem
  nop
return:
registersymbol(ReadMasterQrtzXPWhenStartingBattle)

[DISABLE]

ReadMasterQrtzXPWhenStartingBattle:
  db 8B 69 04 4C 89 A4 24 88 04 00 00 41 89 69 1C

unregistersymbol(ReadMasterQrtzXPWhenStartingBattle)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+16D74D

hnk.exe+16D72B: 48 03 C8                 - add rcx,rax
hnk.exe+16D72E: EB 18                    - jmp hnk.exe+16D748
hnk.exe+16D730: 66 41 83 FF 4F           - cmp r15w,4F
hnk.exe+16D735: 77 19                    - ja hnk.exe+16D750
hnk.exe+16D737: 41 8B CE                 - mov ecx,r14d
hnk.exe+16D73A: 48 81 C1 1B AC 07 00     - add rcx,0007AC1B
hnk.exe+16D741: 48 C1 E1 04              - shl rcx,04
hnk.exe+16D745: 48 03 CB                 - add rcx,rbx
hnk.exe+16D748: 48 85 C9                 - test rcx,rcx
hnk.exe+16D74B: 74 03                    - je hnk.exe+16D750
// ---------- INJECTING HERE ----------
hnk.exe+16D74D: 8B 69 04                 - mov ebp,[rcx+04]
// ---------- DONE INJECTING  ----------
hnk.exe+16D750: 4C 89 A4 24 88 04 00 00  - mov [rsp+00000488],r12
hnk.exe+16D758: 41 89 69 1C              - mov [r9+1C],ebp
hnk.exe+16D75C: 48 85 D2                 - test rdx,rdx
hnk.exe+16D75F: 75 39                    - jne hnk.exe+16D79A
hnk.exe+16D761: B8 0F 27 00 00           - mov eax,0000270F
hnk.exe+16D766: 66 3B F0                 - cmp si,ax
hnk.exe+16D769: 74 2F                    - je hnk.exe+16D79A
hnk.exe+16D76B: 41 B8 FF 03 00 00        - mov r8d,000003FF
hnk.exe+16D771: 48 8D 15 E0 2A AC 00     - lea rdx,[hnk.exe+C30258]
hnk.exe+16D778: 48 8D 4C 24 30           - lea rcx,[rsp+30]
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>11</ID>
      <Description>"Master Quartz to verge of level up upon highlighting it in Quartz menu"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadMasterQrtzXPAmtUponHighlight,hnk.exe,8B 48 04 0F B6 00 FE C0 89 8D 98 01 00 00) // should be unique
alloc(newmem,$1000)

label(code)
label(dothis)
label(return)

newmem:

code:
  mov ecx,[rax+04]
  // check if you're already on the verge of lvl up
  cmp [rax+04],#611911
  je dothis
  cmp [rax+04],#494801
  je dothis
  cmp [rax+04],#397879
  je dothis
  cmp [rax+04],#322027
  je dothis
  cmp [rax+04],#257229
  je dothis
  cmp [rax+04],#202369
  je dothis
  cmp [rax+04],#156387
  je dothis
  cmp [rax+04],#127340
  je dothis
  cmp [rax+04],#107407
  je dothis
  cmp [rax+04],#97019
  je dothis
  // check which threshold you're in between
  cmp [rax+04],#611911
  jge dothis
  mov ecx,#611911
  cmp [rax+04],#494801
  jge dothis
  mov ecx,#494801
  cmp [rax+04],#397879
  jge dothis
  mov ecx,#397879
  cmp [rax+04],#322027
  jge dothis
  mov ecx,#322027
  cmp [rax+04],#257229
  jge dothis
  mov ecx,#257229
  cmp [rax+04],#202369
  jge dothis
  mov ecx,#202369
  cmp [rax+04],#156387
  jge dothis
  mov ecx,#156387
  cmp [rax+04],#127340
  jge dothis
  mov ecx,#127340
  cmp [rax+04],#107407
  jge dothis
  mov ecx,#107407
  cmp [rax+04],#97019
  jge dothis
  mov ecx,#97019

dothis:
  mov [rax+04],ecx
  mov ecx,[rax+04]
  movzx eax,byte ptr [rax]
  inc al
  mov [rbp+00000198],ecx
  jmp return

ReadMasterQrtzXPAmtUponHighlight:
  jmp far newmem
return:
registersymbol(ReadMasterQrtzXPAmtUponHighlight)

[DISABLE]

ReadMasterQrtzXPAmtUponHighlight:
  db 8B 48 04 0F B6 00 FE C0 89 8D 98 01 00 00

unregistersymbol(ReadMasterQrtzXPAmtUponHighlight)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+6A80D4

hnk.exe+6A80B2: 0F B7 C6              - movzx eax,si
hnk.exe+6A80B5: 66 2B C1              - sub ax,cx
hnk.exe+6A80B8: 66 83 F8 4F           - cmp ax,4F
hnk.exe+6A80BC: 77 42                 - ja hnk.exe+6A8100
hnk.exe+6A80BE: 48 8D 86 1B AC 07 00  - lea rax,[rsi+0007AC1B]
hnk.exe+6A80C5: 48 C1 E0 04           - shl rax,04
hnk.exe+6A80C9: 49 03 C7              - add rax,r15
hnk.exe+6A80CC: 4C 8B F6              - mov r14,rsi
hnk.exe+6A80CF: 48 85 C0              - test rax,rax
hnk.exe+6A80D2: 74 2F                 - je hnk.exe+6A8103
// ---------- INJECTING HERE ----------
hnk.exe+6A80D4: 8B 48 04              - mov ecx,[rax+04]
// ---------- DONE INJECTING  ----------
hnk.exe+6A80D7: 0F B6 00              - movzx eax,byte ptr [rax]
hnk.exe+6A80DA: FE C0                 - inc al
hnk.exe+6A80DC: 89 8D 98 01 00 00     - mov [rbp+00000198],ecx
hnk.exe+6A80E2: 0F B6 D0              - movzx edx,al
hnk.exe+6A80E5: 49 8B CF              - mov rcx,r15
hnk.exe+6A80E8: E8 13 A3 CA FF        - call hnk.exe+352400
hnk.exe+6A80ED: 44 8B E0              - mov r12d,eax
hnk.exe+6A80F0: 8B 85 98 01 00 00     - mov eax,[rbp+00000198]
hnk.exe+6A80F6: 44 3B E0              - cmp r12d,eax
hnk.exe+6A80F9: 72 08                 - jb hnk.exe+6A8103
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>2</ID>
      <Description>"14 of item upon usage in battle"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-07
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadItmAmtOnUsageInBattle,hnk.exe,41 8B 44 D1 04 2B C6 85 C0 44 0F 4F D0 45 89 54 D1 04) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov word ptr [r9+rdx*8+04],#15 // new code
  mov eax,[r9+rdx*8+04]
  sub eax,esi
  test eax,eax
  cmovg r10d,eax
  mov [r9+rdx*8+04],r10d
  jmp return

ReadItmAmtOnUsageInBattle:
  jmp far newmem
  nop 4
return:
registersymbol(ReadItmAmtOnUsageInBattle)

[DISABLE]

ReadItmAmtOnUsageInBattle:
  db 41 8B 44 D1 04 2B C6 85 C0 44 0F 4F D0 45 89 54 D1 04

unregistersymbol(ReadItmAmtOnUsageInBattle)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+3F763A

hnk.exe+3F7620: 8B C1                    - mov eax,ecx
hnk.exe+3F7622: 48 03 C0                 - add rax,rax
hnk.exe+3F7625: 8B D1                    - mov edx,ecx
hnk.exe+3F7627: 66 45 39 1C C1           - cmp [r9+rax*8],r11w
hnk.exe+3F762C: 74 09                    - je hnk.exe+3F7637
hnk.exe+3F762E: FF C1                    - inc ecx
hnk.exe+3F7630: 41 3B C8                 - cmp ecx,r8d
hnk.exe+3F7633: 72 EB                    - jb hnk.exe+3F7620
hnk.exe+3F7635: EB 15                    - jmp hnk.exe+3F764C
hnk.exe+3F7637: 48 03 D2                 - add rdx,rdx
// ---------- INJECTING HERE ----------
hnk.exe+3F763A: 41 8B 44 D1 04           - mov eax,[r9+rdx*8+04]
// ---------- DONE INJECTING  ----------
hnk.exe+3F763F: 2B C6                    - sub eax,esi
hnk.exe+3F7641: 85 C0                    - test eax,eax
hnk.exe+3F7643: 44 0F 4F D0              - cmovg r10d,eax
hnk.exe+3F7647: 45 89 54 D1 04           - mov [r9+rdx*8+04],r10d
hnk.exe+3F764C: 80 BC 24 50 04 00 00 00  - cmp byte ptr [rsp+00000450],00
hnk.exe+3F7654: 74 34                    - je hnk.exe+3F768A
hnk.exe+3F7656: 48 8B D7                 - mov rdx,rdi
hnk.exe+3F7659: E8 B2 00 00 00           - call hnk.exe+3F7710
hnk.exe+3F765E: EB 2A                    - jmp hnk.exe+3F768A
hnk.exe+3F7660: 41 B8 FF 03 00 00        - mov r8d,000003FF
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>3</ID>
      <Description>"200 CP on any hit in battle (applies to friend AND foe)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-07
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(WriteToCPUponUsage,hnk.exe,66 89 93 30 04 00 00 48 8B 5C 24 30 48 83 C4 20) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov dx,#200
  mov [rbx+00000430],dx
  mov rbx,[rsp+30]
  add rsp,20
  jmp return

WriteToCPUponUsage:
  jmp far newmem
  nop 2
return:
registersymbol(WriteToCPUponUsage)

[DISABLE]

WriteToCPUponUsage:
  db 66 89 93 30 04 00 00 48 8B 5C 24 30 48 83 C4 20

unregistersymbol(WriteToCPUponUsage)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+F1031

hnk.exe+F100F: 48 8B D8              - mov rbx,rax
hnk.exe+F1012: 75 DC                 - jne hnk.exe+F0FF0
hnk.exe+F1014: 0F B7 83 30 04 00 00  - movzx eax,word ptr [rbx+00000430]
hnk.exe+F101B: 33 C9                 - xor ecx,ecx
hnk.exe+F101D: 0F B7 93 32 04 00 00  - movzx edx,word ptr [rbx+00000432]
hnk.exe+F1024: 2B C7                 - sub eax,edi
hnk.exe+F1026: 85 C0                 - test eax,eax
hnk.exe+F1028: 0F 4F C8              - cmovg ecx,eax
hnk.exe+F102B: 3B CA                 - cmp ecx,edx
hnk.exe+F102D: 66 0F 4C D1           - cmovl dx,cx
// ---------- INJECTING HERE ----------
hnk.exe+F1031: 66 89 93 30 04 00 00  - mov [rbx+00000430],dx
// ---------- DONE INJECTING  ----------
hnk.exe+F1038: 48 8B 5C 24 30        - mov rbx,[rsp+30]
hnk.exe+F103D: 48 83 C4 20           - add rsp,20
hnk.exe+F1041: 5F                    - pop rdi
hnk.exe+F1042: C3                    - ret 
hnk.exe+F1043: CC                    - int 3 
hnk.exe+F1044: CC                    - int 3 
hnk.exe+F1045: CC                    - int 3 
hnk.exe+F1046: CC                    - int 3 
hnk.exe+F1047: CC                    - int 3 
hnk.exe+F1048: CC                    - int 3 
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>8</ID>
      <Description>"(CRASHES GAME, DO NOT USE) minimum 5400 Link-LV exp upon viewing in menu"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : hnk.exe
  Version: 
  Date   : 2023-07-08
  Author : chausies

  This script does blah blah blah
}

[ENABLE]

aobscanmodule(ReadLinkLvlXPInMenu,hnk.exe,44 8B 14 88 EB 09 8B 44 CB 04 EB CD 45 8B D4) // should be unique
alloc(newmem,$1000)

label(code)
label(dothis)
label(return)

newmem:

code:
  cmp [rax+rcx*4],#5400
  jg dothis
  mov [rax+rcx*4],#5400
  jmp dothis

dothis:
  mov r10d,[rax+rcx*4]
  jmp hnk.exe+6AAB57
  mov eax,[rbx+rcx*8+04]
  jmp hnk.exe+6AAB21
  mov r10d,r12d
  jmp return

ReadLinkLvlXPInMenu:
  jmp far newmem
  nop
return:
registersymbol(ReadLinkLvlXPInMenu)

[DISABLE]

ReadLinkLvlXPInMenu:
  db 44 8B 14 88 EB 09 8B 44 CB 04 EB CD 45 8B D4

unregistersymbol(ReadLinkLvlXPInMenu)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: hnk.exe+6AAB48

hnk.exe+6AAB21: C5 F0 57 C9           - vxorps xmm1,xmm1,xmm1
hnk.exe+6AAB25: C4 E1 F2 2A C8        - vcvtsi2ss xmm1,rcx,rax
hnk.exe+6AAB2A: 41 83 F9 40           - cmp r9d,40
hnk.exe+6AAB2E: 73 24                 - jae hnk.exe+6AAB54
hnk.exe+6AAB30: 41 83 F8 40           - cmp r8d,40
hnk.exe+6AAB34: 73 1E                 - jae hnk.exe+6AAB54
hnk.exe+6AAB36: 48 8B 87 28 CF 79 00  - mov rax,[rdi+0079CF28]
hnk.exe+6AAB3D: 49 8D 49 10           - lea rcx,[r9+10]
hnk.exe+6AAB41: 48 C1 E1 06           - shl rcx,06
hnk.exe+6AAB45: 49 03 C8              - add rcx,r8
// ---------- INJECTING HERE ----------
hnk.exe+6AAB48: 44 8B 14 88           - mov r10d,[rax+rcx*4]
// ---------- DONE INJECTING  ----------
hnk.exe+6AAB4C: EB 09                 - jmp hnk.exe+6AAB57
hnk.exe+6AAB4E: 8B 44 CB 04           - mov eax,[rbx+rcx*8+04]
hnk.exe+6AAB52: EB CD                 - jmp hnk.exe+6AAB21
hnk.exe+6AAB54: 45 8B D4              - mov r10d,r12d
hnk.exe+6AAB57: 41 8B C2              - mov eax,r10d
hnk.exe+6AAB5A: 41 FE C3              - inc r11l
hnk.exe+6AAB5D: 45 3A DD              - cmp r11l,r13l
hnk.exe+6AAB60: 45 0F B6 D3           - movzx r10d,r11l
hnk.exe+6AAB64: C5 F8 57 C0           - vxorps xmm0,xmm0,xmm0
hnk.exe+6AAB68: 45 0F 47 D5           - cmova r10d,r13d
}
</AssemblerScript>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
</CheatTable>
