<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="40">
  <CheatEntries>
    <CheatEntry>
      <ID>3</ID>
      <Description>"Happy Numbers"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]


{$lua}

if (LaunchMonoDataCollector()==0) then
  error('Failed to Activate Mono Features')
end

[DISABLE]

</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>1</ID>
          <Description>"99 Hearts (Buy Something In Gallery)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>

[ENABLE]

//aobscan(INJECT_Hearts,89 48 34 BA E0 38 0D 11 8B C0 E8 DC) // should be unique
define(INJECT_Hearts,Game.UI.UIGallery:Buy+45)
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov [eax+34],#99
  mov edx,110D38E0
  jmp return

INJECT_Hearts:
  jmp newmem
  nop 3
return:
registersymbol(INJECT_Hearts)

[DISABLE]

INJECT_Hearts:
  db 89 48 34 BA E0 38 0D 11

unregistersymbol(INJECT_Hearts)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: Game.UI.UIGallery:Buy+45

Game.UI.UIGallery:Buy+26: 90              - nop 
Game.UI.UIGallery:Buy+27: E8 34 10 61 FD  - call System.Collections.Generic.List`1[System.Int32]:Add
Game.UI.UIGallery:Buy+2c: BA E0 38 0D 11  - mov edx,110D38E0
Game.UI.UIGallery:Buy+31: 8B C0           - mov eax,eax
Game.UI.UIGallery:Buy+33: E8 F8 00 5E FD  - call UnityEngine.SingletonBehaviour`1[T_REF]:get_Instance
Game.UI.UIGallery:Buy+38: 8B C8           - mov ecx,eax
Game.UI.UIGallery:Buy+3a: 39 09           - cmp [ecx],ecx
Game.UI.UIGallery:Buy+3c: 8B 40 30        - mov eax,[eax+30]
Game.UI.UIGallery:Buy+3f: 8B 48 34        - mov ecx,[eax+34]
Game.UI.UIGallery:Buy+42: 2B 4D 10        - sub ecx,[ebp+10]
// ---------- INJECTING HERE ----------
Game.UI.UIGallery:Buy+45: 89 48 34        - mov [eax+34],ecx
// ---------- DONE INJECTING  ----------
Game.UI.UIGallery:Buy+48: BA E0 38 0D 11  - mov edx,110D38E0
Game.UI.UIGallery:Buy+4d: 8B C0           - mov eax,eax
Game.UI.UIGallery:Buy+4f: E8 DC 00 5E FD  - call UnityEngine.SingletonBehaviour`1[T_REF]:get_Instance
Game.UI.UIGallery:Buy+54: 89 04 24        - mov [esp],eax
Game.UI.UIGallery:Buy+57: 39 00           - cmp [eax],eax
Game.UI.UIGallery:Buy+59: 8B C0           - mov eax,eax
Game.UI.UIGallery:Buy+5b: E8 70 63 FD FF  - call GameManager:SaveUserData
Game.UI.UIGallery:Buy+60: 8B 45 08        - mov eax,[ebp+08]
Game.UI.UIGallery:Buy+63: 89 04 24        - mov [esp],eax
Game.UI.UIGallery:Buy+66: 90              - nop 
}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>2</ID>
          <Description>"Inst Win"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>

[ENABLE]

//aobscan(INJECT_InstWin,0F 8E 43 00 00 00 C7) // should be unique
define(INJECT_InstWin,Game.UI.UIBattle:CheckWin+94)
registersymbol(INJECT_InstWin)

INJECT_InstWin:
  db 73 47 00 00 00 00

[DISABLE]

INJECT_InstWin:
  db 0F 8E 43 00 00 00

unregistersymbol(INJECT_InstWin)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: Game.UI.UIBattle:CheckWin+94

Game.UI.UIBattle:CheckWin+75: 39 00                 - cmp [eax],eax
Game.UI.UIBattle:CheckWin+77: E8 5C 97 85 ED        - call System.Collections.Generic.List`1[T_REF]:GetEnumerator
Game.UI.UIBattle:CheckWin+7c: 83 EC 04              - sub esp,04
Game.UI.UIBattle:CheckWin+7f: E9 59 00 00 00        - jmp Game.UI.UIBattle:CheckWin+dd
Game.UI.UIBattle:CheckWin+84: 8D 64 24 00           - lea esp,[esp+00]
Game.UI.UIBattle:CheckWin+88: 8B 45 E4              - mov eax,[ebp-1C]
Game.UI.UIBattle:CheckWin+8b: 8B C8                 - mov ecx,eax
Game.UI.UIBattle:CheckWin+8d: 39 09                 - cmp [ecx],ecx
Game.UI.UIBattle:CheckWin+8f: 8B 40 18              - mov eax,[eax+18]
Game.UI.UIBattle:CheckWin+92: 85 C0                 - test eax,eax
// ---------- INJECTING HERE ----------
Game.UI.UIBattle:CheckWin+94: 0F 8E 43 00 00 00     - jng Game.UI.UIBattle:CheckWin+dd
// ---------- DONE INJECTING  ----------
Game.UI.UIBattle:CheckWin+9a: C7 45 C4 00 00 00 00  - mov [ebp-3C],00000000
Game.UI.UIBattle:CheckWin+a1: 83 EC 0C              - sub esp,0C
Game.UI.UIBattle:CheckWin+a4: E8 6D 00 00 00        - call Game.UI.UIBattle:CheckWin+116
Game.UI.UIBattle:CheckWin+a9: 83 C4 0C              - add esp,0C
Game.UI.UIBattle:CheckWin+ac: 83 7D C4 00           - cmp dword ptr [ebp-3C],00
Game.UI.UIBattle:CheckWin+b0: 74 06                 - je Game.UI.UIBattle:CheckWin+b8
Game.UI.UIBattle:CheckWin+b2: 90                    - nop 
Game.UI.UIBattle:CheckWin+b3: E8 A8 0E 85 ED        - call 06933978
Game.UI.UIBattle:CheckWin+b8: C7 45 BC 00 00 00 00  - mov [ebp-44],00000000
Game.UI.UIBattle:CheckWin+bf: 83 EC 0C              - sub esp,0C
}
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <CheatCodes>
    <CodeEntry>
      <Description>Change of jng Game.UI.UIBattle:CheckWin+dd</Description>
      <AddressString>18FBB21C</AddressString>
      <Before>
        <Byte>8B</Byte>
        <Byte>40</Byte>
        <Byte>18</Byte>
        <Byte>85</Byte>
        <Byte>C0</Byte>
      </Before>
      <Actual>
        <Byte>0F</Byte>
        <Byte>8E</Byte>
        <Byte>43</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </Actual>
      <After>
        <Byte>C7</Byte>
        <Byte>45</Byte>
        <Byte>C4</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of cmp [ecx],ecx</Description>
      <AddressString>199BAC45</AddressString>
      <Before>
        <Byte>8B</Byte>
        <Byte>45</Byte>
        <Byte>E4</Byte>
        <Byte>8B</Byte>
        <Byte>C8</Byte>
      </Before>
      <Actual>
        <Byte>39</Byte>
        <Byte>09</Byte>
      </Actual>
      <After>
        <Byte>8B</Byte>
        <Byte>40</Byte>
        <Byte>18</Byte>
        <Byte>85</Byte>
        <Byte>C0</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of call System.Collections.Generic.List`1+Enumerator[T_REF]:MoveNext</Description>
      <AddressString>190E2B03</AddressString>
      <Before>
        <Byte>04</Byte>
        <Byte>24</Byte>
        <Byte>8D</Byte>
        <Byte>6D</Byte>
        <Byte>00</Byte>
      </Before>
      <Actual>
        <Byte>E8</Byte>
        <Byte>C0</Byte>
        <Byte>97</Byte>
        <Byte>85</Byte>
        <Byte>ED</Byte>
      </Actual>
      <After>
        <Byte>85</Byte>
        <Byte>C0</Byte>
        <Byte>75</Byte>
        <Byte>94</Byte>
        <Byte>C7</Byte>
      </After>
    </CodeEntry>
  </CheatCodes>
  <UserdefinedSymbols/>
</CheatTable>
