<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="26">
  <CheatEntries>
    <CheatEntry>
      <ID>12573</ID>
      <Description>"Walk key"</Description>
      <Options moHideChildren="1"/>
      <LastState/>
      <Color>FF0000</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
aobscanmodule(runSpeedCalOnRunAOB,ROTTR.exe,F3 0F 58 ** ** 41 0F 2F C8 F3 0F 11 ** ** 76 ** C7 ** ** ** ** ** ** 48)
registersymbol(runSpeedCalOnRunAOB)

label(bWalkKeyPressed)
registersymbol(bWalkKeyPressed)
label(bWalkKeyID)
registersymbol(bWalkKeyID)
label(dCustMaxSpeed)
registersymbol(dCustMaxSpeed)

alloc(newmem,2048,runSpeedCalOnRunAOB+5) //"ROTTR.exe"+372D0A2)
label(returnhere)
label(originalcode_walkkey)
registersymbol(originalcode_walkkey)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov rdx,bWalkKeyPressed
cmp byte ptr [rdx],1
jne @f
mov rdx,dCustMaxSpeed
movss xmm8,[rdx]

originalcode_walkkey:
readmem(runSpeedCalOnRunAOB+5,9)
//comiss xmm1,xmm8
//movss [rdi+1C],xmm1

exit:
jmp returnhere

///
bWalkKeyPressed:
dd 0
bWalkKeyID:
dd 12 //Alt key
dCustMaxSpeed:
dd (float)0.64
///

runSpeedCalOnRunAOB+5: //"ROTTR.exe"+372D0A2:
jmp newmem
nop
nop
nop
nop
returnhere:

///****************************************///
alloc(newmem2,2048,runSpeedCalOnRunAOB+10) //"ROTTR.exe"+372D0AD)
label(returnhere2)
label(originalcode2_walkkey)
registersymbol(originalcode2_walkkey)
label(exit2)

newmem2: //this is allocated memory, you have read,write,execute access
//place your code here
db F3 44 0F 11
readmem(runSpeedCalOnRunAOB+11,2)
//movss [rdi+1c],xmm8
jmp exit2

originalcode2_walkkey:
readmem(runSpeedCalOnRunAOB+10,7)
//mov [rdi+1C],3F800000

exit2:
jmp returnhere2

///

runSpeedCalOnRunAOB+10: //"ROTTR.exe"+372D0AD:
jmp newmem2
nop
nop
returnhere2:

///****************************************///
label(bEndThread_walkKeylistener_mem)
registersymbol(bEndThread_walkKeylistener_mem)

alloc(walkKeylistener_mem,2048,"ROTTR.exe")
registersymbol(walkKeylistener_mem)
createthread(walkKeylistener_mem)
label(keylistenerstart)
label(keylistenerend)
label(keylistenerexit)

walkKeylistener_mem:
sub rsp,28
push rax

keylistenerstart:
mov rcx,bWalkKeyID
movzx rcx,byte ptr [rcx]
//mov rcx,14 //CAPS LOCK key       //12 //ALT key
push rcx
call GetAsyncKeyState
add rsp,08
shr ax,#15
mov rcx,bWalkKeyPressed
mov [rcx],al

keylistenerend:
mov rcx,#100
call Sleep
cmp dword ptr [bEndThread_walkKeylistener_mem],1
jne keylistenerstart

keylistenerexit:
pop rax
add rsp,28
mov dword ptr [bEndThread_walkKeylistener_mem],2
ret

///
bEndThread_walkKeylistener_mem:
dd 0
///




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
//obtained from SubBeam's ACS script - start//
{$lua}

if( syntaxcheck == false ) then --actual execution
  local starttime = getTickCount()

if readInteger( "bEndThread_walkKeylistener_mem" ) == 0 then --could be 2 already
  writeInteger( "bEndThread_walkKeylistener_mem", 1 ) --tell the thread to kill itself
end

while( getTickCount() &lt; starttime + 1000 ) and ( readInteger( "bEndThread_walkKeylistener_mem" ) ~=2 ) do --wait till it has finished
  sleep( 20 )
end

if( getTickCount() &gt; starttime + 1000 ) then --could happen when the window is shown
  showMessage( 'Disabling the thread failed!' )
  error( 'Thread disabling failed!' )
end
  sleep( 1 )
end

{$asm}
//obtained from SubBeam's ACS script - end//

//bEndThread_walkKeylistener_mem:
//dd 1

///****************************************///
dealloc(newmem)
runSpeedCalOnRunAOB+5: //"ROTTR.exe"+372D0A2:
readmem(originalcode_walkkey,9)
//db 41 0F 2F C8 F3 0F 11 4F 1C
//Alt: comiss xmm1,xmm8
//Alt: movss [rdi+1C],xmm1
unregistersymbol(originalcode_walkkey)

unregistersymbol(bWalkKeyPressed)
unregistersymbol(bWalkKeyID)
unregistersymbol(dCustMaxSpeed)

///****************************************///
dealloc(newmem2)
runSpeedCalOnRunAOB+10: //"ROTTR.exe"+372D0AD:
readmem(originalcode2_walkkey,7)
//db C7 47 1C 00 00 80 3F
//Alt: mov [rdi+1C],3F800000
unregistersymbol(originalcode2_walkkey)

///****************************************///
unregistersymbol(bEndThread_walkKeylistener_mem)

dealloc(walkKeylistener_mem)
unregistersymbol(walkKeylistener_mem)
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>12575</ID>
          <Description>"Key"</Description>
          <DropDownList DescriptionOnly="1" DisplayValueAsItem="1">10:SHIFT key
11:CTRL key
12:ALT key
14:CAPS LOCK key
</DropDownList>
          <ShowAsHex>1</ShowAsHex>
          <Color>008000</Color>
          <VariableType>Byte</VariableType>
          <Address>bWalkKeyID</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>12576</ID>
          <Description>"Speed"</Description>
          <Color>008000</Color>
          <VariableType>Float</VariableType>
          <Address>dCustMaxSpeed</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <Comments>https://fearlessrevolution.com/threads/tomb-raider-2013-rise-of-the-tomb-raider-better-walk-key.7104/</Comments>
</CheatTable>
