<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="18">
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"Invincable (Both sides)"</Description>
      <LastState Activated="0"/>
      <Color>80000008</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
alloc(newmem,100)

aobscan(aob1, 2B 45 10 89 43 18 85 C0)

label(returnhere)
label(exit)
label(invincable)

registersymbol(invincable)

newmem:
  db 90 90 90 90 90 90

exit:
  jmp returnhere

aob1:
  invincable:
  jmp newmem
  nop
returnhere:

[DISABLE]
  dealloc(newmem)
  unregistersymbol(invincable)
invincable:
  db 2B 45 10 89 43 18


</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>1</ID>
      <Description>"Get Address Selected Unit (Both sides) (F9)"</Description>
      <LastState Activated="1"/>
      <Color>80000008</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>//define(viewbytes,8B 45 88 39 00)
//define(viewbytes,8B 45 88 39 00 8B 40 18 89 85 ?? ?? ?? ?? 83 EC)

[ENABLE]
alloc(newmem,1000)

aobscan(aobget, 39 00 8B 40 18 89 85 D0 FE FF FF 83 EC)

label(returnhere)
label(exit)
label(pSelected_Unit_Address)
label(originalcode)
label(INJECT_GETSELECTEDADDRESS)

registersymbol(INJECT_GETSELECTEDADDRESS)
registersymbol(pSelected_Unit_Address)

newmem:
//db 90 90 90 90 90

pSelected_Unit_Address:
dd 0

//code starts here
label(codestart)
codestart:
mov dword ptr [pSelected_Unit_Address],eax

originalcode:
cmp [eax],eax
mov eax,[eax+18]
exit:
jmp returnhere

//Code injected into the game
aobget:
INJECT_GETSELECTEDADDRESS:
jmp codestart
returnhere:

[DISABLE]
INJECT_GETSELECTEDADDRESS:
db 39 00 8B 40 18

dealloc(newmem)

unregistersymbol(pSelected_Unit_Address)
unregistersymbol(INJECT_Get_Visuable_Address)


</AssemblerScript>
      <Hotkeys>
        <Hotkey>
          <Action>Toggle Activation</Action>
          <Keys>
            <Key>120</Key>
          </Keys>
          <ID>0</ID>
        </Hotkey>
      </Hotkeys>
      <CheatEntries>
        <CheatEntry>
          <ID>7</ID>
          <Description>"Health selected unit (F11 Freeze + increase)"</Description>
          <LastState Value="230" Activated="0" RealAddress="0FA382D8"/>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>pSelected_Unit_Address</Address>
          <Offsets>
            <Offset>18</Offset>
          </Offsets>
          <Hotkeys>
            <Hotkey>
              <Action>Toggle Activation Allow Increase</Action>
              <Keys>
                <Key>122</Key>
              </Keys>
              <ID>0</ID>
            </Hotkey>
          </Hotkeys>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>9</ID>
      <Description>"Unlimited Ammo (Both sides) (F10)"</Description>
      <LastState Activated="1"/>
      <Color>80000008</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
alloc(newmem,1000)

aobscan(aobammo, 89 45 F4 89 7E 0C)

label(returnhere)
label(exit)
label(originalcode)
label(INJECT_Unlimited_Ammo_Address)

registersymbol(INJECT_Unlimited_Ammo_Address)

newmem:
  db 90 90 90 90 90 90

//code starts here
label(codestart)
codestart:
exit:
  jmp returnhere

originalcode:

//Code injected into the game
aobammo:
  INJECT_Unlimited_Ammo_Address:
  jmp newmem
  nop
returnhere:

[DISABLE]
INJECT_Unlimited_Ammo_Address:
  db 89 45 F4 89 7E 0C

  dealloc(newmem)
  unregistersymbol(INJECT_Unlimited_Ammo_Address)

//1A70FF27 - 8B 4E 0C              - mov ecx,[esi+0C]
//1A70FF2A - 8B C7                 - mov eax,edi
//1A70FF2C - 2B C1                 - sub eax,ecx
//1A70FF2E - 89 45 F4              - mov [ebp-0C],eax
//1A70FF31 - 89 7E 0C              - mov [esi+0C],edi
//1A70FF34 - 8D 65 F8              - lea esp,[ebp-08]

</AssemblerScript>
      <Hotkeys>
        <Hotkey>
          <Action>Toggle Activation</Action>
          <Keys>
            <Key>121</Key>
          </Keys>
          <ID>0</ID>
        </Hotkey>
      </Hotkeys>
    </CheatEntry>
  </CheatEntries>
  <CheatCodes>
    <CodeEntry>
      <Description>Change of mov eax,[ebx+18]</Description>
      <Address>1A0290C0</Address>
      <ModuleName/>
      <ModuleNameOffset>0</ModuleNameOffset>
      <Before>
        <Byte>43</Byte>
        <Byte>18</Byte>
        <Byte>89</Byte>
        <Byte>45</Byte>
        <Byte>F8</Byte>
      </Before>
      <Actual>
        <Byte>8B</Byte>
        <Byte>43</Byte>
        <Byte>18</Byte>
      </Actual>
      <After>
        <Byte>2B</Byte>
        <Byte>45</Byte>
        <Byte>10</Byte>
        <Byte>CC</Byte>
        <Byte>43</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of mov eax,[ebx+18]</Description>
      <Address>1A0290BA</Address>
      <ModuleName/>
      <ModuleNameOffset>0</ModuleNameOffset>
      <Before>
        <Byte>EC</Byte>
        <Byte>14</Byte>
        <Byte>8B</Byte>
        <Byte>5D</Byte>
        <Byte>08</Byte>
      </Before>
      <Actual>
        <Byte>8B</Byte>
        <Byte>43</Byte>
        <Byte>18</Byte>
      </Actual>
      <After>
        <Byte>89</Byte>
        <Byte>45</Byte>
        <Byte>F8</Byte>
        <Byte>8B</Byte>
        <Byte>43</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of sub esp,14</Description>
      <Address>1A0290B4</Address>
      <ModuleName/>
      <ModuleNameOffset>0</ModuleNameOffset>
      <Before>
        <Byte>00</Byte>
        <Byte>55</Byte>
        <Byte>8B</Byte>
        <Byte>EC</Byte>
        <Byte>53</Byte>
      </Before>
      <Actual>
        <Byte>83</Byte>
        <Byte>EC</Byte>
        <Byte>14</Byte>
      </Actual>
      <After>
        <Byte>8B</Byte>
        <Byte>5D</Byte>
        <Byte>08</Byte>
        <Byte>8B</Byte>
        <Byte>43</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of sub eax,[ebp+10]</Description>
      <Address>1A79B3DB</Address>
      <ModuleName/>
      <ModuleNameOffset>0</ModuleNameOffset>
      <Before>
        <Byte>45</Byte>
        <Byte>F8</Byte>
        <Byte>8B</Byte>
        <Byte>43</Byte>
        <Byte>18</Byte>
      </Before>
      <Actual>
        <Byte>2B</Byte>
        <Byte>45</Byte>
        <Byte>10</Byte>
      </Actual>
      <After>
        <Byte>89</Byte>
        <Byte>43</Byte>
        <Byte>18</Byte>
        <Byte>85</Byte>
        <Byte>C0</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of sub eax,ecx</Description>
      <Address>1A70FF2C</Address>
      <ModuleName/>
      <ModuleNameOffset>0</ModuleNameOffset>
      <Before>
        <Byte>8B</Byte>
        <Byte>4E</Byte>
        <Byte>0C</Byte>
        <Byte>8B</Byte>
        <Byte>C7</Byte>
      </Before>
      <Actual>
        <Byte>2B</Byte>
        <Byte>C1</Byte>
      </Actual>
      <After>
        <Byte>89</Byte>
        <Byte>45</Byte>
        <Byte>F4</Byte>
        <Byte>89</Byte>
        <Byte>7E</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of mov [ebp-0C],eax</Description>
      <Address>0EE14E16</Address>
      <ModuleName/>
      <ModuleNameOffset>0</ModuleNameOffset>
      <Before>
        <Byte>0C</Byte>
        <Byte>8B</Byte>
        <Byte>C7</Byte>
        <Byte>2B</Byte>
        <Byte>C1</Byte>
      </Before>
      <Actual>
        <Byte>89</Byte>
        <Byte>45</Byte>
        <Byte>F4</Byte>
      </Actual>
      <After>
        <Byte>89</Byte>
        <Byte>7E</Byte>
        <Byte>0C</Byte>
        <Byte>8D</Byte>
        <Byte>65</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Change of mov [esi+0C],edi</Description>
      <Address>0EE14E19</Address>
      <ModuleName/>
      <ModuleNameOffset>0</ModuleNameOffset>
      <Before>
        <Byte>2B</Byte>
        <Byte>C1</Byte>
        <Byte>89</Byte>
        <Byte>45</Byte>
        <Byte>F4</Byte>
      </Before>
      <Actual>
        <Byte>89</Byte>
        <Byte>7E</Byte>
        <Byte>0C</Byte>
      </Actual>
      <After>
        <Byte>8D</Byte>
        <Byte>65</Byte>
        <Byte>F8</Byte>
        <Byte>5E</Byte>
        <Byte>5F</Byte>
      </After>
    </CodeEntry>
  </CheatCodes>
  <UserdefinedSymbols>
    <SymbolEntry>
      <Name>aobUnitBaseGrabber_r</Name>
      <Address>19D6A8F0</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pLastUnitClicked</Name>
      <Address>0C430010</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>INJECT_GETVISUABLEADDRESS</Name>
      <Address>1A75F7A0</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>Unit_Address</Name>
      <Address>08EC0010</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>INJECT_GETSELECTEDADDRESS</Name>
      <Address>1A040F08</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pSelected_Unit_Address</Name>
      <Address>04740000</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>INJECT_Unlimited_Ammo_Address</Name>
      <Address>1A024516</Address>
    </SymbolEntry>
  </UserdefinedSymbols>
  <LuaScript>resetLuaState()

function Attach()
  if getProcessIDFromProcessName("BattleWorldsKronos.exe") then
    openProcess("BattleWorldsKronos.exe")
  else
    showMessage("Battle Worlds Kronos not found!!")
  end
end

function Heal()
  errorOnLookupFailure(false)
  local cheattable = getAddressList()
  local HealthEntry = addresslist_getMemoryRecordByDescription(cheattable,"Health selected unit (F11 Freeze + increase)")
  local ActHealthStr = memoryrecord_getValue(HealthEntry)
  local ActHealth = tonumber(ActHealthStr)
  ActHealth = ActHealth + 10
  memoryrecord_setValue(HealthEntry,ActHealth)
end

Attach()
createHotkey(Heal, VK_F12)

</LuaScript>
</CheatTable>
