<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="52">
  <Files>
    <File Name="launchgame.dat" Encoding="Ascii85">i*3J62,qhaOU=1l%S[KG)MzpJ/#M**arbvua8JxlEslZ6DnO)aLW*uoi%W{AfefH/42D))uC(CQ.#3F.00</File>
  </Files>
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"Activate First"</Description>
      <Options moHideChildren="1" moDeactivateChildrenAsWell="1"/>
      <Color>000000</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$LUA}
if syntaxcheck then return end

[ENABLE]
-- Try to Open Process
if process == nil or readInteger(process) == 0 then
  local timer = createTimer()
  local processName = 'ShovelKnight.exe'

  timer.Interval = 1000
  timer.OnTimer = function()
    if getProcessIDFromProcessName(processName) or memrec.Active == false then
      openProcess(processName)
      timer.destroy()
    end
  end
end

hackingPoints = {}
local function updateHackingPoint(address, symbol, record)
  if address then
    registerSymbol(symbol, address)
    table.insert(hackingPoints, symbol)

    if record then
      record.Color = 0x00FF00 -- Green
    end
  elseif record then
    record.Color = 0x0000FF -- Red
  end
end

-- Infinite Health
local aobstring = 'D9 5D 0C D9 46 20 D8 65 0C D9 5D 0C D9 45 0C D9 56 20'
local lifeHack = AOBScanModuleUnique('ShovelKnight.exe', aobstring)
local record = AddressList.getMemoryRecordByDescription('Infinite Health')
updateHackingPoint(lifeHack, 'lifeHack', record)

-- Invincibility


-- Infinite Jump


-- Infinite Magic
aobstring = '88 86 E0 0E 00 00 5E 5D C2'
local itemHack = AOBScanModuleUnique('ShovelKnight.exe', aobstring)
record = AddressList.getMemoryRecordByDescription('Infinite Magic')
updateHackingPoint(itemHack, 'itemHack', record)

-- Edit Money
aobstring = '8B 81 E4 0E 00 00 C3'
local goldHack = AOBScanModuleUnique('ShovelKnight.exe', aobstring)
record = AddressList.getMemoryRecordByDescription('Edit Money')
updateHackingPoint(goldHack, 'goldHack', record)


[DISABLE]
for index, symbol in ipairs(hackingPoints) do
    unregisterSymbol(symbol)
end

for i = 0, AddressList.Count - 1 do
  AddressList[i].Color = 'clWindowText'
end

if readInteger(process) == 0 then
  for i = 0, AddressList.Count - 1 do
      local record = AddressList.getMemoryRecord(i)
      if record.Type == vtAutoAssembler and record.Active then
          record.Active = false
      end
  end
end

</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>1</ID>
          <Description>"Infinite Health"</Description>
          <Color>000000</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$LUA}
if syntaxcheck then return end
if not getAddressSafe('lifeHack') then
  showMessage('AOB Scan for Infinite Health not found!')
  error()
end
{$ASM}
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(infiniteHealth,2048)
label(returnhere)
label(exit)

infiniteHealth:
cmp ebx, 1 // Check if Player
je @f

// Original Code for the Enemy
fstp dword ptr [ebp+0C]
fld dword ptr [esi+20]
fsub dword ptr [ebp+0C]
fstp dword ptr [ebp+0C]
fld dword ptr [ebp+0C]
fst dword ptr [esi+20]

jmp exit

// Cheat
@@:
fstp st(0) // Pop the first value on the stack
fld dword ptr [esi+24] // Place Max Health on the stack
fst dword ptr [ebp+0C] // Load Max Health onto Changed Health
fst dword ptr [esi+20] // Load Max Health onto Current Health

exit:
jmp returnhere

lifeHack:
jmp infiniteHealth
nop D
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(infiniteHealth)
lifeHack:
db D9 5D 0C D9 46 20 D8 65 0C D9 5D 0C D9 45 0C D9 56 20
//fstp dword ptr [ebp+0C]
//fld dword ptr [esi+20]
//fsub dword ptr [ebp+0C]
//fstp dword ptr [ebp+0C]
//fld dword ptr [ebp+0C]
//fst dword ptr [esi+20]

</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>2</ID>
          <Description>"Infinite Magic"</Description>
          <Color>000000</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$LUA}
if syntaxcheck then return end
if not getAddressSafe('itemHack') then
  showMessage("AOB Scan for Infinite Magic not found!")
  error()
end
{$ASM}

itemHack:
db 90 90 90 90 90 90

[DISABLE]
itemHack:
db 88 86 E0 0E 00 00
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>3</ID>
          <Description>"Edit Money"</Description>
          <Options moHideChildren="1" moDeactivateChildrenAsWell="1"/>
          <Color>000000</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$LUA}
if syntaxcheck then return end
if not getAddressSafe('goldHack') then
  showMessage('AOB Scan for Edit Money not found!')
  error()
end
{$ASM}

alloc(newmem,256)
label(returnhere)
label(originalcode)
label(exit)

alloc(pMoney, 8)
registersymbol(pMoney)

newmem:
mov [pMoney], ecx
add [pMoney], EE4

originalcode:
mov eax,[ecx+00000EE4]

exit:
jmp returnhere

goldHack:
jmp newmem
nop
returnhere:




[DISABLE]
dealloc(newmem)
dealloc(pMoney)
unregistersymbol(pMoney)
goldHack:
db 8B 81 E4 0E 00 00
//mov eax,[ecx+00000EE4]
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>4</ID>
              <Description>"Money"</Description>
              <ShowAsSigned>0</ShowAsSigned>
              <Color>000000</Color>
              <VariableType>4 Bytes</VariableType>
              <Address>pMoney</Address>
              <Offsets>
                <Offset>0</Offset>
              </Offsets>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <CheatCodes>
    <CodeEntry>
      <Description>Code :fst dword ptr [esi+20] -- Life</Description>
      <AddressString>ShovelKnight.exe+33BE35</AddressString>
      <Before>
        <Byte>5D</Byte>
        <Byte>0C</Byte>
        <Byte>D9</Byte>
        <Byte>45</Byte>
        <Byte>0C</Byte>
      </Before>
      <Actual>
        <Byte>D9</Byte>
        <Byte>56</Byte>
        <Byte>20</Byte>
      </Actual>
      <After>
        <Byte>D9</Byte>
        <Byte>EE</Byte>
        <Byte>D8</Byte>
        <Byte>D1</Byte>
        <Byte>DF</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Code :mov [esi+00000EE0],al -- ITEM</Description>
      <AddressString>ShovelKnight.exe+62059A</AddressString>
      <Before>
        <Byte>C2</Byte>
        <Byte>04</Byte>
        <Byte>00</Byte>
        <Byte>2A</Byte>
        <Byte>C1</Byte>
      </Before>
      <Actual>
        <Byte>88</Byte>
        <Byte>86</Byte>
        <Byte>E0</Byte>
        <Byte>0E</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </Actual>
      <After>
        <Byte>5E</Byte>
        <Byte>5D</Byte>
        <Byte>C2</Byte>
        <Byte>04</Byte>
        <Byte>00</Byte>
      </After>
    </CodeEntry>
    <CodeEntry>
      <Description>Code :mov eax,[ecx+00000EE4] -- Gold</Description>
      <AddressString>ShovelKnight.exe+620492</AddressString>
      <Before>
        <Byte>00</Byte>
        <Byte>8B</Byte>
        <Byte>C8</Byte>
        <Byte>75</Byte>
        <Byte>DE</Byte>
      </Before>
      <Actual>
        <Byte>8B</Byte>
        <Byte>81</Byte>
        <Byte>E4</Byte>
        <Byte>0E</Byte>
        <Byte>00</Byte>
        <Byte>00</Byte>
      </Actual>
      <After>
        <Byte>C3</Byte>
        <Byte>B9</Byte>
        <Byte>38</Byte>
        <Byte>EC</Byte>
        <Byte>EC</Byte>
      </After>
    </CodeEntry>
  </CheatCodes>
  <UserdefinedSymbols/>
</CheatTable>
