<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="42">
  <CheatEntries>
    <CheatEntry>
      <ID>2</ID>
      <Description>"Darts game - one shot"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : P5R.exe
  Version: 
  Date   : 2022-11-01
  Author : bbfox@https://opencheattables.com
}

[ENABLE]

aobscanmodule(INJECT_XBOX_DART_GAME,P5R.exe,89 8F AC 02 00 00) // should be unique
alloc(newmem,$1000,INJECT_XBOX_DART_GAME)

label(code)
label(return)

newmem:
  xor ecx, ecx

code:
  mov [rdi+000002AC],ecx
  jmp return

INJECT_XBOX_DART_GAME:
  jmp newmem
  nop
return:
registersymbol(INJECT_XBOX_DART_GAME)

[DISABLE]

INJECT_XBOX_DART_GAME:
  db 89 8F AC 02 00 00

unregistersymbol(INJECT_XBOX_DART_GAME)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: P5R.exe+B59DDA

P5R.exe+B59DA9: 74 15                 - je P5R.exe+B59DC0
P5R.exe+B59DAB: BA 02 00 00 00        - mov edx,00000002
P5R.exe+B59DB0: 48 8B CF              - mov rcx,rdi
P5R.exe+B59DB3: E8 98 4C FF FF        - call P5R.exe+B4EA50
P5R.exe+B59DB8: 84 C0                 - test al,al
P5R.exe+B59DBA: 0F 84 21 0A 00 00     - je P5R.exe+B5A7E1
P5R.exe+B59DC0: 8B 8F AC 02 00 00     - mov ecx,[rdi+000002AC]
P5R.exe+B59DC6: 48 63 97 EC 0E 00 00  - movsxd  rdx,dword ptr [rdi+00000EEC]
P5R.exe+B59DCD: 89 8F B0 02 00 00     - mov [rdi+000002B0],ecx
P5R.exe+B59DD3: 2B 8C 97 B8 02 00 00  - sub ecx,[rdi+rdx*4+000002B8]
// ---------- INJECTING HERE ----------
P5R.exe+B59DDA: 89 8F AC 02 00 00     - mov [rdi+000002AC],ecx
// ---------- DONE INJECTING  ----------
P5R.exe+B59DE0: EB 27                 - jmp P5R.exe+B59E09
P5R.exe+B59DE2: BA 03 00 00 00        - mov edx,00000003
P5R.exe+B59DE7: 48 8B CF              - mov rcx,rdi
P5R.exe+B59DEA: E8 61 4C FF FF        - call P5R.exe+B4EA50
P5R.exe+B59DEF: 84 C0                 - test al,al
P5R.exe+B59DF1: 0F 84 EA 09 00 00     - je P5R.exe+B5A7E1
P5R.exe+B59DF7: 8B 87 CC 1C 00 00     - mov eax,[rdi+00001CCC]
P5R.exe+B59DFD: 8B 97 EC 0E 00 00     - mov edx,[rdi+00000EEC]
P5R.exe+B59E03: 89 87 AC 02 00 00     - mov [rdi+000002AC],eax
P5R.exe+B59E09: 48 63 C2              - movsxd  rax,edx
}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>3</ID>
      <Description>"Special battle score multiplier"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : P5R.exe
  Version: 
  Date   : 2022-11-01
  Author : bbfox@https://opencheattables.com
}

[ENABLE]

aobscanmodule(INJECT_XBOX_SBATTLE_MULTI,P5R.exe,01 86 C0 03 00 00) // should be unique
alloc(newmem,$1000,INJECT_XBOX_SBATTLE_MULTI)

label(code)
label(return)
label(vf_xbox_sbattle_multi)

newmem:
  db EB 3B 54
  db 68 69 73 20 74 61
  db 62 6C 65 20 63 6F 6D
  db 65 73 20
  db 66 72 6F 6D 20 68 74 74 70
  db 73 3A 2F 2F 6F 70 65 6E 63 68 65 61 74 74 61 62
  db 6C 65 73 2E 63 6F 6D 20 2F 20 43 45 20 37 2E 34 2B
  vmovss xmm14, [vf_xbox_sbattle_multi]
  cvtsi2ss xmm15, eax
  vmulss xmm15, xmm14, xmm15
  cvtss2si eax, xmm15

code:
  add [rsi+000003C0],eax
  jmp return
align 10 cc
  vf_xbox_sbattle_multi:
  dd (float)5.8701

INJECT_XBOX_SBATTLE_MULTI:
  jmp newmem
  nop
return:
registersymbol(INJECT_XBOX_SBATTLE_MULTI)
registersymbol(vf_xbox_sbattle_multi)

[DISABLE]

INJECT_XBOX_SBATTLE_MULTI:
  db 01 86 C0 03 00 00

unregistersymbol(*)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: P5R.exe+3EB6B5

P5R.exe+3EB68F: 3D 7F 96 98 00                 - cmp eax,vehdebug-x86_64.dll+5967F
P5R.exe+3EB694: 41 0F 4C C8                    - cmovl ecx,r8d
P5R.exe+3EB698: 85 C9                          - test ecx,ecx
P5R.exe+3EB69A: 74 50                          - je P5R.exe+3EB6EC
P5R.exe+3EB69C: 44 89 BE 94 01 00 00           - mov [rsi+00000194],r15d
P5R.exe+3EB6A3: 41 B0 01                       - mov r8l,01
P5R.exe+3EB6A6: 89 96 BC 03 00 00              - mov [rsi+000003BC],edx
P5R.exe+3EB6AC: 48 8B CE                       - mov rcx,rsi
P5R.exe+3EB6AF: 41 8B 01                       - mov eax,[r9]
P5R.exe+3EB6B2: 45 33 C9                       - xor r9d,r9d
// ---------- INJECTING HERE ----------
P5R.exe+3EB6B5: 01 86 C0 03 00 00              - add [rsi+000003C0],eax
// ---------- DONE INJECTING  ----------
P5R.exe+3EB6BB: E8 70 39 00 00                 - call P5R.exe+3EF030
P5R.exe+3EB6C0: 44 38 BE E3 03 00 00           - cmp [rsi+000003E3],r15l
P5R.exe+3EB6C7: 74 23                          - je P5R.exe+3EB6EC
P5R.exe+3EB6C9: B9 36 01 00 00                 - mov ecx,00000136
P5R.exe+3EB6CE: E8 7D 31 26 00                 - call P5R.exe+64E850
P5R.exe+3EB6D3: 8B C8                          - mov ecx,eax
P5R.exe+3EB6D5: E8 26 BE 25 00                 - call P5R.exe+647500
P5R.exe+3EB6DA: 39 86 C0 03 00 00              - cmp [rsi+000003C0],eax
P5R.exe+3EB6E0: 72 0A                          - jb P5R.exe+3EB6EC
P5R.exe+3EB6E2: C7 86 C4 03 00 00 01 00 00 00  - mov [rsi+000003C4],00000001
}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>4</ID>
          <Description>"Multiplier"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>Float</VariableType>
          <Address>vf_xbox_sbattle_multi</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>6</ID>
      <Description>"Get old clothes pt"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{ Game   : P5R.exe
  Version: 
  Date   : 2022-11-01
  Author : bbfox@https://opencheattables.com
}

[ENABLE]

aobscanmodule(INJECT_XBOX_GET_OLD_CLOTHES_PT,P5R.exe,8B 04 99 48 83 C4 20) // should be unique
alloc(newmem,$1000,INJECT_XBOX_GET_OLD_CLOTHES_PT)

label(code)
label(return)
label(i_xbox_base_clothes_pt_addr)

newmem:
  mov [i_xbox_base_clothes_pt_addr], rcx


code:
  mov eax,[rcx+rbx*4]
  add rsp,20
  jmp return
align 10 cc
  i_xbox_base_clothes_pt_addr:
  dq 0

INJECT_XBOX_GET_OLD_CLOTHES_PT:
  jmp newmem
  nop 2
return:
registersymbol(INJECT_XBOX_GET_OLD_CLOTHES_PT)
registersymbol(i_xbox_base_clothes_pt_addr)

[DISABLE]

INJECT_XBOX_GET_OLD_CLOTHES_PT:
  db 8B 04 99 48 83 C4 20

unregistersymbol(*)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: P5R.exe+64E882

P5R.exe+64E85E: 8B CB                    - mov ecx,ebx
P5R.exe+64E860: C7 44 24 38 00 00 00 00  - mov [rsp+38],00000000
P5R.exe+64E868: E8 63 64 01 00           - call P5R.exe+664CD0
P5R.exe+64E86D: 84 C0                    - test al,al
P5R.exe+64E86F: 74 0A                    - je P5R.exe+64E87B
P5R.exe+64E871: 8B 44 24 38              - mov eax,[rsp+38]
P5R.exe+64E875: 48 83 C4 20              - add rsp,20
P5R.exe+64E879: 5B                       - pop rbx
P5R.exe+64E87A: C3                       - ret 
P5R.exe+64E87B: 48 8D 0D BE 6D 86 01     - lea rcx,[P5R.exe+1EB5640]
// ---------- INJECTING HERE ----------
P5R.exe+64E882: 8B 04 99                 - mov eax,[rcx+rbx*4]
// ---------- DONE INJECTING  ----------
P5R.exe+64E885: 48 83 C4 20              - add rsp,20
P5R.exe+64E889: 5B                       - pop rbx
P5R.exe+64E88A: C3                       - ret 
P5R.exe+64E88B: CC                       - int 3 
P5R.exe+64E88C: CC                       - int 3 
P5R.exe+64E88D: CC                       - int 3 
P5R.exe+64E88E: CC                       - int 3 
P5R.exe+64E88F: CC                       - int 3 
P5R.exe+64E890: CC                       - int 3 
P5R.exe+64E891: CC                       - int 3 
}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>8</ID>
          <Description>"Active: browse goods in the shop"</Description>
          <Color>8000FF</Color>
          <GroupHeader>1</GroupHeader>
        </CheatEntry>
        <CheatEntry>
          <ID>7</ID>
          <Description>"Pt"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>i_xbox_base_clothes_pt_addr</Address>
          <Offsets>
            <Offset>54C</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>9</ID>
      <Description>"[Xbox Games] Persona 5 Royal  /  https://opencheattables.com  /  CE 7.4+"</Description>
      <Color>400080</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
</CheatTable>
