<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>37</ID>
      <Description>"----------------------------------------------"</Description>
      <Color>FFFF80</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
    <CheatEntry>
      <ID>35</ID>
      <Description>"- Alice: Madness Returns for EA"</Description>
      <Color>FFFF80</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
    <CheatEntry>
      <ID>36</ID>
      <Description>"- Antic Owl"</Description>
      <Color>FFFF80</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
    <CheatEntry>
      <ID>4027</ID>
      <Description>"- See Table Extra for info"</Description>
      <Color>FFFF80</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
    <CheatEntry>
      <ID>34</ID>
      <Description>"----------------------------------------------"</Description>
      <Color>FFFF80</Color>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
    <CheatEntry>
      <ID>8397</ID>
      <Description>"Auto Attach To Game"</Description>
      <Color>0000FF</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
[ENABLE]

local processName = "AliceMadnessReturns.exe"
local function onTimer_Tick(timer)
  if readInteger(processName) == nil then
    local processId = getProcessIDFromProcessName(processName)
    if processId and processId ~= getOpenedProcessID() then
      openProcess(processId)
    end
  end
end
local autoAttachTimer = createTimer(getMainForm(), true)
autoAttachTimer.Interval = 1000
autoAttachTimer.OnTimer = onTimer_Tick

[DISABLE]

</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>26237</ID>
      <Description>"Camera Structure - Leave On"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
//Camera AOB
aobscanmodule(Camera,AliceMadnessReturns.exe,8B BA 7C 04 00 00 83 3C 8F) // should be unique
alloc(Camnewmem,$1000,Camera)

label(Camcode)
label(Camreturn)
label(pCamera)

Camnewmem:
  mov [pCamera], edx

Camcode:
  mov edi,[edx+0000047C]
  jmp Camreturn

pCamera:
  dq 0

Camera:
  jmp Camnewmem
  nop

Camreturn:
registersymbol(Camera)
registersymbol(pCamera)

//Slomo AOB

aobscanmodule(Slomo,AliceMadnessReturns.exe,F3 0F 10 81 BC 03 00 00) // should be unique
alloc(Slomonewmem,$1000,Slomo)

label(Slomocode)
label(Slomoreturn)
label(pSlomo)

Slomonewmem:
  mov [pSlomo],ecx

Slomocode:
  movss xmm0,[ecx+3BC]
  jmp Slomoreturn

align 4
pSlomo:
  dd 0

Slomo:
  jmp Slomonewmem
  nop 3

Slomoreturn:
registersymbol(Slomo)
registersymbol(pSlomo)

{$lua}
function getCamBase()
    local base = getAddressSafe("pCamera")
    if not base then return nil end

    local addr = readPointer(base)
    if not addr then return nil end
    addr = readPointer(addr + 0x47C)
    if not addr then return nil end
    addr = readPointer(addr + 0x0)
    if not addr then return nil end
    addr = readPointer(addr + 0x40)
    if not addr then return nil end
    addr = readPointer(addr + 0x3C8)
    if not addr then return nil end

    return addr
end

function toDegrees(v)
    return (v / 32768) * 180
end

speedFast  = 7
speedSlow  = 2
speedSlow2 = 0.5

function checkKeys()
    local cam = getCamBase()
    if not cam then return end

if getOpenedProcessID() == getForegroundProcess() then


    -- Key Speed
    local speed = speedFast
    if isKeyPressed(VK_LCONTROL) then speed = speedSlow end
    if isKeyPressed(VK_LMENU)   then speed = speedSlow2 end

    -- rotations
    local pitchI = readInteger(cam + 0x378)
    local yawI   = readInteger(cam + 0x37C)
    local rollI  = readInteger(cam + 0x380)

    local pitch = math.rad(toDegrees(pitchI))
    local yaw   = math.rad(toDegrees(yawI))

    -- position
    local x = readFloat(cam + 0x36C)
    local y = readFloat(cam + 0x370)
    local z = readFloat(cam + 0x374)

    -- fov
    local fov = readFloat(cam + 0x384)

    local siny = math.sin(yaw)
    local cosy = math.cos(yaw)

    -- Forward
    if isKeyPressed(VK_NUMPAD8) then
        writeFloat(cam + 0x36C, x + (cosy * speed))
        writeFloat(cam + 0x370, y + (siny * speed))
    end

    -- Backward
    if isKeyPressed(VK_NUMPAD5) then
        writeFloat(cam + 0x36C, x - (cosy * speed))
        writeFloat(cam + 0x370, y - (siny * speed))
    end

    -- Left
    if isKeyPressed(VK_NUMPAD4) then
        writeFloat(cam + 0x36C, x + math.cos(yaw - math.rad(90)) * speed)
        writeFloat(cam + 0x370, y + math.sin(yaw - math.rad(90)) * speed)
    end

    -- Right
    if isKeyPressed(VK_NUMPAD6) then
        writeFloat(cam + 0x36C, x - math.cos(yaw - math.rad(90)) * speed)
        writeFloat(cam + 0x370, y - math.sin(yaw - math.rad(90)) * speed)
    end

    -- Up / Down
    if isKeyPressed(VK_NUMPAD7) then
        writeFloat(cam + 0x374, z + speed)
    end
    if isKeyPressed(VK_NUMPAD9) then
        writeFloat(cam + 0x374, z - speed)
    end

    -- Pitch
    if isKeyPressed(VK_UP)    then writeInteger(cam + 0x378, pitchI + (speed * 40)) end
    if isKeyPressed(VK_DOWN)  then writeInteger(cam + 0x378, pitchI - (speed * 40)) end

    -- Yaw
    if isKeyPressed(VK_LEFT)  then writeInteger(cam + 0x37C, yawI   - (speed * 40)) end
    if isKeyPressed(VK_RIGHT) then writeInteger(cam + 0x37C, yawI   + (speed * 40)) end

    -- Roll
    if isKeyPressed(VK_NUMPAD1) then writeInteger(cam + 0x380, rollI - (speed * 20)) end
    if isKeyPressed(VK_NUMPAD3) then writeInteger(cam + 0x380, rollI + (speed * 20)) end

    -- FOV
    if isKeyPressed(VK_ADD)      then writeFloat(cam + 0x384, fov - (speed * 0.5)) end
    if isKeyPressed(VK_SUBTRACT) then writeFloat(cam + 0x384, fov + (speed * 0.5)) end
end
end

if camTimer then camTimer.destroy() end

camTimer = createTimer()
camTimer.Interval = 10
camTimer.OnTimer = checkKeys


{$asm}
[DISABLE]
Slomo:
  db F3 0F 10 81 BC 03 00 00

Camera:
  db 8B BA 7C 04 00 00

unregistersymbol(*)
dealloc(*)

{$lua}
if freecamTimer then
    freecamTimer.destroy()
    freecamTimer = nil
end
</AssemblerScript>
      <Hotkeys>
        <Hotkey>
          <Action>Toggle Activation</Action>
          <Keys>
            <Key>34</Key>
          </Keys>
          <ID>0</ID>
        </Hotkey>
      </Hotkeys>
      <CheatEntries>
        <CheatEntry>
          <ID>26227</ID>
          <Description>"X"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>Float</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>36C</Offset>
            <Offset>3C8</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>26228</ID>
          <Description>"Y"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>Float</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>370</Offset>
            <Offset>3C8</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>26229</ID>
          <Description>"Z"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>Float</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>374</Offset>
            <Offset>3C8</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>26230</ID>
          <Description>"Pitch"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>378</Offset>
            <Offset>3C8</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>26231</ID>
          <Description>"Yaw"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>37C</Offset>
            <Offset>3C8</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>26232</ID>
          <Description>"Roll"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>4 Bytes</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>380</Offset>
            <Offset>3C8</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>26233</ID>
          <Description>"FOV"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>Float</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>384</Offset>
            <Offset>3C8</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>26242</ID>
      <Description>"Disable HUD"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
local hud = getAddressSafe("[[[[[pCamera]+47C]+0]+40]+42C]+23C", false, false)
writeInteger(hud, 0)

{$asm}
[DISABLE]
{$lua}
local hud = getAddressSafe("[[[[[pCamera]+47C]+0]+40]+42C]+23C", false, false)
writeInteger(hud, 2)

</AssemblerScript>
      <Hotkeys>
        <Hotkey>
          <Action>Toggle Activation</Action>
          <Keys>
            <Key>46</Key>
          </Keys>
          <ID>0</ID>
        </Hotkey>
      </Hotkeys>
    </CheatEntry>
    <CheatEntry>
      <ID>26254</ID>
      <Description>"Slomo Value"</Description>
      <ShowAsSigned>0</ShowAsSigned>
      <VariableType>Float</VariableType>
      <Address>pSlomo</Address>
      <Offsets>
        <Offset>3BC</Offset>
      </Offsets>
      <Hotkeys>
        <Hotkey>
          <Action>Set Value</Action>
          <Keys>
            <Key>119</Key>
          </Keys>
          <Value>1</Value>
          <ID>0</ID>
        </Hotkey>
        <Hotkey>
          <Action>Set Value</Action>
          <Keys>
            <Key>118</Key>
          </Keys>
          <Value>0.3</Value>
          <ID>1</ID>
        </Hotkey>
        <Hotkey>
          <Action>Set Value</Action>
          <Keys>
            <Key>117</Key>
          </Keys>
          <Value>0.15</Value>
          <ID>2</ID>
        </Hotkey>
      </Hotkeys>
    </CheatEntry>
    <CheatEntry>
      <ID>26255</ID>
      <Description>"God Mode"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
local god = getAddressSafe("[[[[pCamera]+47C]+0]+40]+23C", false, false)
writeByte(god, 23)

{$asm}
[DISABLE]
{$lua}
local god = getAddressSafe("[[[[pCamera]+47C]+0]+40]+23C", false, false)
writeByte(god, 21)

</AssemblerScript>
      <Hotkeys>
        <Hotkey>
          <Action>Toggle Activation</Action>
          <Keys>
            <Key>35</Key>
          </Keys>
          <ID>0</ID>
        </Hotkey>
      </Hotkeys>
      <CheatEntries>
        <CheatEntry>
          <ID>26252</ID>
          <Description>"God Mode"</Description>
          <ShowAsSigned>0</ShowAsSigned>
          <VariableType>Byte</VariableType>
          <Address>pCamera</Address>
          <Offsets>
            <Offset>23C</Offset>
            <Offset>40</Offset>
            <Offset>0</Offset>
            <Offset>47C</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
</CheatTable>
