<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="34">
  <CheatEntries>
    <CheatEntry>
      <ID>16</ID>
      <Description>"Auto Assemble script"</Description>
      <LastState Activated="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
local gameName = "Katamari Damacy Reroll"
local gameProcess = "katamari.exe"
if getProcessIDFromProcessName(gameProcess) ~= nil then
   if readInteger(process) == nil then
      openProcess(gameProcess)
   else
       if readInteger(process) ~= readInteger(gameProcess) then
          openProcess(gameProcess)
       end
   end
else
    beep() error(showMessage(string.format("%s is not running.",gameName)))
end
if syntaxcheck then return end

[DISABLE]
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>14</ID>
          <Description>"Option 1"</Description>
          <Options moHideChildren="1"/>
          <LastState Value="" RealAddress="00000000"/>
          <GroupHeader>1</GroupHeader>
          <CheatEntries>
            <CheatEntry>
              <ID>13</ID>
              <Description>"time remaining selector"</Description>
              <DropDownList ReadOnly="1" DescriptionOnly="1" DisplayValueAsItem="1">178200:99 minutes
0:end level
</DropDownList>
              <VariableType>4 Bytes</VariableType>
              <Address>"mono.dll"+00265110</Address>
              <Offsets>
                <Offset>488</Offset>
                <Offset>90</Offset>
              </Offsets>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>15</ID>
          <Description>"Option 2"</Description>
          <Options moHideChildren="1"/>
          <LastState Value="" RealAddress="00000000"/>
          <GroupHeader>1</GroupHeader>
          <CheatEntries>
            <CheatEntry>
              <ID>8</ID>
              <Description>"infinite time"</Description>
              <LastState/>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>{ Game   : katamaridamacy
  Version: 
  Date   : 2024-12-23
  Author : nbarr

  This script does blah blah blah
}

[ENABLE]

aobscan(clock,88 88 04 00 00 FF C9 89 88 88 04 00 00) // should be unique
alloc(newmem,$1000,clock)

label(code)
label(return)

newmem:
//mov [rax+00000488],ecx
  jmp return
code:
  mov [rax+00000488],ecx
  jmp return

clock+07:
  jmp newmem
  nop
return:
registersymbol(clock)

[DISABLE]

clock+07:
  db 89 88 88 04 00 00

unregistersymbol(clock)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 14F130F868E

14F130F8659: E9 E7 00 00 00                 - jmp 14F130F8745
14F130F865E: 41 83 FF 01                    - cmp r15d,01
14F130F8662: 0F 85 D8 00 00 00              - jne 14F130F8740
14F130F8668: 48 8B 86 18 01 00 00           - mov rax,[rsi+00000118]
14F130F866F: 48 63 80 88 04 00 00           - movsxd  rax,dword ptr [rax+00000488]
14F130F8676: 85 C0                          - test eax,eax
14F130F8678: 0F 84 C2 00 00 00              - je 14F130F8740
14F130F867E: 48 8B 86 18 01 00 00           - mov rax,[rsi+00000118]
14F130F8685: 48 63 88 88 04 00 00           - movsxd  rcx,dword ptr [rax+00000488]
14F130F868C: FF C9                          - dec ecx
// ---------- INJECTING HERE ----------
14F130F868E: 89 88 88 04 00 00              - mov [rax+00000488],ecx
// ---------- DONE INJECTING  ----------
14F130F8694: 48 8B 86 18 01 00 00           - mov rax,[rsi+00000118]
14F130F869B: 48 63 80 88 04 00 00           - movsxd  rax,dword ptr [rax+00000488]
14F130F86A2: 85 C0                          - test eax,eax
14F130F86A4: 0F 85 96 00 00 00              - jne 14F130F8740
14F130F86AA: 49 BA 20 D3 15 2F 4F 01 00 00  - mov r10,0000014F2F15D320
14F130F86B4: 48 83 EC 20                    - sub rsp,20
14F130F86B8: 49 BB B4 F1 3B 30 4F 01 00 00  - mov r11,0000014F303BF1B4
14F130F86C2: 41 FF D3                       - call r11
14F130F86C5: 48 83 C4 20                    - add rsp,20
14F130F86C9: F3 0F 10 05 8F 00 00 00        - movss xmm0,[14F130F8760]
}
</AssemblerScript>
            </CheatEntry>
            <CheatEntry>
              <ID>9</ID>
              <Description>"end game"</Description>
              <LastState/>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>{ Game   : katamaridamacy
  Version: 
  Date   : 2024-12-23
  Author : nbarr

  This script does blah blah blah
}

[ENABLE]

aobscan(clock,88 88 04 00 00 FF C9 89 88 88 04 00 00) // should be unique
alloc(newmem,$1000,clock)

label(code)
label(return)

newmem:
  mov [rax+00000488],0
  jmp return
code:
  mov [rax+00000488],ecx
  jmp return

clock+07:
  jmp newmem
  nop
return:
registersymbol(clock)

[DISABLE]

clock+07:
  db 89 88 88 04 00 00

unregistersymbol(clock)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 14F130F868E

14F130F8659: E9 E7 00 00 00                 - jmp 14F130F8745
14F130F865E: 41 83 FF 01                    - cmp r15d,01
14F130F8662: 0F 85 D8 00 00 00              - jne 14F130F8740
14F130F8668: 48 8B 86 18 01 00 00           - mov rax,[rsi+00000118]
14F130F866F: 48 63 80 88 04 00 00           - movsxd  rax,dword ptr [rax+00000488]
14F130F8676: 85 C0                          - test eax,eax
14F130F8678: 0F 84 C2 00 00 00              - je 14F130F8740
14F130F867E: 48 8B 86 18 01 00 00           - mov rax,[rsi+00000118]
14F130F8685: 48 63 88 88 04 00 00           - movsxd  rcx,dword ptr [rax+00000488]
14F130F868C: FF C9                          - dec ecx
// ---------- INJECTING HERE ----------
14F130F868E: 89 88 88 04 00 00              - mov [rax+00000488],ecx
// ---------- DONE INJECTING  ----------
14F130F8694: 48 8B 86 18 01 00 00           - mov rax,[rsi+00000118]
14F130F869B: 48 63 80 88 04 00 00           - movsxd  rax,dword ptr [rax+00000488]
14F130F86A2: 85 C0                          - test eax,eax
14F130F86A4: 0F 85 96 00 00 00              - jne 14F130F8740
14F130F86AA: 49 BA 20 D3 15 2F 4F 01 00 00  - mov r10,0000014F2F15D320
14F130F86B4: 48 83 EC 20                    - sub rsp,20
14F130F86B8: 49 BB B4 F1 3B 30 4F 01 00 00  - mov r11,0000014F303BF1B4
14F130F86C2: 41 FF D3                       - call r11
14F130F86C5: 48 83 C4 20                    - add rsp,20
14F130F86C9: F3 0F 10 05 8F 00 00 00        - movss xmm0,[14F130F8760]
}
</AssemblerScript>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <CheatCodes>
    <CodeEntry Color="20000000">
      <Description>clock :mov [rax+00000488],ecx</Description>
      <AddressString>14F130F868E</AddressString>
      <Before>
        <Byte>04</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
        <Byte>FF</Byte>
        <Byte>C9</Byte>
      </Before>
      <Actual>
        <Byte>89</Byte>
        <Byte>88</Byte>
        <Byte>88</Byte>
        <Byte>04</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </Actual>
      <After>
        <Byte>48</Byte>
        <Byte>8B</Byte>
        <Byte>86</Byte>
        <Byte>18</Byte>
        <Byte>01</Byte>
      </After>
    </CodeEntry>
  </CheatCodes>
  <UserdefinedSymbols/>
</CheatTable>
