<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>2</ID>
      <Description>"Resolve no decrease when use/hit"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : GhostOfTsushima.exe
  Version: 
  Date   : 2024-05-17
  Author : bbfox@https://opencheattables.com
}

[ENABLE]

aobscanmodule(INJECT_SET_EN,$process,F3 0F 58 CE 0F 28 C2) // should be unique
alloc(newmem,$1000,INJECT_SET_EN)

label(code)
label(return)
label(i_base_data_addr)

newmem:
  mov [i_base_data_addr], rbx
  vmovss xmm15, [vf_0]
  vucomiss xmm6, xmm15
  jae code
  vmovss xmm15, [vf_01]
  vmulss xmm6, xmm6, xmm15

code:
  addss xmm1,xmm6
  movaps xmm0,xmm2
  jmp return
align 10 cc
  i_base_data_addr:
  dq 0
  vf_0:
  dd 0
  vf_01:
  dd (float)-1
  dd 0 0 0


INJECT_SET_EN:
  jmp newmem
  nop 2
return:
registersymbol(INJECT_SET_EN)
registersymbol(i_base_data_addr)

[DISABLE]

INJECT_SET_EN:
  db F3 0F 58 CE 0F 28 C2

unregistersymbol(*)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: GhostOfTsushima.exe+90EDE4

GhostOfTsushima.exe+90EDAC: 48 8D 0D 3D 3A 4D 01     - lea rcx,[GhostOfTsushima.exe+1DE27F0]
GhostOfTsushima.exe+90EDB3: E8 48 BA C3 FF           - call GhostOfTsushima.exe+54A800
GhostOfTsushima.exe+90EDB8: 48 8D 4C 24 40           - lea rcx,[rsp+40]
GhostOfTsushima.exe+90EDBD: F3 0F 59 70 08           - mulss xmm6,[rax+08]
GhostOfTsushima.exe+90EDC2: E8 79 D3 BC FF           - call GhostOfTsushima.exe+4DC140
GhostOfTsushima.exe+90EDC7: 48 8D 4C 24 30           - lea rcx,[rsp+30]
GhostOfTsushima.exe+90EDCC: E8 6F D3 BC FF           - call GhostOfTsushima.exe+4DC140
GhostOfTsushima.exe+90EDD1: F3 0F 10 93 A4 43 00 00  - movss xmm2,[rbx+000043A4]
GhostOfTsushima.exe+90EDD9: 48 8B BC 24 90 00 00 00  - mov rdi,[rsp+00000090]
GhostOfTsushima.exe+90EDE1: 0F 28 CA                 - movaps xmm1,xmm2
// ---------- INJECTING HERE ----------
GhostOfTsushima.exe+90EDE4: F3 0F 58 CE              - addss xmm1,xmm6
// ---------- DONE INJECTING  ----------
GhostOfTsushima.exe+90EDE8: 0F 28 C2                 - movaps xmm0,xmm2
GhostOfTsushima.exe+90EDEB: F3 41 0F 5F C0           - maxss xmm0,xmm8
GhostOfTsushima.exe+90EDF0: 44 0F 28 44 24 50        - movaps xmm8,[rsp+50]
GhostOfTsushima.exe+90EDF6: 0F 2F CF                 - comiss xmm1,xmm7
GhostOfTsushima.exe+90EDF9: 73 05                    - jae GhostOfTsushima.exe+90EE00
GhostOfTsushima.exe+90EDFB: 0F 57 C9                 - xorps xmm1,xmm1
GhostOfTsushima.exe+90EDFE: EB 08                    - jmp GhostOfTsushima.exe+90EE08
GhostOfTsushima.exe+90EE00: 0F 2F C8                 - comiss xmm1,xmm0
GhostOfTsushima.exe+90EE03: 76 03                    - jna GhostOfTsushima.exe+90EE08
GhostOfTsushima.exe+90EE05: 0F 28 C8                 - movaps xmm1,xmm0
}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>14</ID>
          <Description>"Usage: enter battle"</Description>
          <Color>8000FF</Color>
          <GroupHeader>1</GroupHeader>
        </CheatEntry>
        <CheatEntry>
          <ID>4</ID>
          <Description>"Resolve"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <Color>FF8080</Color>
          <VariableType>Float</VariableType>
          <Address>i_base_data_addr</Address>
          <Offsets>
            <Offset>43A4</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>5</ID>
          <Description>"??"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <Color>FF8080</Color>
          <VariableType>Float</VariableType>
          <Address>i_base_data_addr</Address>
          <Offsets>
            <Offset>43A8</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>7</ID>
          <Description>"Max HP"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <Color>FF8080</Color>
          <VariableType>Float</VariableType>
          <Address>i_base_data_addr</Address>
          <Offsets>
            <Offset>1970</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>8</ID>
          <Description>"Cur. HP"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <Color>FF8080</Color>
          <VariableType>Float</VariableType>
          <Address>i_base_data_addr</Address>
          <Offsets>
            <Offset>1974</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>9</ID>
          <Description>"??"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <Color>FF8080</Color>
          <VariableType>Float</VariableType>
          <Address>i_base_data_addr</Address>
          <Offsets>
            <Offset>1978</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>13</ID>
      <Description>"Set materials count"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : GhostOfTsushima.exe
  Version: 
  Date   : 2024-05-17
  Author : bbfox@https://opencheattables.com
}

[ENABLE]

aobscanmodule(INJECT_SET_ITEM_CNT,$process,8B 5C A8 08 EB 03) // should be unique
alloc(newmem,$1000,INJECT_SET_ITEM_CNT)

label(code)
label(return)
label(i_item_min_cnt)
label(i_item_set_to)

newmem:
  push r15
  mov r15d, [i_item_min_cnt]
  cmp [rax+rbp*4+08], r15d
  jb endp

  mov r15d, [i_item_set_to]
  cmp [rax+rbp*4+08], r15d
  jae endp
  mov [rax+rbp*4+08], r15d

endp:
  pop r15

code:
  mov ebx,[rax+rbp*4+08]
  //jmp GhostOfTsushima.exe+910003
  reassemble(INJECT_SET_ITEM_CNT+4)
  jmp return
align 10 cc
  i_item_min_cnt:
  dd 2
  i_item_set_to:
  dd #301

INJECT_SET_ITEM_CNT:
  jmp newmem
  nop
return:
registersymbol(INJECT_SET_ITEM_CNT)
registersymbol(i_item_min_cnt)
registersymbol(i_item_set_to)
[DISABLE]

INJECT_SET_ITEM_CNT:
  db 8B 5C A8 08 EB 03

unregistersymbol(*)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: GhostOfTsushima.exe+90FFFA

GhostOfTsushima.exe+90FFD4: 33 DB                 - xor ebx,ebx
GhostOfTsushima.exe+90FFD6: 41 8B F8              - mov edi,r8d
GhostOfTsushima.exe+90FFD9: 48 8B F1              - mov rsi,rcx
GhostOfTsushima.exe+90FFDC: 41 F7 C0 FC FF FF FF  - test r8d,FFFFFFFC
GhostOfTsushima.exe+90FFE3: 75 1B                 - jne GhostOfTsushima.exe+910000
GhostOfTsushima.exe+90FFE5: 41 83 F8 01           - cmp r8d,01
GhostOfTsushima.exe+90FFE9: 74 15                 - je GhostOfTsushima.exe+910000
GhostOfTsushima.exe+90FFEB: 48 8D 0D 86 6D 3C 01  - lea rcx,[GhostOfTsushima.exe+1CD6D78]
GhostOfTsushima.exe+90FFF2: 48 63 EA              - movsxd  rbp,edx
GhostOfTsushima.exe+90FFF5: E8 26 7F C0 FF        - call GhostOfTsushima.exe+517F20
// ---------- INJECTING HERE ----------
GhostOfTsushima.exe+90FFFA: 8B 5C A8 08           - mov ebx,[rax+rbp*4+08]
// ---------- DONE INJECTING  ----------
GhostOfTsushima.exe+90FFFE: EB 03                 - jmp GhostOfTsushima.exe+910003
GhostOfTsushima.exe+910000: 48 63 EA              - movsxd  rbp,edx
GhostOfTsushima.exe+910003: 48 8B CE              - mov rcx,rsi
GhostOfTsushima.exe+910006: E8 F5 BE F5 FF        - call GhostOfTsushima.exe+86BF00
GhostOfTsushima.exe+91000B: 0F 57 C0              - xorps xmm0,xmm0
GhostOfTsushima.exe+91000E: 0F 2E 86 B8 45 00 00  - ucomiss xmm0,[rsi+000045B8]
GhostOfTsushima.exe+910015: 74 2B                 - je GhostOfTsushima.exe+910042
GhostOfTsushima.exe+910017: 8D 47 FF              - lea eax,[rdi-01]
GhostOfTsushima.exe+91001A: A9 FD FF FF FF        - test eax,FFFFFFFD
GhostOfTsushima.exe+91001F: 74 0E                 - je GhostOfTsushima.exe+91002F
}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>17</ID>
          <Description>"Usage: browse material tab"</Description>
          <GroupHeader>1</GroupHeader>
        </CheatEntry>
        <CheatEntry>
          <ID>15</ID>
          <Description>"Material count must &gt;="</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <Color>C08000</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>i_item_min_cnt</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>16</ID>
          <Description>"Set to"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <Color>C08000</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>i_item_set_to</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>18</ID>
      <Description>"Ghost Of Tsushima v1053.0.0515.2048  /  https://opencheattables.com"</Description>
      <Color>00AE57</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
</CheatTable>
