<?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>"Charge meter pointer (max = 200)"</Description>
      <ShowAsSigned>0</ShowAsSigned>
      <VariableType>2 Bytes</VariableType>
      <Address>hnk.exe+163E626</Address>
    </CheatEntry>
    <CheatEntry>
      <ID>6</ID>
      <Description>"Max charge 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>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>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 upon change (friend or 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>
